@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,727 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { ReactFlow, ReactFlowProvider, Background, Controls } from '@xyflow/react';
3
- import '@xyflow/react/dist/style.css';
4
- import { CustomNode } from '../../nodes/CustomNode';
5
- import { CustomEdge } from '../../edges/CustomEdge';
6
- import type { CustomNodeData } from '../../nodes/CustomNode';
7
- import type { CustomEdgeData } from '../../edges/CustomEdge';
8
- import type { NodeTypeDefinition, EdgeTypeDefinition } from '@principal-ai/subsystems-core';
9
- import React from 'react';
10
-
11
- const meta = {
12
- title: 'Features/AnimationWorkshop',
13
- component: ReactFlow,
14
- parameters: {
15
- layout: 'fullscreen',
16
- },
17
- tags: ['autodocs'],
18
- } satisfies Meta<typeof ReactFlow>;
19
-
20
- export default meta;
21
- type Story = StoryObj<typeof meta>;
22
-
23
- // Define custom node and edge types
24
- const nodeTypes = {
25
- custom: CustomNode,
26
- };
27
-
28
- const edgeTypes = {
29
- custom: CustomEdge,
30
- };
31
-
32
- // Sample type definitions
33
- const processNodeType: NodeTypeDefinition = {
34
- shape: 'rectangle',
35
- color: '#4A90E2',
36
- icon: 'Settings',
37
- dataSchema: {
38
- name: { type: 'string', required: true, displayInLabel: true },
39
- },
40
- };
41
-
42
- const dataNodeType: NodeTypeDefinition = {
43
- shape: 'circle',
44
- color: '#7B68EE',
45
- icon: 'Database',
46
- dataSchema: {
47
- name: { type: 'string', required: true, displayInLabel: true },
48
- },
49
- };
50
-
51
- const edgeTypeDefinition: EdgeTypeDefinition = {
52
- style: 'solid',
53
- color: '#50E3C2',
54
- directed: true,
55
- width: 2,
56
- animation: {
57
- type: 'flow',
58
- color: '#00D9FF',
59
- },
60
- };
61
-
62
- /**
63
- * Story 1: Edge Flow Animations
64
- * Demonstrates forward, backward, and bidirectional flow animations
65
- */
66
- export const EdgeFlowAnimations: Story = {
67
- render: () => (
68
- <ReactFlowProvider>
69
- <div style={{ width: '100vw', height: '100vh' }}>
70
- <ReactFlow
71
- nodes={[
72
- {
73
- id: 'node-1',
74
- type: 'custom',
75
- position: { x: 100, y: 100 },
76
- data: {
77
- label: 'Source',
78
- typeDefinition: processNodeType,
79
- data: { name: 'Source' },
80
- } as CustomNodeData,
81
- },
82
- {
83
- id: 'node-2',
84
- type: 'custom',
85
- position: { x: 400, y: 100 },
86
- data: {
87
- label: 'Target',
88
- typeDefinition: dataNodeType,
89
- data: { name: 'Target' },
90
- } as CustomNodeData,
91
- },
92
- {
93
- id: 'node-3',
94
- type: 'custom',
95
- position: { x: 100, y: 250 },
96
- data: {
97
- label: 'Backward',
98
- typeDefinition: processNodeType,
99
- data: { name: 'Backward' },
100
- } as CustomNodeData,
101
- },
102
- {
103
- id: 'node-4',
104
- type: 'custom',
105
- position: { x: 400, y: 250 },
106
- data: {
107
- label: 'Backward Target',
108
- typeDefinition: dataNodeType,
109
- data: { name: 'Backward Target' },
110
- } as CustomNodeData,
111
- },
112
- {
113
- id: 'node-5',
114
- type: 'custom',
115
- position: { x: 100, y: 400 },
116
- data: {
117
- label: 'Bidirectional A',
118
- typeDefinition: processNodeType,
119
- data: { name: 'Bidirectional A' },
120
- } as CustomNodeData,
121
- },
122
- {
123
- id: 'node-6',
124
- type: 'custom',
125
- position: { x: 400, y: 400 },
126
- data: {
127
- label: 'Bidirectional B',
128
- typeDefinition: dataNodeType,
129
- data: { name: 'Bidirectional B' },
130
- } as CustomNodeData,
131
- },
132
- ]}
133
- edges={[
134
- {
135
- id: 'edge-1',
136
- source: 'node-1',
137
- target: 'node-2',
138
- type: 'custom',
139
- label: 'Forward Flow',
140
- data: {
141
- typeDefinition: edgeTypeDefinition,
142
- animationType: 'flow',
143
- animationDirection: 'forward',
144
- animationDuration: 1000,
145
- } as CustomEdgeData,
146
- },
147
- {
148
- id: 'edge-2',
149
- source: 'node-3',
150
- target: 'node-4',
151
- type: 'custom',
152
- label: 'Backward Flow',
153
- data: {
154
- typeDefinition: edgeTypeDefinition,
155
- animationType: 'flow',
156
- animationDirection: 'backward',
157
- animationDuration: 1000,
158
- } as CustomEdgeData,
159
- },
160
- {
161
- id: 'edge-3',
162
- source: 'node-5',
163
- target: 'node-6',
164
- type: 'custom',
165
- label: 'Bidirectional Flow',
166
- data: {
167
- typeDefinition: edgeTypeDefinition,
168
- animationType: 'flow',
169
- animationDirection: 'bidirectional',
170
- animationDuration: 2000,
171
- } as CustomEdgeData,
172
- },
173
- ]}
174
- nodeTypes={nodeTypes}
175
- edgeTypes={edgeTypes}
176
- fitView
177
- >
178
- <Background />
179
- <Controls />
180
- </ReactFlow>
181
- </div>
182
- </ReactFlowProvider>
183
- ),
184
- };
185
-
186
- /**
187
- * Story 2: Edge Particle Animation
188
- * Shows particle traveling along edges with different speeds
189
- */
190
- export const EdgeParticleAnimation: Story = {
191
- render: () => (
192
- <ReactFlowProvider>
193
- <div style={{ width: '100vw', height: '100vh' }}>
194
- <ReactFlow
195
- nodes={[
196
- {
197
- id: 'node-1',
198
- type: 'custom',
199
- position: { x: 100, y: 150 },
200
- data: {
201
- label: 'Fast',
202
- typeDefinition: processNodeType,
203
- data: { name: 'Fast' },
204
- } as CustomNodeData,
205
- },
206
- {
207
- id: 'node-2',
208
- type: 'custom',
209
- position: { x: 400, y: 150 },
210
- data: {
211
- label: 'Fast Target',
212
- typeDefinition: dataNodeType,
213
- data: { name: 'Fast Target' },
214
- } as CustomNodeData,
215
- },
216
- {
217
- id: 'node-3',
218
- type: 'custom',
219
- position: { x: 100, y: 300 },
220
- data: {
221
- label: 'Slow',
222
- typeDefinition: processNodeType,
223
- data: { name: 'Slow' },
224
- } as CustomNodeData,
225
- },
226
- {
227
- id: 'node-4',
228
- type: 'custom',
229
- position: { x: 400, y: 300 },
230
- data: {
231
- label: 'Slow Target',
232
- typeDefinition: dataNodeType,
233
- data: { name: 'Slow Target' },
234
- } as CustomNodeData,
235
- },
236
- ]}
237
- edges={[
238
- {
239
- id: 'edge-1',
240
- source: 'node-1',
241
- target: 'node-2',
242
- type: 'custom',
243
- label: 'Fast Particle (500ms)',
244
- data: {
245
- typeDefinition: edgeTypeDefinition,
246
- animationType: 'particle',
247
- animationDuration: 500,
248
- animationDirection: 'forward',
249
- } as CustomEdgeData,
250
- },
251
- {
252
- id: 'edge-2',
253
- source: 'node-3',
254
- target: 'node-4',
255
- type: 'custom',
256
- label: 'Slow Particle (2000ms)',
257
- data: {
258
- typeDefinition: edgeTypeDefinition,
259
- animationType: 'particle',
260
- animationDuration: 2000,
261
- animationDirection: 'forward',
262
- } as CustomEdgeData,
263
- },
264
- ]}
265
- nodeTypes={nodeTypes}
266
- edgeTypes={edgeTypes}
267
- fitView
268
- >
269
- <Background />
270
- <Controls />
271
- </ReactFlow>
272
- </div>
273
- </ReactFlowProvider>
274
- ),
275
- };
276
-
277
- /**
278
- * Story 3: Edge Pulse and Glow
279
- * Demonstrates pulse and glow effects on edges
280
- */
281
- export const EdgePulseAndGlow: Story = {
282
- render: () => (
283
- <ReactFlowProvider>
284
- <div style={{ width: '100vw', height: '100vh' }}>
285
- <ReactFlow
286
- nodes={[
287
- {
288
- id: 'node-1',
289
- type: 'custom',
290
- position: { x: 100, y: 150 },
291
- data: {
292
- label: 'Pulse Source',
293
- typeDefinition: processNodeType,
294
- data: { name: 'Pulse Source' },
295
- } as CustomNodeData,
296
- },
297
- {
298
- id: 'node-2',
299
- type: 'custom',
300
- position: { x: 400, y: 150 },
301
- data: {
302
- label: 'Pulse Target',
303
- typeDefinition: dataNodeType,
304
- data: { name: 'Pulse Target' },
305
- } as CustomNodeData,
306
- },
307
- {
308
- id: 'node-3',
309
- type: 'custom',
310
- position: { x: 100, y: 300 },
311
- data: {
312
- label: 'Glow Source',
313
- typeDefinition: processNodeType,
314
- data: { name: 'Glow Source' },
315
- } as CustomNodeData,
316
- },
317
- {
318
- id: 'node-4',
319
- type: 'custom',
320
- position: { x: 400, y: 300 },
321
- data: {
322
- label: 'Glow Target',
323
- typeDefinition: dataNodeType,
324
- data: { name: 'Glow Target' },
325
- } as CustomNodeData,
326
- },
327
- ]}
328
- edges={[
329
- {
330
- id: 'edge-1',
331
- source: 'node-1',
332
- target: 'node-2',
333
- type: 'custom',
334
- label: 'Pulse Animation',
335
- data: {
336
- typeDefinition: edgeTypeDefinition,
337
- animationType: 'pulse',
338
- animationDuration: 1500,
339
- } as CustomEdgeData,
340
- },
341
- {
342
- id: 'edge-2',
343
- source: 'node-3',
344
- target: 'node-4',
345
- type: 'custom',
346
- label: 'Glow Animation',
347
- data: {
348
- typeDefinition: edgeTypeDefinition,
349
- animationType: 'glow',
350
- animationDuration: 1000,
351
- } as CustomEdgeData,
352
- },
353
- ]}
354
- nodeTypes={nodeTypes}
355
- edgeTypes={edgeTypes}
356
- fitView
357
- >
358
- <Background />
359
- <Controls />
360
- </ReactFlow>
361
- </div>
362
- </ReactFlowProvider>
363
- ),
364
- };
365
-
366
- /**
367
- * Story 4: Node Animations
368
- * Shows processing pulse, success flash, error shake, and entry animations
369
- */
370
- export const NodeAnimations: Story = {
371
- render: () => (
372
- <ReactFlowProvider>
373
- <div style={{ width: '100vw', height: '100vh' }}>
374
- <ReactFlow
375
- nodes={[
376
- {
377
- id: 'node-1',
378
- type: 'custom',
379
- position: { x: 100, y: 100 },
380
- data: {
381
- label: 'Processing',
382
- typeDefinition: processNodeType,
383
- data: { name: 'Processing' },
384
- animationType: 'pulse',
385
- animationDuration: 1500,
386
- } as CustomNodeData,
387
- },
388
- {
389
- id: 'node-2',
390
- type: 'custom',
391
- position: { x: 300, y: 100 },
392
- data: {
393
- label: 'Success',
394
- typeDefinition: dataNodeType,
395
- data: { name: 'Success' },
396
- animationType: 'flash',
397
- animationDuration: 1000,
398
- } as CustomNodeData,
399
- },
400
- {
401
- id: 'node-3',
402
- type: 'custom',
403
- position: { x: 100, y: 250 },
404
- data: {
405
- label: 'Error',
406
- typeDefinition: processNodeType,
407
- data: { name: 'Error' },
408
- animationType: 'shake',
409
- animationDuration: 500,
410
- hasViolations: true,
411
- } as CustomNodeData,
412
- },
413
- {
414
- id: 'node-4',
415
- type: 'custom',
416
- position: { x: 300, y: 250 },
417
- data: {
418
- label: 'Entry',
419
- typeDefinition: dataNodeType,
420
- data: { name: 'Entry' },
421
- animationType: 'entry',
422
- animationDuration: 600,
423
- } as CustomNodeData,
424
- },
425
- ]}
426
- edges={[]}
427
- nodeTypes={nodeTypes}
428
- edgeTypes={edgeTypes}
429
- fitView
430
- >
431
- <Background />
432
- <Controls />
433
- </ReactFlow>
434
- </div>
435
- </ReactFlowProvider>
436
- ),
437
- };
438
-
439
- /**
440
- * Story 5: Combined Pipeline Animation
441
- * Shows a realistic data pipeline with coordinated animations
442
- */
443
- export const CombinedPipelineAnimation: Story = {
444
- render: () => (
445
- <ReactFlowProvider>
446
- <div style={{ width: '100vw', height: '100vh' }}>
447
- <ReactFlow
448
- nodes={[
449
- {
450
- id: 'input',
451
- type: 'custom',
452
- position: { x: 50, y: 200 },
453
- data: {
454
- label: 'Input',
455
- typeDefinition: { ...processNodeType, color: '#10B981' },
456
- data: { name: 'Data Input' },
457
- animationType: 'pulse',
458
- animationDuration: 2000,
459
- } as CustomNodeData,
460
- },
461
- {
462
- id: 'validate',
463
- type: 'custom',
464
- position: { x: 250, y: 200 },
465
- data: {
466
- label: 'Validate',
467
- typeDefinition: processNodeType,
468
- data: { name: 'Validator' },
469
- } as CustomNodeData,
470
- },
471
- {
472
- id: 'transform',
473
- type: 'custom',
474
- position: { x: 450, y: 200 },
475
- data: {
476
- label: 'Transform',
477
- typeDefinition: processNodeType,
478
- data: { name: 'Transformer' },
479
- } as CustomNodeData,
480
- },
481
- {
482
- id: 'output',
483
- type: 'custom',
484
- position: { x: 650, y: 200 },
485
- data: {
486
- label: 'Output',
487
- typeDefinition: { ...dataNodeType, color: '#10B981' },
488
- data: { name: 'Data Output' },
489
- animationType: 'flash',
490
- animationDuration: 1500,
491
- } as CustomNodeData,
492
- },
493
- {
494
- id: 'error',
495
- type: 'custom',
496
- position: { x: 250, y: 350 },
497
- data: {
498
- label: 'Error Handler',
499
- typeDefinition: { ...processNodeType, color: '#EF4444' },
500
- data: { name: 'Error Handler' },
501
- animationType: 'shake',
502
- animationDuration: 400,
503
- hasViolations: true,
504
- } as CustomNodeData,
505
- },
506
- ]}
507
- edges={[
508
- {
509
- id: 'edge-1',
510
- source: 'input',
511
- target: 'validate',
512
- type: 'custom',
513
- data: {
514
- typeDefinition: edgeTypeDefinition,
515
- animationType: 'particle',
516
- animationDuration: 1000,
517
- animationDirection: 'forward',
518
- } as CustomEdgeData,
519
- },
520
- {
521
- id: 'edge-2',
522
- source: 'validate',
523
- target: 'transform',
524
- type: 'custom',
525
- data: {
526
- typeDefinition: edgeTypeDefinition,
527
- animationType: 'flow',
528
- animationDuration: 800,
529
- animationDirection: 'forward',
530
- } as CustomEdgeData,
531
- },
532
- {
533
- id: 'edge-3',
534
- source: 'transform',
535
- target: 'output',
536
- type: 'custom',
537
- data: {
538
- typeDefinition: edgeTypeDefinition,
539
- animationType: 'particle',
540
- animationDuration: 1000,
541
- animationDirection: 'forward',
542
- } as CustomEdgeData,
543
- },
544
- {
545
- id: 'edge-error',
546
- source: 'validate',
547
- target: 'error',
548
- type: 'custom',
549
- data: {
550
- typeDefinition: { ...edgeTypeDefinition, color: '#EF4444' },
551
- animationType: 'glow',
552
- animationDuration: 1000,
553
- } as CustomEdgeData,
554
- },
555
- ]}
556
- nodeTypes={nodeTypes}
557
- edgeTypes={edgeTypes}
558
- fitView
559
- >
560
- <Background />
561
- <Controls />
562
- </ReactFlow>
563
- </div>
564
- </ReactFlowProvider>
565
- ),
566
- };
567
-
568
- /**
569
- * Story 6: All Animations Showcase
570
- * Grid layout showing all animation types simultaneously
571
- */
572
- export const AllAnimationsShowcase: Story = {
573
- render: () => (
574
- <ReactFlowProvider>
575
- <div style={{ width: '100vw', height: '100vh' }}>
576
- <ReactFlow
577
- nodes={[
578
- // Row 1: Edge animations
579
- {
580
- id: 'flow-1',
581
- type: 'custom',
582
- position: { x: 50, y: 50 },
583
- data: {
584
- label: 'Flow',
585
- typeDefinition: processNodeType,
586
- data: { name: 'Flow Start' },
587
- } as CustomNodeData,
588
- },
589
- {
590
- id: 'flow-2',
591
- type: 'custom',
592
- position: { x: 200, y: 50 },
593
- data: {
594
- label: 'Flow',
595
- typeDefinition: dataNodeType,
596
- data: { name: 'Flow End' },
597
- } as CustomNodeData,
598
- },
599
-
600
- {
601
- id: 'particle-1',
602
- type: 'custom',
603
- position: { x: 280, y: 50 },
604
- data: {
605
- label: 'Particle',
606
- typeDefinition: processNodeType,
607
- data: { name: 'Particle Start' },
608
- } as CustomNodeData,
609
- },
610
- {
611
- id: 'particle-2',
612
- type: 'custom',
613
- position: { x: 430, y: 50 },
614
- data: {
615
- label: 'Particle',
616
- typeDefinition: dataNodeType,
617
- data: { name: 'Particle End' },
618
- } as CustomNodeData,
619
- },
620
-
621
- {
622
- id: 'pulse-1',
623
- type: 'custom',
624
- position: { x: 510, y: 50 },
625
- data: {
626
- label: 'Pulse',
627
- typeDefinition: processNodeType,
628
- data: { name: 'Pulse Start' },
629
- } as CustomNodeData,
630
- },
631
- {
632
- id: 'pulse-2',
633
- type: 'custom',
634
- position: { x: 660, y: 50 },
635
- data: {
636
- label: 'Pulse',
637
- typeDefinition: dataNodeType,
638
- data: { name: 'Pulse End' },
639
- } as CustomNodeData,
640
- },
641
-
642
- // Row 2: Node animations
643
- {
644
- id: 'node-pulse',
645
- type: 'custom',
646
- position: { x: 100, y: 180 },
647
- data: {
648
- label: 'Processing Pulse',
649
- typeDefinition: processNodeType,
650
- data: { name: 'Processing' },
651
- animationType: 'pulse',
652
- animationDuration: 1500,
653
- } as CustomNodeData,
654
- },
655
- {
656
- id: 'node-flash',
657
- type: 'custom',
658
- position: { x: 300, y: 180 },
659
- data: {
660
- label: 'Success Flash',
661
- typeDefinition: dataNodeType,
662
- data: { name: 'Success' },
663
- animationType: 'flash',
664
- animationDuration: 1000,
665
- } as CustomNodeData,
666
- },
667
- {
668
- id: 'node-shake',
669
- type: 'custom',
670
- position: { x: 500, y: 180 },
671
- data: {
672
- label: 'Error Shake',
673
- typeDefinition: processNodeType,
674
- data: { name: 'Error' },
675
- animationType: 'shake',
676
- animationDuration: 500,
677
- hasViolations: true,
678
- } as CustomNodeData,
679
- },
680
- ]}
681
- edges={[
682
- {
683
- id: 'e-flow',
684
- source: 'flow-1',
685
- target: 'flow-2',
686
- type: 'custom',
687
- data: {
688
- typeDefinition: edgeTypeDefinition,
689
- animationType: 'flow',
690
- animationDirection: 'forward',
691
- animationDuration: 1000,
692
- } as CustomEdgeData,
693
- },
694
- {
695
- id: 'e-particle',
696
- source: 'particle-1',
697
- target: 'particle-2',
698
- type: 'custom',
699
- data: {
700
- typeDefinition: edgeTypeDefinition,
701
- animationType: 'particle',
702
- animationDuration: 1200,
703
- } as CustomEdgeData,
704
- },
705
- {
706
- id: 'e-pulse',
707
- source: 'pulse-1',
708
- target: 'pulse-2',
709
- type: 'custom',
710
- data: {
711
- typeDefinition: edgeTypeDefinition,
712
- animationType: 'pulse',
713
- animationDuration: 1500,
714
- } as CustomEdgeData,
715
- },
716
- ]}
717
- nodeTypes={nodeTypes}
718
- edgeTypes={edgeTypes}
719
- fitView
720
- >
721
- <Background />
722
- <Controls />
723
- </ReactFlow>
724
- </div>
725
- </ReactFlowProvider>
726
- ),
727
- };