@nowline/layout 0.0.0-dev.20261004044228.g75c9ff9 → 0.0.0-dev.20261004050749.g26129db
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/item-port-geometry.d.ts +6 -5
- package/dist/item-port-geometry.d.ts.map +1 -1
- package/dist/item-port-geometry.js +15 -12
- package/dist/item-port-geometry.js.map +1 -1
- package/dist/nodes/milestone-node.d.ts +3 -2
- package/dist/nodes/milestone-node.d.ts.map +1 -1
- package/dist/nodes/milestone-node.js +3 -1
- package/dist/nodes/milestone-node.js.map +1 -1
- package/package.json +2 -2
- package/src/item-port-geometry.ts +15 -12
- package/src/nodes/milestone-node.ts +6 -3
- package/src/types.ts +1 -1
|
@@ -4,10 +4,11 @@ export declare function itemArrowTargetPort(item: PositionedItem, bandwidth: num
|
|
|
4
4
|
/** Where a dependency arrow OUT OF `item` starts: the bar's right edge. */
|
|
5
5
|
export declare function itemArrowSourcePort(item: PositionedItem, bandwidth: number): Point;
|
|
6
6
|
/**
|
|
7
|
-
* Y where a milestone slack arrow leaves `item`: the
|
|
8
|
-
*
|
|
9
|
-
* (so the arrow aligns with the strip
|
|
10
|
-
* spilled title / meta text). The
|
|
7
|
+
* Y where a milestone slack arrow leaves `item`: the row's nominal
|
|
8
|
+
* midline (the line its dependency arrows use), or the progress strip's
|
|
9
|
+
* center when the caption spilled (so the arrow aligns with the strip
|
|
10
|
+
* instead of running through the spilled title / meta text). The
|
|
11
|
+
* arrow's x is the bar's right edge.
|
|
11
12
|
*/
|
|
12
|
-
export declare function itemSlackAttachY(item: PositionedItem): number;
|
|
13
|
+
export declare function itemSlackAttachY(item: PositionedItem, bandwidth: number): number;
|
|
13
14
|
//# sourceMappingURL=item-port-geometry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-port-geometry.d.ts","sourceRoot":"","sources":["../src/item-port-geometry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"item-port-geometry.d.ts","sourceRoot":"","sources":["../src/item-port-geometry.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAOxD,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAMlF;AAED,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAMlF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEhF"}
|
|
@@ -12,14 +12,16 @@
|
|
|
12
12
|
// Attach rules (specs/rendering.md "Dependency Arrows", and the slack
|
|
13
13
|
// arrows under "Milestones"):
|
|
14
14
|
//
|
|
15
|
-
// -
|
|
15
|
+
// - Arrows and slack arrows attach on the row's NOMINAL midline,
|
|
16
16
|
// `box.y + bandwidth / 2`, not the bar's own mid-height, so a bar
|
|
17
17
|
// grown by a wrapped title or a chip column shares an attach line
|
|
18
|
-
// with its un-grown row neighbours
|
|
18
|
+
// with its un-grown row neighbours, and a grown bar's slack arrow
|
|
19
|
+
// leaves level with its dependency arrows.
|
|
19
20
|
// - Caption spilled past the right edge (`textSpills`): the arrow
|
|
20
|
-
// target
|
|
21
|
-
// to the vertical center of the bottom progress
|
|
22
|
-
//
|
|
21
|
+
// target stays on the nominal midline, but the arrow source and the
|
|
22
|
+
// slack arrow drop to the vertical center of the bottom progress
|
|
23
|
+
// strip so they run under the spilled title / meta text instead of
|
|
24
|
+
// through it.
|
|
23
25
|
import { PROGRESS_STRIP_HEIGHT_PX } from './themes/shared.js';
|
|
24
26
|
/** Y of the bottom progress strip's vertical center. */
|
|
25
27
|
function progressStripMidY(item) {
|
|
@@ -30,7 +32,7 @@ export function itemArrowTargetPort(item, bandwidth) {
|
|
|
30
32
|
const { box } = item;
|
|
31
33
|
return {
|
|
32
34
|
x: box.x,
|
|
33
|
-
y:
|
|
35
|
+
y: box.y + bandwidth / 2,
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
38
|
/** Where a dependency arrow OUT OF `item` starts: the bar's right edge. */
|
|
@@ -42,12 +44,13 @@ export function itemArrowSourcePort(item, bandwidth) {
|
|
|
42
44
|
};
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
|
-
* Y where a milestone slack arrow leaves `item`: the
|
|
46
|
-
*
|
|
47
|
-
* (so the arrow aligns with the strip
|
|
48
|
-
* spilled title / meta text). The
|
|
47
|
+
* Y where a milestone slack arrow leaves `item`: the row's nominal
|
|
48
|
+
* midline (the line its dependency arrows use), or the progress strip's
|
|
49
|
+
* center when the caption spilled (so the arrow aligns with the strip
|
|
50
|
+
* instead of running through the spilled title / meta text). The
|
|
51
|
+
* arrow's x is the bar's right edge.
|
|
49
52
|
*/
|
|
50
|
-
export function itemSlackAttachY(item) {
|
|
51
|
-
return item.textSpills ? progressStripMidY(item) : item.box.y +
|
|
53
|
+
export function itemSlackAttachY(item, bandwidth) {
|
|
54
|
+
return item.textSpills ? progressStripMidY(item) : item.box.y + bandwidth / 2;
|
|
52
55
|
}
|
|
53
56
|
//# sourceMappingURL=item-port-geometry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-port-geometry.js","sourceRoot":"","sources":["../src/item-port-geometry.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,oBAAoB;AACpB,EAAE;AACF,wEAAwE;AACxE,uEAAuE;AACvE,yEAAyE;AACzE,wEAAwE;AACxE,oEAAoE;AACpE,sEAAsE;AACtE,kEAAkE;AAClE,EAAE;AACF,sEAAsE;AACtE,8BAA8B;AAC9B,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,sEAAsE;AACtE
|
|
1
|
+
{"version":3,"file":"item-port-geometry.js","sourceRoot":"","sources":["../src/item-port-geometry.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,EAAE,SAAiB;IACpE,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -5,8 +5,9 @@ import type { PositionedMilestone } from '../types.js';
|
|
|
5
5
|
* One predecessor of a milestone with everything the slack-arrow
|
|
6
6
|
* pipeline needs: its source x (visual right edge for items, marker
|
|
7
7
|
* centerX for anchors / other milestones), its attach y (bar bottom
|
|
8
|
-
* strip when text spills, row
|
|
9
|
-
* to dedupe so a chained-flow's siblings collapse to the last
|
|
8
|
+
* strip when text spills, nominal row midline otherwise), and its flow
|
|
9
|
+
* key (used to dedupe so a chained-flow's siblings collapse to the last
|
|
10
|
+
* entry).
|
|
10
11
|
*/
|
|
11
12
|
export interface MilestonePredecessor {
|
|
12
13
|
ref: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"milestone-node.d.ts","sourceRoot":"","sources":["../../src/nodes/milestone-node.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAsB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAQ3E
|
|
1
|
+
{"version":3,"file":"milestone-node.d.ts","sourceRoot":"","sources":["../../src/nodes/milestone-node.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAsB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAQ3E;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CACxC,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,aAAa,GACnB,oBAAoB,EAAE,CAiBxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,oBAAoB,EAAE,CAO5F;AAyBD,qBAAa,aAAa;aAEF,EAAE,EAAE,MAAM;aACV,SAAS,EAAE,oBAAoB;IAFnD,YACoB,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,oBAAoB,EAC/C;IAEJ;;;;OAIG;IACH,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,mBAAmB,GAAG,IAAI,CAmIpD;CACJ;AAED,wBAAgB,eAAe,CAC3B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,EAC7C,GAAG,EAAE,aAAa,GACnB,mBAAmB,EAAE,CAOvB"}
|
|
@@ -32,7 +32,9 @@ export function collectMilestonePredecessors(refs, ctx) {
|
|
|
32
32
|
const x = item ? item.box.x + item.box.width : ctx.entityRightEdges.get(ref);
|
|
33
33
|
if (x === undefined)
|
|
34
34
|
continue;
|
|
35
|
-
const y = item
|
|
35
|
+
const y = item
|
|
36
|
+
? itemSlackAttachY(item, ctx.bandScale.bandwidth())
|
|
37
|
+
: (ctx.entityMidpoints.get(ref)?.y ?? 0);
|
|
36
38
|
// Markers don't share a flow with anything, so use their id
|
|
37
39
|
// as a unique flow key — every marker stands on its own.
|
|
38
40
|
const flowKey = ctx.itemFlowKey.get(ref) ?? `marker:${ref}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"milestone-node.js","sourceRoot":"","sources":["../../src/nodes/milestone-node.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,uEAAuE;AACvE,yEAAyE;AACzE,oEAAoE;AACpE,wEAAwE;AACxE,oDAAoD;AACpD,EAAE;AACF,sEAAsE;AACtE,qEAAqE;AACrE,+DAA+D;AAC/D,mEAAmE;AACnE,sEAAsE;AACtE,iDAAiD;AAGjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EACH,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,GACzB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"milestone-node.js","sourceRoot":"","sources":["../../src/nodes/milestone-node.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,uEAAuE;AACvE,yEAAyE;AACzE,oEAAoE;AACpE,wEAAwE;AACxE,oDAAoD;AACpD,EAAE;AACF,sEAAsE;AACtE,qEAAqE;AACrE,+DAA+D;AAC/D,mEAAmE;AACnE,sEAAsE;AACtE,iDAAiD;AAGjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EACH,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,GACzB,MAAM,sBAAsB,CAAC;AAiB9B;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CACxC,IAAc,EACd,GAAkB;IAElB,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,kEAAkE;QAClE,iEAAiE;QACjE,MAAM,IAAI,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,CAAC,GAAG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"0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.20261004050749.g26129db",
|
|
4
4
|
"description": "Nowline layout engine — works out where everything goes on the page before it's drawn.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"src/"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@nowline/core": "0.0.0-dev.
|
|
25
|
+
"@nowline/core": "0.0.0-dev.20261004050749.g26129db",
|
|
26
26
|
"d3-scale": "^4.0.2",
|
|
27
27
|
"d3-time": "^3.1.0"
|
|
28
28
|
},
|
|
@@ -12,14 +12,16 @@
|
|
|
12
12
|
// Attach rules (specs/rendering.md "Dependency Arrows", and the slack
|
|
13
13
|
// arrows under "Milestones"):
|
|
14
14
|
//
|
|
15
|
-
// -
|
|
15
|
+
// - Arrows and slack arrows attach on the row's NOMINAL midline,
|
|
16
16
|
// `box.y + bandwidth / 2`, not the bar's own mid-height, so a bar
|
|
17
17
|
// grown by a wrapped title or a chip column shares an attach line
|
|
18
|
-
// with its un-grown row neighbours
|
|
18
|
+
// with its un-grown row neighbours, and a grown bar's slack arrow
|
|
19
|
+
// leaves level with its dependency arrows.
|
|
19
20
|
// - Caption spilled past the right edge (`textSpills`): the arrow
|
|
20
|
-
// target
|
|
21
|
-
// to the vertical center of the bottom progress
|
|
22
|
-
//
|
|
21
|
+
// target stays on the nominal midline, but the arrow source and the
|
|
22
|
+
// slack arrow drop to the vertical center of the bottom progress
|
|
23
|
+
// strip so they run under the spilled title / meta text instead of
|
|
24
|
+
// through it.
|
|
23
25
|
|
|
24
26
|
import { PROGRESS_STRIP_HEIGHT_PX } from './themes/shared.js';
|
|
25
27
|
import type { Point, PositionedItem } from './types.js';
|
|
@@ -34,7 +36,7 @@ export function itemArrowTargetPort(item: PositionedItem, bandwidth: number): Po
|
|
|
34
36
|
const { box } = item;
|
|
35
37
|
return {
|
|
36
38
|
x: box.x,
|
|
37
|
-
y:
|
|
39
|
+
y: box.y + bandwidth / 2,
|
|
38
40
|
};
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -48,11 +50,12 @@ export function itemArrowSourcePort(item: PositionedItem, bandwidth: number): Po
|
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
/**
|
|
51
|
-
* Y where a milestone slack arrow leaves `item`: the
|
|
52
|
-
*
|
|
53
|
-
* (so the arrow aligns with the strip
|
|
54
|
-
* spilled title / meta text). The
|
|
53
|
+
* Y where a milestone slack arrow leaves `item`: the row's nominal
|
|
54
|
+
* midline (the line its dependency arrows use), or the progress strip's
|
|
55
|
+
* center when the caption spilled (so the arrow aligns with the strip
|
|
56
|
+
* instead of running through the spilled title / meta text). The
|
|
57
|
+
* arrow's x is the bar's right edge.
|
|
55
58
|
*/
|
|
56
|
-
export function itemSlackAttachY(item: PositionedItem): number {
|
|
57
|
-
return item.textSpills ? progressStripMidY(item) : item.box.y +
|
|
59
|
+
export function itemSlackAttachY(item: PositionedItem, bandwidth: number): number {
|
|
60
|
+
return item.textSpills ? progressStripMidY(item) : item.box.y + bandwidth / 2;
|
|
58
61
|
}
|
|
@@ -29,8 +29,9 @@ import {
|
|
|
29
29
|
* One predecessor of a milestone with everything the slack-arrow
|
|
30
30
|
* pipeline needs: its source x (visual right edge for items, marker
|
|
31
31
|
* centerX for anchors / other milestones), its attach y (bar bottom
|
|
32
|
-
* strip when text spills, row
|
|
33
|
-
* to dedupe so a chained-flow's siblings collapse to the last
|
|
32
|
+
* strip when text spills, nominal row midline otherwise), and its flow
|
|
33
|
+
* key (used to dedupe so a chained-flow's siblings collapse to the last
|
|
34
|
+
* entry).
|
|
34
35
|
*/
|
|
35
36
|
export interface MilestonePredecessor {
|
|
36
37
|
ref: string;
|
|
@@ -58,7 +59,9 @@ export function collectMilestonePredecessors(
|
|
|
58
59
|
const item = ctx.placedItems.get(ref);
|
|
59
60
|
const x = item ? item.box.x + item.box.width : ctx.entityRightEdges.get(ref);
|
|
60
61
|
if (x === undefined) continue;
|
|
61
|
-
const y = item
|
|
62
|
+
const y = item
|
|
63
|
+
? itemSlackAttachY(item, ctx.bandScale.bandwidth())
|
|
64
|
+
: (ctx.entityMidpoints.get(ref)?.y ?? 0);
|
|
62
65
|
// Markers don't share a flow with anything, so use their id
|
|
63
66
|
// as a unique flow key — every marker stands on its own.
|
|
64
67
|
const flowKey = ctx.itemFlowKey.get(ref) ?? `marker:${ref}`;
|
package/src/types.ts
CHANGED
|
@@ -586,7 +586,7 @@ export interface MarkerRowPlacement {
|
|
|
586
586
|
export interface SlackCorridor {
|
|
587
587
|
xStart: number; // slack pred's right edge (logical chart x)
|
|
588
588
|
xEnd: number; // binding pred's right edge / milestone center.x
|
|
589
|
-
y: number; // slack pred's
|
|
589
|
+
y: number; // slack pred's slack-arrow attach y
|
|
590
590
|
slackPredId: string; // exempt from bumping (owns the arrow's origin)
|
|
591
591
|
milestoneId: string;
|
|
592
592
|
}
|