@principal-ai/subsystems-react 0.17.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 +93 -0
- package/dist/components/ConfigurationSelector.d.ts +35 -0
- package/dist/components/ConfigurationSelector.d.ts.map +1 -0
- package/dist/components/ConfigurationSelector.js +63 -0
- package/dist/components/ConfigurationSelector.js.map +1 -0
- package/dist/components/GraphRenderer.d.ts +295 -0
- package/dist/components/GraphRenderer.d.ts.map +1 -0
- package/dist/components/GraphRenderer.js +2008 -0
- package/dist/components/GraphRenderer.js.map +1 -0
- package/dist/components/MultiCanvasRenderer.d.ts +75 -0
- package/dist/components/MultiCanvasRenderer.d.ts.map +1 -0
- package/dist/components/MultiCanvasRenderer.js +203 -0
- package/dist/components/MultiCanvasRenderer.js.map +1 -0
- package/dist/components/NodeTooltip.d.ts +24 -0
- package/dist/components/NodeTooltip.d.ts.map +1 -0
- package/dist/components/NodeTooltip.js +160 -0
- package/dist/components/NodeTooltip.js.map +1 -0
- package/dist/components/SelectionSidebar.d.ts +18 -0
- package/dist/components/SelectionSidebar.d.ts.map +1 -0
- package/dist/components/SelectionSidebar.js +190 -0
- package/dist/components/SelectionSidebar.js.map +1 -0
- package/dist/components/SequenceDiagramRenderer.d.ts +77 -0
- package/dist/components/SequenceDiagramRenderer.d.ts.map +1 -0
- package/dist/components/SequenceDiagramRenderer.js +604 -0
- package/dist/components/SequenceDiagramRenderer.js.map +1 -0
- package/dist/components/WorkflowSequenceDiagram.d.ts +63 -0
- package/dist/components/WorkflowSequenceDiagram.d.ts.map +1 -0
- package/dist/components/WorkflowSequenceDiagram.js +147 -0
- package/dist/components/WorkflowSequenceDiagram.js.map +1 -0
- package/dist/components/dashboard/DashboardRenderer.d.ts +10 -0
- package/dist/components/dashboard/DashboardRenderer.d.ts.map +1 -0
- package/dist/components/dashboard/DashboardRenderer.js +179 -0
- package/dist/components/dashboard/DashboardRenderer.js.map +1 -0
- package/dist/components/dashboard/MetricPanel.d.ts +10 -0
- package/dist/components/dashboard/MetricPanel.d.ts.map +1 -0
- package/dist/components/dashboard/MetricPanel.js +103 -0
- package/dist/components/dashboard/MetricPanel.js.map +1 -0
- package/dist/components/dashboard/MockDataProvider.d.ts +30 -0
- package/dist/components/dashboard/MockDataProvider.d.ts.map +1 -0
- package/dist/components/dashboard/MockDataProvider.js +270 -0
- package/dist/components/dashboard/MockDataProvider.js.map +1 -0
- package/dist/components/dashboard/components/BarChart.d.ts +10 -0
- package/dist/components/dashboard/components/BarChart.d.ts.map +1 -0
- package/dist/components/dashboard/components/BarChart.js +167 -0
- package/dist/components/dashboard/components/BarChart.js.map +1 -0
- package/dist/components/dashboard/components/LineChart.d.ts +10 -0
- package/dist/components/dashboard/components/LineChart.d.ts.map +1 -0
- package/dist/components/dashboard/components/LineChart.js +141 -0
- package/dist/components/dashboard/components/LineChart.js.map +1 -0
- package/dist/components/dashboard/components/MetricCard.d.ts +9 -0
- package/dist/components/dashboard/components/MetricCard.d.ts.map +1 -0
- package/dist/components/dashboard/components/MetricCard.js +163 -0
- package/dist/components/dashboard/components/MetricCard.js.map +1 -0
- package/dist/components/dashboard/components/SourceLink.d.ts +9 -0
- package/dist/components/dashboard/components/SourceLink.d.ts.map +1 -0
- package/dist/components/dashboard/components/SourceLink.js +39 -0
- package/dist/components/dashboard/components/SourceLink.js.map +1 -0
- package/dist/components/dashboard/components/TimeRangeSelector.d.ts +9 -0
- package/dist/components/dashboard/components/TimeRangeSelector.d.ts.map +1 -0
- package/dist/components/dashboard/components/TimeRangeSelector.js +167 -0
- package/dist/components/dashboard/components/TimeRangeSelector.js.map +1 -0
- package/dist/components/dashboard/components/index.d.ts +6 -0
- package/dist/components/dashboard/components/index.d.ts.map +1 -0
- package/dist/components/dashboard/components/index.js +6 -0
- package/dist/components/dashboard/components/index.js.map +1 -0
- package/dist/components/dashboard/index.d.ts +6 -0
- package/dist/components/dashboard/index.d.ts.map +1 -0
- package/dist/components/dashboard/index.js +8 -0
- package/dist/components/dashboard/index.js.map +1 -0
- package/dist/components/dashboard/types.d.ts +74 -0
- package/dist/components/dashboard/types.d.ts.map +1 -0
- package/dist/components/dashboard/types.js +8 -0
- package/dist/components/dashboard/types.js.map +1 -0
- package/dist/components/session-events/SessionEventFeed.d.ts +34 -0
- package/dist/components/session-events/SessionEventFeed.d.ts.map +1 -0
- package/dist/components/session-events/SessionEventFeed.js +1196 -0
- package/dist/components/session-events/SessionEventFeed.js.map +1 -0
- package/dist/components/session-events/index.d.ts +7 -0
- package/dist/components/session-events/index.d.ts.map +1 -0
- package/dist/components/session-events/index.js +6 -0
- package/dist/components/session-events/index.js.map +1 -0
- package/dist/components/state-view/PipelineView.d.ts +14 -0
- package/dist/components/state-view/PipelineView.d.ts.map +1 -0
- package/dist/components/state-view/PipelineView.js +195 -0
- package/dist/components/state-view/PipelineView.js.map +1 -0
- package/dist/components/state-view/index.d.ts +14 -0
- package/dist/components/state-view/index.d.ts.map +1 -0
- package/dist/components/state-view/index.js +12 -0
- package/dist/components/state-view/index.js.map +1 -0
- package/dist/components/state-view/types.d.ts +188 -0
- package/dist/components/state-view/types.d.ts.map +1 -0
- package/dist/components/state-view/types.js +10 -0
- package/dist/components/state-view/types.js.map +1 -0
- package/dist/components/state-view/useStateView.d.ts +32 -0
- package/dist/components/state-view/useStateView.d.ts.map +1 -0
- package/dist/components/state-view/useStateView.js +129 -0
- package/dist/components/state-view/useStateView.js.map +1 -0
- package/dist/contexts/GraphEditContext.d.ts +20 -0
- package/dist/contexts/GraphEditContext.d.ts.map +1 -0
- package/dist/contexts/GraphEditContext.js +8 -0
- package/dist/contexts/GraphEditContext.js.map +1 -0
- package/dist/contexts/TooltipPortalContext.d.ts +8 -0
- package/dist/contexts/TooltipPortalContext.d.ts.map +1 -0
- package/dist/contexts/TooltipPortalContext.js +8 -0
- package/dist/contexts/TooltipPortalContext.js.map +1 -0
- package/dist/edges/CustomEdge.d.ts +24 -0
- package/dist/edges/CustomEdge.d.ts.map +1 -0
- package/dist/edges/CustomEdge.js +222 -0
- package/dist/edges/CustomEdge.js.map +1 -0
- package/dist/edges/GenericEdge.d.ts +18 -0
- package/dist/edges/GenericEdge.d.ts.map +1 -0
- package/dist/edges/GenericEdge.js +10 -0
- package/dist/edges/GenericEdge.js.map +1 -0
- package/dist/graphify/anchor.d.ts +28 -0
- package/dist/graphify/anchor.d.ts.map +1 -0
- package/dist/graphify/anchor.js +132 -0
- package/dist/graphify/anchor.js.map +1 -0
- package/dist/graphify/consolidated.d.ts +210 -0
- package/dist/graphify/consolidated.d.ts.map +1 -0
- package/dist/graphify/consolidated.js +11 -0
- package/dist/graphify/consolidated.js.map +1 -0
- package/dist/graphify/ids.d.ts +19 -0
- package/dist/graphify/ids.d.ts.map +1 -0
- package/dist/graphify/ids.js +46 -0
- package/dist/graphify/ids.js.map +1 -0
- package/dist/graphify/index.d.ts +18 -0
- package/dist/graphify/index.d.ts.map +1 -0
- package/dist/graphify/index.js +12 -0
- package/dist/graphify/index.js.map +1 -0
- package/dist/graphify/kind.d.ts +23 -0
- package/dist/graphify/kind.d.ts.map +1 -0
- package/dist/graphify/kind.js +77 -0
- package/dist/graphify/kind.js.map +1 -0
- package/dist/graphify/resolve.d.ts +48 -0
- package/dist/graphify/resolve.d.ts.map +1 -0
- package/dist/graphify/resolve.js +83 -0
- package/dist/graphify/resolve.js.map +1 -0
- package/dist/graphify/signature.d.ts +87 -0
- package/dist/graphify/signature.d.ts.map +1 -0
- package/dist/graphify/signature.js +276 -0
- package/dist/graphify/signature.js.map +1 -0
- package/dist/graphify/types.d.ts +141 -0
- package/dist/graphify/types.d.ts.map +1 -0
- package/dist/graphify/types.js +8 -0
- package/dist/graphify/types.js.map +1 -0
- package/dist/hooks/useElkLayout.d.ts +66 -0
- package/dist/hooks/useElkLayout.d.ts.map +1 -0
- package/dist/hooks/useElkLayout.js +136 -0
- package/dist/hooks/useElkLayout.js.map +1 -0
- package/dist/hooks/usePathBasedEvents.d.ts +42 -0
- package/dist/hooks/usePathBasedEvents.d.ts.map +1 -0
- package/dist/hooks/usePathBasedEvents.js +119 -0
- package/dist/hooks/usePathBasedEvents.js.map +1 -0
- package/dist/hooks/useSequenceLayout.d.ts +186 -0
- package/dist/hooks/useSequenceLayout.d.ts.map +1 -0
- package/dist/hooks/useSequenceLayout.js +327 -0
- package/dist/hooks/useSequenceLayout.js.map +1 -0
- package/dist/hooks/useUndoRedo.d.ts +80 -0
- package/dist/hooks/useUndoRedo.d.ts.map +1 -0
- package/dist/hooks/useUndoRedo.js +70 -0
- package/dist/hooks/useUndoRedo.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/CustomNode.d.ts +28 -0
- package/dist/nodes/CustomNode.d.ts.map +1 -0
- package/dist/nodes/CustomNode.js +820 -0
- package/dist/nodes/CustomNode.js.map +1 -0
- package/dist/nodes/GenericNode.d.ts +20 -0
- package/dist/nodes/GenericNode.d.ts.map +1 -0
- package/dist/nodes/GenericNode.js +20 -0
- package/dist/nodes/GenericNode.js.map +1 -0
- package/dist/nodes/otel/OtelBoundaryNode.d.ts +55 -0
- package/dist/nodes/otel/OtelBoundaryNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelBoundaryNode.js +81 -0
- package/dist/nodes/otel/OtelBoundaryNode.js.map +1 -0
- package/dist/nodes/otel/OtelEventNode.d.ts +59 -0
- package/dist/nodes/otel/OtelEventNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelEventNode.js +82 -0
- package/dist/nodes/otel/OtelEventNode.js.map +1 -0
- package/dist/nodes/otel/OtelResourceNode.d.ts +53 -0
- package/dist/nodes/otel/OtelResourceNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelResourceNode.js +105 -0
- package/dist/nodes/otel/OtelResourceNode.js.map +1 -0
- package/dist/nodes/otel/OtelScopeNode.d.ts +53 -0
- package/dist/nodes/otel/OtelScopeNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelScopeNode.js +81 -0
- package/dist/nodes/otel/OtelScopeNode.js.map +1 -0
- package/dist/nodes/otel/OtelSpanConventionNode.d.ts +61 -0
- package/dist/nodes/otel/OtelSpanConventionNode.d.ts.map +1 -0
- package/dist/nodes/otel/OtelSpanConventionNode.js +131 -0
- package/dist/nodes/otel/OtelSpanConventionNode.js.map +1 -0
- package/dist/nodes/otel/index.d.ts +17 -0
- package/dist/nodes/otel/index.d.ts.map +1 -0
- package/dist/nodes/otel/index.js +13 -0
- package/dist/nodes/otel/index.js.map +1 -0
- package/dist/nodes/otel/shared/NodeBadges.d.ts +10 -0
- package/dist/nodes/otel/shared/NodeBadges.d.ts.map +1 -0
- package/dist/nodes/otel/shared/NodeBadges.js +178 -0
- package/dist/nodes/otel/shared/NodeBadges.js.map +1 -0
- package/dist/nodes/otel/shared/NodeContent.d.ts +10 -0
- package/dist/nodes/otel/shared/NodeContent.d.ts.map +1 -0
- package/dist/nodes/otel/shared/NodeContent.js +96 -0
- package/dist/nodes/otel/shared/NodeContent.js.map +1 -0
- package/dist/nodes/otel/shared/index.d.ts +8 -0
- package/dist/nodes/otel/shared/index.d.ts.map +1 -0
- package/dist/nodes/otel/shared/index.js +8 -0
- package/dist/nodes/otel/shared/index.js.map +1 -0
- package/dist/nodes/otel/shared/types.d.ts +129 -0
- package/dist/nodes/otel/shared/types.d.ts.map +1 -0
- package/dist/nodes/otel/shared/types.js +5 -0
- package/dist/nodes/otel/shared/types.js.map +1 -0
- package/dist/nodes/otel/shared/useNodeBehavior.d.ts +42 -0
- package/dist/nodes/otel/shared/useNodeBehavior.d.ts.map +1 -0
- package/dist/nodes/otel/shared/useNodeBehavior.js +61 -0
- package/dist/nodes/otel/shared/useNodeBehavior.js.map +1 -0
- package/dist/pierre/PierreFileView.d.ts +17 -0
- package/dist/pierre/PierreFileView.d.ts.map +1 -0
- package/dist/pierre/PierreFileView.js +46 -0
- package/dist/pierre/PierreFileView.js.map +1 -0
- package/dist/pierre/PierreSnippetView.d.ts +28 -0
- package/dist/pierre/PierreSnippetView.d.ts.map +1 -0
- package/dist/pierre/PierreSnippetView.js +105 -0
- package/dist/pierre/PierreSnippetView.js.map +1 -0
- package/dist/pierre/PierreThroughlineCodeView.d.ts +22 -0
- package/dist/pierre/PierreThroughlineCodeView.d.ts.map +1 -0
- package/dist/pierre/PierreThroughlineCodeView.js +206 -0
- package/dist/pierre/PierreThroughlineCodeView.js.map +1 -0
- package/dist/pierre/constructColors.d.ts +24 -0
- package/dist/pierre/constructColors.d.ts.map +1 -0
- package/dist/pierre/constructColors.js +91 -0
- package/dist/pierre/constructColors.js.map +1 -0
- package/dist/pierre/index.d.ts +12 -0
- package/dist/pierre/index.d.ts.map +1 -0
- package/dist/pierre/index.js +7 -0
- package/dist/pierre/index.js.map +1 -0
- package/dist/pierre/pierreBackground.d.ts +15 -0
- package/dist/pierre/pierreBackground.d.ts.map +1 -0
- package/dist/pierre/pierreBackground.js +31 -0
- package/dist/pierre/pierreBackground.js.map +1 -0
- package/dist/pierre/pierreFileLang.d.ts +27 -0
- package/dist/pierre/pierreFileLang.d.ts.map +1 -0
- package/dist/pierre/pierreFileLang.js +52 -0
- package/dist/pierre/pierreFileLang.js.map +1 -0
- package/dist/pierre/pierreSyntaxTheme.d.ts +11 -0
- package/dist/pierre/pierreSyntaxTheme.d.ts.map +1 -0
- package/dist/pierre/pierreSyntaxTheme.js +20 -0
- package/dist/pierre/pierreSyntaxTheme.js.map +1 -0
- package/dist/pierre/scrollAnchor.d.ts +5 -0
- package/dist/pierre/scrollAnchor.d.ts.map +1 -0
- package/dist/pierre/scrollAnchor.js +9 -0
- package/dist/pierre/scrollAnchor.js.map +1 -0
- package/dist/pierre/sliceSnippet.d.ts +10 -0
- package/dist/pierre/sliceSnippet.d.ts.map +1 -0
- package/dist/pierre/sliceSnippet.js +16 -0
- package/dist/pierre/sliceSnippet.js.map +1 -0
- package/dist/pierre/syntaxTokens.d.ts +11 -0
- package/dist/pierre/syntaxTokens.d.ts.map +1 -0
- package/dist/pierre/syntaxTokens.js +51 -0
- package/dist/pierre/syntaxTokens.js.map +1 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts +8 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js +116 -0
- package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -0
- package/dist/subsystem/ComponentDeclaration.d.ts +87 -0
- package/dist/subsystem/ComponentDeclaration.d.ts.map +1 -0
- package/dist/subsystem/ComponentDeclaration.js +374 -0
- package/dist/subsystem/ComponentDeclaration.js.map +1 -0
- package/dist/subsystem/FileDrawer.d.ts +17 -0
- package/dist/subsystem/FileDrawer.d.ts.map +1 -0
- package/dist/subsystem/FileDrawer.js +72 -0
- package/dist/subsystem/FileDrawer.js.map +1 -0
- package/dist/subsystem/GraphLayoutCover.d.ts +20 -0
- package/dist/subsystem/GraphLayoutCover.d.ts.map +1 -0
- package/dist/subsystem/GraphLayoutCover.js +42 -0
- package/dist/subsystem/GraphLayoutCover.js.map +1 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts +96 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -0
- package/dist/subsystem/SubsystemComponentGraph.js +1059 -0
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -0
- package/dist/subsystem/SubsystemFileTree.d.ts +24 -0
- package/dist/subsystem/SubsystemFileTree.d.ts.map +1 -0
- package/dist/subsystem/SubsystemFileTree.js +150 -0
- package/dist/subsystem/SubsystemFileTree.js.map +1 -0
- package/dist/subsystem/declarationRef.d.ts +39 -0
- package/dist/subsystem/declarationRef.d.ts.map +1 -0
- package/dist/subsystem/declarationRef.js +32 -0
- package/dist/subsystem/declarationRef.js.map +1 -0
- package/dist/subsystem/formatDeclaration.d.ts +11 -0
- package/dist/subsystem/formatDeclaration.d.ts.map +1 -0
- package/dist/subsystem/formatDeclaration.js +146 -0
- package/dist/subsystem/formatDeclaration.js.map +1 -0
- package/dist/subsystem/model.d.ts +353 -0
- package/dist/subsystem/model.d.ts.map +1 -0
- package/dist/subsystem/model.js +503 -0
- package/dist/subsystem/model.js.map +1 -0
- package/dist/subsystem/nodes.d.ts +69 -0
- package/dist/subsystem/nodes.d.ts.map +1 -0
- package/dist/subsystem/nodes.js +289 -0
- package/dist/subsystem/nodes.js.map +1 -0
- package/dist/subsystem/paths.d.ts +63 -0
- package/dist/subsystem/paths.d.ts.map +1 -0
- package/dist/subsystem/paths.js +86 -0
- package/dist/subsystem/paths.js.map +1 -0
- package/dist/subsystem/tokenizeComponent.d.ts +20 -0
- package/dist/subsystem/tokenizeComponent.d.ts.map +1 -0
- package/dist/subsystem/tokenizeComponent.js +56 -0
- package/dist/subsystem/tokenizeComponent.js.map +1 -0
- package/dist/subsystem/tokenizeFormatted.d.ts +12 -0
- package/dist/subsystem/tokenizeFormatted.d.ts.map +1 -0
- package/dist/subsystem/tokenizeFormatted.js +13 -0
- package/dist/subsystem/tokenizeFormatted.js.map +1 -0
- package/dist/utils/animationMapping.d.ts +53 -0
- package/dist/utils/animationMapping.d.ts.map +1 -0
- package/dist/utils/animationMapping.js +126 -0
- package/dist/utils/animationMapping.js.map +1 -0
- package/dist/utils/canvasBounds.d.ts +50 -0
- package/dist/utils/canvasBounds.d.ts.map +1 -0
- package/dist/utils/canvasBounds.js +88 -0
- package/dist/utils/canvasBounds.js.map +1 -0
- package/dist/utils/elkLayout.d.ts +137 -0
- package/dist/utils/elkLayout.d.ts.map +1 -0
- package/dist/utils/elkLayout.js +596 -0
- package/dist/utils/elkLayout.js.map +1 -0
- package/dist/utils/graphConverter.d.ts +18 -0
- package/dist/utils/graphConverter.d.ts.map +1 -0
- package/dist/utils/graphConverter.js +114 -0
- package/dist/utils/graphConverter.js.map +1 -0
- package/dist/utils/iconResolver.d.ts +29 -0
- package/dist/utils/iconResolver.d.ts.map +1 -0
- package/dist/utils/iconResolver.js +30 -0
- package/dist/utils/iconResolver.js.map +1 -0
- package/dist/utils/orientationUtils.d.ts +19 -0
- package/dist/utils/orientationUtils.d.ts.map +1 -0
- package/dist/utils/orientationUtils.js +62 -0
- package/dist/utils/orientationUtils.js.map +1 -0
- package/package.json +80 -0
- package/src/components/ConfigurationSelector.tsx +133 -0
- package/src/components/GraphRenderer.tsx +3195 -0
- package/src/components/MultiCanvasRenderer.tsx +295 -0
- package/src/components/NodeTooltip.tsx +279 -0
- package/src/components/PendingChanges.test.tsx +375 -0
- package/src/components/SelectionSidebar.tsx +352 -0
- package/src/components/SequenceDiagramRenderer.tsx +1156 -0
- package/src/components/WorkflowSequenceDiagram.tsx +270 -0
- package/src/components/dashboard/DashboardRenderer.tsx +317 -0
- package/src/components/dashboard/MetricPanel.tsx +254 -0
- package/src/components/dashboard/MockDataProvider.ts +330 -0
- package/src/components/dashboard/components/BarChart.tsx +299 -0
- package/src/components/dashboard/components/LineChart.tsx +279 -0
- package/src/components/dashboard/components/MetricCard.tsx +270 -0
- package/src/components/dashboard/components/SourceLink.tsx +63 -0
- package/src/components/dashboard/components/TimeRangeSelector.tsx +280 -0
- package/src/components/dashboard/components/index.ts +5 -0
- package/src/components/dashboard/index.ts +47 -0
- package/src/components/dashboard/types.ts +126 -0
- package/src/components/session-events/SessionEventFeed.tsx +1797 -0
- package/src/components/session-events/index.ts +13 -0
- package/src/components/state-view/PipelineView.tsx +347 -0
- package/src/components/state-view/index.ts +14 -0
- package/src/components/state-view/types.ts +261 -0
- package/src/components/state-view/useStateView.ts +205 -0
- package/src/contexts/GraphEditContext.tsx +27 -0
- package/src/contexts/TooltipPortalContext.ts +8 -0
- package/src/edges/CustomEdge.tsx +402 -0
- package/src/edges/GenericEdge.tsx +36 -0
- package/src/graphify/anchor.test.ts +124 -0
- package/src/graphify/anchor.ts +160 -0
- package/src/graphify/consolidated.ts +246 -0
- package/src/graphify/ids.ts +48 -0
- package/src/graphify/index.ts +72 -0
- package/src/graphify/kind.test.ts +108 -0
- package/src/graphify/kind.ts +120 -0
- package/src/graphify/resolve.test.ts +89 -0
- package/src/graphify/resolve.ts +115 -0
- package/src/graphify/signature.test.ts +278 -0
- package/src/graphify/signature.ts +354 -0
- package/src/graphify/types.ts +164 -0
- package/src/hooks/useElkLayout.test.ts +134 -0
- package/src/hooks/useElkLayout.ts +191 -0
- package/src/hooks/usePathBasedEvents.ts +192 -0
- package/src/hooks/useSequenceLayout.ts +543 -0
- package/src/hooks/useUndoRedo.ts +144 -0
- package/src/index.ts +341 -0
- package/src/nodes/CustomNode.tsx +1231 -0
- package/src/nodes/GenericNode.tsx +55 -0
- package/src/nodes/otel/OtelBoundaryNode.tsx +224 -0
- package/src/nodes/otel/OtelEventNode.tsx +225 -0
- package/src/nodes/otel/OtelResourceNode.tsx +251 -0
- package/src/nodes/otel/OtelScopeNode.tsx +221 -0
- package/src/nodes/otel/OtelSpanConventionNode.tsx +295 -0
- package/src/nodes/otel/index.ts +23 -0
- package/src/nodes/otel/shared/NodeBadges.tsx +295 -0
- package/src/nodes/otel/shared/NodeContent.tsx +204 -0
- package/src/nodes/otel/shared/index.ts +8 -0
- package/src/nodes/otel/shared/types.ts +138 -0
- package/src/nodes/otel/shared/useNodeBehavior.ts +114 -0
- package/src/pierre/PierreFileView.tsx +81 -0
- package/src/pierre/PierreSnippetView.tsx +184 -0
- package/src/pierre/PierreThroughlineCodeView.tsx +304 -0
- package/src/pierre/constructColors.test.ts +52 -0
- package/src/pierre/constructColors.ts +112 -0
- package/src/pierre/index.ts +18 -0
- package/src/pierre/pierreBackground.ts +33 -0
- package/src/pierre/pierreFileLang.test.ts +26 -0
- package/src/pierre/pierreFileLang.ts +55 -0
- package/src/pierre/pierreSyntaxTheme.ts +23 -0
- package/src/pierre/scrollAnchor.test.ts +13 -0
- package/src/pierre/scrollAnchor.ts +11 -0
- package/src/pierre/sliceSnippet.test.ts +21 -0
- package/src/pierre/sliceSnippet.ts +31 -0
- package/src/pierre/syntaxTokens.test.ts +35 -0
- package/src/pierre/syntaxTokens.ts +60 -0
- package/src/stories/Audit/BoundaryNodes.stories.tsx +385 -0
- package/src/stories/Audit/CanvasEdgeTypes.stories.tsx +1448 -0
- package/src/stories/Audit/CanvasNodeTypes.stories.tsx +1049 -0
- package/src/stories/Audit/ColorPriority.stories.tsx +895 -0
- package/src/stories/Audit/DiamondBadges.stories.tsx +629 -0
- package/src/stories/Audit/NodeDimensionsTesting.stories.tsx +724 -0
- package/src/stories/Audit/NodeFieldsAudit.stories.tsx +996 -0
- package/src/stories/Audit/NodeFontSizeTesting.stories.tsx +715 -0
- package/src/stories/Audit/NodeShapes.stories.tsx +1208 -0
- package/src/stories/Audit/WideNodesTesting.stories.tsx +1045 -0
- package/src/stories/Components/DashboardRenderer.stories.tsx +263 -0
- package/src/stories/Components/GraphRenderer.stories.tsx +3236 -0
- package/src/stories/Components/MultiCanvasRenderer.stories.tsx +370 -0
- package/src/stories/Components/SequenceDiagram.stories.tsx +255 -0
- package/src/stories/Components/StateView.stories.tsx +417 -0
- package/src/stories/Components/TraceViewer.stories.tsx +442 -0
- package/src/stories/Components/WorkflowSequenceDiagram.stories.tsx +802 -0
- package/src/stories/Features/AnimationWorkshop.stories.tsx +727 -0
- package/src/stories/Features/ChangeTypeVisual.stories.tsx +67 -0
- package/src/stories/Features/EventDrivenAnimations.stories.tsx +513 -0
- package/src/stories/Features/MultiConfig.stories.tsx +539 -0
- package/src/stories/Introduction.mdx +34 -0
- package/src/stories/Layout/ElkEdgeRouting.stories.tsx +539 -0
- package/src/stories/Layout/GraphOrientation.stories.tsx +500 -0
- package/src/stories/Layout/MultiDirectionalConnections.stories.tsx +352 -0
- package/src/stories/Nodes/NodeDefinitionComparison.stories.tsx +560 -0
- package/src/stories/Nodes/NodeNameFallbacks.stories.tsx +491 -0
- package/src/stories/Nodes/NumericColors.stories.tsx +440 -0
- package/src/stories/OTEL/EventNameDisplay.stories.tsx +694 -0
- package/src/stories/OTEL/EventNameFallback.stories.tsx +578 -0
- package/src/stories/OTEL/OtelComponents.stories.tsx +422 -0
- package/src/stories/OTEL/OtelNodeTypesPrototype.stories.tsx +806 -0
- package/src/stories/OTEL/RawEventCards.stories.tsx +57 -0
- package/src/stories/OTEL/SpanBadges.stories.tsx +840 -0
- package/src/stories/OTEL/ValidationEventsCanvas.stories.tsx +209 -0
- package/src/stories/Pierre/CodeView.stories.tsx +219 -0
- package/src/stories/RealWorld/BacklogMdCanvases.stories.tsx +721 -0
- package/src/stories/RealWorld/FileCitySequence.stories.tsx +516 -0
- package/src/stories/RealWorld/RealCanvasFiles.stories.tsx +336 -0
- package/src/stories/Subsystem/ComponentDeclarationAudit.stories.tsx +321 -0
- package/src/stories/Subsystem/ComponentGraph/Appearance.stories.tsx +365 -0
- package/src/stories/Subsystem/ComponentGraph/Basics.stories.tsx +137 -0
- package/src/stories/Subsystem/ComponentGraph/Captures.stories.tsx +238 -0
- package/src/stories/Subsystem/ComponentGraph/DetailPanel.stories.tsx +315 -0
- package/src/stories/Subsystem/ComponentGraph/Flows.stories.tsx +239 -0
- package/src/stories/Subsystem/ComponentGraph/FrameworkStereotype.stories.tsx +216 -0
- package/src/stories/Subsystem/ComponentGraph/GraphTitle.stories.tsx +70 -0
- package/src/stories/Subsystem/ComponentGraph/Processes.stories.tsx +68 -0
- package/src/stories/Subsystem/ComponentGraph/Scenarios.stories.tsx +959 -0
- package/src/stories/Subsystem/ComponentGraph/Spotlights.stories.tsx +681 -0
- package/src/stories/Subsystem/ComponentGraph/fixtures.ts +129 -0
- package/src/stories/__traces__/test-run.canvas.json +241 -0
- package/src/stories/data/activity-feed-analytics.dashboard.json +300 -0
- package/src/stories/data/file-city-images-transformed.otel.canvas.json +295 -0
- package/src/stories/data/file-city-workflows.json +269 -0
- package/src/stories/data/graph-converter-test-execution.json +443 -0
- package/src/stories/data/graph-converter-test.workflow.json +105 -0
- package/src/stories/data/graph-converter-validated-execution.json +58 -0
- package/src/stories/data/opencode-session-raw-events.json +273396 -0
- package/src/subsystem/ComponentDeclaration.tsx +643 -0
- package/src/subsystem/FileDrawer.tsx +106 -0
- package/src/subsystem/GraphLayoutCover.tsx +69 -0
- package/src/subsystem/SubsystemComponentGraph.tsx +1644 -0
- package/src/subsystem/SubsystemFileTree.tsx +190 -0
- package/src/subsystem/declarationRef.test.ts +33 -0
- package/src/subsystem/declarationRef.ts +63 -0
- package/src/subsystem/formatDeclaration.ts +174 -0
- package/src/subsystem/model.test.ts +244 -0
- package/src/subsystem/model.ts +850 -0
- package/src/subsystem/nodes.test.ts +56 -0
- package/src/subsystem/nodes.tsx +443 -0
- package/src/subsystem/paths.test.ts +123 -0
- package/src/subsystem/paths.ts +127 -0
- package/src/subsystem/tokenizeComponent.ts +70 -0
- package/src/subsystem/tokenizeFormatted.ts +19 -0
- package/src/utils/animationMapping.ts +166 -0
- package/src/utils/canvasBounds.ts +146 -0
- package/src/utils/elkLayout.test.ts +240 -0
- package/src/utils/elkLayout.ts +779 -0
- package/src/utils/graphConverter.ts +148 -0
- package/src/utils/iconResolver.tsx +53 -0
- package/src/utils/orientationUtils.ts +73 -0
|
@@ -0,0 +1,1208 @@
|
|
|
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: 'Audit/NodeShapes',
|
|
9
|
+
component: GraphRenderer,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
},
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
decorators: [
|
|
15
|
+
(Story) => (
|
|
16
|
+
<ThemeProvider theme={defaultEditorTheme}>
|
|
17
|
+
<Story />
|
|
18
|
+
</ThemeProvider>
|
|
19
|
+
),
|
|
20
|
+
],
|
|
21
|
+
} satisfies Meta<typeof GraphRenderer>;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof meta>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Canvas showing all available node shapes for visual auditing
|
|
28
|
+
*/
|
|
29
|
+
const allShapesCanvas: ExtendedCanvas = {
|
|
30
|
+
nodes: [
|
|
31
|
+
// Row 1: Basic shapes
|
|
32
|
+
{
|
|
33
|
+
id: 'rectangle',
|
|
34
|
+
type: 'text',
|
|
35
|
+
x: 100,
|
|
36
|
+
y: 100,
|
|
37
|
+
width: 140,
|
|
38
|
+
height: 80,
|
|
39
|
+
text: '# Rectangle\nDefault shape',
|
|
40
|
+
color: 6, // purple
|
|
41
|
+
pv: {
|
|
42
|
+
nodeType: 'rectangle-demo',
|
|
43
|
+
shape: 'rectangle',
|
|
44
|
+
icon: 'Square',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'circle',
|
|
49
|
+
type: 'text',
|
|
50
|
+
x: 300,
|
|
51
|
+
y: 100,
|
|
52
|
+
width: 100,
|
|
53
|
+
height: 100,
|
|
54
|
+
text: '# Circle',
|
|
55
|
+
color: 5, // cyan
|
|
56
|
+
pv: {
|
|
57
|
+
nodeType: 'circle-demo',
|
|
58
|
+
shape: 'circle',
|
|
59
|
+
icon: 'Circle',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'hexagon',
|
|
64
|
+
type: 'text',
|
|
65
|
+
x: 480,
|
|
66
|
+
y: 100,
|
|
67
|
+
width: 120,
|
|
68
|
+
height: 120,
|
|
69
|
+
text: '# Hexagon',
|
|
70
|
+
color: 4, // green
|
|
71
|
+
pv: {
|
|
72
|
+
nodeType: 'hexagon-demo',
|
|
73
|
+
shape: 'hexagon',
|
|
74
|
+
icon: 'Hexagon',
|
|
75
|
+
size: { width: 120, height: 120 },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'diamond',
|
|
80
|
+
type: 'text',
|
|
81
|
+
x: 680,
|
|
82
|
+
y: 100,
|
|
83
|
+
width: 70,
|
|
84
|
+
height: 70,
|
|
85
|
+
text: 'Diamond',
|
|
86
|
+
color: 2, // orange
|
|
87
|
+
pv: {
|
|
88
|
+
nodeType: 'diamond-demo',
|
|
89
|
+
shape: 'diamond',
|
|
90
|
+
icon: 'Diamond',
|
|
91
|
+
size: { width: 70, height: 70 },
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: 'custom',
|
|
96
|
+
type: 'text',
|
|
97
|
+
x: 860,
|
|
98
|
+
y: 100,
|
|
99
|
+
width: 140,
|
|
100
|
+
height: 80,
|
|
101
|
+
text: '# Custom\n(Falls back to rect)',
|
|
102
|
+
color: 1, // red
|
|
103
|
+
pv: {
|
|
104
|
+
nodeType: 'custom-demo',
|
|
105
|
+
shape: 'custom',
|
|
106
|
+
icon: 'Settings',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
edges: [],
|
|
111
|
+
pv: {
|
|
112
|
+
version: '1.0.0',
|
|
113
|
+
name: 'Node Shapes Audit',
|
|
114
|
+
description: 'All available node shapes for visual inspection',
|
|
115
|
+
edgeTypes: {},
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export const AllShapes: Story = {
|
|
120
|
+
args: {
|
|
121
|
+
canvas: allShapesCanvas,
|
|
122
|
+
width: 1100,
|
|
123
|
+
height: 350,
|
|
124
|
+
},
|
|
125
|
+
parameters: {
|
|
126
|
+
docs: {
|
|
127
|
+
description: {
|
|
128
|
+
story: `
|
|
129
|
+
**All Node Shapes**
|
|
130
|
+
|
|
131
|
+
This story displays all 5 available node shapes:
|
|
132
|
+
- **Rectangle** - Default shape with rounded corners (borderRadius: 8px)
|
|
133
|
+
- **Circle** - Circular nodes (borderRadius: 50%)
|
|
134
|
+
- **Hexagon** - Flat-top style using clip-path polygon
|
|
135
|
+
- **Diamond** - Diamond shape using clip-path polygon (works with any aspect ratio)
|
|
136
|
+
- **Custom** - Placeholder that falls back to rectangle styling
|
|
137
|
+
`,
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Canvas showing shapes with different sizes
|
|
145
|
+
*/
|
|
146
|
+
const shapeSizesCanvas: ExtendedCanvas = {
|
|
147
|
+
nodes: [
|
|
148
|
+
// Small shapes
|
|
149
|
+
{
|
|
150
|
+
id: 'rect-small',
|
|
151
|
+
type: 'text',
|
|
152
|
+
x: 100,
|
|
153
|
+
y: 80,
|
|
154
|
+
width: 80,
|
|
155
|
+
height: 50,
|
|
156
|
+
text: 'Small',
|
|
157
|
+
color: 6,
|
|
158
|
+
pv: {
|
|
159
|
+
nodeType: 'rect-small',
|
|
160
|
+
shape: 'rectangle',
|
|
161
|
+
size: { width: 80, height: 50 },
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: 'circle-small',
|
|
166
|
+
type: 'text',
|
|
167
|
+
x: 250,
|
|
168
|
+
y: 80,
|
|
169
|
+
width: 60,
|
|
170
|
+
height: 60,
|
|
171
|
+
text: 'S',
|
|
172
|
+
color: 5,
|
|
173
|
+
pv: {
|
|
174
|
+
nodeType: 'circle-small',
|
|
175
|
+
shape: 'circle',
|
|
176
|
+
size: { width: 60, height: 60 },
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: 'hex-small',
|
|
181
|
+
type: 'text',
|
|
182
|
+
x: 380,
|
|
183
|
+
y: 80,
|
|
184
|
+
width: 80,
|
|
185
|
+
height: 60,
|
|
186
|
+
text: 'Small',
|
|
187
|
+
color: 4,
|
|
188
|
+
pv: {
|
|
189
|
+
nodeType: 'hex-small',
|
|
190
|
+
shape: 'hexagon',
|
|
191
|
+
size: { width: 80, height: 60 },
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
id: 'diamond-small',
|
|
196
|
+
type: 'text',
|
|
197
|
+
x: 520,
|
|
198
|
+
y: 80,
|
|
199
|
+
width: 60,
|
|
200
|
+
height: 60,
|
|
201
|
+
text: 'S',
|
|
202
|
+
color: 2,
|
|
203
|
+
pv: {
|
|
204
|
+
nodeType: 'diamond-small',
|
|
205
|
+
shape: 'diamond',
|
|
206
|
+
size: { width: 60, height: 60 },
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
// Medium shapes (default)
|
|
211
|
+
{
|
|
212
|
+
id: 'rect-medium',
|
|
213
|
+
type: 'text',
|
|
214
|
+
x: 100,
|
|
215
|
+
y: 200,
|
|
216
|
+
width: 120,
|
|
217
|
+
height: 70,
|
|
218
|
+
text: 'Medium',
|
|
219
|
+
color: 6,
|
|
220
|
+
pv: {
|
|
221
|
+
nodeType: 'rect-medium',
|
|
222
|
+
shape: 'rectangle',
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: 'circle-medium',
|
|
227
|
+
type: 'text',
|
|
228
|
+
x: 250,
|
|
229
|
+
y: 200,
|
|
230
|
+
width: 80,
|
|
231
|
+
height: 80,
|
|
232
|
+
text: 'M',
|
|
233
|
+
color: 5,
|
|
234
|
+
pv: {
|
|
235
|
+
nodeType: 'circle-medium',
|
|
236
|
+
shape: 'circle',
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
id: 'hex-medium',
|
|
241
|
+
type: 'text',
|
|
242
|
+
x: 380,
|
|
243
|
+
y: 200,
|
|
244
|
+
width: 100,
|
|
245
|
+
height: 80,
|
|
246
|
+
text: 'Medium',
|
|
247
|
+
color: 4,
|
|
248
|
+
pv: {
|
|
249
|
+
nodeType: 'hex-medium',
|
|
250
|
+
shape: 'hexagon',
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
id: 'diamond-medium',
|
|
255
|
+
type: 'text',
|
|
256
|
+
x: 520,
|
|
257
|
+
y: 200,
|
|
258
|
+
width: 80,
|
|
259
|
+
height: 80,
|
|
260
|
+
text: 'M',
|
|
261
|
+
color: 2,
|
|
262
|
+
pv: {
|
|
263
|
+
nodeType: 'diamond-medium',
|
|
264
|
+
shape: 'diamond',
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
|
|
268
|
+
// Large shapes
|
|
269
|
+
{
|
|
270
|
+
id: 'rect-large',
|
|
271
|
+
type: 'text',
|
|
272
|
+
x: 100,
|
|
273
|
+
y: 340,
|
|
274
|
+
width: 180,
|
|
275
|
+
height: 100,
|
|
276
|
+
text: '# Large\nWith content',
|
|
277
|
+
color: 6,
|
|
278
|
+
pv: {
|
|
279
|
+
nodeType: 'rect-large',
|
|
280
|
+
shape: 'rectangle',
|
|
281
|
+
size: { width: 180, height: 100 },
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
id: 'circle-large',
|
|
286
|
+
type: 'text',
|
|
287
|
+
x: 250,
|
|
288
|
+
y: 340,
|
|
289
|
+
width: 120,
|
|
290
|
+
height: 120,
|
|
291
|
+
text: 'Large',
|
|
292
|
+
color: 5,
|
|
293
|
+
pv: {
|
|
294
|
+
nodeType: 'circle-large',
|
|
295
|
+
shape: 'circle',
|
|
296
|
+
size: { width: 120, height: 120 },
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
id: 'hex-large',
|
|
301
|
+
type: 'text',
|
|
302
|
+
x: 380,
|
|
303
|
+
y: 340,
|
|
304
|
+
width: 140,
|
|
305
|
+
height: 110,
|
|
306
|
+
text: 'Large',
|
|
307
|
+
color: 4,
|
|
308
|
+
pv: {
|
|
309
|
+
nodeType: 'hex-large',
|
|
310
|
+
shape: 'hexagon',
|
|
311
|
+
size: { width: 140, height: 110 },
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
id: 'diamond-large',
|
|
316
|
+
type: 'text',
|
|
317
|
+
x: 520,
|
|
318
|
+
y: 340,
|
|
319
|
+
width: 110,
|
|
320
|
+
height: 110,
|
|
321
|
+
text: 'Large',
|
|
322
|
+
color: 2,
|
|
323
|
+
pv: {
|
|
324
|
+
nodeType: 'diamond-large',
|
|
325
|
+
shape: 'diamond',
|
|
326
|
+
size: { width: 110, height: 110 },
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
],
|
|
330
|
+
edges: [],
|
|
331
|
+
pv: {
|
|
332
|
+
version: '1.0.0',
|
|
333
|
+
name: 'Node Sizes Audit',
|
|
334
|
+
description: 'Node shapes at different sizes',
|
|
335
|
+
edgeTypes: {},
|
|
336
|
+
},
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
export const ShapeSizes: Story = {
|
|
340
|
+
args: {
|
|
341
|
+
canvas: shapeSizesCanvas,
|
|
342
|
+
width: 700,
|
|
343
|
+
height: 550,
|
|
344
|
+
},
|
|
345
|
+
parameters: {
|
|
346
|
+
docs: {
|
|
347
|
+
description: {
|
|
348
|
+
story: `
|
|
349
|
+
**Shape Sizes**
|
|
350
|
+
|
|
351
|
+
Shows each shape at small, medium, and large sizes to verify scaling behavior.
|
|
352
|
+
`,
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Canvas showing shapes with icons
|
|
360
|
+
*/
|
|
361
|
+
const shapesWithIconsCanvas: ExtendedCanvas = {
|
|
362
|
+
nodes: [
|
|
363
|
+
{
|
|
364
|
+
id: 'rect-icon',
|
|
365
|
+
type: 'text',
|
|
366
|
+
x: 100,
|
|
367
|
+
y: 100,
|
|
368
|
+
width: 140,
|
|
369
|
+
height: 80,
|
|
370
|
+
text: 'Server',
|
|
371
|
+
color: 6,
|
|
372
|
+
pv: {
|
|
373
|
+
nodeType: 'server',
|
|
374
|
+
shape: 'rectangle',
|
|
375
|
+
icon: 'Server',
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
id: 'circle-icon',
|
|
380
|
+
type: 'text',
|
|
381
|
+
x: 300,
|
|
382
|
+
y: 100,
|
|
383
|
+
width: 100,
|
|
384
|
+
height: 100,
|
|
385
|
+
text: 'User',
|
|
386
|
+
color: 5,
|
|
387
|
+
pv: {
|
|
388
|
+
nodeType: 'user',
|
|
389
|
+
shape: 'circle',
|
|
390
|
+
icon: 'User',
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
id: 'hex-icon',
|
|
395
|
+
type: 'text',
|
|
396
|
+
x: 480,
|
|
397
|
+
y: 100,
|
|
398
|
+
width: 140,
|
|
399
|
+
height: 100,
|
|
400
|
+
text: 'Database',
|
|
401
|
+
color: 4,
|
|
402
|
+
pv: {
|
|
403
|
+
nodeType: 'database',
|
|
404
|
+
shape: 'hexagon',
|
|
405
|
+
icon: 'Database',
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
id: 'diamond-icon',
|
|
410
|
+
type: 'text',
|
|
411
|
+
x: 680,
|
|
412
|
+
y: 100,
|
|
413
|
+
width: 100,
|
|
414
|
+
height: 100,
|
|
415
|
+
text: 'Cache',
|
|
416
|
+
color: 2,
|
|
417
|
+
pv: {
|
|
418
|
+
nodeType: 'cache',
|
|
419
|
+
shape: 'diamond',
|
|
420
|
+
icon: 'Zap',
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
],
|
|
424
|
+
edges: [],
|
|
425
|
+
pv: {
|
|
426
|
+
version: '1.0.0',
|
|
427
|
+
name: 'Shapes with Icons',
|
|
428
|
+
description: 'Node shapes with Lucide icons',
|
|
429
|
+
edgeTypes: {},
|
|
430
|
+
},
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
export const ShapesWithIcons: Story = {
|
|
434
|
+
args: {
|
|
435
|
+
canvas: shapesWithIconsCanvas,
|
|
436
|
+
width: 900,
|
|
437
|
+
height: 300,
|
|
438
|
+
},
|
|
439
|
+
parameters: {
|
|
440
|
+
docs: {
|
|
441
|
+
description: {
|
|
442
|
+
story: `
|
|
443
|
+
**Shapes with Icons**
|
|
444
|
+
|
|
445
|
+
Shows each shape with a Lucide icon to verify icon placement and sizing within different shapes.
|
|
446
|
+
`,
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Canvas showing shapes with states
|
|
454
|
+
*/
|
|
455
|
+
const shapesWithStatesCanvas: ExtendedCanvas = {
|
|
456
|
+
nodes: [
|
|
457
|
+
// Idle state
|
|
458
|
+
{
|
|
459
|
+
id: 'rect-idle',
|
|
460
|
+
type: 'text',
|
|
461
|
+
x: 100,
|
|
462
|
+
y: 80,
|
|
463
|
+
width: 120,
|
|
464
|
+
height: 70,
|
|
465
|
+
text: 'Idle',
|
|
466
|
+
color: 6,
|
|
467
|
+
pv: {
|
|
468
|
+
nodeType: 'process',
|
|
469
|
+
shape: 'rectangle',
|
|
470
|
+
icon: 'Box',
|
|
471
|
+
states: {
|
|
472
|
+
idle: { color: '#94a3b8', icon: 'Box' },
|
|
473
|
+
active: { color: '#3b82f6', icon: 'Play' },
|
|
474
|
+
error: { color: '#ef4444', icon: 'AlertCircle' },
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
id: 'circle-idle',
|
|
480
|
+
type: 'text',
|
|
481
|
+
x: 280,
|
|
482
|
+
y: 80,
|
|
483
|
+
width: 90,
|
|
484
|
+
height: 90,
|
|
485
|
+
text: 'Idle',
|
|
486
|
+
color: 5,
|
|
487
|
+
pv: {
|
|
488
|
+
nodeType: 'agent',
|
|
489
|
+
shape: 'circle',
|
|
490
|
+
icon: 'User',
|
|
491
|
+
states: {
|
|
492
|
+
idle: { color: '#94a3b8', icon: 'User' },
|
|
493
|
+
active: { color: '#22c55e', icon: 'UserCheck' },
|
|
494
|
+
error: { color: '#ef4444', icon: 'UserX' },
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
id: 'hex-idle',
|
|
500
|
+
type: 'text',
|
|
501
|
+
x: 430,
|
|
502
|
+
y: 80,
|
|
503
|
+
width: 120,
|
|
504
|
+
height: 90,
|
|
505
|
+
text: 'Idle',
|
|
506
|
+
color: 4,
|
|
507
|
+
pv: {
|
|
508
|
+
nodeType: 'storage',
|
|
509
|
+
shape: 'hexagon',
|
|
510
|
+
icon: 'Database',
|
|
511
|
+
states: {
|
|
512
|
+
idle: { color: '#94a3b8', icon: 'Database' },
|
|
513
|
+
active: { color: '#22c55e', icon: 'HardDrive' },
|
|
514
|
+
error: { color: '#ef4444', icon: 'Database' },
|
|
515
|
+
},
|
|
516
|
+
},
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
id: 'diamond-idle',
|
|
520
|
+
type: 'text',
|
|
521
|
+
x: 600,
|
|
522
|
+
y: 80,
|
|
523
|
+
width: 90,
|
|
524
|
+
height: 90,
|
|
525
|
+
text: 'Idle',
|
|
526
|
+
color: 2,
|
|
527
|
+
pv: {
|
|
528
|
+
nodeType: 'decision',
|
|
529
|
+
shape: 'diamond',
|
|
530
|
+
icon: 'GitBranch',
|
|
531
|
+
states: {
|
|
532
|
+
idle: { color: '#94a3b8', icon: 'GitBranch' },
|
|
533
|
+
active: { color: '#f97316', icon: 'GitCommit' },
|
|
534
|
+
error: { color: '#ef4444', icon: 'GitBranch' },
|
|
535
|
+
},
|
|
536
|
+
},
|
|
537
|
+
},
|
|
538
|
+
|
|
539
|
+
// Active state
|
|
540
|
+
{
|
|
541
|
+
id: 'rect-active',
|
|
542
|
+
type: 'text',
|
|
543
|
+
x: 100,
|
|
544
|
+
y: 220,
|
|
545
|
+
width: 120,
|
|
546
|
+
height: 70,
|
|
547
|
+
text: 'Active',
|
|
548
|
+
color: 6,
|
|
549
|
+
pv: {
|
|
550
|
+
nodeType: 'process-active',
|
|
551
|
+
shape: 'rectangle',
|
|
552
|
+
icon: 'Play',
|
|
553
|
+
color: '#3b82f6',
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
id: 'circle-active',
|
|
558
|
+
type: 'text',
|
|
559
|
+
x: 280,
|
|
560
|
+
y: 220,
|
|
561
|
+
width: 90,
|
|
562
|
+
height: 90,
|
|
563
|
+
text: 'Active',
|
|
564
|
+
color: 5,
|
|
565
|
+
pv: {
|
|
566
|
+
nodeType: 'agent-active',
|
|
567
|
+
shape: 'circle',
|
|
568
|
+
icon: 'UserCheck',
|
|
569
|
+
color: '#22c55e',
|
|
570
|
+
},
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
id: 'hex-active',
|
|
574
|
+
type: 'text',
|
|
575
|
+
x: 430,
|
|
576
|
+
y: 220,
|
|
577
|
+
width: 120,
|
|
578
|
+
height: 90,
|
|
579
|
+
text: 'Active',
|
|
580
|
+
color: 4,
|
|
581
|
+
pv: {
|
|
582
|
+
nodeType: 'storage-active',
|
|
583
|
+
shape: 'hexagon',
|
|
584
|
+
icon: 'HardDrive',
|
|
585
|
+
color: '#22c55e',
|
|
586
|
+
},
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
id: 'diamond-active',
|
|
590
|
+
type: 'text',
|
|
591
|
+
x: 600,
|
|
592
|
+
y: 220,
|
|
593
|
+
width: 90,
|
|
594
|
+
height: 90,
|
|
595
|
+
text: 'Active',
|
|
596
|
+
color: 2,
|
|
597
|
+
pv: {
|
|
598
|
+
nodeType: 'decision-active',
|
|
599
|
+
shape: 'diamond',
|
|
600
|
+
icon: 'GitCommit',
|
|
601
|
+
color: '#f97316',
|
|
602
|
+
},
|
|
603
|
+
},
|
|
604
|
+
|
|
605
|
+
// Error state
|
|
606
|
+
{
|
|
607
|
+
id: 'rect-error',
|
|
608
|
+
type: 'text',
|
|
609
|
+
x: 100,
|
|
610
|
+
y: 360,
|
|
611
|
+
width: 120,
|
|
612
|
+
height: 70,
|
|
613
|
+
text: 'Error',
|
|
614
|
+
color: 1,
|
|
615
|
+
pv: {
|
|
616
|
+
nodeType: 'process-error',
|
|
617
|
+
shape: 'rectangle',
|
|
618
|
+
icon: 'AlertCircle',
|
|
619
|
+
color: '#ef4444',
|
|
620
|
+
},
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
id: 'circle-error',
|
|
624
|
+
type: 'text',
|
|
625
|
+
x: 280,
|
|
626
|
+
y: 360,
|
|
627
|
+
width: 90,
|
|
628
|
+
height: 90,
|
|
629
|
+
text: 'Error',
|
|
630
|
+
color: 1,
|
|
631
|
+
pv: {
|
|
632
|
+
nodeType: 'agent-error',
|
|
633
|
+
shape: 'circle',
|
|
634
|
+
icon: 'UserX',
|
|
635
|
+
color: '#ef4444',
|
|
636
|
+
},
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
id: 'hex-error',
|
|
640
|
+
type: 'text',
|
|
641
|
+
x: 430,
|
|
642
|
+
y: 360,
|
|
643
|
+
width: 120,
|
|
644
|
+
height: 90,
|
|
645
|
+
text: 'Error',
|
|
646
|
+
color: 1,
|
|
647
|
+
pv: {
|
|
648
|
+
nodeType: 'storage-error',
|
|
649
|
+
shape: 'hexagon',
|
|
650
|
+
icon: 'Database',
|
|
651
|
+
color: '#ef4444',
|
|
652
|
+
},
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
id: 'diamond-error',
|
|
656
|
+
type: 'text',
|
|
657
|
+
x: 600,
|
|
658
|
+
y: 360,
|
|
659
|
+
width: 90,
|
|
660
|
+
height: 90,
|
|
661
|
+
text: 'Error',
|
|
662
|
+
color: 1,
|
|
663
|
+
pv: {
|
|
664
|
+
nodeType: 'decision-error',
|
|
665
|
+
shape: 'diamond',
|
|
666
|
+
icon: 'GitBranch',
|
|
667
|
+
color: '#ef4444',
|
|
668
|
+
},
|
|
669
|
+
},
|
|
670
|
+
],
|
|
671
|
+
edges: [],
|
|
672
|
+
pv: {
|
|
673
|
+
version: '1.0.0',
|
|
674
|
+
name: 'Shapes with States',
|
|
675
|
+
description: 'Node shapes in different states (idle, active, error)',
|
|
676
|
+
edgeTypes: {},
|
|
677
|
+
},
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
export const ShapesWithStates: Story = {
|
|
681
|
+
args: {
|
|
682
|
+
canvas: shapesWithStatesCanvas,
|
|
683
|
+
width: 800,
|
|
684
|
+
height: 550,
|
|
685
|
+
},
|
|
686
|
+
parameters: {
|
|
687
|
+
docs: {
|
|
688
|
+
description: {
|
|
689
|
+
story: `
|
|
690
|
+
**Shapes with States**
|
|
691
|
+
|
|
692
|
+
Shows each shape in different visual states:
|
|
693
|
+
- **Row 1**: Idle state (gray)
|
|
694
|
+
- **Row 2**: Active state (blue/green/orange)
|
|
695
|
+
- **Row 3**: Error state (red)
|
|
696
|
+
`,
|
|
697
|
+
},
|
|
698
|
+
},
|
|
699
|
+
},
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Interactive comparison of all shapes side by side
|
|
704
|
+
*/
|
|
705
|
+
const ShapeComparisonTemplate = () => {
|
|
706
|
+
return (
|
|
707
|
+
<div style={{ padding: 20 }}>
|
|
708
|
+
<h2 style={{ marginBottom: 20, fontFamily: 'system-ui' }}>Node Shape Comparison</h2>
|
|
709
|
+
|
|
710
|
+
<div
|
|
711
|
+
style={{
|
|
712
|
+
display: 'grid',
|
|
713
|
+
gridTemplateColumns: 'repeat(5, 1fr)',
|
|
714
|
+
gap: 20,
|
|
715
|
+
marginBottom: 30,
|
|
716
|
+
}}
|
|
717
|
+
>
|
|
718
|
+
<div style={{ textAlign: 'center' }}>
|
|
719
|
+
<h4 style={{ marginBottom: 10, fontFamily: 'system-ui' }}>Rectangle</h4>
|
|
720
|
+
<code style={{ fontSize: 11 }}>shape: 'rectangle'</code>
|
|
721
|
+
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>borderRadius: 8px</div>
|
|
722
|
+
</div>
|
|
723
|
+
<div style={{ textAlign: 'center' }}>
|
|
724
|
+
<h4 style={{ marginBottom: 10, fontFamily: 'system-ui' }}>Circle</h4>
|
|
725
|
+
<code style={{ fontSize: 11 }}>shape: 'circle'</code>
|
|
726
|
+
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>borderRadius: 50%</div>
|
|
727
|
+
</div>
|
|
728
|
+
<div style={{ textAlign: 'center' }}>
|
|
729
|
+
<h4 style={{ marginBottom: 10, fontFamily: 'system-ui' }}>Hexagon</h4>
|
|
730
|
+
<code style={{ fontSize: 11 }}>shape: 'hexagon'</code>
|
|
731
|
+
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>CSS clip-path polygon</div>
|
|
732
|
+
</div>
|
|
733
|
+
<div style={{ textAlign: 'center' }}>
|
|
734
|
+
<h4 style={{ marginBottom: 10, fontFamily: 'system-ui' }}>Diamond</h4>
|
|
735
|
+
<code style={{ fontSize: 11 }}>shape: 'diamond'</code>
|
|
736
|
+
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>rotate(45deg)</div>
|
|
737
|
+
</div>
|
|
738
|
+
<div style={{ textAlign: 'center' }}>
|
|
739
|
+
<h4 style={{ marginBottom: 10, fontFamily: 'system-ui' }}>Custom</h4>
|
|
740
|
+
<code style={{ fontSize: 11 }}>shape: 'custom'</code>
|
|
741
|
+
<div style={{ marginTop: 10, fontSize: 12, color: '#666' }}>Falls back to rectangle</div>
|
|
742
|
+
</div>
|
|
743
|
+
</div>
|
|
744
|
+
|
|
745
|
+
<GraphRenderer canvas={allShapesCanvas} width={1100} height={280} />
|
|
746
|
+
|
|
747
|
+
<div style={{ marginTop: 30, padding: 16, backgroundColor: '#f5f5f5', borderRadius: 8 }}>
|
|
748
|
+
<h4 style={{ marginBottom: 10, fontFamily: 'system-ui' }}>Implementation Notes</h4>
|
|
749
|
+
<ul style={{ fontSize: 13, lineHeight: 1.8, margin: 0, paddingLeft: 20 }}>
|
|
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(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)</code>
|
|
759
|
+
</li>
|
|
760
|
+
<li>
|
|
761
|
+
<strong>Diamond</strong>: Uses{' '}
|
|
762
|
+
<code>clipPath: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)</code> - works with any
|
|
763
|
+
aspect ratio
|
|
764
|
+
</li>
|
|
765
|
+
<li>
|
|
766
|
+
<strong>Custom</strong>: Currently renders as rectangle (placeholder for future custom
|
|
767
|
+
shapes)
|
|
768
|
+
</li>
|
|
769
|
+
</ul>
|
|
770
|
+
</div>
|
|
771
|
+
</div>
|
|
772
|
+
);
|
|
773
|
+
};
|
|
774
|
+
|
|
775
|
+
export const ShapeComparison: Story = {
|
|
776
|
+
render: () => <ShapeComparisonTemplate />,
|
|
777
|
+
parameters: {
|
|
778
|
+
docs: {
|
|
779
|
+
description: {
|
|
780
|
+
story: 'Interactive comparison view with implementation details for each shape.',
|
|
781
|
+
},
|
|
782
|
+
},
|
|
783
|
+
},
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* Canvas showing shapes with wide aspect ratios (width > height)
|
|
788
|
+
*/
|
|
789
|
+
const wideShapesCanvas: ExtendedCanvas = {
|
|
790
|
+
nodes: [
|
|
791
|
+
{
|
|
792
|
+
id: 'rect-wide',
|
|
793
|
+
type: 'text',
|
|
794
|
+
x: 50,
|
|
795
|
+
y: 80,
|
|
796
|
+
width: 280,
|
|
797
|
+
height: 60,
|
|
798
|
+
text: 'Wide Rectangle (280x60)',
|
|
799
|
+
color: 6,
|
|
800
|
+
pv: {
|
|
801
|
+
nodeType: 'rect-wide',
|
|
802
|
+
shape: 'rectangle',
|
|
803
|
+
icon: 'RectangleHorizontal',
|
|
804
|
+
},
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
id: 'circle-wide',
|
|
808
|
+
type: 'text',
|
|
809
|
+
x: 380,
|
|
810
|
+
y: 80,
|
|
811
|
+
width: 280,
|
|
812
|
+
height: 60,
|
|
813
|
+
text: 'Wide Circle (280x60)',
|
|
814
|
+
color: 5,
|
|
815
|
+
pv: {
|
|
816
|
+
nodeType: 'circle-wide',
|
|
817
|
+
shape: 'circle',
|
|
818
|
+
icon: 'Circle',
|
|
819
|
+
},
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
id: 'hex-wide',
|
|
823
|
+
type: 'text',
|
|
824
|
+
x: 50,
|
|
825
|
+
y: 180,
|
|
826
|
+
width: 280,
|
|
827
|
+
height: 60,
|
|
828
|
+
text: 'Wide Hexagon (280x60)',
|
|
829
|
+
color: 4,
|
|
830
|
+
pv: {
|
|
831
|
+
nodeType: 'hex-wide',
|
|
832
|
+
shape: 'hexagon',
|
|
833
|
+
icon: 'Hexagon',
|
|
834
|
+
},
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
id: 'diamond-wide',
|
|
838
|
+
type: 'text',
|
|
839
|
+
x: 380,
|
|
840
|
+
y: 180,
|
|
841
|
+
width: 280,
|
|
842
|
+
height: 60,
|
|
843
|
+
text: 'Wide Diamond (280x60)',
|
|
844
|
+
color: 2,
|
|
845
|
+
pv: {
|
|
846
|
+
nodeType: 'diamond-wide',
|
|
847
|
+
shape: 'diamond',
|
|
848
|
+
icon: 'Diamond',
|
|
849
|
+
},
|
|
850
|
+
},
|
|
851
|
+
// Extra wide versions
|
|
852
|
+
{
|
|
853
|
+
id: 'rect-extra-wide',
|
|
854
|
+
type: 'text',
|
|
855
|
+
x: 50,
|
|
856
|
+
y: 280,
|
|
857
|
+
width: 400,
|
|
858
|
+
height: 50,
|
|
859
|
+
text: 'Extra Wide Rectangle (400x50)',
|
|
860
|
+
color: 6,
|
|
861
|
+
pv: {
|
|
862
|
+
nodeType: 'rect-extra-wide',
|
|
863
|
+
shape: 'rectangle',
|
|
864
|
+
icon: 'RectangleHorizontal',
|
|
865
|
+
},
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
id: 'hex-extra-wide',
|
|
869
|
+
type: 'text',
|
|
870
|
+
x: 50,
|
|
871
|
+
y: 360,
|
|
872
|
+
width: 400,
|
|
873
|
+
height: 50,
|
|
874
|
+
text: 'Extra Wide Hexagon (400x50)',
|
|
875
|
+
color: 4,
|
|
876
|
+
pv: {
|
|
877
|
+
nodeType: 'hex-extra-wide',
|
|
878
|
+
shape: 'hexagon',
|
|
879
|
+
icon: 'Hexagon',
|
|
880
|
+
},
|
|
881
|
+
},
|
|
882
|
+
],
|
|
883
|
+
edges: [],
|
|
884
|
+
pv: {
|
|
885
|
+
version: '1.0.0',
|
|
886
|
+
name: 'Wide Shapes Audit',
|
|
887
|
+
description: 'Node shapes with wide aspect ratios',
|
|
888
|
+
edgeTypes: {},
|
|
889
|
+
},
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
export const WideShapes: Story = {
|
|
893
|
+
args: {
|
|
894
|
+
canvas: wideShapesCanvas,
|
|
895
|
+
width: 750,
|
|
896
|
+
height: 480,
|
|
897
|
+
},
|
|
898
|
+
parameters: {
|
|
899
|
+
docs: {
|
|
900
|
+
description: {
|
|
901
|
+
story: `
|
|
902
|
+
**Wide Aspect Ratio Shapes**
|
|
903
|
+
|
|
904
|
+
Tests how each shape handles wide aspect ratios (width >> height):
|
|
905
|
+
- **Row 1**: Wide shapes at 280x60
|
|
906
|
+
- **Row 2**: Wide shapes at 280x60
|
|
907
|
+
- **Row 3-4**: Extra wide shapes at 400x50
|
|
908
|
+
|
|
909
|
+
Use this to audit:
|
|
910
|
+
- How circle handles non-square dimensions (should it force square or stretch?)
|
|
911
|
+
- How hexagon clip-path scales horizontally
|
|
912
|
+
- How diamond rotation works with rectangular dimensions
|
|
913
|
+
`,
|
|
914
|
+
},
|
|
915
|
+
},
|
|
916
|
+
},
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Canvas showing shapes with tall aspect ratios (height > width)
|
|
921
|
+
*/
|
|
922
|
+
const tallShapesCanvas: ExtendedCanvas = {
|
|
923
|
+
nodes: [
|
|
924
|
+
{
|
|
925
|
+
id: 'rect-tall',
|
|
926
|
+
type: 'text',
|
|
927
|
+
x: 50,
|
|
928
|
+
y: 50,
|
|
929
|
+
width: 80,
|
|
930
|
+
height: 200,
|
|
931
|
+
text: 'Tall Rect',
|
|
932
|
+
color: 6,
|
|
933
|
+
pv: {
|
|
934
|
+
nodeType: 'rect-tall',
|
|
935
|
+
shape: 'rectangle',
|
|
936
|
+
icon: 'RectangleVertical',
|
|
937
|
+
},
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
id: 'circle-tall',
|
|
941
|
+
type: 'text',
|
|
942
|
+
x: 180,
|
|
943
|
+
y: 50,
|
|
944
|
+
width: 80,
|
|
945
|
+
height: 200,
|
|
946
|
+
text: 'Tall Circle',
|
|
947
|
+
color: 5,
|
|
948
|
+
pv: {
|
|
949
|
+
nodeType: 'circle-tall',
|
|
950
|
+
shape: 'circle',
|
|
951
|
+
icon: 'Circle',
|
|
952
|
+
},
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
id: 'hex-tall',
|
|
956
|
+
type: 'text',
|
|
957
|
+
x: 310,
|
|
958
|
+
y: 50,
|
|
959
|
+
width: 80,
|
|
960
|
+
height: 200,
|
|
961
|
+
text: 'Tall Hex',
|
|
962
|
+
color: 4,
|
|
963
|
+
pv: {
|
|
964
|
+
nodeType: 'hex-tall',
|
|
965
|
+
shape: 'hexagon',
|
|
966
|
+
icon: 'Hexagon',
|
|
967
|
+
},
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
id: 'diamond-tall',
|
|
971
|
+
type: 'text',
|
|
972
|
+
x: 440,
|
|
973
|
+
y: 50,
|
|
974
|
+
width: 80,
|
|
975
|
+
height: 200,
|
|
976
|
+
text: 'Tall',
|
|
977
|
+
color: 2,
|
|
978
|
+
pv: {
|
|
979
|
+
nodeType: 'diamond-tall',
|
|
980
|
+
shape: 'diamond',
|
|
981
|
+
icon: 'Diamond',
|
|
982
|
+
},
|
|
983
|
+
},
|
|
984
|
+
// Extra tall versions
|
|
985
|
+
{
|
|
986
|
+
id: 'rect-extra-tall',
|
|
987
|
+
type: 'text',
|
|
988
|
+
x: 570,
|
|
989
|
+
y: 50,
|
|
990
|
+
width: 60,
|
|
991
|
+
height: 280,
|
|
992
|
+
text: 'Extra Tall',
|
|
993
|
+
color: 6,
|
|
994
|
+
pv: {
|
|
995
|
+
nodeType: 'rect-extra-tall',
|
|
996
|
+
shape: 'rectangle',
|
|
997
|
+
icon: 'RectangleVertical',
|
|
998
|
+
},
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
id: 'hex-extra-tall',
|
|
1002
|
+
type: 'text',
|
|
1003
|
+
x: 680,
|
|
1004
|
+
y: 50,
|
|
1005
|
+
width: 60,
|
|
1006
|
+
height: 280,
|
|
1007
|
+
text: 'Extra Tall',
|
|
1008
|
+
color: 4,
|
|
1009
|
+
pv: {
|
|
1010
|
+
nodeType: 'hex-extra-tall',
|
|
1011
|
+
shape: 'hexagon',
|
|
1012
|
+
icon: 'Hexagon',
|
|
1013
|
+
},
|
|
1014
|
+
},
|
|
1015
|
+
],
|
|
1016
|
+
edges: [],
|
|
1017
|
+
pv: {
|
|
1018
|
+
version: '1.0.0',
|
|
1019
|
+
name: 'Tall Shapes Audit',
|
|
1020
|
+
description: 'Node shapes with tall aspect ratios',
|
|
1021
|
+
edgeTypes: {},
|
|
1022
|
+
},
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
export const TallShapes: Story = {
|
|
1026
|
+
args: {
|
|
1027
|
+
canvas: tallShapesCanvas,
|
|
1028
|
+
width: 800,
|
|
1029
|
+
height: 400,
|
|
1030
|
+
},
|
|
1031
|
+
parameters: {
|
|
1032
|
+
docs: {
|
|
1033
|
+
description: {
|
|
1034
|
+
story: `
|
|
1035
|
+
**Tall Aspect Ratio Shapes**
|
|
1036
|
+
|
|
1037
|
+
Tests how each shape handles tall aspect ratios (height >> width):
|
|
1038
|
+
- **Columns 1-4**: Tall shapes at 80x200
|
|
1039
|
+
- **Columns 5-6**: Extra tall shapes at 60x280
|
|
1040
|
+
|
|
1041
|
+
Use this to audit:
|
|
1042
|
+
- How circle handles non-square dimensions
|
|
1043
|
+
- How hexagon clip-path scales vertically
|
|
1044
|
+
- How diamond rotation works with tall rectangular dimensions
|
|
1045
|
+
- Text/icon placement in narrow vertical spaces
|
|
1046
|
+
`,
|
|
1047
|
+
},
|
|
1048
|
+
},
|
|
1049
|
+
},
|
|
1050
|
+
};
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* Canvas showing extreme aspect ratios for stress testing
|
|
1054
|
+
*/
|
|
1055
|
+
const extremeAspectRatiosCanvas: ExtendedCanvas = {
|
|
1056
|
+
nodes: [
|
|
1057
|
+
// Very wide row
|
|
1058
|
+
{
|
|
1059
|
+
id: 'rect-very-wide',
|
|
1060
|
+
type: 'text',
|
|
1061
|
+
x: 50,
|
|
1062
|
+
y: 50,
|
|
1063
|
+
width: 500,
|
|
1064
|
+
height: 40,
|
|
1065
|
+
text: 'Very Wide Rectangle (500x40) - Testing extreme horizontal stretch',
|
|
1066
|
+
color: 6,
|
|
1067
|
+
pv: {
|
|
1068
|
+
nodeType: 'rect-very-wide',
|
|
1069
|
+
shape: 'rectangle',
|
|
1070
|
+
},
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
id: 'hex-very-wide',
|
|
1074
|
+
type: 'text',
|
|
1075
|
+
x: 50,
|
|
1076
|
+
y: 120,
|
|
1077
|
+
width: 500,
|
|
1078
|
+
height: 40,
|
|
1079
|
+
text: 'Very Wide Hexagon (500x40) - Testing clip-path at extremes',
|
|
1080
|
+
color: 4,
|
|
1081
|
+
pv: {
|
|
1082
|
+
nodeType: 'hex-very-wide',
|
|
1083
|
+
shape: 'hexagon',
|
|
1084
|
+
},
|
|
1085
|
+
},
|
|
1086
|
+
// Very tall column
|
|
1087
|
+
{
|
|
1088
|
+
id: 'rect-very-tall',
|
|
1089
|
+
type: 'text',
|
|
1090
|
+
x: 600,
|
|
1091
|
+
y: 50,
|
|
1092
|
+
width: 50,
|
|
1093
|
+
height: 300,
|
|
1094
|
+
text: 'Very Tall',
|
|
1095
|
+
color: 6,
|
|
1096
|
+
pv: {
|
|
1097
|
+
nodeType: 'rect-very-tall',
|
|
1098
|
+
shape: 'rectangle',
|
|
1099
|
+
},
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
id: 'hex-very-tall',
|
|
1103
|
+
type: 'text',
|
|
1104
|
+
x: 700,
|
|
1105
|
+
y: 50,
|
|
1106
|
+
width: 50,
|
|
1107
|
+
height: 300,
|
|
1108
|
+
text: 'Very Tall',
|
|
1109
|
+
color: 4,
|
|
1110
|
+
pv: {
|
|
1111
|
+
nodeType: 'hex-very-tall',
|
|
1112
|
+
shape: 'hexagon',
|
|
1113
|
+
},
|
|
1114
|
+
},
|
|
1115
|
+
// Circle and diamond with extreme ratios (should these enforce square?)
|
|
1116
|
+
{
|
|
1117
|
+
id: 'circle-extreme-wide',
|
|
1118
|
+
type: 'text',
|
|
1119
|
+
x: 50,
|
|
1120
|
+
y: 200,
|
|
1121
|
+
width: 200,
|
|
1122
|
+
height: 40,
|
|
1123
|
+
text: 'Circle Wide?',
|
|
1124
|
+
color: 5,
|
|
1125
|
+
pv: {
|
|
1126
|
+
nodeType: 'circle-extreme-wide',
|
|
1127
|
+
shape: 'circle',
|
|
1128
|
+
},
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
id: 'diamond-extreme-wide',
|
|
1132
|
+
type: 'text',
|
|
1133
|
+
x: 300,
|
|
1134
|
+
y: 200,
|
|
1135
|
+
width: 200,
|
|
1136
|
+
height: 40,
|
|
1137
|
+
text: 'Diamond Wide?',
|
|
1138
|
+
color: 2,
|
|
1139
|
+
pv: {
|
|
1140
|
+
nodeType: 'diamond-extreme-wide',
|
|
1141
|
+
shape: 'diamond',
|
|
1142
|
+
},
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
id: 'circle-extreme-tall',
|
|
1146
|
+
type: 'text',
|
|
1147
|
+
x: 50,
|
|
1148
|
+
y: 280,
|
|
1149
|
+
width: 50,
|
|
1150
|
+
height: 120,
|
|
1151
|
+
text: 'Tall?',
|
|
1152
|
+
color: 5,
|
|
1153
|
+
pv: {
|
|
1154
|
+
nodeType: 'circle-extreme-tall',
|
|
1155
|
+
shape: 'circle',
|
|
1156
|
+
},
|
|
1157
|
+
},
|
|
1158
|
+
{
|
|
1159
|
+
id: 'diamond-extreme-tall',
|
|
1160
|
+
type: 'text',
|
|
1161
|
+
x: 150,
|
|
1162
|
+
y: 280,
|
|
1163
|
+
width: 50,
|
|
1164
|
+
height: 120,
|
|
1165
|
+
text: 'Tall?',
|
|
1166
|
+
color: 2,
|
|
1167
|
+
pv: {
|
|
1168
|
+
nodeType: 'diamond-extreme-tall',
|
|
1169
|
+
shape: 'diamond',
|
|
1170
|
+
},
|
|
1171
|
+
},
|
|
1172
|
+
],
|
|
1173
|
+
edges: [],
|
|
1174
|
+
pv: {
|
|
1175
|
+
version: '1.0.0',
|
|
1176
|
+
name: 'Extreme Aspect Ratios',
|
|
1177
|
+
description: 'Stress testing node shapes with extreme dimensions',
|
|
1178
|
+
edgeTypes: {},
|
|
1179
|
+
},
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1182
|
+
export const ExtremeAspectRatios: Story = {
|
|
1183
|
+
args: {
|
|
1184
|
+
canvas: extremeAspectRatiosCanvas,
|
|
1185
|
+
width: 800,
|
|
1186
|
+
height: 450,
|
|
1187
|
+
},
|
|
1188
|
+
parameters: {
|
|
1189
|
+
docs: {
|
|
1190
|
+
description: {
|
|
1191
|
+
story: `
|
|
1192
|
+
**Extreme Aspect Ratios (Stress Test)**
|
|
1193
|
+
|
|
1194
|
+
Tests shapes at extreme aspect ratios to identify edge cases:
|
|
1195
|
+
- **500x40**: Very wide shapes
|
|
1196
|
+
- **50x300**: Very tall shapes
|
|
1197
|
+
- Circle with non-square dimensions (should it enforce square or stretch?)
|
|
1198
|
+
|
|
1199
|
+
Key questions to answer:
|
|
1200
|
+
1. Does circle force equal width/height or stretch?
|
|
1201
|
+
2. Does hexagon clip-path degrade gracefully at extremes?
|
|
1202
|
+
3. Does diamond clip-path work correctly at extremes?
|
|
1203
|
+
4. Is text readable in narrow/short shapes?
|
|
1204
|
+
`,
|
|
1205
|
+
},
|
|
1206
|
+
},
|
|
1207
|
+
},
|
|
1208
|
+
};
|