@nowline/layout 0.0.0-dev.20260601071750.g04bdff9
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/LICENSE +190 -0
- package/README.md +103 -0
- package/dist/band-scale.d.ts +56 -0
- package/dist/band-scale.d.ts.map +1 -0
- package/dist/band-scale.js +86 -0
- package/dist/band-scale.js.map +1 -0
- package/dist/calendar.d.ts +79 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +210 -0
- package/dist/calendar.js.map +1 -0
- package/dist/capacity.d.ts +72 -0
- package/dist/capacity.d.ts.map +1 -0
- package/dist/capacity.js +163 -0
- package/dist/capacity.js.map +1 -0
- package/dist/dsl-utils.d.ts +5 -0
- package/dist/dsl-utils.d.ts.map +1 -0
- package/dist/dsl-utils.js +28 -0
- package/dist/dsl-utils.js.map +1 -0
- package/dist/edge-routing.d.ts +89 -0
- package/dist/edge-routing.d.ts.map +1 -0
- package/dist/edge-routing.js +435 -0
- package/dist/edge-routing.js.map +1 -0
- package/dist/frame-tab-geometry.d.ts +78 -0
- package/dist/frame-tab-geometry.d.ts.map +1 -0
- package/dist/frame-tab-geometry.js +115 -0
- package/dist/frame-tab-geometry.js.map +1 -0
- package/dist/header-card-geometry.d.ts +29 -0
- package/dist/header-card-geometry.d.ts.map +1 -0
- package/dist/header-card-geometry.js +41 -0
- package/dist/header-card-geometry.js.map +1 -0
- package/dist/i18n.d.ts +48 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +114 -0
- package/dist/i18n.js.map +1 -0
- package/dist/include-chrome-geometry.d.ts +86 -0
- package/dist/include-chrome-geometry.d.ts.map +1 -0
- package/dist/include-chrome-geometry.js +104 -0
- package/dist/include-chrome-geometry.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/inline-date-pin-geometry.d.ts +46 -0
- package/dist/inline-date-pin-geometry.d.ts.map +1 -0
- package/dist/inline-date-pin-geometry.js +149 -0
- package/dist/inline-date-pin-geometry.js.map +1 -0
- package/dist/item-bar-geometry.d.ts +157 -0
- package/dist/item-bar-geometry.d.ts.map +1 -0
- package/dist/item-bar-geometry.js +214 -0
- package/dist/item-bar-geometry.js.map +1 -0
- package/dist/lane-utilization.d.ts +90 -0
- package/dist/lane-utilization.d.ts.map +1 -0
- package/dist/lane-utilization.js +206 -0
- package/dist/lane-utilization.js.map +1 -0
- package/dist/layout-context.d.ts +143 -0
- package/dist/layout-context.d.ts.map +1 -0
- package/dist/layout-context.js +8 -0
- package/dist/layout-context.js.map +1 -0
- package/dist/layout.d.ts +18 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +1298 -0
- package/dist/layout.js.map +1 -0
- package/dist/nodes/anchor-node.d.ts +16 -0
- package/dist/nodes/anchor-node.d.ts.map +1 -0
- package/dist/nodes/anchor-node.js +68 -0
- package/dist/nodes/anchor-node.js.map +1 -0
- package/dist/nodes/footnote-node.d.ts +10 -0
- package/dist/nodes/footnote-node.d.ts.map +1 -0
- package/dist/nodes/footnote-node.js +41 -0
- package/dist/nodes/footnote-node.js.map +1 -0
- package/dist/nodes/group-node.d.ts +29 -0
- package/dist/nodes/group-node.d.ts.map +1 -0
- package/dist/nodes/group-node.js +195 -0
- package/dist/nodes/group-node.js.map +1 -0
- package/dist/nodes/include-node.d.ts +16 -0
- package/dist/nodes/include-node.d.ts.map +1 -0
- package/dist/nodes/include-node.js +117 -0
- package/dist/nodes/include-node.js.map +1 -0
- package/dist/nodes/item-node.d.ts +51 -0
- package/dist/nodes/item-node.d.ts.map +1 -0
- package/dist/nodes/item-node.js +108 -0
- package/dist/nodes/item-node.js.map +1 -0
- package/dist/nodes/marker-geometry.d.ts +22 -0
- package/dist/nodes/marker-geometry.d.ts.map +1 -0
- package/dist/nodes/marker-geometry.js +38 -0
- package/dist/nodes/marker-geometry.js.map +1 -0
- package/dist/nodes/milestone-node.d.ts +48 -0
- package/dist/nodes/milestone-node.d.ts.map +1 -0
- package/dist/nodes/milestone-node.js +210 -0
- package/dist/nodes/milestone-node.js.map +1 -0
- package/dist/nodes/parallel-node.d.ts +21 -0
- package/dist/nodes/parallel-node.d.ts.map +1 -0
- package/dist/nodes/parallel-node.js +88 -0
- package/dist/nodes/parallel-node.js.map +1 -0
- package/dist/nodes/roadmap-node.d.ts +76 -0
- package/dist/nodes/roadmap-node.d.ts.map +1 -0
- package/dist/nodes/roadmap-node.js +788 -0
- package/dist/nodes/roadmap-node.js.map +1 -0
- package/dist/nodes/swimlane-node.d.ts +38 -0
- package/dist/nodes/swimlane-node.d.ts.map +1 -0
- package/dist/nodes/swimlane-node.js +308 -0
- package/dist/nodes/swimlane-node.js.map +1 -0
- package/dist/renderable.d.ts +44 -0
- package/dist/renderable.d.ts.map +1 -0
- package/dist/renderable.js +21 -0
- package/dist/renderable.js.map +1 -0
- package/dist/row-packer.d.ts +125 -0
- package/dist/row-packer.d.ts.map +1 -0
- package/dist/row-packer.js +169 -0
- package/dist/row-packer.js.map +1 -0
- package/dist/style-resolution.d.ts +14 -0
- package/dist/style-resolution.d.ts.map +1 -0
- package/dist/style-resolution.js +191 -0
- package/dist/style-resolution.js.map +1 -0
- package/dist/themes/dark.d.ts +4 -0
- package/dist/themes/dark.d.ts.map +1 -0
- package/dist/themes/dark.js +241 -0
- package/dist/themes/dark.js.map +1 -0
- package/dist/themes/grayscale.d.ts +4 -0
- package/dist/themes/grayscale.d.ts.map +1 -0
- package/dist/themes/grayscale.js +237 -0
- package/dist/themes/grayscale.js.map +1 -0
- package/dist/themes/index.d.ts +19 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +57 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/light.d.ts +4 -0
- package/dist/themes/light.d.ts.map +1 -0
- package/dist/themes/light.js +248 -0
- package/dist/themes/light.js.map +1 -0
- package/dist/themes/shape.d.ts +194 -0
- package/dist/themes/shape.d.ts.map +1 -0
- package/dist/themes/shape.js +6 -0
- package/dist/themes/shape.js.map +1 -0
- package/dist/themes/shared.d.ts +145 -0
- package/dist/themes/shared.d.ts.map +1 -0
- package/dist/themes/shared.js +310 -0
- package/dist/themes/shared.js.map +1 -0
- package/dist/time-scale.d.ts +39 -0
- package/dist/time-scale.d.ts.map +1 -0
- package/dist/time-scale.js +62 -0
- package/dist/time-scale.js.map +1 -0
- package/dist/types.d.ts +516 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/view-preset.d.ts +23 -0
- package/dist/view-preset.d.ts.map +1 -0
- package/dist/view-preset.js +146 -0
- package/dist/view-preset.js.map +1 -0
- package/dist/working-calendar.d.ts +14 -0
- package/dist/working-calendar.d.ts.map +1 -0
- package/dist/working-calendar.js +74 -0
- package/dist/working-calendar.js.map +1 -0
- package/package.json +43 -0
- package/src/band-scale.ts +115 -0
- package/src/calendar.ts +244 -0
- package/src/capacity.ts +191 -0
- package/src/dsl-utils.ts +30 -0
- package/src/edge-routing.ts +550 -0
- package/src/frame-tab-geometry.ts +165 -0
- package/src/header-card-geometry.ts +48 -0
- package/src/i18n.ts +124 -0
- package/src/include-chrome-geometry.ts +156 -0
- package/src/index.ts +118 -0
- package/src/inline-date-pin-geometry.ts +196 -0
- package/src/item-bar-geometry.ts +271 -0
- package/src/lane-utilization.ts +259 -0
- package/src/layout-context.ts +182 -0
- package/src/layout.ts +1530 -0
- package/src/nodes/anchor-node.ts +77 -0
- package/src/nodes/footnote-node.ts +60 -0
- package/src/nodes/group-node.ts +260 -0
- package/src/nodes/include-node.ts +168 -0
- package/src/nodes/item-node.ts +171 -0
- package/src/nodes/marker-geometry.ts +43 -0
- package/src/nodes/milestone-node.ts +263 -0
- package/src/nodes/parallel-node.ts +110 -0
- package/src/nodes/roadmap-node.ts +957 -0
- package/src/nodes/swimlane-node.ts +423 -0
- package/src/renderable.ts +68 -0
- package/src/row-packer.ts +271 -0
- package/src/style-resolution.ts +243 -0
- package/src/themes/dark.ts +244 -0
- package/src/themes/grayscale.ts +240 -0
- package/src/themes/index.ts +66 -0
- package/src/themes/light.ts +251 -0
- package/src/themes/shape.ts +230 -0
- package/src/themes/shared.ts +369 -0
- package/src/time-scale.ts +78 -0
- package/src/types.ts +641 -0
- package/src/view-preset.ts +180 -0
- package/src/working-calendar.ts +91 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { GroupBlock, ItemDeclaration, ParallelBlock } from '@nowline/core';
|
|
2
|
+
import type { LayoutContext, TrackCursor } from '../layout-context.js';
|
|
3
|
+
import type { PositionedParallel, PositionedTrackChild } from '../types.js';
|
|
4
|
+
export interface ParallelNodeDeps {
|
|
5
|
+
sequenceOne: (child: ItemDeclaration | GroupBlock | ParallelBlock, cursor: TrackCursor, ctx: LayoutContext) => PositionedTrackChild;
|
|
6
|
+
newCursor: (x: number, y: number) => TrackCursor;
|
|
7
|
+
}
|
|
8
|
+
export declare class ParallelNode {
|
|
9
|
+
readonly node: ParallelBlock;
|
|
10
|
+
private readonly deps;
|
|
11
|
+
constructor(node: ParallelBlock, deps: ParallelNodeDeps);
|
|
12
|
+
get id(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Sequence children into stacked sub-tracks, advance the parent
|
|
15
|
+
* `cursor` past the parallel's right edge plus
|
|
16
|
+
* `TRACK_BLOCK_TAIL_GUTTER_PX` of breathing room, and return a
|
|
17
|
+
* `PositionedParallel`.
|
|
18
|
+
*/
|
|
19
|
+
place(cursor: TrackCursor, ctx: LayoutContext): PositionedParallel;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=parallel-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallel-node.d.ts","sourceRoot":"","sources":["../../src/nodes/parallel-node.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGhF,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGvE,OAAO,KAAK,EAAe,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEzF,MAAM,WAAW,gBAAgB;IAC7B,WAAW,EAAE,CACT,KAAK,EAAE,eAAe,GAAG,UAAU,GAAG,aAAa,EACnD,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,aAAa,KACjB,oBAAoB,CAAC;IAC1B,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,WAAW,CAAC;CACpD;AAED,qBAAa,YAAY;aAED,IAAI,EAAE,aAAa;IAEnC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAFL,IAAI,EAAE,aAAa,EAElB,IAAI,EAAE,gBAAgB;IAG3C,IAAI,EAAE,IAAI,MAAM,CAEf;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,aAAa,GAAG,kBAAkB;CAoErE"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// ParallelNode — Renderable for a `parallel { ... }` block. Stacks
|
|
2
|
+
// children top-to-bottom (each child owns a fresh sub-track) and reports
|
|
3
|
+
// the union bounding box. Each child is sequenced via the injected
|
|
4
|
+
// `deps.sequenceOne` callback, which dispatches to the appropriate
|
|
5
|
+
// per-entity Renderable (or, transitionally, the legacy sequencer
|
|
6
|
+
// helpers in `layout.ts`).
|
|
7
|
+
import { propValues } from '../dsl-utils.js';
|
|
8
|
+
import { computeContainerInlineDatePins, pickInlineDate } from '../inline-date-pin-geometry.js';
|
|
9
|
+
import { resolveStyle } from '../style-resolution.js';
|
|
10
|
+
import { TRACK_BLOCK_TAIL_GUTTER_PX } from '../themes/shared.js';
|
|
11
|
+
export class ParallelNode {
|
|
12
|
+
node;
|
|
13
|
+
deps;
|
|
14
|
+
constructor(node,
|
|
15
|
+
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: accessed via `const { deps } = this` destructuring inside methods, which the analyzer does not detect.
|
|
16
|
+
deps) {
|
|
17
|
+
this.node = node;
|
|
18
|
+
this.deps = deps;
|
|
19
|
+
}
|
|
20
|
+
get id() {
|
|
21
|
+
return this.node.name ?? '';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Sequence children into stacked sub-tracks, advance the parent
|
|
25
|
+
* `cursor` past the parallel's right edge plus
|
|
26
|
+
* `TRACK_BLOCK_TAIL_GUTTER_PX` of breathing room, and return a
|
|
27
|
+
* `PositionedParallel`.
|
|
28
|
+
*/
|
|
29
|
+
place(cursor, ctx) {
|
|
30
|
+
const { node } = this;
|
|
31
|
+
const { deps } = this;
|
|
32
|
+
const style = resolveStyle('parallel', node.properties, ctx.styleCtx);
|
|
33
|
+
const startX = cursor.x;
|
|
34
|
+
const startY = cursor.y;
|
|
35
|
+
const children = [];
|
|
36
|
+
let maxRight = startX;
|
|
37
|
+
let accumulatedHeight = 0;
|
|
38
|
+
// Each child of a parallel block lives on its own sub-track,
|
|
39
|
+
// so each child starts a fresh flow segment under the parent's
|
|
40
|
+
// path. Two predecessors that sit on different parallel
|
|
41
|
+
// sub-tracks therefore stay in different flows for milestone
|
|
42
|
+
// slack-arrow dedupe.
|
|
43
|
+
const previousFlowKey = ctx.currentFlowKey;
|
|
44
|
+
const parId = node.name ?? 'p';
|
|
45
|
+
let childIndex = 0;
|
|
46
|
+
for (const child of node.content) {
|
|
47
|
+
if (child.$type === 'DescriptionDirective')
|
|
48
|
+
continue;
|
|
49
|
+
ctx.currentFlowKey = `${previousFlowKey}/par:${parId}#${childIndex}`;
|
|
50
|
+
const subCursor = deps.newCursor(startX, startY + accumulatedHeight);
|
|
51
|
+
const positioned = deps.sequenceOne(child, subCursor, ctx);
|
|
52
|
+
children.push(positioned);
|
|
53
|
+
accumulatedHeight += Math.max(ctx.bandScale.step(), subCursor.height);
|
|
54
|
+
maxRight = Math.max(maxRight, subCursor.maxX);
|
|
55
|
+
childIndex++;
|
|
56
|
+
}
|
|
57
|
+
ctx.currentFlowKey = previousFlowKey;
|
|
58
|
+
const box = {
|
|
59
|
+
x: startX,
|
|
60
|
+
y: startY,
|
|
61
|
+
width: maxRight - startX,
|
|
62
|
+
height: accumulatedHeight,
|
|
63
|
+
};
|
|
64
|
+
cursor.x = maxRight + TRACK_BLOCK_TAIL_GUTTER_PX;
|
|
65
|
+
cursor.maxX = Math.max(cursor.maxX, cursor.x);
|
|
66
|
+
cursor.height = Math.max(cursor.height, accumulatedHeight);
|
|
67
|
+
const id = node.name;
|
|
68
|
+
if (id) {
|
|
69
|
+
ctx.entityLeftEdges.set(id, box.x);
|
|
70
|
+
ctx.entityRightEdges.set(id, box.x + box.width);
|
|
71
|
+
}
|
|
72
|
+
const inlineDatePins = computeContainerInlineDatePins({
|
|
73
|
+
box,
|
|
74
|
+
afterDate: pickInlineDate(propValues(node.properties, 'after')),
|
|
75
|
+
beforeDate: pickInlineDate(propValues(node.properties, 'before')),
|
|
76
|
+
});
|
|
77
|
+
return {
|
|
78
|
+
kind: 'parallel',
|
|
79
|
+
id,
|
|
80
|
+
title: node.title ?? node.name,
|
|
81
|
+
box,
|
|
82
|
+
children,
|
|
83
|
+
style,
|
|
84
|
+
inlineDatePins: inlineDatePins.length > 0 ? inlineDatePins : undefined,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=parallel-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallel-node.js","sourceRoot":"","sources":["../../src/nodes/parallel-node.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,yEAAyE;AACzE,mEAAmE;AACnE,mEAAmE;AACnE,kEAAkE;AAClE,2BAA2B;AAG3B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,8BAA8B,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhG,OAAO,EA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8BAA8B,CAAC;YAClD,GAAG;YACH,SAAS,EAAE,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YAC/D,UAAU,EAAE,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;SACpE,CAAC,CAAC;QAEH,OAAO;YACH,IAAI,EAAE,UAAU;YAChB,EAAE;YACF,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI;YAC9B,GAAG;YACH,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,76 @@
|
|
|
1
|
+
import type { ItemDeclaration, NowlineFile, ResolveResult, SwimlaneDeclaration } from '@nowline/core';
|
|
2
|
+
import type { CalendarConfig } from '../calendar.js';
|
|
3
|
+
import type { LayoutOptions, LayoutResult } from '../layout.js';
|
|
4
|
+
import type { LayoutContext, LayoutHelpers } from '../layout-context.js';
|
|
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
|
+
}
|
|
33
|
+
export declare class RoadmapNode {
|
|
34
|
+
place(file: NowlineFile, resolved: ResolveResult, options: LayoutOptions, deps: RoadmapNodeDeps): LayoutResult;
|
|
35
|
+
}
|
|
36
|
+
interface MarkerEntity {
|
|
37
|
+
id: string;
|
|
38
|
+
centerX: number;
|
|
39
|
+
radius: number;
|
|
40
|
+
title: string;
|
|
41
|
+
fontSize: number;
|
|
42
|
+
bold: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface PackedPlacement {
|
|
45
|
+
rowIndex: number;
|
|
46
|
+
labelBox: BoundingBox;
|
|
47
|
+
labelSide: 'left' | 'right';
|
|
48
|
+
}
|
|
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
|
+
//# sourceMappingURL=roadmap-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roadmap-node.d.ts","sourceRoot":"","sources":["../../src/nodes/roadmap-node.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACR,eAAe,EACf,WAAW,EACX,aAAa,EACb,mBAAmB,EACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIrD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAazE,OAAO,KAAK,EACR,WAAW,EAEX,wBAAwB,EAExB,uBAAuB,EACvB,iBAAiB,EAEjB,kBAAkB,EAGrB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBA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