semiotic 2.0.3 → 3.0.0-beta.1
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/CLAUDE.md +530 -0
- package/README.md +190 -37
- package/ai/cli.js +48 -0
- package/ai/dist/ai/componentRegistry.js +45 -0
- package/ai/dist/ai/mcp-server.js +99 -0
- package/ai/dist/ai/renderHOCToSVG.js +77 -0
- package/ai/dist/src/components/Annotation.js +358 -0
- package/ai/dist/src/components/AnnotationLayer/AnnotationLayer.js +369 -0
- package/ai/dist/src/components/Axis/Axis.js +373 -0
- package/ai/dist/src/components/Axis/axisTitle.js +14 -0
- package/ai/dist/src/components/Axis/index.js +7 -0
- package/ai/dist/src/components/Axis/summaryGraphic.js +37 -0
- package/ai/dist/src/components/Brush.js +84 -0
- package/ai/dist/src/components/DividedLine.js +65 -0
- package/ai/dist/src/components/FacetController.js +259 -0
- package/ai/dist/src/components/Frame.js +139 -0
- package/ai/dist/src/components/InteractionLayer.js +328 -0
- package/ai/dist/src/components/Legend.js +140 -0
- package/ai/dist/src/components/MiniMap.js +75 -0
- package/ai/dist/src/components/MinimapXYFrame.js +99 -0
- package/ai/dist/src/components/NetworkFrame.js +335 -0
- package/ai/dist/src/components/OrdinalFrame.js +437 -0
- package/ai/dist/src/components/ResponsiveFrame.js +68 -0
- package/ai/dist/src/components/ResponsiveMinimapXYFrame.js +11 -0
- package/ai/dist/src/components/ResponsiveNetworkFrame.js +11 -0
- package/ai/dist/src/components/ResponsiveOrdinalFrame.js +11 -0
- package/ai/dist/src/components/ResponsiveXYFrame.js +10 -0
- package/ai/dist/src/components/SparkFrame.js +113 -0
- package/ai/dist/src/components/SparkNetworkFrame.js +11 -0
- package/ai/dist/src/components/SparkOrdinalFrame.js +11 -0
- package/ai/dist/src/components/SparkXYFrame.js +11 -0
- package/ai/dist/src/components/Tooltip/Tooltip.js +304 -0
- package/ai/dist/src/components/TooltipPositioner/index.js +132 -0
- package/ai/dist/src/components/VisualizationLayer.js +395 -0
- package/ai/dist/src/components/XYFrame.js +524 -0
- package/ai/dist/src/components/annotationLayerBehavior/annotationHandling.js +73 -0
- package/ai/dist/src/components/annotationLayerBehavior/d3labeler.js +254 -0
- package/ai/dist/src/components/annotationRules/baseRules.js +150 -0
- package/ai/dist/src/components/annotationRules/networkframeRules.js +198 -0
- package/ai/dist/src/components/annotationRules/orframeRules.js +695 -0
- package/ai/dist/src/components/annotationRules/xyframeRules.js +299 -0
- package/ai/dist/src/components/batchWork.js +35 -0
- package/ai/dist/src/components/charts/index.js +96 -0
- package/ai/dist/src/components/charts/network/ChordDiagram.js +245 -0
- package/ai/dist/src/components/charts/network/CirclePack.js +177 -0
- package/ai/dist/src/components/charts/network/ForceDirectedGraph.js +248 -0
- package/ai/dist/src/components/charts/network/SankeyDiagram.js +305 -0
- package/ai/dist/src/components/charts/network/TreeDiagram.js +268 -0
- package/ai/dist/src/components/charts/network/Treemap.js +177 -0
- package/ai/dist/src/components/charts/ordinal/BarChart.js +191 -0
- package/ai/dist/src/components/charts/ordinal/BoxPlot.js +235 -0
- package/ai/dist/src/components/charts/ordinal/DonutChart.js +178 -0
- package/ai/dist/src/components/charts/ordinal/DotPlot.js +194 -0
- package/ai/dist/src/components/charts/ordinal/GroupedBarChart.js +194 -0
- package/ai/dist/src/components/charts/ordinal/PieChart.js +155 -0
- package/ai/dist/src/components/charts/ordinal/StackedBarChart.js +213 -0
- package/ai/dist/src/components/charts/ordinal/SwarmPlot.js +219 -0
- package/ai/dist/src/components/charts/realtime/RealtimeBarChart.js +91 -0
- package/ai/dist/src/components/charts/realtime/RealtimeLineChart.js +73 -0
- package/ai/dist/src/components/charts/realtime/RealtimeSwarmChart.js +85 -0
- package/ai/dist/src/components/charts/realtime/RealtimeWaterfallChart.js +86 -0
- package/ai/dist/src/components/charts/shared/ChartError.js +72 -0
- package/ai/dist/src/components/charts/shared/colorUtils.js +138 -0
- package/ai/dist/src/components/charts/shared/formatUtils.js +176 -0
- package/ai/dist/src/components/charts/shared/hooks.js +49 -0
- package/ai/dist/src/components/charts/shared/legendUtils.js +57 -0
- package/ai/dist/src/components/charts/shared/types.js +2 -0
- package/ai/dist/src/components/charts/shared/validateChartData.js +82 -0
- package/ai/dist/src/components/charts/shared/validateProps.js +640 -0
- package/ai/dist/src/components/charts/xy/AreaChart.js +220 -0
- package/ai/dist/src/components/charts/xy/BubbleChart.js +222 -0
- package/ai/dist/src/components/charts/xy/Heatmap.js +230 -0
- package/ai/dist/src/components/charts/xy/LineChart.js +302 -0
- package/ai/dist/src/components/charts/xy/Scatterplot.js +136 -0
- package/ai/dist/src/components/charts/xy/StackedAreaChart.js +220 -0
- package/ai/dist/src/components/constants/coordinateNames.js +11 -0
- package/ai/dist/src/components/constants/frame_props.js +251 -0
- package/ai/dist/src/components/constants/jsx.js +71 -0
- package/ai/dist/src/components/data/dataFunctions.js +473 -0
- package/ai/dist/src/components/data/multiAccessorUtils.js +14 -0
- package/ai/dist/src/components/data/networkPipelineCache.js +43 -0
- package/ai/dist/src/components/data/ordinalPipelineCache.js +53 -0
- package/ai/dist/src/components/data/unflowedFunctions.js +5 -0
- package/ai/dist/src/components/data/xyPipelineCache.js +49 -0
- package/ai/dist/src/components/generic_utilities/functions.js +5 -0
- package/ai/dist/src/components/index.js +145 -0
- package/ai/dist/src/components/interactionLayerBehavior/InteractionCanvas.js +128 -0
- package/ai/dist/src/components/processing/InteractionItems.js +223 -0
- package/ai/dist/src/components/processing/hierarchyUtils.js +104 -0
- package/ai/dist/src/components/processing/layouts/chordLayout.js +58 -0
- package/ai/dist/src/components/processing/layouts/forceLayout.js +142 -0
- package/ai/dist/src/components/processing/layouts/hierarchyLayout.js +31 -0
- package/ai/dist/src/components/processing/layouts/index.js +32 -0
- package/ai/dist/src/components/processing/layouts/sankeyLayout.js +96 -0
- package/ai/dist/src/components/processing/layouts/simpleLayouts.js +34 -0
- package/ai/dist/src/components/processing/layouts/types.js +2 -0
- package/ai/dist/src/components/processing/network.js +771 -0
- package/ai/dist/src/components/processing/networkDefaults.js +39 -0
- package/ai/dist/src/components/processing/networkLayoutHelpers.js +98 -0
- package/ai/dist/src/components/processing/ordinal.js +889 -0
- package/ai/dist/src/components/processing/ordinalConstants.js +23 -0
- package/ai/dist/src/components/processing/ordinalOverlays.js +88 -0
- package/ai/dist/src/components/processing/ordinalRenderPipeline.js +196 -0
- package/ai/dist/src/components/processing/xyDrawing.js +484 -0
- package/ai/dist/src/components/realtime/BinAccumulator.js +36 -0
- package/ai/dist/src/components/realtime/IncrementalExtent.js +55 -0
- package/ai/dist/src/components/realtime/RealtimeFrame.js +710 -0
- package/ai/dist/src/components/realtime/RingBuffer.js +104 -0
- package/ai/dist/src/components/realtime/renderers/barRenderer.js +133 -0
- package/ai/dist/src/components/realtime/renderers/candlestickRenderer.js +7 -0
- package/ai/dist/src/components/realtime/renderers/lineRenderer.js +164 -0
- package/ai/dist/src/components/realtime/renderers/swarmRenderer.js +91 -0
- package/ai/dist/src/components/realtime/renderers/types.js +2 -0
- package/ai/dist/src/components/realtime/renderers/waterfallRenderer.js +163 -0
- package/ai/dist/src/components/realtime/types.js +2 -0
- package/ai/dist/src/components/semiotic-ai.js +66 -0
- package/ai/dist/src/components/semiotic-network.js +30 -0
- package/ai/dist/src/components/semiotic-ordinal.js +28 -0
- package/ai/dist/src/components/semiotic-realtime.js +37 -0
- package/ai/dist/src/components/semiotic-server.js +8 -0
- package/ai/dist/src/components/semiotic-xy.js +41 -0
- package/ai/dist/src/components/semiotic.js +101 -0
- package/ai/dist/src/components/server/renderToStaticSVG.js +392 -0
- package/ai/dist/src/components/store/TooltipStore.js +13 -0
- package/ai/dist/src/components/store/createStore.js +77 -0
- package/ai/dist/src/components/svg/SvgHelper.js +308 -0
- package/ai/dist/src/components/svg/areaDrawing.js +312 -0
- package/ai/dist/src/components/svg/boxplotRenderer.js +441 -0
- package/ai/dist/src/components/svg/bucketizedRenderer.js +677 -0
- package/ai/dist/src/components/svg/ckbinsRenderer.js +92 -0
- package/ai/dist/src/components/svg/ckmeans.js +238 -0
- package/ai/dist/src/components/svg/contourLayout.js +73 -0
- package/ai/dist/src/components/svg/contourRenderer.js +53 -0
- package/ai/dist/src/components/svg/edgeGenerators.js +181 -0
- package/ai/dist/src/components/svg/frameFunctions.js +579 -0
- package/ai/dist/src/components/svg/graphAlgorithms.js +138 -0
- package/ai/dist/src/components/svg/hexbinLayout.js +163 -0
- package/ai/dist/src/components/svg/lineDrawing.js +427 -0
- package/ai/dist/src/components/svg/networkDrawing.js +207 -0
- package/ai/dist/src/components/svg/nodeGenerators.js +131 -0
- package/ai/dist/src/components/svg/pieceDrawing.js +110 -0
- package/ai/dist/src/components/svg/pieceLayouts.js +588 -0
- package/ai/dist/src/components/svg/sankeyLinks.js +143 -0
- package/ai/dist/src/components/svg/summaryAxis.js +48 -0
- package/ai/dist/src/components/svg/summaryLayouts.js +202 -0
- package/ai/dist/src/components/svg/swarmLayout.js +128 -0
- package/ai/dist/src/components/types/annotationTypes.js +2 -0
- package/ai/dist/src/components/types/canvasTypes.js +2 -0
- package/ai/dist/src/components/types/generalTypes.js +2 -0
- package/ai/dist/src/components/types/interactionTypes.js +2 -0
- package/ai/dist/src/components/types/legendTypes.js +2 -0
- package/ai/dist/src/components/types/networkTypes.js +2 -0
- package/ai/dist/src/components/types/ordinalTypes.js +2 -0
- package/ai/dist/src/components/types/xyTypes.js +2 -0
- package/ai/dist/src/components/useBoundingRect.js +24 -0
- package/ai/dist/src/components/useDerivedStateFromProps.js +25 -0
- package/ai/dist/src/components/useLegacyUnmountCallback.js +21 -0
- package/ai/dist/src/components/visualizationLayerBehavior/axis.js +249 -0
- package/ai/dist/src/components/visualizationLayerBehavior/general.js +435 -0
- package/ai/dist/src/setupTests.js +4 -0
- package/ai/examples.md +394 -0
- package/ai/schema.json +1178 -0
- package/ai/system-prompt.md +38 -0
- package/dist/AnnotationLayer/AnnotationLayer.d.ts +0 -1
- package/dist/Axis/axisTitle.d.ts +3 -3
- package/dist/Axis/summaryGraphic.d.ts +1 -1
- package/dist/FacetController.d.ts +1 -1
- package/dist/MinimapXYFrame.d.ts +2 -2
- package/dist/NetworkFrame.d.ts +5 -1
- package/dist/OrdinalFrame.d.ts +5 -1
- package/dist/ResponsiveFrame.d.ts +2 -2
- package/dist/ResponsiveMinimapXYFrame.d.ts +3 -6
- package/dist/ResponsiveNetworkFrame.d.ts +3 -6
- package/dist/ResponsiveOrdinalFrame.d.ts +3 -6
- package/dist/ResponsiveXYFrame.d.ts +3 -6
- package/dist/SparkFrame.d.ts +1 -1
- package/dist/SparkNetworkFrame.d.ts +3 -3
- package/dist/SparkOrdinalFrame.d.ts +3 -3
- package/dist/SparkXYFrame.d.ts +3 -3
- package/dist/Tooltip/Tooltip.d.ts +141 -0
- package/dist/TooltipPositioner/index.d.ts +1 -1
- package/dist/VisualizationLayer.d.ts +3 -3
- package/dist/XYFrame.d.ts +5 -1
- package/dist/annotationLayerBehavior/annotationHandling.d.ts +2 -2
- package/dist/annotationRules/networkframeRules.d.ts +2 -2
- package/dist/annotationRules/orframeRules.d.ts +2 -4
- package/dist/annotationRules/xyframeRules.d.ts +2 -2
- package/dist/batchWork.d.ts +1 -1
- package/dist/charts/index.d.ts +62 -0
- package/dist/charts/network/ChordDiagram.d.ts +181 -0
- package/dist/charts/network/CirclePack.d.ts +103 -0
- package/dist/charts/network/ForceDirectedGraph.d.ts +192 -0
- package/dist/charts/network/SankeyDiagram.d.ts +195 -0
- package/dist/charts/network/TreeDiagram.d.ts +200 -0
- package/dist/charts/network/Treemap.d.ts +98 -0
- package/dist/charts/ordinal/BarChart.d.ts +119 -0
- package/dist/charts/ordinal/BoxPlot.d.ts +125 -0
- package/dist/charts/ordinal/DonutChart.d.ts +95 -0
- package/dist/charts/ordinal/DotPlot.d.ts +128 -0
- package/dist/charts/ordinal/GroupedBarChart.d.ts +113 -0
- package/dist/charts/ordinal/PieChart.d.ts +83 -0
- package/dist/charts/ordinal/StackedBarChart.d.ts +119 -0
- package/dist/charts/ordinal/SwarmPlot.d.ts +137 -0
- package/dist/charts/realtime/RealtimeBarChart.d.ts +102 -0
- package/dist/charts/realtime/RealtimeLineChart.d.ts +78 -0
- package/dist/charts/realtime/RealtimeSwarmChart.d.ts +88 -0
- package/dist/charts/realtime/RealtimeWaterfallChart.d.ts +85 -0
- package/dist/charts/shared/ChartError.d.ts +19 -0
- package/dist/charts/shared/colorUtils.d.ts +62 -0
- package/dist/charts/shared/formatUtils.d.ts +82 -0
- package/dist/charts/shared/hooks.d.ts +20 -0
- package/dist/charts/shared/legendUtils.d.ts +32 -0
- package/dist/charts/shared/types.d.ts +58 -0
- package/dist/charts/shared/validateChartData.d.ts +41 -0
- package/dist/charts/shared/validateProps.d.ts +18 -0
- package/dist/charts/xy/AreaChart.d.ts +127 -0
- package/dist/charts/xy/BubbleChart.d.ts +157 -0
- package/dist/charts/xy/Heatmap.d.ts +153 -0
- package/dist/charts/xy/LineChart.d.ts +193 -0
- package/dist/charts/xy/Scatterplot.d.ts +50 -0
- package/dist/charts/xy/StackedAreaChart.d.ts +131 -0
- package/dist/constants/frame_props.d.ts +9 -0
- package/dist/constants/jsx.d.ts +2 -2
- package/dist/data/dataFunctions.d.ts +11 -12
- package/dist/data/networkPipelineCache.d.ts +27 -0
- package/dist/data/ordinalPipelineCache.d.ts +33 -0
- package/dist/data/xyPipelineCache.d.ts +35 -0
- package/dist/index.d.ts +70 -62
- package/dist/interactionLayerBehavior/InteractionCanvas.d.ts +1 -1
- package/dist/network.js +8520 -0
- package/dist/network.js.map +1 -0
- package/dist/network.min.js +1 -0
- package/dist/network.module.js +8484 -0
- package/dist/network.module.js.map +1 -0
- package/dist/network.module.min.js +1 -0
- package/dist/ordinal.js +9276 -0
- package/dist/ordinal.js.map +1 -0
- package/dist/ordinal.min.js +1 -0
- package/dist/ordinal.module.js +9242 -0
- package/dist/ordinal.module.js.map +1 -0
- package/dist/ordinal.module.min.js +1 -0
- package/dist/processing/InteractionItems.d.ts +5 -4
- package/dist/processing/hierarchyUtils.d.ts +16 -0
- package/dist/processing/layouts/chordLayout.d.ts +2 -0
- package/dist/processing/layouts/forceLayout.d.ts +3 -0
- package/dist/processing/layouts/hierarchyLayout.d.ts +10 -0
- package/dist/processing/layouts/index.d.ts +8 -0
- package/dist/processing/layouts/sankeyLayout.d.ts +8 -0
- package/dist/processing/layouts/simpleLayouts.d.ts +7 -0
- package/dist/processing/layouts/types.d.ts +17 -0
- package/dist/processing/network.d.ts +25 -28
- package/dist/processing/networkDefaults.d.ts +36 -0
- package/dist/processing/networkLayoutHelpers.d.ts +54 -0
- package/dist/processing/ordinal.d.ts +43 -43
- package/dist/processing/ordinalConstants.d.ts +33 -0
- package/dist/processing/ordinalOverlays.d.ts +33 -0
- package/dist/processing/ordinalRenderPipeline.d.ts +148 -0
- package/dist/processing/xyDrawing.d.ts +46 -41
- package/dist/realtime/BinAccumulator.d.ts +8 -0
- package/dist/realtime/IncrementalExtent.d.ts +13 -0
- package/dist/realtime/RealtimeFrame.d.ts +4 -0
- package/dist/realtime/RingBuffer.d.ts +19 -0
- package/dist/realtime/renderers/barRenderer.d.ts +2 -0
- package/dist/realtime/renderers/candlestickRenderer.d.ts +2 -0
- package/dist/realtime/renderers/lineRenderer.d.ts +2 -0
- package/dist/realtime/renderers/swarmRenderer.d.ts +2 -0
- package/dist/realtime/renderers/types.d.ts +9 -0
- package/dist/realtime/renderers/waterfallRenderer.d.ts +3 -0
- package/dist/realtime/types.d.ts +113 -0
- package/dist/realtime.js +1598 -0
- package/dist/realtime.js.map +1 -0
- package/dist/realtime.min.js +1 -0
- package/dist/realtime.module.js +1566 -0
- package/dist/realtime.module.js.map +1 -0
- package/dist/realtime.module.min.js +1 -0
- package/dist/semiotic-ai.d.ts +28 -0
- package/dist/semiotic-ai.js +18722 -0
- package/dist/semiotic-ai.js.map +1 -0
- package/dist/semiotic-ai.min.js +1 -0
- package/dist/semiotic-ai.module.js +18668 -0
- package/dist/semiotic-ai.module.js.map +1 -0
- package/dist/semiotic-ai.module.min.js +1 -0
- package/dist/semiotic-network.d.ts +19 -0
- package/dist/semiotic-ordinal.d.ts +18 -0
- package/dist/semiotic-realtime.d.ts +23 -0
- package/dist/semiotic-server.d.ts +1 -0
- package/dist/semiotic-xy.d.ts +24 -0
- package/dist/semiotic.d.ts +19 -3
- package/dist/semiotic.js +18707 -12983
- package/dist/semiotic.js.map +1 -0
- package/dist/semiotic.min.js +1 -0
- package/dist/semiotic.module.js +18651 -12953
- package/dist/semiotic.module.js.map +1 -0
- package/dist/semiotic.module.min.js +1 -0
- package/dist/server/renderToStaticSVG.d.ts +9 -0
- package/dist/server.js +8360 -0
- package/dist/server.js.map +1 -0
- package/dist/server.min.js +1 -0
- package/dist/server.module.js +8331 -0
- package/dist/server.module.js.map +1 -0
- package/dist/server.module.min.js +1 -0
- package/dist/svg/SvgHelper.d.ts +1 -5
- package/dist/svg/areaDrawing.d.ts +3 -13
- package/dist/svg/boxplotRenderer.d.ts +15 -0
- package/dist/svg/bucketizedRenderer.d.ts +16 -0
- package/dist/svg/ckbinsRenderer.d.ts +20 -0
- package/dist/svg/contourLayout.d.ts +6 -0
- package/dist/svg/contourRenderer.d.ts +12 -0
- package/dist/svg/edgeGenerators.d.ts +51 -0
- package/dist/svg/frameFunctions.d.ts +17 -28
- package/dist/svg/graphAlgorithms.d.ts +14 -0
- package/dist/svg/hexbinLayout.d.ts +7 -0
- package/dist/svg/lineDrawing.d.ts +8 -8
- package/dist/svg/networkDrawing.d.ts +5 -123
- package/dist/svg/nodeGenerators.d.ts +58 -0
- package/dist/svg/pieceDrawing.d.ts +1 -2
- package/dist/svg/pieceLayouts.d.ts +5 -23
- package/dist/svg/sankeyLinks.d.ts +3 -0
- package/dist/svg/summaryAxis.d.ts +6 -0
- package/dist/svg/summaryLayouts.d.ts +36 -57
- package/dist/svg/swarmLayout.d.ts +13 -0
- package/dist/types/annotationTypes.d.ts +13 -18
- package/dist/types/canvasTypes.d.ts +1 -1
- package/dist/types/generalTypes.d.ts +37 -35
- package/dist/types/interactionTypes.d.ts +7 -9
- package/dist/types/legendTypes.d.ts +2 -2
- package/dist/types/networkTypes.d.ts +40 -30
- package/dist/types/ordinalTypes.d.ts +27 -18
- package/dist/types/xyTypes.d.ts +13 -16
- package/dist/useLegacyUnmountCallback.d.ts +2 -1
- package/dist/visualizationLayerBehavior/axis.d.ts +3 -5
- package/dist/visualizationLayerBehavior/general.d.ts +8 -12
- package/dist/xy.js +7944 -0
- package/dist/xy.js.map +1 -0
- package/dist/xy.min.js +1 -0
- package/dist/xy.module.js +7903 -0
- package/dist/xy.module.js.map +1 -0
- package/dist/xy.module.min.js +1 -0
- package/package.json +116 -66
- package/dist/AnnotationLayer/helpers.d.ts +0 -6
- package/dist/AnnotationLayer/index.d.ts +0 -2
- package/dist/Mark/Mark.d.ts +0 -3
- package/dist/Mark/Mark.types.d.ts +0 -10
- package/dist/Mark/constants/markTransition.d.ts +0 -10
- package/dist/Mark/markBehavior/drawing.d.ts +0 -13
- package/dist/SpanOrDiv.d.ts +0 -10
- package/dist/components/Annotation.d.ts +0 -3
- package/dist/components/AnnotationLayer/AnnotationLayer.d.ts +0 -26
- package/dist/components/Axis/Axis.d.ts +0 -7
- package/dist/components/Axis/axisTitle.d.ts +0 -10
- package/dist/components/Axis/index.d.ts +0 -2
- package/dist/components/Axis/summaryGraphic.d.ts +0 -17
- package/dist/components/Brush.d.ts +0 -12
- package/dist/components/DividedLine.d.ts +0 -16
- package/dist/components/FacetController.d.ts +0 -12
- package/dist/components/Frame.d.ts +0 -2
- package/dist/components/InteractionLayer.d.ts +0 -3
- package/dist/components/Legend.d.ts +0 -3
- package/dist/components/Mark/Mark.d.ts +0 -3
- package/dist/components/Mark/Mark.types.d.ts +0 -10
- package/dist/components/Mark/markBehavior/drawing.d.ts +0 -13
- package/dist/components/MiniMap.d.ts +0 -14
- package/dist/components/MinimapXYFrame.d.ts +0 -10
- package/dist/components/NetworkFrame.d.ts +0 -4
- package/dist/components/OrdinalFrame.d.ts +0 -4
- package/dist/components/ResponsiveFrame.d.ts +0 -22
- package/dist/components/ResponsiveMinimapXYFrame.d.ts +0 -6
- package/dist/components/ResponsiveNetworkFrame.d.ts +0 -6
- package/dist/components/ResponsiveOrdinalFrame.d.ts +0 -6
- package/dist/components/ResponsiveXYFrame.d.ts +0 -6
- package/dist/components/SpanOrDiv.d.ts +0 -10
- package/dist/components/SparkFrame.d.ts +0 -14
- package/dist/components/SparkNetworkFrame.d.ts +0 -5
- package/dist/components/SparkOrdinalFrame.d.ts +0 -5
- package/dist/components/SparkXYFrame.d.ts +0 -5
- package/dist/components/TooltipPositioner/index.d.ts +0 -7
- package/dist/components/VisualizationLayer.d.ts +0 -33
- package/dist/components/XYFrame.d.ts +0 -4
- package/dist/components/annotationLayerBehavior/annotationHandling.d.ts +0 -19
- package/dist/components/annotationLayerBehavior/d3labeler.d.ts +0 -9
- package/dist/components/annotationRules/baseRules.d.ts +0 -25
- package/dist/components/annotationRules/networkframeRules.d.ts +0 -48
- package/dist/components/annotationRules/orframeRules.d.ts +0 -105
- package/dist/components/annotationRules/xyframeRules.d.ts +0 -117
- package/dist/components/batchWork.d.ts +0 -6
- package/dist/components/constants/coordinateNames.d.ts +0 -8
- package/dist/components/constants/frame_props.d.ts +0 -4
- package/dist/components/constants/jsx.d.ts +0 -19
- package/dist/components/data/dataFunctions.d.ts +0 -46
- package/dist/components/data/multiAccessorUtils.d.ts +0 -1
- package/dist/components/data/unflowedFunctions.d.ts +0 -1
- package/dist/components/generic_utilities/functions.d.ts +0 -1
- package/dist/components/index.d.ts +0 -125
- package/dist/components/interactionLayerBehavior/InteractionCanvas.d.ts +0 -20
- package/dist/components/processing/InteractionItems.d.ts +0 -12
- package/dist/components/processing/network.d.ts +0 -114
- package/dist/components/processing/ordinal.d.ts +0 -102
- package/dist/components/processing/xyDrawing.d.ts +0 -135
- package/dist/components/semiotic.d.ts +0 -35
- package/dist/components/store/TooltipStore.d.ts +0 -2
- package/dist/components/store/createStore.d.ts +0 -1
- package/dist/components/svg/SvgHelper.d.ts +0 -37
- package/dist/components/svg/areaDrawing.d.ts +0 -31
- package/dist/components/svg/ckmeans.d.ts +0 -69
- package/dist/components/svg/frameFunctions.d.ts +0 -119
- package/dist/components/svg/lineDrawing.d.ts +0 -99
- package/dist/components/svg/networkDrawing.d.ts +0 -134
- package/dist/components/svg/pieceDrawing.d.ts +0 -13
- package/dist/components/svg/pieceLayouts.d.ts +0 -71
- package/dist/components/svg/summaryLayouts.d.ts +0 -74
- package/dist/components/types/annotationTypes.d.ts +0 -140
- package/dist/components/types/canvasTypes.d.ts +0 -9
- package/dist/components/types/generalTypes.d.ts +0 -236
- package/dist/components/types/interactionTypes.d.ts +0 -74
- package/dist/components/types/legendTypes.d.ts +0 -20
- package/dist/components/types/networkTypes.d.ts +0 -165
- package/dist/components/types/ordinalTypes.d.ts +0 -103
- package/dist/components/types/xyTypes.d.ts +0 -118
- package/dist/components/useBoundingRect.d.ts +0 -2
- package/dist/components/useDerivedStateFromProps.d.ts +0 -1
- package/dist/components/useLegacyUnmountCallback.d.ts +0 -1
- package/dist/components/visualizationLayerBehavior/axis.d.ts +0 -38
- package/dist/components/visualizationLayerBehavior/general.d.ts +0 -84
- package/dist/setupTests.d.ts +0 -1
|
@@ -0,0 +1,640 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Static props validation for AI code-generation pipelines.
|
|
4
|
+
*
|
|
5
|
+
* Validates component name, required props, prop types, enum values,
|
|
6
|
+
* unknown props (typo detection), and data shape via the existing
|
|
7
|
+
* validateArrayData / validateObjectData / validateNetworkData helpers.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.validateProps = validateProps;
|
|
11
|
+
const validateChartData_1 = require("./validateChartData");
|
|
12
|
+
const validateChartData_2 = require("./validateChartData");
|
|
13
|
+
const validateChartData_3 = require("./validateChartData");
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Shared prop definitions (reused across many components)
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
const commonProps = {
|
|
18
|
+
width: { type: "number" },
|
|
19
|
+
height: { type: "number" },
|
|
20
|
+
margin: { type: "object" },
|
|
21
|
+
className: { type: "string" },
|
|
22
|
+
title: { type: "string" },
|
|
23
|
+
enableHover: { type: "boolean" },
|
|
24
|
+
showLegend: { type: "boolean" },
|
|
25
|
+
showGrid: { type: "boolean" },
|
|
26
|
+
colorBy: { type: ["string", "function"] },
|
|
27
|
+
colorScheme: { type: ["string", "array"] },
|
|
28
|
+
tooltip: { type: ["function", "object"] },
|
|
29
|
+
frameProps: { type: "object" },
|
|
30
|
+
};
|
|
31
|
+
const xyAxisProps = {
|
|
32
|
+
xLabel: { type: "string" },
|
|
33
|
+
yLabel: { type: "string" },
|
|
34
|
+
xFormat: { type: "function" },
|
|
35
|
+
yFormat: { type: "function" },
|
|
36
|
+
};
|
|
37
|
+
const ordinalAxisProps = {
|
|
38
|
+
categoryLabel: { type: "string" },
|
|
39
|
+
valueLabel: { type: "string" },
|
|
40
|
+
valueFormat: { type: "function" },
|
|
41
|
+
};
|
|
42
|
+
const curveEnum = [
|
|
43
|
+
"linear", "monotoneX", "monotoneY", "step",
|
|
44
|
+
"stepAfter", "stepBefore", "basis", "cardinal", "catmullRom",
|
|
45
|
+
];
|
|
46
|
+
const orientationEnum = ["vertical", "horizontal"];
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
// Validation map — one entry per component
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
const VALIDATION_MAP = {
|
|
51
|
+
// -- XY Charts --
|
|
52
|
+
LineChart: {
|
|
53
|
+
required: ["data"],
|
|
54
|
+
dataShape: "array",
|
|
55
|
+
dataAccessors: ["xAccessor", "yAccessor"],
|
|
56
|
+
props: {
|
|
57
|
+
...commonProps,
|
|
58
|
+
...xyAxisProps,
|
|
59
|
+
data: { type: "array" },
|
|
60
|
+
xAccessor: { type: ["string", "function"] },
|
|
61
|
+
yAccessor: { type: ["string", "function"] },
|
|
62
|
+
lineBy: { type: ["string", "function"] },
|
|
63
|
+
lineDataAccessor: { type: "string" },
|
|
64
|
+
curve: { type: "string", enum: curveEnum },
|
|
65
|
+
lineWidth: { type: "number" },
|
|
66
|
+
showPoints: { type: "boolean" },
|
|
67
|
+
pointRadius: { type: "number" },
|
|
68
|
+
fillArea: { type: "boolean" },
|
|
69
|
+
areaOpacity: { type: "number" },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
AreaChart: {
|
|
73
|
+
required: ["data"],
|
|
74
|
+
dataShape: "array",
|
|
75
|
+
dataAccessors: ["xAccessor", "yAccessor"],
|
|
76
|
+
props: {
|
|
77
|
+
...commonProps,
|
|
78
|
+
...xyAxisProps,
|
|
79
|
+
data: { type: "array" },
|
|
80
|
+
xAccessor: { type: ["string", "function"] },
|
|
81
|
+
yAccessor: { type: ["string", "function"] },
|
|
82
|
+
areaBy: { type: ["string", "function"] },
|
|
83
|
+
lineDataAccessor: { type: "string" },
|
|
84
|
+
curve: { type: "string", enum: curveEnum },
|
|
85
|
+
areaOpacity: { type: "number" },
|
|
86
|
+
showLine: { type: "boolean" },
|
|
87
|
+
lineWidth: { type: "number" },
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
StackedAreaChart: {
|
|
91
|
+
required: ["data"],
|
|
92
|
+
dataShape: "array",
|
|
93
|
+
dataAccessors: ["xAccessor", "yAccessor"],
|
|
94
|
+
props: {
|
|
95
|
+
...commonProps,
|
|
96
|
+
...xyAxisProps,
|
|
97
|
+
data: { type: "array" },
|
|
98
|
+
xAccessor: { type: ["string", "function"] },
|
|
99
|
+
yAccessor: { type: ["string", "function"] },
|
|
100
|
+
areaBy: { type: ["string", "function"] },
|
|
101
|
+
lineDataAccessor: { type: "string" },
|
|
102
|
+
curve: { type: "string", enum: curveEnum },
|
|
103
|
+
areaOpacity: { type: "number" },
|
|
104
|
+
showLine: { type: "boolean" },
|
|
105
|
+
lineWidth: { type: "number" },
|
|
106
|
+
normalize: { type: "boolean" },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
Scatterplot: {
|
|
110
|
+
required: ["data"],
|
|
111
|
+
dataShape: "array",
|
|
112
|
+
dataAccessors: ["xAccessor", "yAccessor"],
|
|
113
|
+
props: {
|
|
114
|
+
...commonProps,
|
|
115
|
+
...xyAxisProps,
|
|
116
|
+
data: { type: "array" },
|
|
117
|
+
xAccessor: { type: ["string", "function"] },
|
|
118
|
+
yAccessor: { type: ["string", "function"] },
|
|
119
|
+
sizeBy: { type: ["string", "function"] },
|
|
120
|
+
sizeRange: { type: "array" },
|
|
121
|
+
pointRadius: { type: "number" },
|
|
122
|
+
pointOpacity: { type: "number" },
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
BubbleChart: {
|
|
126
|
+
required: ["data", "sizeBy"],
|
|
127
|
+
dataShape: "array",
|
|
128
|
+
dataAccessors: ["xAccessor", "yAccessor"],
|
|
129
|
+
props: {
|
|
130
|
+
...commonProps,
|
|
131
|
+
...xyAxisProps,
|
|
132
|
+
data: { type: "array" },
|
|
133
|
+
xAccessor: { type: ["string", "function"] },
|
|
134
|
+
yAccessor: { type: ["string", "function"] },
|
|
135
|
+
sizeBy: { type: ["string", "function"] },
|
|
136
|
+
sizeRange: { type: "array" },
|
|
137
|
+
bubbleOpacity: { type: "number" },
|
|
138
|
+
bubbleStrokeWidth: { type: "number" },
|
|
139
|
+
bubbleStrokeColor: { type: "string" },
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
Heatmap: {
|
|
143
|
+
required: ["data"],
|
|
144
|
+
dataShape: "array",
|
|
145
|
+
dataAccessors: ["xAccessor", "yAccessor", "valueAccessor"],
|
|
146
|
+
props: {
|
|
147
|
+
...commonProps,
|
|
148
|
+
...xyAxisProps,
|
|
149
|
+
data: { type: "array" },
|
|
150
|
+
xAccessor: { type: ["string", "function"] },
|
|
151
|
+
yAccessor: { type: ["string", "function"] },
|
|
152
|
+
valueAccessor: { type: ["string", "function"] },
|
|
153
|
+
colorScheme: { type: "string", enum: ["blues", "reds", "greens", "viridis", "custom"] },
|
|
154
|
+
customColorScale: { type: ["object", "function"] },
|
|
155
|
+
showValues: { type: "boolean" },
|
|
156
|
+
valueFormat: { type: "function" },
|
|
157
|
+
cellBorderColor: { type: "string" },
|
|
158
|
+
cellBorderWidth: { type: "number" },
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
// -- Ordinal Charts --
|
|
162
|
+
BarChart: {
|
|
163
|
+
required: ["data"],
|
|
164
|
+
dataShape: "array",
|
|
165
|
+
dataAccessors: ["categoryAccessor", "valueAccessor"],
|
|
166
|
+
props: {
|
|
167
|
+
...commonProps,
|
|
168
|
+
...ordinalAxisProps,
|
|
169
|
+
data: { type: "array" },
|
|
170
|
+
categoryAccessor: { type: ["string", "function"] },
|
|
171
|
+
valueAccessor: { type: ["string", "function"] },
|
|
172
|
+
orientation: { type: "string", enum: orientationEnum },
|
|
173
|
+
sort: { type: ["boolean", "string", "function"] },
|
|
174
|
+
barPadding: { type: "number" },
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
StackedBarChart: {
|
|
178
|
+
required: ["data", "stackBy"],
|
|
179
|
+
dataShape: "array",
|
|
180
|
+
dataAccessors: ["categoryAccessor", "valueAccessor"],
|
|
181
|
+
props: {
|
|
182
|
+
...commonProps,
|
|
183
|
+
...ordinalAxisProps,
|
|
184
|
+
data: { type: "array" },
|
|
185
|
+
categoryAccessor: { type: ["string", "function"] },
|
|
186
|
+
stackBy: { type: ["string", "function"] },
|
|
187
|
+
valueAccessor: { type: ["string", "function"] },
|
|
188
|
+
orientation: { type: "string", enum: orientationEnum },
|
|
189
|
+
normalize: { type: "boolean" },
|
|
190
|
+
barPadding: { type: "number" },
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
GroupedBarChart: {
|
|
194
|
+
required: ["data", "groupBy"],
|
|
195
|
+
dataShape: "array",
|
|
196
|
+
dataAccessors: ["categoryAccessor", "valueAccessor"],
|
|
197
|
+
props: {
|
|
198
|
+
...commonProps,
|
|
199
|
+
...ordinalAxisProps,
|
|
200
|
+
data: { type: "array" },
|
|
201
|
+
categoryAccessor: { type: ["string", "function"] },
|
|
202
|
+
groupBy: { type: ["string", "function"] },
|
|
203
|
+
valueAccessor: { type: ["string", "function"] },
|
|
204
|
+
orientation: { type: "string", enum: orientationEnum },
|
|
205
|
+
barPadding: { type: "number" },
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
SwarmPlot: {
|
|
209
|
+
required: ["data"],
|
|
210
|
+
dataShape: "array",
|
|
211
|
+
dataAccessors: ["categoryAccessor", "valueAccessor"],
|
|
212
|
+
props: {
|
|
213
|
+
...commonProps,
|
|
214
|
+
...ordinalAxisProps,
|
|
215
|
+
data: { type: "array" },
|
|
216
|
+
categoryAccessor: { type: ["string", "function"] },
|
|
217
|
+
valueAccessor: { type: ["string", "function"] },
|
|
218
|
+
orientation: { type: "string", enum: orientationEnum },
|
|
219
|
+
sizeBy: { type: ["string", "function"] },
|
|
220
|
+
sizeRange: { type: "array" },
|
|
221
|
+
pointRadius: { type: "number" },
|
|
222
|
+
pointOpacity: { type: "number" },
|
|
223
|
+
categoryPadding: { type: "number" },
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
BoxPlot: {
|
|
227
|
+
required: ["data"],
|
|
228
|
+
dataShape: "array",
|
|
229
|
+
dataAccessors: ["categoryAccessor", "valueAccessor"],
|
|
230
|
+
props: {
|
|
231
|
+
...commonProps,
|
|
232
|
+
...ordinalAxisProps,
|
|
233
|
+
data: { type: "array" },
|
|
234
|
+
categoryAccessor: { type: ["string", "function"] },
|
|
235
|
+
valueAccessor: { type: ["string", "function"] },
|
|
236
|
+
orientation: { type: "string", enum: orientationEnum },
|
|
237
|
+
showOutliers: { type: "boolean" },
|
|
238
|
+
outlierRadius: { type: "number" },
|
|
239
|
+
categoryPadding: { type: "number" },
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
DotPlot: {
|
|
243
|
+
required: ["data"],
|
|
244
|
+
dataShape: "array",
|
|
245
|
+
dataAccessors: ["categoryAccessor", "valueAccessor"],
|
|
246
|
+
props: {
|
|
247
|
+
...commonProps,
|
|
248
|
+
...ordinalAxisProps,
|
|
249
|
+
data: { type: "array" },
|
|
250
|
+
categoryAccessor: { type: ["string", "function"] },
|
|
251
|
+
valueAccessor: { type: ["string", "function"] },
|
|
252
|
+
orientation: { type: "string", enum: orientationEnum },
|
|
253
|
+
sort: { type: ["boolean", "string", "function"] },
|
|
254
|
+
dotRadius: { type: "number" },
|
|
255
|
+
categoryPadding: { type: "number" },
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
PieChart: {
|
|
259
|
+
required: ["data"],
|
|
260
|
+
dataShape: "array",
|
|
261
|
+
dataAccessors: ["categoryAccessor", "valueAccessor"],
|
|
262
|
+
props: {
|
|
263
|
+
...commonProps,
|
|
264
|
+
data: { type: "array" },
|
|
265
|
+
categoryAccessor: { type: ["string", "function"] },
|
|
266
|
+
valueAccessor: { type: ["string", "function"] },
|
|
267
|
+
startAngle: { type: "number" },
|
|
268
|
+
slicePadding: { type: "number" },
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
DonutChart: {
|
|
272
|
+
required: ["data"],
|
|
273
|
+
dataShape: "array",
|
|
274
|
+
dataAccessors: ["categoryAccessor", "valueAccessor"],
|
|
275
|
+
props: {
|
|
276
|
+
...commonProps,
|
|
277
|
+
data: { type: "array" },
|
|
278
|
+
categoryAccessor: { type: ["string", "function"] },
|
|
279
|
+
valueAccessor: { type: ["string", "function"] },
|
|
280
|
+
innerRadius: { type: "number" },
|
|
281
|
+
centerContent: { type: ["object", "string", "number"] },
|
|
282
|
+
startAngle: { type: "number" },
|
|
283
|
+
slicePadding: { type: "number" },
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
// -- Network Charts --
|
|
287
|
+
ForceDirectedGraph: {
|
|
288
|
+
required: ["nodes", "edges"],
|
|
289
|
+
dataShape: "network",
|
|
290
|
+
dataAccessors: ["nodeIDAccessor", "sourceAccessor", "targetAccessor"],
|
|
291
|
+
props: {
|
|
292
|
+
...commonProps,
|
|
293
|
+
nodes: { type: "array" },
|
|
294
|
+
edges: { type: "array" },
|
|
295
|
+
nodeIDAccessor: { type: ["string", "function"] },
|
|
296
|
+
sourceAccessor: { type: ["string", "function"] },
|
|
297
|
+
targetAccessor: { type: ["string", "function"] },
|
|
298
|
+
nodeLabel: { type: ["string", "function"] },
|
|
299
|
+
nodeSize: { type: ["number", "string", "function"] },
|
|
300
|
+
nodeSizeRange: { type: "array" },
|
|
301
|
+
edgeWidth: { type: ["number", "string", "function"] },
|
|
302
|
+
edgeColor: { type: "string" },
|
|
303
|
+
edgeOpacity: { type: "number" },
|
|
304
|
+
iterations: { type: "number" },
|
|
305
|
+
forceStrength: { type: "number" },
|
|
306
|
+
showLabels: { type: "boolean" },
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
SankeyDiagram: {
|
|
310
|
+
required: ["edges"],
|
|
311
|
+
dataShape: "network",
|
|
312
|
+
dataAccessors: ["sourceAccessor", "targetAccessor"],
|
|
313
|
+
props: {
|
|
314
|
+
...commonProps,
|
|
315
|
+
nodes: { type: "array" },
|
|
316
|
+
edges: { type: "array" },
|
|
317
|
+
sourceAccessor: { type: ["string", "function"] },
|
|
318
|
+
targetAccessor: { type: ["string", "function"] },
|
|
319
|
+
valueAccessor: { type: ["string", "function"] },
|
|
320
|
+
nodeIdAccessor: { type: ["string", "function"] },
|
|
321
|
+
edgeColorBy: { type: ["string", "function"], enum: ["source", "target", "gradient"] },
|
|
322
|
+
orientation: { type: "string", enum: orientationEnum },
|
|
323
|
+
nodeAlign: { type: "string", enum: ["justify", "left", "right", "center"] },
|
|
324
|
+
nodePaddingRatio: { type: "number" },
|
|
325
|
+
nodeWidth: { type: "number" },
|
|
326
|
+
nodeLabel: { type: ["string", "function"] },
|
|
327
|
+
showLabels: { type: "boolean" },
|
|
328
|
+
edgeOpacity: { type: "number" },
|
|
329
|
+
edgeSort: { type: "function" },
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
ChordDiagram: {
|
|
333
|
+
required: ["edges"],
|
|
334
|
+
dataShape: "network",
|
|
335
|
+
dataAccessors: ["sourceAccessor", "targetAccessor"],
|
|
336
|
+
props: {
|
|
337
|
+
...commonProps,
|
|
338
|
+
nodes: { type: "array" },
|
|
339
|
+
edges: { type: "array" },
|
|
340
|
+
sourceAccessor: { type: ["string", "function"] },
|
|
341
|
+
targetAccessor: { type: ["string", "function"] },
|
|
342
|
+
valueAccessor: { type: ["string", "function"] },
|
|
343
|
+
nodeIdAccessor: { type: ["string", "function"] },
|
|
344
|
+
edgeColorBy: { type: ["string", "function"], enum: ["source", "target"] },
|
|
345
|
+
padAngle: { type: "number" },
|
|
346
|
+
groupWidth: { type: "number" },
|
|
347
|
+
sortGroups: { type: "function" },
|
|
348
|
+
nodeLabel: { type: ["string", "function"] },
|
|
349
|
+
showLabels: { type: "boolean" },
|
|
350
|
+
edgeOpacity: { type: "number" },
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
TreeDiagram: {
|
|
354
|
+
required: ["data"],
|
|
355
|
+
dataShape: "object",
|
|
356
|
+
dataAccessors: [],
|
|
357
|
+
props: {
|
|
358
|
+
...commonProps,
|
|
359
|
+
data: { type: "object" },
|
|
360
|
+
layout: { type: "string", enum: ["tree", "cluster", "partition", "treemap", "circlepack"] },
|
|
361
|
+
orientation: { type: "string", enum: ["vertical", "horizontal", "radial"] },
|
|
362
|
+
childrenAccessor: { type: ["string", "function"] },
|
|
363
|
+
valueAccessor: { type: ["string", "function"] },
|
|
364
|
+
nodeIdAccessor: { type: ["string", "function"] },
|
|
365
|
+
colorByDepth: { type: "boolean" },
|
|
366
|
+
edgeStyle: { type: "string", enum: ["line", "curve"] },
|
|
367
|
+
nodeLabel: { type: ["string", "function"] },
|
|
368
|
+
showLabels: { type: "boolean" },
|
|
369
|
+
nodeSize: { type: "number" },
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
Treemap: {
|
|
373
|
+
required: ["data"],
|
|
374
|
+
dataShape: "object",
|
|
375
|
+
dataAccessors: [],
|
|
376
|
+
props: {
|
|
377
|
+
...commonProps,
|
|
378
|
+
data: { type: "object" },
|
|
379
|
+
childrenAccessor: { type: ["string", "function"] },
|
|
380
|
+
valueAccessor: { type: ["string", "function"] },
|
|
381
|
+
nodeIdAccessor: { type: ["string", "function"] },
|
|
382
|
+
colorByDepth: { type: "boolean" },
|
|
383
|
+
showLabels: { type: "boolean" },
|
|
384
|
+
nodeLabel: { type: ["string", "function"] },
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
CirclePack: {
|
|
388
|
+
required: ["data"],
|
|
389
|
+
dataShape: "object",
|
|
390
|
+
dataAccessors: [],
|
|
391
|
+
props: {
|
|
392
|
+
...commonProps,
|
|
393
|
+
data: { type: "object" },
|
|
394
|
+
childrenAccessor: { type: ["string", "function"] },
|
|
395
|
+
valueAccessor: { type: ["string", "function"] },
|
|
396
|
+
nodeIdAccessor: { type: ["string", "function"] },
|
|
397
|
+
colorByDepth: { type: "boolean" },
|
|
398
|
+
showLabels: { type: "boolean" },
|
|
399
|
+
nodeLabel: { type: ["string", "function"] },
|
|
400
|
+
circleOpacity: { type: "number" },
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
// -- Realtime Charts --
|
|
404
|
+
RealtimeLineChart: {
|
|
405
|
+
required: [],
|
|
406
|
+
dataShape: "realtime",
|
|
407
|
+
dataAccessors: [],
|
|
408
|
+
props: {
|
|
409
|
+
size: { type: "array" },
|
|
410
|
+
margin: { type: "object" },
|
|
411
|
+
className: { type: "string" },
|
|
412
|
+
timeAccessor: { type: ["string", "function"] },
|
|
413
|
+
valueAccessor: { type: ["string", "function"] },
|
|
414
|
+
windowSize: { type: "number" },
|
|
415
|
+
windowMode: { type: "string", enum: ["sliding", "stepping"] },
|
|
416
|
+
arrowOfTime: { type: "string", enum: ["left", "right"] },
|
|
417
|
+
stroke: { type: "string" },
|
|
418
|
+
strokeWidth: { type: "number" },
|
|
419
|
+
strokeDasharray: { type: "string" },
|
|
420
|
+
timeExtent: { type: "array" },
|
|
421
|
+
valueExtent: { type: "array" },
|
|
422
|
+
extentPadding: { type: "number" },
|
|
423
|
+
showAxes: { type: "boolean" },
|
|
424
|
+
background: { type: "string" },
|
|
425
|
+
enableHover: { type: ["boolean", "object"] },
|
|
426
|
+
tooltipContent: { type: "function" },
|
|
427
|
+
onHover: { type: "function" },
|
|
428
|
+
annotations: { type: "array" },
|
|
429
|
+
svgAnnotationRules: { type: "function" },
|
|
430
|
+
tickFormatTime: { type: "function" },
|
|
431
|
+
tickFormatValue: { type: "function" },
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
RealtimeBarChart: {
|
|
435
|
+
required: ["binSize"],
|
|
436
|
+
dataShape: "realtime",
|
|
437
|
+
dataAccessors: [],
|
|
438
|
+
props: {
|
|
439
|
+
binSize: { type: "number" },
|
|
440
|
+
size: { type: "array" },
|
|
441
|
+
margin: { type: "object" },
|
|
442
|
+
className: { type: "string" },
|
|
443
|
+
timeAccessor: { type: ["string", "function"] },
|
|
444
|
+
valueAccessor: { type: ["string", "function"] },
|
|
445
|
+
categoryAccessor: { type: ["string", "function"] },
|
|
446
|
+
colors: { type: "object" },
|
|
447
|
+
windowSize: { type: "number" },
|
|
448
|
+
windowMode: { type: "string", enum: ["sliding", "stepping"] },
|
|
449
|
+
arrowOfTime: { type: "string", enum: ["left", "right"] },
|
|
450
|
+
fill: { type: "string" },
|
|
451
|
+
stroke: { type: "string" },
|
|
452
|
+
strokeWidth: { type: "number" },
|
|
453
|
+
gap: { type: "number" },
|
|
454
|
+
timeExtent: { type: "array" },
|
|
455
|
+
valueExtent: { type: "array" },
|
|
456
|
+
extentPadding: { type: "number" },
|
|
457
|
+
showAxes: { type: "boolean" },
|
|
458
|
+
background: { type: "string" },
|
|
459
|
+
enableHover: { type: ["boolean", "object"] },
|
|
460
|
+
tooltipContent: { type: "function" },
|
|
461
|
+
onHover: { type: "function" },
|
|
462
|
+
annotations: { type: "array" },
|
|
463
|
+
svgAnnotationRules: { type: "function" },
|
|
464
|
+
tickFormatTime: { type: "function" },
|
|
465
|
+
tickFormatValue: { type: "function" },
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
RealtimeSwarmChart: {
|
|
469
|
+
required: [],
|
|
470
|
+
dataShape: "realtime",
|
|
471
|
+
dataAccessors: [],
|
|
472
|
+
props: {
|
|
473
|
+
size: { type: "array" },
|
|
474
|
+
margin: { type: "object" },
|
|
475
|
+
className: { type: "string" },
|
|
476
|
+
timeAccessor: { type: ["string", "function"] },
|
|
477
|
+
valueAccessor: { type: ["string", "function"] },
|
|
478
|
+
categoryAccessor: { type: ["string", "function"] },
|
|
479
|
+
colors: { type: "object" },
|
|
480
|
+
windowSize: { type: "number" },
|
|
481
|
+
windowMode: { type: "string", enum: ["sliding", "stepping"] },
|
|
482
|
+
arrowOfTime: { type: "string", enum: ["left", "right"] },
|
|
483
|
+
radius: { type: "number" },
|
|
484
|
+
fill: { type: "string" },
|
|
485
|
+
opacity: { type: "number" },
|
|
486
|
+
stroke: { type: "string" },
|
|
487
|
+
strokeWidth: { type: "number" },
|
|
488
|
+
timeExtent: { type: "array" },
|
|
489
|
+
valueExtent: { type: "array" },
|
|
490
|
+
extentPadding: { type: "number" },
|
|
491
|
+
showAxes: { type: "boolean" },
|
|
492
|
+
background: { type: "string" },
|
|
493
|
+
enableHover: { type: ["boolean", "object"] },
|
|
494
|
+
tooltipContent: { type: "function" },
|
|
495
|
+
onHover: { type: "function" },
|
|
496
|
+
annotations: { type: "array" },
|
|
497
|
+
svgAnnotationRules: { type: "function" },
|
|
498
|
+
tickFormatTime: { type: "function" },
|
|
499
|
+
tickFormatValue: { type: "function" },
|
|
500
|
+
},
|
|
501
|
+
},
|
|
502
|
+
RealtimeWaterfallChart: {
|
|
503
|
+
required: [],
|
|
504
|
+
dataShape: "realtime",
|
|
505
|
+
dataAccessors: [],
|
|
506
|
+
props: {
|
|
507
|
+
size: { type: "array" },
|
|
508
|
+
margin: { type: "object" },
|
|
509
|
+
className: { type: "string" },
|
|
510
|
+
timeAccessor: { type: ["string", "function"] },
|
|
511
|
+
valueAccessor: { type: ["string", "function"] },
|
|
512
|
+
windowSize: { type: "number" },
|
|
513
|
+
windowMode: { type: "string", enum: ["sliding", "stepping"] },
|
|
514
|
+
arrowOfTime: { type: "string", enum: ["left", "right"] },
|
|
515
|
+
positiveColor: { type: "string" },
|
|
516
|
+
negativeColor: { type: "string" },
|
|
517
|
+
connectorStroke: { type: "string" },
|
|
518
|
+
connectorWidth: { type: "number" },
|
|
519
|
+
gap: { type: "number" },
|
|
520
|
+
stroke: { type: "string" },
|
|
521
|
+
strokeWidth: { type: "number" },
|
|
522
|
+
timeExtent: { type: "array" },
|
|
523
|
+
valueExtent: { type: "array" },
|
|
524
|
+
extentPadding: { type: "number" },
|
|
525
|
+
showAxes: { type: "boolean" },
|
|
526
|
+
background: { type: "string" },
|
|
527
|
+
enableHover: { type: ["boolean", "object"] },
|
|
528
|
+
tooltipContent: { type: "function" },
|
|
529
|
+
onHover: { type: "function" },
|
|
530
|
+
annotations: { type: "array" },
|
|
531
|
+
svgAnnotationRules: { type: "function" },
|
|
532
|
+
tickFormatTime: { type: "function" },
|
|
533
|
+
tickFormatValue: { type: "function" },
|
|
534
|
+
},
|
|
535
|
+
},
|
|
536
|
+
};
|
|
537
|
+
// ---------------------------------------------------------------------------
|
|
538
|
+
// Helpers
|
|
539
|
+
// ---------------------------------------------------------------------------
|
|
540
|
+
function checkType(value, expected) {
|
|
541
|
+
const types = Array.isArray(expected) ? expected : [expected];
|
|
542
|
+
const actual = Array.isArray(value) ? "array" : typeof value;
|
|
543
|
+
return types.includes(actual);
|
|
544
|
+
}
|
|
545
|
+
// ---------------------------------------------------------------------------
|
|
546
|
+
// Public API
|
|
547
|
+
// ---------------------------------------------------------------------------
|
|
548
|
+
/**
|
|
549
|
+
* Validate props for a Semiotic HOC chart component.
|
|
550
|
+
*
|
|
551
|
+
* Checks: component name, required props, prop types, enum values,
|
|
552
|
+
* unknown prop names (typo detection), and data shape + accessor validity.
|
|
553
|
+
*/
|
|
554
|
+
function validateProps(componentName, props) {
|
|
555
|
+
const errors = [];
|
|
556
|
+
// 1. Component name check
|
|
557
|
+
const spec = VALIDATION_MAP[componentName];
|
|
558
|
+
if (!spec) {
|
|
559
|
+
return {
|
|
560
|
+
valid: false,
|
|
561
|
+
errors: [
|
|
562
|
+
`Unknown component "${componentName}". Valid components: ${Object.keys(VALIDATION_MAP).join(", ")}`,
|
|
563
|
+
],
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
// 2. Required props
|
|
567
|
+
for (const req of spec.required) {
|
|
568
|
+
if (props[req] === undefined || props[req] === null) {
|
|
569
|
+
errors.push(`"${req}" is required for ${componentName}.`);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
// 3. Prop types & enum values
|
|
573
|
+
for (const [key, value] of Object.entries(props)) {
|
|
574
|
+
if (value === undefined || value === null)
|
|
575
|
+
continue;
|
|
576
|
+
const def = spec.props[key];
|
|
577
|
+
if (!def)
|
|
578
|
+
continue; // unknown prop — checked in step 5
|
|
579
|
+
// Type check
|
|
580
|
+
if (!checkType(value, def.type)) {
|
|
581
|
+
const expectedStr = Array.isArray(def.type)
|
|
582
|
+
? def.type.join(" | ")
|
|
583
|
+
: def.type;
|
|
584
|
+
errors.push(`"${key}" should be ${expectedStr}, got ${Array.isArray(value) ? "array" : typeof value}.`);
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
// Enum check
|
|
588
|
+
if (def.enum && typeof value === "string" && !def.enum.includes(value)) {
|
|
589
|
+
errors.push(`"${key}" value "${value}" is not valid. Expected one of: ${def.enum.join(", ")}.`);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
// 4. Unknown props (warn on typos)
|
|
593
|
+
const knownProps = new Set(Object.keys(spec.props));
|
|
594
|
+
for (const key of Object.keys(props)) {
|
|
595
|
+
if (props[key] === undefined)
|
|
596
|
+
continue;
|
|
597
|
+
if (!knownProps.has(key)) {
|
|
598
|
+
errors.push(`Unknown prop "${key}" for ${componentName}. Check for typos.`);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
// 5. Data shape + accessor validation (delegate to existing helpers)
|
|
602
|
+
if (spec.dataShape === "array") {
|
|
603
|
+
const data = props.data;
|
|
604
|
+
const accessors = {};
|
|
605
|
+
for (const acc of spec.dataAccessors) {
|
|
606
|
+
const val = props[acc];
|
|
607
|
+
if (typeof val === "string") {
|
|
608
|
+
accessors[acc] = val;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
const dataError = (0, validateChartData_1.validateArrayData)({
|
|
612
|
+
componentName,
|
|
613
|
+
data,
|
|
614
|
+
accessors: Object.keys(accessors).length > 0 ? accessors : undefined,
|
|
615
|
+
});
|
|
616
|
+
if (dataError)
|
|
617
|
+
errors.push(dataError);
|
|
618
|
+
}
|
|
619
|
+
else if (spec.dataShape === "object") {
|
|
620
|
+
const dataError = (0, validateChartData_2.validateObjectData)({
|
|
621
|
+
componentName,
|
|
622
|
+
data: props.data,
|
|
623
|
+
});
|
|
624
|
+
if (dataError)
|
|
625
|
+
errors.push(dataError);
|
|
626
|
+
}
|
|
627
|
+
else if (spec.dataShape === "network") {
|
|
628
|
+
const dataError = (0, validateChartData_3.validateNetworkData)({
|
|
629
|
+
componentName,
|
|
630
|
+
nodes: props.nodes,
|
|
631
|
+
edges: props.edges,
|
|
632
|
+
nodesRequired: spec.required.includes("nodes"),
|
|
633
|
+
edgesRequired: spec.required.includes("edges"),
|
|
634
|
+
});
|
|
635
|
+
if (dataError)
|
|
636
|
+
errors.push(dataError);
|
|
637
|
+
}
|
|
638
|
+
// realtime charts: no data validation (ref-based push API)
|
|
639
|
+
return { valid: errors.length === 0, errors };
|
|
640
|
+
}
|