@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.
- 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/package.json +2 -2
- package/src/index.ts +9 -199
- 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,560 +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: 'Nodes/NodeDefinitionComparison',
|
|
9
|
-
component: GraphRenderer,
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'fullscreen',
|
|
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
|
-
/**
|
|
27
|
-
* Component that shows node definition JSON alongside the rendered node
|
|
28
|
-
*/
|
|
29
|
-
const SideBySideComparison: React.FC<{
|
|
30
|
-
title: string;
|
|
31
|
-
nodeDefinition: Record<string, unknown>;
|
|
32
|
-
canvas: ExtendedCanvas;
|
|
33
|
-
description?: string;
|
|
34
|
-
}> = ({ title, nodeDefinition, canvas, description }) => {
|
|
35
|
-
const theme = defaultEditorTheme;
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div style={{ padding: '24px', fontFamily: theme.fonts.body }}>
|
|
39
|
-
<h2 style={{
|
|
40
|
-
marginBottom: '8px',
|
|
41
|
-
fontFamily: theme.fonts.heading,
|
|
42
|
-
fontSize: theme.fontSizes[5],
|
|
43
|
-
color: theme.colors.text,
|
|
44
|
-
}}>
|
|
45
|
-
{title}
|
|
46
|
-
</h2>
|
|
47
|
-
{description && (
|
|
48
|
-
<p style={{
|
|
49
|
-
marginBottom: '24px',
|
|
50
|
-
fontSize: theme.fontSizes[1],
|
|
51
|
-
color: theme.colors.textSecondary,
|
|
52
|
-
}}>
|
|
53
|
-
{description}
|
|
54
|
-
</p>
|
|
55
|
-
)}
|
|
56
|
-
<div style={{
|
|
57
|
-
display: 'grid',
|
|
58
|
-
gridTemplateColumns: '1fr 1fr',
|
|
59
|
-
gap: '24px',
|
|
60
|
-
alignItems: 'start',
|
|
61
|
-
}}>
|
|
62
|
-
{/* Left side - JSON Definition */}
|
|
63
|
-
<div>
|
|
64
|
-
<h3 style={{
|
|
65
|
-
marginBottom: '12px',
|
|
66
|
-
fontSize: theme.fontSizes[2],
|
|
67
|
-
fontWeight: theme.fontWeights.semibold,
|
|
68
|
-
color: theme.colors.textSecondary,
|
|
69
|
-
}}>
|
|
70
|
-
Node Definition (JSON)
|
|
71
|
-
</h3>
|
|
72
|
-
<pre style={{
|
|
73
|
-
backgroundColor: theme.colors.surface,
|
|
74
|
-
border: `1px solid ${theme.colors.border}`,
|
|
75
|
-
borderRadius: '8px',
|
|
76
|
-
padding: '16px',
|
|
77
|
-
fontSize: theme.fontSizes[1],
|
|
78
|
-
fontFamily: theme.fonts.monospace,
|
|
79
|
-
color: theme.colors.text,
|
|
80
|
-
overflow: 'auto',
|
|
81
|
-
maxHeight: '600px',
|
|
82
|
-
lineHeight: 1.5,
|
|
83
|
-
}}>
|
|
84
|
-
{JSON.stringify(nodeDefinition, null, 2)}
|
|
85
|
-
</pre>
|
|
86
|
-
<div style={{
|
|
87
|
-
marginTop: '12px',
|
|
88
|
-
padding: '12px',
|
|
89
|
-
backgroundColor: theme.colors.backgroundSecondary,
|
|
90
|
-
border: `1px solid ${theme.colors.border}`,
|
|
91
|
-
borderRadius: '6px',
|
|
92
|
-
fontSize: theme.fontSizes[0],
|
|
93
|
-
color: theme.colors.textMuted,
|
|
94
|
-
fontFamily: theme.fonts.monospace,
|
|
95
|
-
}}>
|
|
96
|
-
<div><strong>Font Size:</strong> {theme.fontSizes[0]}px (theme.fontSizes[0])</div>
|
|
97
|
-
<div><strong>Font Family:</strong> {theme.fonts.body}</div>
|
|
98
|
-
<div><strong>Font Weight:</strong> {theme.fontWeights.medium} (medium)</div>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
|
|
102
|
-
{/* Right side - Rendered Output */}
|
|
103
|
-
<div>
|
|
104
|
-
<h3 style={{
|
|
105
|
-
marginBottom: '12px',
|
|
106
|
-
fontSize: theme.fontSizes[2],
|
|
107
|
-
fontWeight: theme.fontWeights.semibold,
|
|
108
|
-
color: theme.colors.textSecondary,
|
|
109
|
-
}}>
|
|
110
|
-
Rendered Node
|
|
111
|
-
</h3>
|
|
112
|
-
<div style={{
|
|
113
|
-
backgroundColor: theme.colors.background,
|
|
114
|
-
border: `2px solid ${theme.colors.border}`,
|
|
115
|
-
borderRadius: '8px',
|
|
116
|
-
padding: '24px',
|
|
117
|
-
minHeight: '400px',
|
|
118
|
-
}}>
|
|
119
|
-
<GraphRenderer
|
|
120
|
-
canvas={canvas}
|
|
121
|
-
height={400}
|
|
122
|
-
width="100%"
|
|
123
|
-
/>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Shows a basic OTEL event node definition alongside its rendered output
|
|
133
|
-
*/
|
|
134
|
-
export const BasicOtelEventNode: Story = {
|
|
135
|
-
render: () => {
|
|
136
|
-
const nodeDefinition = {
|
|
137
|
-
id: "analysis-started",
|
|
138
|
-
type: "text",
|
|
139
|
-
text: "Analysis Started",
|
|
140
|
-
x: 200,
|
|
141
|
-
y: 150,
|
|
142
|
-
width: 200,
|
|
143
|
-
height: 100,
|
|
144
|
-
color: "#4CAF50",
|
|
145
|
-
pv: {
|
|
146
|
-
name: "Analysis Started",
|
|
147
|
-
description: "Codebase composition analysis begins",
|
|
148
|
-
shape: "roundedRect",
|
|
149
|
-
icon: "Play",
|
|
150
|
-
otel: {
|
|
151
|
-
kind: "event",
|
|
152
|
-
category: "lifecycle"
|
|
153
|
-
},
|
|
154
|
-
event: {
|
|
155
|
-
name: "analysis.started",
|
|
156
|
-
attributes: {
|
|
157
|
-
"repository.path": {
|
|
158
|
-
type: "string",
|
|
159
|
-
description: "Repository root path",
|
|
160
|
-
required: true
|
|
161
|
-
},
|
|
162
|
-
"analysis.type": {
|
|
163
|
-
type: "string",
|
|
164
|
-
description: "Type of analysis (discovery, validation, full)",
|
|
165
|
-
required: true
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
sources: [
|
|
170
|
-
"packages/subsystems-core/src/discovery/CanvasDiscovery.ts",
|
|
171
|
-
"packages/principal-studio-cli/src/commands/validate.ts"
|
|
172
|
-
]
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
const canvas: ExtendedCanvas = {
|
|
177
|
-
nodes: [nodeDefinition],
|
|
178
|
-
edges: [],
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
return (
|
|
182
|
-
<SideBySideComparison
|
|
183
|
-
title="OTEL Event Node with Sources"
|
|
184
|
-
description="This shows how an OTEL event node is defined in JSON (left) and how it renders in the graph (right). Note the 12px font size for the node name."
|
|
185
|
-
nodeDefinition={nodeDefinition}
|
|
186
|
-
canvas={canvas}
|
|
187
|
-
/>
|
|
188
|
-
);
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Shows different node shapes and their definitions
|
|
194
|
-
*/
|
|
195
|
-
export const NodeShapeComparison: Story = {
|
|
196
|
-
render: () => {
|
|
197
|
-
const nodeDefinitions = [
|
|
198
|
-
{
|
|
199
|
-
id: "circle-node",
|
|
200
|
-
type: "text",
|
|
201
|
-
text: "Circle Shape",
|
|
202
|
-
x: 100,
|
|
203
|
-
y: 150,
|
|
204
|
-
width: 120,
|
|
205
|
-
height: 120,
|
|
206
|
-
color: "#2196F3",
|
|
207
|
-
pv: {
|
|
208
|
-
name: "Circle Node",
|
|
209
|
-
description: "A circular node",
|
|
210
|
-
shape: "circle",
|
|
211
|
-
icon: "Circle",
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
id: "hexagon-node",
|
|
216
|
-
type: "text",
|
|
217
|
-
text: "Hexagon Shape",
|
|
218
|
-
x: 300,
|
|
219
|
-
y: 150,
|
|
220
|
-
width: 140,
|
|
221
|
-
height: 140,
|
|
222
|
-
color: "#FF9800",
|
|
223
|
-
pv: {
|
|
224
|
-
name: "Hexagon Node",
|
|
225
|
-
description: "A hexagonal node",
|
|
226
|
-
shape: "hexagon",
|
|
227
|
-
icon: "Hexagon",
|
|
228
|
-
}
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
id: "diamond-node",
|
|
232
|
-
type: "text",
|
|
233
|
-
text: "Diamond Shape",
|
|
234
|
-
x: 520,
|
|
235
|
-
y: 150,
|
|
236
|
-
width: 100,
|
|
237
|
-
height: 100,
|
|
238
|
-
color: "#9C27B0",
|
|
239
|
-
pv: {
|
|
240
|
-
name: "Diamond Node",
|
|
241
|
-
description: "A diamond node",
|
|
242
|
-
shape: "diamond",
|
|
243
|
-
icon: "Diamond",
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
];
|
|
247
|
-
|
|
248
|
-
const canvas: ExtendedCanvas = {
|
|
249
|
-
nodes: nodeDefinitions,
|
|
250
|
-
edges: [],
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
return (
|
|
254
|
-
<div style={{ padding: '24px' }}>
|
|
255
|
-
<h2 style={{
|
|
256
|
-
marginBottom: '24px',
|
|
257
|
-
fontFamily: defaultEditorTheme.fonts.heading,
|
|
258
|
-
fontSize: defaultEditorTheme.fontSizes[6],
|
|
259
|
-
color: defaultEditorTheme.colors.text,
|
|
260
|
-
}}>
|
|
261
|
-
Multiple Node Shapes - Definition vs Rendering
|
|
262
|
-
</h2>
|
|
263
|
-
<div style={{
|
|
264
|
-
display: 'grid',
|
|
265
|
-
gridTemplateColumns: '1fr 1fr',
|
|
266
|
-
gap: '24px',
|
|
267
|
-
}}>
|
|
268
|
-
{/* Left side - All JSON Definitions */}
|
|
269
|
-
<div>
|
|
270
|
-
<h3 style={{
|
|
271
|
-
marginBottom: '12px',
|
|
272
|
-
fontSize: defaultEditorTheme.fontSizes[2],
|
|
273
|
-
fontWeight: defaultEditorTheme.fontWeights.semibold,
|
|
274
|
-
color: defaultEditorTheme.colors.textSecondary,
|
|
275
|
-
}}>
|
|
276
|
-
Node Definitions (JSON Array)
|
|
277
|
-
</h3>
|
|
278
|
-
<pre style={{
|
|
279
|
-
backgroundColor: defaultEditorTheme.colors.surface,
|
|
280
|
-
border: `1px solid ${defaultEditorTheme.colors.border}`,
|
|
281
|
-
borderRadius: '8px',
|
|
282
|
-
padding: '16px',
|
|
283
|
-
fontSize: defaultEditorTheme.fontSizes[0],
|
|
284
|
-
fontFamily: defaultEditorTheme.fonts.monospace,
|
|
285
|
-
color: defaultEditorTheme.colors.text,
|
|
286
|
-
overflow: 'auto',
|
|
287
|
-
maxHeight: '800px',
|
|
288
|
-
lineHeight: 1.5,
|
|
289
|
-
}}>
|
|
290
|
-
{JSON.stringify(nodeDefinitions, null, 2)}
|
|
291
|
-
</pre>
|
|
292
|
-
</div>
|
|
293
|
-
|
|
294
|
-
{/* Right side - Rendered Output */}
|
|
295
|
-
<div>
|
|
296
|
-
<h3 style={{
|
|
297
|
-
marginBottom: '12px',
|
|
298
|
-
fontSize: defaultEditorTheme.fontSizes[2],
|
|
299
|
-
fontWeight: defaultEditorTheme.fontWeights.semibold,
|
|
300
|
-
color: defaultEditorTheme.colors.textSecondary,
|
|
301
|
-
}}>
|
|
302
|
-
Rendered Nodes
|
|
303
|
-
</h3>
|
|
304
|
-
<div style={{
|
|
305
|
-
backgroundColor: defaultEditorTheme.colors.background,
|
|
306
|
-
border: `2px solid ${defaultEditorTheme.colors.border}`,
|
|
307
|
-
borderRadius: '8px',
|
|
308
|
-
padding: '24px',
|
|
309
|
-
height: '800px',
|
|
310
|
-
}}>
|
|
311
|
-
<GraphRenderer
|
|
312
|
-
canvas={canvas}
|
|
313
|
-
height={800}
|
|
314
|
-
width="100%"
|
|
315
|
-
/>
|
|
316
|
-
</div>
|
|
317
|
-
</div>
|
|
318
|
-
</div>
|
|
319
|
-
</div>
|
|
320
|
-
);
|
|
321
|
-
},
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Shows node with state and violations
|
|
326
|
-
*/
|
|
327
|
-
export const NodeWithStateAndViolations: Story = {
|
|
328
|
-
render: () => {
|
|
329
|
-
const nodeDefinition = {
|
|
330
|
-
id: "validation-error",
|
|
331
|
-
type: "text",
|
|
332
|
-
text: "Validation Error",
|
|
333
|
-
x: 200,
|
|
334
|
-
y: 150,
|
|
335
|
-
width: 200,
|
|
336
|
-
height: 100,
|
|
337
|
-
color: "#F44336",
|
|
338
|
-
pv: {
|
|
339
|
-
name: "Validation Error",
|
|
340
|
-
description: "Validation failed with errors",
|
|
341
|
-
shape: "roundedRect",
|
|
342
|
-
icon: "XCircle",
|
|
343
|
-
otel: {
|
|
344
|
-
kind: "event",
|
|
345
|
-
category: "error"
|
|
346
|
-
},
|
|
347
|
-
event: {
|
|
348
|
-
name: "validation.error",
|
|
349
|
-
attributes: {
|
|
350
|
-
"error.type": {
|
|
351
|
-
type: "string",
|
|
352
|
-
description: "Error type (parse, schema, reference, structure)",
|
|
353
|
-
required: true
|
|
354
|
-
},
|
|
355
|
-
"error.message": {
|
|
356
|
-
type: "string",
|
|
357
|
-
description: "Error message",
|
|
358
|
-
required: true
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
|
-
sources: [
|
|
363
|
-
"packages/principal-studio-cli/src/commands/validate.ts",
|
|
364
|
-
"packages/subsystems-core/src/ConfigurationValidator.ts"
|
|
365
|
-
]
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
const canvas: ExtendedCanvas = {
|
|
370
|
-
nodes: [nodeDefinition],
|
|
371
|
-
edges: [],
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
return (
|
|
375
|
-
<SideBySideComparison
|
|
376
|
-
title="OTEL Event Node - Error State"
|
|
377
|
-
description="Shows an error event node with OTEL metadata and source file badges. The red color (#F44336) is used for error states."
|
|
378
|
-
nodeDefinition={nodeDefinition}
|
|
379
|
-
canvas={canvas}
|
|
380
|
-
/>
|
|
381
|
-
);
|
|
382
|
-
},
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Shows the complete workflow nodes from validation.otel.canvas
|
|
387
|
-
*/
|
|
388
|
-
export const ValidationWorkflowNodes: Story = {
|
|
389
|
-
render: () => {
|
|
390
|
-
const workflowNodes = [
|
|
391
|
-
{
|
|
392
|
-
id: "analysis-started",
|
|
393
|
-
type: "text",
|
|
394
|
-
text: "Analysis Started",
|
|
395
|
-
x: 100,
|
|
396
|
-
y: 50,
|
|
397
|
-
width: 200,
|
|
398
|
-
height: 100,
|
|
399
|
-
color: "#4CAF50",
|
|
400
|
-
pv: {
|
|
401
|
-
name: "Analysis Started",
|
|
402
|
-
shape: "roundedRect",
|
|
403
|
-
icon: "Play",
|
|
404
|
-
otel: { kind: "event", category: "lifecycle" }
|
|
405
|
-
}
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
id: "file-parsed",
|
|
409
|
-
type: "text",
|
|
410
|
-
text: "File Parsed",
|
|
411
|
-
x: 100,
|
|
412
|
-
y: 200,
|
|
413
|
-
width: 200,
|
|
414
|
-
height: 100,
|
|
415
|
-
color: "#2196F3",
|
|
416
|
-
pv: {
|
|
417
|
-
name: "File Parsed",
|
|
418
|
-
shape: "roundedRect",
|
|
419
|
-
icon: "FileJson",
|
|
420
|
-
otel: { kind: "event", category: "operation" }
|
|
421
|
-
}
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
id: "canvas-validated",
|
|
425
|
-
type: "text",
|
|
426
|
-
text: "Canvas Validated",
|
|
427
|
-
x: 350,
|
|
428
|
-
y: 200,
|
|
429
|
-
width: 200,
|
|
430
|
-
height: 100,
|
|
431
|
-
color: "#9C27B0",
|
|
432
|
-
pv: {
|
|
433
|
-
name: "Canvas Validated",
|
|
434
|
-
shape: "roundedRect",
|
|
435
|
-
icon: "CheckSquare",
|
|
436
|
-
otel: { kind: "event", category: "operation" }
|
|
437
|
-
}
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
id: "validation-complete",
|
|
441
|
-
type: "text",
|
|
442
|
-
text: "Validation Complete",
|
|
443
|
-
x: 100,
|
|
444
|
-
y: 350,
|
|
445
|
-
width: 200,
|
|
446
|
-
height: 100,
|
|
447
|
-
color: "#4CAF50",
|
|
448
|
-
pv: {
|
|
449
|
-
name: "Validation Complete",
|
|
450
|
-
shape: "roundedRect",
|
|
451
|
-
icon: "CheckCircle2",
|
|
452
|
-
otel: { kind: "event", category: "lifecycle" }
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
];
|
|
456
|
-
|
|
457
|
-
const canvas: ExtendedCanvas = {
|
|
458
|
-
nodes: workflowNodes,
|
|
459
|
-
edges: [
|
|
460
|
-
{
|
|
461
|
-
id: "start-to-parse",
|
|
462
|
-
fromNode: "analysis-started",
|
|
463
|
-
toNode: "file-parsed",
|
|
464
|
-
fromSide: "bottom",
|
|
465
|
-
toSide: "top"
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
id: "parse-to-validate",
|
|
469
|
-
fromNode: "file-parsed",
|
|
470
|
-
toNode: "canvas-validated",
|
|
471
|
-
fromSide: "right",
|
|
472
|
-
toSide: "left"
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
id: "validate-to-complete",
|
|
476
|
-
fromNode: "file-parsed",
|
|
477
|
-
toNode: "validation-complete",
|
|
478
|
-
fromSide: "bottom",
|
|
479
|
-
toSide: "top"
|
|
480
|
-
}
|
|
481
|
-
],
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
return (
|
|
485
|
-
<div style={{ padding: '24px' }}>
|
|
486
|
-
<h2 style={{
|
|
487
|
-
marginBottom: '24px',
|
|
488
|
-
fontFamily: defaultEditorTheme.fonts.heading,
|
|
489
|
-
fontSize: defaultEditorTheme.fontSizes[6],
|
|
490
|
-
color: defaultEditorTheme.colors.text,
|
|
491
|
-
}}>
|
|
492
|
-
Validation Workflow - OTEL Events
|
|
493
|
-
</h2>
|
|
494
|
-
<p style={{
|
|
495
|
-
marginBottom: '24px',
|
|
496
|
-
fontSize: defaultEditorTheme.fontSizes[1],
|
|
497
|
-
color: defaultEditorTheme.colors.textSecondary,
|
|
498
|
-
}}>
|
|
499
|
-
Example from validation.otel.canvas showing how lifecycle and operation events are defined and rendered.
|
|
500
|
-
</p>
|
|
501
|
-
<div style={{
|
|
502
|
-
display: 'grid',
|
|
503
|
-
gridTemplateColumns: '1fr 1fr',
|
|
504
|
-
gap: '24px',
|
|
505
|
-
}}>
|
|
506
|
-
{/* Left side - JSON */}
|
|
507
|
-
<div>
|
|
508
|
-
<h3 style={{
|
|
509
|
-
marginBottom: '12px',
|
|
510
|
-
fontSize: defaultEditorTheme.fontSizes[2],
|
|
511
|
-
fontWeight: defaultEditorTheme.fontWeights.semibold,
|
|
512
|
-
color: defaultEditorTheme.colors.textSecondary,
|
|
513
|
-
}}>
|
|
514
|
-
Workflow Node Definitions
|
|
515
|
-
</h3>
|
|
516
|
-
<pre style={{
|
|
517
|
-
backgroundColor: defaultEditorTheme.colors.surface,
|
|
518
|
-
border: `1px solid ${defaultEditorTheme.colors.border}`,
|
|
519
|
-
borderRadius: '8px',
|
|
520
|
-
padding: '16px',
|
|
521
|
-
fontSize: defaultEditorTheme.fontSizes[0],
|
|
522
|
-
fontFamily: defaultEditorTheme.fonts.monospace,
|
|
523
|
-
color: defaultEditorTheme.colors.text,
|
|
524
|
-
overflow: 'auto',
|
|
525
|
-
maxHeight: '700px',
|
|
526
|
-
lineHeight: 1.5,
|
|
527
|
-
}}>
|
|
528
|
-
{JSON.stringify({ nodes: workflowNodes, edges: canvas.edges }, null, 2)}
|
|
529
|
-
</pre>
|
|
530
|
-
</div>
|
|
531
|
-
|
|
532
|
-
{/* Right side - Rendered */}
|
|
533
|
-
<div>
|
|
534
|
-
<h3 style={{
|
|
535
|
-
marginBottom: '12px',
|
|
536
|
-
fontSize: defaultEditorTheme.fontSizes[2],
|
|
537
|
-
fontWeight: defaultEditorTheme.fontWeights.semibold,
|
|
538
|
-
color: defaultEditorTheme.colors.textSecondary,
|
|
539
|
-
}}>
|
|
540
|
-
Rendered Workflow Graph
|
|
541
|
-
</h3>
|
|
542
|
-
<div style={{
|
|
543
|
-
backgroundColor: defaultEditorTheme.colors.background,
|
|
544
|
-
border: `2px solid ${defaultEditorTheme.colors.border}`,
|
|
545
|
-
borderRadius: '8px',
|
|
546
|
-
padding: '24px',
|
|
547
|
-
height: '700px',
|
|
548
|
-
}}>
|
|
549
|
-
<GraphRenderer
|
|
550
|
-
canvas={canvas}
|
|
551
|
-
height={700}
|
|
552
|
-
width="100%"
|
|
553
|
-
/>
|
|
554
|
-
</div>
|
|
555
|
-
</div>
|
|
556
|
-
</div>
|
|
557
|
-
</div>
|
|
558
|
-
);
|
|
559
|
-
},
|
|
560
|
-
};
|