@principal-ai/principal-view-react 0.15.5 → 0.15.7
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/components/SequenceDiagramRenderer.d.ts +6 -2
- package/dist/components/SequenceDiagramRenderer.d.ts.map +1 -1
- package/dist/components/SequenceDiagramRenderer.js +253 -35
- package/dist/components/SequenceDiagramRenderer.js.map +1 -1
- package/dist/components/WorkflowSequenceDiagram.d.ts +1 -4
- package/dist/components/WorkflowSequenceDiagram.d.ts.map +1 -1
- package/dist/components/WorkflowSequenceDiagram.js +3 -6
- package/dist/components/WorkflowSequenceDiagram.js.map +1 -1
- package/dist/hooks/useSequenceLayout.d.ts +51 -27
- package/dist/hooks/useSequenceLayout.d.ts.map +1 -1
- package/dist/hooks/useSequenceLayout.js +140 -118
- package/dist/hooks/useSequenceLayout.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/SequenceDiagramRenderer.tsx +395 -48
- package/src/components/WorkflowSequenceDiagram.tsx +3 -6
- package/src/hooks/useSequenceLayout.ts +192 -163
- package/src/index.ts +0 -1
- package/src/stories/FileCitySequence.stories.tsx +22 -50
- package/src/stories/SequenceDiagram.stories.tsx +12 -29
- package/src/stories/WorkflowSequenceDiagram.stories.tsx +14 -26
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* React hook for sequence diagram layout
|
|
3
3
|
*
|
|
4
|
-
* Computes swimlane-based positioning for events
|
|
4
|
+
* Computes swimlane-based positioning for events. Lanes default to the first
|
|
5
|
+
* dotted segment of each event name. Callers can drill deeper by passing
|
|
6
|
+
* `openedNamespaces`: any prefix listed there has its events pushed one level
|
|
7
|
+
* deeper, so its children appear as their own lanes instead of being grouped
|
|
8
|
+
* under the parent.
|
|
5
9
|
*/
|
|
6
10
|
import type { Node, Edge } from '@xyflow/react';
|
|
7
11
|
/**
|
|
@@ -50,34 +54,35 @@ export interface SequenceEdge {
|
|
|
50
54
|
* Swimlane information computed from events
|
|
51
55
|
*/
|
|
52
56
|
export interface Swimlane {
|
|
53
|
-
/** Namespace identifier */
|
|
57
|
+
/** Namespace identifier for this lane */
|
|
54
58
|
namespace: string;
|
|
55
|
-
/** Display label for the lane header */
|
|
59
|
+
/** Display label for the lane header (last segment of the namespace) */
|
|
56
60
|
label: string;
|
|
57
61
|
/** X position of the lane center */
|
|
58
62
|
x: number;
|
|
59
|
-
/** Parent namespace (
|
|
63
|
+
/** Parent namespace (one segment shallower), if any */
|
|
60
64
|
parentNamespace?: string;
|
|
61
|
-
/** Whether this lane is
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
/**
|
|
65
|
+
/** Whether this lane's namespace is in `openedNamespaces` (its events have been drilled deeper) */
|
|
66
|
+
isOpened: boolean;
|
|
67
|
+
/** Whether the immediate parent namespace is opened (this lane only exists because its parent was drilled into) */
|
|
68
|
+
isParentOpened: boolean;
|
|
69
|
+
/** Whether any event extends strictly past this lane's namespace (so opening would split it further) */
|
|
70
|
+
canExpand: boolean;
|
|
71
|
+
/** Events directly assigned to this lane */
|
|
66
72
|
eventIds: string[];
|
|
67
73
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Namespace extraction strategy
|
|
70
|
-
*/
|
|
71
|
-
export type NamespaceStrategy = 'first' | 'all-but-last' | number | ((name: string) => string);
|
|
72
74
|
/**
|
|
73
75
|
* Options for sequence layout
|
|
74
76
|
*/
|
|
75
77
|
export interface UseSequenceLayoutOptions {
|
|
76
78
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
+
* Namespace prefixes whose events should be drilled one segment deeper.
|
|
80
|
+
* Pass an array or a Set. Each entry is a dotted prefix (e.g. `auth` or
|
|
81
|
+
* `auth.user`). When listed, events under that prefix land in lanes one
|
|
82
|
+
* level deeper than the prefix, instead of all sharing the prefix lane.
|
|
83
|
+
* Drilling is recursive: list both `auth` and `auth.user` to drill twice.
|
|
79
84
|
*/
|
|
80
|
-
|
|
85
|
+
openedNamespaces?: string[] | Set<string>;
|
|
81
86
|
/**
|
|
82
87
|
* Width of each swimlane
|
|
83
88
|
* @default 250
|
|
@@ -108,10 +113,22 @@ export interface UseSequenceLayoutOptions {
|
|
|
108
113
|
* @default 14
|
|
109
114
|
*/
|
|
110
115
|
nodeHeight?: number;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A header cell for an opened ancestor namespace, sitting above the leaf
|
|
119
|
+
* lanes it groups. Rendered as a row in the header strip.
|
|
120
|
+
*/
|
|
121
|
+
export interface ParentHeader {
|
|
122
|
+
/** Full ancestor namespace (always in `openedNamespaces`) */
|
|
123
|
+
namespace: string;
|
|
124
|
+
/** Last segment, for display */
|
|
125
|
+
label: string;
|
|
126
|
+
/** Center x of the cell */
|
|
127
|
+
x: number;
|
|
128
|
+
/** Total span width across the leaf lanes underneath */
|
|
129
|
+
width: number;
|
|
130
|
+
/** 1-based depth in the header strip (1 = topmost row) */
|
|
131
|
+
depth: number;
|
|
115
132
|
}
|
|
116
133
|
/**
|
|
117
134
|
* Result from sequence layout computation
|
|
@@ -121,20 +138,26 @@ export interface UseSequenceLayoutResult {
|
|
|
121
138
|
nodes: Node[];
|
|
122
139
|
/** Edges for React Flow */
|
|
123
140
|
edges: Edge[];
|
|
124
|
-
/**
|
|
141
|
+
/** Leaf swimlanes — each gets a lifeline and a leaf header row */
|
|
125
142
|
swimlanes: Swimlane[];
|
|
143
|
+
/**
|
|
144
|
+
* Header cells for opened ancestor namespaces. Stack above the leaf
|
|
145
|
+
* headers; depth 1 sits at the top of the header strip.
|
|
146
|
+
*/
|
|
147
|
+
parentHeaders: ParentHeader[];
|
|
148
|
+
/** Number of header rows (= max leaf depth). At least 1. */
|
|
149
|
+
headerRows: number;
|
|
126
150
|
/** Total width of the diagram */
|
|
127
151
|
totalWidth: number;
|
|
128
152
|
/** Total height of the diagram */
|
|
129
153
|
totalHeight: number;
|
|
130
154
|
}
|
|
131
155
|
/**
|
|
132
|
-
*
|
|
156
|
+
* useSequenceLayout
|
|
133
157
|
*
|
|
134
|
-
* @param events - Events to
|
|
135
|
-
* @param
|
|
136
|
-
* @param options - Layout options
|
|
137
|
-
* @returns Layout result with positioned nodes, edges, and swimlane info
|
|
158
|
+
* @param events - Events to lay out
|
|
159
|
+
* @param sequenceEdges - Edges connecting events
|
|
160
|
+
* @param options - Layout options (lane sizing, openedNamespaces)
|
|
138
161
|
*
|
|
139
162
|
* @example
|
|
140
163
|
* ```tsx
|
|
@@ -147,7 +170,8 @@ export interface UseSequenceLayoutResult {
|
|
|
147
170
|
* [
|
|
148
171
|
* { id: 'e1', fromEvent: '1', toEvent: '2' },
|
|
149
172
|
* { id: 'e2', fromEvent: '2', toEvent: '3' },
|
|
150
|
-
* ]
|
|
173
|
+
* ],
|
|
174
|
+
* { openedNamespaces: ['auth'] }, // drill `auth` to show validation/token as separate lanes
|
|
151
175
|
* );
|
|
152
176
|
* ```
|
|
153
177
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSequenceLayout.d.ts","sourceRoot":"","sources":["../../src/hooks/useSequenceLayout.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useSequenceLayout.d.ts","sourceRoot":"","sources":["../../src/hooks/useSequenceLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IAC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CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,sCAAsC;IACtC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,2BAA2B;IAC3B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,kEAAkE;IAClE,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB;;;OAGG;IACH,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;CACrB;AAqBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,EAAE,EACvB,aAAa,EAAE,YAAY,EAAE,EAC7B,OAAO,GAAE,wBAA6B,GACrC,uBAAuB,CAmSzB"}
|
|
@@ -1,48 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* React hook for sequence diagram layout
|
|
3
3
|
*
|
|
4
|
-
* Computes swimlane-based positioning for events
|
|
4
|
+
* Computes swimlane-based positioning for events. Lanes default to the first
|
|
5
|
+
* dotted segment of each event name. Callers can drill deeper by passing
|
|
6
|
+
* `openedNamespaces`: any prefix listed there has its events pushed one level
|
|
7
|
+
* deeper, so its children appear as their own lanes instead of being grouped
|
|
8
|
+
* under the parent.
|
|
5
9
|
*/
|
|
6
10
|
import { useMemo } from 'react';
|
|
7
11
|
/**
|
|
8
|
-
*
|
|
12
|
+
* Resolve the lane (namespace prefix) for a given event name, given the set
|
|
13
|
+
* of opened namespaces. Walks segments from depth 1 outward, descending while
|
|
14
|
+
* the current prefix is opened, and stopping at the first prefix that isn't.
|
|
9
15
|
*/
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (strategy === 'all-but-last') {
|
|
22
|
-
return segments.slice(0, -1).join('.');
|
|
23
|
-
}
|
|
24
|
-
if (typeof strategy === 'number') {
|
|
25
|
-
return segments.slice(0, strategy).join('.');
|
|
26
|
-
}
|
|
27
|
-
return segments.slice(0, -1).join('.');
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Get parent namespace (one level up)
|
|
31
|
-
*/
|
|
32
|
-
function getParentNamespace(namespace) {
|
|
33
|
-
const segments = namespace.split('.');
|
|
34
|
-
if (segments.length <= 1) {
|
|
35
|
-
return undefined;
|
|
16
|
+
function resolveLane(name, opened) {
|
|
17
|
+
const segs = name.split('.');
|
|
18
|
+
let depth = 1;
|
|
19
|
+
while (depth < segs.length) {
|
|
20
|
+
const prefix = segs.slice(0, depth).join('.');
|
|
21
|
+
if (opened.has(prefix)) {
|
|
22
|
+
depth++;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
36
27
|
}
|
|
37
|
-
return
|
|
28
|
+
return segs.slice(0, depth).join('.');
|
|
38
29
|
}
|
|
39
30
|
/**
|
|
40
|
-
*
|
|
31
|
+
* useSequenceLayout
|
|
41
32
|
*
|
|
42
|
-
* @param events - Events to
|
|
43
|
-
* @param
|
|
44
|
-
* @param options - Layout options
|
|
45
|
-
* @returns Layout result with positioned nodes, edges, and swimlane info
|
|
33
|
+
* @param events - Events to lay out
|
|
34
|
+
* @param sequenceEdges - Edges connecting events
|
|
35
|
+
* @param options - Layout options (lane sizing, openedNamespaces)
|
|
46
36
|
*
|
|
47
37
|
* @example
|
|
48
38
|
* ```tsx
|
|
@@ -55,105 +45,140 @@ function getParentNamespace(namespace) {
|
|
|
55
45
|
* [
|
|
56
46
|
* { id: 'e1', fromEvent: '1', toEvent: '2' },
|
|
57
47
|
* { id: 'e2', fromEvent: '2', toEvent: '3' },
|
|
58
|
-
* ]
|
|
48
|
+
* ],
|
|
49
|
+
* { openedNamespaces: ['auth'] }, // drill `auth` to show validation/token as separate lanes
|
|
59
50
|
* );
|
|
60
51
|
* ```
|
|
61
52
|
*/
|
|
62
53
|
export function useSequenceLayout(events, sequenceEdges, options = {}) {
|
|
63
|
-
const {
|
|
54
|
+
const { openedNamespaces, laneWidth = 250, laneGap = 0, eventSpacing = 80, headerHeight = 60, nodeWidth = 14, nodeHeight = 14, } = options;
|
|
55
|
+
// Normalize openedNamespaces into a stable string for memo dependency
|
|
56
|
+
const openedKey = useMemo(() => {
|
|
57
|
+
if (!openedNamespaces)
|
|
58
|
+
return '';
|
|
59
|
+
const arr = Array.from(openedNamespaces);
|
|
60
|
+
arr.sort();
|
|
61
|
+
return arr.join('|');
|
|
62
|
+
}, [openedNamespaces]);
|
|
64
63
|
return useMemo(() => {
|
|
65
64
|
if (events.length === 0) {
|
|
66
65
|
return {
|
|
67
66
|
nodes: [],
|
|
68
67
|
edges: [],
|
|
69
68
|
swimlanes: [],
|
|
69
|
+
parentHeaders: [],
|
|
70
|
+
headerRows: 1,
|
|
70
71
|
totalWidth: 0,
|
|
71
72
|
totalHeight: 0,
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
75
|
+
const opened = new Set(openedKey ? openedKey.split('|') : []);
|
|
76
|
+
// Step 1: Resolve each event to a lane prefix
|
|
77
|
+
const eventLane = new Map();
|
|
78
|
+
const laneEvents = new Map();
|
|
77
79
|
for (const event of events) {
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
if (!
|
|
81
|
-
|
|
80
|
+
const lane = resolveLane(event.name, opened);
|
|
81
|
+
eventLane.set(event.id, lane);
|
|
82
|
+
if (!laneEvents.has(lane)) {
|
|
83
|
+
laneEvents.set(lane, []);
|
|
82
84
|
}
|
|
83
|
-
|
|
85
|
+
laneEvents.get(lane).push(event.id);
|
|
84
86
|
}
|
|
85
|
-
// Step 2:
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
//
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
for (const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
87
|
+
// Step 2: Order lanes alphabetically (parents naturally sort before children)
|
|
88
|
+
const laneNames = Array.from(laneEvents.keys()).sort();
|
|
89
|
+
// canExpand is meaningful only when opening would actually fork the lane
|
|
90
|
+
// into multiple child lanes. If every event in the lane would drill into
|
|
91
|
+
// the same child, drilling is a relabel — hide the chevron.
|
|
92
|
+
const eventsById = new Map();
|
|
93
|
+
for (const event of events)
|
|
94
|
+
eventsById.set(event.id, event);
|
|
95
|
+
const canExpandLane = (laneNs, eventIds) => {
|
|
96
|
+
const augmented = new Set(opened);
|
|
97
|
+
augmented.add(laneNs);
|
|
98
|
+
const seen = new Set();
|
|
99
|
+
for (const eid of eventIds) {
|
|
100
|
+
const event = eventsById.get(eid);
|
|
101
|
+
if (!event)
|
|
102
|
+
continue;
|
|
103
|
+
seen.add(resolveLane(event.name, augmented));
|
|
104
|
+
if (seen.size > 1)
|
|
105
|
+
return true;
|
|
104
106
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
return false;
|
|
108
|
+
};
|
|
109
|
+
// Step 3: Build Swimlane records
|
|
110
|
+
const swimlanes = laneNames.map((namespace, index) => {
|
|
108
111
|
const x = index * (laneWidth + laneGap) + laneWidth / 2;
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
if (namespaceToVisible.get(eventNs) === namespace) {
|
|
113
|
-
eventIds.push(eventId);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
// Find children (namespaces that have this as parent)
|
|
117
|
-
const children = allNamespaces.filter((ns) => getParentNamespace(ns) === namespace);
|
|
112
|
+
const segs = namespace.split('.');
|
|
113
|
+
const parentNamespace = segs.length > 1 ? segs.slice(0, -1).join('.') : undefined;
|
|
114
|
+
const eventIds = laneEvents.get(namespace);
|
|
118
115
|
return {
|
|
119
116
|
namespace,
|
|
120
|
-
label:
|
|
117
|
+
label: segs[segs.length - 1] || namespace,
|
|
121
118
|
x,
|
|
122
|
-
parentNamespace
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
parentNamespace,
|
|
120
|
+
isOpened: opened.has(namespace),
|
|
121
|
+
isParentOpened: parentNamespace ? opened.has(parentNamespace) : false,
|
|
122
|
+
canExpand: canExpandLane(namespace, eventIds),
|
|
125
123
|
eventIds,
|
|
126
124
|
};
|
|
127
125
|
});
|
|
128
|
-
|
|
129
|
-
const
|
|
126
|
+
const laneByNamespace = new Map();
|
|
127
|
+
for (const lane of swimlanes) {
|
|
128
|
+
laneByNamespace.set(lane.namespace, lane);
|
|
129
|
+
}
|
|
130
|
+
// Step 3b: Build parent header cells for opened ancestors. For every leaf
|
|
131
|
+
// lane at depth > 1, walk depths 1..d-1 and aggregate the leaf x-extent
|
|
132
|
+
// under each ancestor.
|
|
133
|
+
const ancestorBounds = new Map();
|
|
130
134
|
for (const lane of swimlanes) {
|
|
131
|
-
|
|
135
|
+
const segs = lane.namespace.split('.');
|
|
136
|
+
const left = lane.x - laneWidth / 2;
|
|
137
|
+
const right = lane.x + laneWidth / 2;
|
|
138
|
+
for (let d = 1; d < segs.length; d++) {
|
|
139
|
+
const ancestorNs = segs.slice(0, d).join('.');
|
|
140
|
+
const existing = ancestorBounds.get(ancestorNs);
|
|
141
|
+
if (existing) {
|
|
142
|
+
existing.xMin = Math.min(existing.xMin, left);
|
|
143
|
+
existing.xMax = Math.max(existing.xMax, right);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
ancestorBounds.set(ancestorNs, { xMin: left, xMax: right, depth: d });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
132
149
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
150
|
+
const parentHeaders = Array.from(ancestorBounds.entries())
|
|
151
|
+
.map(([namespace, { xMin, xMax, depth }]) => {
|
|
152
|
+
const segs = namespace.split('.');
|
|
153
|
+
return {
|
|
154
|
+
namespace,
|
|
155
|
+
label: segs[segs.length - 1] || namespace,
|
|
156
|
+
x: (xMin + xMax) / 2,
|
|
157
|
+
width: xMax - xMin,
|
|
158
|
+
depth,
|
|
159
|
+
};
|
|
160
|
+
})
|
|
161
|
+
.sort((a, b) => a.depth - b.depth || a.x - b.x);
|
|
162
|
+
const headerRows = swimlanes.reduce((max, lane) => Math.max(max, lane.namespace.split('.').length), 1);
|
|
163
|
+
const totalHeaderHeight = headerHeight * headerRows;
|
|
164
|
+
// Step 4: Position events on global time layers, below the full header strip
|
|
136
165
|
const nodes = [];
|
|
137
166
|
for (let i = 0; i < events.length; i++) {
|
|
138
167
|
const event = events[i];
|
|
139
|
-
const
|
|
140
|
-
const
|
|
141
|
-
const
|
|
142
|
-
// Global Y position based on event order (time layer)
|
|
143
|
-
// Start first event closer to header with small offset
|
|
144
|
-
const y = headerHeight + 40 + i * eventSpacing;
|
|
168
|
+
const laneNs = eventLane.get(event.id);
|
|
169
|
+
const lane = laneByNamespace.get(laneNs);
|
|
170
|
+
const y = totalHeaderHeight + 40 + i * eventSpacing;
|
|
145
171
|
nodes.push({
|
|
146
172
|
id: event.id,
|
|
147
173
|
type: 'sequenceMarker',
|
|
148
174
|
position: {
|
|
149
175
|
x: lane.x - nodeWidth / 2,
|
|
150
|
-
y: y - nodeHeight / 2,
|
|
176
|
+
y: y - nodeHeight / 2,
|
|
151
177
|
},
|
|
152
178
|
data: {
|
|
153
179
|
label: event.label || event.name.split('.').pop() || event.name,
|
|
154
180
|
fullName: event.name,
|
|
155
|
-
namespace:
|
|
156
|
-
visibleNamespace,
|
|
181
|
+
namespace: laneNs,
|
|
157
182
|
timeLayer: i,
|
|
158
183
|
isMoveEvent: event.moveEvent === true,
|
|
159
184
|
sourcePath: event.sourcePath,
|
|
@@ -165,24 +190,21 @@ export function useSequenceLayout(events, sequenceEdges, options = {}) {
|
|
|
165
190
|
},
|
|
166
191
|
});
|
|
167
192
|
}
|
|
168
|
-
// Step 5:
|
|
169
|
-
// Each edge looks forward to determine what to render
|
|
193
|
+
// Step 5: Edges — one per event, looking ahead to the next
|
|
170
194
|
const edges = [];
|
|
171
195
|
for (let i = 0; i < events.length; i++) {
|
|
172
196
|
const currentEvent = events[i];
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
const currentLane = swimlaneByNamespace.get(currentVisibleNs);
|
|
176
|
-
// Look at the next event (if any)
|
|
197
|
+
const currentLaneNs = eventLane.get(currentEvent.id);
|
|
198
|
+
const currentLane = laneByNamespace.get(currentLaneNs);
|
|
177
199
|
if (i < events.length - 1) {
|
|
178
200
|
const nextEvent = events[i + 1];
|
|
179
|
-
const
|
|
180
|
-
const
|
|
181
|
-
const nextLane = swimlaneByNamespace.get(nextVisibleNs);
|
|
201
|
+
const nextLaneNs = eventLane.get(nextEvent.id);
|
|
202
|
+
const nextLane = laneByNamespace.get(nextLaneNs);
|
|
182
203
|
const nextIsMoveEvent = nextEvent.moveEvent === true;
|
|
183
|
-
const crossesLanes =
|
|
184
|
-
|
|
185
|
-
|
|
204
|
+
const crossesLanes = currentLaneNs !== nextLaneNs;
|
|
205
|
+
const edgeLabel = currentEvent.label ||
|
|
206
|
+
currentEvent.name.split('.').pop() ||
|
|
207
|
+
currentEvent.name;
|
|
186
208
|
edges.push({
|
|
187
209
|
id: `edge-${currentEvent.id}-to-${nextEvent.id}`,
|
|
188
210
|
source: currentEvent.id,
|
|
@@ -193,8 +215,8 @@ export function useSequenceLayout(events, sequenceEdges, options = {}) {
|
|
|
193
215
|
labelBgStyle: { fill: 'white', fillOpacity: 0.8 },
|
|
194
216
|
data: {
|
|
195
217
|
crossesLanes,
|
|
196
|
-
sourceNamespace:
|
|
197
|
-
targetNamespace:
|
|
218
|
+
sourceNamespace: currentLaneNs,
|
|
219
|
+
targetNamespace: nextLaneNs,
|
|
198
220
|
isMoveEvent: nextIsMoveEvent,
|
|
199
221
|
sourceEvent: currentEvent,
|
|
200
222
|
targetEvent: nextEvent,
|
|
@@ -204,9 +226,10 @@ export function useSequenceLayout(events, sequenceEdges, options = {}) {
|
|
|
204
226
|
});
|
|
205
227
|
}
|
|
206
228
|
else {
|
|
207
|
-
// Last event - render small activation bar to show it exists
|
|
208
229
|
const currentIsMoveEvent = currentEvent.moveEvent === true;
|
|
209
|
-
const edgeLabel = currentEvent.label ||
|
|
230
|
+
const edgeLabel = currentEvent.label ||
|
|
231
|
+
currentEvent.name.split('.').pop() ||
|
|
232
|
+
currentEvent.name;
|
|
210
233
|
edges.push({
|
|
211
234
|
id: `edge-${currentEvent.id}-end`,
|
|
212
235
|
source: currentEvent.id,
|
|
@@ -217,8 +240,8 @@ export function useSequenceLayout(events, sequenceEdges, options = {}) {
|
|
|
217
240
|
labelBgStyle: { fill: 'white', fillOpacity: 0.8 },
|
|
218
241
|
data: {
|
|
219
242
|
crossesLanes: false,
|
|
220
|
-
sourceNamespace:
|
|
221
|
-
targetNamespace:
|
|
243
|
+
sourceNamespace: currentLaneNs,
|
|
244
|
+
targetNamespace: currentLaneNs,
|
|
222
245
|
isMoveEvent: currentIsMoveEvent,
|
|
223
246
|
sourceEvent: currentEvent,
|
|
224
247
|
targetEvent: currentEvent,
|
|
@@ -232,13 +255,11 @@ export function useSequenceLayout(events, sequenceEdges, options = {}) {
|
|
|
232
255
|
}
|
|
233
256
|
// Step 6: Compute total dimensions
|
|
234
257
|
const totalWidth = swimlanes.length * laneWidth + (swimlanes.length - 1) * laneGap;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
// Step 7: Add invisible boundary nodes to ensure fitView includes full diagram width
|
|
258
|
+
const totalHeight = totalHeaderHeight + 40 + events.length * eventSpacing;
|
|
259
|
+
// Step 7: Boundary nodes so React Flow's fitView covers full width
|
|
238
260
|
if (swimlanes.length > 0) {
|
|
239
261
|
const leftmostLane = swimlanes[0];
|
|
240
262
|
const rightmostLane = swimlanes[swimlanes.length - 1];
|
|
241
|
-
// Add boundary nodes at the corners
|
|
242
263
|
nodes.push({
|
|
243
264
|
id: '__boundary_left__',
|
|
244
265
|
type: 'default',
|
|
@@ -261,20 +282,21 @@ export function useSequenceLayout(events, sequenceEdges, options = {}) {
|
|
|
261
282
|
nodes,
|
|
262
283
|
edges,
|
|
263
284
|
swimlanes,
|
|
285
|
+
parentHeaders,
|
|
286
|
+
headerRows,
|
|
264
287
|
totalWidth,
|
|
265
288
|
totalHeight,
|
|
266
289
|
};
|
|
267
290
|
}, [
|
|
268
291
|
events,
|
|
269
292
|
sequenceEdges,
|
|
270
|
-
|
|
293
|
+
openedKey,
|
|
271
294
|
laneWidth,
|
|
272
295
|
laneGap,
|
|
273
296
|
eventSpacing,
|
|
274
297
|
headerHeight,
|
|
275
298
|
nodeWidth,
|
|
276
299
|
nodeHeight,
|
|
277
|
-
collapsedNamespaces,
|
|
278
300
|
]);
|
|
279
301
|
}
|
|
280
302
|
//# sourceMappingURL=useSequenceLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSequenceLayout.js","sourceRoot":"","sources":["../../src/hooks/useSequenceLayout.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useSequenceLayout.js","sourceRoot":"","sources":["../../src/hooks/useSequenceLayout.ts"],"names":[],"mappings":"AAAA;;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
|
@@ -13,7 +13,7 @@ export type { SequenceDiagramRendererProps } from './components/SequenceDiagramR
|
|
|
13
13
|
export { WorkflowSequenceDiagram } from './components/WorkflowSequenceDiagram';
|
|
14
14
|
export type { WorkflowSequenceDiagramProps } from './components/WorkflowSequenceDiagram';
|
|
15
15
|
export { useSequenceLayout } from './hooks/useSequenceLayout';
|
|
16
|
-
export type { SequenceEvent, SequenceEdge, Swimlane,
|
|
16
|
+
export type { SequenceEvent, SequenceEdge, Swimlane, UseSequenceLayoutOptions, UseSequenceLayoutResult, } from './hooks/useSequenceLayout';
|
|
17
17
|
export { MultiCanvasRenderer, mergeCanvases, parseNodeId } from './components/MultiCanvasRenderer';
|
|
18
18
|
export type { MultiCanvasRendererProps, MultiCanvasLayout, CanvasPlacement, } from './components/MultiCanvasRenderer';
|
|
19
19
|
export { ConfigurationSelector } from './components/ConfigurationSelector';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,SAAS,EACT,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,uBAAuB,EAEvB,gBAAgB,GACjB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,GACf,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,YAAY,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAEzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,YAAY,EA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CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAsBH,oBAAoB;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAQ3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAsBH,oBAAoB;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAQ3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAS9D,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAOnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,6BAA6B;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,8BAA8B;AAC9B,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,2BAA2B;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,mBAAmB;AACnB,OAAO,EACL,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