@re-cinq/floor-graph 0.11.2 → 0.12.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/README.md +7 -1
- package/dist/DanglingStub.d.ts +3 -2
- package/dist/DanglingStub.js +6 -2
- package/dist/ExitDot.d.ts +1 -1
- package/dist/ExitDot.js +3 -2
- package/dist/GraphNode.js +3 -1
- package/dist/elk-graph.d.ts +6 -0
- package/dist/elk-graph.js +23 -5
- package/dist/elk-layout.d.ts +1 -0
- package/dist/elk-layout.js +37 -13
- package/dist/elk-snake-graph.d.ts +24 -0
- package/dist/elk-snake-graph.js +142 -0
- package/dist/elk-snake-layout.d.ts +3 -0
- package/dist/elk-snake-layout.js +48 -0
- package/dist/graph-markers.js +2 -1
- package/dist/layout-geometry.d.ts +12 -0
- package/dist/layout-geometry.js +39 -1
- package/dist/run-graph.module.css +4 -0
- package/dist/run-graph.test-helpers.d.ts +3 -0
- package/dist/run-graph.test-helpers.js +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @re-cinq/floor-graph
|
|
2
2
|
|
|
3
|
-
A React view of an assembly line as a graph: layout, pan and zoom, nodes and edges. [elkjs](https://github.com/kieler/elkjs) lays it out with stations left to right,
|
|
3
|
+
A React view of an assembly line as a graph: layout, pan and zoom, nodes and edges. [elkjs](https://github.com/kieler/elkjs) lays it out with stations left to right, and a longer line wraps into rows that alternate direction. Every edge gets its own ports and is routed at right angles around stations, labels and marker titles. The package ships compiled JS and its CSS modules, so use it from a bundler such as Vite.
|
|
4
4
|
|
|
5
5
|
```
|
|
6
6
|
npm install @re-cinq/floor-graph
|
|
@@ -19,6 +19,12 @@ The controls hold zoom, fit and two toggles. The `mainPathOnly` and `compactStop
|
|
|
19
19
|
- "Main path" fades every station and edge off the path from the entry along `success`, or along the first `always` when nothing succeeds.
|
|
20
20
|
- "Compact stops" draws a station with one edge in and one `always` edge out as a stop on the track, unless it is the entry or is started from outside.
|
|
21
21
|
|
|
22
|
+
## Long lines
|
|
23
|
+
|
|
24
|
+
A line of more than 5 columns wraps into rows. The columns split evenly, so 13 become 5 + 4 + 4. The first row runs left to right, the next right to left, and so on. An edge between rows leaves its row at the far end and enters the next row at its start.
|
|
25
|
+
|
|
26
|
+
Within a row, every edge that leaves the main path for the line's exit meets one shared end: a vertical bar with the end ring in its middle, 60 px tall for each line, so each line arrives in its own lane. An end dot or stub stays in its station's row.
|
|
27
|
+
|
|
22
28
|
## Selection and keyboard
|
|
23
29
|
|
|
24
30
|
`onSelectLine(key)` and `selectedLineKey` select an edge by its `from|to|event` key (`edgeKeyOf`).
|
package/dist/DanglingStub.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ElkLayout } from "./elk-layout";
|
|
2
|
+
type StubNode = ElkLayout["nodes"][number];
|
|
2
3
|
interface DanglingStubProps {
|
|
3
|
-
node:
|
|
4
|
+
node: StubNode;
|
|
4
5
|
}
|
|
5
|
-
/** Where an outcome leads to a line nobody starts: a short end bar with a warning beside it. */
|
|
6
|
+
/** Where an outcome leads to a line nobody starts: a short end bar with a warning beside it, on the side the line does not arrive from. */
|
|
6
7
|
export default function DanglingStub({ node }: DanglingStubProps): import("react").JSX.Element;
|
|
7
8
|
export {};
|
package/dist/DanglingStub.js
CHANGED
|
@@ -3,8 +3,12 @@ import styles from "./run-graph.module.css";
|
|
|
3
3
|
const BAR_HALF_LENGTH = 7;
|
|
4
4
|
const LABEL_GAP = 8;
|
|
5
5
|
const LABEL_DROP = 12;
|
|
6
|
-
/** Where an outcome leads to a line nobody starts: a short end bar with a warning beside it. */
|
|
6
|
+
/** Where an outcome leads to a line nobody starts: a short end bar with a warning beside it, on the side the line does not arrive from. */
|
|
7
7
|
export default function DanglingStub({ node }) {
|
|
8
|
-
|
|
8
|
+
const isLeftward = arrivesFromEast(node);
|
|
9
|
+
return (_jsxs("g", { "data-stub": node.id.replace(/:stub$/, ""), children: [_jsx("line", { className: styles.stubBar, x1: node.x, x2: node.x, y1: node.y - BAR_HALF_LENGTH, y2: node.y + BAR_HALF_LENGTH }), _jsx("text", { className: styles.stubText, x: isLeftward ? node.x - LABEL_GAP : node.x + LABEL_GAP, y: node.y + LABEL_DROP, textAnchor: isLeftward ? "end" : undefined, children: "\u26A0 nobody starts on it" })] }));
|
|
10
|
+
}
|
|
11
|
+
function arrivesFromEast({ x: centreX, ports }) {
|
|
12
|
+
return ports.some((port) => port.x > centreX);
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=DanglingStub.js.map
|
package/dist/ExitDot.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ interface ExitDotProps {
|
|
|
3
3
|
node: ElkLayout["nodes"][number];
|
|
4
4
|
exit: string;
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
6
|
+
/** The shared end of a row's off-path lines: a ring with a dot, like the exit terminal, and a bar joining the lines' ports. */
|
|
7
7
|
export default function ExitDot({ node, exit }: ExitDotProps): import("react").JSX.Element;
|
|
8
8
|
export {};
|
package/dist/ExitDot.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styles from "./run-graph.module.css";
|
|
3
|
-
/**
|
|
3
|
+
/** The shared end of a row's off-path lines: a ring with a dot, like the exit terminal, and a bar joining the lines' ports. */
|
|
4
4
|
export default function ExitDot({ node, exit }) {
|
|
5
|
-
|
|
5
|
+
const portYs = node.ports.map((port) => port.y);
|
|
6
|
+
return (_jsxs("g", { "data-exit-dot": node.id.replace(/:exit$/, ""), children: [_jsx("title", { children: `ends the run at ${exit}` }), _jsx("line", { className: styles.exitBar, x1: node.x, x2: node.x, y1: Math.min(...portYs), y2: Math.max(...portYs) }), _jsx("circle", { className: styles.exitRing, cx: node.x, cy: node.y, r: 6 }), _jsx("circle", { className: styles.exitCore, cx: node.x, cy: node.y, r: 2.5 })] }));
|
|
6
7
|
}
|
|
7
8
|
//# sourceMappingURL=ExitDot.js.map
|
package/dist/GraphNode.js
CHANGED
|
@@ -71,8 +71,10 @@ function CardBody({ node, family, subtitle, height, isUnreachable, }) {
|
|
|
71
71
|
const { top, leftEdge } = box;
|
|
72
72
|
return (_jsxs(_Fragment, { children: [_jsx(NodeBox, { ...box, height: height, isUnreachable: isUnreachable }), _jsx(TypeGlyph, { family: family, cx: leftEdge + GLYPH_INSET, cy: top + GLYPH_INSET }), _jsx(NodeTitle, { title: nodeTitle(node.id), subtitle: subtitle, isUnreachable: isUnreachable, centerX: node.x, centerY: node.y })] }));
|
|
73
73
|
}
|
|
74
|
+
const TITLE_BASELINE_INSET = 4;
|
|
74
75
|
function TerminalBody({ node }) {
|
|
75
|
-
|
|
76
|
+
const titleY = node.titleBox ? node.titleBox.maxY - TITLE_BASELINE_INSET : node.y + 24;
|
|
77
|
+
return (_jsxs(_Fragment, { children: [_jsx("circle", { className: styles.terminalRing, cx: node.x, cy: node.y, r: 11 }), _jsx("circle", { className: styles.terminalCore, cx: node.x, cy: node.y, r: 5 }), _jsx("text", { className: styles.nodeId, x: node.x, y: titleY, textAnchor: "middle", children: nodeTitle(node.id) })] }));
|
|
76
78
|
}
|
|
77
79
|
// The stop's circle centre from the box's top, and the title's drop below it.
|
|
78
80
|
const STOP_RADIUS = 12;
|
package/dist/elk-graph.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { ElkNode } from "elkjs/lib/elk-api";
|
|
2
2
|
import type { AssemblyLineDefinition } from "./assembly-line-definition";
|
|
3
|
+
export declare const NODE_SIZE: {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
};
|
|
3
7
|
/** Builds the ELK input graph for a line: one child per node, markers 22x22, others 140x60 unless sized. */
|
|
4
8
|
export interface NodeSize {
|
|
5
9
|
width: number;
|
|
@@ -14,3 +18,5 @@ export interface ElkGraphOptions {
|
|
|
14
18
|
takenCounts?: ReadonlyMap<string, number>;
|
|
15
19
|
}
|
|
16
20
|
export declare function elkGraphOf(definition: AssemblyLineDefinition, size?: NodeSize, options?: ElkGraphOptions): ElkNode;
|
|
21
|
+
/** Whether a laid-out child is an exit dot, or the shared end that merges a row's exit dots. */
|
|
22
|
+
export declare const isExitId: (id: string) => boolean;
|
package/dist/elk-graph.js
CHANGED
|
@@ -7,7 +7,7 @@ import { isPassThrough } from "./metro/pass-through";
|
|
|
7
7
|
import { countWidthOf } from "./metro/taken-count";
|
|
8
8
|
import { nodeTitle } from "./node-tooltip";
|
|
9
9
|
import { typeFamilyOf } from "./node-type-family";
|
|
10
|
-
const NODE_SIZE = { width: 140, height: 60 };
|
|
10
|
+
export const NODE_SIZE = { width: 140, height: 60 };
|
|
11
11
|
// Card height keeps ELK from centring stations on a shorter marker, which made sub-16px turns.
|
|
12
12
|
const MARKER_SIZE = { width: 22, height: NODE_SIZE.height };
|
|
13
13
|
const PORT_SIZE = 8;
|
|
@@ -23,6 +23,11 @@ const SOURCE_STUB = { idSuffix: "source-stub", direction: "out", side: "EAST" };
|
|
|
23
23
|
const LABEL_HEIGHT = 16;
|
|
24
24
|
const LABEL_CHAR_WIDTH = 7.3;
|
|
25
25
|
const LABEL_PADDING = 6;
|
|
26
|
+
// Match the 14 px bold title font under a marker.
|
|
27
|
+
const TITLE_CHAR_WIDTH = 8;
|
|
28
|
+
const TITLE_PADDING = 8;
|
|
29
|
+
const TITLE_HEIGHT = 16;
|
|
30
|
+
const FIXED_SIDE = { "elk.portConstraints": "FIXED_SIDE" };
|
|
26
31
|
const LAYOUT_OPTIONS = {
|
|
27
32
|
"elk.algorithm": "layered",
|
|
28
33
|
"elk.direction": "RIGHT",
|
|
@@ -48,7 +53,8 @@ export function elkGraphOf(definition, size = NODE_SIZE, options = {}) {
|
|
|
48
53
|
...definition.nodes.map((node) => options.compactStops && isPassThrough(definition, node.id) ? stopOf(definition, node.id) : ({
|
|
49
54
|
id: node.id,
|
|
50
55
|
...(typeFamilyOf(node.type) === "marker" ? MARKER_SIZE : { width: size.widthOf?.(node.id) ?? size.width, height: size.height }),
|
|
51
|
-
layoutOptions:
|
|
56
|
+
layoutOptions: FIXED_SIDE,
|
|
57
|
+
...markerTitleOf(node.id, node.type),
|
|
52
58
|
ports: [
|
|
53
59
|
...incomingEdgesOf(definition, node.id)
|
|
54
60
|
.filter((edge) => !exitDotEdges.includes(edge))
|
|
@@ -67,6 +73,15 @@ export function elkGraphOf(definition, size = NODE_SIZE, options = {}) {
|
|
|
67
73
|
})),
|
|
68
74
|
};
|
|
69
75
|
}
|
|
76
|
+
function markerTitleOf(nodeId, type) {
|
|
77
|
+
if (typeFamilyOf(type) !== "marker")
|
|
78
|
+
return {};
|
|
79
|
+
const text = nodeTitle(nodeId);
|
|
80
|
+
return {
|
|
81
|
+
labels: [{ text, width: Math.ceil(text.length * TITLE_CHAR_WIDTH + TITLE_PADDING), height: TITLE_HEIGHT }],
|
|
82
|
+
layoutOptions: { ...FIXED_SIDE, "elk.nodeLabels.placement": "OUTSIDE V_BOTTOM H_CENTER" },
|
|
83
|
+
};
|
|
84
|
+
}
|
|
70
85
|
function stopOf(definition, nodeId) {
|
|
71
86
|
const width = Math.max(STOP_MIN_WIDTH, Math.ceil(nodeTitle(nodeId).length * STOP_CHAR_WIDTH + STOP_PADDING));
|
|
72
87
|
const [incoming] = incomingEdgesOf(definition, nodeId);
|
|
@@ -86,12 +101,15 @@ function exitDotEdgesOf(definition) {
|
|
|
86
101
|
const mainEdges = mainPathOf(definition).edges;
|
|
87
102
|
return definition.edges.filter((edge) => edge.to === definition.exit && !mainEdges.has(edgeKeyOf(edge)));
|
|
88
103
|
}
|
|
104
|
+
/** Whether a laid-out child is an exit dot, or the shared end that merges a row's exit dots. */
|
|
105
|
+
export const isExitId = (id) => id.endsWith(EXIT_SUFFIX);
|
|
106
|
+
const EXIT_SUFFIX = ":exit";
|
|
89
107
|
function exitDotOf(edge) {
|
|
90
108
|
return {
|
|
91
|
-
id: `${edgeKeyOf(edge)}
|
|
109
|
+
id: `${edgeKeyOf(edge)}${EXIT_SUFFIX}`,
|
|
92
110
|
width: EXIT_DOT_SIZE,
|
|
93
111
|
height: EXIT_DOT_SIZE,
|
|
94
|
-
layoutOptions:
|
|
112
|
+
layoutOptions: FIXED_SIDE,
|
|
95
113
|
ports: [portOf(edge, "in", "WEST")],
|
|
96
114
|
};
|
|
97
115
|
}
|
|
@@ -109,7 +127,7 @@ function stubOf(edge, { idSuffix, direction, side }) {
|
|
|
109
127
|
id: `${edgeKeyOf(edge)}:${idSuffix}`,
|
|
110
128
|
width: STUB_SIZE,
|
|
111
129
|
height: STUB_SIZE,
|
|
112
|
-
layoutOptions:
|
|
130
|
+
layoutOptions: FIXED_SIDE,
|
|
113
131
|
ports: [portOf(edge, direction, side)],
|
|
114
132
|
};
|
|
115
133
|
}
|
package/dist/elk-layout.d.ts
CHANGED
package/dist/elk-layout.js
CHANGED
|
@@ -1,26 +1,49 @@
|
|
|
1
1
|
// Runs ELK on a line's graph and maps the result into what the view draws.
|
|
2
2
|
import ELK from "elkjs/lib/elk.bundled.js";
|
|
3
|
-
import { elkGraphOf } from "./elk-graph";
|
|
3
|
+
import { elkGraphOf, isExitId } from "./elk-graph";
|
|
4
|
+
import { unwrapSnake } from "./elk-snake-layout";
|
|
5
|
+
import { anchoredRowsOf, columnsOf, sharedEndsOf, snakeGraphOf, wrappedRowsOf } from "./elk-snake-graph";
|
|
6
|
+
import { edgeKeyOf } from "./metro/edge-key";
|
|
7
|
+
const LAYERS_PER_ROW = 5;
|
|
4
8
|
/** Lays out a line with ELK: node centres, one SVG path and label centre per edge, and the canvas box. */
|
|
5
9
|
export async function layoutWithElk(definition, size, options) {
|
|
6
|
-
const
|
|
10
|
+
const flat = elkGraphOf(definition, size, options);
|
|
11
|
+
const oneLine = await new ELK().layout(structuredClone(flat));
|
|
12
|
+
const columns = columnsOf(oneLine);
|
|
13
|
+
const wrappedRows = wrappedRowsOf(columns, LAYERS_PER_ROW);
|
|
14
|
+
const snake = wrappedRows && sharedEndsOf(flat, anchoredRowsOf(flat, wrappedRows));
|
|
15
|
+
const laidOut = snake ? unwrapSnake(await new ELK().layout(snakeGraphOf(snake.flat, snake.rowOf)), definition.edges.map(edgeKeyOf)) : await withSharedEnd(flat, oneLine);
|
|
7
16
|
const nodes = nodesOf(laidOut);
|
|
8
17
|
return {
|
|
9
18
|
nodes,
|
|
10
|
-
edges: edgesOf(laidOut, definition,
|
|
19
|
+
edges: edgesOf(laidOut, definition, columns),
|
|
11
20
|
contentBox: { minX: 0, minY: 0, maxX: laidOut.width ?? 0, maxY: laidOut.height ?? 0 },
|
|
12
21
|
};
|
|
13
22
|
}
|
|
23
|
+
async function withSharedEnd(flat, oneLine) {
|
|
24
|
+
const children = flat.children ?? [];
|
|
25
|
+
if (!children.some((child) => isExitId(child.id)))
|
|
26
|
+
return oneLine;
|
|
27
|
+
const { flat: sharedFlat } = sharedEndsOf(flat, new Map(children.map((child) => [child.id, 0])));
|
|
28
|
+
return new ELK().layout(structuredClone(sharedFlat));
|
|
29
|
+
}
|
|
14
30
|
function nodesOf(laidOut) {
|
|
15
|
-
return (laidOut.children ?? []).map(({ id, x: left = 0, y: top = 0, width = 0, height = 0, ports = [] }) => ({
|
|
31
|
+
return (laidOut.children ?? []).map(({ id, x: left = 0, y: top = 0, width = 0, height = 0, ports = [], labels }) => ({
|
|
16
32
|
id,
|
|
17
33
|
x: left + width / 2,
|
|
18
34
|
y: top + height / 2,
|
|
19
35
|
width,
|
|
20
36
|
height,
|
|
21
37
|
ports: ports.map((port) => portOf(port, left, top)),
|
|
38
|
+
...titleBoxOf(labels, left, top),
|
|
22
39
|
}));
|
|
23
40
|
}
|
|
41
|
+
function titleBoxOf(labels, left, top) {
|
|
42
|
+
if (!labels?.length)
|
|
43
|
+
return {};
|
|
44
|
+
const { minX, minY, maxX, maxY } = labelBoxOf(labels[0]);
|
|
45
|
+
return { titleBox: { minX: left + minX, minY: top + minY, maxX: left + maxX, maxY: top + maxY } };
|
|
46
|
+
}
|
|
24
47
|
function portOf({ id, x: portLeft = 0, y: portTop = 0, width = 0, height = 0 }, left, top) {
|
|
25
48
|
const separator = id.lastIndexOf(":");
|
|
26
49
|
return {
|
|
@@ -30,17 +53,18 @@ function portOf({ id, x: portLeft = 0, y: portTop = 0, width = 0, height = 0 },
|
|
|
30
53
|
y: top + portTop + height / 2,
|
|
31
54
|
};
|
|
32
55
|
}
|
|
33
|
-
function edgesOf(laidOut, definition,
|
|
34
|
-
const
|
|
35
|
-
return
|
|
36
|
-
const { from, to, on } =
|
|
37
|
-
const
|
|
56
|
+
function edgesOf(laidOut, definition, columns) {
|
|
57
|
+
const laidOutEdges = new Map((laidOut.edges ?? []).map((laidOutEdge) => [laidOutEdge.id, laidOutEdge]));
|
|
58
|
+
return definition.edges.map((edge) => {
|
|
59
|
+
const { from, to, on } = edge;
|
|
60
|
+
const laidOutEdge = laidOutEdges.get(edgeKeyOf(edge));
|
|
61
|
+
const labelBox = labelBoxOf(laidOutEdge?.labels?.[0]);
|
|
38
62
|
return {
|
|
39
63
|
from,
|
|
40
64
|
to,
|
|
41
65
|
on,
|
|
42
|
-
kind: edgeKindOf(from, to,
|
|
43
|
-
d: pathOf(laidOutEdge
|
|
66
|
+
kind: edgeKindOf(from, to, columns),
|
|
67
|
+
d: pathOf(laidOutEdge?.sections?.[0]),
|
|
44
68
|
mid: centreOf(labelBox),
|
|
45
69
|
labelBox,
|
|
46
70
|
};
|
|
@@ -59,9 +83,9 @@ function labelBoxOf(label) {
|
|
|
59
83
|
function centreOf({ minX, minY, maxX, maxY }) {
|
|
60
84
|
return { x: (minX + maxX) / 2, y: (minY + maxY) / 2, vertical: false };
|
|
61
85
|
}
|
|
62
|
-
function edgeKindOf(from, to,
|
|
86
|
+
function edgeKindOf(from, to, columns) {
|
|
63
87
|
if (from === to)
|
|
64
88
|
return "self";
|
|
65
|
-
return (
|
|
89
|
+
return (columns.get(to) ?? 0) > (columns.get(from) ?? 0) ? "forward" : "back";
|
|
66
90
|
}
|
|
67
91
|
//# sourceMappingURL=elk-layout.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ElkNode } from "elkjs/lib/elk-api";
|
|
2
|
+
/** The column of each child of a laid-out line, keyed by child id: sorted by x, a child starting past the column's widest right edge opens the next column. */
|
|
3
|
+
export declare function columnsOf(laidOut: ElkNode): Map<string, number>;
|
|
4
|
+
/** The row index of each column of a laid-out line. */
|
|
5
|
+
export declare function rowsOf(columnCount: number, columnsPerRow: number): number[];
|
|
6
|
+
/** The row of each child when the columns outnumber a row's share, otherwise undefined: the line stays on one row. */
|
|
7
|
+
export declare function wrappedRowsOf(columns: ReadonlyMap<string, number>, columnsPerRow: number): Map<string, number> | undefined;
|
|
8
|
+
/** The rows with each end dot and stub moved to the row of the station at the other end of its edge. */
|
|
9
|
+
export declare function anchoredRowsOf(flat: ElkNode, rowOf: ReadonlyMap<string, number>): Map<string, number>;
|
|
10
|
+
/** The flat line graph with each row's exit dots merged into one end, as tall as its lines need. */
|
|
11
|
+
export declare function sharedEndsOf(flat: ElkNode, rowOf: ReadonlyMap<string, number>): {
|
|
12
|
+
flat: ElkNode;
|
|
13
|
+
rowOf: Map<string, number>;
|
|
14
|
+
};
|
|
15
|
+
/** The flat line graph wrapped into one compound per row, under a root that runs down. */
|
|
16
|
+
export declare function snakeGraphOf(flat: ElkNode, rowOf: ReadonlyMap<string, number>): ElkNode;
|
|
17
|
+
/** The ids of the three parts a between-row edge is split into, and of its two row ports; the layout joins the parts back by these. */
|
|
18
|
+
export declare const rowId: (row: number) => string;
|
|
19
|
+
export declare const sharedEndId: (row: number) => string;
|
|
20
|
+
export declare const outPartId: (edgeId: string) => string;
|
|
21
|
+
export declare const betweenPartId: (edgeId: string) => string;
|
|
22
|
+
export declare const inPartId: (edgeId: string) => string;
|
|
23
|
+
export declare const rowOutPortId: (edgeId: string) => string;
|
|
24
|
+
export declare const rowInPortId: (edgeId: string) => string;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { isExitId, NODE_SIZE } from "./elk-graph";
|
|
2
|
+
/** The column of each child of a laid-out line, keyed by child id: sorted by x, a child starting past the column's widest right edge opens the next column. */
|
|
3
|
+
export function columnsOf(laidOut) {
|
|
4
|
+
const spans = (laidOut.children ?? []).map(spanOf).sort((first, second) => first.left - second.left);
|
|
5
|
+
const columns = new Map();
|
|
6
|
+
let column = -1;
|
|
7
|
+
let widestRight = 0;
|
|
8
|
+
for (const span of spans) {
|
|
9
|
+
if (span.left >= widestRight)
|
|
10
|
+
column += 1;
|
|
11
|
+
columns.set(span.id, column);
|
|
12
|
+
widestRight = Math.max(widestRight, span.right);
|
|
13
|
+
}
|
|
14
|
+
return columns;
|
|
15
|
+
}
|
|
16
|
+
function spanOf(child) {
|
|
17
|
+
const left = child.x ?? 0;
|
|
18
|
+
return { id: child.id, left, right: left + (child.width ?? 0) };
|
|
19
|
+
}
|
|
20
|
+
/** The row index of each column of a laid-out line. */
|
|
21
|
+
export function rowsOf(columnCount, columnsPerRow) {
|
|
22
|
+
const rowCount = Math.ceil(columnCount / columnsPerRow);
|
|
23
|
+
return Array.from({ length: columnCount }, (unused, column) => Math.floor((column * rowCount) / columnCount));
|
|
24
|
+
}
|
|
25
|
+
/** The row of each child when the columns outnumber a row's share, otherwise undefined: the line stays on one row. */
|
|
26
|
+
export function wrappedRowsOf(columns, columnsPerRow) {
|
|
27
|
+
const columnCount = new Set(columns.values()).size;
|
|
28
|
+
if (columnCount <= columnsPerRow)
|
|
29
|
+
return undefined;
|
|
30
|
+
const rowOfColumn = rowsOf(columnCount, columnsPerRow);
|
|
31
|
+
return new Map([...columns].map(([id, column]) => [id, rowOfColumn[column]]));
|
|
32
|
+
}
|
|
33
|
+
/** The rows with each end dot and stub moved to the row of the station at the other end of its edge. */
|
|
34
|
+
export function anchoredRowsOf(flat, rowOf) {
|
|
35
|
+
const owners = ownerOfPorts(flat);
|
|
36
|
+
const ends = (flat.edges ?? []).flatMap((edge) => endAnchorsOf(owners.get(edge.sources[0]) ?? "", owners.get(edge.targets[0]) ?? "", rowOf));
|
|
37
|
+
return new Map([...rowOf, ...ends]);
|
|
38
|
+
}
|
|
39
|
+
function endAnchorsOf(source, target, rowOf) {
|
|
40
|
+
if (END_CHILD_ID.test(source))
|
|
41
|
+
return [[source, rowOf.get(target) ?? 0]];
|
|
42
|
+
if (END_CHILD_ID.test(target))
|
|
43
|
+
return [[target, rowOf.get(source) ?? 0]];
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
const END_CHILD_ID = /:(exit|stub|source-stub)$/;
|
|
47
|
+
/** The flat line graph with each row's exit dots merged into one end, as tall as its lines need. */
|
|
48
|
+
export function sharedEndsOf(flat, rowOf) {
|
|
49
|
+
const children = flat.children ?? [];
|
|
50
|
+
const dots = children.filter((child) => isExitId(child.id));
|
|
51
|
+
const dotRows = [...new Set(dots.map((dot) => rowOf.get(dot.id) ?? 0))];
|
|
52
|
+
const ends = dotRows.map((row) => ({ row, end: sharedEndOf(row, dots.filter((dot) => rowOf.get(dot.id) === row)) }));
|
|
53
|
+
const dotIds = new Set(dots.map((dot) => dot.id));
|
|
54
|
+
const keptRows = [...rowOf].filter(([id]) => !dotIds.has(id));
|
|
55
|
+
return {
|
|
56
|
+
flat: { ...flat, children: [...children.filter((child) => !dotIds.has(child.id)), ...ends.map(({ end }) => end)] },
|
|
57
|
+
rowOf: new Map([...keptRows, ...ends.map(({ row, end }) => [end.id, row])]),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function sharedEndOf(row, dots) {
|
|
61
|
+
const ports = dots.flatMap((dot) => dot.ports ?? []);
|
|
62
|
+
return { ...dots[0], id: sharedEndId(row), height: ports.length * NODE_SIZE.height, ports };
|
|
63
|
+
}
|
|
64
|
+
/** The flat line graph wrapped into one compound per row, under a root that runs down. */
|
|
65
|
+
export function snakeGraphOf(flat, rowOf) {
|
|
66
|
+
const rowCount = Math.max(...rowOf.values()) + 1;
|
|
67
|
+
const owners = ownerOfPorts(flat);
|
|
68
|
+
const edges = flat.edges ?? [];
|
|
69
|
+
const edgeRows = new Map(edges.map((edge) => [edge.id, sharedRowOf(edge, rowOf, owners)]));
|
|
70
|
+
const crossings = edges.filter((edge) => edgeRows.get(edge.id) === undefined).map((edge) => crossingOf(edge, rowOf, owners));
|
|
71
|
+
const rows = Array.from({ length: rowCount }, (unused, row) => ({
|
|
72
|
+
id: rowId(row),
|
|
73
|
+
layoutOptions: { ...flat.layoutOptions, "elk.direction": directionOf(row), "elk.portConstraints": "FIXED_SIDE", "elk.layered.nodePlacement.bk.fixedAlignment": "LEFTUP" },
|
|
74
|
+
children: (flat.children ?? []).filter((child) => rowOf.get(child.id) === row).map((child) => (isRightRow(row) ? child : mirroredPortsOf(child))),
|
|
75
|
+
ports: crossings.flatMap((crossing) => rowPortsOf(crossing, row)),
|
|
76
|
+
edges: [...edges.filter((edge) => edgeRows.get(edge.id) === row), ...crossings.flatMap((crossing) => rowPartsOf(crossing, row))],
|
|
77
|
+
}));
|
|
78
|
+
return {
|
|
79
|
+
...flat,
|
|
80
|
+
edges: crossings.map(betweenEdgeOf),
|
|
81
|
+
layoutOptions: { ...flat.layoutOptions, "elk.direction": "DOWN", "elk.hierarchyHandling": "SEPARATE_CHILDREN", "elk.layered.nodePlacement.strategy": "SIMPLE" },
|
|
82
|
+
children: rows,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** The ids of the three parts a between-row edge is split into, and of its two row ports; the layout joins the parts back by these. */
|
|
86
|
+
export const rowId = (row) => `row:${row}`;
|
|
87
|
+
export const sharedEndId = (row) => `${rowId(row)}:exit`;
|
|
88
|
+
export const outPartId = (edgeId) => `${edgeId}#out`;
|
|
89
|
+
export const betweenPartId = (edgeId) => `${edgeId}#between`;
|
|
90
|
+
export const inPartId = (edgeId) => `${edgeId}#in`;
|
|
91
|
+
export const rowOutPortId = (edgeId) => `${edgeId}:rowout`;
|
|
92
|
+
export const rowInPortId = (edgeId) => `${edgeId}:rowin`;
|
|
93
|
+
function crossingOf(edge, rowOf, owners) {
|
|
94
|
+
return { edge, fromRow: endpointRowOf(edge.sources[0], rowOf, owners) ?? 0, toRow: endpointRowOf(edge.targets[0], rowOf, owners) ?? 0 };
|
|
95
|
+
}
|
|
96
|
+
function rowPortsOf({ edge, fromRow, toRow }, row) {
|
|
97
|
+
const rowPort = (id, side) => ({ id, width: 0, height: 0, layoutOptions: { "elk.port.side": side } });
|
|
98
|
+
const outPorts = fromRow === row ? [rowPort(rowOutPortId(edge.id), flowEndSideOf(row))] : [];
|
|
99
|
+
const inPorts = toRow === row ? [rowPort(rowInPortId(edge.id), MIRRORED_SIDE[flowEndSideOf(row)])] : [];
|
|
100
|
+
return [...outPorts, ...inPorts];
|
|
101
|
+
}
|
|
102
|
+
function rowPartsOf({ edge, fromRow, toRow }, row) {
|
|
103
|
+
const outParts = fromRow === row ? [{ id: outPartId(edge.id), sources: edge.sources, targets: [rowOutPortId(edge.id)] }] : [];
|
|
104
|
+
const inParts = toRow === row ? [{ id: inPartId(edge.id), sources: [rowInPortId(edge.id)], targets: edge.targets }] : [];
|
|
105
|
+
return [...outParts, ...inParts];
|
|
106
|
+
}
|
|
107
|
+
function betweenEdgeOf({ edge }) {
|
|
108
|
+
return { id: betweenPartId(edge.id), sources: [rowOutPortId(edge.id)], targets: [rowInPortId(edge.id)], labels: edge.labels };
|
|
109
|
+
}
|
|
110
|
+
function directionOf(row) {
|
|
111
|
+
return isRightRow(row) ? "RIGHT" : "LEFT";
|
|
112
|
+
}
|
|
113
|
+
function isRightRow(row) {
|
|
114
|
+
return row % 2 === 0;
|
|
115
|
+
}
|
|
116
|
+
function flowEndSideOf(row) {
|
|
117
|
+
return directionOf(row) === "RIGHT" ? "EAST" : "WEST";
|
|
118
|
+
}
|
|
119
|
+
function ownerOfPorts(flat) {
|
|
120
|
+
const portOwners = (flat.children ?? []).flatMap((child) => (child.ports ?? []).map((port) => [port.id, child.id]));
|
|
121
|
+
return new Map(portOwners);
|
|
122
|
+
}
|
|
123
|
+
function endpointRowOf(portId, rowOf, owners) {
|
|
124
|
+
return rowOf.get(owners.get(portId) ?? "");
|
|
125
|
+
}
|
|
126
|
+
function sharedRowOf(edge, rowOf, owners) {
|
|
127
|
+
const sourceRow = endpointRowOf(edge.sources[0], rowOf, owners);
|
|
128
|
+
const targetRow = endpointRowOf(edge.targets[0], rowOf, owners);
|
|
129
|
+
return sourceRow === targetRow ? sourceRow : undefined;
|
|
130
|
+
}
|
|
131
|
+
const MIRRORED_SIDE = { WEST: "EAST", EAST: "WEST" };
|
|
132
|
+
function mirroredPortsOf(child) {
|
|
133
|
+
const ports = (child.ports ?? []).map((port) => mirroredPortOf(port, child.width ?? 0));
|
|
134
|
+
return { ...child, ports };
|
|
135
|
+
}
|
|
136
|
+
function mirroredPortOf(port, nodeWidth) {
|
|
137
|
+
const side = port.layoutOptions?.["elk.port.side"] ?? "";
|
|
138
|
+
if (side in MIRRORED_SIDE)
|
|
139
|
+
return { ...port, layoutOptions: { ...port.layoutOptions, "elk.port.side": MIRRORED_SIDE[side] } };
|
|
140
|
+
return port.x === undefined ? port : { ...port, x: nodeWidth - port.x };
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=elk-snake-graph.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { betweenPartId, inPartId, outPartId } from "./elk-snake-graph";
|
|
2
|
+
/** The laid-out snake as one graph: children and edge paths in absolute coordinates, one edge per key, with its label. */
|
|
3
|
+
export function unwrapSnake(snake, edgeKeys) {
|
|
4
|
+
const rows = snake.children ?? [];
|
|
5
|
+
const placed = new Map([...(snake.edges ?? []).map((edge) => placedOn(edge, snake)), ...rows.flatMap((row) => (row.edges ?? []).map((edge) => placedOn(edge, row)))]);
|
|
6
|
+
return { ...snake, children: rows.flatMap(movedChildrenOf), edges: edgeKeys.map((key) => joinedEdgeOf(key, placed)) };
|
|
7
|
+
}
|
|
8
|
+
function placedOn(edge, container) {
|
|
9
|
+
return [edge.id, { edge, origin: originOf(container) }];
|
|
10
|
+
}
|
|
11
|
+
function movedChildrenOf(row) {
|
|
12
|
+
return (row.children ?? []).map((child) => movedBy(child, originOf(row)));
|
|
13
|
+
}
|
|
14
|
+
function originOf({ x: left = 0, y: top = 0 }) {
|
|
15
|
+
return { x: left, y: top };
|
|
16
|
+
}
|
|
17
|
+
function movedBy(placed, origin) {
|
|
18
|
+
return { ...placed, x: (placed.x ?? 0) + origin.x, y: (placed.y ?? 0) + origin.y };
|
|
19
|
+
}
|
|
20
|
+
function joinedEdgeOf(key, placed) {
|
|
21
|
+
const parts = [key, outPartId(key), betweenPartId(key), inPartId(key)].flatMap((id) => placed.get(id) ?? []);
|
|
22
|
+
const [startPoint, ...rest] = withoutStraightMiddles(withoutRepeats(parts.flatMap(pointsOf)));
|
|
23
|
+
const endPoint = rest.pop() ?? startPoint;
|
|
24
|
+
const section = { id: key, startPoint, bendPoints: rest, endPoint };
|
|
25
|
+
return { id: key, sources: [], targets: [], sections: [section], labels: parts.flatMap(labelOf).slice(0, 1) };
|
|
26
|
+
}
|
|
27
|
+
function pointsOf({ edge, origin }) {
|
|
28
|
+
const sections = edge.sections ?? [];
|
|
29
|
+
return sections.flatMap(({ startPoint, bendPoints = [], endPoint }) => [startPoint, ...bendPoints, endPoint]).map((point) => movedBy(point, origin));
|
|
30
|
+
}
|
|
31
|
+
function labelOf({ edge, origin }) {
|
|
32
|
+
return (edge.labels ?? []).map((label) => movedBy(label, origin));
|
|
33
|
+
}
|
|
34
|
+
function withoutRepeats(points) {
|
|
35
|
+
return points.filter((point, index) => index === 0 || !isNear(point.x, points[index - 1].x) || !isNear(point.y, points[index - 1].y));
|
|
36
|
+
}
|
|
37
|
+
function withoutStraightMiddles(points) {
|
|
38
|
+
return points.filter((point, index) => index === 0 || index === points.length - 1 || !isStraightRun(points[index - 1], point, points[index + 1]));
|
|
39
|
+
}
|
|
40
|
+
function isStraightRun(before, point, after) {
|
|
41
|
+
const sameColumn = isNear(before.x, point.x) && isNear(point.x, after.x);
|
|
42
|
+
const sameRow = isNear(before.y, point.y) && isNear(point.y, after.y);
|
|
43
|
+
return sameColumn || sameRow;
|
|
44
|
+
}
|
|
45
|
+
function isNear(first, second) {
|
|
46
|
+
return Math.abs(first - second) < 0.01;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=elk-snake-layout.js.map
|
package/dist/graph-markers.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isExitId } from "./elk-graph";
|
|
2
3
|
import DanglingStub from "./DanglingStub";
|
|
3
4
|
import ExitDot from "./ExitDot";
|
|
4
5
|
export function markerOf(node, exit) {
|
|
5
|
-
if (node.id
|
|
6
|
+
if (isExitId(node.id)) {
|
|
6
7
|
return _jsx(ExitDot, { node: node, exit: exit }, node.id);
|
|
7
8
|
}
|
|
8
9
|
return node.id.endsWith(":stub") ? _jsx(DanglingStub, { node: node }, node.id) : null;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { ElkLayout } from "./elk-layout";
|
|
2
|
+
type EdgePair = {
|
|
3
|
+
edge: string;
|
|
4
|
+
beside: string;
|
|
5
|
+
};
|
|
2
6
|
/** Lists each edge segment that crosses a station box other than the edge's own endpoints. */
|
|
3
7
|
export declare function linesThroughStations(layout: ElkLayout): {
|
|
4
8
|
edge: string;
|
|
@@ -9,8 +13,16 @@ export declare function linesOverLabels(layout: ElkLayout): {
|
|
|
9
13
|
edge: string;
|
|
10
14
|
label: string;
|
|
11
15
|
}[];
|
|
16
|
+
/** Lists each edge whose path runs through the title box of any node, its own endpoints included. */
|
|
17
|
+
export declare function linesThroughTitles(layout: ElkLayout): {
|
|
18
|
+
edge: string;
|
|
19
|
+
title: string;
|
|
20
|
+
}[];
|
|
12
21
|
/** Lists each interior segment of an edge path, never the first or last, shorter than the minimum. */
|
|
13
22
|
export declare function tinyTurns(layout: ElkLayout, minimum: number): {
|
|
14
23
|
edge: string;
|
|
15
24
|
length: number;
|
|
16
25
|
}[];
|
|
26
|
+
/** Lists each pair of different edges whose parallel stretches run closer than the minimum gap. */
|
|
27
|
+
export declare function linesAlongside(layout: ElkLayout, minGap: number): EdgePair[];
|
|
28
|
+
export {};
|
package/dist/layout-geometry.js
CHANGED
|
@@ -8,6 +8,10 @@ export function linesThroughStations(layout) {
|
|
|
8
8
|
export function linesOverLabels(layout) {
|
|
9
9
|
return layout.edges.flatMap((edge) => labelsCrossedBy(edge, layout.edges).map((labelled) => ({ edge: edgeKeyOf(edge), label: edgeKeyOf(labelled) })));
|
|
10
10
|
}
|
|
11
|
+
/** Lists each edge whose path runs through the title box of any node, its own endpoints included. */
|
|
12
|
+
export function linesThroughTitles(layout) {
|
|
13
|
+
return layout.edges.flatMap((edge) => titlesCrossedBy(edge, layout.nodes).map((titled) => ({ edge: edgeKeyOf(edge), title: titled.id })));
|
|
14
|
+
}
|
|
11
15
|
/** Lists each interior segment of an edge path, never the first or last, shorter than the minimum. */
|
|
12
16
|
export function tinyTurns(layout, minimum) {
|
|
13
17
|
return layout.edges.flatMap((edge) => segmentsOf(edge)
|
|
@@ -16,6 +20,31 @@ export function tinyTurns(layout, minimum) {
|
|
|
16
20
|
.filter((length) => length < minimum)
|
|
17
21
|
.map((length) => ({ edge: edgeKeyOf(edge), length })));
|
|
18
22
|
}
|
|
23
|
+
/** Lists each pair of different edges whose parallel stretches run closer than the minimum gap. */
|
|
24
|
+
export function linesAlongside(layout, minGap) {
|
|
25
|
+
return layout.edges.flatMap((edge, index) => besideLaterEdges(edge, layout.edges.slice(index + 1), minGap));
|
|
26
|
+
}
|
|
27
|
+
/** The pairs of the edge with each later edge that runs alongside it. */
|
|
28
|
+
function besideLaterEdges(edge, laterEdges, minGap) {
|
|
29
|
+
const neighbours = laterEdges.filter((later) => runsAlongside(segmentsOf(edge), segmentsOf(later), minGap));
|
|
30
|
+
return neighbours.map((later) => ({ edge: edgeKeyOf(edge), beside: edgeKeyOf(later) }));
|
|
31
|
+
}
|
|
32
|
+
/** True when a horizontal or a vertical stretch of one path runs closer than the gap to a parallel stretch of the other, over a shared span. */
|
|
33
|
+
function runsAlongside(first, second, minGap) {
|
|
34
|
+
return first.some((one) => second.some((other) => horizontalAlongside(one, other, minGap) || horizontalAlongside(transposed(one), transposed(other), minGap)));
|
|
35
|
+
}
|
|
36
|
+
/** Two flat stretches whose heights differ by less than the gap while their spans overlap; a zero-length point never overlaps. */
|
|
37
|
+
function horizontalAlongside(one, other, minGap) {
|
|
38
|
+
return isHorizontal(one) && isHorizontal(other) && Math.abs(one.top - other.top) < minGap && one.left < other.right && other.left < one.right;
|
|
39
|
+
}
|
|
40
|
+
/** The box mirrored across the diagonal, so a vertical stretch reads as a horizontal one. */
|
|
41
|
+
function transposed(box) {
|
|
42
|
+
return { left: box.top, right: box.bottom, top: box.left, bottom: box.right };
|
|
43
|
+
}
|
|
44
|
+
/** A stretch with no height, running left to right. */
|
|
45
|
+
function isHorizontal(box) {
|
|
46
|
+
return box.top === box.bottom;
|
|
47
|
+
}
|
|
19
48
|
/** Paths are axis-aligned, so one of the two spans is always zero. */
|
|
20
49
|
function lengthOf(segment) {
|
|
21
50
|
return segment.right - segment.left + (segment.bottom - segment.top);
|
|
@@ -26,6 +55,12 @@ function labelsCrossedBy(edge, edges) {
|
|
|
26
55
|
const others = edges.filter((other) => other !== edge);
|
|
27
56
|
return others.filter((other) => segments.some((segment) => overlaps(segment, labelBoxOf(other))));
|
|
28
57
|
}
|
|
58
|
+
/** The stations whose title box the edge's path runs through. */
|
|
59
|
+
function titlesCrossedBy(edge, stations) {
|
|
60
|
+
const segments = segmentsOf(edge);
|
|
61
|
+
const titles = stations.flatMap((station) => (station.titleBox ? [{ station, bounds: boundsOf(station.titleBox) }] : []));
|
|
62
|
+
return titles.filter(({ bounds }) => segments.some((segment) => overlaps(segment, bounds))).map(({ station }) => station);
|
|
63
|
+
}
|
|
29
64
|
/** The stations, other than the edge's own endpoints, whose box the edge's path runs through. */
|
|
30
65
|
function stationsCrossedBy(edge, stations) {
|
|
31
66
|
const segments = segmentsOf(edge);
|
|
@@ -42,7 +77,10 @@ function segmentsOf({ d }) {
|
|
|
42
77
|
});
|
|
43
78
|
}
|
|
44
79
|
function labelBoxOf({ labelBox }) {
|
|
45
|
-
return
|
|
80
|
+
return boundsOf(labelBox);
|
|
81
|
+
}
|
|
82
|
+
function boundsOf({ minX, maxX, minY, maxY }) {
|
|
83
|
+
return { left: minX, right: maxX, top: minY, bottom: maxY };
|
|
46
84
|
}
|
|
47
85
|
/** The station box shrunk by a margin, so a path grazing the border does not count as crossing. */
|
|
48
86
|
function stationBoxOf(station) {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export declare const LAYOUT_WAIT: {
|
|
2
|
+
timeout: number;
|
|
3
|
+
};
|
|
1
4
|
export declare function renderGraph(ui: React.ReactElement): Promise<import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>>;
|
|
2
5
|
export declare const nodeEl: (container: HTMLElement, id: string) => HTMLElement;
|
|
3
6
|
export declare const edgeEl: (container: HTMLElement, key: string) => HTMLElement;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { render, waitFor } from "@testing-library/react";
|
|
2
2
|
import { expect } from "vitest";
|
|
3
|
+
// ELK lays out asynchronously; its cold start under a parallel test run outlasts waitFor's default 1000 ms.
|
|
4
|
+
export const LAYOUT_WAIT = { timeout: 5000 };
|
|
3
5
|
export async function renderGraph(ui) {
|
|
4
6
|
const rendered = render(ui);
|
|
5
|
-
await waitFor(() => expect(rendered.container.querySelector("[data-node]")).not.toBeNull());
|
|
7
|
+
await waitFor(() => expect(rendered.container.querySelector("[data-node]")).not.toBeNull(), LAYOUT_WAIT);
|
|
6
8
|
return rendered;
|
|
7
9
|
}
|
|
8
10
|
export const nodeEl = (container, id) => container.querySelector(`[data-node="${id}"]`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@re-cinq/floor-graph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "A React view of an assembly line as a graph: the layout of its nodes and edges, the viewport that fits and pans it, and the node and edge drawing, with the stylesheets it needs.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typecheck": "tsc --noEmit"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@re-cinq/floor-contracts": "0.
|
|
48
|
+
"@re-cinq/floor-contracts": "0.12.0",
|
|
49
49
|
"elkjs": "0.9.3"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|