@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,41 +1,145 @@
|
|
|
1
|
-
// FootnoteNode +
|
|
2
|
-
// chart. Each footnote gets a stable index (1-based,
|
|
1
|
+
// FootnoteNode + indexFootnotes / buildFootnotePanel — footnote area at the bottom of the
|
|
2
|
+
// chart. Each footnote gets a stable index (1-based, in document order) and
|
|
3
3
|
// records its `on:` host references so item / swimlane sequencing can
|
|
4
|
-
// emit the matching superscript indicators.
|
|
5
|
-
//
|
|
4
|
+
// emit the matching superscript indicators. An isolated region's
|
|
5
|
+
// footnotes continue the numbering after the host's, in include order,
|
|
6
|
+
// and share the one panel under a heading row with the region's title.
|
|
7
|
+
// An entry whose text does not fit the panel's width wraps onto more
|
|
8
|
+
// rows at the title's x. The panel grows to fit: 28 px header + (entry
|
|
9
|
+
// rows and region headings × FOOTNOTE_ROW_HEIGHT) + 16 px padding.
|
|
6
10
|
import { propValues } from '../dsl-utils.js';
|
|
7
11
|
import { resolveStyle } from '../style-resolution.js';
|
|
12
|
+
import { estimateTextWidth, wrapText } from '../text-measure.js';
|
|
8
13
|
import { FOOTNOTE_HEADER_HEIGHT_PX, FOOTNOTE_PANEL_PADDING_PX, FOOTNOTE_ROW_HEIGHT, } from '../themes/shared.js';
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Pure: depends only on the footnote declarations. Numbers start after
|
|
16
|
+
* `precedingCount` (an isolated region continues after the host and the
|
|
17
|
+
* regions before it). The map's order is document order: the resolver
|
|
18
|
+
* inserts a file's own footnotes as declared, then each merged include's.
|
|
19
|
+
*/
|
|
20
|
+
export function indexFootnotes(footnotes, precedingCount = 0) {
|
|
11
21
|
const index = new Map();
|
|
12
22
|
const hosts = new Map();
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const n = i + 1;
|
|
16
|
-
index.set(id, n);
|
|
23
|
+
[...footnotes.entries()].forEach(([id, f], i) => {
|
|
24
|
+
index.set(id, precedingCount + i + 1);
|
|
17
25
|
hosts.set(id, propValues(f.properties, 'on'));
|
|
18
|
-
entries.push({
|
|
19
|
-
number: n,
|
|
20
|
-
title: f.title ?? id,
|
|
21
|
-
description: f.description?.text,
|
|
22
|
-
style: resolveStyle('footnote', f.properties, ctx.styleCtx),
|
|
23
|
-
});
|
|
24
26
|
});
|
|
27
|
+
return { index, hosts };
|
|
28
|
+
}
|
|
29
|
+
/** Font sizes (px) of an entry's title and description. */
|
|
30
|
+
const FOOTNOTE_TEXT_FONT_SIZE_PX = 11;
|
|
31
|
+
/** The description column never starts closer than this to the title's x. */
|
|
32
|
+
const FOOTNOTE_DESCRIPTION_MIN_OFFSET_PX = 120;
|
|
33
|
+
/** Per-character advance the description column is placed by. */
|
|
34
|
+
const FOOTNOTE_TITLE_CHAR_ADVANCE_PX = 6;
|
|
35
|
+
const DESCRIPTION_LEAD = '— ';
|
|
36
|
+
/**
|
|
37
|
+
* The panel below the chart, spanning the final canvas (`chartRightX`):
|
|
38
|
+
* the host's footnotes, then each region's under its title, each in
|
|
39
|
+
* document order. The canvas does not grow for the panel: an entry whose
|
|
40
|
+
* title or description runs past the panel's inner right edge wraps onto
|
|
41
|
+
* more rows, which start at the title's x and use the whole width.
|
|
42
|
+
*/
|
|
43
|
+
export function buildFootnotePanel(footnotes, ctx, chartBottomY, chartRightX, regions = []) {
|
|
44
|
+
const boxX = FOOTNOTE_PANEL_PADDING_PX;
|
|
45
|
+
const boxY = chartBottomY + FOOTNOTE_PANEL_PADDING_PX;
|
|
46
|
+
const boxWidth = chartRightX - 2 * FOOTNOTE_PANEL_PADDING_PX;
|
|
47
|
+
const titleX = boxX + 2 * FOOTNOTE_PANEL_PADDING_PX;
|
|
48
|
+
const textRightX = boxX + boxWidth - FOOTNOTE_PANEL_PADDING_PX;
|
|
49
|
+
const firstRowY = boxY + FOOTNOTE_HEADER_HEIGHT_PX + FOOTNOTE_PANEL_PADDING_PX;
|
|
50
|
+
const entries = [];
|
|
51
|
+
let row = 0;
|
|
52
|
+
const add = (decls, source, region) => {
|
|
53
|
+
for (const [id, f] of decls) {
|
|
54
|
+
const title = f.title ?? id;
|
|
55
|
+
const description = f.description?.text;
|
|
56
|
+
const lines = entryLines(title, description, titleX, textRightX);
|
|
57
|
+
const y = firstRowY + row * FOOTNOTE_ROW_HEIGHT;
|
|
58
|
+
const at = (l) => ({
|
|
59
|
+
x: l.x,
|
|
60
|
+
y: y + l.row * FOOTNOTE_ROW_HEIGHT,
|
|
61
|
+
text: l.text,
|
|
62
|
+
});
|
|
63
|
+
const entry = {
|
|
64
|
+
number: source.footnoteIndex.get(id) ?? entries.length + 1,
|
|
65
|
+
y,
|
|
66
|
+
title,
|
|
67
|
+
titleLines: lines.title.map(at),
|
|
68
|
+
description,
|
|
69
|
+
style: resolveStyle('footnote', f.properties, source.styleCtx),
|
|
70
|
+
};
|
|
71
|
+
if (lines.description.length > 0)
|
|
72
|
+
entry.descriptionLines = lines.description.map(at);
|
|
73
|
+
if (region !== undefined)
|
|
74
|
+
entry.region = region;
|
|
75
|
+
entries.push(entry);
|
|
76
|
+
row += lines.rows;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
add(footnotes, ctx);
|
|
80
|
+
for (const r of regions) {
|
|
81
|
+
if (r.footnotes.size === 0)
|
|
82
|
+
continue;
|
|
83
|
+
// The region's heading takes a row of its own above its entries.
|
|
84
|
+
const headingY = firstRowY + row * FOOTNOTE_ROW_HEIGHT;
|
|
85
|
+
row += 1;
|
|
86
|
+
const first = entries.length;
|
|
87
|
+
add(r.footnotes, r.ctx, r.title);
|
|
88
|
+
entries[first].regionHeadingY = headingY;
|
|
89
|
+
}
|
|
25
90
|
const box = {
|
|
26
|
-
x:
|
|
27
|
-
y:
|
|
28
|
-
width:
|
|
91
|
+
x: boxX,
|
|
92
|
+
y: boxY,
|
|
93
|
+
width: boxWidth,
|
|
29
94
|
height: entries.length === 0
|
|
30
95
|
? 0
|
|
31
|
-
: FOOTNOTE_HEADER_HEIGHT_PX +
|
|
32
|
-
entries.length * FOOTNOTE_ROW_HEIGHT +
|
|
33
|
-
FOOTNOTE_PANEL_PADDING_PX,
|
|
96
|
+
: FOOTNOTE_HEADER_HEIGHT_PX + row * FOOTNOTE_ROW_HEIGHT + FOOTNOTE_PANEL_PADDING_PX,
|
|
34
97
|
};
|
|
98
|
+
return { box, entries };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Wrap one entry into rows. The title starts at `titleX`; the description
|
|
102
|
+
* follows on the title's row at the description column (`— ` first) and
|
|
103
|
+
* wraps at `titleX`. A wrapped title, or a description whose first word
|
|
104
|
+
* does not fit beside the title, starts the description on a row of its
|
|
105
|
+
* own. A single word wider than the panel stays whole on its row, as
|
|
106
|
+
* `wrapText` never splits a word.
|
|
107
|
+
*/
|
|
108
|
+
function entryLines(title, description, titleX, textRightX) {
|
|
109
|
+
const fullWidth = textRightX - titleX;
|
|
110
|
+
const titleRows = fitsOrWraps(title, fullWidth, fullWidth);
|
|
111
|
+
const titleLines = titleRows.map((text, row) => ({ x: titleX, row, text }));
|
|
112
|
+
if (!description)
|
|
113
|
+
return { title: titleLines, description: [], rows: titleRows.length };
|
|
114
|
+
const leadWidth = estimateTextWidth(DESCRIPTION_LEAD, FOOTNOTE_TEXT_FONT_SIZE_PX);
|
|
115
|
+
const firstWord = description.trim().split(/\s+/)[0] ?? '';
|
|
116
|
+
const columnX = titleX +
|
|
117
|
+
Math.max(FOOTNOTE_DESCRIPTION_MIN_OFFSET_PX, title.length * FOOTNOTE_TITLE_CHAR_ADVANCE_PX);
|
|
118
|
+
const besideTitle = titleRows.length === 1 &&
|
|
119
|
+
leadWidth + estimateTextWidth(firstWord, FOOTNOTE_TEXT_FONT_SIZE_PX) <=
|
|
120
|
+
textRightX - columnX;
|
|
121
|
+
const firstX = besideTitle ? columnX : titleX;
|
|
122
|
+
const firstRow = besideTitle ? titleRows.length - 1 : titleRows.length;
|
|
123
|
+
const rows = fitsOrWraps(description, fullWidth, textRightX - firstX - leadWidth);
|
|
124
|
+
const descriptionLines = rows.map((text, i) => ({
|
|
125
|
+
x: i === 0 ? firstX : titleX,
|
|
126
|
+
row: firstRow + i,
|
|
127
|
+
text: i === 0 ? `${DESCRIPTION_LEAD}${text}` : text,
|
|
128
|
+
}));
|
|
35
129
|
return {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
130
|
+
title: titleLines,
|
|
131
|
+
description: descriptionLines,
|
|
132
|
+
rows: firstRow + rows.length,
|
|
39
133
|
};
|
|
40
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* `text` as is when it fits `firstWidth`, else wrapped (`wrapText`, which
|
|
137
|
+
* collapses whitespace), so an entry that fits keeps its exact text.
|
|
138
|
+
*/
|
|
139
|
+
function fitsOrWraps(text, width, firstWidth) {
|
|
140
|
+
if (estimateTextWidth(text, FOOTNOTE_TEXT_FONT_SIZE_PX) <= firstWidth)
|
|
141
|
+
return [text];
|
|
142
|
+
const rows = wrapText(text, width, FOOTNOTE_TEXT_FONT_SIZE_PX, firstWidth);
|
|
143
|
+
return rows.length > 0 ? rows : [text];
|
|
144
|
+
}
|
|
41
145
|
//# sourceMappingURL=footnote-node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footnote-node.js","sourceRoot":"","sources":["../../src/nodes/footnote-node.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"foot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{
|
|
5
|
-
sequenceItem: (child: ItemDeclaration, cursor: TrackCursor, ctx: LayoutContext, ownerOverride?: string) => PositionedItem;
|
|
6
|
-
sequenceOne: (child: ItemDeclaration | GroupBlock | ParallelBlock, cursor: TrackCursor, ctx: LayoutContext) => PositionedTrackChild;
|
|
7
|
-
resolveChildStart: (props: EntityProperty[], seqDefault: number, laneLeftX: number, ctx: LayoutContext) => number;
|
|
8
|
-
newCursor: (x: number, y: number) => TrackCursor;
|
|
9
|
-
estimateTextWidth: (text: string, fontSize: number) => number;
|
|
10
|
-
/** Predict the extra vertical height an item's wrapped label-chip
|
|
11
|
-
* rows will add to its bar; used to size the row-packer's row
|
|
12
|
-
* pitch ahead of the call to `sequenceItem`. */
|
|
13
|
-
predictItemChipExtraHeight: (item: ItemDeclaration, ctx: LayoutContext) => number;
|
|
14
|
-
}
|
|
1
|
+
import type { GroupBlock } from '@nowline/core';
|
|
2
|
+
import type { LayoutContext, LayoutHelpers, TrackCursor } from '../layout-context.js';
|
|
3
|
+
import type { PositionedGroup } from '../types.js';
|
|
15
4
|
export declare class GroupNode {
|
|
16
5
|
readonly node: GroupBlock;
|
|
17
|
-
private readonly
|
|
18
|
-
constructor(node: GroupBlock,
|
|
6
|
+
private readonly helpers;
|
|
7
|
+
constructor(node: GroupBlock, helpers: LayoutHelpers);
|
|
19
8
|
get id(): string;
|
|
20
9
|
/**
|
|
21
|
-
* Sequence children inside the group's
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* `PositionedGroup` whose
|
|
25
|
-
*
|
|
10
|
+
* Sequence children inside the group's body, advance the parent
|
|
11
|
+
* `cursor` to the group's end in time (its children's duration ends,
|
|
12
|
+
* never a caption spill or a header title), and return a
|
|
13
|
+
* `PositionedGroup` whose box covers the header, the padded rows and
|
|
14
|
+
* the group's dates.
|
|
26
15
|
*/
|
|
27
16
|
place(cursor: TrackCursor, ctx: LayoutContext): PositionedGroup;
|
|
28
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-node.d.ts","sourceRoot":"","sources":["../../src/nodes/group-node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"group-node.d.ts","sourceRoot":"","sources":["../../src/nodes/group-node.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIhD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGtF,OAAO,KAAK,EAAe,eAAe,EAAE,MAAM,aAAa,CAAC;AAIhE,qBAAa,SAAS;aAEE,IAAI,EAAE,UAAU;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAF5B,YACoB,IAAI,EAAE,UAAU,EACf,OAAO,EAAE,aAAa,EACvC;IAEJ,IAAI,EAAE,IAAI,MAAM,CAEf;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,aAAa,GAAG,eAAe,CAgG9D;CACJ"}
|
package/dist/nodes/group-node.js
CHANGED
|
@@ -1,193 +1,120 @@
|
|
|
1
1
|
// GroupNode — Renderable for a `group { ... }` block. Sequences
|
|
2
|
-
// children inside the group's
|
|
3
|
-
//
|
|
4
|
-
// with a sibling's `rightEdge`, caption `spillX`, or a
|
|
5
|
-
// corridor bumps to a new row inside the group.
|
|
6
|
-
// `box.height` grows with the row stack so parent containers stack
|
|
7
|
-
// against the actual painted extent.
|
|
2
|
+
// children inside the group's body through `sequenceRowTrack`
|
|
3
|
+
// (row-track.ts), the loop `SwimlaneNode` uses, so an item whose desired
|
|
4
|
+
// start collides with a sibling's `rightEdge`, caption `spillX`, or a
|
|
5
|
+
// slack-arrow corridor bumps to a new row inside the group.
|
|
8
6
|
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
import { propValues } from '../dsl-utils.js';
|
|
7
|
+
// The group is drawn above and around its content, never beside it
|
|
8
|
+
// (specs/true-width-layout.md §3.3): a header band (title, inline-date
|
|
9
|
+
// glyphs, a bracket spanning exactly its dates) over a body padded above
|
|
10
|
+
// and below its rows. Its box spans exactly its children's earliest start
|
|
11
|
+
// and latest end; see `container-header-geometry.ts`.
|
|
12
|
+
import { containerChrome } from '../container-header-geometry.js';
|
|
13
|
+
import { propValue, propValues } from '../dsl-utils.js';
|
|
16
14
|
import { computeContainerInlineDatePins, pickInlineDate } from '../inline-date-pin-geometry.js';
|
|
17
|
-
import {
|
|
15
|
+
import { resolvePinnedOrSequentialStart } from '../start-rules.js';
|
|
18
16
|
import { resolveStyle } from '../style-resolution.js';
|
|
19
|
-
import {
|
|
17
|
+
import { waveFloorX } from '../wave-layout.js';
|
|
18
|
+
import { sequenceRowTrack } from './row-track.js';
|
|
20
19
|
export class GroupNode {
|
|
21
20
|
node;
|
|
22
|
-
|
|
23
|
-
constructor(node,
|
|
21
|
+
helpers;
|
|
22
|
+
constructor(node, helpers) {
|
|
24
23
|
this.node = node;
|
|
25
|
-
this.
|
|
24
|
+
this.helpers = helpers;
|
|
26
25
|
}
|
|
27
26
|
get id() {
|
|
28
27
|
return this.node.name ?? '';
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
31
|
-
* Sequence children inside the group's
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* `PositionedGroup` whose
|
|
35
|
-
*
|
|
30
|
+
* Sequence children inside the group's body, advance the parent
|
|
31
|
+
* `cursor` to the group's end in time (its children's duration ends,
|
|
32
|
+
* never a caption spill or a header title), and return a
|
|
33
|
+
* `PositionedGroup` whose box covers the header, the padded rows and
|
|
34
|
+
* the group's dates.
|
|
36
35
|
*/
|
|
37
36
|
place(cursor, ctx) {
|
|
38
37
|
const { node } = this;
|
|
39
|
-
const {
|
|
38
|
+
const { helpers } = this;
|
|
40
39
|
const style = resolveStyle('group', node.properties, ctx.styleCtx);
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
// The group starts after every `after:` term, then its own wave and
|
|
41
|
+
// its lead wave floor it, so its box never opens in a column before
|
|
42
|
+
// its first piece of work (specs/waves.md §5.1). A lane child's
|
|
43
|
+
// cursor already sits there (`resolveChildStart`), so this is the
|
|
44
|
+
// identity for it; a parallel's group track starts at the parallel's
|
|
45
|
+
// start, so this is where its `after:` applies
|
|
46
|
+
// (specs/scheduler-unification.md §8 decision 5).
|
|
47
|
+
const startX = waveFloorX(node, resolvePinnedOrSequentialStart(node.properties, cursor.x, ctx), ctx);
|
|
48
|
+
// In a roadmap with waves, a group with no title, no `style:` and
|
|
49
|
+
// no `labels:` that carries `wave:` only assigns membership: it
|
|
50
|
+
// draws nothing, which would otherwise sit exactly on the wave
|
|
51
|
+
// boundary its box opens at, and reserves nothing
|
|
52
|
+
// (specs/waves.md §9.7). An id alone does not make it titled
|
|
53
|
+
// (Example 4's `api-track`).
|
|
54
|
+
const waveOnly = ctx.waves !== undefined &&
|
|
55
|
+
node.title === undefined &&
|
|
56
|
+
propValue(node.properties, 'wave') !== undefined &&
|
|
57
|
+
propValue(node.properties, 'style') === undefined &&
|
|
58
|
+
propValues(node.properties, 'labels').length === 0;
|
|
59
|
+
const title = waveOnly ? undefined : (node.title ?? node.name);
|
|
43
60
|
// Group children chain in time inside the group, so they
|
|
44
61
|
// form one sub-flow under the parent's flow path. See
|
|
45
62
|
// `LayoutContext.currentFlowKey`.
|
|
46
63
|
const previousFlowKey = ctx.currentFlowKey;
|
|
47
64
|
ctx.nextGroupId += 1;
|
|
48
65
|
ctx.currentFlowKey = `${previousFlowKey}/group:${node.name ?? `group-${ctx.nextGroupId}`}`;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// reservation, two bracket-titled groups stacked in a parallel
|
|
57
|
-
// collide: the previous sibling's bracket-foot ends at its
|
|
58
|
-
// box.bottom, and the next sibling's label visual top sits just
|
|
59
|
-
// above box.y — they touch in the gap. Shift `box.y` down by
|
|
60
|
-
// the overhang amount so the glyph lands in space we own.
|
|
61
|
-
const bracketLabelOverhang = !hasChiclet && title ? GROUP_BRACKET_LABEL_OVERHANG_PX : 0;
|
|
62
|
-
const startY = cursor.y + bracketLabelOverhang;
|
|
63
|
-
const step = ctx.bandScale.step();
|
|
64
|
-
const groupContentLeftX = startX;
|
|
65
|
-
const packer = new RowPacker({
|
|
66
|
-
laneLeftX: groupContentLeftX,
|
|
67
|
-
originY: startY + topPad,
|
|
68
|
-
minRowHeight: step,
|
|
69
|
-
slackCorridors: ctx.slackCorridors,
|
|
66
|
+
const afterDate = pickInlineDate(propValues(node.properties, 'after'));
|
|
67
|
+
const beforeDate = pickInlineDate(propValues(node.properties, 'before'));
|
|
68
|
+
const chrome = containerChrome({
|
|
69
|
+
drawn: !waveOnly,
|
|
70
|
+
hasTitle: Boolean(title),
|
|
71
|
+
hasPins: Boolean(afterDate || beforeDate),
|
|
72
|
+
hasBracket: style.bracket !== 'none',
|
|
70
73
|
});
|
|
71
|
-
|
|
72
|
-
const children =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const blockHeight = Math.max(step, innerCursor.height);
|
|
85
|
-
packer.commitBlock({
|
|
86
|
-
rowIndex,
|
|
87
|
-
placed: positioned,
|
|
88
|
-
blockHeight,
|
|
89
|
-
blockEnd,
|
|
90
|
-
});
|
|
91
|
-
timeCursorX = Math.max(timeCursorX, blockEnd);
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
const props = child.properties;
|
|
95
|
-
const desiredStart = deps.resolveChildStart(props, timeCursorX, groupContentLeftX, ctx);
|
|
96
|
-
// Predict logical extent so the row-packer can bump on
|
|
97
|
-
// collision before we hand off to `sequenceItem`. Mirrors
|
|
98
|
-
// SwimlaneNode's pre-flight width math.
|
|
99
|
-
const durationDays = deriveItemDurationDays(props, ctx.sizes, ctx.cal);
|
|
100
|
-
const naturalWidth = Math.max(MIN_ITEM_WIDTH, durationDays * ctx.timeline.pixelsPerDay);
|
|
101
|
-
const desiredEnd = desiredStart + naturalWidth;
|
|
102
|
-
const childId = child.name ?? '';
|
|
103
|
-
const chipExtra = deps.predictItemChipExtraHeight(child, ctx);
|
|
104
|
-
const predictedHeight = step + chipExtra;
|
|
105
|
-
const { rowIndex, y: rowY } = packer.placeItem({
|
|
106
|
-
childId,
|
|
107
|
-
desiredStart,
|
|
108
|
-
desiredEnd,
|
|
109
|
-
// Row pitch = `step()` + extra chip-row height. Keeps
|
|
110
|
-
// the inter-row visible gap (= step - bandwidth) intact
|
|
111
|
-
// when an item's labels wrap and grow the bar.
|
|
112
|
-
predictedHeight,
|
|
113
|
-
});
|
|
114
|
-
const innerCursor = deps.newCursor(desiredStart, rowY);
|
|
115
|
-
const positioned = deps.sequenceItem(child, innerCursor, ctx);
|
|
116
|
-
children.push(positioned);
|
|
117
|
-
const itemLogicalEnd = positioned.box.x + positioned.box.width + ITEM_INSET_PX;
|
|
118
|
-
timeCursorX = Math.max(timeCursorX, itemLogicalEnd);
|
|
119
|
-
let spillReservation = null;
|
|
120
|
-
const hasAnySpill = positioned.textSpills ||
|
|
121
|
-
positioned.chipsOutside ||
|
|
122
|
-
positioned.dotSpills ||
|
|
123
|
-
positioned.iconSpills ||
|
|
124
|
-
positioned.footnoteSpills;
|
|
125
|
-
if (hasAnySpill) {
|
|
126
|
-
const farRight = Math.max(positioned.decorationsRightX, positioned.chipsOutside ? positioned.chipsRightX : 0);
|
|
127
|
-
spillReservation = farRight + 6;
|
|
128
|
-
}
|
|
129
|
-
packer.commitItem({
|
|
130
|
-
rowIndex,
|
|
131
|
-
placed: positioned,
|
|
132
|
-
logicalEnd: itemLogicalEnd,
|
|
133
|
-
spillReservation,
|
|
134
|
-
rowHeight: predictedHeight,
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
const innerHeight = Math.max(step, packer.usedHeight());
|
|
138
|
-
// The group's painted box hugs everything its children put on
|
|
139
|
-
// screen, including caption text that spills past a bar's right
|
|
140
|
-
// edge. `usedRightX` is the rightmost extent any row reached —
|
|
141
|
-
// either a bar's logical right or a caption's reserved spill —
|
|
142
|
-
// so the orange tint visually "owns" the spilled title/meta.
|
|
143
|
-
//
|
|
144
|
-
// The cursor channel (`cursor.x` / `cursor.maxX`) stays on the
|
|
145
|
-
// COMPACT `timeCursorX` (bar logical ends only). Bubbling the
|
|
146
|
-
// wide `visualRightX` upward would propagate through
|
|
147
|
-
// `ParallelNode.maxRight → parallel.box.width → swimlane
|
|
148
|
-
// blockEnd → timeCursorX`, pushing every subsequent sibling
|
|
149
|
-
// right by the spill width — including siblings on entirely
|
|
150
|
-
// different rows of the parent swimlane. The painted box and
|
|
151
|
-
// the logical cursor advance are intentionally decoupled here.
|
|
152
|
-
const visualRightX = Math.max(timeCursorX, packer.usedRightX());
|
|
74
|
+
const track = sequenceRowTrack(node, { leftX: startX, firstRowY: cursor.y + chrome.header + chrome.pad }, ctx, helpers);
|
|
75
|
+
const { children, timeCursorX, timeStartX } = track;
|
|
76
|
+
// Every row's height carries the inter-row gap below it; the body
|
|
77
|
+
// ends `pad` below the last child's painted bottom, not below that
|
|
78
|
+
// gap, and the cursor adds the gap back after the body so a sibling
|
|
79
|
+
// stacked below keeps the same rhythm as two items.
|
|
80
|
+
const step = ctx.bandScale.step();
|
|
81
|
+
const interRowGap = step - ctx.bandScale.bandwidth();
|
|
82
|
+
const contentHeight = Math.max(step, track.packer.usedHeight()) - interRowGap;
|
|
83
|
+
// The bracket and body span exactly the children's dates
|
|
84
|
+
// (specs/true-width-layout.md §3.3): what the group paints past them
|
|
85
|
+
// (a spilled caption, its title) is footprint the row packer keeps,
|
|
86
|
+
// not width.
|
|
153
87
|
const box = {
|
|
154
|
-
x:
|
|
155
|
-
y:
|
|
156
|
-
width:
|
|
157
|
-
height:
|
|
88
|
+
x: timeStartX,
|
|
89
|
+
y: cursor.y,
|
|
90
|
+
width: timeCursorX - timeStartX,
|
|
91
|
+
height: chrome.header + chrome.pad + contentHeight + chrome.pad,
|
|
158
92
|
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
// (`step - bandwidth`) so a sibling stacked below in a
|
|
165
|
-
// `parallel` (or any track-pack consumer) doesn't butt
|
|
166
|
-
// right up against the group's bottom edge. Items naturally
|
|
167
|
-
// include that gap because they report `cursor.height = step`
|
|
168
|
-
// (bandwidth + gap); groups need to add it explicitly since
|
|
169
|
-
// their painted height is gap-less.
|
|
170
|
-
const interRowGap = ctx.bandScale.step() - ctx.bandScale.bandwidth();
|
|
171
|
-
cursor.height = Math.max(cursor.height, bracketLabelOverhang + box.height + interRowGap);
|
|
93
|
+
// A parallel joins on its tracks' ends, as engine C does
|
|
94
|
+
// (specs/scheduler-unification.md §8 decision 8).
|
|
95
|
+
cursor.startX = box.x;
|
|
96
|
+
cursor.x = timeCursorX;
|
|
97
|
+
cursor.height = Math.max(cursor.height, box.height + interRowGap);
|
|
172
98
|
const id = node.name;
|
|
99
|
+
// `after:` the group is a time path: its last child's duration end.
|
|
173
100
|
if (id) {
|
|
174
101
|
ctx.entityLeftEdges.set(id, box.x);
|
|
175
|
-
ctx.entityRightEdges.set(id,
|
|
102
|
+
ctx.entityRightEdges.set(id, timeCursorX);
|
|
176
103
|
}
|
|
177
104
|
ctx.currentFlowKey = previousFlowKey;
|
|
178
|
-
const inlineDatePins =
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
beforeDate: pickInlineDate(propValues(node.properties, 'before')),
|
|
182
|
-
});
|
|
105
|
+
const inlineDatePins = waveOnly
|
|
106
|
+
? []
|
|
107
|
+
: computeContainerInlineDatePins({ box, afterDate, beforeDate, title });
|
|
183
108
|
return {
|
|
184
109
|
kind: 'group',
|
|
185
110
|
id,
|
|
186
111
|
title,
|
|
187
112
|
box,
|
|
113
|
+
headerHeight: chrome.header,
|
|
188
114
|
children,
|
|
189
115
|
style,
|
|
190
116
|
inlineDatePins: inlineDatePins.length > 0 ? inlineDatePins : undefined,
|
|
117
|
+
...(waveOnly ? { waveOnly: true } : {}),
|
|
191
118
|
};
|
|
192
119
|
}
|
|
193
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-node.js","sourceRoot":"","sources":["../../src/nodes/group-node.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,
|
|
1
|
+
{"version":3,"file":"group-node.js","sourceRoot":"","sources":["../../src/nodes/group-node.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,8DAA8D;AAC9D,yEAAyE;AACzE,sEAAsE;AACtE,4DAA4D;AAC5D,EAAE;AACF,mEAAmE;AACnE,uEAAuE;AACvE,yEAAyE;AACzE,0EAA0E;AAC1E,sDAAsD;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,8BAA8B,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhG,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,OAAO,SAAS;IAEE,IAAI;IACH,OAAO;IAF5B,YACoB,IAAgB,EACf,OAAsB;oBADvB,IAAI;uBACH,OAAO;IACzB,CAAC;IAEJ,IAAI,EAAE;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;IAChC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAmB,EAAE,GAAkB;QACzC,MAAM,EAAE,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types.js';
|
|
3
|
+
export interface MeasuredHeader {
|
|
4
|
+
position: HeaderPosition;
|
|
5
|
+
titleLines: string[];
|
|
6
|
+
authorLines: string[];
|
|
7
|
+
cardWidth: number;
|
|
8
|
+
/** Card height, grown when the logo is taller than the text. */
|
|
9
|
+
cardHeight: number;
|
|
10
|
+
/** Card height the title / author text alone needs. */
|
|
11
|
+
textCardHeight: number;
|
|
12
|
+
/** Width the logo takes left of the text, gap included; 0 without a logo. */
|
|
13
|
+
logoSlot: number;
|
|
14
|
+
logo?: ScaledLogo;
|
|
15
|
+
/** Beside: the card's box width, which is also `chartLeftX`. Above: 0. */
|
|
16
|
+
chartLeftX: number;
|
|
17
|
+
/** Above: the band height, bumped for an `xl` logo. Beside never reads it. */
|
|
18
|
+
aboveHeight: number;
|
|
19
|
+
/** Where the chart may start: below the canvas top, or below the above band. */
|
|
20
|
+
chartTopY: number;
|
|
21
|
+
/** Beside: the lowest the header rows may end so the card fits (card + 4 px inset). Above: 0. */
|
|
22
|
+
minRowsBottomY: number;
|
|
23
|
+
}
|
|
24
|
+
/** The positioned header without its attribution box, which finalize adds last. */
|
|
25
|
+
export type PositionedHeaderParts = Omit<PositionedHeader, 'attributionBox'>;
|
|
26
|
+
/** Where the chart ended up, as far as the header needs to know. */
|
|
27
|
+
export interface HeaderFrame {
|
|
28
|
+
/** Bottom of the header rows; the beside card's bottom hugs it. */
|
|
29
|
+
rowsBottomY: number;
|
|
30
|
+
/** Bottom of the chart; the beside header column runs down to it. */
|
|
31
|
+
chartBottomY: number;
|
|
32
|
+
/** The final canvas right edge; the above band spans to it. */
|
|
33
|
+
canvasRightX: number;
|
|
34
|
+
}
|
|
35
|
+
export interface HeaderNodeInput {
|
|
36
|
+
/** The roadmap's title (or name); an empty string when it has neither. */
|
|
37
|
+
title: string;
|
|
38
|
+
author?: string;
|
|
39
|
+
/** The resolved `default roadmap` style; `headerPosition` picks the mode. */
|
|
40
|
+
style: ResolvedStyle;
|
|
41
|
+
/** The drawn logo size, when the file declares a logo and the caller loaded one. */
|
|
42
|
+
logo?: ScaledLogo;
|
|
43
|
+
}
|
|
44
|
+
export declare class HeaderNode {
|
|
45
|
+
private readonly input;
|
|
46
|
+
constructor(input: HeaderNodeInput);
|
|
47
|
+
measure(): MeasuredHeader;
|
|
48
|
+
/**
|
|
49
|
+
* The header box, the card, the logo box and the text inset, once the
|
|
50
|
+
* chart's extent is known. Beside: a column `chartLeftX` wide down to
|
|
51
|
+
* the chart bottom, with the card's bottom on `rowsBottomY`. Above: a
|
|
52
|
+
* band `aboveHeight` tall across the canvas, the card filling it.
|
|
53
|
+
*/
|
|
54
|
+
place(measured: MeasuredHeader, frame: HeaderFrame): PositionedHeaderParts;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=header-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-node.d.ts","sourceRoot":"","sources":["../../src/nodes/header-node.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAOpE,OAAO,KAAK,EAAe,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAehG,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,cAAc,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAC;IACvB,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,0EAA0E;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,WAAW,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,iGAAiG;IACjG,cAAc,E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