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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{renderRectPulse as t}from"./chunk-chunk-FAKO3RGQ.module.min.js";import{buildLinearFillGradient as e,clampCornerRadii as n,filterSparseArray as s,hasAnyCornerRadius as i,resolveCSSColor as o,resolveCanvasFill as r,symbolPathString as l}from"./chunk-chunk-ODUZEEBH.module.min.js";var h=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(t){Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}evict(t){t!==this._min&&t!==this._max||(this._dirty=!0)}recalculate(t,e){this._min=1/0,this._max=-1/0;for(const n of t){const t=e?e(n):n;Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},u=class{constructor(t,e){this.lastBoundedData=null,this.chunkTimer=0,this.pushBuffer=[],this.flushScheduled=!1,this.callback=t,this.chunkThreshold=e?.chunkThreshold??5e3,this.chunkSize=e?.chunkSize??5e3}updateChunkOptions(t){null!=t.chunkThreshold&&(this.chunkThreshold=t.chunkThreshold),null!=t.chunkSize&&(this.chunkSize=t.chunkSize)}clearLastData(){this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0)}setBoundedData(t){if(t=s(t),this.lastBoundedData===t)return;if(this.lastBoundedData=t,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.chunkThreshold>=t.length)return void this.callback({inserts:t,bounded:!0});this.callback({inserts:t.slice(0,this.chunkSize),bounded:!0,totalSize:t.length});let e=this.chunkSize;const n=()=>{if(e>=t.length)return void(this.chunkTimer=0);if(t!==this.lastBoundedData)return void(this.chunkTimer=0);const s=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,s),bounded:!1}),e=s,this.chunkTimer=t.length>e?requestAnimationFrame(n):0};this.chunkTimer=requestAnimationFrame(n)}setReplacementData(t){if(t=s(t),this.lastBoundedData=t,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.pushBuffer=[],this.flushScheduled=!1,this.chunkThreshold>=t.length)return void this.callback({inserts:t,bounded:!0,preserveCategoryOrder:!0});this.callback({inserts:t.slice(0,this.chunkSize),bounded:!0,preserveCategoryOrder:!0,totalSize:t.length});let e=this.chunkSize;const n=()=>{if(e>=t.length)return void(this.chunkTimer=0);if(t!==this.lastBoundedData)return void(this.chunkTimer=0);const s=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,s),bounded:!1}),e=s,this.chunkTimer=t.length>e?requestAnimationFrame(n):0};this.chunkTimer=requestAnimationFrame(n)}flushPushBuffer(){if(this.flushScheduled=!1,0===this.pushBuffer.length)return;const t=this.pushBuffer;this.pushBuffer=[],this.callback({inserts:t,bounded:!1})}scheduleFlush(){this.flushScheduled||(this.flushScheduled=!0,queueMicrotask(()=>this.flushPushBuffer()))}push(t){null!=t&&"object"==typeof t&&(this.pushBuffer.push(t),this.scheduleFlush())}pushMany(t){if(0===t.length)return;let e=0;for(let n=0;t.length>n;n++){const s=t[n];null!=s&&"object"==typeof s&&(this.pushBuffer.push(s),e++)}0!==e&&this.scheduleFlush()}flush(){this.flushPushBuffer()}clear(){this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1}};function c(t,e){return t===e}function a(t,e){if("function"==typeof t)return e=>+t(e);const n=t||e;return t=>+t[n]}function f(t,e){if("function"==typeof t)return t;const n=t||e;return t=>t[n]}function y(t,e){return"function"==typeof t?t:t?e=>e[t]+"":e?t=>t[e]+"":void 0}function d(t,e,n,s){return"function"==typeof t?t({size:e,margin:n,scales:s}):t}function m(t,e,n,s){return"string"==typeof t?{key:t,fn:null}:"function"==typeof t?{key:n,fn:t}:"string"==typeof e?{key:e,fn:null}:"function"==typeof e?{key:s,fn:e}:{key:void 0,fn:null}}function p(t,e,n){return s=>{if(!s||!n||!t.fn&&!e.fn)return s;let i=!1;const o=s.map(n=>{const s=t.fn&&t.key&&!(t.key in n),o=e.fn&&e.key&&!(e.key in n);if(!s&&!o)return n;i=!0;const r={...n};return s&&(r[t.key]=t.fn(n)),o&&(r[e.key]=e.fn(n)),r});return i?o:s}}function k(t){return new Set(Array.isArray(t)?t:[t])}function g(t,e,n){return"exact"===n?function(t,e){const n=t.domain(),s=n[0],i=n[n.length-1],o=s instanceof Date,r=s instanceof Date?s.getTime():s,l=i instanceof Date?i.getTime():i;if(2>e||r===l)return o?[new Date(r),new Date(l)]:[r,l];const h=(l-r)/(e-1),u=Array(e);for(let t=0;e>t;t++){const n=t===e-1?l:r+t*h;u[t]=o?new Date(n):n}return u}(t,e):t.ticks(e)}var T=new Map;function x(t){try{if(t.path)return new Path2D(t.path);const e=`${t.symbolType??"circle"}:${Math.round(t.size)}`;let n=T.get(e);return n||(n=new Path2D(l(t.symbolType,t.size)),T.size>256&&T.clear(),T.set(e,n)),n}catch{return null}}var b=(t,e)=>{const n=t.globalAlpha;for(const s of e){if("symbol"!==s.type)continue;const e=s;if(0>=e.size)continue;const i=x(e);if(!i)continue;t.save(),t.translate(e.x,e.y),e.rotation&&t.rotate(e.rotation);const o=(e.style.opacity??1)*(e._decayOpacity??1);e.style.fill&&(t.globalAlpha=n*o*(e.style.fillOpacity??1),t.fillStyle=r(t,e.style.fill,"#4e79a7"),t.fill(i)),e.style.stroke&&"none"!==e.style.stroke&&(t.globalAlpha=n*o,t.strokeStyle=r(t,e.style.stroke,e.style.stroke),t.lineWidth=e.style.strokeWidth??1,t.stroke(i)),t.restore()}t.globalAlpha=n};function w(t,e){const{x:s,y:i,w:o,h:r}=e,{tl:l,tr:h,br:u,bl:c}=n(e);t.beginPath(),t.moveTo(s+l,i),t.lineTo(s+o-h,i),h>0&&t.arcTo(s+o,i,s+o,i+h,h),t.lineTo(s+o,i+r-u),u>0&&t.arcTo(s+o,i+r,s+o-u,i+r,u),t.lineTo(s+c,i+r),c>0&&t.arcTo(s,i+r,s,i+r-c,c),t.lineTo(s,i+l),l>0&&t.arcTo(s,i,s+l,i,l),t.closePath()}function v(t){switch(t.roundedEdge){case"bottom":return{x0:t.x,y0:t.y+t.h,x1:t.x,y1:t.y};case"right":return{x0:t.x+t.w,y0:t.y,x1:t.x,y1:t.y};case"left":return{x0:t.x,y0:t.y,x1:t.x+t.w,y1:t.y};default:return{x0:t.x,y0:t.y,x1:t.x,y1:t.y+t.h}}}var S=(n,s,l,h)=>{const u=s.filter(t=>"rect"===t.type);for(const s of u){if(null!=s.style.opacity&&(n.globalAlpha=s.style.opacity),s.style.icon)F(n,s);else if(s.cornerRadii&&i(s.cornerRadii)){const t=r(n,s.style.fill,o(n,"var(--semiotic-primary, #007bff)")),i=v(s),l=s.fillGradient&&"string"==typeof t?e(n,s.fillGradient,t,i.x0,i.y0,i.x1,i.y1):null;n.fillStyle=l||t,w(n,s),n.fill(),s.style.stroke&&"none"!==s.style.stroke&&(n.strokeStyle=o(n,s.style.stroke)||s.style.stroke,n.lineWidth=s.style.strokeWidth||1,n.stroke())}else if(s.roundedTop&&s.roundedTop>0){const t=r(n,s.style.fill,o(n,"var(--semiotic-primary, #007bff)")),i=v(s),l=s.fillGradient&&"string"==typeof t?e(n,s.fillGradient,t,i.x0,i.y0,i.x1,i.y1):null;n.fillStyle=l||t;const h=Math.min(s.roundedTop,s.w/2,s.h/2);n.beginPath();const{x:u,y:c,w:a,h:f}=s;switch(s.roundedEdge){case"right":n.moveTo(u,c),n.lineTo(u+a-h,c),n.arcTo(u+a,c,u+a,c+h,h),n.lineTo(u+a,c+f-h),n.arcTo(u+a,c+f,u+a-h,c+f,h),n.lineTo(u,c+f);break;case"left":n.moveTo(u+a,c),n.lineTo(u+h,c),n.arcTo(u,c,u,c+h,h),n.lineTo(u,c+f-h),n.arcTo(u,c+f,u+h,c+f,h),n.lineTo(u+a,c+f);break;case"bottom":n.moveTo(u,c),n.lineTo(u+a,c),n.lineTo(u+a,c+f-h),n.arcTo(u+a,c+f,u+a-h,c+f,h),n.lineTo(u+h,c+f),n.arcTo(u,c+f,u,c+f-h,h);break;default:n.moveTo(u,c+f),n.lineTo(u,c+h),n.arcTo(u,c,u+h,c,h),n.lineTo(u+a-h,c),n.arcTo(u+a,c,u+a,c+h,h),n.lineTo(u+a,c+f)}n.closePath(),n.fill(),s.style.stroke&&"none"!==s.style.stroke&&(n.strokeStyle=o(n,s.style.stroke)||s.style.stroke,n.lineWidth=s.style.strokeWidth||1,n.stroke())}else{const t=r(n,s.style.fill,o(n,"var(--semiotic-primary, #007bff)")),i=v(s),l=s.fillGradient&&"string"==typeof t?e(n,s.fillGradient,t,i.x0,i.y0,i.x1,i.y1):null;n.fillStyle=l||t,n.fillRect(s.x,s.y,s.w,s.h),s.style.stroke&&"none"!==s.style.stroke&&(n.strokeStyle=o(n,s.style.stroke)||s.style.stroke,n.lineWidth=s.style.strokeWidth||1,n.strokeRect(s.x,s.y,s.w,s.h))}t(n,s),n.globalAlpha=1}};function F(t,e){const n=e.style.icon,s=e.style.iconPadding||2,i=Math.min(e.w,e.h)-s;if(0>=i)return;const o=e.h>e.w;if(t.save(),t.beginPath(),t.rect(e.x,e.y,e.w,e.h),t.clip(),o){const o=i+s,r=e.x+(e.w-i)/2;for(let s=e.y+e.h-i;s>=e.y-i;s-=o)t.drawImage(n,r,s,i,i)}else{const o=i+s,r=e.y+(e.h-i)/2;for(let s=e.x;e.x+e.w>s;s+=o)t.drawImage(n,s,r,i,i)}t.restore()}function _(t,e,n,s,i,o){const r=[];for(const i of t){const t=n(i),o=s(i);Number.isFinite(t)&&Number.isFinite(o)&&r.push({px:e.x(t),py:e.y(o),rawY:o,d:i})}r.sort((t,e)=>t.px-e.px);const l=Array(r.length),h=Array(r.length),u=Array(r.length);for(let t=0;r.length>t;t++){const e=r[t];l[t]=[e.px,e.py],h[t]=e.rawY,u[t]=e.d}return{type:"line",path:l,rawValues:h,style:i,datum:u,group:o}}function A(t,e,n,s,i,o,r,l){const h=[];for(const o of t){const t=n(o),r=s(o);if(!Number.isFinite(t)||!Number.isFinite(r))continue;const u=e.x(t),c=l?l(o):i;h.push({px:u,topY:e.y(r),botY:e.y(c)})}h.sort((t,e)=>t.px-e.px);const u=Array(h.length),c=Array(h.length);for(let t=0;h.length>t;t++){const e=h[t];u[t]=[e.px,e.topY],c[t]=[e.px,e.botY]}return{type:"area",topPath:u,bottomPath:c,style:o,datum:t,group:r}}function B(t,e,n,s){const i=new Map;if("silhouette"===s)for(const s of t){let t=0;for(const i of e)t+=n(i,s)||0;i.set(s,-t/2)}else if("wiggle"===s){t.length>0&&i.set(t[0],0);for(let s=1;t.length>s;s++){const o=t[s-1],r=t[s];let l=0,h=0,u=0;for(const t of e){const e=n(t,r)||0;l+=(2*u+e)*(e-(n(t,o)||0)),h+=e,u+=e}const c=i.get(o)??0;i.set(r,c-(h>0?l/(2*h):0))}if(t.length>0){let s=0;for(const o of t){let t=0;for(const s of e)t+=n(s,o)||0;s+=(i.get(o)??0)+t/2}const o=s/t.length;for(const e of t)i.set(e,(i.get(e)??0)-o)}}else for(const e of t)i.set(e,0);return i}function z(t,e,n){let s=0,i=0;for(const o of t){let t=0,r=0;for(const s of e){const e=n(s,o)||0;0>e?r+=e:t+=e}s>r&&(s=r),t>i&&(i=t)}return[s,i]}function D(t,e,n,s,i,o,r,l="zero"){const h=new Set;for(const e of t)for(const t of e.data){const e=n(t);Number.isFinite(e)&&h.add(e)}const u=Array.from(h).sort((t,e)=>t-e),c=new Map;for(const e of t){const t=new Map;for(const i of e.data){const e=n(i),o=s(i);Number.isFinite(e)&&Number.isFinite(o)&&t.set(e,(t.get(e)||0)+o)}c.set(e.key,t)}let a;if(o){a=new Map;for(const e of u){let n=0;for(const s of t)n+=c.get(s.key)?.get(e)||0;a.set(e,n||1)}}const f=B(u,t.map(t=>t.key),(t,e)=>c.get(t)?.get(e)||0,l),y="diverging"===l&&!o,d=[],m=new Map,p=new Map,k=new Map,g=new Map;for(const t of u)p.set(t,f.get(t)??0),k.set(t,0),g.set(t,0);for(const n of t){const t=c.get(n.key),s=new Map;let l=[],h=[];const f=()=>{if(l.length>=2){const t={type:"area",topPath:l,bottomPath:h,style:i(n.key,n.data[0]),datum:n.data,group:n.key};r&&(t.curve=r),d.push(t)}l=[],h=[]};for(const n of u){const i=t.has(n);let r,u,c=i?t.get(n):0;if(o&&i&&(c/=a.get(n)),!i||!Number.isFinite(c)||0===c){f();continue}y?c>0?(r=k.get(n),u=r+c,k.set(n,u)):(r=g.get(n),u=r+c,g.set(n,u)):(r=p.get(n),u=r+c,p.set(n,u));const d=e.x(n);h.push([d,e.y(r)]),l.push([d,e.y(u)]),s.set(n,u)}f(),m.set(n.key,s)}return{nodes:d,stackedTops:m}}function M(t,e,n,s,i,o,r){const l=n(t),h=s(t);if(!Number.isFinite(l)||!Number.isFinite(h))return null;const u={type:"point",x:e.x(l),y:e.y(h),r:i,style:o,datum:t};return void 0!==r&&(u.pointId=r),u}function P(t,e,n,s,i,o,r,l){const h=n(t),u=s(t);if(!Number.isFinite(h)||!Number.isFinite(u))return null;const c={type:"symbol",x:e.x(h),y:e.y(u),size:i,symbolType:o,style:r,datum:t};return void 0!==l&&(c.pointId=l),c}function N(t,e,n,s,i,o,r){return{type:"rect",x:t,y:e,w:n,h:s,style:i,datum:o,group:r}}function W(t,e,n,s,i,o,r){const l={type:"heatcell",x:t,y:e,w:n,h:s,fill:i,datum:o};return r?.showValues&&(l.showValues=!0,l.value=r.value,r.valueFormat&&(l.valueFormat=r.valueFormat)),l}export{u as DataSourceAdapter,h as IncrementalExtent,c as accessorsEquivalent,a as resolveAccessor,f as resolveRawAccessor,y as resolveStringAccessor,k as toIdSet,_ as buildLineNode,A as buildAreaNode,B as computeStackOffsets,z as computeDivergingStackExtent,D as buildStackedAreaNodes,M as buildPointNode,P as buildSymbolNode,N as buildRectNode,W as buildHeatcellNode,g as ticksForMode,d as resolveFrameGraphics,m as resolveAnnotationAccessor,p as buildEnrichAnnotationData,b as symbolCanvasRenderer,S as barCanvasRenderer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{StreamXYFrame_default as e}from"./chunk-chunk-L6D3I3V7.module.min.js";import{buildCustomBehaviorProps as t}from"./chunk-chunk-FAKO3RGQ.module.min.js";import{normalizeLinkedBrush as n,useBrushSelection as i,useChartMode as s,useChartSelection as o}from"./chunk-chunk-ODUZEEBH.module.min.js";import{renderEmptyState as r,renderLoadingState as a}from"./chunk-chunk-ZCNBUZPL.module.min.js";var l=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;const t=e-this._mean;this._mean+=t/this._count,this._m2+=t*(e-this._mean),this._min>e&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);const t=this._count+e._count,n=e._mean-this._mean;this._mean+=n*e._count/t,this._m2+=e._m2+n*n*this._count*e._count/t,this._count=t,this._min>e._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){const t=new e;return t._count=this._count,t._mean=this._mean,t._m2=this._m2,t._min=this._min,t._max=this._max,t}get count(){return this._count}get mean(){return 0===this._count?0:this._mean}get sum(){return 0===this._count?0:this._mean*this._count}get variance(){return 2>this._count?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return 2>this._count?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},c=class{constructor(e){this.windows=new Map,this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;const t=e.hop??e.size;this.hop=t>0&&e.size>=t?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0}push(e,t){Number.isFinite(e)&&Number.isFinite(t)&&(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t):this.pushFixed(e,t),this.prune())}pushFixed(e,t){if("tumbling"===this.type||this.hop>=this.size)return void this.bump(Math.floor(e/this.size)*this.size,t);const n=this.hop,i=Math.floor(e/n);for(let s=Math.floor((e-this.size)/n)+1;i>=s;s++)this.bump(s*n,t)}bump(e,t){let n=this.windows.get(e);n||(n=new l,this.windows.set(e,n)),n.push(t)}pushSession(e,t){const n=this.gap,i=new l;i.push(t);let s=e,o=e;const r=[],a={start:s,end:o,stats:i};for(const t of this.sessions)e-n>t.end||t.start>e+n?r.push(t):(a.stats.merge(t.stats),s>t.start&&(s=t.start),t.end>o&&(o=t.end));a.start=s,a.end=o,r.push(a),r.sort((e,t)=>e.start-t.start),this.sessions=r}prune(){if(this.retain===1/0)return;if("session"===this.type)return void(this.sessions.length>this.retain&&(this.sessions=this.sessions.slice(this.sessions.length-this.retain)));if(this.retain>=this.windows.size)return;const e=[...this.windows.keys()].sort((e,t)=>e-t),t=e.length-this.retain;for(let n=0;t>n;n++)this.windows.delete(e[n])}emit(){return"session"===this.type?this.emitSessions():this.emitFixed()}emitFixed(){const e=[];for(const[t,n]of this.windows){const i=t+this.size;e.push(this.row(t,i,n,i>this.latest))}return e.sort((e,t)=>e.start-t.start),e}emitSessions(){return this.sessions.map(e=>this.row(e.start,e.end,e.stats,this.gap>this.latest-e.end))}row(e,t,n,i){return{start:e,end:t,count:n.count,mean:n.mean,sum:n.sum,min:n.min,max:n.max,stddev:n.stddev,partial:i}}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.sessions=[],this.latest=-1/0}};function u(e,t){switch(t){case"sum":return e.sum;case"min":return e.min;case"max":return e.max;case"count":return e.count;default:return e.mean}}function m(e,t,n,i=1){if("none"===t)return null;if("minmax"===t)return[e.min,e.max];const s=u(e,n),o=e.stddev*i;return[s-o,s+o]}var h={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},d=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g;function p(e){if("number"==typeof e)return Number.isFinite(e)&&e>0?e:null;if("string"!=typeof e)return null;const t=e.trim();if(""===t)return null;d.lastIndex=0;let n,i=0,s=0;for(;null!==(n=d.exec(t));){const e=parseFloat(n[1]),t=h[n[2]];if(null==t||!Number.isFinite(e))return null;i+=e*t,s+=n[0].length}return s!==t.length?null:i>0?i:null}var v=class{constructor(e){this.held=[],this._watermark=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){const t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};const n=[];return this._watermark!==-1/0&&this._watermark-this.lateness>t?(this._lateCount+=1,n.push(e),"drop"===this.latePolicy?{released:[],late:n}:{released:[e],late:n}):(t>this._watermark&&(this._watermark=t),this.held.push(e),{released:this.drain(),late:n})}drain(){const e=this._watermark-this.lateness;if(0===this.held.length)return[];const t=[],n=[];for(const i of this.held)this.getTime(i)>e?n.push(i):t.push(i);return this.held=n,t.sort((e,t)=>this.getTime(e)-this.getTime(t)),t}flush(){const e=this.held;return this.held=[],e.sort((e,t)=>this.getTime(e)-this.getTime(t)),e}clear(){this.held=[],this._watermark=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}};import{useRef as g,useImperativeHandle as f,forwardRef as w,useCallback as y,useState as b,useEffect as x}from"react";import{jsx as A,jsxs as _}from"react/jsx-runtime";var k={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},H={opacity:.7,marginRight:4};function S(e,t,n){if(null!=e)return"function"==typeof t?t(e):e["string"==typeof t?t:n]}function z(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?e+"":e.toFixed(2):e instanceof Date?e.toLocaleString():e+""}function I(e={}){const{timeAccessor:t,valueAccessor:n,xLabel:i="x",yLabel:s="y"}=e;return e=>{const o=e?.data??null,r=S(o,t,"time"),a=S(o,n,"value");return _("div",{className:"semiotic-tooltip",style:k,children:[_("div",{children:[_("span",{style:H,children:[i,":"]}),z(r)]}),_("div",{children:[_("span",{style:H,children:[s,":"]}),z(a)]})]})}}function C(e,t){return null!=e?e:Math.max(t?.length??0,200)}var T="time",R="value",F="__aggLower",P="__aggUpper",M="__aggPartial",N="count",D="__aggStart",E="__aggEnd";function O(e,t){const n=t.stat??"mean",i=t.band??"none",s=t.sigma??1;return e.emit().map(e=>{const t={[T]:(e.start+e.end)/2,[R]:u(e,n),[N]:e.count,[M]:e.partial,[D]:e.start,[E]:e.end},o=m(e,i,n,s);return o&&(t[F]=o[0],t[P]=o[1]),t})}import{jsx as B}from"react/jsx-runtime";function j(e,t,n){const i="function"==typeof t?t(e):e[t??n];if(null==i)return null;if(i instanceof Date)return i.getTime();const s=Number(i);return Number.isFinite(s)?s:null}var V=w(function(n,i){const l=s(n.mode,{width:n.size?.[0]??n.width,height:n.size?.[1]??n.height,enableHover:null!=n.enableHover?!!n.enableHover:void 0,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,responsiveRules:n.responsiveRules}),{size:u,margin:m,className:h,arrowOfTime:d="right",windowMode:w="sliding",windowSize:A,data:_,timeAccessor:k,valueAccessor:H,timeExtent:S,valueExtent:z,extentPadding:M,stroke:N="#007bff",strokeWidth:D=2,strokeDasharray:E,opacity:V,background:W,tooltipContent:$,tooltip:L,onHover:U,annotations:Z,autoPlaceAnnotations:q,svgAnnotationRules:X,tickFormatTime:Y,tickFormatValue:G,decay:K,pulse:Q,staleness:J,transition:ee,linkedHover:te,selection:ne,onObservation:ie,chartId:se,loading:oe,loadingContent:re,emptyContent:ae,emphasis:le,legendPosition:ce,aggregate:ue,eventTime:me}=n,he=l.showAxes,de=l.enableHover,pe=m??l.marginDefaults,ve=u??[l.width,l.height],ge=$??L??I({timeAccessor:k,valueAccessor:H}),fe=g(null),{customHoverBehavior:we}=o({selection:ne,linkedHover:te,unwrapData:!0,onObservation:ie,chartType:"RealtimeLineChart",chartId:se}),ye=y(e=>{U&&U(e),we(e)},[U,we]),be=null!=ue,[xe,Ae]=b([]),_e=g(null),ke=g(ue);ke.current=ue;const He=g(be);He.current=be;const Se=g(xe);Se.current=xe;const ze=g({timeAccessor:k,valueAccessor:H});ze.current={timeAccessor:k,valueAccessor:H},x(()=>{if(!be)return void(_e.current=null);const e=ke.current,t=function(e){const t=e.window??"tumbling",n=p("session"===t?e.gap??e.size:e.size);if(null==n)return null;const i=null!=e.hop?p(e.hop):void 0,s=null!=e.gap?p(e.gap):void 0;return new c({window:t,size:n,hop:i??void 0,gap:s??void 0,retain:e.retain})}(e);if(_e.current=t,t&&_){const{timeAccessor:e,valueAccessor:n}=ze.current;for(const i of _){const s=j(i,e,"time"),o=j(i,n,"value");null!=s&&null!=o&&t.push(s,o)}}Ae(t?O(t,e):[])},[be?[ue.window??"tumbling",ue.size,ue.hop??"",ue.gap??"",ue.retain??""].join("|"):"",be,_]),x(()=>{be&&_e.current&&Ae(O(_e.current,ke.current))},[ue?.stat,ue?.band,ue?.sigma]);const Ie=y(e=>{const t=_e.current,n=ke.current;if(!t||!n)return;const{timeAccessor:i,valueAccessor:s}=ze.current;for(const n of e){const e=j(n,i,"time"),o=j(n,s,"value");null!=e&&null!=o&&t.push(e,o)}Ae(O(t,n))},[]),Ce=null!=me,Te=g(null),Re=g(me);Re.current=me;const Fe=g(Ce);Fe.current=Ce;const Pe=g(ie);Pe.current=ie;const Me=g(se);Me.current=se,x(()=>{Te.current=Ce?function(e){const t=p(e.lateness);return null==t?null:new v({lateness:t,getTime:e=>j(e,ze.current.timeAccessor,"time")??NaN,latePolicy:e.latePolicy??"drop"})}(Re.current):null},[Ce?`${me.lateness}|${me.latePolicy??"drop"}`:"",Ce]);const Ne=y(e=>{0!==e.length&&(He.current?Ie(e):fe.current?.pushMany(e))},[Ie]),De=y(e=>{const t=Te.current;if(!Fe.current||!t)return void Ne(e);const n=[];for(const i of e){const e=t.push(i);if(e.released.length&&n.push(...e.released),e.late.length){const n=Pe.current;if(n){const{timeAccessor:i}=ze.current,s=Re.current?.latePolicy??"drop";for(const o of e.late)n({type:"late-data",datum:o,eventTime:j(o,i,"time")??NaN,watermark:t.watermark,policy:s,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:Me.current})}}}Ne(n)},[Ne]);f(i,()=>({push:e=>De([e]),pushMany:e=>De(e),remove:e=>He.current?[]:fe.current?.remove(e)??[],update:(e,t)=>He.current?[]:fe.current?.update(e,t)??[],clear:()=>{Te.current?.clear(),He.current?(_e.current?.clear(),Ae([])):fe.current?.clear()},getData:()=>He.current?Se.current:fe.current?.getData()??[],getScales:()=>fe.current?.getScales()??null}),[De]);const Ee=a(oe,ve[0],ve[1],re),Oe=Ee?null:r(be?void 0:_,ve[0],ve[1],ae),Be={stroke:N,strokeWidth:D,strokeDasharray:E};null!=V&&(Be.opacity=V);const je=C(A,_),Ve=be?xe:_,We=be?T:k,$e=be?R:H,Le=be&&ue&&"none"!==(ue.band??"none")?{y0Accessor:F,y1Accessor:P,perSeries:!1}:void 0;return Ee||Oe||B(e,{ref:fe,chartType:"line",runtimeMode:"streaming",size:ve,margin:pe,className:le?`${h||""} semiotic-emphasis-${le}`.trim():h,arrowOfTime:d,windowMode:be?"growing":w,windowSize:be?Math.max(1,ue?.retain??Math.max(xe.length,600)):je,data:Ve,timeAccessor:We,valueAccessor:$e,xExtent:S,yExtent:z,extentPadding:M,band:Le,lineStyle:Be,showAxes:he,background:W,hoverAnnotation:de,tooltipContent:ge,...t({linkedHover:te,selection:ne,onObservation:ie,forceHoverBehavior:!0,mobileInteraction:l.mobileInteraction,customHoverBehavior:ye}),annotations:Z,autoPlaceAnnotations:q,svgAnnotationRules:X,tickFormatTime:Y,tickFormatValue:G,decay:K,pulse:Q,staleness:J,transition:ee,pointIdAccessor:n.pointIdAccessor,legendPosition:ce})});V.displayName="RealtimeLineChart";import{useRef as W,useImperativeHandle as $,forwardRef as L,useCallback as U,useMemo as Z}from"react";import{jsx as q}from"react/jsx-runtime";function X(e,t,n){const i="function"==typeof t?t(e):e[t??n];if(null==i)return null;if(i instanceof Date)return i.getTime();if("string"==typeof i&&""===i.trim())return null;const s=Number(i);return Number.isFinite(s)?s:null}var Y=L(function(l,c){const u=s(l.mode,{width:l.size?.[0]??l.width,height:l.size?.[1]??l.height,showAxes:l.showAxes,enableHover:null!=l.enableHover?!!l.enableHover:void 0,linkedHover:l.linkedHover,mobileInteraction:l.mobileInteraction,mobileSemantics:l.mobileSemantics,responsiveRules:l.responsiveRules}),{binSize:m,size:h,margin:d,className:p,arrowOfTime:v="right",windowMode:g="sliding",windowSize:f,data:w,timeAccessor:y,valueAccessor:b,direction:x="up",timeExtent:I,valueExtent:T,extentPadding:R,categoryAccessor:F,colors:P,fill:M,stroke:N,strokeWidth:D,opacity:E,gap:O,background:B,tooltipContent:j,tooltip:V,onHover:L,annotations:Y,autoPlaceAnnotations:G,svgAnnotationRules:K,tickFormatTime:Q,tickFormatValue:J,linkedHover:ee,selection:te,decay:ne,pulse:ie,staleness:se,transition:oe,onObservation:re,chartId:ae,loading:le,loadingContent:ce,emptyContent:ue,emphasis:me,legendPosition:he,brush:de,onBrush:pe,linkedBrush:ve}=l,ge=u.showAxes,fe=u.enableHover,we=d??u.marginDefaults,ye=h??[u.width,u.height],be=j??V??function(e={}){const{timeAccessor:t,valueAccessor:n}=e;return e=>{const i=e?.data??null;if(null==i?.binStart||null==i?.binEnd){const e=S(i,t,"time"),s=S(i,n,"value");return _("div",{className:"semiotic-tooltip",style:k,children:[_("div",{children:[A("span",{style:H,children:"x:"}),z(e)]}),_("div",{children:[A("span",{style:H,children:"y:"}),z(s)]})]})}return _("div",{className:"semiotic-tooltip",style:k,children:[_("div",{children:[A("span",{style:H,children:"range:"}),z(i.binStart),"–",z(i.binEnd)]}),null!=i.total&&_("div",{children:[A("span",{style:H,children:"count:"}),z(i.total)]}),null!=i.category&&_("div",{children:[A("span",{style:H,children:"category:"}),z(i.category)]})]})}}({timeAccessor:y,valueAccessor:b}),xe=W(null),{customHoverBehavior:Ae}=o({selection:te,linkedHover:ee,unwrapData:!0,onObservation:re,chartType:"RealtimeHistogram",chartId:ae}),_e=U(e=>{L&&L(e),Ae(e)},[L,Ae]),ke=!0===de?{dimension:"x",snap:"bin"}:"x"===de?{dimension:"x"}:"object"==typeof de?de:void 0,He=n(ve),Se="string"==typeof y?y:"time",ze=i({name:He?.name||"__unused_hist_brush__",xField:He?.xField||Se,...He?.yField?{yField:He.yField}:{}}),Ie=W(ze.brushInteraction);Ie.current=ze.brushInteraction;const Ce=U(e=>{if(pe&&pe(e),re&&re(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:ae}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:ae}),He){const t=Ie.current;t.end(e?"xBrush"===t.brush?e.x:"yBrush"===t.brush?e.y:[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:null)}},[pe,re,ae,He]);$(c,()=>({push:e=>xe.current?.push(e),pushMany:e=>xe.current?.pushMany(e),remove:e=>xe.current?.remove(e)??[],update:(e,t)=>xe.current?.update(e,t)??[],clear:()=>xe.current?.clear(),getData:()=>xe.current?.getData()??[],getScales:()=>xe.current?.getScales()??null}),[]);const Te=a(le,ye[0],ye[1],ce),Re=Te?null:r(w,ye[0],ye[1],ue),Fe={};null!=M&&(Fe.fill=M),null!=N&&(Fe.stroke=N),null!=D&&(Fe.strokeWidth=D),null!=E&&(Fe.opacity=E),null!=O&&(Fe.gap=O);const Pe=me?`${p||""} semiotic-emphasis-${me}`.trim():p,Me=C(f,w),Ne=Z(()=>"down"!==x?T:function({data:e,valueAccessor:t,timeAccessor:n,binSize:i,valueExtent:s,extentPadding:o}){if(s)return[s[1],s[0]];if(!e||0===e.length)return;const r=new Map;for(const s of e){const e=X(s,n,"time"),o=X(s,t,"value");if(null==e||null==o)continue;const a=Math.floor(e/i)*i;r.set(a,(r.get(a)??0)+o)}let a=0;for(const e of r.values())e>a&&(a=e);return[a>0?a+a*(o??.1):1,0]}({data:w,valueAccessor:b,timeAccessor:y,binSize:m,valueExtent:T,extentPadding:R}),[x,w,b,y,m,T,R]);return Te||Re||q(e,{ref:xe,chartType:"bar",runtimeMode:"streaming",size:ye,margin:we,className:Pe,arrowOfTime:v,windowMode:g,windowSize:Me,data:w,timeAccessor:y,valueAccessor:b,xExtent:I,yExtent:Ne,extentPadding:R,binSize:m,categoryAccessor:F,barColors:P,barStyle:Fe,showAxes:ge,background:B,hoverAnnotation:fe,tooltipContent:be,...t({linkedHover:ee,selection:te,onObservation:re,forceHoverBehavior:!0,mobileInteraction:u.mobileInteraction,customHoverBehavior:_e}),annotations:Y,autoPlaceAnnotations:G,svgAnnotationRules:K,tickFormatTime:Q,tickFormatValue:J,decay:ne,pulse:ie,staleness:se,transition:oe,pointIdAccessor:l.pointIdAccessor,legendPosition:he,brush:ke||(ve?{dimension:"x"}:void 0),onBrush:ke||ve?Ce:void 0})});function G(e){return q(Y,{...e,windowMode:"growing"})}Y.displayName="RealtimeHistogram",G.displayName="TemporalHistogram";var K=Y;import{useRef as Q,useImperativeHandle as J,forwardRef as ee,useCallback as te}from"react";import{jsx as ne}from"react/jsx-runtime";var ie=ee(function(n,i){const l=s(n.mode,{width:n.size?.[0]??n.width,height:n.size?.[1]??n.height,enableHover:null!=n.enableHover?!!n.enableHover:void 0,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,responsiveRules:n.responsiveRules}),{size:c,margin:u,className:m,arrowOfTime:h="right",windowMode:d="sliding",windowSize:p,data:v,timeAccessor:g,valueAccessor:f,timeExtent:w,valueExtent:y,yScaleType:b,extentPadding:x,categoryAccessor:A,colors:_,radius:k,fill:H,opacity:S,stroke:z,strokeWidth:T,pointStyle:R,background:F,tooltipContent:P,tooltip:M,onHover:N,annotations:D,autoPlaceAnnotations:E,svgAnnotationRules:O,tickFormatTime:B,tickFormatValue:j,linkedHover:V,selection:W,onObservation:$,chartId:L,loading:U,loadingContent:Z,emptyContent:q,emphasis:X,legendPosition:Y}=n,G=l.showAxes,K=l.enableHover,ee=u??l.marginDefaults,ie=c??[l.width,l.height],se=P??M??I({timeAccessor:g,valueAccessor:f}),oe=Q(null),{customHoverBehavior:re}=o({selection:W,linkedHover:V,unwrapData:!0,onObservation:$,chartType:"RealtimeSwarmChart",chartId:L}),ae=te(e=>{N&&N(e),re(e)},[N,re]);J(i,()=>({push:e=>oe.current?.push(e),pushMany:e=>oe.current?.pushMany(e),remove:e=>oe.current?.remove(e)??[],update:(e,t)=>oe.current?.update(e,t)??[],clear:()=>oe.current?.clear(),getData:()=>oe.current?.getData()??[],getScales:()=>oe.current?.getScales()??null}),[]);const le=a(U,ie[0],ie[1],Z),ce=le?null:r(v,ie[0],ie[1],q),ue={};null!=k&&(ue.radius=k),null!=H&&(ue.fill=H),null!=S&&(ue.opacity=S),null!=z&&(ue.stroke=z),null!=T&&(ue.strokeWidth=T);const me=R,he=X?`${m||""} semiotic-emphasis-${X}`.trim():m,de=C(p,v);return le||ce||ne(e,{ref:oe,chartType:"swarm",runtimeMode:"streaming",size:ie,margin:ee,className:he,arrowOfTime:h,windowMode:d,windowSize:de,data:v,timeAccessor:g,valueAccessor:f,xExtent:w,yExtent:y,yScaleType:b,extentPadding:x,categoryAccessor:A,barColors:_,swarmStyle:ue,pointStyle:me,showAxes:G,background:F,hoverAnnotation:K,tooltipContent:se,...t({linkedHover:V,selection:W,onObservation:$,forceHoverBehavior:!0,mobileInteraction:l.mobileInteraction,customHoverBehavior:ae}),annotations:D,autoPlaceAnnotations:E,svgAnnotationRules:O,tickFormatTime:B,tickFormatValue:j,legendPosition:Y,pointIdAccessor:n.pointIdAccessor})});ie.displayName="RealtimeSwarmChart";import{useRef as se,useImperativeHandle as oe,forwardRef as re,useCallback as ae}from"react";import{jsx as le}from"react/jsx-runtime";var ce=re(function(n,i){const l=s(n.mode,{width:n.size?.[0]??n.width,height:n.size?.[1]??n.height,enableHover:null!=n.enableHover?!!n.enableHover:void 0,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,responsiveRules:n.responsiveRules}),{size:c,margin:u,className:m,arrowOfTime:h="right",windowMode:d="sliding",windowSize:p,data:v,timeAccessor:g,valueAccessor:f,timeExtent:w,valueExtent:y,extentPadding:b,positiveColor:x,negativeColor:I,connectorStroke:T,connectorWidth:R,gap:F,stroke:P,strokeWidth:M,opacity:N,background:D,tooltipContent:E,tooltip:O,onHover:B,annotations:j,autoPlaceAnnotations:V,svgAnnotationRules:W,tickFormatTime:$,tickFormatValue:L,linkedHover:U,selection:Z,onObservation:q,chartId:X,loading:Y,loadingContent:G,emptyContent:K,emphasis:Q,legendPosition:J}=n,ee=l.showAxes,te=l.enableHover,ne=u??l.marginDefaults,ie=c??[l.width,l.height],re=E??O??function(e={}){const{timeAccessor:t,valueAccessor:n}=e;return e=>{const i=e?.data??null,s=S(i,t,"time"),o=i?.delta??S(i,n,"value"),r=i?.cumEnd,a="number"==typeof o?0>o?z(o):"+"+z(o):z(o);return _("div",{className:"semiotic-tooltip",style:k,children:[_("div",{children:[A("span",{style:H,children:"x:"}),z(s)]}),_("div",{children:[A("span",{style:H,children:"Δ:"}),a]}),null!=r&&_("div",{children:[A("span",{style:H,children:"total:"}),z(r)]})]})}}({timeAccessor:g,valueAccessor:f}),ce=se(null),{customHoverBehavior:ue}=o({selection:Z,linkedHover:U,unwrapData:!0,onObservation:q,chartType:"RealtimeWaterfallChart",chartId:X}),me=ae(e=>{B&&B(e),ue(e)},[B,ue]);oe(i,()=>({push:e=>ce.current?.push(e),pushMany:e=>ce.current?.pushMany(e),remove:e=>ce.current?.remove(e)??[],update:(e,t)=>ce.current?.update(e,t)??[],clear:()=>ce.current?.clear(),getData:()=>ce.current?.getData()??[],getScales:()=>ce.current?.getScales()??null}),[]);const he=a(Y,ie[0],ie[1],G),de=he?null:r(v,ie[0],ie[1],K),pe={};null!=x&&(pe.positiveColor=x),null!=I&&(pe.negativeColor=I),null!=T&&(pe.connectorStroke=T),null!=R&&(pe.connectorWidth=R),null!=F&&(pe.gap=F),null!=P&&(pe.stroke=P),null!=M&&(pe.strokeWidth=M),null!=N&&(pe.opacity=N);const ve=Q?`${m||""} semiotic-emphasis-${Q}`.trim():m,ge=C(p,v);return he||de||le(e,{ref:ce,chartType:"waterfall",runtimeMode:"streaming",size:ie,margin:ne,className:ve,arrowOfTime:h,windowMode:d,windowSize:ge,data:v,timeAccessor:g,valueAccessor:f,xExtent:w,yExtent:y,extentPadding:b,waterfallStyle:pe,showAxes:ee,background:D,hoverAnnotation:te,tooltipContent:re,...t({linkedHover:U,selection:Z,onObservation:q,forceHoverBehavior:!0,mobileInteraction:l.mobileInteraction,customHoverBehavior:me}),annotations:j,autoPlaceAnnotations:V,svgAnnotationRules:W,tickFormatTime:$,tickFormatValue:L,legendPosition:J,pointIdAccessor:n.pointIdAccessor})});ce.displayName="RealtimeWaterfallChart";import{useRef as ue,useImperativeHandle as me,forwardRef as he,useCallback as de}from"react";import{jsx as pe}from"react/jsx-runtime";var ve=he(function(n,i){const l=s(n.mode,{width:n.size?.[0]??n.width,height:n.size?.[1]??n.height,enableHover:null!=n.enableHover?!!n.enableHover:void 0,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,responsiveRules:n.responsiveRules}),{size:c,margin:u,className:m,arrowOfTime:h="right",windowMode:d="sliding",windowSize:p,data:v,timeAccessor:g,valueAccessor:f,categoryAccessor:w,timeExtent:y,valueExtent:b,extentPadding:x,heatmapXBins:I=20,heatmapYBins:T=20,aggregation:R="count",background:F,tooltipContent:P,tooltip:M,onHover:N,annotations:D,autoPlaceAnnotations:E,svgAnnotationRules:O,tickFormatTime:B,tickFormatValue:j,decay:V,pulse:W,staleness:$,linkedHover:L,selection:U,onObservation:Z,chartId:q,loading:X,loadingContent:Y,emptyContent:G,emphasis:K,legendPosition:Q}=n,J=l.showAxes,ee=l.enableHover,te=u??l.marginDefaults,ne=c??[l.width,l.height],ie=P??M??function(e={}){const{timeAccessor:t,valueAccessor:n,xLabel:i="x",yLabel:s="y"}=e;return e=>{const o=e?.data??null,r=o?.xCenter??S(o,t,"time"),a=o?.yCenter??S(o,n,"value"),l=o?.count,c=o?.sum,u=o?.value,m=o?.agg??"count";return _("div",{className:"semiotic-tooltip",style:k,children:[_("div",{children:[_("span",{style:H,children:[i,":"]}),z(r)]}),_("div",{children:[_("span",{style:H,children:[s,":"]}),z(a)]}),null!=l&&_("div",{children:[A("span",{style:H,children:"count:"}),z(l)]}),"sum"===m&&null!=c&&_("div",{children:[A("span",{style:H,children:"sum:"}),z(c)]}),"mean"===m&&null!=u&&_("div",{children:[A("span",{style:H,children:"mean:"}),z(u)]})]})}}({timeAccessor:g,valueAccessor:f}),se=ue(null),{customHoverBehavior:oe}=o({selection:U,linkedHover:L,unwrapData:!0,onObservation:Z,chartType:"RealtimeHeatmap",chartId:q}),re=de(e=>{N&&N(e),oe(e)},[N,oe]);me(i,()=>({push:e=>se.current?.push(e),pushMany:e=>se.current?.pushMany(e),remove:e=>se.current?.remove(e)??[],update:(e,t)=>se.current?.update(e,t)??[],clear:()=>se.current?.clear(),getData:()=>se.current?.getData()??[],getScales:()=>se.current?.getScales()??null}),[]);const ae=a(X,ne[0],ne[1],Y),le=ae?null:r(v,ne[0],ne[1],G),ce=K?`${m||""} semiotic-emphasis-${K}`.trim():m,he=C(p,v);return ae||le||pe(e,{ref:se,chartType:"heatmap",runtimeMode:"streaming",size:ne,margin:te,className:ce,arrowOfTime:h,windowMode:d,windowSize:he,data:v,timeAccessor:g,valueAccessor:f,categoryAccessor:w,xExtent:y,yExtent:b,extentPadding:x,heatmapXBins:I,heatmapYBins:T,heatmapAggregation:R,showAxes:J,background:F,hoverAnnotation:ee,tooltipContent:ie,...t({linkedHover:L,selection:U,onObservation:Z,forceHoverBehavior:!0,mobileInteraction:l.mobileInteraction,customHoverBehavior:re}),annotations:D,autoPlaceAnnotations:E,svgAnnotationRules:O,tickFormatTime:B,tickFormatValue:j,decay:V,pulse:W,staleness:$,legendPosition:Q,pointIdAccessor:n.pointIdAccessor})});ve.displayName="RealtimeHeatmap";export{l as RunningStats,c as WindowAccumulator,u as statValue,m as bandBounds,p as parseWindowDuration,v as ReorderBuffer,V as RealtimeLineChart,Y as RealtimeHistogram,G as TemporalHistogram,K as RealtimeTemporalHistogram,ie as RealtimeSwarmChart,ce as RealtimeWaterfallChart,ve as RealtimeHeatmap};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{darkenColor as t,lightenColor as o}from"./chunk-chunk-2JGJ5GUG.module.min.js";import{getMax as n,getMinMax as e}from"./chunk-chunk-JJ2OOIET.module.min.js";var r="__forecastSegment",a="__forecastOpacity";function s(t,o,n,r){const s=o.uncertaintyOpacity,i=o.confidenceAccessor;if(!s&&!i)return;const l="object"==typeof s?s:{},c=l.min??.15,f=l.max??1;if(i){const o="function"==typeof i?i:t=>t[i];for(const n of t){const t=o(n);null!=t&&Number.isFinite(t)&&(n[a]=c+Math.max(0,Math.min(1,t))*(f-c))}return}const u=t.map(t=>{const o=n(t),e=r(t);return null!=o&&null!=e&&Number.isFinite(o)&&Number.isFinite(e)?Math.abs(o-e):NaN}),p=u.filter(t=>Number.isFinite(t));if(0===p.length)return;const[h,y]=e(p),d=y-h;t.forEach((t,o)=>{const n=u[o];Number.isFinite(n)&&(t[a]=f-(d>0?(n-h)/d:0)*(f-c))})}function i(t,o){return"function"==typeof o?o(t):!!t[o]}function l(t){return[{type:"anomaly-band",threshold:t.threshold??2,showBand:!1!==t.showBand,fill:t.bandColor||"#6366f1",fillOpacity:t.bandOpacity??.1,anomalyColor:t.anomalyColor||"#ef4444",anomalyRadius:t.anomalyRadius??6,label:t.label}]}function c(t,o,e,a,l){return(c=a).isTraining||c.isForecast||c.isAnomaly||c.upperBounds||c.lowerBounds?function(t,o,n,e,a){const{isTraining:l,isForecast:c,isAnomaly:f,upperBounds:u,lowerBounds:p,color:h="#6366f1",bandOpacity:y=.15,anomalyColor:d="#ef4444",anomalyRadius:m=6,label:b}=e,g=t.map(t=>{let o="observed";return c&&i(t,c)?o="forecast":l&&i(t,l)&&(o="training"),{...t,[r]:o}}),k=e._groupBy,_=[];if(k){const t=new Map;for(const o of g){const n=o[k]??"__default";t.has(n)||t.set(n,[]),t.get(n).push(o)}const o=[];for(const[,n]of t)for(let t=0;n.length-1>t;t++)n[t][r]!==n[t+1][r]&&(o.push({...n[t+1],[r]:n[t][r]}),o.push({...n[t],[r]:n[t+1][r]}));_.push(...g,...o)}else for(let t=0;g.length>t;t++)_.push(g[t]),g.length-1>t&&g[t][r]!==g[t+1][r]&&(_.push({...g[t+1],[r]:g[t][r]}),_.push({...g[t],[r]:g[t+1][r]}));if(e.trainUnderline){const t=[];for(const o of _)"training"===o[r]&&t.push({...o,[r]:"training-base"});_.unshift(...t)}const O=[];if(u&&p){const t="string"==typeof u?u:"__envUpper",o="string"==typeof p?p:"__envLower";if("function"==typeof u||"function"==typeof p)for(const n of _)"function"==typeof u&&(n[t]=u(n)),"function"==typeof p&&(n[o]=p(n));O.push({type:"envelope",upperAccessor:t,lowerAccessor:o,fill:h,fillOpacity:y,label:b})}if(e.uncertaintyOpacity||e.confidenceAccessor){const t=u?"function"==typeof u?u:t=>t[u]:()=>{},o=p?"function"==typeof p?p:t=>t[p]:()=>{};s(_.filter(t=>"forecast"===t[r]),e,t,o)}if(f){const t=e.anomalyStyle,o={type:"highlight",filter:t=>i(t,f)};t?(o.style=t,o.r=m):"function"==typeof d?(o.style=t=>{const o=d(t);return{stroke:o,strokeWidth:1.5,fill:o,fillOpacity:.7}},o.r=m):(o.color=d,o.r=m,o.style={stroke:d,strokeWidth:1.5,fill:d,fillOpacity:.7}),O.push(o)}return a&&O.push({type:"anomaly-band",threshold:a.threshold??2,showBand:!1!==a.showBand,fill:a.bandColor||"#6366f1",fillOpacity:a.bandOpacity??.1,anomalyColor:a.anomalyColor||"#ef4444",anomalyRadius:a.anomalyRadius??6,label:a.label}),{processedData:_,annotations:O}}(t,0,0,a,l):function(t,o,e,a,i){const{trainEnd:l,steps:c=10,confidence:f=.95,color:u="#6366f1",bandOpacity:p=.15,label:h}=a;if(null==l)return{processedData:t,annotations:[]};const y=[],d=[];for(const n of t)n[o]>l?d.push({...n,[r]:"observed"}):y.push({...n,[r]:"training"});const m=y.map(t=>[t[o],t[e]]).filter(t=>null!=t[0]&&null!=t[1]&&isFinite(t[0])&&isFinite(t[1])).sort((t,o)=>t[0]-o[0]),b=[],g=[];if(m.length>=3){const i=m.length;let l=0,y=0,d=0,k=0;for(const[t,o]of m)l+=t,y+=o,d+=t*t,k+=t*o;const _=i*d-l*l;if(Math.abs(_)>1e-12){const d=(i*k-l*y)/_,O=(y-d*l)/i,w=t=>O+d*t,B=m.map(([t,o])=>o-w(t)).reduce((t,o)=>t+o*o,0),F=Math.sqrt(B/Math.max(i-2,1)),v=m.reduce((t,o)=>t+o[0],0)/i,C=m.reduce((t,o)=>t+(o[0]-v)**2,0),D=.99>f?.95>f?.9>f?1:1.645:1.96:2.576,A=t.map(t=>t[o]).filter(t=>null!=t&&isFinite(t)),M=n(A),N=m.length>1?(m[i-1][0]-m[0][0])/(i-1):1;for(let t=1;c>=t;t++){const n=M+t*N,a=w(n),s=F*Math.sqrt(1+1/i+(C>0?(n-v)**2/C:0))*D;g.push({[o]:n,[e]:a,[r]:"forecast",__forecastUpper:a+s,__forecastLower:a-s})}s(g,a,t=>t.__forecastUpper,t=>t.__forecastLower),b.push({type:"envelope",upperAccessor:"__forecastUpper",lowerAccessor:"__forecastLower",fill:u,fillOpacity:p,label:h})}}b.push({type:"x-threshold",x:l,color:"#94a3b8",strokeWidth:1,strokeDasharray:"4,2",label:"Train / Forecast"}),i&&b.push({type:"anomaly-band",threshold:i.threshold??2,showBand:!1!==i.showBand,fill:i.bandColor||"#6366f1",fillOpacity:i.bandOpacity??.1,anomalyColor:i.anomalyColor||"#ef4444",anomalyRadius:i.anomalyRadius??6,label:i.label});const k=[];if(k.push(...y),y.length>0&&d.length>0&&k.push({...y[y.length-1],[r]:"observed"}),k.push(...d),g.length>0){const t=d.length>0?d[d.length-1]:y[y.length-1];t&&k.push({...t,[r]:"forecast"}),k.push(...g)}return{processedData:k,annotations:b}}(t,o,e,a,l);var c}function f(n,e){const s=e.trainDasharray??"8,4",i=e.forecastDasharray??"4,4",l=e.color||"#6366f1",c=e.trainOpacity,f=e.forecastOpacity,u=e.trainStroke,p=e.trainLinecap,h=e.trainUnderline;return e=>{const y=n(e),d=e[r];if("training"===d){let o=y.stroke;return"darken"===u?o=t(y.stroke||"#666",.5):u&&(o=u),{...y,stroke:o,strokeDasharray:s,...p&&{strokeLinecap:p},...null!=c&&{strokeOpacity:c}}}if("training-base"===d){let t=y.stroke||"#666";return"lighten"===h&&(t=o(t,.4)),{...y,stroke:t,strokeDasharray:void 0}}if("forecast"===d){const t=e[a],o=null!=t?t:f;return{...y,stroke:l,strokeDasharray:i,...null!=o&&{strokeOpacity:o}}}return y}}export{a as FORECAST_OPACITY_FIELD,r as SEGMENT_FIELD,l as buildAnomalyAnnotations,c as buildForecast,f as createSegmentLineStyle,t as darkenColor,o as lightenColor,s as stampForecastOpacity};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type NavTreeNode } from "./ai/navigationTree";
|
|
3
|
+
import { type OnObservationCallback } from "./store/ObservationStore";
|
|
4
|
+
import { type OnAnnotationActivateCallback } from "./charts/shared/annotationActivation";
|
|
3
5
|
export interface AccessibleNavTreeProps {
|
|
4
6
|
tree: NavTreeNode;
|
|
5
7
|
/** Accessible name for the tree. */
|
|
@@ -22,5 +24,9 @@ export interface AccessibleNavTreeProps {
|
|
|
22
24
|
* the conversation-arc store is enabled — zero-overhead otherwise.
|
|
23
25
|
*/
|
|
24
26
|
chartId?: string;
|
|
27
|
+
/** Normalized focus/activation events produced by structured navigation. */
|
|
28
|
+
onObservation?: OnObservationCallback;
|
|
29
|
+
/** Observe activation of an annotation leaf in the navigation tree. */
|
|
30
|
+
onAnnotationActivate?: OnAnnotationActivateCallback;
|
|
25
31
|
}
|
|
26
|
-
export declare function AccessibleNavTree({ tree, label, visible, className, onActiveChange, activeId: controlledActiveId, chartId }: AccessibleNavTreeProps): React.JSX.Element;
|
|
32
|
+
export declare function AccessibleNavTree({ tree, label, visible, className, onActiveChange, activeId: controlledActiveId, chartId, onObservation, onAnnotationActivate }: AccessibleNavTreeProps): React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED from chartSpecs.ts and chartDefinitionPilot.ts by
|
|
3
|
+
* scripts/regenerate-schema.ts.
|
|
4
|
+
* Do not edit by hand; run `npm run docs:chart-specs:schema`.
|
|
5
|
+
*/
|
|
6
|
+
import type { ChartCategory } from "../charts/shared/chartSpecs";
|
|
7
|
+
interface ChartClinicMetadata {
|
|
8
|
+
readonly category: ChartCategory;
|
|
9
|
+
readonly recommendedImport: string;
|
|
10
|
+
readonly serverImport?: "semiotic/server";
|
|
11
|
+
readonly docsRoute?: string;
|
|
12
|
+
readonly pilot?: true;
|
|
13
|
+
}
|
|
14
|
+
export declare const CHART_CLINIC_METADATA: Readonly<Record<string, ChartClinicMetadata>>;
|
|
15
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChartObservation } from "../store/ObservationStore";
|
|
1
2
|
import type { NavTreeNode } from "./navigationTree";
|
|
2
3
|
import type { Datum } from "../charts/shared/datumTypes";
|
|
3
4
|
/**
|
|
@@ -29,8 +30,12 @@ export interface UseNavigationSyncOptions {
|
|
|
29
30
|
matchFields?: string[];
|
|
30
31
|
/** Selection name shared with the chart's `selection={{ name }}`. Default "__semiotic-nav-sync". */
|
|
31
32
|
selectionName?: string;
|
|
32
|
-
/**
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Which chart observations move the tree. Defaults to pointer hover/click
|
|
35
|
+
* plus keyboard focus/activation so raw frames and HOC charts stay in sync
|
|
36
|
+
* for both pointer and keyboard readers.
|
|
37
|
+
*/
|
|
38
|
+
observe?: Array<"hover" | "click" | "focus" | "activate">;
|
|
34
39
|
/**
|
|
35
40
|
* The chart's annotations. An annotation anchored to a datum carries that
|
|
36
41
|
* datum's identifying fields (the same `matchFields` used for hover sync), so
|
|
@@ -49,6 +54,16 @@ export interface UseNavigationSyncResult {
|
|
|
49
54
|
selection: {
|
|
50
55
|
name: string;
|
|
51
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Feed a chart observation directly into the sync. This is useful for raw
|
|
59
|
+
* StreamFrames or custom interactions that call `onObservation` themselves
|
|
60
|
+
* instead of publishing through the chart HOCs. Matching pointer and
|
|
61
|
+
* keyboard observations move the tree; events later received from the global
|
|
62
|
+
* observation store are de-duplicated by object identity.
|
|
63
|
+
*/
|
|
64
|
+
onObservation: (observation: ChartObservation) => void;
|
|
65
|
+
/** Alias of `onObservation` for composing an externally supplied handler. */
|
|
66
|
+
handleObservation: (observation: ChartObservation) => void;
|
|
52
67
|
/** Nav-tree leaf ids that an annotation anchors to — mark these as "has a note". */
|
|
53
68
|
annotatedIds: Set<string>;
|
|
54
69
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import type { MobileStandardControlRequest, MobileStandardControlsProps } from "./MobileStandardControls";
|
|
3
|
+
import type { MobileInteractionProp } from "./charts/shared/types";
|
|
4
|
+
export declare function canReceiveChartProps(child: ReactElement): boolean;
|
|
5
|
+
export declare function isMobileStandardControlsProps(value: MobileStandardControlRequest | MobileStandardControlsProps | undefined): value is MobileStandardControlsProps;
|
|
6
|
+
export declare function standardControlsFromInteraction(mobileInteraction: MobileInteractionProp | undefined): MobileStandardControlRequest | undefined;
|
|
7
|
+
export declare function targetSizeFromInteraction(mobileInteraction: MobileInteractionProp | undefined): number | undefined;
|
|
8
|
+
export declare function hasStandardControlsRequest(request: MobileStandardControlRequest | undefined): request is MobileStandardControlRequest;
|
|
9
|
+
export declare function withStandardControls(source: MobileInteractionProp | undefined, controls: MobileStandardControlRequest | undefined): MobileInteractionProp | undefined;
|
|
@@ -4,6 +4,7 @@ import type { StreamGeoFrameProps, ProjectionProp } from "../../stream/geoTypes"
|
|
|
4
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
5
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
6
6
|
import type { LegendInteractionMode } from "../shared/hooks";
|
|
7
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
7
8
|
import { type AreasProp } from "../../geo/useReferenceAreas";
|
|
8
9
|
/**
|
|
9
10
|
* ChoroplethMap component props
|
|
@@ -33,6 +34,17 @@ export interface ChoroplethMapProps<TDatum extends Datum = Datum> extends BaseCh
|
|
|
33
34
|
valueAccessor: ChartAccessor<TDatum, number>;
|
|
34
35
|
/** Sequential color scheme @default "blues" */
|
|
35
36
|
colorScheme?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Declarative, threshold-aware feature styling. Ordered `{ when, style }`
|
|
39
|
+
* rules; last applicable rule wins per property. `when` accepts a predicate
|
|
40
|
+
* `(feature, ctx) => boolean` (`ctx.value` is the feature's `valueAccessor`
|
|
41
|
+
* value; rules see the feature with its `properties` flattened, so
|
|
42
|
+
* `{ field: "iso", eq: "USA" }` works), a declarative threshold
|
|
43
|
+
* (`{ gt, gte, within, in, … }`), or `true`. A rule's `fill` may be a color
|
|
44
|
+
* or a HatchFill (hatch flags a feature — e.g. "no data" / "under review").
|
|
45
|
+
* Layers over the sequential-scale base fill.
|
|
46
|
+
*/
|
|
47
|
+
styleRules?: StyleRule[];
|
|
36
48
|
/** Geographic projection @default "equalEarth" */
|
|
37
49
|
projection?: ProjectionProp;
|
|
38
50
|
/** Show graticule grid lines */
|
|
@@ -43,8 +55,13 @@ export interface ChoroplethMapProps<TDatum extends Datum = Datum> extends BaseCh
|
|
|
43
55
|
showLegend?: boolean;
|
|
44
56
|
/** Legend interaction mode */
|
|
45
57
|
legendInteraction?: LegendInteractionMode;
|
|
46
|
-
/**
|
|
47
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Finite projection-fit fraction in `[0, 0.5)`. `0.1` = 10% inset;
|
|
60
|
+
* nullish values use 0 and invalid values throw. An explicit
|
|
61
|
+
* `frameProps.projectionExtent` remains authoritative.
|
|
62
|
+
* @default 0
|
|
63
|
+
*/
|
|
64
|
+
fitPadding?: number | null;
|
|
48
65
|
/** Enable zoom/pan. Defaults to true when tileURL is set, false otherwise. */
|
|
49
66
|
zoomable?: boolean;
|
|
50
67
|
/** [minZoom, maxZoom] @default [1, 8] */
|
|
@@ -4,6 +4,7 @@ import type { StreamGeoFrameProps, ProjectionProp } from "../../stream/geoTypes"
|
|
|
4
4
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
5
5
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
6
6
|
import type { LegendPosition } from "../shared/hooks";
|
|
7
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
7
8
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
8
9
|
export interface DistanceCartogramProps<TDatum extends Datum = Datum> extends BaseChartProps {
|
|
9
10
|
/** Point data with geographic coordinates */
|
|
@@ -36,6 +37,12 @@ export interface DistanceCartogramProps<TDatum extends Datum = Datum> extends Ba
|
|
|
36
37
|
transition?: number;
|
|
37
38
|
/** Field to determine point color */
|
|
38
39
|
colorBy?: ChartAccessor<TDatum, string>;
|
|
40
|
+
/**
|
|
41
|
+
* Declarative, threshold-aware point styling. Ordered `{ when, style }`
|
|
42
|
+
* rules; last applicable rule wins. `ctx` = `{ value, category }`
|
|
43
|
+
* (category = `colorBy`). A rule `fill` may be a color or a HatchFill.
|
|
44
|
+
*/
|
|
45
|
+
styleRules?: StyleRule[];
|
|
39
46
|
/** Color scheme @default "category10" */
|
|
40
47
|
colorScheme?: string | string[] | Record<string, string>;
|
|
41
48
|
/** Point radius @default 5 */
|
|
@@ -46,8 +53,13 @@ export interface DistanceCartogramProps<TDatum extends Datum = Datum> extends Ba
|
|
|
46
53
|
showLegend?: boolean;
|
|
47
54
|
/** Legend position */
|
|
48
55
|
legendPosition?: LegendPosition;
|
|
49
|
-
/**
|
|
50
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Finite projection-fit fraction in `[0, 0.5)`. `0.1` = 10% inset;
|
|
58
|
+
* nullish values use 0 and invalid values throw. An explicit
|
|
59
|
+
* `frameProps.projectionExtent` remains authoritative.
|
|
60
|
+
* @default 0
|
|
61
|
+
*/
|
|
62
|
+
fitPadding?: number | null;
|
|
51
63
|
/** Enable zoom/pan. Defaults to true when tileURL is set, false otherwise. */
|
|
52
64
|
zoomable?: boolean;
|
|
53
65
|
/** [minZoom, maxZoom] @default [1, 8] */
|
|
@@ -10,12 +10,11 @@ import type { GeoParticleStyle } from "../../stream/GeoParticlePool";
|
|
|
10
10
|
import { type AreasProp } from "../../geo/useReferenceAreas";
|
|
11
11
|
export interface FlowMapProps<TDatum extends Datum = Datum> extends BaseChartProps {
|
|
12
12
|
/** Flow edges with source/target/value */
|
|
13
|
-
flows?: {
|
|
13
|
+
flows?: Array<Datum & {
|
|
14
14
|
source: string;
|
|
15
15
|
target: string;
|
|
16
16
|
value?: number;
|
|
17
|
-
|
|
18
|
-
}[];
|
|
17
|
+
}>;
|
|
19
18
|
/** Geographic nodes with coordinates */
|
|
20
19
|
nodes?: TDatum[];
|
|
21
20
|
/** Node ID accessor @default "id" */
|
|
@@ -39,7 +38,7 @@ export interface FlowMapProps<TDatum extends Datum = Datum> extends BaseChartPro
|
|
|
39
38
|
/** Background area style */
|
|
40
39
|
areaStyle?: Style;
|
|
41
40
|
/** Edge color accessor */
|
|
42
|
-
edgeColorBy?: ChartAccessor<
|
|
41
|
+
edgeColorBy?: ChartAccessor<Datum, string>;
|
|
43
42
|
/** Edge opacity @default 0.6 */
|
|
44
43
|
edgeOpacity?: number;
|
|
45
44
|
/** Min/max pixel width for proportional edge width @default [1, 8] */
|
|
@@ -60,8 +59,13 @@ export interface FlowMapProps<TDatum extends Datum = Datum> extends BaseChartPro
|
|
|
60
59
|
legendInteraction?: LegendInteractionMode;
|
|
61
60
|
/** Legend position */
|
|
62
61
|
legendPosition?: LegendPosition;
|
|
63
|
-
/**
|
|
64
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Finite projection-fit fraction in `[0, 0.5)`. `0.1` = 10% inset;
|
|
64
|
+
* nullish values use 0 and invalid values throw. An explicit
|
|
65
|
+
* `frameProps.projectionExtent` remains authoritative.
|
|
66
|
+
* @default 0
|
|
67
|
+
*/
|
|
68
|
+
fitPadding?: number | null;
|
|
65
69
|
/** Enable zoom/pan. Defaults to true when tileURL is set, false otherwise. */
|
|
66
70
|
zoomable?: boolean;
|
|
67
71
|
/** [minZoom, maxZoom] @default [1, 8] */
|
|
@@ -5,6 +5,7 @@ import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
|
5
5
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
6
6
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
7
7
|
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
8
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
8
9
|
import type { Style } from "../../stream/types";
|
|
9
10
|
import { type AreasProp } from "../../geo/useReferenceAreas";
|
|
10
11
|
export interface ProportionalSymbolMapProps<TDatum extends Datum = Datum> extends BaseChartProps {
|
|
@@ -20,6 +21,12 @@ export interface ProportionalSymbolMapProps<TDatum extends Datum = Datum> extend
|
|
|
20
21
|
sizeRange?: [number, number];
|
|
21
22
|
/** Field to determine point color */
|
|
22
23
|
colorBy?: ChartAccessor<TDatum, string>;
|
|
24
|
+
/**
|
|
25
|
+
* Declarative, threshold-aware symbol styling. Ordered `{ when, style }`
|
|
26
|
+
* rules; last applicable rule wins. `ctx` = `{ value, category }` (value =
|
|
27
|
+
* `sizeBy`, category = `colorBy`). A rule `fill` may be a color or HatchFill.
|
|
28
|
+
*/
|
|
29
|
+
styleRules?: StyleRule[];
|
|
23
30
|
/** Color scheme @default "category10" */
|
|
24
31
|
colorScheme?: string | string[] | Record<string, string>;
|
|
25
32
|
/** Geographic projection @default "equalEarth" */
|
|
@@ -38,8 +45,13 @@ export interface ProportionalSymbolMapProps<TDatum extends Datum = Datum> extend
|
|
|
38
45
|
legendInteraction?: LegendInteractionMode;
|
|
39
46
|
/** Legend position */
|
|
40
47
|
legendPosition?: LegendPosition;
|
|
41
|
-
/**
|
|
42
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Finite projection-fit fraction in `[0, 0.5)`. `0.1` = 10% inset;
|
|
50
|
+
* nullish values use 0 and invalid values throw. An explicit
|
|
51
|
+
* `frameProps.projectionExtent` remains authoritative.
|
|
52
|
+
* @default 0
|
|
53
|
+
*/
|
|
54
|
+
fitPadding?: number | null;
|
|
43
55
|
/** Enable zoom/pan. Defaults to true when tileURL is set, false otherwise. */
|
|
44
56
|
zoomable?: boolean;
|
|
45
57
|
/** [minZoom, maxZoom] @default [1, 8] */
|
|
@@ -133,3 +133,9 @@ export { Tooltip, MultiLineTooltip, normalizeTooltip } from "../Tooltip/Tooltip"
|
|
|
133
133
|
export type { TooltipProp, TooltipConfig, TooltipField, MultiLineTooltipConfig } from "../Tooltip/Tooltip";
|
|
134
134
|
export { createHatchPattern } from "./shared/hatchPattern";
|
|
135
135
|
export type { HatchPatternOptions } from "./shared/hatchPattern";
|
|
136
|
+
export { isHatchFill, hatchPatternDef, resolveSvgFill, hatchFillId } from "./shared/hatchFill";
|
|
137
|
+
export type { HatchFill } from "./shared/hatchFill";
|
|
138
|
+
export { resolveStyleRules, matchesThreshold, ruleMatches, makeRuleValueResolver, makeXYRuleContext, makeNodeRuleContext, composeStyleRules, makeStyleRuleStyleFn, } from "./shared/styleRules";
|
|
139
|
+
export type { StyleRule, StyleRuleStyle, StyleRuleThreshold, StyleRuleContext, StyleRulePredicate, } from "./shared/styleRules";
|
|
140
|
+
export { AnnotationLabel, estimateLabelWidth } from "./shared/AnnotationLabel";
|
|
141
|
+
export type { AnnotationLabelBackground, AnnotationLabelBackgroundConfig, AnnotationLabelProps } from "./shared/AnnotationLabel";
|
|
@@ -5,6 +5,7 @@ import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
|
5
5
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
6
6
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
7
7
|
import type { LegendInteractionMode } from "../shared/hooks";
|
|
8
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
8
9
|
/**
|
|
9
10
|
* ChordDiagram component props
|
|
10
11
|
*/
|
|
@@ -17,10 +18,17 @@ export interface ChordDiagramProps<TNode extends Datum = Datum, TEdge extends Da
|
|
|
17
18
|
nodeIdAccessor?: ChartAccessor<TNode, string>;
|
|
18
19
|
colorBy?: ChartAccessor<TNode, string>;
|
|
19
20
|
colorScheme?: string | string[] | Record<string, string>;
|
|
21
|
+
/**
|
|
22
|
+
* Declarative, threshold-aware node styling (see ForceDirectedGraph).
|
|
23
|
+
* Ordered `{ when, style }` rules; last applicable rule wins. Rules see the
|
|
24
|
+
* raw node object. A rule `fill` may be a color or a HatchFill.
|
|
25
|
+
*/
|
|
26
|
+
styleRules?: StyleRule[];
|
|
20
27
|
edgeColorBy?: "source" | "target" | ((d: Datum) => string);
|
|
21
28
|
padAngle?: number;
|
|
22
29
|
groupWidth?: number;
|
|
23
|
-
|
|
30
|
+
/** Compare D3 chord group indices to control their angular order. */
|
|
31
|
+
sortGroups?: (a: number, b: number) => number;
|
|
24
32
|
nodeLabel?: ChartAccessor<TNode, string>;
|
|
25
33
|
showLabels?: boolean;
|
|
26
34
|
enableHover?: boolean;
|
|
@@ -5,6 +5,7 @@ import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
|
5
5
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
6
6
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
7
7
|
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
8
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
8
9
|
/**
|
|
9
10
|
* ForceDirectedGraph component props
|
|
10
11
|
*/
|
|
@@ -68,6 +69,16 @@ export interface ForceDirectedGraphProps<TNode extends Datum = Datum, TEdge exte
|
|
|
68
69
|
colorBy?: ChartAccessor<TNode, string>;
|
|
69
70
|
/** d3 scheme name or explicit color array; falls back to theme. */
|
|
70
71
|
colorScheme?: string | string[] | Record<string, string>;
|
|
72
|
+
/**
|
|
73
|
+
* Declarative, threshold-aware node styling. Ordered `{ when, style }`
|
|
74
|
+
* rules; the last applicable rule wins per property. `when` accepts a
|
|
75
|
+
* predicate `(node, ctx) => boolean` (rules see the raw node object; `ctx` =
|
|
76
|
+
* `{ value, category }` where `category` is the `colorBy` group), a
|
|
77
|
+
* declarative threshold (`{ field, gt, eq, in, … }`), or `true` — so you can
|
|
78
|
+
* style whole groups of nodes (`{ field: "type", eq: "db" }`). A rule's
|
|
79
|
+
* `fill` may be a color or a HatchFill. Layers over the resolved node color.
|
|
80
|
+
*/
|
|
81
|
+
styleRules?: StyleRule[];
|
|
71
82
|
/**
|
|
72
83
|
* Constant pixel radius, or a function/field returning a numeric value
|
|
73
84
|
* scaled into `nodeSizeRange`.
|
|
@@ -5,6 +5,7 @@ import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
|
5
5
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
6
6
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
7
7
|
import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
|
|
8
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
8
9
|
/**
|
|
9
10
|
* SankeyDiagram component props
|
|
10
11
|
*/
|
|
@@ -17,6 +18,13 @@ export interface SankeyDiagramProps<TNode extends Datum = Datum, TEdge extends D
|
|
|
17
18
|
nodeIdAccessor?: ChartAccessor<TNode, string>;
|
|
18
19
|
colorBy?: ChartAccessor<TNode, string>;
|
|
19
20
|
colorScheme?: string | string[] | Record<string, string>;
|
|
21
|
+
/**
|
|
22
|
+
* Declarative, threshold-aware node styling (see ForceDirectedGraph).
|
|
23
|
+
* Ordered `{ when, style }` rules; last applicable rule wins. Rules see the
|
|
24
|
+
* raw node object; `ctx` = `{ value, category }`. A rule `fill` may be a
|
|
25
|
+
* color or a HatchFill. Layers over the resolved node color.
|
|
26
|
+
*/
|
|
27
|
+
styleRules?: StyleRule[];
|
|
20
28
|
edgeColorBy?: "source" | "target" | "gradient" | ((d: Datum) => string);
|
|
21
29
|
orientation?: "horizontal" | "vertical";
|
|
22
30
|
nodeAlign?: "justify" | "left" | "right" | "center";
|
|
@@ -31,7 +39,7 @@ export interface SankeyDiagramProps<TNode extends Datum = Datum, TEdge extends D
|
|
|
31
39
|
legendPosition?: LegendPosition;
|
|
32
40
|
legendInteraction?: LegendInteractionMode;
|
|
33
41
|
edgeOpacity?: number;
|
|
34
|
-
edgeSort?: (a:
|
|
42
|
+
edgeSort?: (a: TEdge, b: TEdge) => number;
|
|
35
43
|
tooltip?: TooltipProp;
|
|
36
44
|
frameProps?: Partial<Omit<StreamNetworkFrameProps, "edges" | "size">>;
|
|
37
45
|
}
|
|
@@ -5,6 +5,7 @@ import type { LegendInteractionMode } from "../shared/hooks";
|
|
|
5
5
|
import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
|
|
6
6
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
7
7
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
8
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
8
9
|
import { type RegressionProp } from "../shared/regressionUtils";
|
|
9
10
|
/**
|
|
10
11
|
* BarChart component props
|
|
@@ -81,6 +82,26 @@ export interface BarChartProps<TDatum extends Datum = Datum> extends BaseChartPr
|
|
|
81
82
|
color: string;
|
|
82
83
|
}>;
|
|
83
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* Declarative, threshold-aware bar styling. An ordered list of
|
|
87
|
+
* `{ when, style }` rules; every rule whose condition matches a bar
|
|
88
|
+
* contributes its style, merged in order so the **last applicable rule
|
|
89
|
+
* wins** per property. `when` accepts a predicate `(datum, ctx) => boolean`,
|
|
90
|
+
* a declarative threshold (`{ gt, lte, within, in, … }` — compares the
|
|
91
|
+
* bar's value unless `field` is set), or `true`/omitted (always applies).
|
|
92
|
+
* A rule's `fill` may be a color string or a declarative
|
|
93
|
+
* {@link HatchFill} for diagonal hatching (renders on canvas and SSR).
|
|
94
|
+
* Rules layer over the resolved base color; `frameProps.pieceStyle` and
|
|
95
|
+
* top-level `stroke`/`strokeWidth`/`opacity` still override them.
|
|
96
|
+
* @example
|
|
97
|
+
* ```tsx
|
|
98
|
+
* styleRules={[
|
|
99
|
+
* { when: { gte: 10 }, style: { fill: "var(--semiotic-warning)" } },
|
|
100
|
+
* { when: { gt: 15 }, style: { fill: { type: "hatch", background: "#e0a92a", stroke: "#fff" } } },
|
|
101
|
+
* ]}
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
styleRules?: StyleRule[];
|
|
84
105
|
/** When true, adds padding below the 0 baseline. Default false (bars flush with axis). */
|
|
85
106
|
baselinePadding?: boolean;
|
|
86
107
|
enableHover?: boolean;
|
|
@@ -4,6 +4,7 @@ import type { StreamOrdinalFrameProps } from "../../stream/ordinalTypes";
|
|
|
4
4
|
import type { LegendInteractionMode } from "../shared/hooks";
|
|
5
5
|
import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
|
|
6
6
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
7
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
7
8
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
8
9
|
export interface GroupedBarChartProps<TDatum extends Datum = Datum> extends BaseChartProps {
|
|
9
10
|
data?: TDatum[];
|
|
@@ -21,6 +22,16 @@ export interface GroupedBarChartProps<TDatum extends Datum = Datum> extends Base
|
|
|
21
22
|
barPadding?: number;
|
|
22
23
|
/** Rounded corner radius on bar ends (away from baseline). */
|
|
23
24
|
roundedTop?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Declarative, threshold-aware bar styling. Ordered `{ when, style }`
|
|
27
|
+
* rules; the last applicable rule wins per property. `when` accepts a
|
|
28
|
+
* predicate `(datum, ctx) => boolean` (where `ctx.category` is the group
|
|
29
|
+
* series key), a declarative threshold on the bar value
|
|
30
|
+
* (`{ gt, lte, within, in, … }`), or `true`. A rule's `fill` may be a color
|
|
31
|
+
* or a {@link HatchFill}. Layers over the resolved series color;
|
|
32
|
+
* `frameProps.pieceStyle` overrides.
|
|
33
|
+
*/
|
|
34
|
+
styleRules?: StyleRule[];
|
|
24
35
|
baselinePadding?: boolean;
|
|
25
36
|
enableHover?: boolean;
|
|
26
37
|
showGrid?: boolean;
|
|
@@ -5,6 +5,7 @@ import type { LegendInteractionMode } from "../shared/hooks";
|
|
|
5
5
|
import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
|
|
6
6
|
import { type TooltipProp } from "../../Tooltip/Tooltip";
|
|
7
7
|
import type { RealtimeFrameHandle } from "../../realtime/types";
|
|
8
|
+
import { type StyleRule } from "../shared/styleRules";
|
|
8
9
|
export interface StackedBarChartProps<TDatum extends Datum = Datum> extends BaseChartProps {
|
|
9
10
|
data?: TDatum[];
|
|
10
11
|
categoryAccessor?: ChartAccessor<TDatum, string>;
|
|
@@ -22,6 +23,16 @@ export interface StackedBarChartProps<TDatum extends Datum = Datum> extends Base
|
|
|
22
23
|
barPadding?: number;
|
|
23
24
|
/** Rounded top corner radius. Only the topmost stacked segment gets rounded. */
|
|
24
25
|
roundedTop?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Declarative, threshold-aware segment styling. Ordered `{ when, style }`
|
|
28
|
+
* rules; the last applicable rule wins per property. `when` accepts a
|
|
29
|
+
* predicate `(datum, ctx) => boolean` (where `ctx.category` is the stack
|
|
30
|
+
* series key), a declarative threshold on the segment value
|
|
31
|
+
* (`{ gt, lte, within, in, … }`), or `true`. A rule's `fill` may be a color
|
|
32
|
+
* or a {@link HatchFill} for hatching a segment (e.g. a "fixed-rate" band).
|
|
33
|
+
* Layers over the resolved series color; `frameProps.pieceStyle` overrides.
|
|
34
|
+
*/
|
|
35
|
+
styleRules?: StyleRule[];
|
|
25
36
|
baselinePadding?: boolean;
|
|
26
37
|
enableHover?: boolean;
|
|
27
38
|
showGrid?: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { Datum } from "../shared/datumTypes";
|
|
3
3
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
|
+
import type { StyleRule } from "../shared/styleRules";
|
|
4
5
|
import { type PhysicsFrameHandle } from "./physicsHocHandle";
|
|
5
6
|
import { type PhysicsHocFrameProps, type PhysicsSharedChartProps, type TooltipProp } from "./physicsHocUtils";
|
|
6
7
|
export interface CollisionSwarmChartProps<TDatum extends Datum = Datum> extends Omit<BaseChartProps, "margin">, PhysicsSharedChartProps {
|
|
@@ -11,6 +12,12 @@ export interface CollisionSwarmChartProps<TDatum extends Datum = Datum> extends
|
|
|
11
12
|
radiusAccessor?: ChartAccessor<TDatum, number>;
|
|
12
13
|
pointRadius?: number;
|
|
13
14
|
colorBy?: ChartAccessor<TDatum, string>;
|
|
15
|
+
/**
|
|
16
|
+
* Declarative, threshold-aware dot styling. Ordered `{ when, style }` rules;
|
|
17
|
+
* last applicable rule wins. `ctx` = `{ value, category }` (value = the
|
|
18
|
+
* `xAccessor` position). A rule `fill` may be a color or a HatchFill.
|
|
19
|
+
*/
|
|
20
|
+
styleRules?: StyleRule[];
|
|
14
21
|
seed?: number;
|
|
15
22
|
xExtent?: [number, number];
|
|
16
23
|
collisionIterations?: number;
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import type { Datum } from "../shared/datumTypes";
|
|
3
3
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
4
|
import { type EventDropWindowOptions } from "./physicsChartUtils";
|
|
5
|
+
import type { StyleRule } from "../shared/styleRules";
|
|
5
6
|
import { type PhysicsFrameHandle } from "./physicsHocHandle";
|
|
6
7
|
import { type PhysicsHocFrameProps, type PhysicsSharedChartProps, type TooltipProp } from "./physicsHocUtils";
|
|
7
8
|
export interface EventDropChartProps<TDatum extends Datum = Datum> extends Omit<BaseChartProps, "margin">, PhysicsSharedChartProps {
|
|
@@ -16,6 +17,12 @@ export interface EventDropChartProps<TDatum extends Datum = Datum> extends Omit<
|
|
|
16
17
|
} | ((latestEventTime: number) => number);
|
|
17
18
|
ballRadius?: number;
|
|
18
19
|
colorBy?: ChartAccessor<TDatum, string>;
|
|
20
|
+
/**
|
|
21
|
+
* Declarative, threshold-aware drop styling. Ordered `{ when, style }`
|
|
22
|
+
* rules; last applicable rule wins. `ctx` = `{ value, category }` (value =
|
|
23
|
+
* the event time). A rule `fill` may be a color or a HatchFill.
|
|
24
|
+
*/
|
|
25
|
+
styleRules?: StyleRule[];
|
|
19
26
|
seed?: number;
|
|
20
27
|
timeExtent?: [number, number];
|
|
21
28
|
timeScale?: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { Datum } from "../shared/datumTypes";
|
|
3
3
|
import type { BaseChartProps, ChartAccessor } from "../shared/types";
|
|
4
|
+
import type { StyleRule } from "../shared/styleRules";
|
|
4
5
|
import { type PhysicsFrameHandle } from "./physicsHocHandle";
|
|
5
6
|
import { type PhysicsHocFrameProps, type PhysicsSharedChartProps, type PhysicsSimulationMode, type TooltipProp } from "./physicsHocUtils";
|
|
6
7
|
import type { ChartMode } from "../shared/types";
|
|
@@ -32,6 +33,13 @@ export interface GaltonBoardChartProps<TDatum extends Datum = Datum> extends Omi
|
|
|
32
33
|
branchProbability?: number;
|
|
33
34
|
ballRadius?: number;
|
|
34
35
|
colorBy?: ChartAccessor<TDatum, string>;
|
|
36
|
+
/**
|
|
37
|
+
* Declarative, threshold-aware ball styling. Ordered `{ when, style }`
|
|
38
|
+
* rules; last applicable rule wins. Rules resolve against each ball's datum;
|
|
39
|
+
* `ctx` = `{ value, category }` (category = the colorBy group). A rule `fill`
|
|
40
|
+
* may be a color or a HatchFill. Layers over the colorBy-derived fill.
|
|
41
|
+
*/
|
|
42
|
+
styleRules?: StyleRule[];
|
|
35
43
|
referenceLines?: GaltonBoardReferenceLine | GaltonBoardReferenceLine[];
|
|
36
44
|
seed?: number;
|
|
37
45
|
showProjection?: boolean;
|