@principal-ai/subsystems-react 0.17.0 → 0.18.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.
Files changed (98) hide show
  1. package/dist/index.d.ts +7 -44
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +6 -32
  4. package/dist/index.js.map +1 -1
  5. package/package.json +2 -2
  6. package/src/index.ts +9 -199
  7. package/src/components/ConfigurationSelector.tsx +0 -133
  8. package/src/components/GraphRenderer.tsx +0 -3195
  9. package/src/components/MultiCanvasRenderer.tsx +0 -295
  10. package/src/components/NodeTooltip.tsx +0 -279
  11. package/src/components/PendingChanges.test.tsx +0 -375
  12. package/src/components/SelectionSidebar.tsx +0 -352
  13. package/src/components/SequenceDiagramRenderer.tsx +0 -1156
  14. package/src/components/WorkflowSequenceDiagram.tsx +0 -270
  15. package/src/components/dashboard/DashboardRenderer.tsx +0 -317
  16. package/src/components/dashboard/MetricPanel.tsx +0 -254
  17. package/src/components/dashboard/MockDataProvider.ts +0 -330
  18. package/src/components/dashboard/components/BarChart.tsx +0 -299
  19. package/src/components/dashboard/components/LineChart.tsx +0 -279
  20. package/src/components/dashboard/components/MetricCard.tsx +0 -270
  21. package/src/components/dashboard/components/SourceLink.tsx +0 -63
  22. package/src/components/dashboard/components/TimeRangeSelector.tsx +0 -280
  23. package/src/components/dashboard/components/index.ts +0 -5
  24. package/src/components/dashboard/index.ts +0 -47
  25. package/src/components/dashboard/types.ts +0 -126
  26. package/src/components/state-view/PipelineView.tsx +0 -347
  27. package/src/components/state-view/index.ts +0 -14
  28. package/src/components/state-view/types.ts +0 -261
  29. package/src/components/state-view/useStateView.ts +0 -205
  30. package/src/contexts/GraphEditContext.tsx +0 -27
  31. package/src/contexts/TooltipPortalContext.ts +0 -8
  32. package/src/edges/CustomEdge.tsx +0 -402
  33. package/src/edges/GenericEdge.tsx +0 -36
  34. package/src/hooks/usePathBasedEvents.ts +0 -192
  35. package/src/hooks/useSequenceLayout.ts +0 -543
  36. package/src/hooks/useUndoRedo.ts +0 -144
  37. package/src/nodes/CustomNode.tsx +0 -1231
  38. package/src/nodes/GenericNode.tsx +0 -55
  39. package/src/nodes/otel/OtelBoundaryNode.tsx +0 -224
  40. package/src/nodes/otel/OtelEventNode.tsx +0 -225
  41. package/src/nodes/otel/OtelResourceNode.tsx +0 -251
  42. package/src/nodes/otel/OtelScopeNode.tsx +0 -221
  43. package/src/nodes/otel/OtelSpanConventionNode.tsx +0 -295
  44. package/src/nodes/otel/index.ts +0 -23
  45. package/src/nodes/otel/shared/NodeBadges.tsx +0 -295
  46. package/src/nodes/otel/shared/NodeContent.tsx +0 -204
  47. package/src/nodes/otel/shared/index.ts +0 -8
  48. package/src/nodes/otel/shared/types.ts +0 -138
  49. package/src/nodes/otel/shared/useNodeBehavior.ts +0 -114
  50. package/src/stories/Audit/BoundaryNodes.stories.tsx +0 -385
  51. package/src/stories/Audit/CanvasEdgeTypes.stories.tsx +0 -1448
  52. package/src/stories/Audit/CanvasNodeTypes.stories.tsx +0 -1049
  53. package/src/stories/Audit/ColorPriority.stories.tsx +0 -895
  54. package/src/stories/Audit/DiamondBadges.stories.tsx +0 -629
  55. package/src/stories/Audit/NodeDimensionsTesting.stories.tsx +0 -724
  56. package/src/stories/Audit/NodeFieldsAudit.stories.tsx +0 -996
  57. package/src/stories/Audit/NodeFontSizeTesting.stories.tsx +0 -715
  58. package/src/stories/Audit/NodeShapes.stories.tsx +0 -1208
  59. package/src/stories/Audit/WideNodesTesting.stories.tsx +0 -1045
  60. package/src/stories/Components/DashboardRenderer.stories.tsx +0 -263
  61. package/src/stories/Components/GraphRenderer.stories.tsx +0 -3236
  62. package/src/stories/Components/MultiCanvasRenderer.stories.tsx +0 -370
  63. package/src/stories/Components/SequenceDiagram.stories.tsx +0 -255
  64. package/src/stories/Components/StateView.stories.tsx +0 -417
  65. package/src/stories/Components/TraceViewer.stories.tsx +0 -442
  66. package/src/stories/Components/WorkflowSequenceDiagram.stories.tsx +0 -802
  67. package/src/stories/Features/AnimationWorkshop.stories.tsx +0 -727
  68. package/src/stories/Features/ChangeTypeVisual.stories.tsx +0 -67
  69. package/src/stories/Features/EventDrivenAnimations.stories.tsx +0 -513
  70. package/src/stories/Features/MultiConfig.stories.tsx +0 -539
  71. package/src/stories/Layout/ElkEdgeRouting.stories.tsx +0 -539
  72. package/src/stories/Layout/GraphOrientation.stories.tsx +0 -500
  73. package/src/stories/Layout/MultiDirectionalConnections.stories.tsx +0 -352
  74. package/src/stories/Nodes/NodeDefinitionComparison.stories.tsx +0 -560
  75. package/src/stories/Nodes/NodeNameFallbacks.stories.tsx +0 -491
  76. package/src/stories/Nodes/NumericColors.stories.tsx +0 -440
  77. package/src/stories/OTEL/EventNameDisplay.stories.tsx +0 -694
  78. package/src/stories/OTEL/EventNameFallback.stories.tsx +0 -578
  79. package/src/stories/OTEL/OtelComponents.stories.tsx +0 -422
  80. package/src/stories/OTEL/OtelNodeTypesPrototype.stories.tsx +0 -806
  81. package/src/stories/OTEL/RawEventCards.stories.tsx +0 -57
  82. package/src/stories/OTEL/SpanBadges.stories.tsx +0 -840
  83. package/src/stories/OTEL/ValidationEventsCanvas.stories.tsx +0 -209
  84. package/src/stories/RealWorld/BacklogMdCanvases.stories.tsx +0 -721
  85. package/src/stories/RealWorld/FileCitySequence.stories.tsx +0 -516
  86. package/src/stories/RealWorld/RealCanvasFiles.stories.tsx +0 -336
  87. package/src/stories/__traces__/test-run.canvas.json +0 -241
  88. package/src/stories/data/activity-feed-analytics.dashboard.json +0 -300
  89. package/src/stories/data/file-city-images-transformed.otel.canvas.json +0 -295
  90. package/src/stories/data/file-city-workflows.json +0 -269
  91. package/src/stories/data/graph-converter-test-execution.json +0 -443
  92. package/src/stories/data/graph-converter-test.workflow.json +0 -105
  93. package/src/stories/data/graph-converter-validated-execution.json +0 -58
  94. package/src/utils/animationMapping.ts +0 -166
  95. package/src/utils/canvasBounds.ts +0 -146
  96. package/src/utils/graphConverter.ts +0 -148
  97. package/src/utils/iconResolver.tsx +0 -53
  98. package/src/utils/orientationUtils.ts +0 -73
@@ -1,539 +0,0 @@
1
- import React from 'react';
2
- import type { Meta, StoryObj } from '@storybook/react';
3
- import { GraphRenderer } from '../../components/GraphRenderer';
4
- import type { ExtendedCanvas } from '@principal-ai/subsystems-core';
5
- import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
6
-
7
- const meta = {
8
- title: 'Layout/ElkEdgeRouting',
9
- component: GraphRenderer,
10
- parameters: {
11
- layout: 'centered',
12
- },
13
- tags: ['autodocs'],
14
- decorators: [
15
- (Story) => (
16
- <ThemeProvider theme={defaultEditorTheme}>
17
- <Story />
18
- </ThemeProvider>
19
- ),
20
- ],
21
- } satisfies Meta<typeof GraphRenderer>;
22
-
23
- export default meta;
24
- type Story = StoryObj<typeof meta>;
25
-
26
- const createNode = (
27
- id: string,
28
- x: number,
29
- y: number,
30
- label: string,
31
- color: 1 | 2 | 3 | 4 | 5 | 6 = 4
32
- ) => ({
33
- id,
34
- type: 'text' as const,
35
- x,
36
- y,
37
- width: 120,
38
- height: 60,
39
- text: label,
40
- color,
41
- pv: {
42
- nodeType: 'component',
43
- shape: 'rectangle' as const,
44
- },
45
- });
46
-
47
- // =============================================================================
48
- // Level 1: Two nodes, one edge
49
- // =============================================================================
50
- const twoNodeCanvas: ExtendedCanvas = {
51
- nodes: [
52
- createNode('a', 0, 0, 'Node A', 5),
53
- createNode('b', 250, 0, 'Node B', 4),
54
- ],
55
- edges: [
56
- { id: 'e1', fromNode: 'a', toNode: 'b', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
57
- ],
58
- pv: {
59
- version: '1.0.0',
60
- name: 'Two Nodes',
61
- edgeTypes: {
62
- flow: { style: 'solid', color: '#3b82f6', width: 2, directed: true },
63
- },
64
- },
65
- };
66
-
67
- export const Level1_TwoNodes: Story = {
68
- args: {
69
- canvas: twoNodeCanvas,
70
- width: 500,
71
- height: 200,
72
- showBackground: true,
73
- backgroundVariant: 'dots',
74
- },
75
- };
76
-
77
- export const Level1_TwoNodes_ELK: Story = {
78
- args: {
79
- canvas: twoNodeCanvas,
80
- width: 500,
81
- height: 200,
82
- showBackground: true,
83
- backgroundVariant: 'dots',
84
- elkLayout: { enabled: true, routingStyle: 'orthogonal' },
85
- },
86
- };
87
-
88
- // =============================================================================
89
- // Level 1b: Two nodes with vertical offset
90
- // =============================================================================
91
- const twoNodeVerticalOffsetCanvas: ExtendedCanvas = {
92
- nodes: [
93
- createNode('a', 0, 0, 'Node A', 5),
94
- createNode('b', 250, 100, 'Node B', 4),
95
- ],
96
- edges: [
97
- { id: 'e1', fromNode: 'a', toNode: 'b', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
98
- ],
99
- pv: {
100
- version: '1.0.0',
101
- name: 'Two Nodes Vertical Offset',
102
- edgeTypes: {
103
- flow: { style: 'solid', color: '#3b82f6', width: 2, directed: true },
104
- },
105
- },
106
- };
107
-
108
- export const Level1b_TwoNodesVerticalOffset: Story = {
109
- args: {
110
- canvas: twoNodeVerticalOffsetCanvas,
111
- width: 500,
112
- height: 250,
113
- showBackground: true,
114
- backgroundVariant: 'dots',
115
- },
116
- };
117
-
118
- export const Level1b_TwoNodesVerticalOffset_ELK: Story = {
119
- args: {
120
- canvas: twoNodeVerticalOffsetCanvas,
121
- width: 500,
122
- height: 250,
123
- showBackground: true,
124
- backgroundVariant: 'dots',
125
- elkLayout: { enabled: true, routingStyle: 'orthogonal' },
126
- },
127
- };
128
-
129
- // =============================================================================
130
- // Level 1c: Two nodes stacked vertically (target below source)
131
- // =============================================================================
132
- const twoNodeStackedCanvas: ExtendedCanvas = {
133
- nodes: [
134
- createNode('a', 50, 0, 'Node A', 5),
135
- createNode('b', 50, 120, 'Node B', 4),
136
- ],
137
- edges: [
138
- { id: 'e1', fromNode: 'a', toNode: 'b', fromSide: 'bottom', toSide: 'top', pv: { edgeType: 'flow' } },
139
- ],
140
- pv: {
141
- version: '1.0.0',
142
- name: 'Two Nodes Stacked',
143
- edgeTypes: {
144
- flow: { style: 'solid', color: '#3b82f6', width: 2, directed: true },
145
- },
146
- },
147
- };
148
-
149
- export const Level1c_TwoNodesStacked: Story = {
150
- args: {
151
- canvas: twoNodeStackedCanvas,
152
- width: 300,
153
- height: 300,
154
- showBackground: true,
155
- backgroundVariant: 'dots',
156
- },
157
- };
158
-
159
- export const Level1c_TwoNodesStacked_ELK: Story = {
160
- args: {
161
- canvas: twoNodeStackedCanvas,
162
- width: 300,
163
- height: 300,
164
- showBackground: true,
165
- backgroundVariant: 'dots',
166
- elkLayout: { enabled: true, routingStyle: 'orthogonal' },
167
- },
168
- };
169
-
170
- // =============================================================================
171
- // Level 1d: Vertical routing with horizontal offset (bottom to top connection)
172
- // Tests vertical-first routing: down → right → up
173
- // =============================================================================
174
- const verticalRoutingCanvas: ExtendedCanvas = {
175
- nodes: [
176
- createNode('a', 0, 0, 'Node A', 5),
177
- createNode('b', 200, 150, 'Node B', 4),
178
- ],
179
- edges: [
180
- { id: 'e1', fromNode: 'a', toNode: 'b', fromSide: 'bottom', toSide: 'top', pv: { edgeType: 'flow' } },
181
- ],
182
- pv: {
183
- version: '1.0.0',
184
- name: 'Vertical Routing',
185
- edgeTypes: {
186
- flow: { style: 'solid', color: '#3b82f6', width: 2, directed: true },
187
- },
188
- },
189
- };
190
-
191
- export const Level1d_VerticalRouting: Story = {
192
- args: {
193
- canvas: verticalRoutingCanvas,
194
- width: 450,
195
- height: 350,
196
- showBackground: true,
197
- backgroundVariant: 'dots',
198
- },
199
- };
200
-
201
- export const Level1d_VerticalRouting_ELK: Story = {
202
- args: {
203
- canvas: verticalRoutingCanvas,
204
- width: 450,
205
- height: 350,
206
- showBackground: true,
207
- backgroundVariant: 'dots',
208
- elkLayout: { enabled: true, routingStyle: 'orthogonal' },
209
- },
210
- };
211
-
212
- // =============================================================================
213
- // Level 2: Three nodes in a line
214
- // =============================================================================
215
- const threeNodeCanvas: ExtendedCanvas = {
216
- nodes: [
217
- createNode('a', 0, 0, 'Node A', 5),
218
- createNode('b', 200, 0, 'Node B', 2),
219
- createNode('c', 400, 0, 'Node C', 4),
220
- ],
221
- edges: [
222
- { id: 'e1', fromNode: 'a', toNode: 'b', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
223
- { id: 'e2', fromNode: 'b', toNode: 'c', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
224
- ],
225
- pv: {
226
- version: '1.0.0',
227
- name: 'Three Nodes Linear',
228
- edgeTypes: {
229
- flow: { style: 'solid', color: '#3b82f6', width: 2, directed: true },
230
- },
231
- },
232
- };
233
-
234
- export const Level2_ThreeNodesLinear: Story = {
235
- args: {
236
- canvas: threeNodeCanvas,
237
- width: 600,
238
- height: 200,
239
- showBackground: true,
240
- backgroundVariant: 'dots',
241
- },
242
- };
243
-
244
- export const Level2_ThreeNodesLinear_ELK: Story = {
245
- args: {
246
- canvas: threeNodeCanvas,
247
- width: 600,
248
- height: 200,
249
- showBackground: true,
250
- backgroundVariant: 'dots',
251
- elkLayout: { enabled: true, routingStyle: 'orthogonal' },
252
- },
253
- };
254
-
255
- // =============================================================================
256
- // Level 3: One source, two targets (fan out)
257
- // =============================================================================
258
- const fanOutCanvas: ExtendedCanvas = {
259
- nodes: [
260
- createNode('a', 0, 50, 'Source', 5),
261
- createNode('b', 250, 0, 'Target 1', 4),
262
- createNode('c', 250, 100, 'Target 2', 4),
263
- ],
264
- edges: [
265
- { id: 'e1', fromNode: 'a', toNode: 'b', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
266
- { id: 'e2', fromNode: 'a', toNode: 'c', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
267
- ],
268
- pv: {
269
- version: '1.0.0',
270
- name: 'Fan Out',
271
- edgeTypes: {
272
- flow: { style: 'solid', color: '#3b82f6', width: 2, directed: true },
273
- },
274
- },
275
- };
276
-
277
- export const Level3_FanOut: Story = {
278
- args: {
279
- canvas: fanOutCanvas,
280
- width: 500,
281
- height: 250,
282
- showBackground: true,
283
- backgroundVariant: 'dots',
284
- },
285
- };
286
-
287
- export const Level3_FanOut_ELK: Story = {
288
- args: {
289
- canvas: fanOutCanvas,
290
- width: 500,
291
- height: 250,
292
- showBackground: true,
293
- backgroundVariant: 'dots',
294
- elkLayout: { enabled: true, routingStyle: 'orthogonal' },
295
- },
296
- };
297
-
298
- // =============================================================================
299
- // Level 4: Two sources, one target (fan in)
300
- // =============================================================================
301
- const fanInCanvas: ExtendedCanvas = {
302
- nodes: [
303
- createNode('a', 0, 0, 'Source 1', 5),
304
- createNode('b', 0, 100, 'Source 2', 5),
305
- createNode('c', 250, 50, 'Target', 4),
306
- ],
307
- edges: [
308
- { id: 'e1', fromNode: 'a', toNode: 'c', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
309
- { id: 'e2', fromNode: 'b', toNode: 'c', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
310
- ],
311
- pv: {
312
- version: '1.0.0',
313
- name: 'Fan In',
314
- edgeTypes: {
315
- flow: { style: 'solid', color: '#3b82f6', width: 2, directed: true },
316
- },
317
- },
318
- };
319
-
320
- export const Level4_FanIn: Story = {
321
- args: {
322
- canvas: fanInCanvas,
323
- width: 500,
324
- height: 250,
325
- showBackground: true,
326
- backgroundVariant: 'dots',
327
- },
328
- };
329
-
330
- export const Level4_FanIn_ELK: Story = {
331
- args: {
332
- canvas: fanInCanvas,
333
- width: 500,
334
- height: 250,
335
- showBackground: true,
336
- backgroundVariant: 'dots',
337
- elkLayout: { enabled: true, routingStyle: 'orthogonal' },
338
- },
339
- };
340
-
341
- // =============================================================================
342
- // Level 5: Diamond (fan out then fan in)
343
- // =============================================================================
344
- const diamondCanvas: ExtendedCanvas = {
345
- nodes: [
346
- createNode('a', 0, 50, 'Start', 5),
347
- createNode('b', 200, 0, 'Path 1', 2),
348
- createNode('c', 200, 100, 'Path 2', 2),
349
- createNode('d', 400, 50, 'End', 4),
350
- ],
351
- edges: [
352
- { id: 'e1', fromNode: 'a', toNode: 'b', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
353
- { id: 'e2', fromNode: 'a', toNode: 'c', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
354
- { id: 'e3', fromNode: 'b', toNode: 'd', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
355
- { id: 'e4', fromNode: 'c', toNode: 'd', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
356
- ],
357
- pv: {
358
- version: '1.0.0',
359
- name: 'Diamond',
360
- edgeTypes: {
361
- flow: { style: 'solid', color: '#3b82f6', width: 2, directed: true },
362
- },
363
- },
364
- };
365
-
366
- export const Level5_Diamond: Story = {
367
- args: {
368
- canvas: diamondCanvas,
369
- width: 600,
370
- height: 250,
371
- showBackground: true,
372
- backgroundVariant: 'dots',
373
- },
374
- };
375
-
376
- export const Level5_Diamond_ELK: Story = {
377
- args: {
378
- canvas: diamondCanvas,
379
- width: 600,
380
- height: 250,
381
- showBackground: true,
382
- backgroundVariant: 'dots',
383
- elkLayout: { enabled: true, routingStyle: 'orthogonal' },
384
- },
385
- };
386
-
387
- // =============================================================================
388
- // Level 6: Cross connection (edges that would overlap)
389
- // =============================================================================
390
- const crossCanvas: ExtendedCanvas = {
391
- nodes: [
392
- createNode('a1', 0, 0, 'A1', 5),
393
- createNode('a2', 0, 100, 'A2', 5),
394
- createNode('b1', 300, 0, 'B1', 4),
395
- createNode('b2', 300, 100, 'B2', 4),
396
- ],
397
- edges: [
398
- // Crossing edges
399
- { id: 'e1', fromNode: 'a1', toNode: 'b2', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
400
- { id: 'e2', fromNode: 'a2', toNode: 'b1', fromSide: 'right', toSide: 'left', pv: { edgeType: 'signal' } },
401
- ],
402
- pv: {
403
- version: '1.0.0',
404
- name: 'Cross Connection',
405
- edgeTypes: {
406
- flow: { style: 'solid', color: '#3b82f6', width: 2, directed: true },
407
- signal: { style: 'dashed', color: '#ef4444', width: 2, directed: true },
408
- },
409
- },
410
- };
411
-
412
- export const Level6_CrossConnection: Story = {
413
- args: {
414
- canvas: crossCanvas,
415
- width: 500,
416
- height: 250,
417
- showBackground: true,
418
- backgroundVariant: 'dots',
419
- },
420
- };
421
-
422
- export const Level6_CrossConnection_ELK: Story = {
423
- args: {
424
- canvas: crossCanvas,
425
- width: 500,
426
- height: 250,
427
- showBackground: true,
428
- backgroundVariant: 'dots',
429
- elkLayout: { enabled: true, routingStyle: 'orthogonal' },
430
- },
431
- };
432
-
433
- // =============================================================================
434
- // Level 7: Multiple parallel edges (same source/target sides)
435
- // =============================================================================
436
- const parallelCanvas: ExtendedCanvas = {
437
- nodes: [
438
- createNode('a', 0, 0, 'Source', 5),
439
- createNode('b', 300, 0, 'Target', 4),
440
- ],
441
- edges: [
442
- { id: 'e1', fromNode: 'a', toNode: 'b', fromSide: 'right', toSide: 'left', pv: { edgeType: 'data' } },
443
- { id: 'e2', fromNode: 'a', toNode: 'b', fromSide: 'right', toSide: 'left', pv: { edgeType: 'control' } },
444
- { id: 'e3', fromNode: 'a', toNode: 'b', fromSide: 'right', toSide: 'left', pv: { edgeType: 'signal' } },
445
- ],
446
- pv: {
447
- version: '1.0.0',
448
- name: 'Parallel Edges',
449
- edgeTypes: {
450
- data: { style: 'solid', color: '#3b82f6', width: 2, directed: true },
451
- control: { style: 'solid', color: '#22c55e', width: 2, directed: true },
452
- signal: { style: 'dashed', color: '#ef4444', width: 2, directed: true },
453
- },
454
- },
455
- };
456
-
457
- export const Level7_ParallelEdges: Story = {
458
- args: {
459
- canvas: parallelCanvas,
460
- width: 500,
461
- height: 200,
462
- showBackground: true,
463
- backgroundVariant: 'dots',
464
- },
465
- };
466
-
467
- export const Level7_ParallelEdges_ELK: Story = {
468
- args: {
469
- canvas: parallelCanvas,
470
- width: 500,
471
- height: 200,
472
- showBackground: true,
473
- backgroundVariant: 'dots',
474
- elkLayout: { enabled: true, routingStyle: 'orthogonal' },
475
- },
476
- };
477
-
478
- // =============================================================================
479
- // Level 8: Complex - 3x3 grid with various connections
480
- // =============================================================================
481
- const complexCanvas: ExtendedCanvas = {
482
- nodes: [
483
- // Left column
484
- createNode('l1', 0, 0, 'L1', 5),
485
- createNode('l2', 0, 100, 'L2', 5),
486
- createNode('l3', 0, 200, 'L3', 5),
487
- // Middle column
488
- createNode('m1', 200, 50, 'M1', 2),
489
- createNode('m2', 200, 150, 'M2', 2),
490
- // Right column
491
- createNode('r1', 400, 0, 'R1', 4),
492
- createNode('r2', 400, 100, 'R2', 4),
493
- createNode('r3', 400, 200, 'R3', 4),
494
- ],
495
- edges: [
496
- // Left to middle
497
- { id: 'e1', fromNode: 'l1', toNode: 'm1', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
498
- { id: 'e2', fromNode: 'l2', toNode: 'm1', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
499
- { id: 'e3', fromNode: 'l2', toNode: 'm2', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
500
- { id: 'e4', fromNode: 'l3', toNode: 'm2', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
501
- // Middle to right
502
- { id: 'e5', fromNode: 'm1', toNode: 'r1', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
503
- { id: 'e6', fromNode: 'm1', toNode: 'r2', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
504
- { id: 'e7', fromNode: 'm2', toNode: 'r2', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
505
- { id: 'e8', fromNode: 'm2', toNode: 'r3', fromSide: 'right', toSide: 'left', pv: { edgeType: 'flow' } },
506
- // Cross connections
507
- { id: 'e9', fromNode: 'l1', toNode: 'r3', fromSide: 'right', toSide: 'left', pv: { edgeType: 'signal' } },
508
- { id: 'e10', fromNode: 'l3', toNode: 'r1', fromSide: 'right', toSide: 'left', pv: { edgeType: 'signal' } },
509
- ],
510
- pv: {
511
- version: '1.0.0',
512
- name: 'Complex Graph',
513
- edgeTypes: {
514
- flow: { style: 'solid', color: '#3b82f6', width: 2, directed: true },
515
- signal: { style: 'dashed', color: '#ef4444', width: 2, directed: true },
516
- },
517
- },
518
- };
519
-
520
- export const Level8_Complex: Story = {
521
- args: {
522
- canvas: complexCanvas,
523
- width: 600,
524
- height: 350,
525
- showBackground: true,
526
- backgroundVariant: 'dots',
527
- },
528
- };
529
-
530
- export const Level8_Complex_ELK: Story = {
531
- args: {
532
- canvas: complexCanvas,
533
- width: 600,
534
- height: 350,
535
- showBackground: true,
536
- backgroundVariant: 'dots',
537
- elkLayout: { enabled: true, routingStyle: 'orthogonal' },
538
- },
539
- };