@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
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// Phase 1, the date window (specs/layout-phases.md §3.2): the roadmap's
|
|
2
|
+
// scope (theme, locale, style context, `default roadmap` style) and the
|
|
3
|
+
// natural date window, a projection of the day schedule
|
|
4
|
+
// (specs/scheduler-unification.md §3.3). Nothing here knows about pixels.
|
|
5
|
+
import { findProp } from '@nowline/core/internal';
|
|
6
|
+
import { daysBetween, literalToDays } from '../calendar.js';
|
|
7
|
+
import { resolveWorkingCalendar } from '../calendar-resolver.js';
|
|
8
|
+
import { propValue } from '../dsl-utils.js';
|
|
9
|
+
import { resolveLocale } from '../i18n.js';
|
|
10
|
+
import { isNonWorkingDisplay } from '../non-working-display.js';
|
|
11
|
+
import { resolveStyle } from '../style-resolution.js';
|
|
12
|
+
import { themes } from '../themes/index.js';
|
|
13
|
+
import { resolveScale, tickBoundaryAtOrAfter } from '../view-preset.js';
|
|
14
|
+
import { daysPerUnit } from '../working-calendar.js';
|
|
15
|
+
export function resolveScope(file, resolved, options) {
|
|
16
|
+
const themeName = options.theme ?? 'light';
|
|
17
|
+
const theme = themes[themeName];
|
|
18
|
+
const locale = resolveLocale(options.locale, directiveLocale(file));
|
|
19
|
+
const styleCtx = {
|
|
20
|
+
theme,
|
|
21
|
+
styles: resolved.config.styles,
|
|
22
|
+
defaults: resolved.config.defaults,
|
|
23
|
+
labels: resolved.content.labels,
|
|
24
|
+
};
|
|
25
|
+
// Raw style props (including `timeline-position` and `minor-grid`) are
|
|
26
|
+
// banned on the roadmap declaration itself, so the values come from the
|
|
27
|
+
// level-2 `default roadmap` line in config.
|
|
28
|
+
const roadmapStyle = resolveStyle('roadmap', file.roadmapDecl?.properties ?? [], styleCtx);
|
|
29
|
+
return { themeName, theme, locale, styleCtx, roadmapStyle };
|
|
30
|
+
}
|
|
31
|
+
export function resolveDateWindow(file, resolved, options, scope, schedule) {
|
|
32
|
+
// The working calendar maps dates to working-day indices for the
|
|
33
|
+
// window, the axis and every placement (specs/working-calendar.md
|
|
34
|
+
// §5, §7.1).
|
|
35
|
+
const { config: cal, working: calendar } = resolveWorkingCalendar(file, resolved);
|
|
36
|
+
const preset = resolveScale(file, resolved.config.scale);
|
|
37
|
+
// Window is content-aware: when `length:` is omitted we derive the end
|
|
38
|
+
// day from the latest dated/sequenced entity (item, anchor, milestone,
|
|
39
|
+
// today's now-line) instead of defaulting to a 180-day desert.
|
|
40
|
+
const { startDate, endDate } = computeDateWindow(file, schedule, options.today, preset);
|
|
41
|
+
// How non-working days are drawn: the surface option, then the file's
|
|
42
|
+
// `default roadmap non-working:` key (resolved to `hide` when absent).
|
|
43
|
+
// It reaches every placement through the time scale.
|
|
44
|
+
const nonWorking = isNonWorkingDisplay(options.nonWorking)
|
|
45
|
+
? options.nonWorking
|
|
46
|
+
: scope.roadmapStyle.nonWorking;
|
|
47
|
+
// `TimeScale.showsNonWorking`, needed here to size the scale's range.
|
|
48
|
+
const showsNonWorking = nonWorking === 'show' && calendar.hasNonWorkingDays;
|
|
49
|
+
const spanDays = Math.max(1, calendar.workingIndexOf(startDate, endDate));
|
|
50
|
+
// Under `show` every calendar day takes a pixel width of its own, so
|
|
51
|
+
// the chart widens by the non-working days in the window.
|
|
52
|
+
const timelineDays = showsNonWorking ? Math.max(1, daysBetween(startDate, endDate)) : spanDays;
|
|
53
|
+
return {
|
|
54
|
+
cal,
|
|
55
|
+
calendar,
|
|
56
|
+
preset,
|
|
57
|
+
schedule,
|
|
58
|
+
startDate,
|
|
59
|
+
naturalEndDate: endDate,
|
|
60
|
+
spanDays,
|
|
61
|
+
timelineDays,
|
|
62
|
+
nonWorking,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
// Compute a sensible [startDate, endDate] window from the roadmap's day
|
|
66
|
+
// schedule (`scheduleRoadmap`, specs/scheduler-unification.md §3.3).
|
|
67
|
+
//
|
|
68
|
+
// Precedence:
|
|
69
|
+
// 1. An explicit `length:` is a minimum span; content (including wave
|
|
70
|
+
// barriers E_n and every S_k) past it grows the window to the next
|
|
71
|
+
// tick boundary.
|
|
72
|
+
// 2. Otherwise we derive the end day from the actual content extent
|
|
73
|
+
// (`schedule.extent.contentEndDay`: latest lane cursor, anchor date,
|
|
74
|
+
// milestone date/after, wave edge) and today's now-line if it falls
|
|
75
|
+
// past the content. This keeps the rendered chart from defaulting to
|
|
76
|
+
// a 180-day desert when the content only spans a few weeks.
|
|
77
|
+
// 3. As a last resort (no content + no length), fall back to a small
|
|
78
|
+
// 4-week placeholder so an empty roadmap still draws a sensible axis.
|
|
79
|
+
//
|
|
80
|
+
// The start is `schedule.startDate`: the roadmap's `start:`, else `today`
|
|
81
|
+
// (see `scheduleRoadmap`). Every day count is a working-day index from the
|
|
82
|
+
// start (specs/working-calendar.md §5) under the schedule's calendar. A
|
|
83
|
+
// calendar with no non-working day keeps calendar-day arithmetic.
|
|
84
|
+
//
|
|
85
|
+
// Exported for tests; not part of the package surface.
|
|
86
|
+
export function computeDateWindow(file, schedule, today, scale) {
|
|
87
|
+
const props = file.roadmapDecl?.properties ?? [];
|
|
88
|
+
const { config: cal, working: calendar } = schedule.calendar;
|
|
89
|
+
const { startDate } = schedule;
|
|
90
|
+
const lengthRaw = propValue(props, 'length');
|
|
91
|
+
let minDays = 0;
|
|
92
|
+
if (lengthRaw) {
|
|
93
|
+
const days = literalToDays(lengthRaw, cal);
|
|
94
|
+
if (days > 0) {
|
|
95
|
+
minDays = days;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// An explicit `length:` bounds the now-line: a far-future `today` must
|
|
99
|
+
// not stretch a deliberately-sized roadmap (that case stays out of range
|
|
100
|
+
// and surfaces as an NL.W1000 insight). Content overflow — items,
|
|
101
|
+
// anchors, milestones — still grows the window below via `padded`, with
|
|
102
|
+
// `length:` acting purely as the floor. Without `length:`, `today`
|
|
103
|
+
// extends the window so the now-line is always in range.
|
|
104
|
+
let contentDays = schedule.extent.contentEndDay;
|
|
105
|
+
if (today && !(minDays > 0)) {
|
|
106
|
+
const t = calendar.workingIndexOf(startDate, today);
|
|
107
|
+
if (t > 0)
|
|
108
|
+
contentDays = Math.max(contentDays, t);
|
|
109
|
+
}
|
|
110
|
+
const tickDays = daysPerUnit(scale.unit, cal);
|
|
111
|
+
// Round up to the smallest tick boundary that is `>= contentDays`. When
|
|
112
|
+
// the latest content lands exactly on a tick boundary the chart ends
|
|
113
|
+
// exactly there (no extra trailing tick); otherwise we extend to the
|
|
114
|
+
// next tick so the right edge always sits on a labelled column. For
|
|
115
|
+
// month / quarter / year scales the boundary is a real month /
|
|
116
|
+
// quarter / year start, not a multiple of `days-per-month` etc.
|
|
117
|
+
const padded = tickBoundaryAtOrAfter(startDate, contentDays > 0 ? contentDays : 4 * cal.daysPerWeek, scale.unit, tickDays, calendar);
|
|
118
|
+
const finalDays = Math.max(minDays, padded);
|
|
119
|
+
return {
|
|
120
|
+
startDate,
|
|
121
|
+
endDate: calendar.dateAtWorkingIndex(startDate, Math.max(1, finalDays)),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
// Read the optional `locale:` property from the file's `nowline` directive.
|
|
125
|
+
// Layout receives an already-parsed AST, so this is a cheap lookup with no
|
|
126
|
+
// validation work — that's the validator's job in `@nowline/core`.
|
|
127
|
+
function directiveLocale(file) {
|
|
128
|
+
return findProp(file.directive?.properties ?? [], 'locale')?.value;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=date-window.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-window.js","sourceRoot":"","sources":["../../src/phases/date-window.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,wEAAwE;AACxE,wDAAwD;AACxD,0EAA0E;AAG1E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAuB,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAA0B,MAAM,2BAA2B,CAAC;AAExF,OAAO,EAAE,YAAY,EAAqB,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAA8B,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAmB,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAwB,MAAM,wBAAwB,CAAC;AAmC3E,MAAM,UAAU,YAAY,CACxB,IAAiB,EACjB,QAAuB,EACvB,OAAsB;IAEtB,MAAM,SAAS,GAAc,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC;IACtD,MAAM,KAAK,GAAU,MAAM,CAAC,SAAS,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAiB;QAC3B,KAAK;QACL,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM;QAC9B,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ;QAClC,MAAM,EAAE,QAAQ,CAAC,OAAO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type { NowlineFile, ResolveResult } from '@nowline/core';
|
|
2
|
+
import type { LayoutOptions, LayoutResult } from '../layout.js';
|
|
3
|
+
import type { LayoutContext } from '../layout-context.js';
|
|
4
|
+
import type { PositionedHeaderParts } from '../nodes/header-node.js';
|
|
5
|
+
import { type MarkerBand, type MarkerEntity } from '../nodes/marker-band.js';
|
|
6
|
+
import { type BuiltWaves } from '../nodes/wave-node.js';
|
|
7
|
+
import { TimeScale } from '../time-scale.js';
|
|
8
|
+
import type { BoundingBox, PositionedAnchor, PositionedDependencyEdge, PositionedFootnoteArea, PositionedMilestone, PositionedNowline, PositionedWaveLegend } from '../types.js';
|
|
9
|
+
import type { DateWindow, RoadmapScope } from './date-window.js';
|
|
10
|
+
import { type MeasuredRoadmap } from './measure.js';
|
|
11
|
+
import type { PlacedChart } from './place.js';
|
|
12
|
+
/**
|
|
13
|
+
* The canvas right edge. `grow` is the single mutator: every artifact that
|
|
14
|
+
* wants the canvas wider passes the absolute x it must contain, its
|
|
15
|
+
* breathing room (typically `GUTTER_PX`) included. Today: item caption
|
|
16
|
+
* spills (f1), the timeline extension (f2) and marker-row labels (f3).
|
|
17
|
+
* f3 freezes it; `final` reads it only after that.
|
|
18
|
+
*
|
|
19
|
+
* The now-pill is intentionally NOT a contributor — when the line lands
|
|
20
|
+
* close to either edge, `buildNowline` switches the pill to "flag" mode
|
|
21
|
+
* (squared edge against the line, rounded edge into the chart), so the
|
|
22
|
+
* pill always fits inside the canvas.
|
|
23
|
+
*/
|
|
24
|
+
export declare class CanvasExtent {
|
|
25
|
+
private rightX;
|
|
26
|
+
private frozen;
|
|
27
|
+
constructor(rightX: number);
|
|
28
|
+
/** Grow the canvas to contain `x`; returns whether it grew. Throws once frozen. */
|
|
29
|
+
grow(x: number): boolean;
|
|
30
|
+
/** The canvas is final from here on. */
|
|
31
|
+
freeze(): void;
|
|
32
|
+
/** The right edge so far. Only the step that freezes the canvas (f3) reads it before `final`. */
|
|
33
|
+
get provisional(): number;
|
|
34
|
+
/** The final right edge. Throws before `freeze`. */
|
|
35
|
+
get final(): number;
|
|
36
|
+
}
|
|
37
|
+
/** The pieces of the model the steps produce. Each is set once, by its step. */
|
|
38
|
+
export interface ModelDraft {
|
|
39
|
+
/** Every marker with its final x, and how many of them are calendar labels (f3). */
|
|
40
|
+
markerEntries?: {
|
|
41
|
+
all: MarkerEntity[];
|
|
42
|
+
calendarCount: number;
|
|
43
|
+
};
|
|
44
|
+
milestones?: PositionedMilestone[];
|
|
45
|
+
waves?: BuiltWaves;
|
|
46
|
+
anchors?: PositionedAnchor[];
|
|
47
|
+
edges?: PositionedDependencyEdge[];
|
|
48
|
+
nowline?: PositionedNowline | null;
|
|
49
|
+
waveLegend?: PositionedWaveLegend;
|
|
50
|
+
footnotes?: PositionedFootnoteArea;
|
|
51
|
+
header?: PositionedHeaderParts;
|
|
52
|
+
attributionBox?: BoundingBox;
|
|
53
|
+
/** The canvas height, below the attribution mark. */
|
|
54
|
+
height?: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The top of the header rows on the final axis. The measure phase reserves
|
|
58
|
+
* the now-pill row only when `today` falls inside the natural window; when
|
|
59
|
+
* the axis extension (f2) brings `today` in, the pill row is reserved here
|
|
60
|
+
* (L2, specs/layout-phases.md §1.3), and the tick panel, wave strip and
|
|
61
|
+
* marker band below it move down by `shift`.
|
|
62
|
+
*/
|
|
63
|
+
export interface HeaderRowsTop {
|
|
64
|
+
timelineY: number;
|
|
65
|
+
pillRowHeight: number;
|
|
66
|
+
tickPanelY: number;
|
|
67
|
+
/** The marker band's top, where f5 packs it. */
|
|
68
|
+
markerRowY: number;
|
|
69
|
+
/** How far the tick panel, wave strip and marker band move down from the measure. */
|
|
70
|
+
shift: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Reports whether a finalize step changed something and, for a step that
|
|
74
|
+
* says (`FinalizeContext.explain`), why; see `setFinalizeTrace`.
|
|
75
|
+
*/
|
|
76
|
+
export type FinalizeTrace = (step: string, changed: boolean, why?: readonly string[]) => void;
|
|
77
|
+
/**
|
|
78
|
+
* What passed the natural window when f2 grew the axis (specs/layout-phases.md
|
|
79
|
+
* §9, F3): a leaf item bar (a bug: the schedule's extent and the placement
|
|
80
|
+
* disagree), a spilled caption (its one capped column), a date-pinned marker
|
|
81
|
+
* (a dated anchor or milestone on the last day), or an after-only milestone
|
|
82
|
+
* on the window end (decision 14), in the main chart or in an isolated
|
|
83
|
+
* region. A diamond sits on its day, so its right half passes a window that
|
|
84
|
+
* ends on that day.
|
|
85
|
+
*/
|
|
86
|
+
export type TimelineExtensionCause = 'bar' | 'caption' | 'datedMarker' | 'afterMilestone';
|
|
87
|
+
/**
|
|
88
|
+
* Install (or, with `undefined`, remove) the `FinalizeTrace`. Internal: the
|
|
89
|
+
* coverage register (`finalize-coverage.test.ts`) records with it which
|
|
90
|
+
* steps change something on each sample.
|
|
91
|
+
*/
|
|
92
|
+
export declare function setFinalizeTrace(trace: FinalizeTrace | undefined): void;
|
|
93
|
+
export declare class FinalizeContext {
|
|
94
|
+
readonly file: NowlineFile;
|
|
95
|
+
readonly resolved: ResolveResult;
|
|
96
|
+
readonly options: LayoutOptions;
|
|
97
|
+
readonly scope: RoadmapScope;
|
|
98
|
+
readonly window: DateWindow;
|
|
99
|
+
readonly measured: MeasuredRoadmap;
|
|
100
|
+
readonly chart: PlacedChart;
|
|
101
|
+
/** The canvas right edge: `grow` until f3 freezes it, `final` only after. */
|
|
102
|
+
readonly canvas: CanvasExtent;
|
|
103
|
+
/** Chart top, bottom of the lanes, bottom including the panels below them. */
|
|
104
|
+
readonly chartY: {
|
|
105
|
+
top: number;
|
|
106
|
+
swimlaneBottom: number;
|
|
107
|
+
bottom: number;
|
|
108
|
+
};
|
|
109
|
+
/** Pieces of the model the steps produce. */
|
|
110
|
+
readonly draft: ModelDraft;
|
|
111
|
+
private scaleIsFinal;
|
|
112
|
+
private band;
|
|
113
|
+
private rowsTop;
|
|
114
|
+
private rowsBottom;
|
|
115
|
+
private why;
|
|
116
|
+
constructor(file: NowlineFile, resolved: ResolveResult, options: LayoutOptions, scope: RoadmapScope, window: DateWindow, measured: MeasuredRoadmap, chart: PlacedChart);
|
|
117
|
+
/** The placement context of the kept pass. */
|
|
118
|
+
get ctx(): LayoutContext;
|
|
119
|
+
/** The axis scale. f2 may replace it; `finalScale()` throws before f2 ran. */
|
|
120
|
+
get scale(): TimeScale;
|
|
121
|
+
finalScale(): TimeScale;
|
|
122
|
+
/** Replace the axis scale with an extended one (f2 only). */
|
|
123
|
+
extendScale(scale: TimeScale): void;
|
|
124
|
+
/** The scale is final from here on (f2, whether or not it extended it). */
|
|
125
|
+
settleScale(): void;
|
|
126
|
+
/** The final marker pack, set by f5; reading it earlier throws. */
|
|
127
|
+
markerBand(): MarkerBand;
|
|
128
|
+
/** Set the final marker pack (f5 only); the context's placements become its. */
|
|
129
|
+
setMarkerBand(band: MarkerBand): void;
|
|
130
|
+
/**
|
|
131
|
+
* The header rows' top on the final axis. It reads the final scale, so
|
|
132
|
+
* it throws before f2; f5 packs the marker band at it and f7 moves the
|
|
133
|
+
* rows to it.
|
|
134
|
+
*/
|
|
135
|
+
headerRowsTop(): HeaderRowsTop;
|
|
136
|
+
/** The bottom of the grown header rows, set by f7; reading it earlier throws. */
|
|
137
|
+
headerRowsBottom(): number;
|
|
138
|
+
/** Set the bottom of the grown header rows (f7 only). */
|
|
139
|
+
setHeaderRowsBottom(y: number): void;
|
|
140
|
+
/** Say why the running step changed something; its report carries it. */
|
|
141
|
+
explain(why: readonly string[]): void;
|
|
142
|
+
/** Report a step's effect to the trace, when one is installed. */
|
|
143
|
+
report(step: string, changed: boolean): void;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The header rows' top once the axis is final. When the measure phase left
|
|
147
|
+
* the pill row at 0 and `today` lies on the final axis, f2 brought it in:
|
|
148
|
+
* the rows grow by `NOW_PILL_HEIGHT_PX` above the tick panel, and the
|
|
149
|
+
* timeline y follows the beside-card rule (`headerRowsTimelineY`), so a
|
|
150
|
+
* card that already pushed the rows down absorbs some or all of the pill
|
|
151
|
+
* row instead of the rows growing by its full height.
|
|
152
|
+
*/
|
|
153
|
+
export declare function resolveHeaderRowsTop(measured: MeasuredRoadmap, today: Date | undefined, scale: TimeScale): HeaderRowsTop;
|
|
154
|
+
/**
|
|
155
|
+
* What a finalize step reads or writes. `placement` is everything place
|
|
156
|
+
* left (lanes, regions, items, milestone x, the date-pinned markers),
|
|
157
|
+
* `window` the date window and `headerBands` the measured header rows;
|
|
158
|
+
* the rest are the slots finalize produces.
|
|
159
|
+
*/
|
|
160
|
+
export type FinalizeSlot = 'placement' | 'window' | 'headerBands' | 'canvas' | 'scale' | 'timeline' | 'calendarRuns' | 'markerEntries' | 'laneWidths' | 'markerBand' | 'milestones' | 'calendarLabels' | 'markerMidpoints' | 'chartTop' | 'rowsBottom' | 'laneBottom' | 'chartBottom' | 'laneY' | 'waves' | 'anchors' | 'edges' | 'nowline' | 'legend' | 'footnotes' | 'header' | 'attribution';
|
|
161
|
+
/**
|
|
162
|
+
* The rule a slot follows:
|
|
163
|
+
* - `input`: nothing in finalize writes it.
|
|
164
|
+
* - `final`: steps up to `finalAfter` may write it, none after; only
|
|
165
|
+
* `finalAfter` itself may read it before then.
|
|
166
|
+
* - `cursor`: only the `advancers` write it (each reads it as it advances
|
|
167
|
+
* it); every other reader comes after the last advancer.
|
|
168
|
+
* - `product`: one step writes it; readers come after that step.
|
|
169
|
+
*/
|
|
170
|
+
export type SlotRule = {
|
|
171
|
+
kind: 'input';
|
|
172
|
+
} | {
|
|
173
|
+
kind: 'final';
|
|
174
|
+
finalAfter: string;
|
|
175
|
+
} | {
|
|
176
|
+
kind: 'cursor';
|
|
177
|
+
advancers: readonly string[];
|
|
178
|
+
} | {
|
|
179
|
+
kind: 'product';
|
|
180
|
+
};
|
|
181
|
+
export declare const SLOT_RULES: Readonly<Record<FinalizeSlot, SlotRule>>;
|
|
182
|
+
export interface FinalizeStep {
|
|
183
|
+
readonly name: string;
|
|
184
|
+
readonly reads: readonly FinalizeSlot[];
|
|
185
|
+
readonly writes: readonly FinalizeSlot[];
|
|
186
|
+
/** Run the step; returns whether it changed something (for the coverage trace). */
|
|
187
|
+
run(fx: FinalizeContext): boolean;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Every way `steps` breaks `rules`, as one message each; empty when the
|
|
191
|
+
* order holds.
|
|
192
|
+
*/
|
|
193
|
+
export declare function checkFinalizeOrder(steps: readonly FinalizeStep[], rules?: Readonly<Record<FinalizeSlot, SlotRule>>): string[];
|
|
194
|
+
/** The finalize pass, in order (specs/layout-phases.md §3.5). */
|
|
195
|
+
export declare const FINALIZE_STEPS: readonly FinalizeStep[];
|
|
196
|
+
/** Run the finalize pass over `fx` and assemble the positioned model. */
|
|
197
|
+
export declare function finalizeRoadmap(fx: FinalizeContext, steps?: readonly FinalizeStep[]): LayoutResult;
|
|
198
|
+
//# sourceMappingURL=finalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finalize.d.ts","sourceRoot":"","sources":["../../src/phases/finalize.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAShE,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAEH,KAAK,UAAU,EACf,KAAK,YAAY,EAOpB,MAAM,yBAAyB,CAAC;AASjC,OAAO,EAAE,KAAK,UAAU,EAA+B,MAAM,uBAAuB,CAAC;AASrF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EACR,WAAW,EAEX,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,m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