Original Submission chart-layout-builder, the service used to generate the graphs layout has too much responsibilities. It:
- Draws the svg container
- Initializes the axes
- Draws the axes
- Draws the graph's legend
- Format the x-axis labels
The problem today is that it is difficult to customize the layout regarding of the type of graph we want to draw. For instance, We can't draw a graph without a legend and a badge. Moreover, the labels formatting is design to format labels from time scales, and is not compatible with bar charts (which can display whatever they need o display on the x-axis other than a date -> cf. velocity chart -> sprints names).
The current architectures makes the layout-builder a god object we have to adapt to. The new architecture will have to be the opposite situation: The layout can be adapted to the graphs needs: legend or not, formatted x-axis labels or not etc.
The refactoring has to be done in 3 steps:
1. Extract the labels formatting for time scales in a dedicated class
2. Extract the legend generator in a dedicated class
3. Turn chart-builder into a ES6 class
No functional change has been planned.