@nowline/layout 0.8.5 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/axis-columns.d.ts +70 -0
- package/dist/axis-columns.d.ts.map +1 -0
- package/dist/axis-columns.js +104 -0
- package/dist/axis-columns.js.map +1 -0
- package/dist/band-scale.d.ts.map +1 -1
- package/dist/calendar-resolver.d.ts +27 -0
- package/dist/calendar-resolver.d.ts.map +1 -0
- package/dist/calendar-resolver.js +132 -0
- package/dist/calendar-resolver.js.map +1 -0
- package/dist/calendar.d.ts +0 -19
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +4 -44
- package/dist/calendar.js.map +1 -1
- package/dist/canvas-width.d.ts +23 -0
- package/dist/canvas-width.d.ts.map +1 -0
- package/dist/canvas-width.js +26 -0
- package/dist/canvas-width.js.map +1 -0
- package/dist/capacity.d.ts +28 -0
- package/dist/capacity.d.ts.map +1 -1
- package/dist/capacity.js +64 -29
- package/dist/capacity.js.map +1 -1
- package/dist/chart-translation.d.ts +22 -0
- package/dist/chart-translation.d.ts.map +1 -0
- package/dist/chart-translation.js +83 -0
- package/dist/chart-translation.js.map +1 -0
- package/dist/container-header-geometry.d.ts +64 -0
- package/dist/container-header-geometry.d.ts.map +1 -0
- package/dist/container-header-geometry.js +89 -0
- package/dist/container-header-geometry.js.map +1 -0
- package/dist/dsl-utils.d.ts +3 -4
- package/dist/dsl-utils.d.ts.map +1 -1
- package/dist/dsl-utils.js +8 -25
- package/dist/dsl-utils.js.map +1 -1
- package/dist/edge-routing.d.ts +69 -78
- package/dist/edge-routing.d.ts.map +1 -1
- package/dist/edge-routing.js +271 -401
- package/dist/edge-routing.js.map +1 -1
- package/dist/frame-tab-geometry.d.ts +24 -14
- package/dist/frame-tab-geometry.d.ts.map +1 -1
- package/dist/frame-tab-geometry.js +69 -23
- package/dist/frame-tab-geometry.js.map +1 -1
- package/dist/header-card-geometry.d.ts +12 -0
- package/dist/header-card-geometry.d.ts.map +1 -1
- package/dist/header-card-geometry.js +14 -2
- package/dist/header-card-geometry.js.map +1 -1
- package/dist/header-logo.d.ts +28 -0
- package/dist/header-logo.d.ts.map +1 -0
- package/dist/header-logo.js +51 -0
- package/dist/header-logo.js.map +1 -0
- package/dist/i18n.d.ts +11 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +11 -1
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +20 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/dist/inline-date-pin-geometry.d.ts +19 -11
- package/dist/inline-date-pin-geometry.d.ts.map +1 -1
- package/dist/inline-date-pin-geometry.js +45 -46
- package/dist/inline-date-pin-geometry.js.map +1 -1
- package/dist/item-bar-geometry.d.ts +192 -4
- package/dist/item-bar-geometry.d.ts.map +1 -1
- package/dist/item-bar-geometry.js +258 -5
- package/dist/item-bar-geometry.js.map +1 -1
- package/dist/item-port-geometry.d.ts +13 -0
- package/dist/item-port-geometry.d.ts.map +1 -0
- package/dist/item-port-geometry.js +63 -0
- package/dist/item-port-geometry.js.map +1 -0
- package/dist/layout-context.d.ts +115 -51
- package/dist/layout-context.d.ts.map +1 -1
- package/dist/layout-context.js +96 -5
- package/dist/layout-context.js.map +1 -1
- package/dist/layout-insights.d.ts.map +1 -1
- package/dist/layout-insights.js +73 -1
- package/dist/layout-insights.js.map +1 -1
- package/dist/layout.d.ts +35 -0
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +18 -1315
- package/dist/layout.js.map +1 -1
- package/dist/nodes/anchor-node.d.ts.map +1 -1
- package/dist/nodes/anchor-node.js +11 -4
- package/dist/nodes/anchor-node.js.map +1 -1
- package/dist/nodes/content-extent.d.ts +24 -0
- package/dist/nodes/content-extent.d.ts.map +1 -0
- package/dist/nodes/content-extent.js +100 -0
- package/dist/nodes/content-extent.js.map +1 -0
- package/dist/nodes/dependency-edges.d.ts +6 -0
- package/dist/nodes/dependency-edges.d.ts.map +1 -0
- package/dist/nodes/dependency-edges.js +148 -0
- package/dist/nodes/dependency-edges.js.map +1 -0
- package/dist/nodes/footnote-node.d.ts +24 -3
- package/dist/nodes/footnote-node.d.ts.map +1 -1
- package/dist/nodes/footnote-node.js +129 -25
- package/dist/nodes/footnote-node.js.map +1 -1
- package/dist/nodes/group-node.d.ts +10 -21
- package/dist/nodes/group-node.d.ts.map +1 -1
- package/dist/nodes/group-node.js +79 -154
- package/dist/nodes/group-node.js.map +1 -1
- package/dist/nodes/header-node.d.ts +56 -0
- package/dist/nodes/header-node.d.ts.map +1 -0
- package/dist/nodes/header-node.js +163 -0
- package/dist/nodes/header-node.js.map +1 -0
- package/dist/nodes/include-node.d.ts +22 -12
- package/dist/nodes/include-node.d.ts.map +1 -1
- package/dist/nodes/include-node.js +95 -62
- package/dist/nodes/include-node.js.map +1 -1
- package/dist/nodes/item-measure.d.ts +135 -0
- package/dist/nodes/item-measure.d.ts.map +1 -0
- package/dist/nodes/item-measure.js +514 -0
- package/dist/nodes/item-measure.js.map +1 -0
- package/dist/nodes/item-node.d.ts +162 -9
- package/dist/nodes/item-node.d.ts.map +1 -1
- package/dist/nodes/item-node.js +256 -69
- package/dist/nodes/item-node.js.map +1 -1
- package/dist/nodes/marker-band.d.ts +118 -0
- package/dist/nodes/marker-band.d.ts.map +1 -0
- package/dist/nodes/marker-band.js +303 -0
- package/dist/nodes/marker-band.js.map +1 -0
- package/dist/nodes/marker-geometry.js +1 -1
- package/dist/nodes/marker-geometry.js.map +1 -1
- package/dist/nodes/milestone-node.d.ts +112 -15
- package/dist/nodes/milestone-node.d.ts.map +1 -1
- package/dist/nodes/milestone-node.js +246 -95
- package/dist/nodes/milestone-node.js.map +1 -1
- package/dist/nodes/nowline-node.d.ts +8 -0
- package/dist/nodes/nowline-node.d.ts.map +1 -0
- package/dist/nodes/nowline-node.js +74 -0
- package/dist/nodes/nowline-node.js.map +1 -0
- package/dist/nodes/parallel-node.d.ts +7 -12
- package/dist/nodes/parallel-node.d.ts.map +1 -1
- package/dist/nodes/parallel-node.js +66 -32
- package/dist/nodes/parallel-node.js.map +1 -1
- package/dist/nodes/region-markers.d.ts +41 -0
- package/dist/nodes/region-markers.d.ts.map +1 -0
- package/dist/nodes/region-markers.js +130 -0
- package/dist/nodes/region-markers.js.map +1 -0
- package/dist/nodes/roadmap-node.d.ts +9 -72
- package/dist/nodes/roadmap-node.d.ts.map +1 -1
- package/dist/nodes/roadmap-node.js +38 -788
- package/dist/nodes/roadmap-node.js.map +1 -1
- package/dist/nodes/row-track.d.ts +33 -0
- package/dist/nodes/row-track.d.ts.map +1 -0
- package/dist/nodes/row-track.js +170 -0
- package/dist/nodes/row-track.js.map +1 -0
- package/dist/nodes/sequence-item.d.ts +25 -0
- package/dist/nodes/sequence-item.d.ts.map +1 -0
- package/dist/nodes/sequence-item.js +396 -0
- package/dist/nodes/sequence-item.js.map +1 -0
- package/dist/nodes/sequence-one.d.ts +5 -0
- package/dist/nodes/sequence-one.d.ts.map +1 -0
- package/dist/nodes/sequence-one.js +26 -0
- package/dist/nodes/sequence-one.js.map +1 -0
- package/dist/nodes/swimlane-node.d.ts +5 -17
- package/dist/nodes/swimlane-node.d.ts.map +1 -1
- package/dist/nodes/swimlane-node.js +62 -147
- package/dist/nodes/swimlane-node.js.map +1 -1
- package/dist/nodes/wave-node.d.ts +52 -0
- package/dist/nodes/wave-node.d.ts.map +1 -0
- package/dist/nodes/wave-node.js +483 -0
- package/dist/nodes/wave-node.js.map +1 -0
- package/dist/non-working-display.d.ts +14 -0
- package/dist/non-working-display.d.ts.map +1 -0
- package/dist/non-working-display.js +28 -0
- package/dist/non-working-display.js.map +1 -0
- package/dist/phases/date-window.d.ts +48 -0
- package/dist/phases/date-window.d.ts.map +1 -0
- package/dist/phases/date-window.js +130 -0
- package/dist/phases/date-window.js.map +1 -0
- package/dist/phases/finalize.d.ts +198 -0
- package/dist/phases/finalize.d.ts.map +1 -0
- package/dist/phases/finalize.js +1058 -0
- package/dist/phases/finalize.js.map +1 -0
- package/dist/phases/measure.d.ts +77 -0
- package/dist/phases/measure.d.ts.map +1 -0
- package/dist/phases/measure.js +222 -0
- package/dist/phases/measure.js.map +1 -0
- package/dist/phases/place.d.ts +28 -0
- package/dist/phases/place.d.ts.map +1 -0
- package/dist/phases/place.js +225 -0
- package/dist/phases/place.js.map +1 -0
- package/dist/renderable.d.ts.map +1 -1
- package/dist/renderable.js +23 -3
- package/dist/renderable.js.map +1 -1
- package/dist/resolve-today.d.ts +11 -1
- package/dist/resolve-today.d.ts.map +1 -1
- package/dist/resolve-today.js +26 -12
- package/dist/resolve-today.js.map +1 -1
- package/dist/row-packer.d.ts +42 -16
- package/dist/row-packer.d.ts.map +1 -1
- package/dist/row-packer.js +51 -78
- package/dist/row-packer.js.map +1 -1
- package/dist/schedule.d.ts +58 -1
- package/dist/schedule.d.ts.map +1 -1
- package/dist/schedule.js +280 -106
- package/dist/schedule.js.map +1 -1
- package/dist/start-rules.d.ts +27 -0
- package/dist/start-rules.d.ts.map +1 -0
- package/dist/start-rules.js +91 -0
- package/dist/start-rules.js.map +1 -0
- package/dist/start-terms.d.ts +23 -0
- package/dist/start-terms.d.ts.map +1 -0
- package/dist/start-terms.js +27 -0
- package/dist/start-terms.js.map +1 -0
- package/dist/status-dot.d.ts +46 -0
- package/dist/status-dot.d.ts.map +1 -0
- package/dist/status-dot.js +78 -0
- package/dist/status-dot.js.map +1 -0
- package/dist/style-resolution.d.ts.map +1 -1
- package/dist/style-resolution.js +23 -43
- package/dist/style-resolution.js.map +1 -1
- package/dist/text-measure.d.ts +28 -0
- package/dist/text-measure.d.ts.map +1 -0
- package/dist/text-measure.js +70 -0
- package/dist/text-measure.js.map +1 -0
- package/dist/themes/contrast.d.ts +4 -0
- package/dist/themes/contrast.d.ts.map +1 -0
- package/dist/themes/contrast.js +32 -0
- package/dist/themes/contrast.js.map +1 -0
- package/dist/themes/dark.d.ts.map +1 -1
- package/dist/themes/dark.js +28 -1
- package/dist/themes/dark.js.map +1 -1
- package/dist/themes/grayscale.d.ts.map +1 -1
- package/dist/themes/grayscale.js +28 -1
- package/dist/themes/grayscale.js.map +1 -1
- package/dist/themes/index.d.ts +4 -11
- package/dist/themes/index.d.ts.map +1 -1
- package/dist/themes/index.js +6 -4
- package/dist/themes/index.js.map +1 -1
- package/dist/themes/light.d.ts.map +1 -1
- package/dist/themes/light.js +28 -1
- package/dist/themes/light.js.map +1 -1
- package/dist/themes/shape.d.ts +31 -0
- package/dist/themes/shape.d.ts.map +1 -1
- package/dist/themes/shared.d.ts +44 -50
- package/dist/themes/shared.d.ts.map +1 -1
- package/dist/themes/shared.js +79 -83
- package/dist/themes/shared.js.map +1 -1
- package/dist/time-scale.d.ts +42 -6
- package/dist/time-scale.d.ts.map +1 -1
- package/dist/time-scale.js +109 -17
- package/dist/time-scale.js.map +1 -1
- package/dist/types.d.ts +528 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/view-preset.d.ts +61 -6
- package/dist/view-preset.d.ts.map +1 -1
- package/dist/view-preset.js +439 -24
- package/dist/view-preset.js.map +1 -1
- package/dist/wave-barrier.d.ts +107 -0
- package/dist/wave-barrier.d.ts.map +1 -0
- package/dist/wave-barrier.js +174 -0
- package/dist/wave-barrier.js.map +1 -0
- package/dist/wave-hatch.d.ts +4 -0
- package/dist/wave-hatch.d.ts.map +1 -0
- package/dist/wave-hatch.js +21 -0
- package/dist/wave-hatch.js.map +1 -0
- package/dist/wave-layout.d.ts +99 -0
- package/dist/wave-layout.d.ts.map +1 -0
- package/dist/wave-layout.js +130 -0
- package/dist/wave-layout.js.map +1 -0
- package/dist/working-calendar.d.ts +128 -4
- package/dist/working-calendar.d.ts.map +1 -1
- package/dist/working-calendar.js +725 -51
- package/dist/working-calendar.js.map +1 -1
- package/dist/working-span.d.ts +11 -0
- package/dist/working-span.d.ts.map +1 -0
- package/dist/working-span.js +18 -0
- package/dist/working-span.js.map +1 -0
- package/package.json +7 -7
- package/src/axis-columns.ts +140 -0
- package/src/calendar-resolver.ts +161 -0
- package/src/calendar.ts +4 -45
- package/src/canvas-width.ts +36 -0
- package/src/capacity.ts +71 -30
- package/src/chart-translation.ts +88 -0
- package/src/container-header-geometry.ts +116 -0
- package/src/dsl-utils.ts +8 -26
- package/src/edge-routing.ts +347 -491
- package/src/frame-tab-geometry.ts +78 -25
- package/src/header-card-geometry.ts +17 -2
- package/src/header-logo.ts +67 -0
- package/src/i18n.ts +22 -1
- package/src/index.ts +97 -12
- package/src/inline-date-pin-geometry.ts +55 -58
- package/src/item-bar-geometry.ts +341 -5
- package/src/item-port-geometry.ts +69 -0
- package/src/layout-context.ts +210 -72
- package/src/layout-insights.ts +109 -2
- package/src/layout.ts +57 -1530
- package/src/nodes/anchor-node.ts +11 -4
- package/src/nodes/content-extent.ts +107 -0
- package/src/nodes/dependency-edges.ts +171 -0
- package/src/nodes/footnote-node.ts +171 -31
- package/src/nodes/group-node.ts +92 -215
- package/src/nodes/header-node.ts +255 -0
- package/src/nodes/include-node.ts +124 -110
- package/src/nodes/item-measure.ts +723 -0
- package/src/nodes/item-node.ts +358 -80
- package/src/nodes/marker-band.ts +406 -0
- package/src/nodes/marker-geometry.ts +1 -1
- package/src/nodes/milestone-node.ts +321 -136
- package/src/nodes/nowline-node.ts +87 -0
- package/src/nodes/parallel-node.ts +69 -39
- package/src/nodes/region-markers.ts +194 -0
- package/src/nodes/roadmap-node.ts +46 -950
- package/src/nodes/row-track.ts +217 -0
- package/src/nodes/sequence-item.ts +433 -0
- package/src/nodes/sequence-one.ts +40 -0
- package/src/nodes/swimlane-node.ts +66 -206
- package/src/nodes/wave-node.ts +609 -0
- package/src/non-working-display.ts +32 -0
- package/src/phases/date-window.ts +191 -0
- package/src/phases/finalize.ts +1303 -0
- package/src/phases/measure.ts +329 -0
- package/src/phases/place.ts +318 -0
- package/src/renderable.ts +23 -3
- package/src/resolve-today.ts +28 -25
- package/src/row-packer.ts +85 -84
- package/src/schedule.ts +362 -114
- package/src/start-rules.ts +113 -0
- package/src/start-terms.ts +38 -0
- package/src/status-dot.ts +81 -0
- package/src/style-resolution.ts +27 -57
- package/src/text-measure.ts +71 -0
- package/src/themes/contrast.ts +34 -0
- package/src/themes/dark.ts +28 -1
- package/src/themes/grayscale.ts +28 -1
- package/src/themes/index.ts +10 -7
- package/src/themes/light.ts +28 -1
- package/src/themes/shape.ts +38 -0
- package/src/themes/shared.ts +85 -93
- package/src/time-scale.ts +117 -19
- package/src/types.ts +529 -20
- package/src/view-preset.ts +520 -27
- package/src/wave-barrier.ts +242 -0
- package/src/wave-hatch.ts +25 -0
- package/src/wave-layout.ts +203 -0
- package/src/working-calendar.ts +875 -57
- package/src/working-span.ts +19 -0
|
@@ -4,27 +4,20 @@
|
|
|
4
4
|
// fresh rows) and emits a `PositionedSwimlane` plus the band's used
|
|
5
5
|
// height.
|
|
6
6
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
// - The Renderable interface's `measure(MeasureContext)` is not yet
|
|
15
|
-
// wired through the production pipeline. The composition-root work
|
|
16
|
-
// in step 5 (`RoadmapNode`) will exercise it; meanwhile the legacy
|
|
17
|
-
// two-pass "buildSwimlane returns positioned + usedHeight" shape is
|
|
18
|
-
// preserved.
|
|
19
|
-
import { isItemDeclaration } from '@nowline/core';
|
|
20
|
-
import { deriveItemDurationDays } from '../calendar.js';
|
|
21
|
-
import { estimateCapacitySuffixWidth, formatCapacityNumber, parseCapacityValue, resolveCapacityIcon, } from '../capacity.js';
|
|
7
|
+
// The lane's children go through the shared row track (`row-track.ts`):
|
|
8
|
+
// items are measured and placed by `sequenceItem`, and parallel and group
|
|
9
|
+
// children by the injected `helpers.sequenceOne`. A lane has no separate
|
|
10
|
+
// measure pass: its height is the result of packing its rows, so
|
|
11
|
+
// `place` returns the positioned lane with its used height
|
|
12
|
+
// (specs/layout-phases.md §2, non-goals).
|
|
13
|
+
import { capacityIconDxTerms, estimateCapacitySuffixWidth, formatCapacityNumber, parseCapacityValue, resolveCapacityIcon, } from '../capacity.js';
|
|
22
14
|
import { propValue } from '../dsl-utils.js';
|
|
23
15
|
import { frameTabGeometry } from '../frame-tab-geometry.js';
|
|
24
16
|
import { computeLaneUtilization, resolveLaneUtilizationThresholds } from '../lane-utilization.js';
|
|
25
|
-
import {
|
|
17
|
+
import { resolveChildStart } from '../start-rules.js';
|
|
26
18
|
import { resolveStyle } from '../style-resolution.js';
|
|
27
|
-
import {
|
|
19
|
+
import { estimateTextWidth } from '../text-measure.js';
|
|
20
|
+
import { sequenceRowTrack } from './row-track.js';
|
|
28
21
|
/**
|
|
29
22
|
* Font size (px) the renderer uses for the lane capacity badge. Mirrors
|
|
30
23
|
* the owner-badge font size in `renderSwimlane` so the two reads as a
|
|
@@ -47,8 +40,9 @@ function resolveLaneCapacity(lane, style, symbols) {
|
|
|
47
40
|
const text = formatCapacityNumber(value);
|
|
48
41
|
const icon = resolveCapacityIcon(style.capacityIcon, symbols);
|
|
49
42
|
const badgeWidthPx = estimateCapacitySuffixWidth(text, icon, LANE_CAPACITY_BADGE_FONT_SIZE_PX);
|
|
43
|
+
const iconDxTerms = capacityIconDxTerms(text, icon, LANE_CAPACITY_BADGE_FONT_SIZE_PX);
|
|
50
44
|
return {
|
|
51
|
-
capacity: { value, text, icon },
|
|
45
|
+
capacity: { value, text, icon, ...(iconDxTerms !== undefined ? { iconDxTerms } : {}) },
|
|
52
46
|
badgeWidthPx,
|
|
53
47
|
};
|
|
54
48
|
}
|
|
@@ -56,21 +50,21 @@ const TAB_TOP_Y = 10; // matches renderer: tabY = box.y + 10
|
|
|
56
50
|
const TAB_BOTTOM_Y = 38; // tab (height 22) plus 6 px breathing room
|
|
57
51
|
const TAB_GUTTER_PX = 8;
|
|
58
52
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* exactly in sync. Capacity badge and footnote-indicator widths are
|
|
63
|
-
* added when present so the first-item collision math reserves
|
|
64
|
-
* enough horizontal space for the (now-wider) chiclet.
|
|
53
|
+
* The lane's owner as the frame tab shows it: the person's or team's
|
|
54
|
+
* title (nested teams included), else the bare id, plus which glyph leads
|
|
55
|
+
* it. Undefined without `owner:`.
|
|
65
56
|
*/
|
|
66
|
-
function
|
|
67
|
-
const title = lane.title ?? lane.name ?? '';
|
|
68
|
-
if (!title)
|
|
69
|
-
return 0;
|
|
57
|
+
function resolveLaneOwner(lane, ctx) {
|
|
70
58
|
const ownerRaw = propValue(lane.properties, 'owner');
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
59
|
+
if (!ownerRaw)
|
|
60
|
+
return undefined;
|
|
61
|
+
const team = ctx.teams.get(ownerRaw);
|
|
62
|
+
if (team)
|
|
63
|
+
return { text: team.title ?? ownerRaw, kind: 'team' };
|
|
64
|
+
const person = ctx.persons.get(ownerRaw);
|
|
65
|
+
if (person)
|
|
66
|
+
return { text: person.title ?? ownerRaw, kind: 'person' };
|
|
67
|
+
return { text: ownerRaw, kind: 'team' };
|
|
74
68
|
}
|
|
75
69
|
/**
|
|
76
70
|
* Footnote indicators (1-based numbers) that name this lane via `on:`,
|
|
@@ -98,32 +92,28 @@ function collectFootnoteIndicators(lane, ctx) {
|
|
|
98
92
|
* the top-pad collapse decision (a row whose first item lives past the
|
|
99
93
|
* tab can sit at TAB_TOP_Y; otherwise rows drop below the tab).
|
|
100
94
|
*/
|
|
101
|
-
function firstChildStartX(lane, laneLeftX, ctx
|
|
95
|
+
function firstChildStartX(lane, laneLeftX, ctx) {
|
|
102
96
|
for (const child of lane.content) {
|
|
103
97
|
if (child.$type === 'DescriptionDirective')
|
|
104
98
|
continue;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
: (child.properties ?? []);
|
|
108
|
-
return deps.resolveChildStart(props, laneLeftX, laneLeftX, ctx);
|
|
99
|
+
// Snapped like the start it predicts (a no-op under `hide`).
|
|
100
|
+
return ctx.scale.startX(resolveChildStart(child, laneLeftX, ctx));
|
|
109
101
|
}
|
|
110
102
|
return undefined;
|
|
111
103
|
}
|
|
112
104
|
export class SwimlaneNode {
|
|
113
105
|
input;
|
|
114
|
-
|
|
115
|
-
constructor(input,
|
|
116
|
-
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: accessed via `const { deps } = this` destructuring inside methods, which the analyzer does not detect.
|
|
117
|
-
deps) {
|
|
106
|
+
helpers;
|
|
107
|
+
constructor(input, helpers) {
|
|
118
108
|
this.input = input;
|
|
119
|
-
this.
|
|
109
|
+
this.helpers = helpers;
|
|
120
110
|
}
|
|
121
111
|
get id() {
|
|
122
112
|
return this.input.lane.name ?? '';
|
|
123
113
|
}
|
|
124
114
|
place(origin, ctx) {
|
|
125
115
|
const { lane, bandIndex } = this.input;
|
|
126
|
-
const {
|
|
116
|
+
const { helpers } = this;
|
|
127
117
|
const style = resolveStyle('swimlane', lane.properties, ctx.styleCtx);
|
|
128
118
|
const laneLeftX = origin.x;
|
|
129
119
|
const step = ctx.bandScale.step();
|
|
@@ -145,130 +135,53 @@ export class SwimlaneNode {
|
|
|
145
135
|
// pre-resolved footnote index/host map.
|
|
146
136
|
const footnoteIndicators = collectFootnoteIndicators(lane, ctx);
|
|
147
137
|
const footnoteIndicatorWidthPx = footnoteIndicators.length > 0
|
|
148
|
-
?
|
|
138
|
+
? estimateTextWidth(footnoteIndicators.join(','), LANE_CAPACITY_BADGE_FONT_SIZE_PX)
|
|
149
139
|
: 0;
|
|
150
|
-
// Title-tab geometry
|
|
151
|
-
|
|
140
|
+
// Title-tab geometry, computed once from the owner's display
|
|
141
|
+
// title: the collision box below and the chiclet the renderer
|
|
142
|
+
// draws (`PositionedSwimlane.tab`) are the same rectangle. Every
|
|
143
|
+
// lane box sits at x 0 (`box` below); finalize sets only widths.
|
|
144
|
+
const boxX = 0;
|
|
145
|
+
const owner = resolveLaneOwner(lane, ctx);
|
|
146
|
+
const title = lane.title ?? lane.name ?? '';
|
|
147
|
+
const tab = title
|
|
148
|
+
? frameTabGeometry(boxX, title, owner?.text, badgeWidthPx, footnoteIndicatorWidthPx)
|
|
149
|
+
: null;
|
|
150
|
+
const tabRightX = tab?.rightX ?? 0;
|
|
152
151
|
// First-row Y: when the first child's desired x is past the title
|
|
153
152
|
// tab, top-align with the tab and reclaim ~28 px per lane.
|
|
154
153
|
// Otherwise drop below the tab.
|
|
155
|
-
const firstChildDesiredX = firstChildStartX(lane, laneLeftX, ctx
|
|
154
|
+
const firstChildDesiredX = firstChildStartX(lane, laneLeftX, ctx);
|
|
156
155
|
const canAlignFirstRowWithTab = !lane.title ||
|
|
157
156
|
firstChildDesiredX === undefined ||
|
|
158
157
|
firstChildDesiredX >= tabRightX + TAB_GUTTER_PX;
|
|
159
158
|
const startY = origin.y + (canAlignFirstRowWithTab ? TAB_TOP_Y : TAB_BOTTOM_Y);
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
originY: startY,
|
|
166
|
-
minRowHeight: step,
|
|
167
|
-
slackCorridors: ctx.slackCorridors,
|
|
168
|
-
});
|
|
169
|
-
let timeCursorX = laneLeftX;
|
|
170
|
-
const children = [];
|
|
171
|
-
for (const child of lane.content) {
|
|
172
|
-
if (child.$type === 'DescriptionDirective')
|
|
173
|
-
continue;
|
|
174
|
-
if (!isItemDeclaration(child)) {
|
|
175
|
-
const blockProps = child.properties ?? [];
|
|
176
|
-
const blockStart = deps.resolveChildStart(blockProps, timeCursorX, laneLeftX, ctx);
|
|
177
|
-
const { rowIndex, y: blockY } = packer.placeBlock();
|
|
178
|
-
const cursor = deps.newCursor(blockStart, blockY);
|
|
179
|
-
const positioned = deps.sequenceOne(child, cursor, ctx);
|
|
180
|
-
children.push(positioned);
|
|
181
|
-
const blockEnd = positioned.box.x + positioned.box.width;
|
|
182
|
-
const blockHeight = Math.max(step, cursor.height);
|
|
183
|
-
packer.commitBlock({
|
|
184
|
-
rowIndex,
|
|
185
|
-
placed: positioned,
|
|
186
|
-
blockHeight,
|
|
187
|
-
blockEnd,
|
|
188
|
-
});
|
|
189
|
-
timeCursorX = Math.max(timeCursorX, blockEnd);
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
192
|
-
const props = child.properties;
|
|
193
|
-
const desiredStart = deps.resolveChildStart(props, timeCursorX, laneLeftX, ctx);
|
|
194
|
-
// Predict the item's logical extent so the row-pack can decide
|
|
195
|
-
// BEFORE handing off to sequenceItem. The arithmetic mirrors
|
|
196
|
-
// the duration → width math in `sequenceItem` (see
|
|
197
|
-
// packages/layout/src/layout.ts).
|
|
198
|
-
const durationDays = deriveItemDurationDays(props, ctx.sizes, ctx.cal);
|
|
199
|
-
const naturalWidth = Math.max(MIN_ITEM_WIDTH, durationDays * ctx.timeline.pixelsPerDay);
|
|
200
|
-
const desiredEnd = desiredStart + naturalWidth;
|
|
201
|
-
const childId = child.name ?? '';
|
|
202
|
-
const chipExtra = deps.predictItemChipExtraHeight(child, ctx);
|
|
203
|
-
const predictedHeight = step + chipExtra;
|
|
204
|
-
const { rowIndex, y: rowY } = packer.placeItem({
|
|
205
|
-
childId,
|
|
206
|
-
desiredStart,
|
|
207
|
-
desiredEnd,
|
|
208
|
-
// Row pitch = `step()` + extra chip-row height. Keeps
|
|
209
|
-
// the inter-row visible gap (= step - bandwidth) intact
|
|
210
|
-
// when an item's labels wrap and grow the bar.
|
|
211
|
-
predictedHeight,
|
|
212
|
-
});
|
|
213
|
-
const cursor = deps.newCursor(desiredStart, rowY);
|
|
214
|
-
const positioned = deps.sequenceItem(child, cursor, ctx);
|
|
215
|
-
children.push(positioned);
|
|
216
|
-
// Item end in LOGICAL space (one ITEM_INSET_PX past the visual
|
|
217
|
-
// bar's right edge). The next chained item starts here and
|
|
218
|
-
// lands edge-to-edge in time, with a 2 × ITEM_INSET_PX visible
|
|
219
|
-
// gutter between bars.
|
|
220
|
-
const itemLogicalEnd = positioned.box.x + positioned.box.width + ITEM_INSET_PX;
|
|
221
|
-
timeCursorX = Math.max(timeCursorX, itemLogicalEnd);
|
|
222
|
-
let spillReservation = null;
|
|
223
|
-
const hasAnySpill = positioned.textSpills ||
|
|
224
|
-
positioned.chipsOutside ||
|
|
225
|
-
positioned.dotSpills ||
|
|
226
|
-
positioned.iconSpills ||
|
|
227
|
-
positioned.footnoteSpills;
|
|
228
|
-
if (hasAnySpill) {
|
|
229
|
-
// `decorationsRightX` already aggregates the spilled
|
|
230
|
-
// dot / icon / footnote / caption right edges from
|
|
231
|
-
// `sequenceItem`; the chip column tracks separately
|
|
232
|
-
// via `chipsRightX`. Add a 6-px buffer so the next
|
|
233
|
-
// chained item's bar leaves a visible gutter past
|
|
234
|
-
// the spilled cluster instead of butting against it.
|
|
235
|
-
const farRight = Math.max(positioned.decorationsRightX, positioned.chipsOutside ? positioned.chipsRightX : 0);
|
|
236
|
-
spillReservation = farRight + 6;
|
|
237
|
-
}
|
|
238
|
-
packer.commitItem({
|
|
239
|
-
rowIndex,
|
|
240
|
-
placed: positioned,
|
|
241
|
-
logicalEnd: itemLogicalEnd,
|
|
242
|
-
spillReservation,
|
|
243
|
-
rowHeight: predictedHeight,
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
// `packer.usedHeight()` measures from `startY` (the first row,
|
|
159
|
+
// The shared row-track loop (row-track.ts) packs the lane's
|
|
160
|
+
// children below the tab offset chosen above.
|
|
161
|
+
const track = sequenceRowTrack(lane, { leftX: laneLeftX, firstRowY: startY }, ctx, helpers);
|
|
162
|
+
const { children } = track;
|
|
163
|
+
// `track.packer.usedHeight()` measures from `startY` (the first row,
|
|
247
164
|
// below the title tab); the swimlane band spans from `origin.y`
|
|
248
165
|
// (the band top, above the tab). Add the tab offset back so the
|
|
249
166
|
// band height covers everything the user sees.
|
|
250
167
|
const tabOffset = startY - origin.y;
|
|
251
|
-
const bandHeight = Math.max(step + 32, tabOffset + packer.usedHeight() + 16);
|
|
168
|
+
const bandHeight = Math.max(step + 32, tabOffset + track.packer.usedHeight() + 16);
|
|
252
169
|
// Include the chiclet's right edge in the lane's reported
|
|
253
170
|
// right-extent so empty lanes still report a non-zero right edge
|
|
254
171
|
// — `buildIncludeRegions` uses this to size the include's dashed
|
|
255
172
|
// bracket around its content, and a lane with only a chiclet
|
|
256
173
|
// (no items) should still fit visibly inside that bracket.
|
|
257
|
-
const usedRightX = Math.max(packer.usedRightX(), tabRightX);
|
|
174
|
+
const usedRightX = Math.max(track.packer.usedRightX(), tabRightX);
|
|
175
|
+
// The band spans the canvas, whose width is final only after the
|
|
176
|
+
// post-placement growth: finalize (`fitWidths`, f4) sets a main
|
|
177
|
+
// lane's width to it and `fitIncludeRegionWidth` a region lane's to
|
|
178
|
+
// the region's. Placement never reads the canvas.
|
|
258
179
|
const box = {
|
|
259
|
-
x:
|
|
180
|
+
x: boxX,
|
|
260
181
|
y: origin.y,
|
|
261
|
-
width:
|
|
182
|
+
width: 0,
|
|
262
183
|
height: bandHeight,
|
|
263
184
|
};
|
|
264
|
-
// Owner display string: id → title for teams/people; falls back to id.
|
|
265
|
-
const ownerRaw = propValue(lane.properties, 'owner');
|
|
266
|
-
let ownerDisplay;
|
|
267
|
-
if (ownerRaw) {
|
|
268
|
-
const team = ctx.teams.get(ownerRaw);
|
|
269
|
-
const person = ctx.persons.get(ownerRaw);
|
|
270
|
-
ownerDisplay = team?.title ?? person?.title ?? ownerRaw;
|
|
271
|
-
}
|
|
272
185
|
// Lane utilization underline (m12). Computed *after* children are
|
|
273
186
|
// positioned so the contributors carry their final box.x / box.width.
|
|
274
187
|
// Returns null when the lane has no `capacity:`, no contributing
|
|
@@ -289,15 +202,17 @@ export class SwimlaneNode {
|
|
|
289
202
|
return {
|
|
290
203
|
positioned: {
|
|
291
204
|
id: lane.name,
|
|
292
|
-
title
|
|
205
|
+
title,
|
|
293
206
|
box,
|
|
294
207
|
bandIndex,
|
|
295
208
|
children,
|
|
296
209
|
nested: [],
|
|
297
210
|
style,
|
|
298
|
-
owner:
|
|
211
|
+
owner: owner?.text,
|
|
212
|
+
ownerKind: owner?.kind,
|
|
299
213
|
footnoteIndicators,
|
|
300
214
|
capacity,
|
|
215
|
+
tab,
|
|
301
216
|
utilization,
|
|
302
217
|
},
|
|
303
218
|
usedHeight: bandHeight,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swimlane-node.js","sourceRoot":"","sources":["../../src/nodes/swimlane-node.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,0EAA0E;AAC1E,qEAAqE;AACrE,oEAAoE;AACpE,UAAU;AACV,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"swimlane-node.js","sourceRoot":"","sources":["../../src/nodes/swimlane-node.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,0EAA0E;AAC1E,qEAAqE;AACrE,oEAAoE;AACpE,UAAU;AACV,EAAE;AACF,wEAAwE;AACxE,0EAA0E;AAC1E,yEAAyE;AACzE,iEAAiE;AACjE,2DAA2D;AAC3D,0CAA0C;AAQ1C,OAAO,EACH,mBAAmB,EACnB,2BAA2B,EAC3B,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAElG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,gCAAgC,GAAG,EAAE,CAAC;AAE5C;;;;;GAKG;AACH,SAAS,mBAAmB,CACxB,IAAyB,EACzB,KAA+B,EAC/B,OAAi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,IAAI;gBACb,KAAK;gBACL,GAAG;gBACH,SAAS;gBACT,QAAQ;gBACR,MAAM,EAAE,EAAE;gBACV,KAAK;gBACL,KAAK,EAAE,KAAK,EAAE,IAAI;gBAClB,SAAS,EAAE,KAAK,EAAE,IAAI;gBACtB,kBAAkB;gBAClB,QAAQ;gBACR,GAAG;gBACH,WAAW;aACd;YACD,UAAU,EAAE,UAAU;YACtB,UAAU;SACb,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { LocaleStrings } from '../i18n.js';
|
|
2
|
+
import type { LayoutContext } from '../layout-context.js';
|
|
3
|
+
import type { Theme } from '../themes/shape.js';
|
|
4
|
+
import type { PositionedIncludeRegion, PositionedSwimlane, PositionedWave, PositionedWaveBoundary, PositionedWaveCrossing, PositionedWaveLegend } from '../types.js';
|
|
5
|
+
import { type WaveLayoutState } from '../wave-layout.js';
|
|
6
|
+
/** Everything `buildWaves` produces; the caller attaches it to the model. */
|
|
7
|
+
export interface BuiltWaves {
|
|
8
|
+
waves: PositionedWave[];
|
|
9
|
+
/** Boundary lines, left to right (empty when every wave is empty). */
|
|
10
|
+
boundaries: PositionedWaveBoundary[];
|
|
11
|
+
/** Crossings over the main lanes' background bars. */
|
|
12
|
+
crossings: PositionedWaveCrossing[];
|
|
13
|
+
/** Crossings over each isolated region's background bars, parallel to `includes`. */
|
|
14
|
+
regionCrossings: PositionedWaveCrossing[][];
|
|
15
|
+
/** True when any placed item (main lanes or regions) is background work. */
|
|
16
|
+
hasBackground: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Build the positioned waves, boundaries and crossings. `state` must be
|
|
20
|
+
* frozen: its `pass` is the pass that ran with the solved `S`/`E`, so its
|
|
21
|
+
* member counts cover the main lanes and the first-level regions exactly
|
|
22
|
+
* once (later placements never accumulate). `ctx.timeline.waveStrip` is
|
|
23
|
+
* set whenever some wave has items; when none does, nothing is drawn and the
|
|
24
|
+
* waves carry their spans only (specs/waves.md §9.1).
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildWaves(state: WaveLayoutState, ctx: LayoutContext, strings: LocaleStrings, swimlanes: PositionedSwimlane[], includes: PositionedIncludeRegion[]): BuiltWaves;
|
|
27
|
+
interface LabelFit {
|
|
28
|
+
kind: 'title' | 'id' | 'ellipsis' | 'ordinal';
|
|
29
|
+
label: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The first strip label candidate that fits (§9.1): the title, the id, the
|
|
33
|
+
* title ellipsized to 3 or more characters plus "…", then the 1-based
|
|
34
|
+
* `#k`. The test is the bold 10 px width estimate plus `extraWidth` (the
|
|
35
|
+
* footnote superscripts) plus 6 px padding on each side. Undefined: no
|
|
36
|
+
* label.
|
|
37
|
+
*/
|
|
38
|
+
export declare function fitStripLabel(title: string, id: string, ordinal: number, visibleWidth: number, extraWidth: number): LabelFit | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* `wave.labelText` when it reaches 4.5:1 against `fill` (or either colour is
|
|
41
|
+
* not hex), else whichever of the theme's dark (`hatch`) and light
|
|
42
|
+
* (`hatchOnDark`) strokes contrasts more.
|
|
43
|
+
*/
|
|
44
|
+
export declare function readableLabelText(wave: Pick<Theme['wave'], 'labelText' | 'hatch' | 'hatchOnDark'>, fill: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* The wave legend (§9.5), or undefined without background work (which there
|
|
47
|
+
* is only when some wave is drawn): one hatch swatch, `Background work (not
|
|
48
|
+
* in a wave)`, `WAVE_LEGEND_LINE_PX` high from `topY` at the chart origin.
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildWaveLegend(built: BuiltWaves, ctx: LayoutContext, strings: LocaleStrings, topY: number): PositionedWaveLegend | undefined;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=wave-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wave-node.d.ts","sourceRoot":"","sources":["../../src/nodes/wave-node.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