@nowline/layout 0.8.6 → 0.10.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/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 -152
- 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 -30
- 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 -145
- 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 +4 -4
- 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 -214
- 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 -38
- 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 -205
- 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
|
@@ -1,37 +1,55 @@
|
|
|
1
1
|
// ParallelNode — Renderable for a `parallel { ... }` block. Stacks
|
|
2
|
-
// children top-to-bottom (each child owns a fresh
|
|
3
|
-
//
|
|
4
|
-
// `
|
|
5
|
-
//
|
|
6
|
-
//
|
|
2
|
+
// children top-to-bottom inside its body (each child owns a fresh
|
|
3
|
+
// sub-track) under a header band, the way a group is drawn
|
|
4
|
+
// (specs/true-width-layout.md §3.3; `container-header-geometry.ts`). Each
|
|
5
|
+
// child is sequenced via the injected `helpers.sequenceOne` callback
|
|
6
|
+
// (`sequence-one.ts`), which dispatches to `sequenceItem`, `GroupNode` or a
|
|
7
|
+
// nested `ParallelNode`.
|
|
8
|
+
import { containerChrome } from '../container-header-geometry.js';
|
|
7
9
|
import { propValues } from '../dsl-utils.js';
|
|
8
10
|
import { computeContainerInlineDatePins, pickInlineDate } from '../inline-date-pin-geometry.js';
|
|
11
|
+
import { newCursor, } from '../layout-context.js';
|
|
9
12
|
import { resolveStyle } from '../style-resolution.js';
|
|
10
|
-
import {
|
|
13
|
+
import { waveFloorX } from '../wave-layout.js';
|
|
11
14
|
export class ParallelNode {
|
|
12
15
|
node;
|
|
13
|
-
|
|
14
|
-
constructor(node,
|
|
16
|
+
helpers;
|
|
17
|
+
constructor(node, helpers) {
|
|
15
18
|
this.node = node;
|
|
16
|
-
this.
|
|
19
|
+
this.helpers = helpers;
|
|
17
20
|
}
|
|
18
21
|
get id() {
|
|
19
22
|
return this.node.name ?? '';
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
25
|
* Sequence children into stacked sub-tracks, advance the parent
|
|
23
|
-
* `cursor`
|
|
24
|
-
*
|
|
25
|
-
* `PositionedParallel`.
|
|
26
|
+
* `cursor` to the parallel's end in time (the latest track end), and
|
|
27
|
+
* return a `PositionedParallel`.
|
|
26
28
|
*/
|
|
27
29
|
place(cursor, ctx) {
|
|
28
30
|
const { node } = this;
|
|
29
|
-
const {
|
|
31
|
+
const { helpers } = this;
|
|
30
32
|
const style = resolveStyle('parallel', node.properties, ctx.styleCtx);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
// The block's own wave and its lead wave floor the shared start
|
|
34
|
+
// (specs/waves.md §5.1); each track is floored again by its own
|
|
35
|
+
// wave where it is placed. A no-op without waves.
|
|
36
|
+
const startX = waveFloorX(node, cursor.x, ctx);
|
|
37
|
+
const afterDate = pickInlineDate(propValues(node.properties, 'after'));
|
|
38
|
+
const beforeDate = pickInlineDate(propValues(node.properties, 'before'));
|
|
39
|
+
const title = node.title ?? node.name;
|
|
40
|
+
const chrome = containerChrome({
|
|
41
|
+
drawn: true,
|
|
42
|
+
hasTitle: Boolean(title),
|
|
43
|
+
hasPins: Boolean(afterDate || beforeDate),
|
|
44
|
+
hasBracket: style.bracket !== 'none',
|
|
45
|
+
});
|
|
46
|
+
const firstTrackY = cursor.y + chrome.header + chrome.pad;
|
|
33
47
|
const children = [];
|
|
34
|
-
|
|
48
|
+
// The tracks' span in time: the bracket and body open on the
|
|
49
|
+
// earliest track start and close on the latest track end, the join
|
|
50
|
+
// (bars span exactly their dates, specs/true-width-layout.md §3.1).
|
|
51
|
+
let minTimeLeft = Number.POSITIVE_INFINITY;
|
|
52
|
+
let maxTimeRight = Number.NEGATIVE_INFINITY;
|
|
35
53
|
let accumulatedHeight = 0;
|
|
36
54
|
// Each child of a parallel block lives on its own sub-track,
|
|
37
55
|
// so each child starts a fresh flow segment under the parent's
|
|
@@ -46,38 +64,56 @@ export class ParallelNode {
|
|
|
46
64
|
if (child.$type === 'DescriptionDirective')
|
|
47
65
|
continue;
|
|
48
66
|
ctx.currentFlowKey = `${previousFlowKey}/par:${parId}#${childIndex}`;
|
|
49
|
-
const subCursor =
|
|
50
|
-
const positioned =
|
|
67
|
+
const subCursor = newCursor(startX, firstTrackY + accumulatedHeight);
|
|
68
|
+
const positioned = helpers.sequenceOne(child, subCursor, ctx);
|
|
51
69
|
children.push(positioned);
|
|
52
70
|
accumulatedHeight += Math.max(ctx.bandScale.step(), subCursor.height);
|
|
53
|
-
|
|
71
|
+
minTimeLeft = Math.min(minTimeLeft, subCursor.startX);
|
|
72
|
+
maxTimeRight = Math.max(maxTimeRight, subCursor.x);
|
|
54
73
|
childIndex++;
|
|
55
74
|
}
|
|
56
75
|
ctx.currentFlowKey = previousFlowKey;
|
|
76
|
+
if (children.length === 0) {
|
|
77
|
+
// Under `show` an empty box still opens on a working day.
|
|
78
|
+
minTimeLeft = ctx.scale.showsNonWorking ? ctx.scale.startX(startX) : startX;
|
|
79
|
+
maxTimeRight = minTimeLeft;
|
|
80
|
+
}
|
|
81
|
+
// Each track's height carries the inter-row gap below it; the body
|
|
82
|
+
// ends `pad` below the last track's painted bottom, and the cursor
|
|
83
|
+
// adds the gap back after the body.
|
|
84
|
+
const step = ctx.bandScale.step();
|
|
85
|
+
const interRowGap = step - ctx.bandScale.bandwidth();
|
|
86
|
+
const contentHeight = Math.max(step, accumulatedHeight) - interRowGap;
|
|
57
87
|
const box = {
|
|
58
|
-
x:
|
|
59
|
-
y:
|
|
60
|
-
width:
|
|
61
|
-
height:
|
|
88
|
+
x: minTimeLeft,
|
|
89
|
+
y: cursor.y,
|
|
90
|
+
width: maxTimeRight - minTimeLeft,
|
|
91
|
+
height: chrome.header + chrome.pad + contentHeight + chrome.pad,
|
|
62
92
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
93
|
+
// No tail gutter: the parallel joins on its latest track end in
|
|
94
|
+
// time, as engine C does (specs/scheduler-unification.md §8
|
|
95
|
+
// decisions 6, 8).
|
|
96
|
+
cursor.startX = box.x;
|
|
97
|
+
cursor.x = maxTimeRight;
|
|
98
|
+
cursor.height = Math.max(cursor.height, box.height + interRowGap);
|
|
66
99
|
const id = node.name;
|
|
100
|
+
// `after:` the parallel is a time path: its latest track end.
|
|
67
101
|
if (id) {
|
|
68
102
|
ctx.entityLeftEdges.set(id, box.x);
|
|
69
|
-
ctx.entityRightEdges.set(id,
|
|
103
|
+
ctx.entityRightEdges.set(id, maxTimeRight);
|
|
70
104
|
}
|
|
71
105
|
const inlineDatePins = computeContainerInlineDatePins({
|
|
72
106
|
box,
|
|
73
|
-
afterDate
|
|
74
|
-
beforeDate
|
|
107
|
+
afterDate,
|
|
108
|
+
beforeDate,
|
|
109
|
+
title,
|
|
75
110
|
});
|
|
76
111
|
return {
|
|
77
112
|
kind: 'parallel',
|
|
78
113
|
id,
|
|
79
|
-
title
|
|
114
|
+
title,
|
|
80
115
|
box,
|
|
116
|
+
headerHeight: chrome.header,
|
|
81
117
|
children,
|
|
82
118
|
style,
|
|
83
119
|
inlineDatePins: inlineDatePins.length > 0 ? inlineDatePins : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parallel-node.js","sourceRoot":"","sources":["../../src/nodes/parallel-node.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,
|
|
1
|
+
{"version":3,"file":"parallel-node.js","sourceRoot":"","sources":["../../src/nodes/parallel-node.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,kEAAkE;AAClE,2DAA2D;AAC3D,0EAA0E;AAC1E,qEAAqE;AACrE,4EAA4E;AAC5E,yBAAyB;AAGzB,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CA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C,MAAM,GAAG,WAAW,CAAC,CAAC;QAElE,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,8DAA8D;QAC9D,IAAI,EAAE,EAAE,CAAC;YACL,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;YACnC,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;QAC/C,CAAC;QAED,MAAM,cAAc,GAAG,8BAA8B,CAAC;YAClD,GAAG;YACH,SAAS;YACT,UAAU;YACV,KAAK;SACR,CAAC,CAAC;QAEH,OAAO;YACH,IAAI,EAAE,UAAU;YAChB,EAAE;YACF,KAAK;YACL,GAAG;YACH,YAAY,EAAE,MAAM,CAAC,MAAM;YAC3B,QAAQ;YACR,KAAK;YACL,cAAc,EAAE,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS;SACzE,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { AnchorDeclaration, IsolatedRegion } from '@nowline/core';
|
|
2
|
+
import type { LayoutContext } from '../layout-context.js';
|
|
3
|
+
import type { PositionedAnchor, PositionedIncludeRegion, PositionedMilestone } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* How far a region's marker labels stay inside the region box on either
|
|
6
|
+
* side: the renderer's 8 px border inset plus 8 px of air.
|
|
7
|
+
*/
|
|
8
|
+
export declare const REGION_MARKER_INSET_X_PX = 16;
|
|
9
|
+
/** A region's placed markers and how far its lanes move down for them. */
|
|
10
|
+
export interface RegionMarkers {
|
|
11
|
+
anchors: PositionedAnchor[];
|
|
12
|
+
milestones: PositionedMilestone[];
|
|
13
|
+
/** The lanes' shift: 0 when the region has no marker to draw. */
|
|
14
|
+
laneShift: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Place `region`'s anchors and milestones once its lanes are laid out
|
|
18
|
+
* from `lanesTopY` down to `lanesBottomY`, inside a region whose top
|
|
19
|
+
* border is at `regionTopY`. The pack is bounded by the region's left
|
|
20
|
+
* inset and by `chartRightX` (the canvas before finalize grows it) less
|
|
21
|
+
* the right inset; a label that fits on neither side packs to the right
|
|
22
|
+
* and finalize f3 grows the canvas for it (`regionMarkerCanvasRightX`).
|
|
23
|
+
* The caller shifts the lanes by `laneShift`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function placeRegionMarkers(region: IsolatedRegion, ctx: LayoutContext, regionTopY: number, lanesTopY: number, lanesBottomY: number, chartRightX: number): RegionMarkers;
|
|
26
|
+
/**
|
|
27
|
+
* The canvas right edge `region`'s marker labels need: a label that fits
|
|
28
|
+
* on neither side of its marker inside the region's insets grows the
|
|
29
|
+
* canvas until it fits on the right, the host's marker-row rule. Returns
|
|
30
|
+
* `chartRightX` when every label fits.
|
|
31
|
+
*/
|
|
32
|
+
export declare function regionMarkerCanvasRightX(region: PositionedIncludeRegion, chartRightX: number): number;
|
|
33
|
+
/** The right end of `region`'s rightmost marker label, or 0 with none. */
|
|
34
|
+
export declare function regionMarkerLabelsRightX(region: PositionedIncludeRegion): number;
|
|
35
|
+
/**
|
|
36
|
+
* Seed a region's dated anchors into its context's edge maps at their x on
|
|
37
|
+
* the host's scale, the way the host seeds its own (`phases/place.ts`).
|
|
38
|
+
* An anchor outside the date window is skipped, as on the host.
|
|
39
|
+
*/
|
|
40
|
+
export declare function seedRegionAnchorEdges(anchors: ReadonlyMap<string, AnchorDeclaration>, ctx: LayoutContext): void;
|
|
41
|
+
//# sourceMappingURL=region-markers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"region-markers.d.ts","sourceRoot":"","sources":["../../src/nodes/region-markers.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAalG;;;GAGG;AACH,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAQ3C,0EAA0E;AAC1E,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAC9B,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,aAAa,EAClB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,GACpB,aAAa,CA6Cf;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,MAAM,GACpB,MAAM,CAaR;AAED,0EAA0E;AAC1E,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,uBAAuB,GAAG,MAAM,CAMhF;AA2CD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACjC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC/C,GAAG,EAAE,aAAa,GACnB,IAAI,CAKN"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// Region markers — an isolated region's own anchors and milestones, drawn
|
|
2
|
+
// in a marker row of the region's own, under its label tab
|
|
3
|
+
// (specs/rendering.md § Included Roadmap Region). The row packs with the
|
|
4
|
+
// host's packer and label rules, bounded by the region's dashed border
|
|
5
|
+
// instead of the chart; the region's lanes move down by its height, and
|
|
6
|
+
// each cut line stops at the region's last lane.
|
|
7
|
+
import { estimateTextWidth } from '../text-measure.js';
|
|
8
|
+
import { buildAnchors } from './anchor-node.js';
|
|
9
|
+
import { datePinnedMarkerEntries, markerArrows, markerLabelsRightX, markerRowPlacements, packMarkerRow, } from './marker-band.js';
|
|
10
|
+
import { MARKER_ROW_PITCH_PX } from './marker-geometry.js';
|
|
11
|
+
import { buildMilestones, positionMilestones } from './milestone-node.js';
|
|
12
|
+
/**
|
|
13
|
+
* How far a region's marker labels stay inside the region box on either
|
|
14
|
+
* side: the renderer's 8 px border inset plus 8 px of air.
|
|
15
|
+
*/
|
|
16
|
+
export const REGION_MARKER_INSET_X_PX = 16;
|
|
17
|
+
/** The region marker band's top, below the region's top border. */
|
|
18
|
+
const REGION_MARKER_BAND_TOP_PX = 8;
|
|
19
|
+
/** Air between the region marker band and the region's first lane. */
|
|
20
|
+
const REGION_MARKER_BAND_GAP_PX = 6;
|
|
21
|
+
/**
|
|
22
|
+
* Place `region`'s anchors and milestones once its lanes are laid out
|
|
23
|
+
* from `lanesTopY` down to `lanesBottomY`, inside a region whose top
|
|
24
|
+
* border is at `regionTopY`. The pack is bounded by the region's left
|
|
25
|
+
* inset and by `chartRightX` (the canvas before finalize grows it) less
|
|
26
|
+
* the right inset; a label that fits on neither side packs to the right
|
|
27
|
+
* and finalize f3 grows the canvas for it (`regionMarkerCanvasRightX`).
|
|
28
|
+
* The caller shifts the lanes by `laneShift`.
|
|
29
|
+
*/
|
|
30
|
+
export function placeRegionMarkers(region, ctx, regionTopY, lanesTopY, lanesBottomY, chartRightX) {
|
|
31
|
+
// A milestone `after:` an anchor reads the anchor's edge. Without waves
|
|
32
|
+
// the edges are already seeded for the lanes; with waves they are
|
|
33
|
+
// seeded here, after the lanes, so the lanes still see only the wave
|
|
34
|
+
// edges.
|
|
35
|
+
seedRegionAnchorEdges(region.content.anchors, ctx);
|
|
36
|
+
const placements = buildMilestones(region.content.milestones, ctx);
|
|
37
|
+
const entries = regionMarkerEntries(region.content.anchors, placements, ctx);
|
|
38
|
+
if (entries.length === 0)
|
|
39
|
+
return { anchors: [], milestones: [], laneShift: 0 };
|
|
40
|
+
const leftX = REGION_MARKER_INSET_X_PX;
|
|
41
|
+
const packed = packMarkerRow(entries, leftX, markerLabelsRightX(entries, leftX, chartRightX - REGION_MARKER_INSET_X_PX, estimateTextWidth), estimateTextWidth, markerArrows(placements));
|
|
42
|
+
const bandTopY = regionTopY + REGION_MARKER_BAND_TOP_PX;
|
|
43
|
+
const laneShift = bandTopY + packed.rowCount * MARKER_ROW_PITCH_PX + REGION_MARKER_BAND_GAP_PX - lanesTopY;
|
|
44
|
+
const cutBottomY = lanesBottomY + laneShift;
|
|
45
|
+
const rows = markerRowPlacements(packed.placements, bandTopY);
|
|
46
|
+
ctx.markerRowPlacements = rows;
|
|
47
|
+
ctx.chartTopY = lanesTopY + laneShift;
|
|
48
|
+
ctx.swimlaneBottomY = cutBottomY;
|
|
49
|
+
const anchors = buildAnchors(region.content.anchors, ctx, new Set());
|
|
50
|
+
// Placement read each item predecessor's y before the lanes moved; an
|
|
51
|
+
// arrow from a region marker starts on its row in `rows`.
|
|
52
|
+
const milestones = positionMilestones(placements.map((p) => ({
|
|
53
|
+
...p,
|
|
54
|
+
cutTopY: ctx.chartTopY,
|
|
55
|
+
cutBottomY,
|
|
56
|
+
slackArrows: p.slackArrows?.map((a) => ('y' in a ? { x: a.x, y: a.y + laneShift } : a)),
|
|
57
|
+
})), rows);
|
|
58
|
+
return { anchors, milestones, laneShift };
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The canvas right edge `region`'s marker labels need: a label that fits
|
|
62
|
+
* on neither side of its marker inside the region's insets grows the
|
|
63
|
+
* canvas until it fits on the right, the host's marker-row rule. Returns
|
|
64
|
+
* `chartRightX` when every label fits.
|
|
65
|
+
*/
|
|
66
|
+
export function regionMarkerCanvasRightX(region, chartRightX) {
|
|
67
|
+
const entries = [
|
|
68
|
+
...(region.anchors ?? []).map((a) => positionedEntry(a, false)),
|
|
69
|
+
...(region.milestones ?? []).map((m) => positionedEntry(m, true)),
|
|
70
|
+
];
|
|
71
|
+
if (entries.length === 0)
|
|
72
|
+
return chartRightX;
|
|
73
|
+
const rightX = markerLabelsRightX(entries, region.box.x + REGION_MARKER_INSET_X_PX, chartRightX - REGION_MARKER_INSET_X_PX, estimateTextWidth);
|
|
74
|
+
return rightX + REGION_MARKER_INSET_X_PX;
|
|
75
|
+
}
|
|
76
|
+
/** The right end of `region`'s rightmost marker label, or 0 with none. */
|
|
77
|
+
export function regionMarkerLabelsRightX(region) {
|
|
78
|
+
let rightX = 0;
|
|
79
|
+
for (const m of [...(region.anchors ?? []), ...(region.milestones ?? [])]) {
|
|
80
|
+
rightX = Math.max(rightX, m.labelBox.x + m.labelBox.width);
|
|
81
|
+
}
|
|
82
|
+
return rightX;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The host's marker order: the date-pinned anchors, the dated milestones,
|
|
86
|
+
* then the after-only ones, so the stable sort in `packMarkerRow` breaks
|
|
87
|
+
* a tie on x the same way the host's band does.
|
|
88
|
+
*/
|
|
89
|
+
function regionMarkerEntries(anchors, milestones, ctx) {
|
|
90
|
+
const entries = datePinnedMarkerEntries(anchors, new Map(), ctx.scale);
|
|
91
|
+
const milestoneEntry = (m) => ({
|
|
92
|
+
id: m.id,
|
|
93
|
+
centerX: m.slipX ?? m.x,
|
|
94
|
+
radius: m.radius,
|
|
95
|
+
title: m.title,
|
|
96
|
+
fontSize: 10,
|
|
97
|
+
bold: true,
|
|
98
|
+
...(m.slipX !== undefined ? { slipFromX: m.x } : {}),
|
|
99
|
+
});
|
|
100
|
+
entries.push(...milestones.filter((m) => m.fixed).map(milestoneEntry));
|
|
101
|
+
entries.push(...milestones.filter((m) => !m.fixed).map(milestoneEntry));
|
|
102
|
+
return entries;
|
|
103
|
+
}
|
|
104
|
+
function positionedEntry(m, bold) {
|
|
105
|
+
// A slipped milestone's label sits at its slipped diamond.
|
|
106
|
+
const slipX = 'slip' in m ? m.slip?.x : undefined;
|
|
107
|
+
return {
|
|
108
|
+
id: m.id ?? '',
|
|
109
|
+
centerX: slipX ?? m.center.x,
|
|
110
|
+
radius: m.radius,
|
|
111
|
+
title: m.title,
|
|
112
|
+
fontSize: 10,
|
|
113
|
+
bold,
|
|
114
|
+
// The label is forced right of the slipped diamond, as in the pack
|
|
115
|
+
// (`regionMarkerEntries`) and f3's host entries.
|
|
116
|
+
...(slipX !== undefined ? { slipFromX: m.center.x } : {}),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Seed a region's dated anchors into its context's edge maps at their x on
|
|
121
|
+
* the host's scale, the way the host seeds its own (`phases/place.ts`).
|
|
122
|
+
* An anchor outside the date window is skipped, as on the host.
|
|
123
|
+
*/
|
|
124
|
+
export function seedRegionAnchorEdges(anchors, ctx) {
|
|
125
|
+
for (const e of datePinnedMarkerEntries(anchors, new Map(), ctx.scale)) {
|
|
126
|
+
ctx.entityLeftEdges.set(e.id, e.centerX);
|
|
127
|
+
ctx.entityRightEdges.set(e.id, e.centerX);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=region-markers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"region-markers.js","sourceRoot":"","sources":["../../src/nodes/region-markers.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,2DAA2D;AAC3D,yEAAyE;AACzE,uEAAuE;AACvE,wEAAwE;AACxE,iDAAiD;AAIjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACH,uBAAuB,EAEvB,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAA2B,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEnG;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAE3C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EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QACzC,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;AACL,CAAC"}
|
|
@@ -1,76 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CalendarConfig } from '../calendar.js';
|
|
1
|
+
import type { NowlineFile, ResolveResult } from '@nowline/core';
|
|
3
2
|
import type { LayoutOptions, LayoutResult } from '../layout.js';
|
|
4
|
-
import type {
|
|
5
|
-
import type { BoundingBox, PositionedDependencyEdge, PositionedIncludeRegion, PositionedNowline, PositionedSwimlane } from '../types.js';
|
|
6
|
-
import type { ViewPreset } from '../view-preset.js';
|
|
7
|
-
/** Sized output from the beside-mode header word-wrap pass. */
|
|
8
|
-
export interface SizedHeader {
|
|
9
|
-
titleLines: string[];
|
|
10
|
-
authorLines: string[];
|
|
11
|
-
cardWidth: number;
|
|
12
|
-
cardHeight: number;
|
|
13
|
-
boxWidth: number;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Bundle of orchestration + sequencer helpers RoadmapNode delegates to.
|
|
17
|
-
* `layout.ts` builds this struct from its private helpers and passes it
|
|
18
|
-
* once when calling `RoadmapNode.place(...)`.
|
|
19
|
-
*/
|
|
20
|
-
export interface RoadmapNodeDeps extends LayoutHelpers {
|
|
21
|
-
computeDateWindow: (file: NowlineFile, ctx: {
|
|
22
|
-
cal: CalendarConfig;
|
|
23
|
-
sizes: Map<string, import('../types.js').ResolvedSize>;
|
|
24
|
-
}, resolved: ResolveResult, today: Date | undefined, scale: ViewPreset) => {
|
|
25
|
-
startDate: Date;
|
|
26
|
-
endDate: Date;
|
|
27
|
-
};
|
|
28
|
-
sizeBesideHeader: (title: string, author: string | undefined) => SizedHeader;
|
|
29
|
-
collectItems: (swimlanes: SwimlaneDeclaration[]) => Map<string, ItemDeclaration>;
|
|
30
|
-
buildDependencies: (items: Map<string, ItemDeclaration>, swimlanes: PositionedSwimlane[], includes: PositionedIncludeRegion[], ctx: LayoutContext) => PositionedDependencyEdge[];
|
|
31
|
-
buildNowline: (today: Date | undefined, ctx: LayoutContext, locale: string) => PositionedNowline | null;
|
|
32
|
-
}
|
|
3
|
+
import type { RoadmapSchedule } from '../schedule.js';
|
|
33
4
|
export declare class RoadmapNode {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
fontSize: number;
|
|
42
|
-
bold: boolean;
|
|
43
|
-
}
|
|
44
|
-
interface PackedPlacement {
|
|
45
|
-
rowIndex: number;
|
|
46
|
-
labelBox: BoundingBox;
|
|
47
|
-
labelSide: 'left' | 'right';
|
|
5
|
+
/**
|
|
6
|
+
* `schedule` is the roadmap's day schedule (engine C), built once by
|
|
7
|
+
* `layoutRoadmap` or handed in through `LayoutOptions.schedule`. The date
|
|
8
|
+
* window is a projection of it, and `schedule.plan` (the wave plan,
|
|
9
|
+
* undefined without waves) drives the barrier passes below (engine A).
|
|
10
|
+
*/
|
|
11
|
+
place(file: NowlineFile, resolved: ResolveResult, options: LayoutOptions, schedule: RoadmapSchedule): LayoutResult;
|
|
48
12
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Pack anchors + milestones into marker rows using a bottom-first
|
|
51
|
-
* tick-order strategy. Markers default to the row CLOSEST to the
|
|
52
|
-
* chart; conflicts push them UP toward the date ticks (the inverse of
|
|
53
|
-
* swimlane items which default to the top and push down).
|
|
54
|
-
*
|
|
55
|
-
* Walk order is left-to-right by `centerX` (tick order, not file
|
|
56
|
-
* declaration). For each marker:
|
|
57
|
-
* 1. Try the bottommost existing row (highest `rowIndex`), right
|
|
58
|
-
* side first then left, working UP through the rows.
|
|
59
|
-
* 2. If neither side fits at any existing row, GROW: prepend a new
|
|
60
|
-
* row at `rowIndex = 0`. Every previously-placed marker has its
|
|
61
|
-
* `rowIndex` incremented by 1 so the bottom corridor stays
|
|
62
|
-
* stable as the band expands upward toward the ticks.
|
|
63
|
-
*
|
|
64
|
-
* Returns row-relative placements (no centerY yet — caller fills that
|
|
65
|
-
* in once `markerRowY` is known). Row indices follow the existing
|
|
66
|
-
* convention: 0 = top of band (closest to ticks), `rowCount - 1` =
|
|
67
|
-
* bottom of band (closest to chart). The "bottom-first" preference
|
|
68
|
-
* lives entirely in the search order and grow direction; geometry
|
|
69
|
-
* stays anchored to `markerRowY` at the top.
|
|
70
|
-
*/
|
|
71
|
-
export declare function packMarkerRow(entries: MarkerEntity[], chartLeftX: number, chartRightX: number, estimateTextWidth: (text: string, fontSize: number) => number): {
|
|
72
|
-
placements: Map<string, PackedPlacement>;
|
|
73
|
-
rowCount: number;
|
|
74
|
-
};
|
|
75
|
-
export {};
|
|
76
13
|
//# sourceMappingURL=roadmap-node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roadmap-node.d.ts","sourceRoot":"","sources":["../../src/nodes/roadmap-node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"roadmap-node.d.ts","sourceRoot":"","sources":["../../src/nodes/roadmap-node.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,qBAAa,WAAW;IACpB;;;;;OAKG;IACH,KAAK,CACD,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,eAAe,GAC1B,YAAY,CA0Bd;CACJ"}
|