@principal-ai/principal-view-react 0.6.10 → 0.6.12
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 +2 -5
- package/dist/components/ConfigurationSelector.js +4 -2
- package/dist/components/ConfigurationSelector.js.map +1 -1
- package/dist/components/EdgeInfoPanel.d.ts.map +1 -1
- package/dist/components/EdgeInfoPanel.js +43 -13
- package/dist/components/EdgeInfoPanel.js.map +1 -1
- package/dist/components/GraphRenderer.d.ts.map +1 -1
- package/dist/components/GraphRenderer.js +133 -83
- package/dist/components/GraphRenderer.js.map +1 -1
- package/dist/components/NodeInfoPanel.d.ts.map +1 -1
- package/dist/components/NodeInfoPanel.js +143 -45
- package/dist/components/NodeInfoPanel.js.map +1 -1
- package/dist/edges/CustomEdge.d.ts +1 -0
- package/dist/edges/CustomEdge.d.ts.map +1 -1
- package/dist/edges/CustomEdge.js +18 -4
- package/dist/edges/CustomEdge.js.map +1 -1
- package/dist/edges/GenericEdge.d.ts.map +1 -1
- package/dist/edges/GenericEdge.js +2 -2
- package/dist/edges/GenericEdge.js.map +1 -1
- package/dist/hooks/usePathBasedEvents.d.ts +1 -1
- package/dist/hooks/usePathBasedEvents.d.ts.map +1 -1
- package/dist/hooks/usePathBasedEvents.js +9 -9
- package/dist/hooks/usePathBasedEvents.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/nodes/CustomNode.d.ts.map +1 -1
- package/dist/nodes/CustomNode.js +62 -45
- package/dist/nodes/CustomNode.js.map +1 -1
- package/dist/nodes/GenericNode.d.ts.map +1 -1
- package/dist/nodes/GenericNode.js.map +1 -1
- package/dist/utils/animationMapping.d.ts.map +1 -1
- package/dist/utils/animationMapping.js +12 -12
- package/dist/utils/animationMapping.js.map +1 -1
- package/dist/utils/graphConverter.d.ts.map +1 -1
- package/dist/utils/graphConverter.js +47 -19
- package/dist/utils/graphConverter.js.map +1 -1
- package/dist/utils/iconResolver.d.ts.map +1 -1
- package/dist/utils/iconResolver.js +1 -1
- package/dist/utils/iconResolver.js.map +1 -1
- package/package.json +2 -1
- package/src/components/ConfigurationSelector.tsx +5 -5
- package/src/components/EdgeInfoPanel.tsx +79 -37
- package/src/components/GraphRenderer.tsx +526 -365
- package/src/components/NodeInfoPanel.tsx +209 -86
- package/src/edges/CustomEdge.tsx +40 -7
- package/src/edges/GenericEdge.tsx +2 -6
- package/src/hooks/usePathBasedEvents.ts +54 -45
- package/src/index.ts +11 -2
- package/src/nodes/CustomNode.tsx +137 -109
- package/src/nodes/GenericNode.tsx +4 -3
- package/src/stories/AnimationWorkshop.stories.tsx +131 -12
- package/src/stories/CanvasEdgeTypes.stories.tsx +980 -0
- package/src/stories/CanvasNodeTypes.stories.tsx +898 -0
- package/src/stories/ColorPriority.stories.tsx +20 -10
- package/src/stories/EventDrivenAnimations.stories.tsx +8 -0
- package/src/stories/EventLog.stories.tsx +1 -1
- package/src/stories/GraphRenderer.stories.tsx +23 -10
- package/src/stories/IndustryThemes.stories.tsx +481 -0
- package/src/stories/MultiConfig.stories.tsx +8 -0
- package/src/stories/MultiDirectionalConnections.stories.tsx +8 -0
- package/src/stories/NodeFieldsAudit.stories.tsx +124 -37
- package/src/stories/NodeShapes.stories.tsx +73 -59
- package/src/utils/animationMapping.ts +19 -23
- package/src/utils/graphConverter.ts +61 -21
- package/src/utils/iconResolver.tsx +5 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { GraphRenderer } from '../components/GraphRenderer';
|
|
3
3
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
4
|
+
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
6
7
|
title: 'Features/Multi-Directional Connections',
|
|
@@ -15,6 +16,13 @@ const meta = {
|
|
|
15
16
|
},
|
|
16
17
|
},
|
|
17
18
|
tags: ['autodocs'],
|
|
19
|
+
decorators: [
|
|
20
|
+
(Story) => (
|
|
21
|
+
<ThemeProvider theme={defaultEditorTheme}>
|
|
22
|
+
<Story />
|
|
23
|
+
</ThemeProvider>
|
|
24
|
+
),
|
|
25
|
+
],
|
|
18
26
|
} satisfies Meta<typeof GraphRenderer>;
|
|
19
27
|
|
|
20
28
|
export default meta;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
import { GraphRenderer } from '../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
|
+
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
5
6
|
|
|
6
7
|
const meta = {
|
|
7
8
|
title: 'Audit/NodeFieldsAudit',
|
|
@@ -10,6 +11,13 @@ const meta = {
|
|
|
10
11
|
layout: 'centered',
|
|
11
12
|
},
|
|
12
13
|
tags: ['autodocs'],
|
|
14
|
+
decorators: [
|
|
15
|
+
(Story) => (
|
|
16
|
+
<ThemeProvider theme={defaultEditorTheme}>
|
|
17
|
+
<Story />
|
|
18
|
+
</ThemeProvider>
|
|
19
|
+
),
|
|
20
|
+
],
|
|
13
21
|
} satisfies Meta<typeof GraphRenderer>;
|
|
14
22
|
|
|
15
23
|
export default meta;
|
|
@@ -31,10 +39,10 @@ const allFieldsCanvas: ExtendedCanvas = {
|
|
|
31
39
|
color: '#6366f1', // color field
|
|
32
40
|
pv: {
|
|
33
41
|
nodeType: 'fully-populated',
|
|
34
|
-
shape: 'rectangle',
|
|
35
|
-
icon: 'Server',
|
|
36
|
-
fill: '#6366f1',
|
|
37
|
-
stroke: '#4f46e5',
|
|
42
|
+
shape: 'rectangle', // shape field
|
|
43
|
+
icon: 'Server', // icon field
|
|
44
|
+
fill: '#6366f1', // pv.fill (takes priority over node.color)
|
|
45
|
+
stroke: '#4f46e5', // pv.stroke (border color)
|
|
38
46
|
dataSchema: {
|
|
39
47
|
name: { type: 'string', displayInLabel: true },
|
|
40
48
|
description: { type: 'string', displayInLabel: true },
|
|
@@ -214,14 +222,13 @@ const fieldVariationsCanvas: ExtendedCanvas = {
|
|
|
214
222
|
y: 80,
|
|
215
223
|
width: 120,
|
|
216
224
|
height: 80,
|
|
217
|
-
text: 'Rectangle',
|
|
225
|
+
text: '# Rectangle\n\nDefault shape',
|
|
218
226
|
color: '#6366f1',
|
|
219
227
|
pv: {
|
|
220
228
|
nodeType: 'shape-rect',
|
|
221
229
|
shape: 'rectangle',
|
|
222
230
|
icon: 'Square',
|
|
223
231
|
fill: '#6366f1',
|
|
224
|
-
description: 'Default shape',
|
|
225
232
|
dataSchema: { name: { type: 'string', displayInLabel: true } },
|
|
226
233
|
},
|
|
227
234
|
},
|
|
@@ -232,14 +239,13 @@ const fieldVariationsCanvas: ExtendedCanvas = {
|
|
|
232
239
|
y: 80,
|
|
233
240
|
width: 100,
|
|
234
241
|
height: 100,
|
|
235
|
-
text: 'Circle',
|
|
242
|
+
text: '# Circle\n\nRound shape',
|
|
236
243
|
color: '#8b5cf6',
|
|
237
244
|
pv: {
|
|
238
245
|
nodeType: 'shape-circle',
|
|
239
246
|
shape: 'circle',
|
|
240
247
|
icon: 'Circle',
|
|
241
248
|
fill: '#8b5cf6',
|
|
242
|
-
description: 'Round shape',
|
|
243
249
|
dataSchema: { name: { type: 'string', displayInLabel: true } },
|
|
244
250
|
},
|
|
245
251
|
},
|
|
@@ -250,14 +256,13 @@ const fieldVariationsCanvas: ExtendedCanvas = {
|
|
|
250
256
|
y: 80,
|
|
251
257
|
width: 120,
|
|
252
258
|
height: 120,
|
|
253
|
-
text: 'Hexagon',
|
|
259
|
+
text: '# Hexagon\n\n6-sided polygon',
|
|
254
260
|
color: '#06b6d4',
|
|
255
261
|
pv: {
|
|
256
262
|
nodeType: 'shape-hexagon',
|
|
257
263
|
shape: 'hexagon',
|
|
258
264
|
icon: 'Hexagon',
|
|
259
265
|
fill: '#06b6d4',
|
|
260
|
-
description: '6-sided polygon',
|
|
261
266
|
dataSchema: { name: { type: 'string', displayInLabel: true } },
|
|
262
267
|
},
|
|
263
268
|
},
|
|
@@ -268,14 +273,13 @@ const fieldVariationsCanvas: ExtendedCanvas = {
|
|
|
268
273
|
y: 80,
|
|
269
274
|
width: 90,
|
|
270
275
|
height: 90,
|
|
271
|
-
text: 'Diamond',
|
|
276
|
+
text: '# Diamond\n\nRotated square',
|
|
272
277
|
color: '#f59e0b',
|
|
273
278
|
pv: {
|
|
274
279
|
nodeType: 'shape-diamond',
|
|
275
280
|
shape: 'diamond',
|
|
276
281
|
icon: 'Diamond',
|
|
277
282
|
fill: '#f59e0b',
|
|
278
|
-
description: 'Rotated square',
|
|
279
283
|
dataSchema: { name: { type: 'string', displayInLabel: true } },
|
|
280
284
|
},
|
|
281
285
|
},
|
|
@@ -492,9 +496,7 @@ const FieldReferenceTemplate = () => {
|
|
|
492
496
|
borderRadius: 4,
|
|
493
497
|
}}
|
|
494
498
|
>
|
|
495
|
-
<div style={{ fontSize: 10, color: '#f97316', marginBottom: 4 }}>
|
|
496
|
-
ICON
|
|
497
|
-
</div>
|
|
499
|
+
<div style={{ fontSize: 10, color: '#f97316', marginBottom: 4 }}>ICON</div>
|
|
498
500
|
<span style={{ fontSize: 24 }}>S</span>
|
|
499
501
|
</div>
|
|
500
502
|
|
|
@@ -521,9 +523,7 @@ const FieldReferenceTemplate = () => {
|
|
|
521
523
|
borderRadius: 4,
|
|
522
524
|
}}
|
|
523
525
|
>
|
|
524
|
-
<div style={{ fontSize: 10, color: '#3b82f6', marginBottom: 4 }}>
|
|
525
|
-
STATE BADGE
|
|
526
|
-
</div>
|
|
526
|
+
<div style={{ fontSize: 10, color: '#3b82f6', marginBottom: 4 }}>STATE BADGE</div>
|
|
527
527
|
<span
|
|
528
528
|
style={{
|
|
529
529
|
backgroundColor: '#22c55e',
|
|
@@ -573,7 +573,14 @@ const FieldReferenceTemplate = () => {
|
|
|
573
573
|
</thead>
|
|
574
574
|
<tbody>
|
|
575
575
|
<tr>
|
|
576
|
-
<td
|
|
576
|
+
<td
|
|
577
|
+
style={{
|
|
578
|
+
padding: 8,
|
|
579
|
+
borderBottom: '1px solid #e5e7eb',
|
|
580
|
+
fontWeight: 'bold',
|
|
581
|
+
color: '#f97316',
|
|
582
|
+
}}
|
|
583
|
+
>
|
|
577
584
|
icon
|
|
578
585
|
</td>
|
|
579
586
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>
|
|
@@ -584,7 +591,14 @@ const FieldReferenceTemplate = () => {
|
|
|
584
591
|
</td>
|
|
585
592
|
</tr>
|
|
586
593
|
<tr>
|
|
587
|
-
<td
|
|
594
|
+
<td
|
|
595
|
+
style={{
|
|
596
|
+
padding: 8,
|
|
597
|
+
borderBottom: '1px solid #e5e7eb',
|
|
598
|
+
fontWeight: 'bold',
|
|
599
|
+
color: '#22c55e',
|
|
600
|
+
}}
|
|
601
|
+
>
|
|
588
602
|
label
|
|
589
603
|
</td>
|
|
590
604
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>
|
|
@@ -595,7 +609,14 @@ const FieldReferenceTemplate = () => {
|
|
|
595
609
|
</td>
|
|
596
610
|
</tr>
|
|
597
611
|
<tr>
|
|
598
|
-
<td
|
|
612
|
+
<td
|
|
613
|
+
style={{
|
|
614
|
+
padding: 8,
|
|
615
|
+
borderBottom: '1px solid #e5e7eb',
|
|
616
|
+
fontWeight: 'bold',
|
|
617
|
+
color: '#3b82f6',
|
|
618
|
+
}}
|
|
619
|
+
>
|
|
599
620
|
state
|
|
600
621
|
</td>
|
|
601
622
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>
|
|
@@ -606,7 +627,14 @@ const FieldReferenceTemplate = () => {
|
|
|
606
627
|
</td>
|
|
607
628
|
</tr>
|
|
608
629
|
<tr>
|
|
609
|
-
<td
|
|
630
|
+
<td
|
|
631
|
+
style={{
|
|
632
|
+
padding: 8,
|
|
633
|
+
borderBottom: '1px solid #e5e7eb',
|
|
634
|
+
fontWeight: 'bold',
|
|
635
|
+
color: '#6366f1',
|
|
636
|
+
}}
|
|
637
|
+
>
|
|
610
638
|
color
|
|
611
639
|
</td>
|
|
612
640
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>
|
|
@@ -617,7 +645,14 @@ const FieldReferenceTemplate = () => {
|
|
|
617
645
|
</td>
|
|
618
646
|
</tr>
|
|
619
647
|
<tr>
|
|
620
|
-
<td
|
|
648
|
+
<td
|
|
649
|
+
style={{
|
|
650
|
+
padding: 8,
|
|
651
|
+
borderBottom: '1px solid #e5e7eb',
|
|
652
|
+
fontWeight: 'bold',
|
|
653
|
+
color: '#6366f1',
|
|
654
|
+
}}
|
|
655
|
+
>
|
|
621
656
|
stroke
|
|
622
657
|
</td>
|
|
623
658
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>
|
|
@@ -628,7 +663,14 @@ const FieldReferenceTemplate = () => {
|
|
|
628
663
|
</td>
|
|
629
664
|
</tr>
|
|
630
665
|
<tr>
|
|
631
|
-
<td
|
|
666
|
+
<td
|
|
667
|
+
style={{
|
|
668
|
+
padding: 8,
|
|
669
|
+
borderBottom: '1px solid #e5e7eb',
|
|
670
|
+
fontWeight: 'bold',
|
|
671
|
+
color: '#6366f1',
|
|
672
|
+
}}
|
|
673
|
+
>
|
|
632
674
|
shape
|
|
633
675
|
</td>
|
|
634
676
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>
|
|
@@ -639,7 +681,14 @@ const FieldReferenceTemplate = () => {
|
|
|
639
681
|
</td>
|
|
640
682
|
</tr>
|
|
641
683
|
<tr>
|
|
642
|
-
<td
|
|
684
|
+
<td
|
|
685
|
+
style={{
|
|
686
|
+
padding: 8,
|
|
687
|
+
borderBottom: '1px solid #e5e7eb',
|
|
688
|
+
fontWeight: 'bold',
|
|
689
|
+
color: '#6366f1',
|
|
690
|
+
}}
|
|
691
|
+
>
|
|
643
692
|
size
|
|
644
693
|
</td>
|
|
645
694
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>
|
|
@@ -650,15 +699,11 @@ const FieldReferenceTemplate = () => {
|
|
|
650
699
|
</td>
|
|
651
700
|
</tr>
|
|
652
701
|
<tr>
|
|
653
|
-
<td style={{ padding: 8, fontWeight: 'bold', color: '#ef4444' }}>
|
|
654
|
-
hasViolations
|
|
655
|
-
</td>
|
|
702
|
+
<td style={{ padding: 8, fontWeight: 'bold', color: '#ef4444' }}>hasViolations</td>
|
|
656
703
|
<td style={{ padding: 8 }}>
|
|
657
704
|
<code>computed</code>
|
|
658
705
|
</td>
|
|
659
|
-
<td style={{ padding: 8 }}>
|
|
660
|
-
Shows warning indicator when true
|
|
661
|
-
</td>
|
|
706
|
+
<td style={{ padding: 8 }}>Shows warning indicator when true</td>
|
|
662
707
|
</tr>
|
|
663
708
|
</tbody>
|
|
664
709
|
</table>
|
|
@@ -977,7 +1022,14 @@ const PopupReferenceTemplate = () => {
|
|
|
977
1022
|
<tbody>
|
|
978
1023
|
<tr>
|
|
979
1024
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>1</td>
|
|
980
|
-
<td
|
|
1025
|
+
<td
|
|
1026
|
+
style={{
|
|
1027
|
+
padding: 8,
|
|
1028
|
+
borderBottom: '1px solid #e5e7eb',
|
|
1029
|
+
fontWeight: 'bold',
|
|
1030
|
+
color: '#f97316',
|
|
1031
|
+
}}
|
|
1032
|
+
>
|
|
981
1033
|
Icon
|
|
982
1034
|
</td>
|
|
983
1035
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>Yes (picker)</td>
|
|
@@ -987,7 +1039,14 @@ const PopupReferenceTemplate = () => {
|
|
|
987
1039
|
</tr>
|
|
988
1040
|
<tr>
|
|
989
1041
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>2</td>
|
|
990
|
-
<td
|
|
1042
|
+
<td
|
|
1043
|
+
style={{
|
|
1044
|
+
padding: 8,
|
|
1045
|
+
borderBottom: '1px solid #e5e7eb',
|
|
1046
|
+
fontWeight: 'bold',
|
|
1047
|
+
color: '#22c55e',
|
|
1048
|
+
}}
|
|
1049
|
+
>
|
|
991
1050
|
Type
|
|
992
1051
|
</td>
|
|
993
1052
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>Yes (dropdown)</td>
|
|
@@ -997,7 +1056,14 @@ const PopupReferenceTemplate = () => {
|
|
|
997
1056
|
</tr>
|
|
998
1057
|
<tr>
|
|
999
1058
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>3</td>
|
|
1000
|
-
<td
|
|
1059
|
+
<td
|
|
1060
|
+
style={{
|
|
1061
|
+
padding: 8,
|
|
1062
|
+
borderBottom: '1px solid #e5e7eb',
|
|
1063
|
+
fontWeight: 'bold',
|
|
1064
|
+
color: '#3b82f6',
|
|
1065
|
+
}}
|
|
1066
|
+
>
|
|
1001
1067
|
State
|
|
1002
1068
|
</td>
|
|
1003
1069
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>No</td>
|
|
@@ -1007,7 +1073,14 @@ const PopupReferenceTemplate = () => {
|
|
|
1007
1073
|
</tr>
|
|
1008
1074
|
<tr>
|
|
1009
1075
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>4</td>
|
|
1010
|
-
<td
|
|
1076
|
+
<td
|
|
1077
|
+
style={{
|
|
1078
|
+
padding: 8,
|
|
1079
|
+
borderBottom: '1px solid #e5e7eb',
|
|
1080
|
+
fontWeight: 'bold',
|
|
1081
|
+
color: '#8b5cf6',
|
|
1082
|
+
}}
|
|
1083
|
+
>
|
|
1011
1084
|
Name
|
|
1012
1085
|
</td>
|
|
1013
1086
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>Yes (inline)</td>
|
|
@@ -1017,7 +1090,14 @@ const PopupReferenceTemplate = () => {
|
|
|
1017
1090
|
</tr>
|
|
1018
1091
|
<tr>
|
|
1019
1092
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>5</td>
|
|
1020
|
-
<td
|
|
1093
|
+
<td
|
|
1094
|
+
style={{
|
|
1095
|
+
padding: 8,
|
|
1096
|
+
borderBottom: '1px solid #e5e7eb',
|
|
1097
|
+
fontWeight: 'bold',
|
|
1098
|
+
color: '#06b6d4',
|
|
1099
|
+
}}
|
|
1100
|
+
>
|
|
1021
1101
|
Properties
|
|
1022
1102
|
</td>
|
|
1023
1103
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>No</td>
|
|
@@ -1027,7 +1107,14 @@ const PopupReferenceTemplate = () => {
|
|
|
1027
1107
|
</tr>
|
|
1028
1108
|
<tr>
|
|
1029
1109
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>6</td>
|
|
1030
|
-
<td
|
|
1110
|
+
<td
|
|
1111
|
+
style={{
|
|
1112
|
+
padding: 8,
|
|
1113
|
+
borderBottom: '1px solid #e5e7eb',
|
|
1114
|
+
fontWeight: 'bold',
|
|
1115
|
+
color: '#64748b',
|
|
1116
|
+
}}
|
|
1117
|
+
>
|
|
1031
1118
|
ID
|
|
1032
1119
|
</td>
|
|
1033
1120
|
<td style={{ padding: 8, borderBottom: '1px solid #e5e7eb' }}>No</td>
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
import { GraphRenderer } from '../components/GraphRenderer';
|
|
4
4
|
import type { ExtendedCanvas } from '@principal-ai/principal-view-core';
|
|
5
|
+
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
5
6
|
|
|
6
7
|
const meta = {
|
|
7
8
|
title: 'Audit/NodeShapes',
|
|
@@ -10,6 +11,13 @@ const meta = {
|
|
|
10
11
|
layout: 'centered',
|
|
11
12
|
},
|
|
12
13
|
tags: ['autodocs'],
|
|
14
|
+
decorators: [
|
|
15
|
+
(Story) => (
|
|
16
|
+
<ThemeProvider theme={defaultEditorTheme}>
|
|
17
|
+
<Story />
|
|
18
|
+
</ThemeProvider>
|
|
19
|
+
),
|
|
20
|
+
],
|
|
13
21
|
} satisfies Meta<typeof GraphRenderer>;
|
|
14
22
|
|
|
15
23
|
export default meta;
|
|
@@ -33,7 +41,7 @@ const allShapesCanvas: ExtendedCanvas = {
|
|
|
33
41
|
pv: {
|
|
34
42
|
nodeType: 'rectangle-demo',
|
|
35
43
|
shape: 'rectangle',
|
|
36
|
-
icon: '
|
|
44
|
+
icon: 'Square',
|
|
37
45
|
},
|
|
38
46
|
},
|
|
39
47
|
{
|
|
@@ -48,7 +56,7 @@ const allShapesCanvas: ExtendedCanvas = {
|
|
|
48
56
|
pv: {
|
|
49
57
|
nodeType: 'circle-demo',
|
|
50
58
|
shape: 'circle',
|
|
51
|
-
icon: '
|
|
59
|
+
icon: 'Circle',
|
|
52
60
|
},
|
|
53
61
|
},
|
|
54
62
|
{
|
|
@@ -63,7 +71,7 @@ const allShapesCanvas: ExtendedCanvas = {
|
|
|
63
71
|
pv: {
|
|
64
72
|
nodeType: 'hexagon-demo',
|
|
65
73
|
shape: 'hexagon',
|
|
66
|
-
icon: '
|
|
74
|
+
icon: 'Hexagon',
|
|
67
75
|
size: { width: 120, height: 120 },
|
|
68
76
|
},
|
|
69
77
|
},
|
|
@@ -79,7 +87,7 @@ const allShapesCanvas: ExtendedCanvas = {
|
|
|
79
87
|
pv: {
|
|
80
88
|
nodeType: 'diamond-demo',
|
|
81
89
|
shape: 'diamond',
|
|
82
|
-
icon: '
|
|
90
|
+
icon: 'Diamond',
|
|
83
91
|
size: { width: 70, height: 70 },
|
|
84
92
|
},
|
|
85
93
|
},
|
|
@@ -95,7 +103,7 @@ const allShapesCanvas: ExtendedCanvas = {
|
|
|
95
103
|
pv: {
|
|
96
104
|
nodeType: 'custom-demo',
|
|
97
105
|
shape: 'custom',
|
|
98
|
-
icon: '
|
|
106
|
+
icon: 'Settings',
|
|
99
107
|
},
|
|
100
108
|
},
|
|
101
109
|
],
|
|
@@ -364,7 +372,7 @@ const shapesWithIconsCanvas: ExtendedCanvas = {
|
|
|
364
372
|
pv: {
|
|
365
373
|
nodeType: 'server',
|
|
366
374
|
shape: 'rectangle',
|
|
367
|
-
icon: '
|
|
375
|
+
icon: 'Server',
|
|
368
376
|
},
|
|
369
377
|
},
|
|
370
378
|
{
|
|
@@ -379,7 +387,7 @@ const shapesWithIconsCanvas: ExtendedCanvas = {
|
|
|
379
387
|
pv: {
|
|
380
388
|
nodeType: 'user',
|
|
381
389
|
shape: 'circle',
|
|
382
|
-
icon: '
|
|
390
|
+
icon: 'User',
|
|
383
391
|
},
|
|
384
392
|
},
|
|
385
393
|
{
|
|
@@ -394,7 +402,7 @@ const shapesWithIconsCanvas: ExtendedCanvas = {
|
|
|
394
402
|
pv: {
|
|
395
403
|
nodeType: 'database',
|
|
396
404
|
shape: 'hexagon',
|
|
397
|
-
icon: '
|
|
405
|
+
icon: 'Database',
|
|
398
406
|
},
|
|
399
407
|
},
|
|
400
408
|
{
|
|
@@ -409,7 +417,7 @@ const shapesWithIconsCanvas: ExtendedCanvas = {
|
|
|
409
417
|
pv: {
|
|
410
418
|
nodeType: 'cache',
|
|
411
419
|
shape: 'diamond',
|
|
412
|
-
icon: '
|
|
420
|
+
icon: 'Zap',
|
|
413
421
|
},
|
|
414
422
|
},
|
|
415
423
|
],
|
|
@@ -459,11 +467,11 @@ const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
|
459
467
|
pv: {
|
|
460
468
|
nodeType: 'process',
|
|
461
469
|
shape: 'rectangle',
|
|
462
|
-
icon: '
|
|
470
|
+
icon: 'Box',
|
|
463
471
|
states: {
|
|
464
|
-
idle: { color: '#94a3b8', icon: '
|
|
465
|
-
active: { color: '#3b82f6', icon: '
|
|
466
|
-
error: { color: '#ef4444', icon: '
|
|
472
|
+
idle: { color: '#94a3b8', icon: 'Box' },
|
|
473
|
+
active: { color: '#3b82f6', icon: 'Play' },
|
|
474
|
+
error: { color: '#ef4444', icon: 'AlertCircle' },
|
|
467
475
|
},
|
|
468
476
|
},
|
|
469
477
|
},
|
|
@@ -479,11 +487,11 @@ const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
|
479
487
|
pv: {
|
|
480
488
|
nodeType: 'agent',
|
|
481
489
|
shape: 'circle',
|
|
482
|
-
icon: '
|
|
490
|
+
icon: 'User',
|
|
483
491
|
states: {
|
|
484
|
-
idle: { color: '#94a3b8', icon: '
|
|
485
|
-
active: { color: '#22c55e', icon: '
|
|
486
|
-
error: { color: '#ef4444', icon: '
|
|
492
|
+
idle: { color: '#94a3b8', icon: 'User' },
|
|
493
|
+
active: { color: '#22c55e', icon: 'UserCheck' },
|
|
494
|
+
error: { color: '#ef4444', icon: 'UserX' },
|
|
487
495
|
},
|
|
488
496
|
},
|
|
489
497
|
},
|
|
@@ -499,11 +507,11 @@ const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
|
499
507
|
pv: {
|
|
500
508
|
nodeType: 'storage',
|
|
501
509
|
shape: 'hexagon',
|
|
502
|
-
icon: '
|
|
510
|
+
icon: 'Database',
|
|
503
511
|
states: {
|
|
504
|
-
idle: { color: '#94a3b8', icon: '
|
|
505
|
-
active: { color: '#22c55e', icon: '
|
|
506
|
-
error: { color: '#ef4444', icon: '
|
|
512
|
+
idle: { color: '#94a3b8', icon: 'Database' },
|
|
513
|
+
active: { color: '#22c55e', icon: 'HardDrive' },
|
|
514
|
+
error: { color: '#ef4444', icon: 'Database' },
|
|
507
515
|
},
|
|
508
516
|
},
|
|
509
517
|
},
|
|
@@ -519,11 +527,11 @@ const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
|
519
527
|
pv: {
|
|
520
528
|
nodeType: 'decision',
|
|
521
529
|
shape: 'diamond',
|
|
522
|
-
icon: '
|
|
530
|
+
icon: 'GitBranch',
|
|
523
531
|
states: {
|
|
524
|
-
idle: { color: '#94a3b8', icon: '
|
|
525
|
-
active: { color: '#f97316', icon: '
|
|
526
|
-
error: { color: '#ef4444', icon: '
|
|
532
|
+
idle: { color: '#94a3b8', icon: 'GitBranch' },
|
|
533
|
+
active: { color: '#f97316', icon: 'GitCommit' },
|
|
534
|
+
error: { color: '#ef4444', icon: 'GitBranch' },
|
|
527
535
|
},
|
|
528
536
|
},
|
|
529
537
|
},
|
|
@@ -541,7 +549,7 @@ const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
|
541
549
|
pv: {
|
|
542
550
|
nodeType: 'process-active',
|
|
543
551
|
shape: 'rectangle',
|
|
544
|
-
icon: '
|
|
552
|
+
icon: 'Play',
|
|
545
553
|
color: '#3b82f6',
|
|
546
554
|
},
|
|
547
555
|
},
|
|
@@ -557,7 +565,7 @@ const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
|
557
565
|
pv: {
|
|
558
566
|
nodeType: 'agent-active',
|
|
559
567
|
shape: 'circle',
|
|
560
|
-
icon: '
|
|
568
|
+
icon: 'UserCheck',
|
|
561
569
|
color: '#22c55e',
|
|
562
570
|
},
|
|
563
571
|
},
|
|
@@ -573,7 +581,7 @@ const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
|
573
581
|
pv: {
|
|
574
582
|
nodeType: 'storage-active',
|
|
575
583
|
shape: 'hexagon',
|
|
576
|
-
icon: '
|
|
584
|
+
icon: 'HardDrive',
|
|
577
585
|
color: '#22c55e',
|
|
578
586
|
},
|
|
579
587
|
},
|
|
@@ -589,7 +597,7 @@ const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
|
589
597
|
pv: {
|
|
590
598
|
nodeType: 'decision-active',
|
|
591
599
|
shape: 'diamond',
|
|
592
|
-
icon: '
|
|
600
|
+
icon: 'GitCommit',
|
|
593
601
|
color: '#f97316',
|
|
594
602
|
},
|
|
595
603
|
},
|
|
@@ -607,7 +615,7 @@ const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
|
607
615
|
pv: {
|
|
608
616
|
nodeType: 'process-error',
|
|
609
617
|
shape: 'rectangle',
|
|
610
|
-
icon: '
|
|
618
|
+
icon: 'AlertCircle',
|
|
611
619
|
color: '#ef4444',
|
|
612
620
|
},
|
|
613
621
|
},
|
|
@@ -623,7 +631,7 @@ const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
|
623
631
|
pv: {
|
|
624
632
|
nodeType: 'agent-error',
|
|
625
633
|
shape: 'circle',
|
|
626
|
-
icon: '
|
|
634
|
+
icon: 'UserX',
|
|
627
635
|
color: '#ef4444',
|
|
628
636
|
},
|
|
629
637
|
},
|
|
@@ -639,7 +647,7 @@ const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
|
639
647
|
pv: {
|
|
640
648
|
nodeType: 'storage-error',
|
|
641
649
|
shape: 'hexagon',
|
|
642
|
-
icon: '
|
|
650
|
+
icon: 'Database',
|
|
643
651
|
color: '#ef4444',
|
|
644
652
|
},
|
|
645
653
|
},
|
|
@@ -655,7 +663,7 @@ const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
|
655
663
|
pv: {
|
|
656
664
|
nodeType: 'decision-error',
|
|
657
665
|
shape: 'diamond',
|
|
658
|
-
icon: '
|
|
666
|
+
icon: 'GitBranch',
|
|
659
667
|
color: '#ef4444',
|
|
660
668
|
},
|
|
661
669
|
},
|
|
@@ -699,58 +707,64 @@ const ShapeComparisonTemplate = () => {
|
|
|
699
707
|
<div style={{ padding: 20 }}>
|
|
700
708
|
<h2 style={{ marginBottom: 20, fontFamily: 'system-ui' }}>Node Shape Comparison</h2>
|
|
701
709
|
|
|
702
|
-
<div
|
|
710
|
+
<div
|
|
711
|
+
style={{
|
|
712
|
+
display: 'grid',
|
|
713
|
+
gridTemplateColumns: 'repeat(5, 1fr)',
|
|
714
|
+
gap: 20,
|
|
715
|
+
marginBottom: 30,
|
|
716
|
+
}}
|
|
717
|
+
>
|
|
703
718
|
<div style={{ textAlign: 'center' }}>
|
|
704
719
|
<h4 style={{ marginBottom: 10, fontFamily: 'system-ui' }}>Rectangle</h4>
|
|
705
720
|
<code style={{ fontSize: 11 }}>shape: 'rectangle'</code>
|
|
706
|
-
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>
|
|
707
|
-
borderRadius: 8px
|
|
708
|
-
</div>
|
|
721
|
+
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>borderRadius: 8px</div>
|
|
709
722
|
</div>
|
|
710
723
|
<div style={{ textAlign: 'center' }}>
|
|
711
724
|
<h4 style={{ marginBottom: 10, fontFamily: 'system-ui' }}>Circle</h4>
|
|
712
725
|
<code style={{ fontSize: 11 }}>shape: 'circle'</code>
|
|
713
|
-
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>
|
|
714
|
-
borderRadius: 50%
|
|
715
|
-
</div>
|
|
726
|
+
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>borderRadius: 50%</div>
|
|
716
727
|
</div>
|
|
717
728
|
<div style={{ textAlign: 'center' }}>
|
|
718
729
|
<h4 style={{ marginBottom: 10, fontFamily: 'system-ui' }}>Hexagon</h4>
|
|
719
730
|
<code style={{ fontSize: 11 }}>shape: 'hexagon'</code>
|
|
720
|
-
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>
|
|
721
|
-
CSS clip-path polygon
|
|
722
|
-
</div>
|
|
731
|
+
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>CSS clip-path polygon</div>
|
|
723
732
|
</div>
|
|
724
733
|
<div style={{ textAlign: 'center' }}>
|
|
725
734
|
<h4 style={{ marginBottom: 10, fontFamily: 'system-ui' }}>Diamond</h4>
|
|
726
735
|
<code style={{ fontSize: 11 }}>shape: 'diamond'</code>
|
|
727
|
-
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>
|
|
728
|
-
rotate(45deg)
|
|
729
|
-
</div>
|
|
736
|
+
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>rotate(45deg)</div>
|
|
730
737
|
</div>
|
|
731
738
|
<div style={{ textAlign: 'center' }}>
|
|
732
739
|
<h4 style={{ marginBottom: 10, fontFamily: 'system-ui' }}>Custom</h4>
|
|
733
740
|
<code style={{ fontSize: 11 }}>shape: 'custom'</code>
|
|
734
|
-
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>
|
|
735
|
-
Falls back to rectangle
|
|
736
|
-
</div>
|
|
741
|
+
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>Falls back to rectangle</div>
|
|
737
742
|
</div>
|
|
738
743
|
</div>
|
|
739
744
|
|
|
740
|
-
<GraphRenderer
|
|
741
|
-
canvas={allShapesCanvas}
|
|
742
|
-
width={1100}
|
|
743
|
-
height={280}
|
|
744
|
-
/>
|
|
745
|
+
<GraphRenderer canvas={allShapesCanvas} width={1100} height={280} />
|
|
745
746
|
|
|
746
747
|
<div style={{ marginTop: 30, padding: 16, backgroundColor: '#f5f5f5', borderRadius: 8 }}>
|
|
747
748
|
<h4 style={{ marginBottom: 10, fontFamily: 'system-ui' }}>Implementation Notes</h4>
|
|
748
749
|
<ul style={{ fontSize: 13, lineHeight: 1.8, margin: 0, paddingLeft: 20 }}>
|
|
749
|
-
<li
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
<li
|
|
753
|
-
|
|
750
|
+
<li>
|
|
751
|
+
<strong>Rectangle</strong>: Standard box with 8px border radius
|
|
752
|
+
</li>
|
|
753
|
+
<li>
|
|
754
|
+
<strong>Circle</strong>: Forces equal width/height, 50% border radius
|
|
755
|
+
</li>
|
|
756
|
+
<li>
|
|
757
|
+
<strong>Hexagon</strong>: Flat-top style using{' '}
|
|
758
|
+
<code>clipPath: polygon(20% 0%, 80% 0%, 100% 50%, 80% 100%, 20% 100%, 0% 50%)</code>
|
|
759
|
+
</li>
|
|
760
|
+
<li>
|
|
761
|
+
<strong>Diamond</strong>: Fixed square rotated 45°, inner content rotated -45° to keep
|
|
762
|
+
text upright
|
|
763
|
+
</li>
|
|
764
|
+
<li>
|
|
765
|
+
<strong>Custom</strong>: Currently renders as rectangle (placeholder for future custom
|
|
766
|
+
shapes)
|
|
767
|
+
</li>
|
|
754
768
|
</ul>
|
|
755
769
|
</div>
|
|
756
770
|
</div>
|