stable
Clone or download
Given a gantt chart with at least two tasks, with a dependency from a task to the last one, When we display the dependencies, Then a vertical scrollbar appears at the right of the chart. π Context ======= As explain in commit ["Introduce arrows for dependencies"][0], we use a safety gap to ensure that path, arrows, half turn can be displayed. ``` svg ββββββββββββββββββββββββββββββ β β β β β ββββββββββββββββββββββ β β β β β β β βββββββββββββββββββββββββ β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β | gap β β β β β v β βββΆββββββββββββββββββββ---------+- β | β | β | β | ββββββββββββββββββββββββ|βββββ----+- | | gap | | ----->+----+ | | ``` We chose an arbitrary value of 2 Γ offset + radius to have enough room. If we zoom in: ``` gap βββββββββββββββββββββΆβ β β βoffset radius offsetβ βββββββΆβββββββΆβββββββΆβ β β β β β β β β β β β β ββββββββββ β β ββ β β β β β ββ β ββ β β β β β β β β β ``` Problem ======= The extra offset is a wasted space, but most important, it adds unecessary height to the svg graph, producing a scroll overflow when the arrow start from or points to the last task of the graph. Since the arrow is positionned at the middle of the task bar, the gap should be lesser than the half of the height of the task. For example, until now, gap was 24 (2 Γ 8 + 8) while the height of the task is 40: 24 > 40/2 => meh βΉοΈ. ``` β β ββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β β Κ β β β β βββββββββββββββββββββ | β task #123 β β -----βββΆβββββββββββββββββββββ | Task height β β β Κ βββββββββββββββββββββ | β β β |gap v βββββββββββββ©ββββββββ|βββββββββββββββββββββββββββββββββββββββββββ β v ββββββββββββββββββββ svg ``` Solution ======== The proposal is to remove the extra offset from the gap (but keep 1px room for the display of the line): ``` gap βββββββββββββββΆβ β β βoffset radius β βββββββΆβββββββΆββ β β ββ β β ββ β β ββ ββββββββββββ ββ ββ ββ β ββ βββ βββ ββ ββ ββ β β ``` With the current settings we have now: gap = offset + radius + 1 = 17 wich is less than 40/2 => no moar scrollbar π Part of story #19734: have a Roadmap widget on dashboard [0]: git #tuleap/stable/acb60c4c1af35694ed8fbc1f17a0e29435f8c922 Change-Id: I1cbb785faca14bfd4c67a67de153669f6a61c37b
Modified Files
Name | ||||
---|---|---|---|---|
M | plugins/roadmap/scripts/roadmap-widget/src/components/Gantt/Task/DependencyArrow.test.ts | +24 | β24 | Go to diff View file |
M | plugins/roadmap/scripts/roadmap-widget/src/helpers/path.test.ts | +16 | β11 | Go to diff View file |
M | plugins/roadmap/scripts/roadmap-widget/src/helpers/path.ts | +1 | β1 | Go to diff View file |
M | plugins/roadmap/scripts/roadmap-widget/src/helpers/svg-arrow-path.test.ts | +6 | β6 | Go to diff View file |