@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.
Files changed (496) hide show
  1. package/README.md +93 -0
  2. package/dist/components/ConfigurationSelector.d.ts +35 -0
  3. package/dist/components/ConfigurationSelector.d.ts.map +1 -0
  4. package/dist/components/ConfigurationSelector.js +63 -0
  5. package/dist/components/ConfigurationSelector.js.map +1 -0
  6. package/dist/components/GraphRenderer.d.ts +295 -0
  7. package/dist/components/GraphRenderer.d.ts.map +1 -0
  8. package/dist/components/GraphRenderer.js +2008 -0
  9. package/dist/components/GraphRenderer.js.map +1 -0
  10. package/dist/components/MultiCanvasRenderer.d.ts +75 -0
  11. package/dist/components/MultiCanvasRenderer.d.ts.map +1 -0
  12. package/dist/components/MultiCanvasRenderer.js +203 -0
  13. package/dist/components/MultiCanvasRenderer.js.map +1 -0
  14. package/dist/components/NodeTooltip.d.ts +24 -0
  15. package/dist/components/NodeTooltip.d.ts.map +1 -0
  16. package/dist/components/NodeTooltip.js +160 -0
  17. package/dist/components/NodeTooltip.js.map +1 -0
  18. package/dist/components/SelectionSidebar.d.ts +18 -0
  19. package/dist/components/SelectionSidebar.d.ts.map +1 -0
  20. package/dist/components/SelectionSidebar.js +190 -0
  21. package/dist/components/SelectionSidebar.js.map +1 -0
  22. package/dist/components/SequenceDiagramRenderer.d.ts +77 -0
  23. package/dist/components/SequenceDiagramRenderer.d.ts.map +1 -0
  24. package/dist/components/SequenceDiagramRenderer.js +604 -0
  25. package/dist/components/SequenceDiagramRenderer.js.map +1 -0
  26. package/dist/components/WorkflowSequenceDiagram.d.ts +63 -0
  27. package/dist/components/WorkflowSequenceDiagram.d.ts.map +1 -0
  28. package/dist/components/WorkflowSequenceDiagram.js +147 -0
  29. package/dist/components/WorkflowSequenceDiagram.js.map +1 -0
  30. package/dist/components/dashboard/DashboardRenderer.d.ts +10 -0
  31. package/dist/components/dashboard/DashboardRenderer.d.ts.map +1 -0
  32. package/dist/components/dashboard/DashboardRenderer.js +179 -0
  33. package/dist/components/dashboard/DashboardRenderer.js.map +1 -0
  34. package/dist/components/dashboard/MetricPanel.d.ts +10 -0
  35. package/dist/components/dashboard/MetricPanel.d.ts.map +1 -0
  36. package/dist/components/dashboard/MetricPanel.js +103 -0
  37. package/dist/components/dashboard/MetricPanel.js.map +1 -0
  38. package/dist/components/dashboard/MockDataProvider.d.ts +30 -0
  39. package/dist/components/dashboard/MockDataProvider.d.ts.map +1 -0
  40. package/dist/components/dashboard/MockDataProvider.js +270 -0
  41. package/dist/components/dashboard/MockDataProvider.js.map +1 -0
  42. package/dist/components/dashboard/components/BarChart.d.ts +10 -0
  43. package/dist/components/dashboard/components/BarChart.d.ts.map +1 -0
  44. package/dist/components/dashboard/components/BarChart.js +167 -0
  45. package/dist/components/dashboard/components/BarChart.js.map +1 -0
  46. package/dist/components/dashboard/components/LineChart.d.ts +10 -0
  47. package/dist/components/dashboard/components/LineChart.d.ts.map +1 -0
  48. package/dist/components/dashboard/components/LineChart.js +141 -0
  49. package/dist/components/dashboard/components/LineChart.js.map +1 -0
  50. package/dist/components/dashboard/components/MetricCard.d.ts +9 -0
  51. package/dist/components/dashboard/components/MetricCard.d.ts.map +1 -0
  52. package/dist/components/dashboard/components/MetricCard.js +163 -0
  53. package/dist/components/dashboard/components/MetricCard.js.map +1 -0
  54. package/dist/components/dashboard/components/SourceLink.d.ts +9 -0
  55. package/dist/components/dashboard/components/SourceLink.d.ts.map +1 -0
  56. package/dist/components/dashboard/components/SourceLink.js +39 -0
  57. package/dist/components/dashboard/components/SourceLink.js.map +1 -0
  58. package/dist/components/dashboard/components/TimeRangeSelector.d.ts +9 -0
  59. package/dist/components/dashboard/components/TimeRangeSelector.d.ts.map +1 -0
  60. package/dist/components/dashboard/components/TimeRangeSelector.js +167 -0
  61. package/dist/components/dashboard/components/TimeRangeSelector.js.map +1 -0
  62. package/dist/components/dashboard/components/index.d.ts +6 -0
  63. package/dist/components/dashboard/components/index.d.ts.map +1 -0
  64. package/dist/components/dashboard/components/index.js +6 -0
  65. package/dist/components/dashboard/components/index.js.map +1 -0
  66. package/dist/components/dashboard/index.d.ts +6 -0
  67. package/dist/components/dashboard/index.d.ts.map +1 -0
  68. package/dist/components/dashboard/index.js +8 -0
  69. package/dist/components/dashboard/index.js.map +1 -0
  70. package/dist/components/dashboard/types.d.ts +74 -0
  71. package/dist/components/dashboard/types.d.ts.map +1 -0
  72. package/dist/components/dashboard/types.js +8 -0
  73. package/dist/components/dashboard/types.js.map +1 -0
  74. package/dist/components/session-events/SessionEventFeed.d.ts +34 -0
  75. package/dist/components/session-events/SessionEventFeed.d.ts.map +1 -0
  76. package/dist/components/session-events/SessionEventFeed.js +1196 -0
  77. package/dist/components/session-events/SessionEventFeed.js.map +1 -0
  78. package/dist/components/session-events/index.d.ts +7 -0
  79. package/dist/components/session-events/index.d.ts.map +1 -0
  80. package/dist/components/session-events/index.js +6 -0
  81. package/dist/components/session-events/index.js.map +1 -0
  82. package/dist/components/state-view/PipelineView.d.ts +14 -0
  83. package/dist/components/state-view/PipelineView.d.ts.map +1 -0
  84. package/dist/components/state-view/PipelineView.js +195 -0
  85. package/dist/components/state-view/PipelineView.js.map +1 -0
  86. package/dist/components/state-view/index.d.ts +14 -0
  87. package/dist/components/state-view/index.d.ts.map +1 -0
  88. package/dist/components/state-view/index.js +12 -0
  89. package/dist/components/state-view/index.js.map +1 -0
  90. package/dist/components/state-view/types.d.ts +188 -0
  91. package/dist/components/state-view/types.d.ts.map +1 -0
  92. package/dist/components/state-view/types.js +10 -0
  93. package/dist/components/state-view/types.js.map +1 -0
  94. package/dist/components/state-view/useStateView.d.ts +32 -0
  95. package/dist/components/state-view/useStateView.d.ts.map +1 -0
  96. package/dist/components/state-view/useStateView.js +129 -0
  97. package/dist/components/state-view/useStateView.js.map +1 -0
  98. package/dist/contexts/GraphEditContext.d.ts +20 -0
  99. package/dist/contexts/GraphEditContext.d.ts.map +1 -0
  100. package/dist/contexts/GraphEditContext.js +8 -0
  101. package/dist/contexts/GraphEditContext.js.map +1 -0
  102. package/dist/contexts/TooltipPortalContext.d.ts +8 -0
  103. package/dist/contexts/TooltipPortalContext.d.ts.map +1 -0
  104. package/dist/contexts/TooltipPortalContext.js +8 -0
  105. package/dist/contexts/TooltipPortalContext.js.map +1 -0
  106. package/dist/edges/CustomEdge.d.ts +24 -0
  107. package/dist/edges/CustomEdge.d.ts.map +1 -0
  108. package/dist/edges/CustomEdge.js +222 -0
  109. package/dist/edges/CustomEdge.js.map +1 -0
  110. package/dist/edges/GenericEdge.d.ts +18 -0
  111. package/dist/edges/GenericEdge.d.ts.map +1 -0
  112. package/dist/edges/GenericEdge.js +10 -0
  113. package/dist/edges/GenericEdge.js.map +1 -0
  114. package/dist/graphify/anchor.d.ts +28 -0
  115. package/dist/graphify/anchor.d.ts.map +1 -0
  116. package/dist/graphify/anchor.js +132 -0
  117. package/dist/graphify/anchor.js.map +1 -0
  118. package/dist/graphify/consolidated.d.ts +210 -0
  119. package/dist/graphify/consolidated.d.ts.map +1 -0
  120. package/dist/graphify/consolidated.js +11 -0
  121. package/dist/graphify/consolidated.js.map +1 -0
  122. package/dist/graphify/ids.d.ts +19 -0
  123. package/dist/graphify/ids.d.ts.map +1 -0
  124. package/dist/graphify/ids.js +46 -0
  125. package/dist/graphify/ids.js.map +1 -0
  126. package/dist/graphify/index.d.ts +18 -0
  127. package/dist/graphify/index.d.ts.map +1 -0
  128. package/dist/graphify/index.js +12 -0
  129. package/dist/graphify/index.js.map +1 -0
  130. package/dist/graphify/kind.d.ts +23 -0
  131. package/dist/graphify/kind.d.ts.map +1 -0
  132. package/dist/graphify/kind.js +77 -0
  133. package/dist/graphify/kind.js.map +1 -0
  134. package/dist/graphify/resolve.d.ts +48 -0
  135. package/dist/graphify/resolve.d.ts.map +1 -0
  136. package/dist/graphify/resolve.js +83 -0
  137. package/dist/graphify/resolve.js.map +1 -0
  138. package/dist/graphify/signature.d.ts +87 -0
  139. package/dist/graphify/signature.d.ts.map +1 -0
  140. package/dist/graphify/signature.js +276 -0
  141. package/dist/graphify/signature.js.map +1 -0
  142. package/dist/graphify/types.d.ts +141 -0
  143. package/dist/graphify/types.d.ts.map +1 -0
  144. package/dist/graphify/types.js +8 -0
  145. package/dist/graphify/types.js.map +1 -0
  146. package/dist/hooks/useElkLayout.d.ts +66 -0
  147. package/dist/hooks/useElkLayout.d.ts.map +1 -0
  148. package/dist/hooks/useElkLayout.js +136 -0
  149. package/dist/hooks/useElkLayout.js.map +1 -0
  150. package/dist/hooks/usePathBasedEvents.d.ts +42 -0
  151. package/dist/hooks/usePathBasedEvents.d.ts.map +1 -0
  152. package/dist/hooks/usePathBasedEvents.js +119 -0
  153. package/dist/hooks/usePathBasedEvents.js.map +1 -0
  154. package/dist/hooks/useSequenceLayout.d.ts +186 -0
  155. package/dist/hooks/useSequenceLayout.d.ts.map +1 -0
  156. package/dist/hooks/useSequenceLayout.js +327 -0
  157. package/dist/hooks/useSequenceLayout.js.map +1 -0
  158. package/dist/hooks/useUndoRedo.d.ts +80 -0
  159. package/dist/hooks/useUndoRedo.d.ts.map +1 -0
  160. package/dist/hooks/useUndoRedo.js +70 -0
  161. package/dist/hooks/useUndoRedo.js.map +1 -0
  162. package/dist/index.d.ts +73 -0
  163. package/dist/index.d.ts.map +1 -0
  164. package/dist/index.js +51 -0
  165. package/dist/index.js.map +1 -0
  166. package/dist/nodes/CustomNode.d.ts +28 -0
  167. package/dist/nodes/CustomNode.d.ts.map +1 -0
  168. package/dist/nodes/CustomNode.js +820 -0
  169. package/dist/nodes/CustomNode.js.map +1 -0
  170. package/dist/nodes/GenericNode.d.ts +20 -0
  171. package/dist/nodes/GenericNode.d.ts.map +1 -0
  172. package/dist/nodes/GenericNode.js +20 -0
  173. package/dist/nodes/GenericNode.js.map +1 -0
  174. package/dist/nodes/otel/OtelBoundaryNode.d.ts +55 -0
  175. package/dist/nodes/otel/OtelBoundaryNode.d.ts.map +1 -0
  176. package/dist/nodes/otel/OtelBoundaryNode.js +81 -0
  177. package/dist/nodes/otel/OtelBoundaryNode.js.map +1 -0
  178. package/dist/nodes/otel/OtelEventNode.d.ts +59 -0
  179. package/dist/nodes/otel/OtelEventNode.d.ts.map +1 -0
  180. package/dist/nodes/otel/OtelEventNode.js +82 -0
  181. package/dist/nodes/otel/OtelEventNode.js.map +1 -0
  182. package/dist/nodes/otel/OtelResourceNode.d.ts +53 -0
  183. package/dist/nodes/otel/OtelResourceNode.d.ts.map +1 -0
  184. package/dist/nodes/otel/OtelResourceNode.js +105 -0
  185. package/dist/nodes/otel/OtelResourceNode.js.map +1 -0
  186. package/dist/nodes/otel/OtelScopeNode.d.ts +53 -0
  187. package/dist/nodes/otel/OtelScopeNode.d.ts.map +1 -0
  188. package/dist/nodes/otel/OtelScopeNode.js +81 -0
  189. package/dist/nodes/otel/OtelScopeNode.js.map +1 -0
  190. package/dist/nodes/otel/OtelSpanConventionNode.d.ts +61 -0
  191. package/dist/nodes/otel/OtelSpanConventionNode.d.ts.map +1 -0
  192. package/dist/nodes/otel/OtelSpanConventionNode.js +131 -0
  193. package/dist/nodes/otel/OtelSpanConventionNode.js.map +1 -0
  194. package/dist/nodes/otel/index.d.ts +17 -0
  195. package/dist/nodes/otel/index.d.ts.map +1 -0
  196. package/dist/nodes/otel/index.js +13 -0
  197. package/dist/nodes/otel/index.js.map +1 -0
  198. package/dist/nodes/otel/shared/NodeBadges.d.ts +10 -0
  199. package/dist/nodes/otel/shared/NodeBadges.d.ts.map +1 -0
  200. package/dist/nodes/otel/shared/NodeBadges.js +178 -0
  201. package/dist/nodes/otel/shared/NodeBadges.js.map +1 -0
  202. package/dist/nodes/otel/shared/NodeContent.d.ts +10 -0
  203. package/dist/nodes/otel/shared/NodeContent.d.ts.map +1 -0
  204. package/dist/nodes/otel/shared/NodeContent.js +96 -0
  205. package/dist/nodes/otel/shared/NodeContent.js.map +1 -0
  206. package/dist/nodes/otel/shared/index.d.ts +8 -0
  207. package/dist/nodes/otel/shared/index.d.ts.map +1 -0
  208. package/dist/nodes/otel/shared/index.js +8 -0
  209. package/dist/nodes/otel/shared/index.js.map +1 -0
  210. package/dist/nodes/otel/shared/types.d.ts +129 -0
  211. package/dist/nodes/otel/shared/types.d.ts.map +1 -0
  212. package/dist/nodes/otel/shared/types.js +5 -0
  213. package/dist/nodes/otel/shared/types.js.map +1 -0
  214. package/dist/nodes/otel/shared/useNodeBehavior.d.ts +42 -0
  215. package/dist/nodes/otel/shared/useNodeBehavior.d.ts.map +1 -0
  216. package/dist/nodes/otel/shared/useNodeBehavior.js +61 -0
  217. package/dist/nodes/otel/shared/useNodeBehavior.js.map +1 -0
  218. package/dist/pierre/PierreFileView.d.ts +17 -0
  219. package/dist/pierre/PierreFileView.d.ts.map +1 -0
  220. package/dist/pierre/PierreFileView.js +46 -0
  221. package/dist/pierre/PierreFileView.js.map +1 -0
  222. package/dist/pierre/PierreSnippetView.d.ts +28 -0
  223. package/dist/pierre/PierreSnippetView.d.ts.map +1 -0
  224. package/dist/pierre/PierreSnippetView.js +105 -0
  225. package/dist/pierre/PierreSnippetView.js.map +1 -0
  226. package/dist/pierre/PierreThroughlineCodeView.d.ts +22 -0
  227. package/dist/pierre/PierreThroughlineCodeView.d.ts.map +1 -0
  228. package/dist/pierre/PierreThroughlineCodeView.js +206 -0
  229. package/dist/pierre/PierreThroughlineCodeView.js.map +1 -0
  230. package/dist/pierre/constructColors.d.ts +24 -0
  231. package/dist/pierre/constructColors.d.ts.map +1 -0
  232. package/dist/pierre/constructColors.js +91 -0
  233. package/dist/pierre/constructColors.js.map +1 -0
  234. package/dist/pierre/index.d.ts +12 -0
  235. package/dist/pierre/index.d.ts.map +1 -0
  236. package/dist/pierre/index.js +7 -0
  237. package/dist/pierre/index.js.map +1 -0
  238. package/dist/pierre/pierreBackground.d.ts +15 -0
  239. package/dist/pierre/pierreBackground.d.ts.map +1 -0
  240. package/dist/pierre/pierreBackground.js +31 -0
  241. package/dist/pierre/pierreBackground.js.map +1 -0
  242. package/dist/pierre/pierreFileLang.d.ts +27 -0
  243. package/dist/pierre/pierreFileLang.d.ts.map +1 -0
  244. package/dist/pierre/pierreFileLang.js +52 -0
  245. package/dist/pierre/pierreFileLang.js.map +1 -0
  246. package/dist/pierre/pierreSyntaxTheme.d.ts +11 -0
  247. package/dist/pierre/pierreSyntaxTheme.d.ts.map +1 -0
  248. package/dist/pierre/pierreSyntaxTheme.js +20 -0
  249. package/dist/pierre/pierreSyntaxTheme.js.map +1 -0
  250. package/dist/pierre/scrollAnchor.d.ts +5 -0
  251. package/dist/pierre/scrollAnchor.d.ts.map +1 -0
  252. package/dist/pierre/scrollAnchor.js +9 -0
  253. package/dist/pierre/scrollAnchor.js.map +1 -0
  254. package/dist/pierre/sliceSnippet.d.ts +10 -0
  255. package/dist/pierre/sliceSnippet.d.ts.map +1 -0
  256. package/dist/pierre/sliceSnippet.js +16 -0
  257. package/dist/pierre/sliceSnippet.js.map +1 -0
  258. package/dist/pierre/syntaxTokens.d.ts +11 -0
  259. package/dist/pierre/syntaxTokens.d.ts.map +1 -0
  260. package/dist/pierre/syntaxTokens.js +51 -0
  261. package/dist/pierre/syntaxTokens.js.map +1 -0
  262. package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts +8 -0
  263. package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +1 -0
  264. package/dist/stories/Subsystem/ComponentGraph/fixtures.js +116 -0
  265. package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +1 -0
  266. package/dist/subsystem/ComponentDeclaration.d.ts +87 -0
  267. package/dist/subsystem/ComponentDeclaration.d.ts.map +1 -0
  268. package/dist/subsystem/ComponentDeclaration.js +374 -0
  269. package/dist/subsystem/ComponentDeclaration.js.map +1 -0
  270. package/dist/subsystem/FileDrawer.d.ts +17 -0
  271. package/dist/subsystem/FileDrawer.d.ts.map +1 -0
  272. package/dist/subsystem/FileDrawer.js +72 -0
  273. package/dist/subsystem/FileDrawer.js.map +1 -0
  274. package/dist/subsystem/GraphLayoutCover.d.ts +20 -0
  275. package/dist/subsystem/GraphLayoutCover.d.ts.map +1 -0
  276. package/dist/subsystem/GraphLayoutCover.js +42 -0
  277. package/dist/subsystem/GraphLayoutCover.js.map +1 -0
  278. package/dist/subsystem/SubsystemComponentGraph.d.ts +96 -0
  279. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -0
  280. package/dist/subsystem/SubsystemComponentGraph.js +1059 -0
  281. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -0
  282. package/dist/subsystem/SubsystemFileTree.d.ts +24 -0
  283. package/dist/subsystem/SubsystemFileTree.d.ts.map +1 -0
  284. package/dist/subsystem/SubsystemFileTree.js +150 -0
  285. package/dist/subsystem/SubsystemFileTree.js.map +1 -0
  286. package/dist/subsystem/declarationRef.d.ts +39 -0
  287. package/dist/subsystem/declarationRef.d.ts.map +1 -0
  288. package/dist/subsystem/declarationRef.js +32 -0
  289. package/dist/subsystem/declarationRef.js.map +1 -0
  290. package/dist/subsystem/formatDeclaration.d.ts +11 -0
  291. package/dist/subsystem/formatDeclaration.d.ts.map +1 -0
  292. package/dist/subsystem/formatDeclaration.js +146 -0
  293. package/dist/subsystem/formatDeclaration.js.map +1 -0
  294. package/dist/subsystem/model.d.ts +353 -0
  295. package/dist/subsystem/model.d.ts.map +1 -0
  296. package/dist/subsystem/model.js +503 -0
  297. package/dist/subsystem/model.js.map +1 -0
  298. package/dist/subsystem/nodes.d.ts +69 -0
  299. package/dist/subsystem/nodes.d.ts.map +1 -0
  300. package/dist/subsystem/nodes.js +289 -0
  301. package/dist/subsystem/nodes.js.map +1 -0
  302. package/dist/subsystem/paths.d.ts +63 -0
  303. package/dist/subsystem/paths.d.ts.map +1 -0
  304. package/dist/subsystem/paths.js +86 -0
  305. package/dist/subsystem/paths.js.map +1 -0
  306. package/dist/subsystem/tokenizeComponent.d.ts +20 -0
  307. package/dist/subsystem/tokenizeComponent.d.ts.map +1 -0
  308. package/dist/subsystem/tokenizeComponent.js +56 -0
  309. package/dist/subsystem/tokenizeComponent.js.map +1 -0
  310. package/dist/subsystem/tokenizeFormatted.d.ts +12 -0
  311. package/dist/subsystem/tokenizeFormatted.d.ts.map +1 -0
  312. package/dist/subsystem/tokenizeFormatted.js +13 -0
  313. package/dist/subsystem/tokenizeFormatted.js.map +1 -0
  314. package/dist/utils/animationMapping.d.ts +53 -0
  315. package/dist/utils/animationMapping.d.ts.map +1 -0
  316. package/dist/utils/animationMapping.js +126 -0
  317. package/dist/utils/animationMapping.js.map +1 -0
  318. package/dist/utils/canvasBounds.d.ts +50 -0
  319. package/dist/utils/canvasBounds.d.ts.map +1 -0
  320. package/dist/utils/canvasBounds.js +88 -0
  321. package/dist/utils/canvasBounds.js.map +1 -0
  322. package/dist/utils/elkLayout.d.ts +137 -0
  323. package/dist/utils/elkLayout.d.ts.map +1 -0
  324. package/dist/utils/elkLayout.js +596 -0
  325. package/dist/utils/elkLayout.js.map +1 -0
  326. package/dist/utils/graphConverter.d.ts +18 -0
  327. package/dist/utils/graphConverter.d.ts.map +1 -0
  328. package/dist/utils/graphConverter.js +114 -0
  329. package/dist/utils/graphConverter.js.map +1 -0
  330. package/dist/utils/iconResolver.d.ts +29 -0
  331. package/dist/utils/iconResolver.d.ts.map +1 -0
  332. package/dist/utils/iconResolver.js +30 -0
  333. package/dist/utils/iconResolver.js.map +1 -0
  334. package/dist/utils/orientationUtils.d.ts +19 -0
  335. package/dist/utils/orientationUtils.d.ts.map +1 -0
  336. package/dist/utils/orientationUtils.js +62 -0
  337. package/dist/utils/orientationUtils.js.map +1 -0
  338. package/package.json +80 -0
  339. package/src/components/ConfigurationSelector.tsx +133 -0
  340. package/src/components/GraphRenderer.tsx +3195 -0
  341. package/src/components/MultiCanvasRenderer.tsx +295 -0
  342. package/src/components/NodeTooltip.tsx +279 -0
  343. package/src/components/PendingChanges.test.tsx +375 -0
  344. package/src/components/SelectionSidebar.tsx +352 -0
  345. package/src/components/SequenceDiagramRenderer.tsx +1156 -0
  346. package/src/components/WorkflowSequenceDiagram.tsx +270 -0
  347. package/src/components/dashboard/DashboardRenderer.tsx +317 -0
  348. package/src/components/dashboard/MetricPanel.tsx +254 -0
  349. package/src/components/dashboard/MockDataProvider.ts +330 -0
  350. package/src/components/dashboard/components/BarChart.tsx +299 -0
  351. package/src/components/dashboard/components/LineChart.tsx +279 -0
  352. package/src/components/dashboard/components/MetricCard.tsx +270 -0
  353. package/src/components/dashboard/components/SourceLink.tsx +63 -0
  354. package/src/components/dashboard/components/TimeRangeSelector.tsx +280 -0
  355. package/src/components/dashboard/components/index.ts +5 -0
  356. package/src/components/dashboard/index.ts +47 -0
  357. package/src/components/dashboard/types.ts +126 -0
  358. package/src/components/session-events/SessionEventFeed.tsx +1797 -0
  359. package/src/components/session-events/index.ts +13 -0
  360. package/src/components/state-view/PipelineView.tsx +347 -0
  361. package/src/components/state-view/index.ts +14 -0
  362. package/src/components/state-view/types.ts +261 -0
  363. package/src/components/state-view/useStateView.ts +205 -0
  364. package/src/contexts/GraphEditContext.tsx +27 -0
  365. package/src/contexts/TooltipPortalContext.ts +8 -0
  366. package/src/edges/CustomEdge.tsx +402 -0
  367. package/src/edges/GenericEdge.tsx +36 -0
  368. package/src/graphify/anchor.test.ts +124 -0
  369. package/src/graphify/anchor.ts +160 -0
  370. package/src/graphify/consolidated.ts +246 -0
  371. package/src/graphify/ids.ts +48 -0
  372. package/src/graphify/index.ts +72 -0
  373. package/src/graphify/kind.test.ts +108 -0
  374. package/src/graphify/kind.ts +120 -0
  375. package/src/graphify/resolve.test.ts +89 -0
  376. package/src/graphify/resolve.ts +115 -0
  377. package/src/graphify/signature.test.ts +278 -0
  378. package/src/graphify/signature.ts +354 -0
  379. package/src/graphify/types.ts +164 -0
  380. package/src/hooks/useElkLayout.test.ts +134 -0
  381. package/src/hooks/useElkLayout.ts +191 -0
  382. package/src/hooks/usePathBasedEvents.ts +192 -0
  383. package/src/hooks/useSequenceLayout.ts +543 -0
  384. package/src/hooks/useUndoRedo.ts +144 -0
  385. package/src/index.ts +341 -0
  386. package/src/nodes/CustomNode.tsx +1231 -0
  387. package/src/nodes/GenericNode.tsx +55 -0
  388. package/src/nodes/otel/OtelBoundaryNode.tsx +224 -0
  389. package/src/nodes/otel/OtelEventNode.tsx +225 -0
  390. package/src/nodes/otel/OtelResourceNode.tsx +251 -0
  391. package/src/nodes/otel/OtelScopeNode.tsx +221 -0
  392. package/src/nodes/otel/OtelSpanConventionNode.tsx +295 -0
  393. package/src/nodes/otel/index.ts +23 -0
  394. package/src/nodes/otel/shared/NodeBadges.tsx +295 -0
  395. package/src/nodes/otel/shared/NodeContent.tsx +204 -0
  396. package/src/nodes/otel/shared/index.ts +8 -0
  397. package/src/nodes/otel/shared/types.ts +138 -0
  398. package/src/nodes/otel/shared/useNodeBehavior.ts +114 -0
  399. package/src/pierre/PierreFileView.tsx +81 -0
  400. package/src/pierre/PierreSnippetView.tsx +184 -0
  401. package/src/pierre/PierreThroughlineCodeView.tsx +304 -0
  402. package/src/pierre/constructColors.test.ts +52 -0
  403. package/src/pierre/constructColors.ts +112 -0
  404. package/src/pierre/index.ts +18 -0
  405. package/src/pierre/pierreBackground.ts +33 -0
  406. package/src/pierre/pierreFileLang.test.ts +26 -0
  407. package/src/pierre/pierreFileLang.ts +55 -0
  408. package/src/pierre/pierreSyntaxTheme.ts +23 -0
  409. package/src/pierre/scrollAnchor.test.ts +13 -0
  410. package/src/pierre/scrollAnchor.ts +11 -0
  411. package/src/pierre/sliceSnippet.test.ts +21 -0
  412. package/src/pierre/sliceSnippet.ts +31 -0
  413. package/src/pierre/syntaxTokens.test.ts +35 -0
  414. package/src/pierre/syntaxTokens.ts +60 -0
  415. package/src/stories/Audit/BoundaryNodes.stories.tsx +385 -0
  416. package/src/stories/Audit/CanvasEdgeTypes.stories.tsx +1448 -0
  417. package/src/stories/Audit/CanvasNodeTypes.stories.tsx +1049 -0
  418. package/src/stories/Audit/ColorPriority.stories.tsx +895 -0
  419. package/src/stories/Audit/DiamondBadges.stories.tsx +629 -0
  420. package/src/stories/Audit/NodeDimensionsTesting.stories.tsx +724 -0
  421. package/src/stories/Audit/NodeFieldsAudit.stories.tsx +996 -0
  422. package/src/stories/Audit/NodeFontSizeTesting.stories.tsx +715 -0
  423. package/src/stories/Audit/NodeShapes.stories.tsx +1208 -0
  424. package/src/stories/Audit/WideNodesTesting.stories.tsx +1045 -0
  425. package/src/stories/Components/DashboardRenderer.stories.tsx +263 -0
  426. package/src/stories/Components/GraphRenderer.stories.tsx +3236 -0
  427. package/src/stories/Components/MultiCanvasRenderer.stories.tsx +370 -0
  428. package/src/stories/Components/SequenceDiagram.stories.tsx +255 -0
  429. package/src/stories/Components/StateView.stories.tsx +417 -0
  430. package/src/stories/Components/TraceViewer.stories.tsx +442 -0
  431. package/src/stories/Components/WorkflowSequenceDiagram.stories.tsx +802 -0
  432. package/src/stories/Features/AnimationWorkshop.stories.tsx +727 -0
  433. package/src/stories/Features/ChangeTypeVisual.stories.tsx +67 -0
  434. package/src/stories/Features/EventDrivenAnimations.stories.tsx +513 -0
  435. package/src/stories/Features/MultiConfig.stories.tsx +539 -0
  436. package/src/stories/Introduction.mdx +34 -0
  437. package/src/stories/Layout/ElkEdgeRouting.stories.tsx +539 -0
  438. package/src/stories/Layout/GraphOrientation.stories.tsx +500 -0
  439. package/src/stories/Layout/MultiDirectionalConnections.stories.tsx +352 -0
  440. package/src/stories/Nodes/NodeDefinitionComparison.stories.tsx +560 -0
  441. package/src/stories/Nodes/NodeNameFallbacks.stories.tsx +491 -0
  442. package/src/stories/Nodes/NumericColors.stories.tsx +440 -0
  443. package/src/stories/OTEL/EventNameDisplay.stories.tsx +694 -0
  444. package/src/stories/OTEL/EventNameFallback.stories.tsx +578 -0
  445. package/src/stories/OTEL/OtelComponents.stories.tsx +422 -0
  446. package/src/stories/OTEL/OtelNodeTypesPrototype.stories.tsx +806 -0
  447. package/src/stories/OTEL/RawEventCards.stories.tsx +57 -0
  448. package/src/stories/OTEL/SpanBadges.stories.tsx +840 -0
  449. package/src/stories/OTEL/ValidationEventsCanvas.stories.tsx +209 -0
  450. package/src/stories/Pierre/CodeView.stories.tsx +219 -0
  451. package/src/stories/RealWorld/BacklogMdCanvases.stories.tsx +721 -0
  452. package/src/stories/RealWorld/FileCitySequence.stories.tsx +516 -0
  453. package/src/stories/RealWorld/RealCanvasFiles.stories.tsx +336 -0
  454. package/src/stories/Subsystem/ComponentDeclarationAudit.stories.tsx +321 -0
  455. package/src/stories/Subsystem/ComponentGraph/Appearance.stories.tsx +365 -0
  456. package/src/stories/Subsystem/ComponentGraph/Basics.stories.tsx +137 -0
  457. package/src/stories/Subsystem/ComponentGraph/Captures.stories.tsx +238 -0
  458. package/src/stories/Subsystem/ComponentGraph/DetailPanel.stories.tsx +315 -0
  459. package/src/stories/Subsystem/ComponentGraph/Flows.stories.tsx +239 -0
  460. package/src/stories/Subsystem/ComponentGraph/FrameworkStereotype.stories.tsx +216 -0
  461. package/src/stories/Subsystem/ComponentGraph/GraphTitle.stories.tsx +70 -0
  462. package/src/stories/Subsystem/ComponentGraph/Processes.stories.tsx +68 -0
  463. package/src/stories/Subsystem/ComponentGraph/Scenarios.stories.tsx +959 -0
  464. package/src/stories/Subsystem/ComponentGraph/Spotlights.stories.tsx +681 -0
  465. package/src/stories/Subsystem/ComponentGraph/fixtures.ts +129 -0
  466. package/src/stories/__traces__/test-run.canvas.json +241 -0
  467. package/src/stories/data/activity-feed-analytics.dashboard.json +300 -0
  468. package/src/stories/data/file-city-images-transformed.otel.canvas.json +295 -0
  469. package/src/stories/data/file-city-workflows.json +269 -0
  470. package/src/stories/data/graph-converter-test-execution.json +443 -0
  471. package/src/stories/data/graph-converter-test.workflow.json +105 -0
  472. package/src/stories/data/graph-converter-validated-execution.json +58 -0
  473. package/src/stories/data/opencode-session-raw-events.json +273396 -0
  474. package/src/subsystem/ComponentDeclaration.tsx +643 -0
  475. package/src/subsystem/FileDrawer.tsx +106 -0
  476. package/src/subsystem/GraphLayoutCover.tsx +69 -0
  477. package/src/subsystem/SubsystemComponentGraph.tsx +1644 -0
  478. package/src/subsystem/SubsystemFileTree.tsx +190 -0
  479. package/src/subsystem/declarationRef.test.ts +33 -0
  480. package/src/subsystem/declarationRef.ts +63 -0
  481. package/src/subsystem/formatDeclaration.ts +174 -0
  482. package/src/subsystem/model.test.ts +244 -0
  483. package/src/subsystem/model.ts +850 -0
  484. package/src/subsystem/nodes.test.ts +56 -0
  485. package/src/subsystem/nodes.tsx +443 -0
  486. package/src/subsystem/paths.test.ts +123 -0
  487. package/src/subsystem/paths.ts +127 -0
  488. package/src/subsystem/tokenizeComponent.ts +70 -0
  489. package/src/subsystem/tokenizeFormatted.ts +19 -0
  490. package/src/utils/animationMapping.ts +166 -0
  491. package/src/utils/canvasBounds.ts +146 -0
  492. package/src/utils/elkLayout.test.ts +240 -0
  493. package/src/utils/elkLayout.ts +779 -0
  494. package/src/utils/graphConverter.ts +148 -0
  495. package/src/utils/iconResolver.tsx +53 -0
  496. 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
+ };