@principal-ai/subsystems-react 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -85
- package/dist/index.d.ts +7 -44
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -32
- package/dist/index.js.map +1 -1
- package/dist/subsystem/SubsystemCarousel.d.ts +36 -0
- package/dist/subsystem/SubsystemCarousel.d.ts.map +1 -0
- package/dist/subsystem/SubsystemCarousel.js +163 -0
- package/dist/subsystem/SubsystemCarousel.js.map +1 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts +25 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +329 -68
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +9 -199
- package/src/subsystem/SubsystemComponentGraph.tsx +396 -50
- package/src/components/ConfigurationSelector.tsx +0 -133
- package/src/components/GraphRenderer.tsx +0 -3195
- package/src/components/MultiCanvasRenderer.tsx +0 -295
- package/src/components/NodeTooltip.tsx +0 -279
- package/src/components/PendingChanges.test.tsx +0 -375
- package/src/components/SelectionSidebar.tsx +0 -352
- package/src/components/SequenceDiagramRenderer.tsx +0 -1156
- package/src/components/WorkflowSequenceDiagram.tsx +0 -270
- package/src/components/dashboard/DashboardRenderer.tsx +0 -317
- package/src/components/dashboard/MetricPanel.tsx +0 -254
- package/src/components/dashboard/MockDataProvider.ts +0 -330
- package/src/components/dashboard/components/BarChart.tsx +0 -299
- package/src/components/dashboard/components/LineChart.tsx +0 -279
- package/src/components/dashboard/components/MetricCard.tsx +0 -270
- package/src/components/dashboard/components/SourceLink.tsx +0 -63
- package/src/components/dashboard/components/TimeRangeSelector.tsx +0 -280
- package/src/components/dashboard/components/index.ts +0 -5
- package/src/components/dashboard/index.ts +0 -47
- package/src/components/dashboard/types.ts +0 -126
- package/src/components/state-view/PipelineView.tsx +0 -347
- package/src/components/state-view/index.ts +0 -14
- package/src/components/state-view/types.ts +0 -261
- package/src/components/state-view/useStateView.ts +0 -205
- package/src/contexts/GraphEditContext.tsx +0 -27
- package/src/contexts/TooltipPortalContext.ts +0 -8
- package/src/edges/CustomEdge.tsx +0 -402
- package/src/edges/GenericEdge.tsx +0 -36
- package/src/hooks/usePathBasedEvents.ts +0 -192
- package/src/hooks/useSequenceLayout.ts +0 -543
- package/src/hooks/useUndoRedo.ts +0 -144
- package/src/nodes/CustomNode.tsx +0 -1231
- package/src/nodes/GenericNode.tsx +0 -55
- package/src/nodes/otel/OtelBoundaryNode.tsx +0 -224
- package/src/nodes/otel/OtelEventNode.tsx +0 -225
- package/src/nodes/otel/OtelResourceNode.tsx +0 -251
- package/src/nodes/otel/OtelScopeNode.tsx +0 -221
- package/src/nodes/otel/OtelSpanConventionNode.tsx +0 -295
- package/src/nodes/otel/index.ts +0 -23
- package/src/nodes/otel/shared/NodeBadges.tsx +0 -295
- package/src/nodes/otel/shared/NodeContent.tsx +0 -204
- package/src/nodes/otel/shared/index.ts +0 -8
- package/src/nodes/otel/shared/types.ts +0 -138
- package/src/nodes/otel/shared/useNodeBehavior.ts +0 -114
- package/src/stories/Audit/BoundaryNodes.stories.tsx +0 -385
- package/src/stories/Audit/CanvasEdgeTypes.stories.tsx +0 -1448
- package/src/stories/Audit/CanvasNodeTypes.stories.tsx +0 -1049
- package/src/stories/Audit/ColorPriority.stories.tsx +0 -895
- package/src/stories/Audit/DiamondBadges.stories.tsx +0 -629
- package/src/stories/Audit/NodeDimensionsTesting.stories.tsx +0 -724
- package/src/stories/Audit/NodeFieldsAudit.stories.tsx +0 -996
- package/src/stories/Audit/NodeFontSizeTesting.stories.tsx +0 -715
- package/src/stories/Audit/NodeShapes.stories.tsx +0 -1208
- package/src/stories/Audit/WideNodesTesting.stories.tsx +0 -1045
- package/src/stories/Components/DashboardRenderer.stories.tsx +0 -263
- package/src/stories/Components/GraphRenderer.stories.tsx +0 -3236
- package/src/stories/Components/MultiCanvasRenderer.stories.tsx +0 -370
- package/src/stories/Components/SequenceDiagram.stories.tsx +0 -255
- package/src/stories/Components/StateView.stories.tsx +0 -417
- package/src/stories/Components/TraceViewer.stories.tsx +0 -442
- package/src/stories/Components/WorkflowSequenceDiagram.stories.tsx +0 -802
- package/src/stories/Features/AnimationWorkshop.stories.tsx +0 -727
- package/src/stories/Features/ChangeTypeVisual.stories.tsx +0 -67
- package/src/stories/Features/EventDrivenAnimations.stories.tsx +0 -513
- package/src/stories/Features/MultiConfig.stories.tsx +0 -539
- package/src/stories/Layout/ElkEdgeRouting.stories.tsx +0 -539
- package/src/stories/Layout/GraphOrientation.stories.tsx +0 -500
- package/src/stories/Layout/MultiDirectionalConnections.stories.tsx +0 -352
- package/src/stories/Nodes/NodeDefinitionComparison.stories.tsx +0 -560
- package/src/stories/Nodes/NodeNameFallbacks.stories.tsx +0 -491
- package/src/stories/Nodes/NumericColors.stories.tsx +0 -440
- package/src/stories/OTEL/EventNameDisplay.stories.tsx +0 -694
- package/src/stories/OTEL/EventNameFallback.stories.tsx +0 -578
- package/src/stories/OTEL/OtelComponents.stories.tsx +0 -422
- package/src/stories/OTEL/OtelNodeTypesPrototype.stories.tsx +0 -806
- package/src/stories/OTEL/RawEventCards.stories.tsx +0 -57
- package/src/stories/OTEL/SpanBadges.stories.tsx +0 -840
- package/src/stories/OTEL/ValidationEventsCanvas.stories.tsx +0 -209
- package/src/stories/RealWorld/BacklogMdCanvases.stories.tsx +0 -721
- package/src/stories/RealWorld/FileCitySequence.stories.tsx +0 -516
- package/src/stories/RealWorld/RealCanvasFiles.stories.tsx +0 -336
- package/src/stories/__traces__/test-run.canvas.json +0 -241
- package/src/stories/data/activity-feed-analytics.dashboard.json +0 -300
- package/src/stories/data/file-city-images-transformed.otel.canvas.json +0 -295
- package/src/stories/data/file-city-workflows.json +0 -269
- package/src/stories/data/graph-converter-test-execution.json +0 -443
- package/src/stories/data/graph-converter-test.workflow.json +0 -105
- package/src/stories/data/graph-converter-validated-execution.json +0 -58
- package/src/utils/animationMapping.ts +0 -166
- package/src/utils/canvasBounds.ts +0 -146
- package/src/utils/graphConverter.ts +0 -148
- package/src/utils/iconResolver.tsx +0 -53
- package/src/utils/orientationUtils.ts +0 -73
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { GraphRenderer } from '../../components/GraphRenderer';
|
|
3
|
-
import type { ExtendedCanvas } from '@principal-ai/subsystems-core';
|
|
4
|
-
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: 'Layout/MultiDirectionalConnections',
|
|
8
|
-
component: GraphRenderer,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'fullscreen',
|
|
11
|
-
docs: {
|
|
12
|
-
description: {
|
|
13
|
-
component:
|
|
14
|
-
'Demonstrates multi-directional edge connections (top, bottom, left, right) and clickable edges with information panels.',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
tags: ['autodocs'],
|
|
19
|
-
decorators: [
|
|
20
|
-
(Story) => (
|
|
21
|
-
<ThemeProvider theme={defaultEditorTheme}>
|
|
22
|
-
<Story />
|
|
23
|
-
</ThemeProvider>
|
|
24
|
-
),
|
|
25
|
-
],
|
|
26
|
-
} satisfies Meta<typeof GraphRenderer>;
|
|
27
|
-
|
|
28
|
-
export default meta;
|
|
29
|
-
type Story = StoryObj<typeof meta>;
|
|
30
|
-
|
|
31
|
-
// Canvas with multi-directional connections and rich metadata
|
|
32
|
-
const multiDirectionalCanvas: ExtendedCanvas = {
|
|
33
|
-
nodes: [
|
|
34
|
-
{
|
|
35
|
-
id: 'gateway-1',
|
|
36
|
-
type: 'text',
|
|
37
|
-
x: 400,
|
|
38
|
-
y: 50,
|
|
39
|
-
width: 100,
|
|
40
|
-
height: 100,
|
|
41
|
-
text: 'API Gateway',
|
|
42
|
-
color: '#06B6D4',
|
|
43
|
-
pv: {
|
|
44
|
-
nodeType: 'gateway',
|
|
45
|
-
shape: 'diamond',
|
|
46
|
-
icon: 'Network',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
id: 'service-1',
|
|
51
|
-
type: 'text',
|
|
52
|
-
x: 200,
|
|
53
|
-
y: 200,
|
|
54
|
-
width: 140,
|
|
55
|
-
height: 80,
|
|
56
|
-
text: 'Auth Service',
|
|
57
|
-
color: '#4A90E2',
|
|
58
|
-
pv: {
|
|
59
|
-
nodeType: 'service',
|
|
60
|
-
shape: 'rectangle',
|
|
61
|
-
icon: 'Server',
|
|
62
|
-
states: {
|
|
63
|
-
active: { color: '#22C55E', label: 'Active' },
|
|
64
|
-
idle: { color: '#EAB308', label: 'Idle' },
|
|
65
|
-
error: { color: '#EF4444', label: 'Error' },
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
id: 'service-2',
|
|
71
|
-
type: 'text',
|
|
72
|
-
x: 600,
|
|
73
|
-
y: 200,
|
|
74
|
-
width: 140,
|
|
75
|
-
height: 80,
|
|
76
|
-
text: 'API Service',
|
|
77
|
-
color: '#4A90E2',
|
|
78
|
-
pv: {
|
|
79
|
-
nodeType: 'service',
|
|
80
|
-
shape: 'rectangle',
|
|
81
|
-
icon: 'Server',
|
|
82
|
-
states: {
|
|
83
|
-
active: { color: '#22C55E', label: 'Active' },
|
|
84
|
-
idle: { color: '#EAB308', label: 'Idle' },
|
|
85
|
-
error: { color: '#EF4444', label: 'Error' },
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: 'cache-1',
|
|
91
|
-
type: 'text',
|
|
92
|
-
x: 100,
|
|
93
|
-
y: 400,
|
|
94
|
-
width: 120,
|
|
95
|
-
height: 100,
|
|
96
|
-
text: 'Redis Cache',
|
|
97
|
-
color: '#F59E0B',
|
|
98
|
-
pv: {
|
|
99
|
-
nodeType: 'cache',
|
|
100
|
-
shape: 'hexagon',
|
|
101
|
-
icon: 'Zap',
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
id: 'database-1',
|
|
106
|
-
type: 'text',
|
|
107
|
-
x: 400,
|
|
108
|
-
y: 400,
|
|
109
|
-
width: 100,
|
|
110
|
-
height: 100,
|
|
111
|
-
text: 'PostgreSQL',
|
|
112
|
-
color: '#7B68EE',
|
|
113
|
-
pv: {
|
|
114
|
-
nodeType: 'database',
|
|
115
|
-
shape: 'circle',
|
|
116
|
-
icon: 'Database',
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
id: 'service-3',
|
|
121
|
-
type: 'text',
|
|
122
|
-
x: 700,
|
|
123
|
-
y: 400,
|
|
124
|
-
width: 140,
|
|
125
|
-
height: 80,
|
|
126
|
-
text: 'Notification Service',
|
|
127
|
-
color: '#4A90E2',
|
|
128
|
-
pv: {
|
|
129
|
-
nodeType: 'service',
|
|
130
|
-
shape: 'rectangle',
|
|
131
|
-
icon: 'Bell',
|
|
132
|
-
states: {
|
|
133
|
-
active: { color: '#22C55E', label: 'Active' },
|
|
134
|
-
idle: { color: '#EAB308', label: 'Idle' },
|
|
135
|
-
error: { color: '#EF4444', label: 'Error' },
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
edges: [
|
|
141
|
-
// From top to services (top -> bottom connections)
|
|
142
|
-
{
|
|
143
|
-
id: 'edge-1',
|
|
144
|
-
fromNode: 'gateway-1',
|
|
145
|
-
toNode: 'service-1',
|
|
146
|
-
fromSide: 'bottom',
|
|
147
|
-
toSide: 'top',
|
|
148
|
-
label: 'POST /auth/login',
|
|
149
|
-
pv: { edgeType: 'http' },
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
id: 'edge-2',
|
|
153
|
-
fromNode: 'gateway-1',
|
|
154
|
-
toNode: 'service-2',
|
|
155
|
-
fromSide: 'bottom',
|
|
156
|
-
toSide: 'top',
|
|
157
|
-
label: 'GET /api/users',
|
|
158
|
-
pv: { edgeType: 'http' },
|
|
159
|
-
},
|
|
160
|
-
// Horizontal connections (left <-> right)
|
|
161
|
-
{
|
|
162
|
-
id: 'edge-3',
|
|
163
|
-
fromNode: 'service-1',
|
|
164
|
-
toNode: 'service-2',
|
|
165
|
-
fromSide: 'right',
|
|
166
|
-
toSide: 'left',
|
|
167
|
-
label: '/internal/validate',
|
|
168
|
-
pv: { edgeType: 'http' },
|
|
169
|
-
},
|
|
170
|
-
// Services to data layer
|
|
171
|
-
{
|
|
172
|
-
id: 'edge-4',
|
|
173
|
-
fromNode: 'service-1',
|
|
174
|
-
toNode: 'cache-1',
|
|
175
|
-
fromSide: 'bottom',
|
|
176
|
-
toSide: 'top',
|
|
177
|
-
label: 'GET',
|
|
178
|
-
pv: { edgeType: 'cache_access' },
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
id: 'edge-5',
|
|
182
|
-
fromNode: 'service-1',
|
|
183
|
-
toNode: 'database-1',
|
|
184
|
-
fromSide: 'bottom',
|
|
185
|
-
toSide: 'top',
|
|
186
|
-
label: 'SELECT users',
|
|
187
|
-
pv: { edgeType: 'database_query' },
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
id: 'edge-6',
|
|
191
|
-
fromNode: 'service-2',
|
|
192
|
-
toNode: 'database-1',
|
|
193
|
-
fromSide: 'bottom',
|
|
194
|
-
toSide: 'top',
|
|
195
|
-
label: 'UPDATE sessions',
|
|
196
|
-
pv: { edgeType: 'database_query' },
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
id: 'edge-7',
|
|
200
|
-
fromNode: 'service-2',
|
|
201
|
-
toNode: 'service-3',
|
|
202
|
-
fromSide: 'right',
|
|
203
|
-
toSide: 'left',
|
|
204
|
-
label: 'POST /notify',
|
|
205
|
-
pv: { edgeType: 'http' },
|
|
206
|
-
},
|
|
207
|
-
// Cache to database (horizontal)
|
|
208
|
-
{
|
|
209
|
-
id: 'edge-8',
|
|
210
|
-
fromNode: 'cache-1',
|
|
211
|
-
toNode: 'database-1',
|
|
212
|
-
fromSide: 'right',
|
|
213
|
-
toSide: 'left',
|
|
214
|
-
label: 'cache miss',
|
|
215
|
-
pv: { edgeType: 'database_query' },
|
|
216
|
-
},
|
|
217
|
-
],
|
|
218
|
-
pv: {
|
|
219
|
-
version: '1.0.0',
|
|
220
|
-
name: 'Multi-Directional Connection Demo',
|
|
221
|
-
description: 'Showcasing edges connecting from all sides with rich metadata',
|
|
222
|
-
edgeTypes: {
|
|
223
|
-
http: {
|
|
224
|
-
style: 'solid',
|
|
225
|
-
color: '#22C55E',
|
|
226
|
-
width: 2,
|
|
227
|
-
directed: true,
|
|
228
|
-
},
|
|
229
|
-
database_query: {
|
|
230
|
-
style: 'dashed',
|
|
231
|
-
color: '#7B68EE',
|
|
232
|
-
width: 2,
|
|
233
|
-
directed: true,
|
|
234
|
-
},
|
|
235
|
-
cache_access: {
|
|
236
|
-
style: 'dotted',
|
|
237
|
-
color: '#F59E0B',
|
|
238
|
-
width: 2,
|
|
239
|
-
directed: true,
|
|
240
|
-
},
|
|
241
|
-
websocket: {
|
|
242
|
-
style: 'animated',
|
|
243
|
-
color: '#06B6D4',
|
|
244
|
-
width: 3,
|
|
245
|
-
directed: false,
|
|
246
|
-
},
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
// Canvas with violation highlighting
|
|
252
|
-
const canvasWithViolations: ExtendedCanvas = {
|
|
253
|
-
...multiDirectionalCanvas,
|
|
254
|
-
pv: {
|
|
255
|
-
...multiDirectionalCanvas.pv!,
|
|
256
|
-
name: 'Connection Demo with Violations',
|
|
257
|
-
},
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
// Minimal view canvas
|
|
261
|
-
const minimalCanvas: ExtendedCanvas = {
|
|
262
|
-
nodes: multiDirectionalCanvas.nodes!.slice(0, 4),
|
|
263
|
-
edges: multiDirectionalCanvas.edges!.slice(0, 4),
|
|
264
|
-
pv: {
|
|
265
|
-
...multiDirectionalCanvas.pv!,
|
|
266
|
-
name: 'Minimal View',
|
|
267
|
-
},
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
// Complex mesh with additional gateway
|
|
271
|
-
const complexMeshCanvas: ExtendedCanvas = {
|
|
272
|
-
nodes: [
|
|
273
|
-
...multiDirectionalCanvas.nodes!,
|
|
274
|
-
{
|
|
275
|
-
id: 'gateway-2',
|
|
276
|
-
type: 'text',
|
|
277
|
-
x: 400,
|
|
278
|
-
y: 600,
|
|
279
|
-
width: 100,
|
|
280
|
-
height: 100,
|
|
281
|
-
text: 'Internal Gateway',
|
|
282
|
-
color: '#06B6D4',
|
|
283
|
-
pv: {
|
|
284
|
-
nodeType: 'gateway',
|
|
285
|
-
shape: 'diamond',
|
|
286
|
-
icon: 'Network',
|
|
287
|
-
},
|
|
288
|
-
},
|
|
289
|
-
],
|
|
290
|
-
edges: [
|
|
291
|
-
...multiDirectionalCanvas.edges!,
|
|
292
|
-
{
|
|
293
|
-
id: 'edge-9',
|
|
294
|
-
fromNode: 'database-1',
|
|
295
|
-
toNode: 'gateway-2',
|
|
296
|
-
fromSide: 'bottom',
|
|
297
|
-
toSide: 'top',
|
|
298
|
-
label: 'wss',
|
|
299
|
-
pv: { edgeType: 'websocket' },
|
|
300
|
-
},
|
|
301
|
-
],
|
|
302
|
-
pv: {
|
|
303
|
-
...multiDirectionalCanvas.pv!,
|
|
304
|
-
name: 'Complex Mesh',
|
|
305
|
-
},
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
export const Default: Story = {
|
|
309
|
-
args: {
|
|
310
|
-
canvas: multiDirectionalCanvas,
|
|
311
|
-
width: '100%',
|
|
312
|
-
height: '800px',
|
|
313
|
-
showControls: true,
|
|
314
|
-
showBackground: true,
|
|
315
|
-
},
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
export const WithViolations: Story = {
|
|
319
|
-
args: {
|
|
320
|
-
canvas: canvasWithViolations,
|
|
321
|
-
violations: [
|
|
322
|
-
{
|
|
323
|
-
id: 'v1',
|
|
324
|
-
severity: 'error',
|
|
325
|
-
type: 'connection',
|
|
326
|
-
description: 'Unauthorized connection detected',
|
|
327
|
-
context: { edgeId: 'edge-3' },
|
|
328
|
-
},
|
|
329
|
-
],
|
|
330
|
-
width: '100%',
|
|
331
|
-
height: '800px',
|
|
332
|
-
},
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
export const MinimalView: Story = {
|
|
336
|
-
args: {
|
|
337
|
-
canvas: minimalCanvas,
|
|
338
|
-
width: '100%',
|
|
339
|
-
height: '600px',
|
|
340
|
-
showMinimap: false,
|
|
341
|
-
showControls: true,
|
|
342
|
-
showBackground: true,
|
|
343
|
-
},
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
export const ComplexMesh: Story = {
|
|
347
|
-
args: {
|
|
348
|
-
canvas: complexMeshCanvas,
|
|
349
|
-
width: '100%',
|
|
350
|
-
height: '900px',
|
|
351
|
-
},
|
|
352
|
-
};
|