semiotic 3.8.0 → 3.8.2
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 +14 -9
- package/README.md +56 -55
- package/ai/behaviorContracts.cjs +9 -0
- package/ai/dist/mcp-server.js +240 -30
- package/ai/schema.json +616 -42
- package/ai/surface-manifest.json +3 -2
- package/ai/system-prompt.md +7 -3
- package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +20 -0
- package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +2 -0
- package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +1 -0
- package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +2 -0
- package/dist/chunk-chunk-255KDHW5.module.min.js +1 -0
- package/dist/chunk-chunk-27HVVXS6.module.min.js +1 -0
- package/dist/chunk-chunk-2CXCXRB4.module.min.js +1 -0
- package/dist/chunk-chunk-2JGJ5GUG.module.min.js +2 -0
- package/dist/chunk-chunk-2UN3ANRN.module.min.js +2 -0
- package/dist/chunk-chunk-2VUEY5TH.module.min.js +1 -0
- package/dist/chunk-chunk-2WVCH4PL.module.min.js +1 -0
- package/dist/chunk-chunk-5UKL5W76.module.min.js +2 -0
- package/dist/chunk-chunk-5WEFWNUW.module.min.js +2 -0
- package/dist/chunk-chunk-6F6GEAQU.module.min.js +1 -0
- package/dist/chunk-chunk-7LHMKRKE.module.min.js +2 -0
- package/dist/chunk-chunk-BHYTYMY2.module.min.js +2 -0
- package/dist/chunk-chunk-C6EJ4IOD.module.min.js +2 -0
- package/dist/chunk-chunk-CA3YDW6F.module.min.js +1 -0
- package/dist/chunk-chunk-CP3EN6KZ.module.min.js +1 -0
- package/dist/chunk-chunk-CYIML3AV.module.min.js +2 -0
- package/dist/chunk-chunk-DNY43POY.module.min.js +1 -0
- package/dist/chunk-chunk-DSNGDNJY.module.min.js +1 -0
- package/dist/chunk-chunk-E7MIQX7D.module.min.js +2 -0
- package/dist/chunk-chunk-EMO5NUGE.module.min.js +1 -0
- package/dist/chunk-chunk-ES4DCG3L.module.min.js +1 -0
- package/dist/chunk-chunk-FAKO3RGQ.module.min.js +2 -0
- package/dist/chunk-chunk-FYY2ACNJ.module.min.js +2 -0
- package/dist/chunk-chunk-G7WFWHAD.module.min.js +2 -0
- package/dist/chunk-chunk-GMQ5AYTD.module.min.js +1 -0
- package/dist/chunk-chunk-H4PPRW6N.module.min.js +1 -0
- package/dist/chunk-chunk-IFYPMWKY.module.min.js +1 -0
- package/dist/chunk-chunk-J3ELI22J.module.min.js +1 -0
- package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
- package/dist/chunk-chunk-J3XWETBJ.module.min.js +2 -0
- package/dist/chunk-chunk-JCG72SGW.module.min.js +2 -0
- package/dist/{semiotic-ai-chunk-OG7BQUUW.module.min.js → chunk-chunk-JJ2OOIET.module.min.js} +0 -1
- package/dist/chunk-chunk-KTWEBFMX.module.min.js +2 -0
- package/dist/chunk-chunk-L6D3I3V7.module.min.js +2 -0
- package/dist/chunk-chunk-M337NY6L.module.min.js +1 -0
- package/dist/chunk-chunk-NO4MCQVD.module.min.js +1 -0
- package/dist/chunk-chunk-ODUZEEBH.module.min.js +2 -0
- package/dist/chunk-chunk-P6UBCMSQ.module.min.js +2 -0
- package/dist/chunk-chunk-Q2YADC2V.module.min.js +2 -0
- package/dist/chunk-chunk-QRIBHZYW.module.min.js +1 -0
- package/dist/chunk-chunk-QSQVBIJA.module.min.js +1 -0
- package/dist/chunk-chunk-RCF52Z42.module.min.js +2 -0
- package/dist/chunk-chunk-RH5TSQPH.module.min.js +1 -0
- package/dist/chunk-chunk-ROP4HI7H.module.min.js +2 -0
- package/dist/chunk-chunk-RZH7VZYS.module.min.js +2 -0
- package/dist/chunk-chunk-SIRIJ3DY.module.min.js +1 -0
- package/dist/chunk-chunk-STZFFTAN.module.min.js +2 -0
- package/dist/chunk-chunk-SV4XAZ3Q.module.min.js +1 -0
- package/dist/chunk-chunk-T27ZEV6A.module.min.js +1 -0
- package/dist/chunk-chunk-U3AGQ5EF.module.min.js +2 -0
- package/dist/chunk-chunk-U66USBWU.module.min.js +1 -0
- package/dist/chunk-chunk-VVCA3DB7.module.min.js +1 -0
- package/dist/chunk-chunk-W3DB2MN4.module.min.js +2 -0
- package/dist/chunk-chunk-WCX6U47H.module.min.js +2 -0
- package/dist/chunk-chunk-WDIN4LRC.module.min.js +1 -0
- package/dist/chunk-chunk-XEVJDUTH.module.min.js +1 -0
- package/dist/chunk-chunk-XOYX77KF.module.min.js +2 -0
- package/dist/chunk-chunk-YCQYG6J5.module.min.js +2 -0
- package/dist/chunk-chunk-YHNZCPOZ.module.min.js +2 -0
- package/dist/chunk-chunk-YWZB3KPI.module.min.js +2 -0
- package/dist/chunk-chunk-Z5KXAVQD.module.min.js +2 -0
- package/dist/chunk-chunk-ZCNBUZPL.module.min.js +2 -0
- package/dist/chunk-chunk-ZLKRTF5N.module.min.js +2 -0
- package/dist/chunk-chunk-ZTNVDWAK.module.min.js +2 -0
- package/dist/chunk-statisticalOverlays-6MVAK5RW.module.min.js +2 -0
- package/dist/components/AccessibleNavTree.d.ts +7 -1
- package/dist/components/ai/chartClinicMetadata.generated.d.ts +15 -0
- package/dist/components/ai/useNavigationSync.d.ts +17 -2
- package/dist/components/chartContainerMobile.d.ts +9 -0
- package/dist/components/charts/geo/ChoroplethMap.d.ts +19 -2
- package/dist/components/charts/geo/DistanceCartogram.d.ts +14 -2
- package/dist/components/charts/geo/FlowMap.d.ts +10 -6
- package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +14 -2
- package/dist/components/charts/index.d.ts +6 -0
- package/dist/components/charts/network/ChordDiagram.d.ts +9 -1
- package/dist/components/charts/network/ForceDirectedGraph.d.ts +11 -0
- package/dist/components/charts/network/SankeyDiagram.d.ts +9 -1
- package/dist/components/charts/ordinal/BarChart.d.ts +21 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +11 -0
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +11 -0
- package/dist/components/charts/physics/CollisionSwarmChart.d.ts +7 -0
- package/dist/components/charts/physics/EventDropChart.d.ts +7 -0
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +8 -0
- package/dist/components/charts/physics/PhysicalFlowChart.d.ts +7 -0
- package/dist/components/charts/physics/PhysicsCustomChart.d.ts +4 -25
- package/dist/components/charts/physics/PhysicsPileChart.d.ts +7 -0
- package/dist/components/charts/physics/physicsChartShared.d.ts +17 -1
- package/dist/components/charts/physics/physicsCustomLayout.d.ts +32 -0
- package/dist/components/charts/shared/AnnotationLabel.d.ts +88 -0
- package/dist/components/charts/shared/annotationActivation.d.ts +35 -0
- package/dist/components/charts/shared/annotationLabelLayout.d.ts +5 -0
- package/dist/components/charts/shared/annotationRules.d.ts +2 -1
- package/dist/components/charts/shared/auditAccessibilityText.d.ts +13 -0
- package/dist/components/charts/shared/chartSelectionUtils.d.ts +4 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +3 -3
- package/dist/components/charts/shared/datumTypes.d.ts +2 -0
- package/dist/components/charts/shared/diagnoseAnnotationChecks.d.ts +2 -0
- package/dist/components/charts/shared/formatUtils.d.ts +3 -3
- package/dist/components/charts/shared/hatchFill.d.ts +87 -0
- package/dist/components/charts/shared/hooks.d.ts +7 -6
- package/dist/components/charts/shared/knownChartComponents.d.ts +9 -0
- package/dist/components/charts/shared/leastSquaresRegression.d.ts +16 -0
- package/dist/components/charts/shared/mergeShapeStyle.d.ts +3 -2
- package/dist/components/charts/shared/semanticInteractions.d.ts +42 -0
- package/dist/components/charts/shared/sparseArray.d.ts +1 -1
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +6 -4
- package/dist/components/charts/shared/styleRules.d.ts +205 -0
- package/dist/components/charts/shared/tooltipUtils.d.ts +22 -9
- package/dist/components/charts/shared/types.d.ts +9 -6
- package/dist/components/charts/shared/useAreaSeriesSetup.d.ts +16 -2
- package/dist/components/charts/shared/useChartSetup.d.ts +2 -2
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useFrameImperativeHandle.d.ts +1 -2
- package/dist/components/charts/shared/useLikertAggregation.d.ts +4 -4
- package/dist/components/charts/shared/useOrdinalBrush.d.ts +2 -1
- package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +24 -1
- package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
- package/dist/components/charts/shared/useXYLineStyle.d.ts +10 -0
- package/dist/components/charts/shared/useXYPointStyle.d.ts +19 -1
- package/dist/components/charts/shared/validateChartData.d.ts +7 -5
- package/dist/components/charts/shared/validationMap.d.ts +11 -2
- package/dist/components/charts/shared/validationMap.generated.d.ts +6 -0
- package/dist/components/charts/shared/withChartWrapper.d.ts +4 -3
- package/dist/components/charts/value/targetPresentation.d.ts +22 -0
- package/dist/components/charts/value/types.d.ts +5 -6
- package/dist/components/charts/xy/AreaChart.d.ts +8 -0
- package/dist/components/charts/xy/BubbleChart.d.ts +9 -0
- package/dist/components/charts/xy/ConnectedScatterplot.d.ts +7 -0
- package/dist/components/charts/xy/DifferenceChart.d.ts +1 -52
- package/dist/components/charts/xy/Heatmap.d.ts +2 -2
- package/dist/components/charts/xy/LineChart.d.ts +11 -0
- package/dist/components/charts/xy/QuadrantChart.d.ts +7 -0
- package/dist/components/charts/xy/Scatterplot.d.ts +10 -0
- package/dist/components/charts/xy/StackedAreaChart.d.ts +7 -0
- package/dist/components/charts/xy/differenceSegments.d.ts +49 -0
- package/dist/components/charts/xy/scatterplotMatrixInteractionTypes.d.ts +12 -0
- package/dist/components/controls/SentenceFilter.d.ts +97 -0
- package/dist/components/data/fromVegaLite.d.ts +19 -9
- package/dist/components/rough/createRoughRenderMode.d.ts +46 -0
- package/dist/components/semiotic-ai.d.ts +3 -1
- package/dist/components/semiotic-controls.d.ts +2 -0
- package/dist/components/semiotic-geo.d.ts +4 -0
- package/dist/components/semiotic-network.d.ts +4 -0
- package/dist/components/semiotic-ordinal.d.ts +6 -0
- package/dist/components/semiotic-physics.d.ts +4 -0
- package/dist/components/semiotic-rough.d.ts +4 -0
- package/dist/components/semiotic-utils-core.d.ts +4 -0
- package/dist/components/semiotic-xy.d.ts +4 -0
- package/dist/components/semiotic.d.ts +9 -1
- package/dist/components/server/optionalImageTypes.d.ts +37 -0
- package/dist/components/server/serverChartConfigShared.d.ts +9 -5
- package/dist/components/server/serverChartConfigs.d.ts +4 -4
- package/dist/components/server/staticAnnotations.d.ts +6 -3
- package/dist/components/server/staticLegend.d.ts +1 -1
- package/dist/components/server/staticNetwork.d.ts +4 -4
- package/dist/components/server/staticSVGChrome.d.ts +5 -4
- package/dist/components/store/ObservationStore.d.ts +21 -1
- package/dist/components/stream/AccessibleDataTable.d.ts +4 -10
- package/dist/components/stream/AriaLiveTooltip.d.ts +9 -0
- package/dist/components/stream/CanvasHitTester.d.ts +4 -4
- package/dist/components/stream/DataSourceAdapter.d.ts +1 -1
- package/dist/components/stream/FrameRuntime.d.ts +57 -0
- package/dist/components/stream/GeoParticlePool.d.ts +1 -1
- package/dist/components/stream/GeoPipelineStore.d.ts +43 -12
- package/dist/components/stream/GeoSVGOverlay.d.ts +64 -0
- package/dist/components/stream/NetworkCanvasHitTester.d.ts +2 -1
- package/dist/components/stream/NetworkPipelineStore.d.ts +24 -21
- package/dist/components/stream/NetworkSSRFrame.d.ts +17 -0
- package/dist/components/stream/NetworkSVGOverlay.d.ts +6 -0
- package/dist/components/stream/OrdinalBrushOverlay.d.ts +1 -2
- package/dist/components/stream/OrdinalBrushOverlayLazy.d.ts +9 -0
- package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -2
- package/dist/components/stream/OrdinalPipelineStore.d.ts +13 -13
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +9 -1
- package/dist/components/stream/OrdinalStyleResolver.d.ts +12 -0
- package/dist/components/stream/ParticlePool.d.ts +1 -1
- package/dist/components/stream/PipelineStore.d.ts +12 -16
- package/dist/components/stream/SVGOverlay.d.ts +6 -0
- package/dist/components/stream/SceneGraph.d.ts +3 -3
- package/dist/components/stream/XYBrushOverlayLazy.d.ts +17 -0
- package/dist/components/stream/accessorUtils.d.ts +2 -2
- package/dist/components/stream/annotationAccessorResolver.d.ts +2 -2
- package/dist/components/stream/frameGraphics.d.ts +4 -0
- package/dist/components/stream/frameKeyboardNavigation.d.ts +45 -0
- package/dist/components/stream/geoPipelineHelpers.d.ts +3 -3
- package/dist/components/stream/geoPipelineUpdateResults.d.ts +34 -0
- package/dist/components/stream/geoSceneBuilder.d.ts +16 -0
- package/dist/components/stream/geoTypes.d.ts +48 -15
- package/dist/components/stream/hitTestUtils.d.ts +2 -2
- package/dist/components/stream/hoverUtils.d.ts +4 -2
- package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +1 -0
- package/dist/components/stream/layouts/hierarchyUtils.d.ts +2 -2
- package/dist/components/stream/networkCustomLayoutRunner.d.ts +23 -0
- package/dist/components/stream/networkCustomRestyle.d.ts +15 -0
- package/dist/components/stream/networkFrameAnimation.d.ts +7 -0
- package/dist/components/stream/networkFrameHandleTypes.d.ts +39 -0
- package/dist/components/stream/networkFrameObservations.d.ts +15 -0
- package/dist/components/stream/networkFramePaint.d.ts +11 -2
- package/dist/components/stream/networkInteractionTypes.d.ts +26 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +2 -2
- package/dist/components/stream/networkPipelineUpdateResults.d.ts +38 -0
- package/dist/components/stream/networkTypes.d.ts +37 -56
- package/dist/components/stream/ordinalCanvasRenderers.d.ts +2 -2
- package/dist/components/stream/ordinalPipelineUpdateResults.d.ts +20 -1
- package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -2
- package/dist/components/stream/ordinalTypes.d.ts +30 -3
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +2 -0
- package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +6 -0
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +21 -6
- package/dist/components/stream/physics/physicsFrameObservations.d.ts +19 -0
- package/dist/components/stream/physics/physicsFrameSetup.d.ts +4 -0
- package/dist/components/stream/physics/physicsPipelineUpdateResults.d.ts +19 -1
- package/dist/components/stream/physics/usePhysicsFrameLifecyclePolicy.d.ts +3 -1
- package/dist/components/stream/pipelineConfig.d.ts +4 -2
- package/dist/components/stream/pipelineDecay.d.ts +2 -2
- package/dist/components/stream/pipelinePulse.d.ts +2 -2
- package/dist/components/stream/pipelineStoreUpdateResults.d.ts +23 -2
- package/dist/components/stream/pipelineTransitions.d.ts +1 -1
- package/dist/components/stream/pipelineUpdateContract.d.ts +7 -0
- package/dist/components/stream/pipelineUpdateStore.d.ts +21 -0
- package/dist/components/stream/renderBackend.d.ts +27 -0
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +15 -1
- package/dist/components/stream/renderers/geoCanvasRenderer.d.ts +3 -2
- package/dist/components/stream/renderers/networkParticleRenderer.d.ts +1 -1
- package/dist/components/stream/sceneRenderBackendTypes.d.ts +28 -0
- package/dist/components/stream/sceneRevisionDiagnostics.d.ts +31 -4
- package/dist/components/stream/streamSemanticTypes.d.ts +16 -0
- package/dist/components/stream/streamThemeTypes.d.ts +14 -0
- package/dist/components/stream/svgOverlayUtils.d.ts +10 -0
- package/dist/components/stream/test-utils/frameScheduler.d.ts +12 -0
- package/dist/components/stream/test-utils/revisionConsumption.d.ts +13 -0
- package/dist/components/stream/titleLayout.d.ts +31 -0
- package/dist/components/stream/types.d.ts +30 -65
- package/dist/components/stream/useCanvasFrameHost.d.ts +71 -0
- package/dist/components/stream/useFrame.d.ts +23 -0
- package/dist/components/stream/useLegendCategoryEmission.d.ts +3 -3
- package/dist/components/stream/useSemanticFrameInteractions.d.ts +22 -0
- package/dist/components/stream/useUpdateResultSnapshot.d.ts +7 -0
- package/dist/components/stream/xyFrameAxisTypes.d.ts +50 -0
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -5
- package/dist/controls.min.js +1 -1
- package/dist/controls.module.min.js +1 -1
- package/dist/forceLayoutWorker.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.min.js +1 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.min.js +1 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/rough.min.js +1 -0
- package/dist/rough.module.min.js +1 -0
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +3 -1
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-controls.d.ts +2 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental.min.js +1 -1
- package/dist/semiotic-experimental.module.min.js +1 -1
- package/dist/semiotic-geo.d.ts +4 -0
- package/dist/semiotic-network.d.ts +4 -0
- package/dist/semiotic-ordinal.d.ts +6 -0
- package/dist/semiotic-physics.d.ts +4 -0
- package/dist/semiotic-realtime-core.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-react.min.js +1 -1
- package/dist/semiotic-recipes-react.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +1 -1
- package/dist/semiotic-recipes.module.min.js +1 -1
- package/dist/semiotic-rough.d.ts +4 -0
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes-react.min.js +1 -1
- package/dist/semiotic-themes-react.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.d.ts +4 -0
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils-react.min.js +1 -1
- package/dist/semiotic-utils-react.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-value.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +4 -0
- package/dist/semiotic.d.ts +9 -1
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/test-utils/capturedFrameProps.d.ts +67 -0
- package/dist/test-utils/frameMock.d.ts +12 -9
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +29 -10
- package/dist/semiotic-ai-statisticalOverlays-CY4WKR4A.module.min.js +0 -2
- package/dist/semiotic-chunk-3FSVZ46U.module.min.js +0 -2
- package/dist/semiotic-statisticalOverlays-UOMSFKVJ.module.min.js +0 -2
- package/dist/xy-chunk-IWD6IB6V.module.min.js +0 -2
- package/dist/xy-statisticalOverlays-7RWG6LJT.module.min.js +0 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { Datum } from "./datumTypes";
|
|
3
|
+
import type { SemanticClickBehavior, SemanticHoverBehavior } from "./semanticInteractions";
|
|
3
4
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
4
5
|
import type { HoverData } from "../../realtime/types";
|
|
5
6
|
import type { HoverHighlightMode, LinkedHoverProp, SelectionConfig, ResolvedMobileInteractionConfig } from "./types";
|
|
@@ -86,8 +87,8 @@ export declare function buildCustomBehaviorProps(input: {
|
|
|
86
87
|
forceHoverBehavior?: boolean;
|
|
87
88
|
forceClickBehavior?: boolean;
|
|
88
89
|
mobileInteraction?: ResolvedMobileInteractionConfig;
|
|
89
|
-
customHoverBehavior:
|
|
90
|
-
customClickBehavior?:
|
|
90
|
+
customHoverBehavior: SemanticHoverBehavior;
|
|
91
|
+
customClickBehavior?: SemanticClickBehavior;
|
|
91
92
|
/**
|
|
92
93
|
* Whether `linkedHover` participates in the click predicate. Most
|
|
93
94
|
* XY / ordinal HOCs say yes — `linkedHover` cross-chart selection
|
|
@@ -98,8 +99,9 @@ export declare function buildCustomBehaviorProps(input: {
|
|
|
98
99
|
*/
|
|
99
100
|
linkedHoverInClickPredicate?: boolean;
|
|
100
101
|
}): {
|
|
101
|
-
customHoverBehavior?:
|
|
102
|
-
customClickBehavior?:
|
|
102
|
+
customHoverBehavior?: SemanticHoverBehavior;
|
|
103
|
+
customClickBehavior?: SemanticClickBehavior;
|
|
104
|
+
annotationObservationCallback?: OnObservationCallback;
|
|
103
105
|
hoverRadius?: number;
|
|
104
106
|
};
|
|
105
107
|
/**
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declarative, threshold-aware style rules for data marks.
|
|
3
|
+
*
|
|
4
|
+
* A `StyleRule[]` is an ordered list of `{ when, style }` pairs. Every rule
|
|
5
|
+
* whose `when` condition matches a datum contributes its `style`; styles are
|
|
6
|
+
* merged in list order so — for any single property — the **last applicable
|
|
7
|
+
* rule wins**. This is the CSS-cascade mental model: send as many rules as
|
|
8
|
+
* you like, and the last one that applies to a given property is the one you
|
|
9
|
+
* see. A datum that matches no rule keeps the chart's resolved base style.
|
|
10
|
+
*
|
|
11
|
+
* `when` is intentionally permissive: it can be a predicate function (full
|
|
12
|
+
* control), a declarative numeric/categorical threshold (no code), or simply
|
|
13
|
+
* omitted / `true` (an unconditional base layer). Threshold conditions read a
|
|
14
|
+
* numeric value from `field` (falling back to the chart-provided value, e.g.
|
|
15
|
+
* a bar's `valueAccessor`), so `{ when: { gt: 10 }, style: {...} }` "styles
|
|
16
|
+
* every bar taller than 10" with no accessor boilerplate.
|
|
17
|
+
*
|
|
18
|
+
* The engine is chart-agnostic — it operates on a raw datum plus a small
|
|
19
|
+
* context (`value`, `category`, `index`). Bar-family HOCs feed it through
|
|
20
|
+
* `useOrdinalPieceStyle`, but any renderer with a datum and a numeric value
|
|
21
|
+
* can reuse it.
|
|
22
|
+
*/
|
|
23
|
+
import type { Datum } from "./datumTypes";
|
|
24
|
+
import type { HatchFill } from "./hatchFill";
|
|
25
|
+
/** The style a rule applies. `fill` may be a solid color or a {@link HatchFill}. */
|
|
26
|
+
export interface StyleRuleStyle {
|
|
27
|
+
/** Solid color string, a CSS var, or a declarative hatch descriptor. */
|
|
28
|
+
fill?: string | HatchFill;
|
|
29
|
+
fillOpacity?: number;
|
|
30
|
+
stroke?: string;
|
|
31
|
+
strokeWidth?: number;
|
|
32
|
+
strokeDasharray?: string;
|
|
33
|
+
opacity?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A declarative numeric / categorical condition. All present operators must
|
|
37
|
+
* hold (logical AND). The compared value is chosen in this order:
|
|
38
|
+
* 1. `axis` — a resolved context channel (`"x"` / `"y"` / `"value"`), so a
|
|
39
|
+
* rule can target either axis of an XY chart regardless of the accessor
|
|
40
|
+
* field name (e.g. `{ axis: "y", gt: 10 }`).
|
|
41
|
+
* 2. `field` — a raw datum property (`datum[field]`).
|
|
42
|
+
* 3. otherwise the host-resolved context value (`ctx.value` — the bar value,
|
|
43
|
+
* the y value for XY, the node/feature/body value, etc.).
|
|
44
|
+
*/
|
|
45
|
+
export interface StyleRuleThreshold {
|
|
46
|
+
/**
|
|
47
|
+
* Compare against a resolved context channel rather than a raw field. Use to
|
|
48
|
+
* target an XY chart's `"x"` or `"y"` axis without knowing the accessor's
|
|
49
|
+
* field name. `"value"` is the same channel the field-less default uses.
|
|
50
|
+
*/
|
|
51
|
+
axis?: "x" | "y" | "value";
|
|
52
|
+
/** Datum field to compare. Defaults to the host-resolved context value. */
|
|
53
|
+
field?: string;
|
|
54
|
+
/** value > n */
|
|
55
|
+
gt?: number;
|
|
56
|
+
/** value >= n */
|
|
57
|
+
gte?: number;
|
|
58
|
+
/** value < n */
|
|
59
|
+
lt?: number;
|
|
60
|
+
/** value <= n */
|
|
61
|
+
lte?: number;
|
|
62
|
+
/** value === n (numeric or string equality) */
|
|
63
|
+
eq?: number | string;
|
|
64
|
+
/** value !== n */
|
|
65
|
+
ne?: number | string;
|
|
66
|
+
/** min <= value <= max (inclusive) */
|
|
67
|
+
within?: [number, number];
|
|
68
|
+
/** value < min OR value > max */
|
|
69
|
+
outside?: [number, number];
|
|
70
|
+
/** value is one of the listed values */
|
|
71
|
+
in?: Array<number | string>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Context passed to predicate / style functions and threshold resolution.
|
|
75
|
+
* Which channels are populated depends on the chart family:
|
|
76
|
+
* - ordinal bars: `value` (bar value), `category` (stack/group key)
|
|
77
|
+
* - XY: `value` (= `y`), `x`, `y`
|
|
78
|
+
* - network nodes: `value` (node size/value), `category` (group / colorBy)
|
|
79
|
+
* - geo features: `value` (feature value), `category`
|
|
80
|
+
* - physics particles: `value` (body value), `category` (colorBy group)
|
|
81
|
+
*/
|
|
82
|
+
export interface StyleRuleContext {
|
|
83
|
+
/** Primary numeric value the host resolved (bar value; XY y; node/feature/body value). */
|
|
84
|
+
value: number | undefined;
|
|
85
|
+
/** Resolved x value (XY family). */
|
|
86
|
+
x?: number;
|
|
87
|
+
/** Resolved y value (XY family; usually equals `value`). */
|
|
88
|
+
y?: number;
|
|
89
|
+
/** Resolved size value (bubble / symbol `sizeBy`, node size), when known. */
|
|
90
|
+
size?: number;
|
|
91
|
+
/** Category / series / stack / group key, when the host knows one. */
|
|
92
|
+
category?: string;
|
|
93
|
+
/** Positional index, when the host provides one. */
|
|
94
|
+
index?: number;
|
|
95
|
+
}
|
|
96
|
+
/** A `when` predicate: full programmatic control over matching. */
|
|
97
|
+
export type StyleRulePredicate = (datum: Datum, ctx: StyleRuleContext) => boolean;
|
|
98
|
+
/**
|
|
99
|
+
* One declarative style rule. `when` may be:
|
|
100
|
+
* - a **predicate** `(datum, ctx) => boolean`
|
|
101
|
+
* - a **threshold** object (`{ gt, lte, within, in, … }`)
|
|
102
|
+
* - `true` / omitted — always matches (an unconditional base layer)
|
|
103
|
+
* - `false` — never matches (temporarily disable a rule)
|
|
104
|
+
*/
|
|
105
|
+
export interface StyleRule {
|
|
106
|
+
/** Optional stable id — handy for legends, debugging, and docs. */
|
|
107
|
+
id?: string;
|
|
108
|
+
/** Match condition. Omitted / `true` ⇒ always applies. */
|
|
109
|
+
when?: StyleRulePredicate | StyleRuleThreshold | boolean;
|
|
110
|
+
/** Style to apply when matched. Object, or a per-datum function. */
|
|
111
|
+
style: StyleRuleStyle | ((datum: Datum, ctx: StyleRuleContext) => StyleRuleStyle);
|
|
112
|
+
/** Optional human label (legend / documentation only). */
|
|
113
|
+
label?: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Build a stable-ish resolver that reads a numeric value from a datum via a
|
|
117
|
+
* string field or accessor function — the value threshold rules compare
|
|
118
|
+
* against when their `field` is omitted. Memoize the result in the host
|
|
119
|
+
* component keyed on the accessor (string accessors are already stable).
|
|
120
|
+
*/
|
|
121
|
+
export declare function makeRuleValueResolver(accessor: string | ((d: Datum) => unknown) | undefined): (d: Datum) => number | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Build the XY `StyleRuleContext` resolver from x/y accessors: populates
|
|
124
|
+
* `value` (= y), `x`, and `y` so thresholds can target either axis via
|
|
125
|
+
* `{ axis: "x" }` / `{ axis: "y" }` regardless of the accessor field names.
|
|
126
|
+
* Shared by the XY client hooks and the XY server render configs. Memoize in
|
|
127
|
+
* the host keyed on the accessors.
|
|
128
|
+
*/
|
|
129
|
+
export declare function makeXYRuleContext(xAccessor: string | ((d: Datum) => unknown) | undefined, yAccessor: string | ((d: Datum) => unknown) | undefined): (d: Datum, category?: string) => StyleRuleContext;
|
|
130
|
+
/**
|
|
131
|
+
* Build the network-node `StyleRuleContext` resolver: `value` from a numeric
|
|
132
|
+
* field (defaults to the node's `value`) and `category` from the `colorBy`
|
|
133
|
+
* group. Rules resolve against the raw node object (unwrap `RealtimeNode.data`
|
|
134
|
+
* first). Shared by network client HOCs and the network server configs.
|
|
135
|
+
*/
|
|
136
|
+
export declare function makeNodeRuleContext(colorBy: string | ((d: Datum) => unknown) | undefined, valueAccessor?: string | ((d: Datum) => unknown)): (raw: Datum) => StyleRuleContext;
|
|
137
|
+
/**
|
|
138
|
+
* Evaluate a declarative threshold against a datum + context. Returns `false`
|
|
139
|
+
* when the compared value can't be resolved to a finite number (except for the
|
|
140
|
+
* purely categorical `eq`/`ne`/`in` operators, which also accept strings).
|
|
141
|
+
*/
|
|
142
|
+
export declare function matchesThreshold(threshold: StyleRuleThreshold, datum: Datum, ctx: StyleRuleContext): boolean;
|
|
143
|
+
/** Does a single rule's `when` condition match this datum? */
|
|
144
|
+
export declare function ruleMatches(rule: StyleRule, datum: Datum, ctx: StyleRuleContext): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Resolve an ordered rule list to a single merged style. Every matching
|
|
147
|
+
* rule's style is spread in list order, so for any given property the last
|
|
148
|
+
* applicable rule wins. Returns an empty object when nothing matches (the
|
|
149
|
+
* host chart's base style is then used unchanged).
|
|
150
|
+
*/
|
|
151
|
+
export declare function resolveStyleRules(datum: Datum, rules: ReadonlyArray<StyleRule> | undefined, ctx: StyleRuleContext): StyleRuleStyle;
|
|
152
|
+
/** A per-mark style function the pipelines accept (`fill` may be a HatchFill). */
|
|
153
|
+
type MarkStyleFn = (d: Datum, arg?: string) => StyleRuleStyle;
|
|
154
|
+
/**
|
|
155
|
+
* Client-side composition: wrap a base per-mark style function so declarative
|
|
156
|
+
* rules layer OVER its output (rules win per property), matching the ordinal
|
|
157
|
+
* `useOrdinalPieceStyle` behavior for every other family. The base style runs
|
|
158
|
+
* first (resolving the mark's base color); the merged rule style is spread on
|
|
159
|
+
* top. Returns the base function unchanged when there are no rules, so it's a
|
|
160
|
+
* zero-cost pass-through in the common case.
|
|
161
|
+
*
|
|
162
|
+
* `buildContext` populates the `StyleRuleContext` channels the family's rules
|
|
163
|
+
* read (`value`, `x`, `y`, `category`…). `unwrap` handles frames whose style
|
|
164
|
+
* callbacks receive a wrapper rather than the raw datum (e.g. network's
|
|
165
|
+
* `RealtimeNode`, whose user object lives on `.data`) — rules and
|
|
166
|
+
* `buildContext` see the unwrapped raw datum, while the base function still
|
|
167
|
+
* receives the original argument.
|
|
168
|
+
*/
|
|
169
|
+
export declare function composeStyleRules<A = string>(baseStyleFn: ((d: Datum, arg?: A) => Datum) | undefined, rules: ReadonlyArray<StyleRule> | undefined, buildContext: (raw: Datum, arg?: A) => StyleRuleContext, unwrap?: (d: Datum) => Datum): (d: Datum, arg?: A) => Datum;
|
|
170
|
+
/**
|
|
171
|
+
* Compose style rules into a per-mark style function. It resolves the merged
|
|
172
|
+
* rule style from a per-datum `StyleRuleContext` (built by `buildContext`),
|
|
173
|
+
* then overlays a user-supplied style function (which wins). Marks left
|
|
174
|
+
* unmatched return an empty style so the frame's own base-color resolver fills
|
|
175
|
+
* them.
|
|
176
|
+
*
|
|
177
|
+
* This is the family-agnostic primitive behind the server render path (which
|
|
178
|
+
* builds frame props directly instead of going through a HOC hook). Each
|
|
179
|
+
* family supplies the `buildContext` that populates the channels its threshold
|
|
180
|
+
* rules read — `value` for bars, `{ value, x, y }` for XY, node value/group
|
|
181
|
+
* for network, etc. — so all families share one rule-resolution core.
|
|
182
|
+
*
|
|
183
|
+
* @param arg the second style-fn argument (ordinal category / stack key). It is
|
|
184
|
+
* passed through to `buildContext` and the user style fn unchanged.
|
|
185
|
+
*/
|
|
186
|
+
export declare function makeStyleRuleStyleFn(rules: ReadonlyArray<StyleRule> | undefined, buildContext: (d: Datum, arg?: string) => StyleRuleContext, userStyleFn?: MarkStyleFn): MarkStyleFn | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* Network-flavored server helper: resolves rules against the raw node (the
|
|
189
|
+
* server frame passes a `RealtimeNode` wrapper whose user object is on
|
|
190
|
+
* `.data`), with `{ value, category }` context from `makeNodeRuleContext`. A
|
|
191
|
+
* user `nodeStyle` overlays and wins. `undefined` when there are no rules.
|
|
192
|
+
*/
|
|
193
|
+
export declare function styleRulesToNodeStyle(rules: ReadonlyArray<StyleRule> | undefined, colorBy: string | ((d: Datum) => unknown) | undefined, valueAccessor: string | ((d: Datum) => unknown) | undefined, userNodeStyle?: (d: Datum, arg?: number) => Datum): ((d: Datum, arg?: number) => Datum) | undefined;
|
|
194
|
+
/**
|
|
195
|
+
* XY-flavored server helper: `{ value: y, x, y }` context from `makeXYRuleContext`.
|
|
196
|
+
* Feeds `pointStyle` / `lineStyle`. A user style overlays and wins.
|
|
197
|
+
*/
|
|
198
|
+
export declare function styleRulesToXYStyle(rules: ReadonlyArray<StyleRule> | undefined, xAccessor: string | ((d: Datum) => unknown) | undefined, yAccessor: string | ((d: Datum) => unknown) | undefined, userStyle?: MarkStyleFn): MarkStyleFn | undefined;
|
|
199
|
+
/**
|
|
200
|
+
* Ordinal-flavored {@link makeStyleRuleStyleFn}: the context is
|
|
201
|
+
* `{ value: valueAccessor(d), category }` — the bar/piece value plus the
|
|
202
|
+
* stack/group key. Kept as sugar for the ordinal server config.
|
|
203
|
+
*/
|
|
204
|
+
export declare function styleRulesToPieceStyle(rules: ReadonlyArray<StyleRule> | undefined, valueAccessor: string | ((d: Datum) => unknown) | undefined, userPieceStyle?: MarkStyleFn): MarkStyleFn | undefined;
|
|
205
|
+
export {};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { HoverData } from "../../realtime/types";
|
|
3
3
|
import type { Datum } from "./datumTypes";
|
|
4
|
+
export type TooltipValue = string | number | boolean | Date | Datum | Datum[] | null | undefined;
|
|
5
|
+
type TooltipAccessor = string | {
|
|
6
|
+
bivarianceHack(datum: Datum): TooltipValue;
|
|
7
|
+
}["bivarianceHack"];
|
|
8
|
+
type TooltipFormatter = {
|
|
9
|
+
bivarianceHack(value: TooltipValue, index?: number, allTicks?: number[]): React.ReactNode;
|
|
10
|
+
}["bivarianceHack"];
|
|
4
11
|
export interface TooltipFieldConfig {
|
|
5
12
|
label: string;
|
|
6
|
-
accessor:
|
|
13
|
+
accessor: TooltipAccessor;
|
|
7
14
|
role?: "title" | "x" | "y" | "color" | "size" | "group" | "value";
|
|
8
15
|
/** Per-field formatter. HOCs pass `xFormat`/`yFormat`/`valueFormat` here so
|
|
9
16
|
* the default tooltip renders values consistently with the axis. Typed
|
|
@@ -12,15 +19,15 @@ export interface TooltipFieldConfig {
|
|
|
12
19
|
* (`(d, index?, allTicks?) => ReactNode`). A ReactNode return renders
|
|
13
20
|
* as-is in the tooltip span. If the formatter throws, the tooltip
|
|
14
21
|
* falls back to the built-in `formatVal`. */
|
|
15
|
-
format?:
|
|
22
|
+
format?: TooltipFormatter;
|
|
16
23
|
}
|
|
17
24
|
/**
|
|
18
25
|
* Extract a display name from an accessor.
|
|
19
26
|
* Strings return themselves; functions return "value".
|
|
20
27
|
*/
|
|
21
|
-
export declare function accessorName(acc:
|
|
28
|
+
export declare function accessorName(acc: TooltipAccessor): string;
|
|
22
29
|
export declare function formatVal(v: unknown): string;
|
|
23
|
-
export declare function resolveValue(d: Datum, acc:
|
|
30
|
+
export declare function resolveValue(d: Datum, acc: TooltipAccessor): TooltipValue;
|
|
24
31
|
export { smartTooltipEntries } from "./smartTooltip";
|
|
25
32
|
export type { SmartTooltipEntry, SmartTooltipResult } from "./smartTooltip";
|
|
26
33
|
/**
|
|
@@ -33,7 +40,13 @@ export type { SmartTooltipEntry, SmartTooltipResult } from "./smartTooltip";
|
|
|
33
40
|
* Returns an empty array when band is not configured, so the spread at
|
|
34
41
|
* the call site is a no-op for the common case.
|
|
35
42
|
*/
|
|
36
|
-
export declare function bandTooltipFields(band:
|
|
43
|
+
export declare function bandTooltipFields(band: {
|
|
44
|
+
y0Accessor?: TooltipAccessor;
|
|
45
|
+
y1Accessor?: TooltipAccessor;
|
|
46
|
+
} | Array<{
|
|
47
|
+
y0Accessor?: TooltipAccessor;
|
|
48
|
+
y1Accessor?: TooltipAccessor;
|
|
49
|
+
}> | null | undefined, valueFormat?: TooltipFormatter): TooltipFieldConfig[];
|
|
37
50
|
/**
|
|
38
51
|
* Build a default tooltipContent function for StreamXYFrame HOCs.
|
|
39
52
|
* Receives HoverData ({ data, time, value, x, y }) and renders
|
|
@@ -48,13 +61,13 @@ export declare function buildDefaultTooltip(fields: TooltipFieldConfig[]): (hove
|
|
|
48
61
|
* (PieChart/DonutChart wrap data in arrays). Default: `d.data || d`.
|
|
49
62
|
*/
|
|
50
63
|
export declare function buildOrdinalTooltip({ categoryAccessor, valueAccessor, groupAccessor, groupLabel, pieData, valueFormat, }: {
|
|
51
|
-
categoryAccessor:
|
|
52
|
-
valueAccessor:
|
|
53
|
-
groupAccessor?:
|
|
64
|
+
categoryAccessor: TooltipAccessor;
|
|
65
|
+
valueAccessor: TooltipAccessor;
|
|
66
|
+
groupAccessor?: TooltipAccessor;
|
|
54
67
|
groupLabel?: string;
|
|
55
68
|
pieData?: boolean;
|
|
56
69
|
/** Same formatter the HOC passes to the value axis. Threaded here so the
|
|
57
70
|
* default tooltip shows values consistently with the axis ("$450k", not
|
|
58
71
|
* "450000"). Override by passing a custom `tooltip` prop. */
|
|
59
|
-
valueFormat?:
|
|
72
|
+
valueFormat?: TooltipFormatter;
|
|
60
73
|
}): (d: Datum) => React.ReactNode;
|
|
@@ -2,7 +2,7 @@ import type React from "react";
|
|
|
2
2
|
import type { PartialMargin } from "../../types/marginType";
|
|
3
3
|
import type { OnObservationCallback } from "../../store/ObservationStore";
|
|
4
4
|
import type { AnimateProp } from "../../stream/pipelineTransitionUtils";
|
|
5
|
-
import type { Datum } from "./datumTypes";
|
|
5
|
+
import type { Datum, DatumValue } from "./datumTypes";
|
|
6
6
|
import type { AutoPlaceAnnotations } from "../../recipes/annotationLayout";
|
|
7
7
|
import type { ResponsiveRule } from "./responsiveRules";
|
|
8
8
|
import type { MobileVisualizationContract } from "./auditMobileVisualization";
|
|
@@ -164,10 +164,7 @@ export interface BaseChartProps {
|
|
|
164
164
|
accessibleTable?: boolean;
|
|
165
165
|
/** Callback when a data element is clicked. Receives the original datum and pixel coordinates.
|
|
166
166
|
* For lines, receives the line data; for bars, the bar datum; for pie slices, the slice datum. */
|
|
167
|
-
onClick?:
|
|
168
|
-
x: number;
|
|
169
|
-
y: number;
|
|
170
|
-
}) => void;
|
|
167
|
+
onClick?: DatumClickHandler;
|
|
171
168
|
/** Dim non-hovered series when hovering a data mark. Requires `colorBy`. */
|
|
172
169
|
hoverHighlight?: HoverHighlightMode;
|
|
173
170
|
/** Max pixel distance for hover/click hit testing. Default 30. Increase for sparse charts, decrease for dense ones. */
|
|
@@ -198,6 +195,12 @@ export interface BaseChartProps {
|
|
|
198
195
|
* - Network / geo / hierarchy charts: no-op (no continuous axis). */
|
|
199
196
|
axisExtent?: import("./axisExtent").AxisExtentMode;
|
|
200
197
|
}
|
|
198
|
+
export type DatumClickHandler = {
|
|
199
|
+
bivarianceHack(datum: Datum, event: {
|
|
200
|
+
x: number;
|
|
201
|
+
y: number;
|
|
202
|
+
}): void;
|
|
203
|
+
}["bivarianceHack"];
|
|
201
204
|
/**
|
|
202
205
|
* Axis configuration props
|
|
203
206
|
*/
|
|
@@ -220,7 +223,7 @@ export type CategoryFormatFn = (label: string, index?: number) => string | React
|
|
|
220
223
|
* Accessor type - can be a property name or a function
|
|
221
224
|
* @deprecated Use DataAccessor from generalTypes for generic type safety
|
|
222
225
|
*/
|
|
223
|
-
export type Accessor<T =
|
|
226
|
+
export type Accessor<T = DatumValue> = string | ((d: Datum, i?: number) => T);
|
|
224
227
|
/**
|
|
225
228
|
* Generic accessor type that provides autocomplete when TDatum is specified.
|
|
226
229
|
* Uses Datum in the function param so HOC charts can pass
|
|
@@ -3,6 +3,11 @@ import type { Datum } from "./datumTypes";
|
|
|
3
3
|
import type { Accessor, ChartAccessor } from "./types";
|
|
4
4
|
import type { SelectionHookResult } from "./selectionUtils";
|
|
5
5
|
import type { HoverData } from "../../stream/types";
|
|
6
|
+
import type { BandConfig } from "../../stream/types";
|
|
7
|
+
import { type StyleRule, type StyleRuleContext } from "./styleRules";
|
|
8
|
+
import type { HatchFill } from "./hatchFill";
|
|
9
|
+
/** Values a resolved area/line style may carry (`fill` can be a HatchFill). */
|
|
10
|
+
type AreaStyleValue = string | number | HatchFill | CanvasPattern | undefined;
|
|
6
11
|
export interface AreaSeriesSetupOptions<TDatum extends Datum = Datum> {
|
|
7
12
|
/** Sparse-filtered data array (the HOC's `safeData`). */
|
|
8
13
|
safeData: TDatum[];
|
|
@@ -54,14 +59,22 @@ export interface AreaSeriesSetupOptions<TDatum extends Datum = Datum> {
|
|
|
54
59
|
groupField?: Accessor<string> | ChartAccessor<TDatum, string>;
|
|
55
60
|
/** Optional band prop — when set, the default tooltip surfaces a
|
|
56
61
|
* pair of rows per band (low + high). Threaded through verbatim. */
|
|
57
|
-
band?:
|
|
62
|
+
band?: BandConfig<TDatum> | Array<BandConfig<TDatum>>;
|
|
63
|
+
/**
|
|
64
|
+
* Declarative style rules, merged on top of the resolved area fill/stroke
|
|
65
|
+
* (last-applicable rule wins). Per-series: resolves against the series'
|
|
66
|
+
* sample datum. A rule `fill` may be a color or a HatchFill.
|
|
67
|
+
*/
|
|
68
|
+
styleRules?: ReadonlyArray<StyleRule>;
|
|
69
|
+
/** Build the `StyleRuleContext` for a series sample datum. */
|
|
70
|
+
ruleContext?: (d: Datum) => StyleRuleContext;
|
|
58
71
|
}
|
|
59
72
|
export interface AreaSeriesSetupResult<TDatum extends Datum = Datum> {
|
|
60
73
|
/** Flat data array ready for `<StreamXYFrame data={…} />`. Empty
|
|
61
74
|
* when the HOC is in push mode (no `data` prop). */
|
|
62
75
|
flattenedData: TDatum[];
|
|
63
76
|
/** Selection-aware line/area style fn. */
|
|
64
|
-
lineStyle: (d: Datum) => Record<string,
|
|
77
|
+
lineStyle: (d: Datum) => Record<string, AreaStyleValue>;
|
|
65
78
|
/** Selection-aware point style fn — `undefined` when `showPoints`
|
|
66
79
|
* is false so the HOC can spread it conditionally. */
|
|
67
80
|
pointStyle: ((d: Datum) => Record<string, string | number>) | undefined;
|
|
@@ -76,3 +89,4 @@ export interface AreaSeriesSetupResult<TDatum extends Datum = Datum> {
|
|
|
76
89
|
* verbatim before extraction.
|
|
77
90
|
*/
|
|
78
91
|
export declare function useAreaSeriesSetup<TDatum extends Datum = Datum>(options: AreaSeriesSetupOptions<TDatum>): AreaSeriesSetupResult<TDatum>;
|
|
92
|
+
export {};
|
|
@@ -18,7 +18,7 @@ export interface ChartSetupInput {
|
|
|
18
18
|
/** The data array used for color scale and category extraction */
|
|
19
19
|
data: Array<Datum>;
|
|
20
20
|
/** The original data prop (may be undefined) — used for empty-state check */
|
|
21
|
-
rawData:
|
|
21
|
+
rawData: Array<Datum | null | undefined> | undefined;
|
|
22
22
|
/** The color-by accessor (may be an "actual" colorBy derived from stackBy/groupBy/categoryAccessor) */
|
|
23
23
|
colorBy: Accessor<string> | undefined;
|
|
24
24
|
/** Color scheme name or custom array — undefined lets useColorScale consult the theme */
|
|
@@ -53,7 +53,7 @@ export interface ChartSetupInput {
|
|
|
53
53
|
right: number;
|
|
54
54
|
};
|
|
55
55
|
/** onClick callback */
|
|
56
|
-
onClick?: (datum:
|
|
56
|
+
onClick?: (datum: Datum, event: {
|
|
57
57
|
x: number;
|
|
58
58
|
y: number;
|
|
59
59
|
}) => void;
|
|
@@ -28,6 +28,9 @@ interface ScaffoldOptions {
|
|
|
28
28
|
enableHover?: boolean;
|
|
29
29
|
showLegend?: boolean;
|
|
30
30
|
title?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
summary?: string;
|
|
33
|
+
accessibleTable?: boolean;
|
|
31
34
|
mobileInteraction?: MobileInteractionProp;
|
|
32
35
|
mobileSemantics?: MobileVisualizationContract;
|
|
33
36
|
responsiveRules?: ResponsiveRule[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ref, RefObject
|
|
1
|
+
import type { Ref, RefObject } from "react";
|
|
2
2
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
3
3
|
type FrameVariant = "xy" | "network" | "geo-points" | "geo-lines";
|
|
4
4
|
interface Options {
|
|
@@ -15,7 +15,6 @@ interface Options {
|
|
|
15
15
|
variant: FrameVariant;
|
|
16
16
|
frameRef: RefObject<unknown>;
|
|
17
17
|
overrides?: Partial<RealtimeFrameHandle>;
|
|
18
|
-
deps?: DependencyList;
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
20
|
* Wire up the HOC's exposed `ref` to the inner frame ref using the
|
|
@@ -30,11 +30,11 @@ export declare function resolveAccessorFn<T>(accessor: string | ((d: Datum) => T
|
|
|
30
30
|
* Interpolates from red → gray → blue for odd, red → blue for even.
|
|
31
31
|
*/
|
|
32
32
|
export declare function defaultDivergingScheme(n: number, themeDivergingSchemeName?: string): string[];
|
|
33
|
-
export declare function aggregateData(data:
|
|
33
|
+
export declare function aggregateData(data: Datum[], levels: string[], getCat: (d: Datum) => string, getScore: ((d: Datum) => number) | null, getLevel: ((d: Datum) => string) | null, getCount: ((d: Datum) => number) | null): AggregatedRow[];
|
|
34
34
|
export declare function toDivergingValues(rows: AggregatedRow[], levels: string[]): AggregatedRow[];
|
|
35
35
|
export declare function orderForDiverging(rows: AggregatedRow[], levels: string[]): AggregatedRow[];
|
|
36
36
|
interface UseLikertAggregationConfig {
|
|
37
|
-
data:
|
|
37
|
+
data: Datum[] | undefined;
|
|
38
38
|
levels: string[];
|
|
39
39
|
categoryAccessor?: string | ((d: Datum) => string);
|
|
40
40
|
valueAccessor?: string | ((d: Datum) => number);
|
|
@@ -47,9 +47,9 @@ interface UseLikertAggregationResult {
|
|
|
47
47
|
/** Pre-processed data for static mode */
|
|
48
48
|
processedData: AggregatedRow[];
|
|
49
49
|
/** Re-aggregate all accumulated data (call from push handlers) */
|
|
50
|
-
reAggregate: (rawData:
|
|
50
|
+
reAggregate: (rawData: Datum[]) => void;
|
|
51
51
|
/** Ref holding accumulated raw data for push mode */
|
|
52
|
-
accumulatorRef: MutableRefObject<
|
|
52
|
+
accumulatorRef: MutableRefObject<Datum[]>;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Encapsulates Likert-specific data aggregation:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChartAccessor } from "./types";
|
|
2
|
+
import type { Datum } from "./datumTypes";
|
|
2
3
|
export interface OrdinalBrushInput {
|
|
3
4
|
brushProp: boolean | undefined;
|
|
4
5
|
onBrushProp: ((extent: {
|
|
@@ -8,7 +9,7 @@ export interface OrdinalBrushInput {
|
|
|
8
9
|
name: string;
|
|
9
10
|
rField?: string;
|
|
10
11
|
} | undefined;
|
|
11
|
-
valueAccessor: ChartAccessor<
|
|
12
|
+
valueAccessor: ChartAccessor<Datum, number>;
|
|
12
13
|
}
|
|
13
14
|
export interface OrdinalBrushResult {
|
|
14
15
|
hasBrush: boolean;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { Datum } from "./datumTypes";
|
|
2
2
|
import type { Accessor, ChartAccessor } from "./types";
|
|
3
3
|
import type { SelectionHookResult } from "./selectionUtils";
|
|
4
|
+
import { type StyleRule } from "./styleRules";
|
|
5
|
+
import type { HatchFill } from "./hatchFill";
|
|
6
|
+
/**
|
|
7
|
+
* Values a resolved piece style may carry. Wider than the axis-style
|
|
8
|
+
* `string | number` because `fill` can be a declarative {@link HatchFill}
|
|
9
|
+
* descriptor or a raw `CanvasPattern`.
|
|
10
|
+
*/
|
|
11
|
+
type PieceStyleValue = string | number | HatchFill | CanvasPattern | undefined;
|
|
12
|
+
type PieceStyleObject = Record<string, PieceStyleValue>;
|
|
4
13
|
export interface OrdinalPieceStyleOptions {
|
|
5
14
|
/** colorBy accessor — string field name or function */
|
|
6
15
|
colorBy?: Accessor<string> | ChartAccessor<Datum, string>;
|
|
@@ -65,6 +74,19 @@ export interface OrdinalPieceStyleOptions {
|
|
|
65
74
|
effectiveSelectionHook: SelectionHookResult | null | undefined;
|
|
66
75
|
/** Resolved selection config (typically `setup.resolvedSelection`). */
|
|
67
76
|
resolvedSelection: import("./types").SelectionConfig | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Declarative, threshold-aware style rules. Evaluated per piece and merged
|
|
79
|
+
* on top of the resolved base fill (last-applicable rule wins per property).
|
|
80
|
+
* The user's `frameProps.pieceStyle` still overrides these, and top-level
|
|
81
|
+
* primitive props (`stroke`/`strokeWidth`/`opacity`) override everything.
|
|
82
|
+
*/
|
|
83
|
+
styleRules?: ReadonlyArray<StyleRule>;
|
|
84
|
+
/**
|
|
85
|
+
* Resolve the numeric value a threshold rule compares against for a datum
|
|
86
|
+
* (typically the chart's `valueAccessor` output). Lets `{ when: { gt: 10 } }`
|
|
87
|
+
* work with no `field` on the threshold.
|
|
88
|
+
*/
|
|
89
|
+
resolveRuleValue?: (d: Datum) => number | undefined;
|
|
68
90
|
}
|
|
69
91
|
/**
|
|
70
92
|
* Build a memoized `pieceStyle` function that the chart can pass
|
|
@@ -84,4 +106,5 @@ export interface OrdinalPieceStyleOptions {
|
|
|
84
106
|
* })
|
|
85
107
|
* ```
|
|
86
108
|
*/
|
|
87
|
-
export declare function useOrdinalPieceStyle(options: OrdinalPieceStyleOptions): (d: Datum, category?: string) =>
|
|
109
|
+
export declare function useOrdinalPieceStyle(options: OrdinalPieceStyleOptions): (d: Datum, category?: string) => PieceStyleObject;
|
|
110
|
+
export {};
|
|
@@ -37,7 +37,7 @@ export declare function useStreamingLegend({ isPushMode, colorBy, colorScheme, s
|
|
|
37
37
|
legendPosition?: LegendPosition;
|
|
38
38
|
}): {
|
|
39
39
|
wrapPush: (originalPush: (d: Datum) => void) => (datum: Datum) => void;
|
|
40
|
-
wrapPushMany: (originalPushMany: (
|
|
40
|
+
wrapPushMany: (originalPushMany: (data: Datum[]) => void) => (data: Datum[]) => void;
|
|
41
41
|
resetCategories: () => void;
|
|
42
42
|
categories: string[];
|
|
43
43
|
categoryDomainProps: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Datum } from "./datumTypes";
|
|
2
2
|
import type { Accessor, ChartAccessor } from "./types";
|
|
3
3
|
import type { SelectionHookResult, SelectionStyleConfig } from "./selectionUtils";
|
|
4
|
+
import { type StyleRule, type StyleRuleContext } from "./styleRules";
|
|
4
5
|
export interface XYLineStyleOptions {
|
|
5
6
|
/**
|
|
6
7
|
* Base stroke width. The top-level `strokeWidth` override below
|
|
@@ -33,6 +34,15 @@ export interface XYLineStyleOptions {
|
|
|
33
34
|
effectiveSelectionHook?: SelectionHookResult | null;
|
|
34
35
|
/** Resolved selection style config (matched/unmatched style overrides). */
|
|
35
36
|
resolvedSelection?: SelectionStyleConfig;
|
|
37
|
+
/**
|
|
38
|
+
* Declarative style rules, merged on top of the resolved base stroke/fill
|
|
39
|
+
* (last-applicable rule wins). NOTE: line styles resolve per-SERIES against
|
|
40
|
+
* a representative sample datum (the series' first point), so a rule's
|
|
41
|
+
* `ctx.x`/`ctx.y` reflect that sample point, not every vertex.
|
|
42
|
+
*/
|
|
43
|
+
styleRules?: ReadonlyArray<StyleRule>;
|
|
44
|
+
/** Build the `StyleRuleContext` for a series' sample datum + group key. */
|
|
45
|
+
ruleContext?: (d: Datum, group?: string) => StyleRuleContext;
|
|
36
46
|
}
|
|
37
47
|
/**
|
|
38
48
|
* Returns a memoized `lineStyle` callback that the XY frame's
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { Datum } from "./datumTypes";
|
|
2
2
|
import type { Accessor, ChartAccessor } from "./types";
|
|
3
3
|
import type { SelectionHookResult } from "./selectionUtils";
|
|
4
|
+
import { type StyleRule, type StyleRuleContext } from "./styleRules";
|
|
5
|
+
import type { HatchFill } from "./hatchFill";
|
|
6
|
+
/** Values a resolved point style may carry (`fill` can be a HatchFill). */
|
|
7
|
+
type PointStyleValue = string | number | HatchFill | CanvasPattern | undefined;
|
|
8
|
+
type PointStyleObject = Record<string, PointStyleValue>;
|
|
4
9
|
export interface XYPointStyleOptions {
|
|
5
10
|
/** colorBy accessor — string field name or function. */
|
|
6
11
|
colorBy?: Accessor<string> | ChartAccessor<Datum, string>;
|
|
@@ -46,6 +51,18 @@ export interface XYPointStyleOptions {
|
|
|
46
51
|
effectiveSelectionHook: SelectionHookResult | null | undefined;
|
|
47
52
|
/** Resolved selection config (typically `setup.resolvedSelection`). */
|
|
48
53
|
resolvedSelection: import("./types").SelectionConfig | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Declarative style rules, evaluated per point and merged on top of the
|
|
56
|
+
* resolved base fill (last-applicable rule wins). Same engine and precedence
|
|
57
|
+
* as the ordinal bar `styleRules`.
|
|
58
|
+
*/
|
|
59
|
+
styleRules?: ReadonlyArray<StyleRule>;
|
|
60
|
+
/**
|
|
61
|
+
* Build the `StyleRuleContext` for a point — populate `value`/`x`/`y` from
|
|
62
|
+
* the chart's accessors so thresholds can target either axis
|
|
63
|
+
* (`{ axis: "x", gt: 5 }`). Called only when `styleRules` is set.
|
|
64
|
+
*/
|
|
65
|
+
ruleContext?: (d: Datum) => StyleRuleContext;
|
|
49
66
|
/**
|
|
50
67
|
* For ConnectedScatterplot-style charts whose color depends on the
|
|
51
68
|
* point's position in an ordered sequence, the resolver may need
|
|
@@ -84,4 +101,5 @@ export interface XYPointStyleOptions {
|
|
|
84
101
|
* })
|
|
85
102
|
* ```
|
|
86
103
|
*/
|
|
87
|
-
export declare function useXYPointStyle(options: XYPointStyleOptions): (d: Datum) =>
|
|
104
|
+
export declare function useXYPointStyle(options: XYPointStyleOptions): (d: Datum) => PointStyleObject;
|
|
105
|
+
export {};
|
|
@@ -9,22 +9,24 @@ import type { Datum } from "./datumTypes";
|
|
|
9
9
|
* Samples first, last, and a middle element to catch common mistakes
|
|
10
10
|
* (wrong field names, missing data) without iterating the entire dataset.
|
|
11
11
|
*/
|
|
12
|
-
type
|
|
12
|
+
type AccessorResult = string | number | boolean | Date | Datum | null | undefined;
|
|
13
|
+
type AccessorLike = string | ((datum: Datum, index?: number) => AccessorResult);
|
|
14
|
+
type ChartDataInput = ReadonlyArray<Datum> | Datum | string | number | boolean | null | undefined;
|
|
13
15
|
interface ArrayDataValidation {
|
|
14
16
|
componentName: string;
|
|
15
|
-
data:
|
|
17
|
+
data: ChartDataInput;
|
|
16
18
|
accessors?: Record<string, AccessorLike | undefined>;
|
|
17
19
|
requiredProps?: Datum;
|
|
18
20
|
}
|
|
19
21
|
interface ObjectDataValidation {
|
|
20
22
|
componentName: string;
|
|
21
|
-
data:
|
|
23
|
+
data: ChartDataInput;
|
|
22
24
|
dataLabel?: string;
|
|
23
25
|
}
|
|
24
26
|
interface NetworkDataValidation {
|
|
25
27
|
componentName: string;
|
|
26
|
-
nodes?:
|
|
27
|
-
edges?:
|
|
28
|
+
nodes?: ReadonlyArray<Datum> | null;
|
|
29
|
+
edges?: ReadonlyArray<Datum> | null;
|
|
28
30
|
nodesRequired?: boolean;
|
|
29
31
|
edgesRequired?: boolean;
|
|
30
32
|
accessors?: Record<string, AccessorLike | undefined>;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Runtime validation map derived from the Chart Spec Registry.
|
|
3
|
+
*
|
|
4
|
+
* The generated module contains only the fields consumed by `validateProps`.
|
|
5
|
+
* Keeping the docs/schema-rich registry out of this runtime import path saves
|
|
6
|
+
* it from every AI and utility bundle while preserving VALIDATION_MAP's public
|
|
7
|
+
* object shape. Regenerate after chart-spec edits with:
|
|
8
|
+
*
|
|
9
|
+
* npm run docs:chart-specs:schema
|
|
10
|
+
*/
|
|
11
|
+
export { VALIDATION_MAP } from "./validationMap.generated";
|