semiotic 3.8.9 → 3.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -81
- package/agent-skill/semiotic-charts/SKILL.md +11 -2
- package/ai/behaviorContracts.cjs +33 -3
- package/ai/cli.js +53 -2
- package/ai/componentMetadata.cjs +15 -0
- package/ai/dist/mcp-server.js +1530 -611
- package/ai/examples.md +48 -42
- package/{CLAUDE.md → ai/reference.md} +43 -22
- package/ai/schema.json +10603 -986
- package/ai/surface-manifest.json +643 -2
- package/ai/system-prompt.md +83 -130
- package/dist/c-3BLJEQNG.min.js +1 -0
- package/dist/c-3KZD6AXJ.min.js +1 -0
- package/dist/c-4TWEX5HG.min.js +1 -0
- package/dist/c-52TEGIUJ.min.js +1 -0
- package/dist/c-5YCIX3VZ.min.js +1 -0
- package/dist/c-6FEKTA3U.min.js +1 -0
- package/dist/c-6O5EVOPH.min.js +1 -0
- package/dist/c-74HEEZGK.min.js +1 -0
- package/dist/c-AKAF6JAD.min.js +1 -0
- package/dist/c-BBKITSXB.min.js +1 -0
- package/dist/c-BWNB6USU.min.js +1 -0
- package/dist/c-C25ENHIK.min.js +1 -0
- package/dist/c-CDR5AO3R.min.js +1 -0
- package/dist/c-COHXCW3Q.min.js +1 -0
- package/dist/{chunk-scatterplotMatrixBrushOverlay-SDIZSN66.module.min.js → c-DADXPJXV.min.js} +0 -1
- package/dist/c-E3JFRRMI.min.js +1 -0
- package/dist/c-EBFPQHHO.min.js +1 -0
- package/dist/c-G36WS6LN.min.js +1 -0
- package/dist/c-GIKRQI4X.min.js +1 -0
- package/dist/c-GPYOFETM.min.js +1 -0
- package/dist/c-IDUHYYSI.min.js +1 -0
- package/dist/{chunk-chunk-FQPKOAIH.module.min.js → c-IUHFPMHD.min.js} +0 -1
- package/dist/c-J5G56TUH.min.js +1 -0
- package/dist/c-JAZ73J32.min.js +1 -0
- package/dist/c-KG3NXHAL.min.js +1 -0
- package/dist/c-KII3PLZE.min.js +1 -0
- package/dist/c-LIXGXMNS.min.js +1 -0
- package/dist/c-LVEY6D6B.min.js +1 -0
- package/dist/c-M4Y3BHFR.min.js +1 -0
- package/dist/c-MAIICR2Z.min.js +1 -0
- package/dist/c-MG5DM6VE.min.js +1 -0
- package/dist/{chunk-minimapBrushOverlay-JU57U7NM.module.min.js → c-MNF2S4AA.min.js} +0 -1
- package/dist/c-MT3WBK7M.min.js +1 -0
- package/dist/c-NY3JWV2K.min.js +1 -0
- package/dist/c-O6U6K4CW.min.js +1 -0
- package/dist/c-OCI56QF2.min.js +1 -0
- package/dist/c-OQ7M4AGV.min.js +1 -0
- package/dist/c-OXYMVK7Q.min.js +1 -0
- package/dist/c-PPWDL5ZI.min.js +1 -0
- package/dist/c-QHF5YON3.min.js +1 -0
- package/dist/c-RR3GO5SW.min.js +1 -0
- package/dist/{chunk-chunk-J5QD4RAM.module.min.js → c-RSVIHIQ4.min.js} +0 -1
- package/dist/{chunk-chunk-EMO5NUGE.module.min.js → c-S2BXNNJN.min.js} +0 -1
- package/dist/{chunk-chunk-YCQYG6J5.module.min.js → c-SLGMUBUL.min.js} +0 -1
- package/dist/c-SUILCHWU.min.js +1 -0
- package/dist/c-TZW3JGJ5.min.js +1 -0
- package/dist/c-US5ZFT6E.min.js +1 -0
- package/dist/{chunk-chunk-RZH7VZYS.module.min.js → c-USFMFKIH.min.js} +0 -1
- package/dist/c-UUKVD4WB.min.js +1 -0
- package/dist/{chunk-chunk-SV4XAZ3Q.module.min.js → c-VGW3VG3I.min.js} +0 -1
- package/dist/c-W3CE4A4S.min.js +1 -0
- package/dist/{chunk-chunk-2NVFEB7P.module.min.js → c-WJCD5EUY.min.js} +0 -1
- package/dist/{chunk-chunk-2JGJ5GUG.module.min.js → c-X5UBGU2V.min.js} +0 -1
- package/dist/c-YDAY2WFR.min.js +1 -0
- package/dist/c-ZOWWU34K.min.js +1 -0
- package/dist/components/AccessibleNavTree.d.ts +1 -1
- package/dist/components/CategoryColors.d.ts +1 -1
- package/dist/components/GradientLegend.d.ts +14 -0
- package/dist/components/Legend.d.ts +2 -7
- package/dist/components/LinkedCharts.d.ts +1 -1
- package/dist/components/MobileAnnotationCalloutList.d.ts +1 -1
- package/dist/components/ObservationReadout.d.ts +45 -0
- package/dist/components/ThemeProvider.d.ts +4 -4
- package/dist/components/Tooltip/FlippingTooltip.d.ts +5 -7
- package/dist/components/Tooltip/Tooltip.d.ts +30 -5
- package/dist/components/Tooltip/tooltipChrome.d.ts +43 -0
- package/dist/components/ai/chartCapabilityTypes.d.ts +86 -2
- package/dist/components/ai/chartClinic.d.ts +2 -0
- package/dist/components/ai/deriveProfileFields.d.ts +40 -0
- package/dist/components/ai/evaluateChart.d.ts +85 -0
- package/dist/components/ai/fieldPolicy.d.ts +7 -0
- package/dist/components/ai/fieldRoles.d.ts +24 -0
- package/dist/components/ai/generativeChart.d.ts +18 -2
- package/dist/components/ai/inferIntent.d.ts +26 -2
- package/dist/components/ai/intents.d.ts +35 -0
- package/dist/components/ai/navigationTree.d.ts +2 -2
- package/dist/components/ai/observedSceneAudit.d.ts +2 -1
- package/dist/components/ai/profileData.d.ts +11 -0
- package/dist/components/ai/repairChartConfig.d.ts +2 -3
- package/dist/components/ai/semanticEvidence.d.ts +4 -0
- package/dist/components/ai/semanticViability.d.ts +11 -0
- package/dist/components/ai/semanticViabilityRegistry.d.ts +5 -0
- package/dist/components/ai/streamingTypes.d.ts +4 -0
- package/dist/components/ai/suggestCharts.d.ts +5 -6
- package/dist/components/ai/suggestDashboard.d.ts +2 -3
- package/dist/components/ai/suggestStreamCharts.d.ts +1 -1
- package/dist/components/ai/suggestStretchCharts.d.ts +2 -3
- package/dist/components/ai/suggestionPropContracts.d.ts +20 -0
- package/dist/components/ai/variantDiscovery.d.ts +3 -1
- package/dist/components/charts/custom/NetworkCustomChart.d.ts +3 -0
- package/dist/components/charts/custom/OrdinalCustomChart.d.ts +3 -0
- package/dist/components/charts/custom/XYCustomChart.d.ts +1 -1
- package/dist/components/charts/geo/ChoroplethMap.d.ts +3 -1
- package/dist/components/charts/geo/DistanceCartogram.d.ts +2 -7
- package/dist/components/charts/geo/cartogramOverlay.d.ts +28 -0
- package/dist/components/charts/index.d.ts +4 -3
- package/dist/components/charts/network/ProcessSankey.d.ts +2 -136
- package/dist/components/charts/network/ProcessSankeyProps.d.ts +139 -0
- package/dist/components/charts/network/Treemap.d.ts +2 -1
- package/dist/components/charts/network/processSankey/boundaryHubOrdering.d.ts +23 -0
- package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +2 -0
- package/dist/components/charts/network/processSankey/ordering.d.ts +3 -41
- package/dist/components/charts/network/processSankey/orderingTypes.d.ts +32 -0
- package/dist/components/charts/network/processSankey/packing.d.ts +1 -1
- package/dist/components/charts/network/processSankey/packingCache.d.ts +1 -1
- package/dist/components/charts/network/processSankey/packingOptimization.d.ts +72 -0
- package/dist/components/charts/ordinal/BarChart.d.ts +4 -3
- package/dist/components/charts/ordinal/FunnelChart.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -2
- package/dist/components/charts/ordinal/StackedBarChart.d.ts +4 -3
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +2 -2
- package/dist/components/charts/physics/GaltonBoardChart.d.ts +2 -9
- package/dist/components/charts/physics/GauntletChart.d.ts +10 -41
- package/dist/components/charts/physics/ProcessFlowChart.d.ts +1 -1
- package/dist/components/charts/physics/chainReactionAccessibleTable.d.ts +9 -0
- package/dist/components/charts/physics/chainReactionRuntime.d.ts +2 -1
- package/dist/components/charts/physics/chainReactionTypes.d.ts +5 -1
- package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +2 -2
- package/dist/components/charts/physics/crucibleClone.d.ts +6 -0
- package/dist/components/charts/physics/crucibleEffects.d.ts +1 -2
- package/dist/components/charts/physics/crucibleRecord.d.ts +7 -0
- package/dist/components/charts/physics/gauntletChrome.d.ts +4 -4
- package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
- package/dist/components/charts/physics/gauntletPublic.d.ts +4 -0
- package/dist/components/charts/physics/packetFlowOverlay.d.ts +7 -0
- package/dist/components/charts/physics/physicsChartLayout.d.ts +8 -0
- package/dist/components/charts/physics/physicsChartShared.d.ts +3 -1
- package/dist/components/charts/physics/physicsChartUtils.d.ts +1 -1
- package/dist/components/charts/physics/physicsHocUtils.d.ts +25 -12
- package/dist/components/charts/physics/physicsProjectionOverlays.d.ts +24 -0
- package/dist/components/charts/physics/processFlowOverlays.d.ts +9 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +15 -12
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +10 -7
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +35 -14
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +21 -14
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +20 -13
- package/dist/components/charts/realtime/aggregate.d.ts +4 -1
- package/dist/components/charts/realtime/eventTime.d.ts +4 -0
- package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +27 -0
- package/dist/components/charts/realtime/realtimeChartTypes.d.ts +30 -0
- package/dist/components/charts/realtime/useRealtimeCategoryColors.d.ts +30 -0
- package/dist/components/charts/shared/FrameTextAnnotationSVG.d.ts +10 -0
- package/dist/components/charts/shared/annotationActivation.d.ts +3 -7
- package/dist/components/charts/shared/annotationBandFill.d.ts +6 -0
- package/dist/components/charts/shared/annotationDispatch.d.ts +31 -0
- package/dist/components/charts/shared/annotationIdentity.d.ts +8 -0
- package/dist/components/charts/shared/annotationRules.d.ts +1 -15
- package/dist/components/charts/shared/boundedCategoryRegistry.d.ts +8 -0
- package/dist/components/charts/shared/chainReactionChartSpec.d.ts +3 -0
- package/dist/components/charts/shared/chartMode.d.ts +3 -2
- package/dist/components/charts/shared/chartSpecCore.d.ts +1 -0
- package/dist/components/charts/shared/frameTextAnnotation.d.ts +63 -0
- package/dist/components/charts/shared/gradient.d.ts +16 -0
- package/dist/components/charts/shared/hatchFill.d.ts +15 -0
- package/dist/components/charts/shared/hooks.d.ts +4 -4
- package/dist/components/charts/shared/legendUtils.d.ts +1 -0
- package/dist/components/charts/shared/streamPropsHelpers.d.ts +2 -1
- package/dist/components/charts/shared/styleRules.d.ts +9 -2
- package/dist/components/charts/shared/styleRulesWireSchema.d.ts +353 -0
- package/dist/components/charts/shared/types.d.ts +18 -9
- package/dist/components/charts/shared/useChartLegend.d.ts +43 -9
- package/dist/components/charts/shared/useChartSetup.d.ts +3 -1
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +5 -2
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +5 -1
- package/dist/components/charts/shared/useOrdinalBrush.d.ts +3 -3
- package/dist/components/charts/shared/useStreamingLegend.d.ts +6 -1
- package/dist/components/charts/value/types.d.ts +1 -1
- package/dist/components/charts/xy/BubbleChart.d.ts +1 -1
- package/dist/components/charts/xy/BumpChart.capability.d.ts +14 -1
- package/dist/components/charts/xy/BumpChart.d.ts +13 -73
- package/dist/components/charts/xy/BumpChart.semanticViability.d.ts +5 -0
- package/dist/components/charts/xy/CandlestickChart.d.ts +2 -2
- package/dist/components/charts/xy/LineChart.d.ts +2 -2
- package/dist/components/charts/xy/Scatterplot.d.ts +1 -1
- package/dist/components/charts/xy/bumpData.d.ts +44 -0
- package/dist/components/charts/xy/bumpIdentity.d.ts +2 -0
- package/dist/components/charts/xy/bumpLayout.d.ts +45 -0
- package/dist/components/charts/xy/bumpTooltip.d.ts +20 -0
- package/dist/components/legendLayout.d.ts +131 -4
- package/dist/components/realtime/ReorderBuffer.d.ts +2 -0
- package/dist/components/realtime/types.d.ts +10 -1
- package/dist/components/recipes/balanceSnapshotsToFlows.d.ts +42 -0
- package/dist/components/recipes/directedReachability.d.ts +14 -0
- package/dist/components/recipes/gofishDisplayListFixtures.generated.d.ts +6 -6
- package/dist/components/recipes/gridObservatory.d.ts +1 -1
- package/dist/components/recipes/networkAnalysis.d.ts +1 -18
- package/dist/components/recipes/physics.d.ts +7 -4
- package/dist/components/recipes/processPhysics.d.ts +0 -1
- package/dist/components/recipes/waffle.d.ts +7 -4
- package/dist/components/semiotic-ai-core.d.ts +13 -4
- package/dist/components/semiotic-ai-observations.d.ts +3 -0
- package/dist/components/semiotic-ai.d.ts +16 -9
- package/dist/components/semiotic-client-shared.d.ts +10 -0
- package/dist/components/semiotic-experimental.d.ts +1 -1
- package/dist/components/semiotic-geo.d.ts +4 -1
- package/dist/components/semiotic-network.d.ts +7 -4
- package/dist/components/semiotic-ordinal.d.ts +4 -1
- package/dist/components/semiotic-physics.d.ts +11 -4
- package/dist/components/semiotic-realtime-core.d.ts +11 -4
- package/dist/components/semiotic-realtime-react.d.ts +4 -3
- package/dist/components/semiotic-realtime.d.ts +3 -1
- package/dist/components/semiotic-recipes-core.d.ts +7 -5
- package/dist/components/semiotic-server-edge.d.ts +3 -2
- package/dist/components/semiotic-server.d.ts +3 -2
- package/dist/components/semiotic-themes-core.d.ts +5 -48
- package/dist/components/semiotic-utils-core.d.ts +10 -5
- package/dist/components/semiotic-utils-react.d.ts +2 -0
- package/dist/components/semiotic-utils.d.ts +1 -1
- package/dist/components/semiotic-xy.d.ts +4 -1
- package/dist/components/semiotic.d.ts +68 -26
- package/dist/components/server/animatedGif.d.ts +1 -1
- package/dist/components/server/renderEvidence.d.ts +25 -2
- package/dist/components/server/renderToStaticSVG.d.ts +15 -7
- package/dist/components/server/serverChartConfigShared.d.ts +8 -1
- package/dist/components/server/serverChartConfigs.d.ts +1 -0
- package/dist/components/server/serverChartConfigsNetwork.d.ts +3 -3
- package/dist/components/server/serverChartConfigsNetworkChord.d.ts +2 -0
- package/dist/components/server/serverChartConfigsNetworkForce.d.ts +2 -0
- package/dist/components/server/serverChartConfigsNetworkHierarchy.d.ts +3 -0
- package/dist/components/server/serverChartConfigsXY.d.ts +3 -3
- package/dist/components/server/serverChartConfigsXYBubble.d.ts +5 -0
- package/dist/components/server/serverChartConfigsXYBump.d.ts +7 -0
- package/dist/components/server/serverChartConfigsXYScatter.d.ts +5 -0
- package/dist/components/server/staticAnnotationFallbacks.d.ts +10 -0
- package/dist/components/server/staticAnnotations.d.ts +28 -1
- package/dist/components/server/staticAxisTickLabel.d.ts +13 -0
- package/dist/components/server/staticLegend.d.ts +1 -1
- package/dist/components/server/staticLegendMargin.d.ts +41 -0
- package/dist/components/server/staticOrdinal.d.ts +8 -2
- package/dist/components/server/staticPhysics.d.ts +13 -1
- package/dist/components/server/staticPhysicsChrome.d.ts +20 -0
- package/dist/components/server/staticRawLegend.d.ts +15 -0
- package/dist/components/server/staticSVGChrome.d.ts +16 -55
- package/dist/components/server/staticXYAxes.d.ts +27 -0
- package/dist/components/server/staticXYAxisTicks.d.ts +39 -0
- package/dist/components/server/staticXYGrid.d.ts +11 -0
- package/dist/components/server/themeResolver.d.ts +5 -1
- package/dist/components/store/ThemeStore.d.ts +2 -98
- package/dist/components/store/designTokens.d.ts +1 -1
- package/dist/components/store/themeCSSVariables.d.ts +10 -0
- package/dist/components/store/themeCore.d.ts +91 -0
- package/dist/components/store/themePresets.d.ts +81 -0
- package/dist/components/store/themeSerialization.d.ts +2 -1
- package/dist/components/stream/AccessibleDataTable.d.ts +12 -14
- package/dist/components/stream/AccessibleTablePortalImpl.d.ts +6 -0
- package/dist/components/stream/GeoTileRenderer.d.ts +2 -0
- package/dist/components/stream/NetworkCanvasHitTester.d.ts +3 -1
- package/dist/components/stream/NetworkSSRFrame.d.ts +2 -1
- package/dist/components/stream/NetworkSVGOverlay.d.ts +3 -31
- package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -0
- package/dist/components/stream/SVGChartTitle.d.ts +9 -0
- package/dist/components/stream/SVGOverlay.d.ts +1 -21
- package/dist/components/stream/SVGUnderlay.d.ts +24 -0
- package/dist/components/stream/SceneToSVG.d.ts +1 -1
- package/dist/components/stream/StreamGeoFrame.d.ts +1 -1
- package/dist/components/stream/StreamOrdinalFrame.d.ts +1 -1
- package/dist/components/stream/StreamXYFrame.d.ts +1 -1
- package/dist/components/stream/accessibleDataRows.d.ts +11 -0
- package/dist/components/stream/accessibleDataTableModel.d.ts +40 -0
- package/dist/components/stream/accessibleTableTypes.d.ts +11 -0
- package/dist/components/stream/axisTickUtils.d.ts +19 -0
- package/dist/components/stream/canvasBackground.d.ts +10 -0
- package/dist/components/stream/canvasSetup.d.ts +9 -0
- package/dist/components/stream/frameCursorInteraction.d.ts +25 -0
- package/dist/components/stream/frameDefaultMargins.d.ts +37 -0
- package/dist/components/stream/frameGraphics.d.ts +18 -0
- package/dist/components/stream/frameGraphicsSubscription.d.ts +26 -0
- package/dist/components/stream/frameLegendOptions.d.ts +18 -0
- package/dist/components/stream/geoFrameCursorInteraction.d.ts +9 -0
- package/dist/components/stream/geoFrameHelpers.d.ts +29 -1
- package/dist/components/stream/geoTypes.d.ts +10 -11
- package/dist/components/stream/hitTarget.d.ts +61 -2
- package/dist/components/stream/moduleWorkerSession.d.ts +6 -0
- package/dist/components/stream/networkAnnotationAnchors.d.ts +37 -0
- package/dist/components/stream/networkCustomLayout.d.ts +2 -2
- package/dist/components/stream/networkFrameCursorInteraction.d.ts +12 -0
- package/dist/components/stream/networkFrameInteraction.d.ts +2 -0
- package/dist/components/stream/networkFramePaint.d.ts +7 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +1 -1
- package/dist/components/stream/networkTypes.d.ts +30 -32
- package/dist/components/stream/normalizeXYData.d.ts +7 -0
- package/dist/components/stream/ordinalFrameCursorInteraction.d.ts +7 -0
- package/dist/components/stream/ordinalFrameInteraction.d.ts +29 -0
- package/dist/components/stream/ordinalSceneSVG.d.ts +10 -0
- package/dist/components/stream/ordinalTypes.d.ts +10 -4
- package/dist/components/stream/physics/PhysicsBodySpatialIndex.d.ts +9 -1
- package/dist/components/stream/physics/PhysicsCanvasTheme.d.ts +25 -0
- package/dist/components/stream/physics/PhysicsControllers.d.ts +0 -3
- package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +4 -1
- package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +3 -24
- package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +9 -21
- package/dist/components/stream/physics/PhysicsSettledSVGElement.d.ts +37 -0
- package/dist/components/stream/physics/PhysicsSettledScene.d.ts +7 -3
- package/dist/components/stream/physics/StreamPhysicsFrame.d.ts +1 -1
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +23 -4
- package/dist/components/stream/physics/physicsAnnotationContext.d.ts +19 -0
- package/dist/components/stream/physics/physicsBodyCanvas.d.ts +4 -0
- package/dist/components/stream/physics/physicsSettledChrome.d.ts +7 -0
- package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +32 -0
- package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +36 -0
- package/dist/components/stream/pipelineConfig.d.ts +6 -17
- package/dist/components/stream/pipelineDomainResolution.d.ts +1 -1
- package/dist/components/stream/renderBackend.d.ts +2 -0
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +13 -2
- package/dist/components/stream/renderers/resolveCSSColor.d.ts +7 -0
- package/dist/components/stream/responsiveSize.d.ts +17 -0
- package/dist/components/stream/sceneCursor.d.ts +41 -0
- package/dist/components/stream/sceneRevisionDiagnostics.d.ts +1 -1
- package/dist/components/stream/svgOverlayUtils.d.ts +22 -1
- package/dist/components/stream/types.d.ts +25 -12
- package/dist/components/stream/useCanvasFrameHost.d.ts +3 -1
- package/dist/components/stream/useFrame.d.ts +24 -1
- package/dist/components/stream/useResponsiveSize.d.ts +6 -1
- package/dist/components/stream/useStalenessCheck.d.ts +1 -1
- package/dist/components/stream/xyFrameAxisTypes.d.ts +15 -4
- package/dist/components/stream/xyFrameCursorInteraction.d.ts +6 -0
- package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +1 -1
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -26
- package/dist/components/types/legendTypes.d.ts +6 -0
- package/dist/components/types/marginType.d.ts +7 -8
- 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.module.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/processSankeyLayoutWorker.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/rough.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-ai-core.d.ts +13 -4
- 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 +16 -9
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1 -0
- package/dist/semiotic-client-glyph.module.min.js +2 -0
- package/dist/semiotic-client-responsive.module.min.js +2 -0
- package/dist/semiotic-client-shared.module.min.js +2 -0
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +2 -0
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +2 -0
- package/dist/semiotic-experimental-node.module.min.js +2 -0
- package/dist/semiotic-experimental-react-shared.module.min.js +2 -0
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-experimental.d.ts +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 -1
- package/dist/semiotic-network.d.ts +7 -4
- package/dist/semiotic-ordinal.d.ts +4 -1
- package/dist/semiotic-physics.d.ts +11 -4
- package/dist/semiotic-realtime-core.d.ts +11 -4
- package/dist/semiotic-realtime-core.min.js +2 -1
- package/dist/semiotic-realtime-core.module.min.js +2 -1
- package/dist/semiotic-realtime-react.d.ts +4 -3
- package/dist/semiotic-realtime-react.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-realtime.d.ts +3 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -0
- package/dist/semiotic-recipes-core.d.ts +7 -5
- package/dist/semiotic-recipes-core.min.js +9 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-geo-cjs.min.js +1 -0
- 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 +7 -1
- package/dist/semiotic-recipes.module.min.js +2 -1
- package/dist/semiotic-server-edge-node.module.min.js +1 -0
- package/dist/semiotic-server-edge.d.ts +3 -2
- 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-server.d.ts +3 -2
- package/dist/semiotic-themes-core.d.ts +5 -48
- 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 +10 -5
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils-react.d.ts +2 -0
- package/dist/semiotic-utils-react.min.js +1 -1
- package/dist/semiotic-utils-react.module.min.js +1 -1
- package/dist/semiotic-utils.d.ts +1 -1
- package/dist/semiotic-utils.min.js +2 -1
- package/dist/semiotic-utils.module.min.js +2 -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 -1
- package/dist/semiotic.d.ts +68 -26
- 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/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +53 -19
- package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +0 -20
- package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +0 -2
- package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +0 -1
- package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +0 -2
- package/dist/chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js +0 -2
- package/dist/chunk-chunk-2B3AIKUZ.module.min.js +0 -2
- package/dist/chunk-chunk-2CXCXRB4.module.min.js +0 -1
- package/dist/chunk-chunk-2X3FJCME.module.min.js +0 -1
- package/dist/chunk-chunk-2ZHHWZQM.module.min.js +0 -2
- package/dist/chunk-chunk-4ITOQRXM.module.min.js +0 -2
- package/dist/chunk-chunk-5UKL5W76.module.min.js +0 -2
- package/dist/chunk-chunk-5VVNW5AZ.module.min.js +0 -1
- package/dist/chunk-chunk-5ZON5NMV.module.min.js +0 -2
- package/dist/chunk-chunk-66PCWJUG.module.min.js +0 -1
- package/dist/chunk-chunk-6S3YGYW7.module.min.js +0 -1
- package/dist/chunk-chunk-6V5VQVCT.module.min.js +0 -2
- package/dist/chunk-chunk-7C5EDZ3Z.module.min.js +0 -2
- package/dist/chunk-chunk-A3I4HBD5.module.min.js +0 -1
- package/dist/chunk-chunk-ACLDBMRH.module.min.js +0 -2
- package/dist/chunk-chunk-AFQHURLO.module.min.js +0 -2
- package/dist/chunk-chunk-DDB4TLQG.module.min.js +0 -2
- package/dist/chunk-chunk-DTH3SUOU.module.min.js +0 -2
- package/dist/chunk-chunk-DTSNLGRK.module.min.js +0 -2
- package/dist/chunk-chunk-DVCWU7MT.module.min.js +0 -2
- package/dist/chunk-chunk-FEPXDKJP.module.min.js +0 -1
- package/dist/chunk-chunk-FJ76HWQZ.module.min.js +0 -1
- package/dist/chunk-chunk-FSIHAW6L.module.min.js +0 -2
- package/dist/chunk-chunk-G2RGVEYY.module.min.js +0 -2
- package/dist/chunk-chunk-G75OPF5N.module.min.js +0 -2
- package/dist/chunk-chunk-HADHLMY5.module.min.js +0 -1
- package/dist/chunk-chunk-HAJVODLO.module.min.js +0 -2
- package/dist/chunk-chunk-HBFA4NN6.module.min.js +0 -1
- package/dist/chunk-chunk-HIV7AW2V.module.min.js +0 -2
- package/dist/chunk-chunk-IY7RYD4S.module.min.js +0 -1
- package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
- package/dist/chunk-chunk-J3XWETBJ.module.min.js +0 -2
- package/dist/chunk-chunk-JZAMMSQQ.module.min.js +0 -2
- package/dist/chunk-chunk-KTWEBFMX.module.min.js +0 -2
- package/dist/chunk-chunk-LSJUXBMF.module.min.js +0 -1
- package/dist/chunk-chunk-MXMRXSCI.module.min.js +0 -2
- package/dist/chunk-chunk-MXVBXFKW.module.min.js +0 -2
- package/dist/chunk-chunk-NWIGA3UK.module.min.js +0 -1
- package/dist/chunk-chunk-OFAP623Y.module.min.js +0 -2
- package/dist/chunk-chunk-OHLRAEQZ.module.min.js +0 -2
- package/dist/chunk-chunk-OZK46A5U.module.min.js +0 -1
- package/dist/chunk-chunk-PMR47KRY.module.min.js +0 -2
- package/dist/chunk-chunk-PRNXOCYZ.module.min.js +0 -2
- package/dist/chunk-chunk-Q2YADC2V.module.min.js +0 -2
- package/dist/chunk-chunk-RLKZVJMQ.module.min.js +0 -2
- package/dist/chunk-chunk-ROP4HI7H.module.min.js +0 -2
- package/dist/chunk-chunk-SK2TQMG4.module.min.js +0 -2
- package/dist/chunk-chunk-SKLYXNYW.module.min.js +0 -2
- package/dist/chunk-chunk-TCMHJWFJ.module.min.js +0 -1
- package/dist/chunk-chunk-TSCFL235.module.min.js +0 -1
- package/dist/chunk-chunk-U4NZCU5T.module.min.js +0 -2
- package/dist/chunk-chunk-U66USBWU.module.min.js +0 -1
- package/dist/chunk-chunk-UOQRPGPK.module.min.js +0 -2
- package/dist/chunk-chunk-VKL6DI43.module.min.js +0 -2
- package/dist/chunk-chunk-W62673ZE.module.min.js +0 -1
- package/dist/chunk-chunk-WFHZHWT7.module.min.js +0 -1
- package/dist/chunk-chunk-XCC25CZZ.module.min.js +0 -2
- package/dist/chunk-chunk-XECNOUZY.module.min.js +0 -2
- package/dist/chunk-chunk-XYZDTYAF.module.min.js +0 -2
- package/dist/chunk-chunk-YHNZCPOZ.module.min.js +0 -2
- package/dist/chunk-chunk-YWZB3KPI.module.min.js +0 -2
- package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +0 -2
- package/dist/components/stream/test-utils/frameScheduler.d.ts +0 -12
- package/dist/components/stream/test-utils/revisionConsumption.d.ts +0 -13
- package/dist/test-utils/canvasMock.d.ts +0 -86
- package/dist/test-utils/capturedFrameProps.d.ts +0 -67
- package/dist/test-utils/frameMock.d.ts +0 -81
- package/dist/test-utils/ordinalFixtures.d.ts +0 -48
- /package/dist/{chunk-chunk-JJ2OOIET.module.min.js → c-GGISSW5E.min.js} +0 -0
- /package/dist/{chunk-chunk-SIRIJ3DY.module.min.js → c-N4G2L7ID.min.js} +0 -0
- /package/dist/{chunk-chunk-CA3YDW6F.module.min.js → c-S6U5CGT5.min.js} +0 -0
- /package/dist/components/recipes/{mobileAnnotationStrategy.d.ts → mobileAnnotationBehavior.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useChartSetup as t,useCustomChartScaffold as e}from"./c-3KZD6AXJ.min.js";import{lineCanvasRenderer as n,resolveNodeColor as i}from"./c-ZOWWU34K.min.js";import{RingBuffer as o,compactTimestampBufferForRemoval as r,computePulseIntensity as s,hasActivePulses as a,pointCanvasRenderer as c,pushWithTimestamp as l,refreshIdlePulse as u,setPulseState as h,useGeoKeyboardNavigation as d,useLegendCategoryEmission as p,useSemanticFrameInteractions as f}from"./c-MG5DM6VE.min.js";import{needsDataCanvasPaint as g,needsInteractionCanvasPaint as m}from"./c-OCI56QF2.min.js";import{StalenessBadge as y,attachUpdateResultStore as v,buildBaseMetadataProps as b,buildCustomBehaviorProps as w,composeOverlays as R,computeDecayOpacity as P,createCustomLayoutFailureDiagnostic as x,filterAnnotationsByStatus as S,findHitPointInQuadtree as C,formatVal as L,getHitRadius as A,glyphCanvasRenderer as k,paintCanvasBackground as D,paintSceneWithBackend as M,renderPathPulse as j,renderSceneWithBackend as T,resolveFrameGraphics as B,resolveFrameLayers as _,shouldHandleFramePointer as I,useConfigSync as E,useLayoutSelectionSync as N,useStableShallow as F,useStalenessCheck as O,warnCustomLayoutDiagnostics as W}from"./c-GPYOFETM.min.js";import{wrapWithCustomLayoutSelection as z}from"./c-G36WS6LN.min.js";import{buildResolveColor as H,resolveCustomLayoutPalette as G}from"./c-J5G56TUH.min.js";import{AccessibleDataTable as q,AccessibleTablePortal as Z,AriaLiveTooltip as Y,CanvasFrameBackground as X,FlippingTooltip as Q,FocusRing as U,STREAMING_PALETTE as $,SVGChartTitle as V,SafeRender as K,SceneRevisionDiagnosticsObserver as J,ScreenReaderSummary as tt,SkipToTableLink as et,UpdateResultTracker as nt,annotationLayout as it,coerceCanvasFill as ot,computeCanvasAriaLabel as rt,computeEasing as st,computeRawProgress as at,createDefaultAnnotationRules as ct,defaultTooltipStyle as lt,filterSparseArray as ut,geoSceneNodeToSVG as ht,getDevicePixelRatio as dt,getPointerHitRadius as pt,glyphHitGeometry as ft,isAnnotationActivationTarget as gt,isServerEnvironment as mt,lerp as yt,normalizeTooltip as vt,now as bt,observationInputType as wt,prepareCanvas as Rt,rehitCanvasMarkCursor as Pt,renderAnnotationPass as xt,renderLegendFromConfig as St,resolveCSSColor as Ct,sceneHasAuthoredCursor as Lt,sceneMarkCursor as At,setCanvasMarkCursor as kt,smartTooltipEntries as Dt,useAnnotationActivationOptions as Mt,useCanvasMarkCursorCleanup as jt,useFrame as Tt,useFrameCanvasHost as Bt,useHydration as _t,useSceneRevisionDiagnostics as It,useWasHydratingFromSSR as Et}from"./c-GIKRQI4X.min.js";import{resolveThemeSemanticColors as Nt}from"./c-YDAY2WFR.min.js";import{getMax as Ft}from"./c-WJCD5EUY.min.js";import{forwardRef as Ot,memo as Wt,useCallback as zt,useEffect as Ht,useImperativeHandle as Gt,useMemo as qt,useRef as Zt,useState as Yt}from"react";import{geoPath as Xt}from"d3-geo";import{quadtree as Qt}from"d3-quadtree";import{geoMercator as Ut,geoEqualEarth as $t,geoAlbersUsa as Vt,geoOrthographic as Kt,geoNaturalEarth1 as Jt,geoEquirectangular as te}from"d3-geo";var ee={mercator:Ut,equalEarth:$t,albersUsa:Vt,orthographic:Kt,naturalEarth:Jt,equirectangular:te};function ne(t,e){return t?"function"==typeof t?t:e=>e[t]:t=>t[e]}function ie(t){return t?"function"==typeof t?t:e=>e[t]:t=>t.coordinates||t.data||[]}function oe(t,e,n){return t?"function"==typeof t?{...n,...t(e)}:{...n,...t}:{...n}}function re(t,e){if(2>t.length)return[t];const n=.4*e,i=[];let o=[t[0]];for(let e=1;t.length>e;e++){const r=t[e];Math.abs(r[0]-t[e-1][0])>n?(2>o.length||i.push(o),o=[r]):o.push(r)}return 2>o.length||i.push(o),i}function se(t,e,n=24){const i=e[0]-t[0],o=e[1]-t[1],r=Math.sqrt(i*i+o*o);if(0===r)return[t,e];const s=-o/r,a=i/r,c=Math.min(.3*r,80),l=(t[0]+e[0])/2+s*c,u=(t[1]+e[1])/2+a*c,h=[];for(let i=0;n>=i;i++){const o=i/n,r=1-o;h.push([r*r*t[0]+2*r*o*l+o*o*e[0],r*r*t[1]+2*r*o*u+o*o*e[1]])}return h}function ae(t,e){if(2>t.length)return t;const n=e/2+1,i=[];for(let e=0;t.length>e;e++){const o=t[e];let r,s;0===e?(r=t[1][0]-o[0],s=t[1][1]-o[1]):e===t.length-1?(r=o[0]-t[e-1][0],s=o[1]-t[e-1][1]):(r=t[e+1][0]-t[e-1][0],s=t[e+1][1]-t[e-1][1]);const a=Math.sqrt(r*r+s*s)||1;i.push([o[0]+s/a*n,o[1]+-r/a*n])}return i}function ce(t,e,n,i,o){const r=e[0]-t[0],s=e[1]-t[1],a=Math.sqrt(r*r+s*s);if(0===a)return[t,e];const c=s/a,l=-r/a,u=o/2+1;return[[t[0]+c*u,t[1]+l*u],[e[0]+c*u,e[1]+l*u]]}import{scaleLinear as le}from"d3-scale";var ue=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],he=["scene-style","data-paint","accessibility","evidence"],de=(t,e)=>({retainedData:t,invalidations:e}),pe=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],fe=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],ge=["scene-geometry","data-paint","accessibility","evidence"],me=["scene-style","data-paint","accessibility","evidence"],ye=["overlay","accessibility","evidence"],ve=[],be={xAccessor:de("rebuild",pe),yAccessor:de("rebuild",pe),lineDataAccessor:de("rebuild",pe),pointIdAccessor:de("rebuild",ge),lineIdAccessor:de("rebuild",ge),windowSize:de("rebuild",pe),projection:de("preserve",fe),projectionExtent:de("preserve",fe),fitPadding:de("preserve",fe),lineType:de("preserve",fe),flowStyle:de("preserve",fe),graticule:de("preserve",fe),projectionTransform:de("preserve",fe),customLayout:de("preserve",fe),layoutConfig:de("preserve",fe),layoutMargin:de("preserve",fe),areaStyle:de("preserve",me),pointStyle:de("preserve",["scene-geometry","scene-style","data-paint","accessibility","evidence"]),lineStyle:de("preserve",me),colorScheme:de("preserve",me),themeCategorical:de("preserve",me),themeDiverging:de("preserve",me),themeSemantic:de("preserve",me),themeSequential:de("preserve",me),decay:de("preserve",me),pulse:de("preserve",me),layoutSelection:de("preserve",me),annotations:de("preserve",ye),autoPlaceAnnotations:de("preserve",ye),clock:de("preserve",ve),transition:de("preserve",ve),introAnimation:de("preserve",ve),onLayoutError:de("preserve",ve)},we=de("preserve",fe),Re=class{constructor(){this.tracker=new nt}get last(){return this.tracker.last}subscribe(t){return this.tracker.subscribe(t)}recordData(t,e){return this.tracker.record({kind:t,...void 0===e?{}:{count:e}},ue)}recordNoop(t){return this.tracker.record({kind:t,..."restyle"===t?{}:{count:0}},[])}recordRestyle(t){return t?this.tracker.record({kind:"restyle"},he):this.recordNoop("restyle")}recordConfig(t,e={}){const n=function(t){let e="preserve";const n=new Set;for(const i of t){const t=be[i]??we;"rebuild"===t.retainedData&&(e="rebuild");for(const e of t.invalidations)n.add(e)}return{retainedData:e,invalidations:n}}(t),i=new Set(n.invalidations);return e.retainedDataChanged&&i.add("data"),this.tracker.record({kind:"config",keys:t},i)}};import{geoDistance as Pe,geoGraticule as xe,geoInterpolate as Se}from"d3-geo";function Ce(t){if(null==t)return 0;if("number"==typeof t&&Number.isFinite(t)&&t>=0&&.5>t)return t;throw new RangeError(`[semiotic] fitPadding must be a finite fraction in [0, 0.5); received ${t+""}.`)}var Le=class t{constructor(t){this.updateResults=new Re,this.scene=[],this.scales=null,this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._customLayoutFailedThisBuild=!1,this._quadtree=null,this._maxPointRadius=0,this.projection=null,this.geoPath=null,this.baseScale=0,this.baseTranslate=[0,0],this.baseRotation=[0,0,0],this.currentZoom=1,this.cartogramLayout=null,this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.streaming=!1,this.lastIngestTime=0,this.timestampBuffer=null,this.activeTransition=null,this.prevPositions=null,this._hasRenderedOnce=!1,this.config=function(t){return{...t,fitPadding:Ce(t.fitPadding)}}(t)}currentTime(){return this.config.clock?.()??bt()}getConfiguredWindowSize(){const t=this.config.windowSize??500;if(!Number.isInteger(t)||1>t)throw Error("GeoPipelineStore windowSize must be a positive integer");return t}retainNewestLines(t=this.getConfiguredWindowSize()){this.lineData.length>t&&(this.lineData=this.lineData.slice(-t))}resizeStreamingWindow(t){if(this.pointBuffer){const e=this.pointBuffer.toArray(),n=this.timestampBuffer?.toArray()??[],i=e.slice(-t),r=n.slice(-i.length),s=this.currentTime();this.pointBuffer=new o(t),this.timestampBuffer=new o(t),i.forEach((t,e)=>{this.pointBuffer.push(t),this.timestampBuffer.push(r[e]??s)})}this.retainNewestLines(t)}updateConfig(t){const e=function(t){return"fitPadding"in t?{...t,fitPadding:Ce(t.fitPadding)}:t}(t),n=this.config,i=this.getConfiguredWindowSize(),o=Object.keys(e).filter(t=>e[t]!==n[t]);this.config={...this.config,...e};const r=this.getConfiguredWindowSize(),s=this.streaming&&r!==i;s&&(this.resizeStreamingWindow(r),this.version++),"customLayout"in e&&!e.customLayout&&(this.lastCustomLayoutFailure=null),this.updateResults.recordConfig(o,{retainedDataChanged:s})}updateConfigWithResult(t){return this.updateConfig(t),this.updateResults.last}setAreas(t){this.areas=t,this.updateResults.recordData("replace",t.length)}setAreasWithResult(t){return this.setAreas(t),this.updateResults.last}setPoints(t){this.pointData=t.slice(),this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.updateResults.recordData("replace",t.length)}setPointsWithResult(t){return this.setPoints(t),this.updateResults.last}setLines(t){this.lineData=t.slice(),this.streaming&&this.retainNewestLines(),this.updateResults.recordData("replace",t.length)}setLinesWithResult(t){return this.setLines(t),this.updateResults.last}initStreaming(t){void 0!==t&&t!==this.config.windowSize&&(this.config={...this.config,windowSize:t});const e=this.getConfiguredWindowSize(),n=this.pointBuffer?this.pointBuffer.toArray():this.pointData,i=this.timestampBuffer?.toArray()??[],r=n.slice(-e),s=i.slice(-r.length),a=this.currentTime();this.pointBuffer=new o(e),this.timestampBuffer=new o(e),r.forEach((t,e)=>{this.pointBuffer.push(t),this.timestampBuffer.push(s[e]??a)}),this.pointData=[],this.retainNewestLines(e),this.streaming=!0}pushPoint(t){this.pointBuffer||this.initStreaming();const e=this.currentTime();l(this.pointBuffer,t,this.timestampBuffer,e),this.lastIngestTime=e,this.updateResults.recordData("ingest",1)}pushPointWithResult(t){return this.pushPoint(t),this.updateResults.last}pushMany(t){this.pointBuffer||this.initStreaming();const e=this.currentTime();for(const n of t)l(this.pointBuffer,n,this.timestampBuffer,e);this.lastIngestTime=e,this.updateResults.recordData("ingest",t.length)}pushManyWithResult(t){return this.pushMany(t),this.updateResults.last}pushLine(t){null!=t&&"object"==typeof t?(this.streaming||this.initStreaming(),this.lineData.push(t),this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",1)):this.updateResults.recordNoop("ingest")}pushManyLines(t){if(!Array.isArray(t)||0===t.length)return void this.updateResults.recordNoop("ingest");const e=t.filter(t=>null!=t&&"object"==typeof t);if(0!==e.length){this.streaming||this.initStreaming();for(const t of e)this.lineData.push(t);this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",e.length)}else this.updateResults.recordNoop("ingest")}removeLine(t){const{lineIdAccessor:e}=this.config;if(!e)throw Error("removeLine() requires lineIdAccessor to be configured");const n="function"==typeof e?e:t=>t[e],i=new Set(Array.isArray(t)?t:[t]),o=[];return this.lineData=this.lineData.filter(t=>!i.has(n(t)+"")||(o.push(t),!1)),o.length>0?(this.version++,this.updateResults.recordData("remove",o.length)):this.updateResults.recordNoop("remove"),o}getLines(){return this.lineData.slice()}removePoint(t){const{pointIdAccessor:e}=this.config;if(!e)throw Error("removePoint() requires pointIdAccessor to be configured");const n="function"==typeof e?e:t=>t[e],i=new Set(Array.isArray(t)?t:[t]);if(this.streaming&&this.pointBuffer){const t=t=>i.has(n(t)+"");r(this.pointBuffer,this.timestampBuffer,t);const e=this.pointBuffer.remove(t);return e.length>0?(this.version++,this.updateResults.recordData("remove",e.length)):this.updateResults.recordNoop("remove"),e}{const t=[];return this.pointData=this.pointData.filter(e=>!i.has(n(e)+"")||(t.push(e),!1)),t.length>0?(this.version++,this.updateResults.recordData("remove",t.length)):this.updateResults.recordNoop("remove"),t}}clear(){this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.scene=[],this.scales=null,this._hasRenderedOnce=!1,this.activeTransition=null,this.prevPositions=null,this._quadtree=null,this._maxPointRadius=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._customLayoutFailedThisBuild=!1,this.version++,this.updateResults.recordData("clear")}restyleScene(t){const e=this._customRestyle;if(e){for(const n of this.scene){const i=this._baseStyles.get(n)??n.style,o=e(n,t);n.style=o?{...i,...o}:i}this.markStylePaintPending(),this.updateResults.recordRestyle(!0)}else this.updateResults.recordRestyle(!1)}computeScene(t){const{config:e}=this,n=this.projection,i=this.geoPath,o=this.scales,r=this.baseScale,s=[...this.baseTranslate],a=[...this.baseRotation],c=this.scene;this.projection=function(t){if(!t)return $t();if("string"==typeof t){const e=ee[t];return e?e():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${t}", falling back to equalEarth`),$t())}if("object"==typeof t&&"type"in t){const e=ee[t.type],n=e?e():$t();return t.rotate&&"rotate"in n&&n.rotate(t.rotate),t.center&&"center"in n&&n.center(t.center),n}return t}(e.projection),this.geoPath=Xt(this.projection),this.fitProjection(t),this.geoPath=Xt(this.projection);const l=this.projection;this.scales={projection:l,geoPath:this.geoPath,projectedPoint:(t,e)=>l([t,e]),invertedPoint:(t,e)=>l.invert?l.invert([t,e]):null},this._customLayoutFailedThisBuild=!1;const u=this.buildSceneNodes(t);if(this._customLayoutFailedThisBuild)!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.projection=n,this.geoPath=i,this.scales=o,this.baseScale=r,this.baseTranslate=s,this.baseRotation=a):(this.scene=[],this.rebuildQuadtree());else{if(this.scene=u,this.rebuildQuadtree(),e.projectionTransform&&this.applyCartogramTransform(e.projectionTransform,t),e.decay&&this.streaming&&this.applyDecay(),e.pulse&&this.streaming&&this.applyPulse(),e.transition&&!this._hasRenderedOnce&&this.scene.length>0&&e.introAnimation){const e=t.width/2,n=t.height/2,i=this.scene.filter(t=>"point"===t.type).map(t=>({...t,x:e,y:n}));i.length>0&&this.startTransition(i)}this._hasRenderedOnce=!0,e.transition&&c.length>0&&this.startTransition(c),this.version++}}fitProjection(t){const e=this.projection,n=this.config,i=[...this.areas],o=ne(n.xAccessor,"lon"),r=ne(n.yAccessor,"lat"),s=this.getPoints();if(s.length>0){const t=s.map(t=>[o(t),r(t)]);i.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:t}})}const a=ie(n.lineDataAccessor);for(const t of this.lineData){const e=a(t);if(e&&e.length>0){const t=e.map(t=>[o(t),r(t)]);i.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:t}})}}if(0!==i.length){if(n.projectionExtent){const[[i,o],[r,s]]=n.projectionExtent;e.fitExtent([[0,0],[t.width,t.height]],{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[i,o],[i,s],[r,s],[r,o],[i,o]]]}})}else if(e.clipAngle&&(e.clipAngle()??0)>0){const i=n.fitPadding??0,o=Math.min(t.width,t.height);e.scale(o/2-o*i),e.translate([t.width/2,t.height/2])}else{const o=n.fitPadding??0,r=t.width*o,s=t.height*o;e.fitExtent([[r,s],[t.width-r,t.height-s]],{type:"FeatureCollection",features:i})}this.baseScale=e.scale(),this.baseTranslate=e.translate(),this.baseRotation=e.rotate?.()??[0,0,0]}}applyZoomTransform(t,e){const n=this.projection;if(!n)return;const i=this.geoPath,o=this.scales,r=n.scale(),s=[...n.translate()],a=this.currentZoom;n.scale(this.baseScale*t.k),n.translate([this.baseTranslate[0]*t.k+t.x,this.baseTranslate[1]*t.k+t.y]),this.currentZoom=t.k,this.geoPath=Xt(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(t,e)=>n([t,e]),invertedPoint:(t,e)=>n.invert?n.invert([t,e]):null},this._customLayoutFailedThisBuild=!1;const c=this.buildSceneNodes(e);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.scale(r),n.translate(s),this.currentZoom=a,this.geoPath=i,this.scales=o):(this.scene=[],this.rebuildQuadtree()):(this.scene=c,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,e),this.version++)}applyZoomScale(t,e){const n=this.projection;if(!n)return;const i=this.geoPath,o=this.scales,r=n.scale(),s=[...n.translate()],a=this.currentZoom;n.scale(this.baseScale*t),n.translate(this.baseTranslate),this.currentZoom=t,this.geoPath=Xt(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(t,e)=>n([t,e]),invertedPoint:(t,e)=>n.invert?n.invert([t,e]):null},this._customLayoutFailedThisBuild=!1;const c=this.buildSceneNodes(e);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.scale(r),n.translate(s),this.currentZoom=a,this.geoPath=i,this.scales=o):(this.scene=[],this.rebuildQuadtree()):(this.scene=c,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,e),this.version++)}applyRotation(t,e){const n=this.projection;if(!n||!n.rotate)return;const i=this.geoPath,o=this.scales,r=[...n.rotate()];n.rotate(t),this.geoPath=Xt(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(t,e)=>n([t,e]),invertedPoint:(t,e)=>n.invert?n.invert([t,e]):null},this._customLayoutFailedThisBuild=!1;const s=this.buildSceneNodes(e);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.rotate(r),this.geoPath=i,this.scales=o):(this.scene=[],this.rebuildQuadtree()):(this.scene=s,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,e),this.version++)}setRotation(t){const e=this.projection;e&&e.rotate&&e.rotate(t)}hasProjection(){return null!=this.projection}getRotation(){return this.projection?.rotate?.()??this.baseRotation}getBaseProjectionState(){return{scale:this.baseScale,translate:[...this.baseTranslate]}}getPoints(){return this.streaming&&this.pointBuffer?this.pointBuffer.toArray():this.pointData}rebuildQuadtree(){let e=0,n=0;for(const t of this.scene)"point"===t.type&&!1!==t.interactive&&(n++,t.r>e&&(e=t.r));if(this._maxPointRadius=e,t.QUADTREE_THRESHOLD>=n)return void(this._quadtree=null);const i=Array(n);let o=0;for(const t of this.scene)"point"===t.type&&!1!==t.interactive&&(i[o++]=t);this._quadtree=Qt().x(t=>t.x).y(t=>t.y).addAll(i)}get quadtree(){return this._quadtree}get maxPointRadius(){return this._maxPointRadius}buildSceneNodes(t){this._customLayoutFailedThisBuild=!1;const{config:e}=this,n=this.projection,i=this.geoPath;if(e.customLayout&&this.scales){const n=e.layoutMargin??{top:0,right:0,bottom:0,left:0},i=G(e.colorScheme,e.themeCategorical,$),o={areas:this.areas.slice(),points:this.getPoints().slice(),lines:this.lineData.slice(),scales:this.scales,dimensions:{width:t.width,height:t.height,margin:n,plot:{x:0,y:0,width:t.width,height:t.height}},theme:{semantic:e.themeSemantic??{},categorical:[...i]},resolveColor:H(i,e.colorScheme),config:e.layoutConfig??{},selection:e.layoutSelection??null};let r;try{r=e.customLayout(o)}catch(t){const n=null!==this.lastCustomLayoutResult,i=x("geo",t,n,this.version);this.lastCustomLayoutFailure=i,this._customLayoutFailedThisBuild=!0,"production"!==process.env.NODE_ENV&&console.error("[semiotic] geo customLayout threw:",t);try{e.onLayoutError?.(i)}catch(t){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",t)}return n?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[])}const s=r.nodes??[];if(this.customLayoutOverlays=r.overlays??null,this.lastCustomLayoutResult=r,this.lastCustomLayoutFailure=null,this._customRestyle=r.restyle,this.hasCustomRestyle=!!r.restyle,this._baseStyles=new WeakMap,this.hasCustomRestyle){for(const t of s)this._baseStyles.set(t,t.style);this.restyleScene(e.layoutSelection??null)}return W({label:"geo customLayout",nodes:s,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),s}return this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,function({config:t,projection:e,path:n,areas:i,points:o,lines:r,layout:s}){const a=ne(t.xAccessor,"lon"),c=ne(t.yAccessor,"lat"),l=[],u=function(t){return{fill:t.themeSemantic?.surface||"#e0e0e0",stroke:t.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}(t),h=function(t){return{stroke:t.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}(t),d=function(t){return{fill:t.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}(t);if(t.graticule){const e=!0===t.graticule?{}:t.graticule,i=xe();e.step&&i.step(e.step);const o=n(i())||"";o&&l.push({type:"geoarea",pathData:o,centroid:[s.width/2,s.height/2],bounds:[[0,0],[s.width,s.height]],screenArea:0,style:{fill:"none",stroke:e.stroke||"#e0e0e0",strokeWidth:e.strokeWidth??.5,strokeDasharray:e.strokeDasharray||"2,2"},datum:null,interactive:!1})}for(const e of i){const i=n(e);if(!i)continue;const o=n.centroid(e),r=n.bounds(e),s=n.area(e);l.push({type:"geoarea",pathData:i,centroid:o,bounds:r,screenArea:s,style:oe(t.areaStyle,e,u),datum:e,interactive:!0})}const p=ie(t.lineDataAccessor);for(const n of r){const i=p(n);if(!i||2>i.length)continue;let o=[];if("geo"===t.lineType){const t=Array(i.length);for(let e=0;i.length>e;e++)t[e]=[a(i[e]),c(i[e])];for(let n=0;t.length-1>n;n++){const i=t[n],r=t[n+1],s=Pe(i,r)||0,a=Math.max(2,Math.ceil(s/(Math.PI/180))),c=Se(i,r);for(let t=0;a>=t;t++){if(n>0&&0===t)continue;const i=e(c(t/a));null!=i&&o.push(i)}}}else for(let t=0;i.length>t;t++){const n=i[t],r=e([a(n),c(n)]);null!=r&&o.push(r)}if(2>o.length)continue;const r=oe(t.lineStyle,n,h),u="number"==typeof r.strokeWidth?r.strokeWidth:1;2!==i.length||2>o.length||"arc"!==t.flowStyle?2!==i.length||2>o.length||"offset"!==t.flowStyle||(o="geo"===t.lineType?ae(o,u):ce(o[0],o[o.length-1],0,0,u)):o=se(o[0],o[o.length-1]);const d=re(o,s.width);if(d.length>1)for(const t of d)2>t.length||l.push({type:"line",path:t,style:{...r,_edgeFade:!0},datum:n});else l.push({type:"line",path:2>o.length&&d[0]||o,style:r,datum:n})}const f=t.pointIdAccessor?"function"==typeof t.pointIdAccessor?t.pointIdAccessor:e=>e[t.pointIdAccessor]:null,g=e.clipAngle?e.clipAngle()??0:0,m=g>0?g*Math.PI/180:null,y=e.rotate?e.rotate():[0,0,0],v="function"==typeof e.center?e.center():[0,0],b=[(v[0]??0)-y[0],(v[1]??0)-y[1]];for(const n of o){const i=a(n),o=c(n);if(null!=m&&Pe([i,o],b)>m)continue;const r=e([i,o]);if(!r)continue;const s=t.pointStyle?t.pointStyle(n):{...d},u={type:"point",x:r[0],y:r[1],r:s.r||4,style:s,datum:n,pointId:f?f(n)+"":void 0};l.push(u)}return l}({config:e,projection:n,path:i,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:t})}applyCartogramTransform(t,e){const n=function(t,e,n,i){const o=t.filter(t=>"point"===t.type);if(2>o.length)return null;const r=e.strength??1,s=Number.isFinite(r)?Math.max(0,Math.min(1,r)):1,a="strip"===e.layout?"strip":"radial";if("radial"===a&&0===s)return null;const c=e.centerAccessor?"function"==typeof e.centerAccessor?e.centerAccessor:t=>t[e.centerAccessor]:t=>t.id,l="function"==typeof e.costAccessor?e.costAccessor:t=>t[e.costAccessor],u=o.find(t=>t.datum&&c(t.datum)+""==e.center+"");if(!u)return"production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Distance cartogram center "${e.center}" not found in point data`),null;const h=o.map(t=>t.datum?Number(l(t.datum)):NaN).filter(t=>isFinite(t)&&t>=0),d=Ft(h,1);i>0&&"production"!==process.env.NODE_ENV&&console.warn("GeoFrame: Distance cartogram does not support area rendering. Areas will be ignored. Remove areas or set projectionTransform to null to render them.");for(let e=t.length-1;e>=0;e--){const n=t[e];"geoarea"===n.type&&n.interactive&&t.splice(e,1)}const p="strip"===a?function(t,e,n,i,o){const r=Math.max(3,Math.min(8,.35*o.height)),s=Math.max(1,o.width-2*r),a=o.height/2,c=le().domain([0,i]).range([0,s]);e.x=r,e.y=a;const l=[];for(const o of t){if(o===e)continue;if(!o.datum){o.x=r,o.y=a;continue}const t=Number(n(o.datum)),s=r+(isFinite(t)&&t>=0&&i>0?c(t):0);o.x=s,o.y=a,l.push({node:o,x:s})}l.sort((t,e)=>t.x-e.x);const u=Math.max(0,Math.min(o.height/2-1,6));let h=0;for(;l.length>h;){let t=h+1;for(;l.length>t&&3>Math.abs(l[t].x-l[h].x);)t++;const e=t-h;if(e>1&&u>0)for(let t=0;e>t;t++)l[h+t].node.y=a+(t-(e-1)/2)*Math.min(2.5,2*u/Math.max(1,e-1));h=t}return{cx:r,cy:a,maxCost:i,availableRadius:s,layout:"strip"}}(o,u,l,d,n):function(t,e,n,i,o,r){const s=e.x,a=e.y,c=r.width/2,l=r.height/2,u=Math.min(r.width,r.height)/2,h=le().domain([0,i]).range([0,u]);for(const r of t){if(r===e)continue;if(!r.datum)continue;const t=r.x,u=r.y,d=Math.atan2(u-a,t-s),p=Math.hypot(t-s,u-a),f=Number(n(r.datum)),g=isFinite(f)&&f>=0?i>0?h(f):0:p,m=c+Math.cos(d)*g,y=l+Math.sin(d)*g;r.x=t+(m-t)*o,r.y=u+(y-u)*o}return e.x=s+(c-s)*o,e.y=a+(l-a)*o,{cx:e.x,cy:e.y,maxCost:i,availableRadius:u,layout:"radial"}}(o,u,l,d,s,n),f=t.filter(t=>"line"===t.type);if(f.length>0){const t=new Map;for(const e of o)null!=e.pointId&&t.set(e.pointId+"",[e.x,e.y]);for(const n of f){const i=n.datum?.source,o=n.datum?.target;if(null!=i&&null!=o){const r=t.get(i+""),s=t.get(o+"");if(r&&s)if("fractional"===e.lineMode&&n.path.length>2){const t=n.path[0],e=n.path[n.path.length-1],i=[r[0]-t[0],r[1]-t[1]],o=[s[0]-e[0],s[1]-e[1]],a=[0];for(let t=1;n.path.length>t;t++)a.push(a[t-1]+Math.hypot(n.path[t][0]-n.path[t-1][0],n.path[t][1]-n.path[t-1][1]));const c=a[a.length-1];n.path=n.path.map((t,e)=>{const r=c>0?a[e]/c:e/(n.path.length-1);return[t[0]+i[0]*(1-r)+o[0]*r,t[1]+i[1]*(1-r)+o[1]*r]})}else n.path=[r,s]}}}return p}(this.scene,t,e,this.areas.length);n&&(this.cartogramLayout=n)}applyDecay(){const t=this.config.decay;if(!t||!this.pointBuffer)return;const e=this.pointBuffer.size;if(0===e)return;const n=this.scene.filter(t=>"point"===t.type);for(let i=0;n.length>i;i++){const o=P(t,i,e);n[i]._decayOpacity=o,n[i].style={...n[i].style,opacity:o}}}applyPulse(t=this.currentTime()){const e=this.config.pulse;if(!e||!this.timestampBuffer)return!1;const n=this.scene.filter(t=>"point"===t.type),i=this.timestampBuffer.toArray(),o=e.color||"rgba(255,255,255,0.6)",r=e.glowRadius??4;let a=!1;for(let c=0;n.length>c&&i.length>c;c++){const l=s(e,i[c],t);a=h(n[c],l,o,r)||a}return a}refreshPulse(t){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(t)}hasActivePulsesAt(t){return!!this.config.pulse&&a(this.config.pulse,this.timestampBuffer,t)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}startTransition(t){const e=this.config.transition?.duration??300;if(0>=e)return;const n=new Map;for(const e of t)"point"===e.type&&e.pointId&&n.set(e.pointId,[e.x,e.y]);const i=this.scene.filter(t=>"point"===t.type);let o=!1;for(const t of i)if(t.pointId){const e=n.get(t.pointId);e&&(t._targetX=t.x,t._targetY=t.y,t.x=e[0],t.y=e[1],(Math.abs(e[0]-t._targetX)>.5||Math.abs(e[1]-t._targetY)>.5)&&(o=!0))}for(const t of i)t.pointId&&!n.has(t.pointId)&&(t._targetOpacity=t.style?.opacity??t.style?.fillOpacity??1,t.style={...t.style,opacity:0},o=!0);o&&(this.activeTransition={startTime:this.currentTime(),duration:e})}cancelIntroAnimation(){this.activeTransition=null;for(const t of this.scene)"point"===t.type&&(null!=t._targetOpacity&&(t.style={...t.style,opacity:t._targetOpacity},t._targetOpacity=void 0),null!=t._targetX&&(t.x=t._targetX,t.y=t._targetY,t._targetX=void 0,t._targetY=void 0))}advanceTransition(t){if(!this.activeTransition)return!1;const e=at(t,this.activeTransition),n=st(e),i=this.scene.filter(t=>"point"===t.type);for(const t of i){if(null!=t._targetX&&null!=t._targetY){const e=t.y;t.x=yt(t.x,t._targetX,n),t.y=yt(e,t._targetY,n)}null!=t._targetOpacity&&(t.style={...t.style,opacity:t._targetOpacity*n})}if(e>=1){for(const t of i)null!=t._targetX&&(t.x=t._targetX,t.y=t._targetY,t._targetX=void 0,t._targetY=void 0),null!=t._targetOpacity&&(t.style={...t.style,opacity:t._targetOpacity},t._targetOpacity=void 0);return this.activeTransition=null,!1}return!0}};Le.QUADTREE_THRESHOLD=500;var Ae=Le;function ke(t,e,n,i,o,r,s=0,a=i){if(r){const t=C(r,e,n,i,s);if(t&&!1!==t.node.interactive)return t}else{let o=null,r=1/0;for(const s of t){if("point"!==s.type)continue;if(!1===s.interactive)continue;const t=s.x-e,a=s.y-n,c=Math.sqrt(t*t+a*a);A(s.r,i)>=c&&r>c&&(o=s,r=c)}if(o)return{node:o,distance:r}}let c=null,l=1/0;for(const o of t){if("glyph"!==o.type)continue;if(null==o.datum)continue;const t=ft(o.glyph,o.size),r=o.x+t.centerDx-e,s=o.y+t.centerDy-n,a=Math.sqrt(r*r+s*s);A(t.radius,i)>=a&&l>a&&(c=o,l=a)}if(c)return{node:c,distance:l};for(let i=t.length-1;i>=0;i--){const r=t[i];if("geoarea"!==r.type)continue;const s=r;if(!1===s.interactive)continue;const[[a,c],[l,u]]=s.bounds;if(!(a>e||e>l||c>n||n>u)&&(s._cachedPath2D||(s._cachedPath2D=new Path2D(s.pathData)),o.isPointInPath(s._cachedPath2D,e,n)))return{node:s,distance:0}}let u=null,h=1/0;for(const i of t){if("line"!==i.type)continue;const t=i,{path:o}=t,r=Math.max((t.style.strokeWidth??2)+4,5,a);for(let i=0;o.length-1>i;i++){const[s,a]=o[i],[c,l]=o[i+1],d=De(e,n,s,a,c,l);r>=d&&h>d&&(u=t,h=d)}}return u?{node:u,distance:h}:null}function De(t,e,n,i,o,r){const s=o-n,a=r-i,c=s*s+a*a;if(0===c)return Math.sqrt((t-n)**2+(e-i)**2);let l=((t-n)*s+(e-i)*a)/c;return l=Math.max(0,Math.min(1,l)),Math.sqrt((t-(n+l*s))**2+(e-(i+l*a))**2)}v(Ae);import{useMemo as Me,useRef as je}from"react";import{jsx as Te,jsxs as Be}from"react/jsx-runtime";function _e(t){const{width:e,height:n,totalWidth:i,totalHeight:o,margin:r,showAxes:s,title:a,legend:c,legendHoverBehavior:l,legendClickBehavior:u,legendHighlightedCategory:h,legendIsolatedCategories:d,legendPosition:p,legendLayout:f,foregroundGraphics:g,annotations:m,onAnnotationActivate:y,onObservation:v,chartId:b,chartType:w,autoPlaceAnnotations:R,svgAnnotationRules:P,pointNodes:x,geoProjection:C}=t,L=Mt({onAnnotationActivate:y,onObservation:v,chartId:b,chartType:w}),A=je([m?.length??0,new Map]),k=m?.length??0;A.current[0]!==k&&(A.current=[k,new Map]);const D=Me(()=>{if(!m||0===m.length)return null;const t=S(m),i=C?t.map(t=>{if(!Array.isArray(t.coordinates)||2>t.coordinates.length)return t;const e=C(Number(t.coordinates[0]),Number(t.coordinates[1]));return e?{...t,x:e[0],y:e[1]}:t}):t,o={scales:{x:t=>Number(t),y:t=>Number(t)},timeAxis:"x",width:e,height:n,frameType:"xy",pointNodes:x,stickyPositionCache:A.current[1]},r=R?it({annotations:i,context:o,..."object"==typeof R?R:{}}):i;return xt(r,ct("xy",L),P,o)},[m,R,P,e,n,x,L,C]);return s||a||c||g||D&&D.length>0?Be("svg",{role:"img",width:i,height:o,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[Te("title",{children:"string"==typeof a?a:"XY Chart"}),Te("desc",{children:"string"==typeof a?a+" (XY data visualization)":"XY data visualization"}),Be("g",{transform:"translate("+r.left+","+r.top+")",children:[D,g]}),Te(V,{title:a,totalWidth:i,marginTop:r.top}),St({legend:c,totalWidth:i,totalHeight:o,margin:r,legendPosition:p,title:a,legendLayout:f,legendHoverBehavior:l,legendClickBehavior:u,legendHighlightedCategory:h,legendIsolatedCategories:d})]}):null}import{zoom as Ie,zoomIdentity as Ee}from"d3-zoom";import{select as Ne}from"d3-selection";function Fe([t,e,n]){const i=1<<n;return[t-Math.floor(t/i)*i,e,n]}function Oe(t,e,n,i,o){return"function"==typeof t?t(e,n,i,o):t.replace("{z}",e+"").replace("{x}",n+"").replace("{y}",i+"").replace("{r}",o>1?"@2x":"")}var We=new WeakMap,ze=1;function He(t){return Number.isFinite(t)?Math.max(1,Math.floor(t)):256}var Ge=class{constructor(t=256){this.cache=new Map,this.limit=He(t)}setLimit(t){this.limit=He(t),this.cache.size>this.limit&&this.evict()}get(t){const e=this.cache.get(t);return e&&(e.lastUsed=performance.now()),e}set(t,e){this.cache.set(t,e),this.cache.size>this.limit&&this.evict()}evict(){for(;this.cache.size>this.limit;){let t,e=1/0;for(const[n,i]of this.cache)e>i.lastUsed&&(e=i.lastUsed,t=n);if(!t)break;{const e=this.cache.get(t);e&&(e.img.onload=null,e.img.onerror=null,e.img.src=""),this.cache.delete(t)}}}clear(){for(const t of this.cache.values())t.img.onload=null,t.img.onerror=null,t.img.src="";this.cache.clear()}};var qe=class{constructor(t){this.capacity=t,this.particles=Array(t);for(let e=0;t>e;e++)this.particles[e]={t:0,offset:0,lineIndex:0,active:!1,x:0,y:0}}spawn(t,e=Math.random){for(let n=0;this.capacity>n;n++){const i=this.particles[n];if(!i.active)return i.active=!0,i.t=0,i.offset=.6*(e()-.5),i.lineIndex=t,i.x=0,i.y=0,i}return null}step(t,e,n,i){for(let o=0;this.capacity>o;o++){const r=this.particles[o];if(!r.active)continue;const s=n[r.lineIndex];if(!s||2>s.length){r.active=!1;continue}if(r.t+=t*e,r.t>=1){r.active=!1;continue}const a=Ze(s),c=Ye(s,r.t*a),l=(i[r.lineIndex]||2)/2;r.x=c.x+c.nx*r.offset*l*2,r.y=c.y+c.ny*r.offset*l*2}}countForLine(t){let e=0;for(let n=0;this.capacity>n;n++)this.particles[n].active&&this.particles[n].lineIndex===t&&e++;return e}clear(){for(let t=0;this.capacity>t;t++)this.particles[t].active=!1}};function Ze(t){let e=0;for(let n=1;t.length>n;n++){const i=t[n][0]-t[n-1][0],o=t[n][1]-t[n-1][1];e+=Math.sqrt(i*i+o*o)}return e}function Ye(t,e){let n=0;for(let i=1;t.length>i;i++){const o=t[i][0]-t[i-1][0],r=t[i][1]-t[i-1][1],s=Math.sqrt(o*o+r*r);if(n+s>=e||i===t.length-1){const a=s>0?(e-n)/s:0,c=s>.001?s:1;return{x:t[i-1][0]+o*a,y:t[i-1][1]+r*a,nx:-r/c,ny:o/c}}n+=s}const i=t[t.length-1];return{x:i[0],y:i[1],nx:0,ny:0}}function Xe(t){if(!t)return;const e=[];for(const n of t)if("point"===n.type)e.push(n);else if("glyph"===n.type){const t=n,i=ft(t.glyph,t.size);e.push({pointId:t.pointId,x:t.x+i.centerDx,y:t.y+i.centerDy,r:i.radius})}return e}import{jsx as Qe,jsxs as Ue}from"react/jsx-runtime";function $e({data:t}){if(!t)return null;if(t.properties)return Qe("div",{className:"semiotic-tooltip",style:lt,children:Qe("div",{style:{fontWeight:600},children:t.properties.name||t.properties.NAME||t.properties.id||"Feature"})});const e=null!=t.data?t.data:t;if(!e||"object"!=typeof e)return null;const n=Dt(e),i=null!=n.title?n.title+"":null;return null==i&&0===n.entries.length?null:Ue("div",{className:"semiotic-tooltip",style:lt,children:[null!=i&&Qe("div",{style:{fontWeight:600,marginBottom:n.entries.length?2:0},children:i}),n.entries.map(t=>Ue("div",{children:[Ue("span",{style:{opacity:.7},children:[t.key,": "]}),Qe("span",{style:{fontWeight:600},children:L(t.value)})]},t.key))]})}$e.ownsChrome=!0;var Ve={top:10,right:10,bottom:10,left:10},Ke=null;function Je(){if(null!==Ke)return Ke;if("undefined"==typeof window)return!1;const t="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,e="undefined"!=typeof navigator&&"number"==typeof navigator.hardwareConcurrency&&4>=navigator.hardwareConcurrency,n="undefined"!=typeof navigator&&"number"==typeof navigator.deviceMemory&&4>=navigator.deviceMemory;return Ke=t||e||n}function tn(){return Je()?12:30}var en={width:28,height:28,border:"1px solid rgba(0,0,0,0.2)",borderRadius:4,background:"rgba(255,255,255,0.9)",color:"#333",fontSize:16,fontWeight:600,lineHeight:1,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,boxShadow:"0 1px 3px rgba(0,0,0,0.1)"};function nn(t){return"string"==typeof t?t:"object"==typeof t&&t&&"type"in t?t.type:null}function on(t){return t?t.getContext("2d"):null}function rn(t){const e=t.pointer.clientX-t.canvasRect.left-t.margin.left,n=t.pointer.clientY-t.canvasRect.top-t.margin.top;if(0>e||e>t.width||0>n||n>t.height)return{kind:"outside"};t.hitCanvasRef.current||(t.hitCanvasRef.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const i=on(t.hitCanvasRef.current);if(!i)return{kind:"unavailable"};const o=ke(t.scene,e,n,pt(30,t.pointer.pointerType),i,t.pointQuadtree,t.maxPointRadius,pt(6,t.pointer.pointerType));if(!o)return{kind:"miss"};const{node:r}=o,s=r.datum,a=Array.isArray(s)?null:s?.properties?s:s?.data||s,c="point"===r.type?r.x:"geoarea"===r.type?r.centroid[0]:e,l="point"===r.type?r.y:"geoarea"===r.type?r.centroid[1]:n;return{kind:"hit",node:r,hover:{...a,...a?.properties||{},data:a,properties:a?.properties,__semioticHoverData:!0,x:c,y:l}}}import*as sn from"react";import{useSyncExternalStore as an}from"react";function cn({graphics:t,size:e,margin:n,readScales:i,tracker:o}){return an(o.subscribe,o.getSnapshot,o.getSnapshot),sn.createElement(sn.Fragment,null,B(t,e,n,i()))}import{jsx as ln,jsxs as un}from"react/jsx-runtime";var hn=Wt(Ot(function(t,e){const{projection:o,projectionExtent:r,fitPadding:s,projectionTransform:a,areas:l,points:h,lines:v,customLayout:b,layoutConfig:w,layoutSelection:P,onLayoutError:x,xAccessor:S,yAccessor:C,lineDataAccessor:L,pointIdAccessor:A,lineIdAccessor:B,lineType:W="geo",flowStyle:H="basic",graticule:G,zoomable:$,zoomExtent:V,onZoom:K,dragRotate:nt,showParticles:it,particleStyle:st,tileURL:at,tileAttribution:ct,tileCacheSize:lt,size:ft,width:yt,height:vt,responsiveWidth:bt,responsiveHeight:xt,margin:St,className:Dt,background:Mt,maxDevicePixelRatio:Ft,windowSize:Ot=500,renderMode:Wt,areaStyle:Xt,pointStyle:Qt,lineStyle:Ut,colorScheme:$t,enableHover:Vt=!0,hoverAnnotation:Kt,tooltipContent:Jt,allowTooltipOverflow:te=!1,customClickBehavior:ee,customHoverBehavior:ne,onObservation:ie,annotationObservationCallback:oe,chartId:re,annotations:se,onAnnotationActivate:ae,autoPlaceAnnotations:ce,svgAnnotationRules:le,decay:ue,pulse:he,transition:de,animate:pe,staleness:fe,frameScheduler:ge,clock:me,random:ye,seed:ve,paused:be=!1,suspendWhenHidden:we=!0,backgroundGraphics:Re,foregroundGraphics:Pe,title:xe,legend:Se,legendPosition:Ce,legendLayout:Le,legendHoverBehavior:De,legendClickBehavior:Me,legendHighlightedCategory:je,legendIsolatedCategories:Te,legendCategoryAccessor:Be,onCategoriesChange:He,showAxes:Ze,accessibleTable:Ye=!0,description:Qe,summary:Ue}=t,{customHoverBehavior:Ke,customClickBehavior:an,hasClickBehavior:hn}=f({customHoverBehavior:ne,customClickBehavior:ee,onObservation:ie,chartId:re,chartType:"StreamGeoFrame"}),dn=ft||[yt||600,vt||400],pn=Zt(!0),fn=Tt({sizeProp:dn,responsiveWidth:bt,responsiveHeight:xt,userMargin:St,marginDefault:Ve,title:xe,legend:Se,legendPosition:Ce,legendLayout:Le,legendMarginReserved:t.__legendMarginReservedFor===Se,animate:pe,transitionProp:de,frameScheduler:ge,clock:me,random:ye,seed:ve,paused:be,suspendWhenHidden:we,themeDirtyRef:pn}),{reducedMotionRef:gn,responsiveRef:mn,size:yn,margin:vn,adjustedWidth:bn,adjustedHeight:wn,transition:Rn,introEnabled:Pn,tableId:xn,frameRuntime:Sn,rafRef:Cn,renderFnRef:Ln,scheduleRender:An,currentTheme:kn}=fn,Dn=_t(),Mn=Et(),jn=qt(()=>Array.isArray(l)?ut(l):l,[l]),Tn=qt(()=>ut(h),[h]),Bn=qt(()=>ut(v),[v]),_n=nt??"orthographic"===nn(o),In=qt(()=>({projection:o,projectionExtent:r,fitPadding:s,xAccessor:S,yAccessor:C,lineDataAccessor:L,lineType:W,flowStyle:H,areaStyle:Xt,pointStyle:Qt,lineStyle:Ut,colorScheme:$t,themeSemantic:Nt(kn),themeSequential:kn?.colors?.sequential,themeDiverging:kn?.colors?.diverging,themeCategorical:kn?.colors?.categorical,graticule:G,projectionTransform:a,windowSize:Ot,clock:Sn.now,decay:ue,pulse:he,transition:Rn,introAnimation:Pn,annotations:se,pointIdAccessor:A,lineIdAccessor:B,customLayout:b,layoutConfig:w,onLayoutError:x,layoutMargin:vn}),[o,r,s,S,C,L,W,H,Xt,Qt,Ut,$t,kn,G,a,Ot,Sn.now,ue,he,Rn,Pn,se,A,B,b,w,x,vn]),En=F(In),Nn=Zt(null);Nn.current||(Nn.current=new Ae(En));const Fn=Nn.current,On=Zt(null),Wn=On.current??(On.current=function(t){const e=new Set;let n=0,i=t;return{subscribe:t=>(e.add(t),()=>e.delete(t)),getSnapshot:()=>n,sync(t){if(t!==i){i=t,n+=1;for(const t of e)t()}}}}(Fn.scales)),zn=mt||!Dn&&Mn;zn&&(jn||h||v)&&(jn&&Fn.setAreas(jn),h&&Fn.setPoints(Tn),v&&Fn.setLines(Bn),Fn.computeScene({width:bn,height:wn}));const{resolvedForeground:Hn,resolvedBackground:Gn,themeBackground:qn,surfaceBackground:Zn}=function({tracker:t,readScales:e,...n}){const i=i=>"function"==typeof i?sn.createElement(cn,{graphics:i,size:n.size,margin:n.margin,readScales:e,tracker:t}):i;return{..._({...n,resolveScaleAwareGraphics:!1}),resolvedForeground:i(n.foregroundGraphics),resolvedBackground:i(n.backgroundGraphics)}}({foregroundGraphics:Pe,backgroundGraphics:Re,size:yn,margin:vn,scales:Fn.scales,background:Mt,themeBackgroundColor:kn.colors.background,tracker:Wn,readScales:()=>Fn.scales}),Yn=Zt(null),Xn=Zt(null),Qn=Zt(null);at&&!Qn.current&&(Qn.current=new Ge(lt??256)),Qn.current?.setLimit(lt??256);const Un=Zt(se),$n=Zt(null),Vn=Zt(Ee),Kn=Zt(!1),Jn=Zt(null),ti=zt(t=>{Jn.current=t,mn&&"object"==typeof mn&&(mn.current=t)},[mn]),ei=Zt(null),ni=Zt(null),ii=Zt(null),oi=Zt(0);if(it&&!ii.current){const t=st?.maxPerLine??tn();ii.current=new qe(50*t)}const ri=Zt(null),si=Zt(!1),ai=Zt(null),ci=Zt(!1),li=Zt(!1),ui=It("StreamGeoFrame"),hi=Zt(void 0),[di,pi]=Yt(null),[,fi]=Yt(0),gi=Zt(0),[mi,yi]=Yt(!1),vi=p(Nn,Be,He,t=>t.getPoints());E(Nn,En,pn,An),N(Nn,P,pn,An),Ht(()=>{const t=Nn.current;t&&(jn&&t.setAreas(jn),h&&t.setPoints(Tn),v&&t.setLines(Bn),pn.current=!0,An())},[jn,h,Tn,v,Bn,An]);const bi=zt(t=>{null!=t&&"object"==typeof t&&(Nn.current?.pushPoint(t),pn.current=!0,An())},[An]),wi=zt(t=>{const e=ut(t);0!==e.length&&(Nn.current?.pushMany(e),pn.current=!0,An())},[An]),Ri=zt(t=>{null!=t&&"object"==typeof t&&(Nn.current?.pushLine(t),pn.current=!0,An())},[An]),Pi=zt(t=>{const e=ut(t);0!==e.length&&(Nn.current?.pushManyLines(e),pn.current=!0,An())},[An]),xi=zt(()=>{Nn.current?.clear(),pn.current=!0,An()},[An]);Gt(e,()=>({push:bi,pushMany:wi,removePoint:t=>{const e=Nn.current?.removePoint(t)??[];return e.length>0&&(pn.current=!0,An()),e},pushLine:Ri,pushManyLines:Pi,removeLine:t=>{const e=Nn.current?.removeLine(t)??[];return e.length>0&&(pn.current=!0,An()),e},getLines:()=>Nn.current?.getLines()??[],clear:xi,getProjection:()=>Nn.current?.scales?.projection??null,getGeoPath:()=>Nn.current?.scales?.geoPath??null,getCartogramLayout:()=>Nn.current?.cartogramLayout??null,getCustomLayout:()=>Nn.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>Nn.current?.lastCustomLayoutFailure??null,getZoom:()=>Vn.current.k,resetZoom:()=>{const t=Jn.current;t&&$n.current&&Ne(t).call($n.current.transform,Ee)},getData:()=>Nn.current?.getPoints()??[]}),[bi,wi,Ri,Pi,xi,An]);const{hoverHandlerRef:Si,onPointerMove:Ci,onPointerLeave:Li,pointerStateRef:Ai}=fn,{canvasRef:ki,interactionCanvasRef:Di,resolutionDirtyRef:Mi}=Bt(fn,{hydrated:Dn,wasHydratingFromSSR:Mn,storeRef:Nn,dirtyRef:pn,cleanup:()=>Qn.current?.clear(),maxDevicePixelRatio:Ft,canvasPaintDependencies:[bn,wn,Mt,Re,Wt,at,lt,An]});Ht(()=>{Si.current=t=>{const e=ki.current;if(!e)return;const n=Nn.current;if(!n||!n.scene.length)return void kt(e);const i=rn({pointer:t,canvasRect:e.getBoundingClientRect(),margin:vn,width:bn,height:wn,scene:n.scene,pointQuadtree:n.quadtree,maxPointRadius:n.maxPointRadius,hitCanvasRef:Xn});kt(e,"hit"===i.kind?At(i.node):void 0),Vt&&!1!==Kt&&("hit"===i.kind?(ri.current=i.hover,ai.current=i.node,pi(i.hover),Ke?.(i.hover),An()):("outside"===i.kind||"miss"===i.kind&&ri.current)&&(ri.current=null,ai.current=null,pi(null),Ke?.(null),An()))}},[Vt,Kt,bn,wn,vn,Ke,An,Si,ki]),fn.hoverLeaveRef.current=()=>{kt(ki.current),Vt&&!1!==Kt&&(ri.current=null,ai.current=null,pi(null),Ke?.(null),An())},jt(ki);const ji=zt(t=>{if(gt(t.target))return;if(!an)return;const e=Nn.current;if(!e||!e.scene.length)return void an(null);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left-vn.left,o=t.clientY-n.top-vn.top;if(0>i||i>bn||0>o||o>wn)return void an(null);Xn.current||(Xn.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const r=on(Xn.current);if(!r)return void an(null);const s=pt(30,hi.current),a=pt(6,hi.current),c=ke(e.scene,i,o,s,r,e.quadtree,e.maxPointRadius,a);if(c){const t=c.node.datum,e=Array.isArray(t)?null:t?.properties?t:t?.data||t,n=e?.properties?{...e,...e.properties}:e;return void an({...n,data:e,properties:e?.properties,__semioticHoverData:!0,x:i,y:o,time:i,value:o},{type:"activate",inputType:wt(hi.current)})}an(null)},[wn,bn,an,vn]),{kbFocusIndexRef:Ti,focusedNavPointRef:Bi,onKeyDown:_i}=d({storeRef:Nn,hoverRef:ri,hoveredNodeRef:ai,setHoverPoint:pi,customHoverBehavior:Ke,customClickBehavior:an,scheduleRender:An}),Ii=zt(t=>{I(Ai,t,Vt&&!1!==Kt,si.current,ki.current)&&(hi.current=t.pointerType,Ti.current=-1,Bi.current=null,Ci(t))},[ki,Vt,Kt,Bi,Ti,Ci,Ai]),Ei=zt(t=>{hi.current=t.pointerType},[]);Ln.current=()=>{if(Cn.current=null,Wn.sync(Nn.current?.scales??null),!Sn.isActive)return;const t=ki.current,e=Nn.current;if(!t||!e)return;const o=Sn.now();let r=!1;const s=ni.current;let a=!1;s&&(ni.current=null,e.applyRotation(s,{width:bn,height:wn}),a=!0);const l=null!=e.activeTransition,h=e.advanceTransition(gn.current?o+1e6:o),d=!gn.current&&h,p=ui.current.beforeCompute(e.getLastUpdateResult(),d);let f=!1;if(pn.current&&!h){const t={width:bn,height:wn},n=e.hasProjection(),i=_n&&n?e.getRotation():null;e.computeScene(t);const o=Vn.current,r=1!==o.k||0!==o.x||0!==o.y;_n&&i?r?(e.setRotation(i),e.applyZoomScale(o.k,t)):e.applyRotation(i,t):r&&e.applyZoomTransform(o,t),pn.current=!1,f=!0,vi()}Wn.sync(e.scales),ui.current.afterCompute(p,f,!1);const y=dt(Ft),v=it&&!gn.current&&!!ii.current,b=e.consumeStylePaintPending();var w;(f||a||b)&&(si.current=Lt(e.scene),si.current||kt(t)),si.current&&(l||f||a||b)&&Pt((w={canvas:t,pointer:Ai.current,store:e,margin:vn,width:bn,height:wn,hitCanvasRef:Xn,geometryMoved:l||f||a}).canvas,w.pointer,t=>{const e=rn({pointer:t,canvasRect:w.canvas.getBoundingClientRect(),margin:w.margin,width:w.width,height:w.height,scene:w.store.scene,pointQuadtree:w.geometryMoved?null:w.store.quadtree,maxPointRadius:w.store.maxPointRadius,hitCanvasRef:w.hitCanvasRef});return"hit"===e.kind?At(e.node):void 0});const R=u(e,o,f,li),P=g({dirtyOrRebuilt:f,transitioning:l,continuous:v,liveEncoding:R.changed,forced:a||b||Mi.current});if(Mi.current=!1,at&&Qn.current){const t=Yn.current;if(t&&e.scales?.projection){const n=Rt(t,yn,vn,y);n&&(n.clearRect(-vn.left,-vn.top,yn[0],yn[1]),n.save(),n.beginPath(),n.rect(0,0,bn,wn),n.clip(),function(t,e){const{tileURL:n,projection:i,width:o,height:r,tileCache:s,onTileLoad:a,maxDevicePixelRatio:c}=e,l=i.scale(),u=i.translate(),h=function(t){const{size:e,scale:n,translate:i,clampX:o=!0,clampY:r=!0}=t,s=Math.max(Math.log(n)/Math.LN2-8,0),a=Math.round(s),c=1<<a,l=Math.pow(2,s-a+8),u=i[0]-n/2,h=i[1]-n/2,d=Math.max(o?0:-1/0,Math.floor((0-u)/l)),p=Math.min(o?c:1/0,Math.ceil((e[0]-u)/l)),f=Math.max(r?0:-1/0,Math.floor((0-h)/l)),g=Math.min(r?c:1/0,Math.ceil((e[1]-h)/l)),m=[];for(let t=f;g>t;++t)for(let e=d;p>e;++e)m.push([e,t,a]);return{tiles:m,translate:[u/l,h/l],scale:l}}({size:[o,r],scale:2*l*Math.PI,translate:u}),d=dt(c),p=function(t){if("string"==typeof t)return"template:"+t;const e=t;let n=We.get(e);return null==n&&(n=ze++,We.set(e,n)),"provider:"+n}(n);let f=!0;for(const e of h.tiles){const[i,o,r]=Fe(e),c=Oe(n,r,i,o,d),l=`${p}|dpr:${d}|${r}/${i}/${o}|${c}`;let u=s.get(l);if(!u){const t=new Image;t.crossOrigin="anonymous";const e={img:t,loaded:!1,failed:!1,key:l,lastUsed:performance.now()};s.set(l,e),t.onload=()=>{e.loaded=!0,a?.()},t.onerror=()=>{e.loaded=!0,e.failed=!0,a?.()},t.src=c,u=e}if(!u.loaded){f=!1;continue}if(u.failed)continue;const g=h.scale;t.drawImage(u.img,(e[0]+h.translate[0])*g-.5,(e[1]+h.translate[1])*g-.5,g+1,g+1)}}(n,{tileURL:at,projection:e.scales.projection,width:bn,height:wn,tileCache:Qn.current,maxDevicePixelRatio:Ft,onTileLoad:()=>An()}),n.restore())}}if(P){const i=Rt(t,yn,vn,y);if(!i)return;i.clearRect(-vn.left,-vn.top,yn[0],yn[1]),at||D(i,{background:Mt,themeBackground:qn,hasBackgroundGraphics:!!Re,x:-vn.left,y:-vn.top,width:yn[0],height:yn[1]}),i.save(),i.beginPath(),i.rect(0,0,bn,wn),i.clip();const s=e.scene,a=e.scales,l={width:bn,height:wn};if(M({context:i,nodes:s,renderMode:Wt,pixelRatio:y,paintBuiltIn:t=>{!function(t,e){const n=e.filter(t=>"geoarea"===t.type);for(const e of n){if(!e.pathData)continue;e._cachedPath2D||(e._cachedPath2D=new Path2D(e.pathData));const n=e._cachedPath2D,i=ot(t,e.style.fill)||"#e0e0e0";"none"!==i&&(t.fillStyle=i,t.globalAlpha=(e._decayOpacity??1)*(e.style.fillOpacity??1),t.fill(n));const o=e.style.strokeWidth??.5;if(e.style.stroke&&"none"!==e.style.stroke&&o>0){if(t.strokeStyle=Ct(t,e.style.stroke)||e.style.stroke,t.lineWidth=o,t.globalAlpha=e._decayOpacity??1,e.style.strokeDasharray){const n=e.style.strokeDasharray.split(",").map(Number);t.setLineDash(n)}else t.setLineDash([]);t.stroke(n)}j(t,e,n),t.globalAlpha=1,t.setLineDash([])}}(i,t),n(i,t,a,l),c(i,t,a,l),k(i,t,a,l)}}),v&&ii.current){const t=ii.current,e=s.filter(t=>"line"===t.type);if(e.length>0){const n=st||{},s=.3*(n.speedMultiplier??1),a=n.maxPerLine??tn(),c=n.spawnRate??(Je()?.06:.15),l=n.radius??2,u=n.opacity??.7,h=o/1e3,d=oi.current>0?Math.min(h-oi.current,.1):.016;oi.current=h;const p=e.map(t=>t.path),f=e.map(t=>t.style.strokeWidth??2);for(let n=0;e.length>n;n++)Sn.random()<c&&t.countForLine(n)<a&&t.spawn(n,Sn.random);t.step(d,s,p,f),i.globalAlpha=u;for(let o=0;t.particles.length>o;o++){const r=t.particles[o];if(!r.active)continue;const s=e[r.lineIndex],a="function"==typeof n.color?n.color(s?.datum??{}):"source"!==n.color&&n.color?n.color:s?.style.stroke||"#fff";i.beginPath(),i.arc(r.x,r.y,l,0,2*Math.PI),i.fillStyle=a,i.fill()}i.globalAlpha=1,r=!0}}i.restore()}(f||l&&!h)&&t.setAttribute("aria-label",rt(e.scene,"Geographic chart"));const x=ai.current,S=!(!x||"geoarea"!==x.type&&"point"!==x.type),C=m(S,ci.current),L=Di.current;if(L&&C){const t=Rt(L,yn,vn,y);if(t){if(t.clearRect(-vn.left,-vn.top,yn[0],yn[1]),x&&"geoarea"===x.type){const e=new Path2D(x.pathData);t.fillStyle="rgba(255, 255, 255, 0.3)",t.fill(e),t.strokeStyle="rgba(0, 0, 0, 0.5)",t.lineWidth=2,t.stroke(e)}if(x&&"point"===x.type){const e=x,n="object"==typeof Kt?Kt:void 0,o=n?.pointColor||i(x);t.beginPath(),t.arc(e.x,e.y,e.r+3,0,2*Math.PI),o?(t.save(),t.globalAlpha=.4,t.fillStyle=o,t.fill(),t.restore()):(t.fillStyle="rgba(255, 255, 255, 0.4)",t.fill()),t.strokeStyle=o||"rgba(0, 0, 0, 0.5)",t.lineWidth=2,t.stroke()}}ci.current=S}const A=se!==Un.current;A&&(Un.current=se),(f||A||l&&se&&se.length>0)&&(f||A||l&&!h||o-gi.current>=33)&&(fi(t=>t+1),gi.current=o),(d||null!=e.activeTransition||R.pending||r)&&An()},O(fe,Nn,pn,An,Sn.now,mi,yi),Ht(()=>{if("production"!==process.env.NODE_ENV&&at){const t=nn(o);t&&"mercator"!==t&&console.warn(`[StreamGeoFrame] tileURL is set but projection is "${t}". Raster tiles use Web Mercator and will not align with other projections.`)}},[at,o]),Ht(()=>{const t=Jn.current;if(!$||!t)return $n.current&&t&&(Ne(t).on(".zoom",null),$n.current=null),void(t&&Ne(t).on("mousedown.rotate",null).on("touchstart.rotate",null));const[e,n]=V||[1,8],i={width:bn,height:wn};if(_n){let o=Vn.current.k;const r=t=>{o=Math.max(e,Math.min(n,t)),Vn.current=Ee.scale(o);const r=Nn.current;r&&(r.applyZoomScale(o,i),pn.current=!1,An(),r.scales?.projection&&K?.({projection:r.scales.projection,zoom:r.currentZoom}))};$n.current={scaleBy:(t,e)=>r(o*e),transform:(t,e)=>r(e?.k??1)};const s=t=>{t.preventDefault(),r(o*(0>t.deltaY?1.1:1/1.1))},a=t=>{const e=t.target;e&&(e.closest("button")||e.closest(".stream-geo-zoom-controls"))||(t.preventDefault(),r(1.5*o))};t.addEventListener("wheel",s,{passive:!1}),t.addEventListener("dblclick",a);const c=.4,l=e=>{if(0!==e.button)return;const n=e.target;if(n.closest("button")||n.closest(".stream-geo-zoom-controls"))return;const i=Nn.current;if(!i)return;const o=i.getRotation();ei.current={x:e.clientX,y:e.clientY,rotation:[...o]},t.setPointerCapture(e.pointerId),e.preventDefault()},u=t=>{const e=ei.current;e&&(ni.current=[e.rotation[0]+(t.clientX-e.x)*c,Math.max(-90,Math.min(90,e.rotation[1]-(t.clientY-e.y)*c)),e.rotation[2]],An())},h=e=>{if(!ei.current)return;ei.current=null,t.releasePointerCapture(e.pointerId);const n=ni.current;if(n){ni.current=null;const t=Nn.current;t&&(t.applyRotation(n,i),An())}const o=Nn.current;o?.scales?.projection&&K?.({projection:o.scales.projection,zoom:o.currentZoom})};return t.addEventListener("pointerdown",l),t.addEventListener("pointermove",u),t.addEventListener("pointerup",h),t.addEventListener("pointercancel",h),()=>{t.removeEventListener("wheel",s),t.removeEventListener("dblclick",a),t.removeEventListener("pointerdown",l),t.removeEventListener("pointermove",u),t.removeEventListener("pointerup",h),t.removeEventListener("pointercancel",h),$n.current=null}}const o=Ie().scaleExtent([e,n]).extent([[0,0],[yn[0],yn[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",t=>{const e=t.transform;Vn.current=e,Kn.current=!0;const n=Nn.current;n&&(n.applyZoomTransform(e,i),pn.current=!1,An())}).on("end",t=>{Vn.current=t.transform,Kn.current=!1;const e=Nn.current;e?.scales?.projection&&K?.({projection:e.scales.projection,zoom:e.currentZoom})});return $n.current=o,Ne(t).call(o),()=>{Ne(t).on(".zoom",null)}},[$,V,_n,yn,bn,wn,vn,K,An]);const Ni=Vt&&!1!==Kt,Fi=Ni&&di?Jt?Jt(di):ln($e,{data:di}):null,Oi=Fi?ln(Q,{x:di.x,y:di.y,containerWidth:bn,containerHeight:wn,margin:vn,className:"stream-frame-tooltip",zIndex:10,children:Fi}):null;if(zn){const t=Fn.scene;return un("div",{ref:ti,className:"stream-geo-frame"+(Dt?" "+Dt:""),role:"img","aria-label":Qe||("string"==typeof xe?xe:"Geographic chart"),style:{position:"relative",width:bt?"100%":yn[0],height:xt?"100%":yn[1]},children:[ln(tt,{summary:Ue}),un("svg",{xmlns:"http://www.w3.org/2000/svg",width:yn[0],height:yn[1],style:{position:"absolute",left:0,top:0},children:[Zn?ln("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:yn[0],height:yn[1],fill:Zn}):null,ln("g",{transform:`translate(${vn.left},${vn.top})`,children:Gn}),ln("g",{transform:`translate(${vn.left},${vn.top})`,children:t.map((t,e)=>T({node:t,index:e,renderMode:Wt,fallback:()=>ht(t,e)}))})]}),ln(_e,{width:bn,height:wn,totalWidth:yn[0],totalHeight:yn[1],margin:vn,showAxes:!1,title:xe,legend:Se,legendPosition:Ce,legendLayout:Le,legendHoverBehavior:De,legendClickBehavior:Me,legendHighlightedCategory:je,legendIsolatedCategories:Te,foregroundGraphics:R(Hn,z(Nn.current?.customLayoutOverlays,P??null)),annotations:se,onAnnotationActivate:ae,onObservation:oe??ie,chartId:re,chartType:"StreamGeoFrame",autoPlaceAnnotations:ce,svgAnnotationRules:le,pointNodes:Xe(t),geoProjection:Nn.current?.scales?.projectedPoint})]})}return un("div",{ref:ti,className:"stream-geo-frame"+(Dt?" "+Dt:""),role:"group","aria-label":Qe||("string"==typeof xe?xe:"Geographic chart"),tabIndex:0,style:{position:"relative",width:bt?"100%":yn[0],height:xt?"100%":yn[1],overflow:te?"visible":"hidden",...$?{touchAction:"none"}:{}},onKeyDown:_i,children:["production"!==process.env.NODE_ENV&&Nn.current&&ln(J,{store:Nn.current,diagnostics:ui.current}),Ye&&un(Z,{accessibleTable:Ye,children:[ln(et,{tableId:xn}),ln(q,{scene:Nn.current?.scene??[],chartType:"Geographic chart",tableId:xn,chartTitle:"string"==typeof xe?xe:void 0})]}),ln(tt,{summary:Ue}),ln(Y,{hoverPoint:di}),un("div",{role:"img","aria-label":Qe||("string"==typeof xe?xe:"Geographic chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:Ii,onPointerLeave:Li,onPointerDown:Ni||hn?Ei:void 0,onClick:hn?ji:void 0,children:[ln(X,{size:yn,margin:vn,backdropFill:Zn??void 0,children:Gn}),at&&ln("canvas",{ref:Yn,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),ln("canvas",{ref:ki,"aria-label":rt(Nn.current?.scene??[],"Geographic chart"),style:{position:"absolute",left:0,top:0}}),ln("canvas",{ref:Di,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),ln(_e,{width:bn,height:wn,totalWidth:yn[0],totalHeight:yn[1],margin:vn,showAxes:Ze,title:xe,legend:Se,legendPosition:Ce,legendLayout:Le,legendHoverBehavior:De,legendClickBehavior:Me,legendHighlightedCategory:je,legendIsolatedCategories:Te,foregroundGraphics:R(Hn,z(Nn.current?.customLayoutOverlays,P??null)),annotations:se,onAnnotationActivate:ae,onObservation:oe??ie,chartId:re,chartType:"StreamGeoFrame",autoPlaceAnnotations:ce,svgAnnotationRules:le,pointNodes:Xe(Nn.current?.scene),geoProjection:Nn.current?.scales?.projectedPoint}),fe?.showBadge&&ln(y,{isStale:mi,position:fe.badgePosition}),$&&un("div",{className:"stream-geo-zoom-controls",style:{position:"absolute",bottom:vn.bottom+8,left:vn.left+8,display:"flex",flexDirection:"column",gap:2,zIndex:2},children:[ln("button",{type:"button","aria-label":"Zoom in",onClick:t=>{t.stopPropagation();const e=Jn.current,n=$n.current;e&&n?.scaleBy&&n.scaleBy(Ne(e),1.5)},style:en,children:"+"}),ln("button",{type:"button","aria-label":"Zoom out",onClick:t=>{t.stopPropagation();const e=Jn.current,n=$n.current;e&&n?.scaleBy&&n.scaleBy(Ne(e),1/1.5)},style:en,children:"−"})]}),ct&&ln("div",{className:"stream-geo-tile-attribution",style:{position:"absolute",bottom:vn.bottom+2,right:vn.right+4,fontSize:10,color:"rgba(0,0,0,0.6)",background:"rgba(255,255,255,0.7)",padding:"1px 4px",borderRadius:2,pointerEvents:"none",zIndex:2},children:ct}),ln(U,{active:Ti.current>=0,hoverPoint:di,margin:vn,size:yn,shape:Bi.current?.shape,width:Bi.current?.w,height:Bi.current?.h,pathData:Bi.current?.pathData}),Oi]})]})}));hn.displayName="StreamGeoFrame";var dn=hn;import{forwardRef as pn,useMemo as fn}from"react";import{jsx as gn}from"react/jsx-runtime";var mn=pn(function(n,i){const{points:o,areas:r,lines:s,layout:a,layoutConfig:c,onLayoutError:l,projection:u="equirectangular",xAccessor:h="lon",yAccessor:d="lat",lineDataAccessor:p,colorBy:f,colorScheme:g,tooltip:m,annotations:y,margin:v,selection:R,linkedHover:P,onObservation:x,onClick:S,chartId:C,loading:L,loadingContent:A,emptyContent:k,className:D,frameProps:M={}}=n,{frameRef:j,resolved:T,normalizedMargin:B}=e({imperativeRef:i,imperativeVariant:"geo-points",margin:v,width:n.width,height:n.height,enableHover:n.enableHover,title:n.title,description:n.description,summary:n.summary,accessibleTable:n.accessibleTable,mode:n.mode,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,responsiveRules:n.responsiveRules}),_=fn(()=>ut(o),[o]),I=fn(()=>ut(r),[r]),E=fn(()=>ut(s),[s]),N=fn(()=>[..._,...E,...I],[_,E,I]),F=t({data:N,rawData:void 0!==o||void 0!==s||void 0!==r?N:void 0,colorBy:f,colorScheme:g,legendInteraction:void 0,selection:R,linkedHover:P,fallbackFields:"string"==typeof f?[f]:[],unwrapData:!1,onObservation:x,onClick:S,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"GeoCustomChart",chartId:C,showLegend:!1,userMargin:B,marginDefaults:T.marginDefaults,loading:L,loadingContent:A,emptyContent:k,width:T.width,height:T.height,hasTitle:!!T.title}),O=F.effectiveSelectionHook,W=fn(()=>O?.isActive?{isActive:!0,predicate:O.predicate}:null,[O?.isActive,O?.predicate]);if(F.earlyReturn)return F.earlyReturn;const{width:z,height:H,enableHover:G,title:q,description:Z,summary:Y,accessibleTable:X}=T,Q=vt(m),U={projection:u,...null!=o&&{points:_},...null!=r&&{areas:I},...null!=s&&{lines:E},xAccessor:h,yAccessor:d,...null!=p&&{lineDataAccessor:p},customLayout:a,layoutConfig:c,onLayoutError:l,layoutSelection:W,colorBy:f,colorScheme:g,size:[z,H],responsiveWidth:n.responsiveWidth,responsiveHeight:n.responsiveHeight,margin:F.margin,enableHover:G,...b({title:q,description:Z,summary:Y,accessibleTable:X,className:D,animate:n.animate,maxDevicePixelRatio:n.maxDevicePixelRatio,autoPlaceAnnotations:n.autoPlaceAnnotations}),...!1===m?{tooltipContent:()=>null}:Q?{tooltipContent:Q}:{},...w({linkedHover:P,selection:R,onObservation:x,onClick:S,hoverHighlight:!1,mobileInteraction:F.mobileInteraction,customHoverBehavior:F.customHoverBehavior,customClickBehavior:F.customClickBehavior,linkedHoverInClickPredicate:!1}),...y&&y.length>0&&{annotations:y},...M};return gn(K,{componentName:"GeoCustomChart",width:z,height:H,children:gn(dn,{ref:j,...U})})});mn.displayName="GeoCustomChart";export{dn as StreamGeoFrame_default,mn as GeoCustomChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=[40,40],n=[.5,.5];function h(h,i){const[e,o]=h.viewBox??t,[a,r]=h.anchor??n,c=o>0?o:1,x=Math.max(0,i)/c,f=(e>0?e:c)*x,l=c*x;return{width:f,height:l,scale:x,offsetX:-a*f,offsetY:-r*l}}function i(t,n,h,i){if("none"!==t)return"color"===t||null==t?n??i:"accent"===t?h:t}function e(n,h,i=0,e="horizontal"){const[o,a]=n.viewBox??t,r=Math.min(1,Math.max(0,i)),c=Math.min(1,Math.max(0,h));return c>r?r>0||1>c?"vertical"===e?{x:0,y:a*(1-c),width:o,height:a*(c-r)}:{x:o*r,y:0,width:o*(c-r),height:a}:null:{x:0,y:0,width:0,height:0}}export{t as DEFAULT_GLYPH_VIEWBOX,h as glyphPlacement,i as resolveGlyphPaint,e as glyphFractionClipRect};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{parseDateLikeString as e}from"./c-W3CE4A4S.min.js";function o(e,o){const s={numbers:[],missing:0,nonFinite:0,nonNumeric:0,zero:0,negative:0,fractional:0};for(const n of e){const e=n?.[o];if(null==e||""===e){s.missing++;continue}let t;if("number"==typeof e)t=e;else if("string"==typeof e){const o=e.trim();if(""===o){s.missing++;continue}const n=Number(o);Number.isNaN(n)?/^[+-]?nan$/i.test(o)&&(t=n):t=n}void 0!==t?Number.isFinite(t)?(s.numbers.push(t),0===t&&s.zero++,0>t&&s.negative++,Number.isInteger(t)||s.fractional++):s.nonFinite++:s.nonNumeric++}return s}function s(e,o){if(0===e.length)return;const s=(e.length-1)*o,n=Math.floor(s),t=Math.ceil(s);if(n===t)return e[n];const r=s-n;return e[n]*(1-r)+e[t]*r}function n(e,n={}){if(!Array.isArray(e)||0===e.length)return{};const t=new Set;for(const o of e)if(o&&"object"==typeof o)for(const e of Object.keys(o))t.add(e);const r={};for(const i of t){const t=o(e,i);let a=1/0,c=-1/0;for(const e of t.numbers)a>e&&(a=e),e>c&&(c=e);const l=!1===n.quantiles?void 0:[...t.numbers].sort((e,o)=>e-o);r[i]={field:i,observedCount:e.length-t.missing,finiteCount:t.numbers.length,missingCount:t.missing,nonFiniteCount:t.nonFinite,nonNumericCount:t.nonNumeric,zeroCount:t.zero,negativeCount:t.negative,fractionalCount:t.fractional,...t.numbers.length>0?{min:a,...l?{q1:s(l,.25),median:s(l,.5),q3:s(l,.75)}:{},max:c}:{}}}return r}function t(e){const o=[`${e.component}: ${e.ok?"✓ numerically safe":"✗ numeric hazards found"}`,`${e.rowCount} rows · ${e.summary.fieldsChecked} numeric fields · ${e.summary.errors} errors · ${e.summary.warnings} warnings`];for(const s of e.diagnoses)o.push(`${"error"===s.severity?"ERROR":"WARN"} ${s.code}${s.field?` [${s.field}]`:""}: ${s.message}`),s.fix&&o.push(" Fix: "+s.fix);return o.join("\n")}function r(e){return e.code.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function i(e,o={}){const s=Number.isFinite(o.max)?Math.max(0,Math.floor(o.max)):6,n=e.diagnoses.map((e,o)=>({item:e,diagnosisIndex:o})).filter(({item:e})=>!o.errorsOnly||"error"===e.severity),t=n.slice(0,s).map(({item:e,diagnosisIndex:o})=>({id:`data-audit:${e.code}:${e.role??"chart"}:${e.field??"chart"}:${o}`,level:e.severity,title:e.field?`${r(e)} · ${e.field}`:r(e),message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic data audit",dismissible:!0}));return n.length>s&&t.push({id:"data-audit:overflow:chart",level:n.slice(s).some(({item:e})=>"error"===e.severity)?"error":"warning",title:`${n.length-s} more numeric finding${n.length-s===1?"":"s"}`,message:"Run auditData() or diagnoseConfig() to inspect the complete report.",source:"Semiotic data audit",dismissible:!0}),t}function a(e,o){const s=e.nestedDataAccessorProp?o[e.nestedDataAccessorProp]:void 0;return"string"==typeof s?s:e.defaultNestedDataAccessor}function c(e,o,s){const n=e.dataProp??"data",t=o[n],r=s??(Array.isArray(t)?t:[]),i=a(e,o);if(!i)return{dataProp:n,rows:r};const c=[];let l=!1;for(const e of r){const o=e?.[i];if(Array.isArray(o)){l=!0;for(const e of o)e&&"object"==typeof e&&c.push(e)}}return{dataProp:n,rows:l?c:r}}var l=[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"y",accessor:"yAccessor",defaultAccessor:"y",domain:!0}],u={fields:l},f=[{...l[0],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates"},{...l[1],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates",allowMissing:!0}],g={fields:f},d={role:"value",accessor:"valueAccessor",defaultAccessor:"value"},m={...d,domain:!0},h={fields:[{...d,requirements:["finite","non-negative"]}],aggregates:[{kind:"positive-total",role:"value"}]},p={fields:[d],aggregates:[{kind:"normalized-total",role:"value",groupAccessor:"categoryAccessor",defaultGroupAccessor:"category",whenProp:"normalize"}]},v={fields:f,aggregates:[{kind:"normalized-total",role:"y",groupAccessor:"xAccessor",defaultGroupAccessor:"x",whenProp:"normalize"}]},w={fields:[...l,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},y={fields:[...l,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},A={fields:[d]},b={fields:[{...d,dataProp:"edges",requirements:["finite","non-negative"],missingValue:1}]},$={LineChart:g,AreaChart:g,BumpChart:g,Scatterplot:y,ConnectedScatterplot:u,QuadrantChart:y,MinimapChart:g,BubbleChart:w,StackedAreaChart:v,DifferenceChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date",domain:!0},{role:"value",accessor:"seriesAAccessor",defaultAccessor:"a"},{role:"value",accessor:"seriesBAccessor",defaultAccessor:"b"}]},CandlestickChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"high",accessor:"highAccessor",defaultAccessor:"high",requirements:["finite"]},{role:"low",accessor:"lowAccessor",defaultAccessor:"low",requirements:["finite"]},{role:"open",accessor:"openAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]},{role:"close",accessor:"closeAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]}]},Heatmap:A,BarChart:{fields:[d]},GroupedBarChart:{fields:[d]},StackedBarChart:p,DotPlot:{fields:[m]},Histogram:{fields:[m]},BoxPlot:{fields:[m]},SwarmPlot:{fields:[m,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},ViolinPlot:{fields:[m]},RidgelinePlot:{fields:[m]},PieChart:h,DonutChart:h,FunnelChart:h,SankeyDiagram:b,ChordDiagram:b,ProportionalSymbolMap:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"lon",dataProp:"points",requirements:["finite"]},{role:"y",accessor:"yAccessor",defaultAccessor:"lat",dataProp:"points",requirements:["finite"]},{role:"size",accessor:"sizeBy",dataProp:"points",requirements:["finite","non-negative"]}]}},R=Symbol.for("semiotic.numericContractRegistry");function N(){const e=globalThis;return e[R]??(e[R]={contracts:new Map}),e[R]}function x(e,o){o?N().contracts.set(e,o):N().contracts.delete(e)}function z(e){N().contracts.delete(e)}var E={xAccessor:"x",yAccessor:"y",valueAccessor:"value",sizeBy:"size",sizeAccessor:"size",radiusAccessor:"size",countAccessor:"count",amountAccessor:"value",highAccessor:"high",lowAccessor:"low",openAccessor:"open",closeAccessor:"close",lowerAccessor:"lower",upperAccessor:"upper",positiveAccessor:"value",negativeAccessor:"value",progressAccessor:"value",confidenceAccessor:"value",costAccessor:"value",throughputAccessor:"value"};function P(e,o,s){return"function"==typeof e?e(o,s):o[e]}function I(o,s){if("number"==typeof o)return Number.isFinite(o)?o:null;if(o instanceof Date){const e=o.getTime();return s&&Number.isFinite(e)?e:null}if("string"==typeof o){const n=o.trim(),t=Number(n);if(n&&Number.isFinite(t))return t;if("date-like"===s){const o=e(n);return Number.isFinite(o)?o:null}}return null}function C(e){return"number"==typeof e&&!Number.isFinite(e)}function _(e,o,s,n,t){const r={field:s,numbers:[],finiteRows:[],missingRows:[],nonFiniteRows:[],nonNumericRows:[],accessorErrorRows:[],zeroRows:[],negativeRows:[],fractionalRows:[]};for(let s=0;e.length>s;s++){let i;try{i=P(o,e[s],s)}catch{r.accessorErrorRows.push(s);continue}if(null==i||""===i){if(void 0!==t){r.numbers.push(t),r.finiteRows.push(s),0===t&&r.zeroRows.push(s),0>t&&r.negativeRows.push(s),Number.isInteger(t)||r.fractionalRows.push(s);continue}r.missingRows.push(s);continue}const a=I(i,n);null!=a?(r.numbers.push(a),r.finiteRows.push(s),0===a&&r.zeroRows.push(s),0>a&&r.negativeRows.push(s),Number.isInteger(a)||r.fractionalRows.push(s)):C(i)?r.nonFiniteRows.push(s):r.nonNumericRows.push(s)}return r}function S(e,o){const s=new Set(e.requirements??["finite"]);return s.add("finite"),("x"===e.role&&"log"===o.xScaleType||"y"===e.role&&"log"===o.yScaleType)&&s.add("positive"),[...s]}function M(e){return e.slice(0,5)}function O(e){return{domain:"data",...e}}function T(e,o){const n=[],{observation:t,contract:r,accessorLabel:i,requirements:a}=e,c={field:i,role:r.role},l=[...t.nonFiniteRows,...t.nonNumericRows,...t.accessorErrorRows].sort((e,o)=>e-o);if(0===t.numbers.length)return n.push(O({severity:"error",code:"DEGENERATE_EXTENT",message:`${r.accessor}="${i}" produces no finite numeric values; the chart cannot resolve its ${r.role} input.`,fix:`Ensure ${i} contains finite numbers${"x"===r.role?" (or valid dates for a time scale)":""}.`,...c,...l.length>0?{rows:M(l),count:l.length}:{}})),n;t.nonFiniteRows.length>0&&n.push(O({severity:"error",code:"NON_FINITE_VALUE",message:`${i} contains ${t.nonFiniteRows.length} NaN or infinite value${1===t.nonFiniteRows.length?"":"s"}; scale and layout math require finite numbers.`,fix:`Filter or replace NaN/Infinity in ${i} before rendering.`,...c,rows:M(t.nonFiniteRows),count:t.nonFiniteRows.length})),!r.allowMissing&&t.missingRows.length>0&&n.push(O({severity:"error",code:"MISSING_NUMERIC_VALUE",message:`${i} is missing for ${t.missingRows.length} row${1===t.missingRows.length?"":"s"}; the ${r.role} role requires an explicit numeric value.`,fix:`Fill or filter missing ${i} values before rendering.`,...c,rows:M(t.missingRows),count:t.missingRows.length}));const u=[...t.nonNumericRows,...t.accessorErrorRows].sort((e,o)=>e-o);if(u.length>0&&n.push(O({severity:"error",code:"NON_NUMERIC_VALUE",message:`${i} produces ${u.length} non-numeric value${1===u.length?"":"s"} for the ${r.role} role.`,fix:`Bind ${r.accessor} to a numeric field or return finite numbers from the accessor.`,...c,rows:M(u),count:u.length})),r.domain&&t.numbers.length>=2){const[e,o]=function(e){let o=1/0,s=-1/0;for(const n of e)o>n&&(o=n),n>s&&(s=n);return[o,s]}(t.numbers);e===o&&n.push(O({severity:"warning",code:"ZERO_SPAN_DOMAIN",message:`${i} is constant at ${e}; its ${r.role} scale has a zero-span data domain.`,fix:`Provide varying ${r.role} values, set an explicit extent around ${e}, or use a single-value display.`,...c,rows:M(t.finiteRows),count:t.finiteRows.length}))}if(a.includes("positive")){const o=t.numbers.map((e,o)=>({number:e,row:t.finiteRows[o]})).filter(({number:e})=>0>=e).map(({row:e})=>e);if(o.length>0){const s=e.logScale;n.push(O({severity:"error",code:s?"LOG_NON_POSITIVE":"NON_POSITIVE_VALUE",message:`${i} contains ${o.length} non-positive value${1===o.length?"":"s"}, which ${s?"cannot be represented on a log scale":"violate the positive-value contract"}.`,fix:s?"Remove or transform values ≤ 0, or use a linear/symlog scale.":"Provide values greater than zero.",...c,rows:M(o),count:o.length}))}}if(a.includes("non-negative")&&t.negativeRows.length>0&&n.push(O({severity:"error",code:"size"===r.role?"NEGATIVE_SIZE":"NEGATIVE_VALUE",message:`${i} contains ${t.negativeRows.length} negative ${r.role} value${1===t.negativeRows.length?"":"s"}; the chart maps this role to non-negative geometry.`,fix:"Use a non-negative measure, clamp intentionally, or encode sign with position/color instead.",...c,rows:M(t.negativeRows),count:t.negativeRows.length})),a.includes("integer")){const e=[...new Set([...t.negativeRows,...t.zeroRows,...t.fractionalRows])].sort((e,o)=>e-o);e.length>0&&n.push(O({severity:"error",code:"INVALID_COUNT",message:`${i} contains ${e.length} value${1===e.length?"":"s"} that are not positive integers.`,fix:"Counts must be integers ≥ 1; aggregate, round intentionally, or use a continuous-value encoding.",...c,rows:M(e),count:e.length}))}if(a.includes("unit-interval")){const e=t.numbers.map((e,o)=>({number:e,row:t.finiteRows[o]})).filter(({number:e})=>0>e||e>1).map(({row:e})=>e);e.length>0&&n.push(O({severity:"error",code:"OUTSIDE_UNIT_INTERVAL",message:`${i} contains ${e.length} value${1===e.length?"":"s"} outside [0, 1].`,fix:`Normalize ${i} to [0, 1] before using it as ${r.role}.`,...c,rows:M(e),count:e.length}))}if(o&&r.domain){const o=function(e){const o=e.observation.numbers.map((o,s)=>({value:o,row:e.observation.finiteRows[s]})).sort((e,o)=>e.value-o.value);if(8>o.length)return[];const n=o.map(e=>e.value),t=s(n,.25),r=s(n,.75),i=s(n,.5),a=r-t;if(a>0){const e=t-10*a,s=r+10*a;return o.filter(o=>e>o.value||o.value>s).map(e=>e.row)}const c=100*Math.max(1,Math.abs(i));return o.filter(e=>Math.abs(e.value-i)>c).map(e=>e.row)}(e);o.length>0&&n.push(O({severity:"warning",code:"OUTLIER_DOMINATED_DOMAIN",message:`${i} has ${o.length} extreme value${1===o.length?"":"s"} beyond the 10×IQR guardrail; the main distribution may collapse visually.`,fix:"Verify the extreme values, then consider a log scale, robust extent, inset, or explicit annotation rather than silently clipping them.",...c,rows:M(o),count:o.length}))}return n}function k(e,o,s){if(!e)return"__all__";try{return P(e,o,s)+""}catch{return"__accessor_error__"}}function D(e,o,s){if(e.whenProp&&!0!==s[e.whenProp])return[];const n=o.find(o=>o.contract.role===e.role);if(!n||0===n.observation.numbers.length)return[];const t=e.groupAccessor?s[e.groupAccessor]:void 0,r="string"==typeof t||"function"==typeof t?t:e.defaultGroupAccessor,i=new Map;for(let e=0;n.rows.length>e;e++){let o;try{o=P(n.accessor,n.rows[e],e)}catch{continue}const s=I(o,void 0);if(null==s)continue;const t=k(r,n.rows[e],e),a=i.get(t)??{sum:0,magnitude:0,positive:!1,negative:!1,rows:[],negativeRows:[]};a.sum+=s,a.magnitude+=Math.abs(s),a.positive||(a.positive=s>0),a.negative||(a.negative=0>s),a.rows.push(e),0>s&&a.negativeRows.push(e),i.set(t,a)}const a=[],c=[],l=[],u=[],f=[],g=[];for(const[o,s]of i)("positive-total"===e.kind&&0>=s.sum||"normalized-total"===e.kind&&Number.EPSILON*Math.max(1,s.magnitude)*10>=Math.abs(s.sum))&&(a.push(o),u.push(...s.rows)),"normalized-total"===e.kind&&s.positive&&s.negative&&(c.push(o),f.push(...s.rows)),"normalized-total"===e.kind&&s.negative&&(l.push(o),g.push(...s.negativeRows));const d=[];return a.length>0&&d.push(O({severity:"error",code:"normalized-total"===e.kind?"ZERO_NORMALIZED_TOTAL":"NON_POSITIVE_TOTAL",message:"normalized-total"===e.kind?`${a.length} normalization group${1===a.length?" has":"s have"} a zero total, so division would be undefined.`:"The part-to-whole total is not positive, so meaningful shares cannot be computed.",fix:"normalized-total"===e.kind?"Remove empty/zero-sum groups or disable normalization.":"Provide at least one positive value and ensure the total is greater than zero.",field:n.accessorLabel,role:e.role,rows:M([...new Set(u)].sort((e,o)=>e-o)),count:a.length})),l.length>0&&d.push(O({severity:"error",code:"NEGATIVE_NORMALIZED_VALUE",message:`${l.length} normalization group${1===l.length?" contains":"s contain"} negative contributions, so conventional percentage shares are not defined.`,fix:"Use non-negative contributions, a diverging stack, or disable normalization.",field:n.accessorLabel,role:e.role,rows:M([...new Set(g)].sort((e,o)=>e-o)),count:g.length})),c.length>0&&d.push(O({severity:"warning",code:"MIXED_SIGN_NORMALIZATION",message:`${c.length} normalization group${1===c.length?" mixes":"s mix"} positive and negative contributions; percentage shares may be unstable or misleading.`,fix:"Separate positive and negative contributions, use diverging stacks, or disable normalization.",field:n.accessorLabel,role:e.role,rows:M([...new Set(f)].sort((e,o)=>e-o)),count:c.length})),d}function L(e,o,s,n={}){const t=n.contracts??function(e){return N().contracts.get(e)??$[e]}(e)??function(e){const o=[];for(const[s,n]of Object.entries(E))"string"!=typeof e[s]&&"function"!=typeof e[s]||o.push({role:n,accessor:s,..."size"===n?{requirements:["finite","non-negative"]}:{},..."x"===n||"y"===n?{domain:!0}:{}});return o.length>0?{fields:o}:void 0}(o);if(!t)return{component:e,ok:!0,rowCount:s?.length??(Array.isArray(o.data)?o.data.length:0),summary:{fieldsChecked:0,errors:0,warnings:0},contracts:[],diagnoses:[]};const r=function(e,o,s){const n=[],t=new Set;for(const r of e.fields){if(r.whenProps?.some(e=>null==o[e]))continue;const e=o[r.accessor],i="string"==typeof e||"function"==typeof e?e:r.defaultAccessor;if("string"!=typeof i&&"function"!=typeof i)continue;const{dataProp:a,rows:l}=c(r,o,s);if(0===l.length)continue;const u="string"==typeof i?i:r.accessor+"()",f=`${a}:${r.role}:${u}`;if(t.has(f))continue;t.add(f);const g=r.temporalValues??("time"===r.role||"x"===r.role&&"time"===o.xScaleType?"date-like":void 0),d="x"===r.role&&"log"===o.xScaleType||"y"===r.role&&"log"===o.yScaleType,m=S(r,o);n.push({contract:r,accessor:i,accessorLabel:u,dataProp:a,rows:l,requirements:m,logScale:d,observation:_(l,i,u,g,r.missingValue)})}return n}(t,o,s),i=[],l=!1!==n.checkOutliers;for(const e of function(e,o,s){const n=new Set;for(const t of e.fields){const e=t.dataProp??"data",r=s??o[e];if(!Array.isArray(r))continue;if(0===r.length){n.add(e);continue}const i=a(t,o);if(!i)continue;const c=r.map(e=>e?.[i]).filter(Array.isArray);c.length>0&&c.every(e=>0===e.length)&&n.add(`${e}.${i}`)}return[...n]}(t,o,s))i.push(O({severity:"error",code:"EMPTY_DATA",message:e+" is an explicitly empty array; there are no numeric inputs to render.",fix:`Provide at least one valid row, render an intentional empty state, or omit ${e} when using the ref push API.`,count:0,rows:[]}));const u=new Set(r.filter(e=>e.contract.domain&&1===e.rows.length).map(e=>e.dataProp));for(const e of u)i.push(O({severity:"warning",code:"SINGLE_ROW_DOMAIN",message:e+" has one row; a quantitative scale cannot establish variation from a single observation.",fix:"Provide at least two observations or use a single-value display such as BigNumber.",count:1,rows:[0]}));for(const e of r)i.push(...T(e,l));for(const e of t.aggregates??[])i.push(...D(e,r,o));const f=i.filter(e=>"error"===e.severity).length,g=i.length-f;return{component:e,ok:0===f,rowCount:r.reduce((e,o)=>Math.max(e,o.rows.length),s?.length??(Array.isArray(o.data)?o.data.length:0)),summary:{fieldsChecked:r.length,errors:f,warnings:g},contracts:r.map(e=>({role:e.contract.role,accessor:e.accessorLabel,dataProp:e.dataProp,requirements:e.requirements,allowMissing:!0===e.contract.allowMissing,...void 0!==e.contract.missingValue?{missingValue:e.contract.missingValue}:{},domain:!0===e.contract.domain})),diagnoses:i}}export{$ as BUILT_IN_NUMERIC_CONTRACTS,x as registerNumericContracts,z as unregisterNumericContracts,n as profileNumericFields,t as formatDataAudit,i as toDataAuditNotifications,L as auditData};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{filterAnnotationsByStatus as e}from"./c-E3JFRRMI.min.js";import{resolveAccessor as t,resolveRawAccessor as n}from"./c-MT3WBK7M.min.js";var r=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),o=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),a=new Set(["PieChart","DonutChart","FunnelChart"]),i=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]);function s(e,t){return o.has(e)||a.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:t.categoryAccessor??t.stepAccessor,dimensionFallback:"category"}:{measure:t.yAccessor??t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function l(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const n=e[t];if("string"==typeof n&&n)return n}}function c(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}function u(e,t=new Set){if(null===e)return!0;const n=typeof e;if("string"===n||"boolean"===n)return!0;if("number"===n)return Number.isFinite(e);if("object"!==n)return!1;if(t.has(e))return!1;t.add(e);const r=Array.isArray(e)?e.every(e=>u(e,t)):Object.entries(e).every(([,e])=>u(e,t));return t.delete(e),r}var h=Symbol.for("semiotic.chartRecipeRegistry");function d(e){return function(){const e=globalThis;return e[h]||(e[h]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[h]}().recipes.get(e)}function p(e){return"string"==typeof e?d(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function f(e){return"string"==typeof e?e:e.id??e.name}function m(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function g(e){return Array.isArray(e.data)?e.data:Array.isArray(e.nodes)?e.nodes:Array.isArray(e.points)?e.points:Array.isArray(e.areas)?e.areas:[]}function $(e,t,n){return n??p(t.recipe)??p(t.recipeId)??d(e)}function y(e,t,n=[]){const r=e.accessor?t[e.accessor]:void 0;if("string"==typeof r&&r)return r;if(e.field)return e.field;const o=n.find(e=>e&&"object"==typeof e);if(!o)return;const a=Object.entries(o).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?a.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in o):a.find(([,e])=>"string"==typeof e)?.[0]}function b(e,t){return e.dataRoles.find(e=>e.role===t)}function v(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function C(e,t,n,r,o,a={}){const i={...a};if(t)for(const[e,n]of Object.entries(t))i[e]=n;for(const e of n.dataRoles){const n=y(e,r,o),a=t&&n?t[n]:n;void 0!==a&&(i[e.role]=a)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{const n=i[t];return null==n?`{${t}}`:n+""})}var w={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",BumpChart:"bump chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value",StreamPhysicsFrame:"physics stream frame",EventDropChart:"event-drop physics chart",GaltonBoardChart:"Galton board chart",UnitPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PacketFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",CrucibleChart:"crucible physics chart",PhysicsCustomChart:"custom physics chart"},k=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),A=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]);function S(e){return w[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}function x(e){const t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}var P=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),j={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},F={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},D=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],L={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"};function B(e){return j[e]}function M(e,t){const n=function(e){if(e){if("fits"in e||"buildProps"in e){const t=e,n={};for(const[e,r]of Object.entries(t.intentScores))"number"==typeof r&&Number.isFinite(r)&&(n[e]=r);return{family:t.family,intentScores:Object.keys(n).length?n:void 0}}return e}}(t);if(n?.act)return n.act;if(n?.intentScores){const e=function(e){let t,n=0;for(const[r,o]of Object.entries(e))if("number"==typeof o&&o>0)if(o>n)t=r,n=o;else if(o===n&&void 0!==t){const e=D.indexOf(r),n=D.indexOf(t);-1===e||-1!==n&&e>=n||(t=r)}return t}(n.intentScores);if(e&&j[e]&&(n.intentScores[e]??0)>=3)return j[e]}return n?.family?F[n.family]:function(e){return"BumpChart"===e?"ranking":a.has(e)||"StackedAreaChart"===e?"apportioning":P.has(e)?"relating":o.has(e)?"comparing":i.has(e)?"characterizing":r.has(e)?"tracking":k.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}var N=new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),I=new Set(["system","agent","watcher"]),T=new Set(["ai","agent","system","computed","dbt","great-expectations"]),R=new Set(["rule","statistical-test","llm-inference","computed"]);function O(e){const t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;const t=e;if("string"!=typeof t.type||!N.has(t.type))return!1;const n=t.provenance;return!(!n||"object"!=typeof n)&&(I.has(n.authorKind)||T.has(n.source)||R.has(n.basis))})}function G(e="en"){let t,n;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),n=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),n=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?n.format(e):t.format(e):e+""}var E={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"};function U(e){const t=E["string"==typeof e.type?e.type:"annotation"]||"an annotation",n=function(e){const t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,n=t?.authorKind??t?.source??t?.basis;return"watcher"===n?"a watcher-flagged ":"agent"===n||"ai"===n||"llm-inference"===n?"an AI-suggested ":""}(e),r=n?n+t.replace(/^an? /,""):t,o="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return o?`${r} labeled "${o}"`:r}function q(t){const n=Array.isArray(t.annotations)?t.annotations:null;if(!n||0===n.length)return;const r=e(n.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return;const o=r.map(U),a=o.slice(0,5),i=o.length-a.length,s=function(e){return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:e[0]??""}(a)+(i>0?`, and ${i} more`:""),l=r.length;return`The author has marked ${1===l?"one feature":l+" features"} on this chart: ${s}.`}function z(e,u,h={}){const d=void 0!==h.levels,p=new Set(h.levels??["l1","l2","l3"]);d||!h.capability&&!O(u)||p.add("l4");const b=$(e,u,h.recipe);if(b){const e=["l1","l2","l3","l4"].filter(e=>p.has(e));d||e.includes("l4")||e.push("l4");const t=function(e,t,n={}){const r=g(t),o=m(t),a=n.locale??"en",i="function"==typeof e.description?e.description({data:r,config:o,locale:a}):void 0,s=i?.levels??function(e,t,n,r){const o=v(e,["nominal","ordinal"]),a=v(e,["quantitative"]),i=o?y(o,n,t):void 0,s=a?y(a,n,t):void 0,l=o?.role??i??"category",c=a?.role??s??"value",u=e.encodings??[],h=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${l} and ${c} are mapped through the recipe's declared visual semantics`,{number:d,percent:p}=function(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}(r),m=new Map;if(i&&s)for(const e of t){const t=(e[i]??"Uncategorized")+"",n=Number(e[s]);Number.isFinite(n)&&m.set(t,(m.get(t)??0)+n)}const g=[...m].sort((e,t)=>t[1]-e[1]),$=g.reduce((e,[,t])=>e+t,0),b=g[0],C=g[1],w=$>0?((b?.[1]??0)+(C?.[1]??0))/$:0,k=e.intents.map(e=>({id:f(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,A=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${l} and ${c}. ${S=h,S?S.charAt(0).toUpperCase()+S.slice(1):S}.`,l2:g.length>0?`${g.length} categories total ${d.format($)}. ${b[0]} accounts for ${d.format(b[1])}${$>0?` (${p.format(b[1]/$)})`:""}${C?`, followed by ${C[0]} at ${d.format(C[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>g.length?b?b[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>w?`The total is distributed across ${g.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${b[0]} and ${C[0]}, which together account for ${p.format(w)}.`,l4:`The chart is intended for ${k??"explanation"}${A?` with a ${A} audience`:""}: ${e.designContract.whyCustom}`};var S}(e,r,o,a),l=n.levels??["l1","l2","l3","l4"],c={};for(const e of l)s[e]&&(c[e]=s[e]);const u=["l1","l2","l3","l4"].map(e=>c[e]).filter(e=>!!e).join(" "),h=n.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:u,levels:c,...h?.length?{caveats:h}:{}}}(b,u,{levels:e,locale:h.locale,audience:h.audience,includeCaveats:h.includeCaveats}),n=q(u);return{...t,text:n?`${n} ${t.text}`.trim():t.text,...n?{annotations:n}:{}}}const C=G(h.locale??"en"),w=S(e),P=Array.isArray(u.data)?u.data:null,j=l(u),F=A.has(e)?function(e,t){const n=e.physics&&"object"==typeof e.physics?e.physics:null,r=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,o=[e.settledProjectionRows,e.projectionRows,r?.rows,n?.settledProjectionRows,n?.projectionRows,n?.settledProjection&&"object"==typeof n.settledProjection?n.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(o)?o.map((e,n)=>{if(!e||"object"!=typeof e)return null;const r=e,o=x(r.count??r.value??r.total??r.bodies??r.events);if(null==o)return null;const a=r.label??r.id??r.name??"container "+(n+1),i=x(r.secondary??r.secondaryCount),s=x(r.observed??r.observedCount);return{label:c(a,t),count:o,...null!=i?{secondary:i}:{},..."string"==typeof r.secondaryLabel&&r.secondaryLabel?{secondaryLabel:r.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}(u,C):null,{measure:D,measureFallback:B,dimension:N,dimensionFallback:I}=s(e,u),T="string"==typeof D&&D?D:B,R="string"==typeof N&&N?N:I,E={};if(A.has(e)&&function(e,t,n,r,o,a){const i=function(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}(e),s=function(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"body"}(e);if(o.has("l1")&&(r.l1=function(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"UnitPileChart"===e?"A physics pile chart that collapses moving bodies into a settled bar-style projection by container.":"CollisionSwarmChart"===e?"A collision swarm chart that separates overlapping points while preserving their quantitative axis position.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}(e,t)),!o.has("l2")&&!o.has("l3"))return;if(!n||0===n.length)return void(o.has("l2")&&(r.l2="No settled projection is loaded yet."));const l=n.reduce((e,t)=>e+t.count,0),c=n.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),u=c[0]??n.slice().sort((e,t)=>t.count-e.count)[0];if(!u)return;const h=n.reduce((e,t)=>e+(t.secondary??0),0),d=n.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(o.has("l2"))if(0===c.length)r.l2=`The settled projection contains ${a(l)} ${J(l,s)} across ${n.length} ${J(n.length,i)}; no ${J(2,i)} are non-empty yet.`;else{const e=h>0?` ${a(h)} ${J(h,s)} ${1===h?"is":"are"} marked ${d}.`:"";r.l2=`The settled projection contains ${a(l)} ${J(l,s)} across ${n.length} ${J(n.length,i)}; ${c.length} ${J(c.length,i)} ${1===c.length?"is":"are"} non-empty. The largest ${i} is ${u.label} with ${a(u.count)} ${J(u.count,s)}.${e}`}if(o.has("l3")&&l>0&&c.length>0){const e=c.find(e=>e!==u),t=function(e,t){if(0>=t)return"0%";const n=e/t*100;return(10>n?Math.round(10*n)/10:Math.round(n))+"%"}(u.count,l);r.l3=e?`The settled projection is most concentrated in ${u.label}, which holds ${a(u.count)} ${J(u.count,s)} (${t}); ${e.label} follows with ${a(e.count)} ${J(e.count,s)}.`:`The settled projection is concentrated in ${u.label}, which holds all ${a(u.count)} ${J(u.count,s)}.`}}(e,w,F,E,p,C),p.has("l1")&&!A.has(e))if("BumpChart"===e)E.l1=`A ${w} ranking ${j??"series"} by ${T} across ${R}.`;else if(r.has(e)||o.has(e))E.l1=`A ${w} of ${T} by ${R}`+(j?`, split by ${j}.`:".");else if(a.has(e))E.l1=`A ${w} showing ${T} across ${R} categories.`;else if(i.has(e))E.l1=`A ${w} of the distribution of ${T}`+(j?` by ${j}.`:".");else if(k.has(e)){const e=Array.isArray(u.nodes)?u.nodes.length:void 0,t=Array.isArray(u.edges)?u.edges.length:void 0,n=[null!=e?`${e} ${J(e,"node")}`:null,null!=t?`${t} ${J(t,"edge")}`:null].filter(Boolean);E.l1=`A ${w}${n.length?" with "+n.join(" and "):""}.`}else if("BigNumber"===e){const e="string"==typeof u.label?u.label:T;E.l1=`A single value${e?" for "+e:""}.`}else E.l1=`A ${w}.`;const U=r.has(e)||"BumpChart"===e||o.has(e)||a.has(e)||i.has(e);let z=null;if((p.has("l2")||p.has("l3")||p.has("l4"))&&U&&P&&P.length>0&&(z=function(e,t,n,r){let o=0,a=0,i=1/0,s=-1/0,l=null,u=null,h=0,d=0,p=null,f=null,m=NaN,g=NaN;for(const n of e){const e=t(n);Number.isFinite(e)&&(0===o&&(m=e,p=n),g=e,f=n,i>e&&(i=e,l=n,h=o),e>s&&(s=e,u=n,d=o),o++,a+=e)}return 0===o?null:{count:o,min:i,max:s,mean:a/o,minLabel:c(null!=l?n(l):null,r),maxLabel:c(null!=u?n(u):null,r),first:m,last:g,firstLabel:c(null!=p?n(p):null,r),lastLabel:c(null!=f?n(f):null,r),minIndex:h,maxIndex:d}}(P,t(D,B),n(N,I),C)),p.has("l2")&&U&&(P&&0!==P.length?z&&(E.l2=a.has(e)?`${z.count} segments totaling ${C(function(e){return e.mean*e.count}(z))}. Largest is ${z.maxLabel} at ${C(z.max)}; smallest is ${z.minLabel} at ${C(z.min)}.`:`${T} ranges from ${C(z.min)} (${z.minLabel}) to ${C(z.max)} (${z.maxLabel}), with a mean of ${C(z.mean)} across ${z.count} points.`):E.l2="No data is loaded yet."),p.has("l3")&&z&&!j&&r.has(e)?E.l3=function(e,t,n){const{first:r,last:o,min:a,max:i,maxLabel:s,minLabel:l,firstLabel:c,lastLabel:u,minIndex:h,maxIndex:d,count:p}=e,f=i-a,m=o-r;if(0===f)return`${H(t)} is constant at ${n(r)} across the series.`;if(.04>f/(Math.abs(e.mean)||1))return`${H(t)} ends roughly where it started (${n(r)} at ${c} to ${n(o)} at ${u}), ranging between ${n(a)} and ${n(i)}.`;const g=d>0&&p-1>d,$=h>0&&p-1>h,y=(i-Math.max(r,o))/f,b=(Math.min(r,o)-a)/f;return g&&y>.15?`Overall ${t} climbs to a peak of ${n(i)} (${s}), then falls to ${n(o)} (${u}).`:$&&b>.15?`Overall ${t} drops to a low of ${n(a)} (${l}), then recovers to ${n(o)} (${u}).`:.05>Math.abs(m)/f?`${H(t)} ends roughly where it started (${n(r)} at ${c} to ${n(o)} at ${u}), ranging between ${n(a)} and ${n(i)}.`:m>0?d===p-1?`Overall ${t} rises from ${n(r)} (${c}) to a peak of ${n(o)} (${u}).`:`Overall ${t} rises from ${n(r)} (${c}) to ${n(o)} (${u}), after peaking at ${n(i)} (${s}).`:h===p-1?`Overall ${t} falls from ${n(r)} (${c}) to a low of ${n(o)} (${u}).`:`Overall ${t} falls from ${n(r)} (${c}) to ${n(o)} (${u}), after dipping to ${n(a)} (${l}).`}(z,T,C):p.has("l3")&&z&&!j&&o.has(e)&&(E.l3=`The highest ${R} is ${z.maxLabel} and the lowest is ${z.minLabel}.`),p.has("l4")){const t=O(u)?"alerting":M(e,h.capability);t&&(E.l4=function(e,t,n,r,i,s,l,c){const u=L[e],h=/^[aeiou]/i.test(u)?"an":"a";let d,p;switch(e){case"locating":d="This is a map",p="read values by location";break;case"presenting":d="This is a single-value display",p=`read ${"string"==typeof n.label&&n.label?n.label:i} as the headline number`;break;case"tracing":d=`This is ${h} ${u} chart`,p="follow the movement between states";break;case"nesting":d=`This is ${h} ${u} chart`,p="read it for nested structure and how children sum into their parents";break;case"relating":d=`This is ${h} ${u} chart`,p=`read it for whether ${s} and ${i} move together`;break;default:d=`This is ${h} ${u} chart`,p=function(e,t,n,r,i,s){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+n;case"comparing":return`compare ${n} across ${r}`;case"ranking":return"read it top to bottom by "+n;case"apportioning":return`read each ${r}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+n;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,n){if(o.has(n)||a.has(n))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:r,last:i,min:s,max:l,minLabel:c,maxLabel:u,lastLabel:h,minIndex:d,maxIndex:p,count:f}=e,m=l-s;if(m>0){const e=p>0&&f-1>p,n=d>0&&f-1>d,o=(l-Math.max(r,i))/m,a=(Math.min(r,i)-s)/m;if(e&&o>.15)return`the peak of ${t(l)} at ${u} is the point to investigate`;if(n&&a>.15)return`the dip to ${t(s)} at ${c} is the point to investigate`;if(i>=l)return`the climb to ${t(i)} at ${h} warrants a closer look`;if(s>=i)return`the drop to ${t(i)} at ${h} warrants a closer look`}return`the extremes — ${u} (${t(l)}) and ${c} (${t(s)}) — are the points to check`}(t,i,s);case"tracking":return`read it for the trajectory of ${n}, which ${function(e){const t=e.max-e.min,n=e.last-e.first;return 0===t||.05>Math.abs(n)/t?"holds roughly steady":n>0?"rises":"falls"}(t)} from ${i(t.first)} (${t.firstLabel}) to ${i(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${n} across ${r}; ${t.maxLabel} leads at ${i(t.max)}`;case"ranking":return`read it top to bottom by ${n}; ${t.maxLabel} ranks highest at ${i(t.max)}`;case"apportioning":{const e=t.mean*t.count,n=e>0?Math.round(t.max/e*100):null;return`read each ${r}'s share of the ${i(e)} total; ${t.maxLabel} is the largest at ${i(t.max)}${null!=n?` (${n}%)`:""}`}case"characterizing":return`read it for the spread of ${n}, from ${i(t.min)} to ${i(t.max)}`;default:return"read the highlighted features"}}(e,r,i,s,l,t)}return`${d}; ${p}.${function(e,t){if(!t)return"";const n=t.familiarity?.[e];return"number"!=typeof n||n>2?"":` This ${S(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,c)}`}(t,e,u,j?null:z,T,R,C,h.audience))}const V=["l1","l2","l3","l4"].filter(e=>p.has(e)&&E[e]).map(e=>E[e]).join(" "),K=q(u);return{text:K?`${K} ${V}`.trim():V,levels:E,...K?{annotations:K}:{}}}function H(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function J(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function V(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}var K=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Q=new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),W=new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]);function _(e,t,n){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:n]}function X(e,t="—"){return null==e||""===e?t:"object"==typeof e?X(e.id??e.name??e.label,t):e+""}function Z(e){const t="number"==typeof e?e:Number(e);return Number.isFinite(t)?t:void 0}function Y(e){return X(e,"unknown").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function ee(e,t){const n=[];return(e.linkedHover||e.selection||e.linkedBrush)&&n.push("network"===t?"Use linked highlighting to trace related marks.":"Use linked highlighting to compare related locations."),(e.enableHover||e.tooltip)&&n.push("Hover or focus a mark for its details."),n.length>0?" "+n.join(" "):""}function te(e,t){t&&e.children?.push(t)}function ne(e,t){const n=_(e,t,"children");return Array.isArray(n)?n:[]}function re(e,t,n){const r=_(e,t,n);if(void 0!==r)return r;const o=e.properties;return o&&"object"==typeof o?_(o,t,n):void 0}function oe(u,h,d={}){const p=d.locale??"en",f=Math.max(1,d.maxLeaves??200),w=G(p),k=$(u,h,d.recipe);if(k)return function(e,t,n={}){const r=g(t),o=m(t),a=Math.max(1,n.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:r,config:o,locale:n.locale??"en"});const i=(s=e.navigation)&&"object"==typeof s?e.navigation:void 0;var s;const l=(i?.groupByRole?b(e,i.groupByRole):void 0)??(i?.groupBy?.[0]?b(e,i.groupBy[0])??e.dataRoles.find(e=>e.field===i.groupBy?.[0]):void 0)??v(e,["nominal","ordinal"]),c=l?y(l,o,r):void 0,u=(i?.idRole?b(e,i.idRole):void 0)??v(e,["identifier"]),h=u?y(u,o,r):void 0,d={id:"root",role:"chart",label:i?.summaryTemplate?C(i.summaryTemplate,void 0,e,o,r,{count:r.length}):`${e.name}: ${r.length} ${1===r.length?"item":"items"} represented.`,level:1,children:[]};let p=0;const f=(t,n,a)=>{const s=h?t[h]:void 0,l=i?.itemLabelTemplate?C(i.itemLabelTemplate,t,e,o,r,{count:r.length}):function(e,t,n,r){const o=v(t,["nominal","ordinal"]),a=t.dataRoles.filter(e=>"quantitative"===e.semanticType),i=o?y(o,n,r):void 0,s=[];i&&null!=e[i]&&s.push(e[i]+"");for(const t of a){const o=y(t,n,r);o&&null!=e[o]&&s.push(`${t.role}: ${e[o]+""}`)}return s.length>0?s.join(", "):"Data item"}(t,e,o,r);return{id:"datum-"+V(s??n),role:"datum",label:l,level:a,datum:t}};if(c){const e=new Map;for(const t of r){const n=(t[c]??"Uncategorized")+"",r=e.get(n);r?r.push(t):e.set(n,[t])}d.children=[...e].map(([e,t],n)=>{const r=t.slice(0,Math.max(0,a-p));p+=r.length;const o=r.map((e,t)=>f(e,1e5*n+t,3));return t.length>r.length&&o.push({id:"more-"+V(e),role:"datum",label:`…and ${t.length-r.length} more items`,level:3}),{id:"group-"+V(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:o}})}else{const e=r.slice(0,a);d.children=e.map((e,t)=>f(e,t,2)),r.length>e.length&&d.children.push({id:"more",role:"datum",label:`…and ${r.length-e.length} more items`,level:2})}return d}(k,h,{maxLeaves:f,locale:p});const A={id:"root",role:"chart",label:z(u,h,{locale:p}).text||"Chart.",level:1,children:[]},S=function(t,n){const r=Array.isArray(t.annotations)?t.annotations:null;if(!r)return null;const o=e(r.filter(e=>!!e&&"object"==typeof e));if(0===o.length)return null;let a=0;const i=o.slice(0,n).map(e=>{const t=e.lifecycle?.status,n=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+a++,role:"annotation",level:3,label:`${r=U(e),r?r.charAt(0).toUpperCase()+r.slice(1):r}${n}.`,datum:e};var r});o.length>n&&i.push({id:"annotation-"+a++,role:"annotation",level:3,label:`…and ${o.length-n} more annotations.`});const s=o.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===s?"one marked feature":s+" marked features"}.`,children:i}}(h,f);if(K.has(u)){const e=function(e,t,n,r){const o=Array.isArray(t.nodes)?t.nodes:[],a=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],i=t.nodeIdAccessor??t.nodeIDAccessor,s=t.sourceAccessor??"source",l=t.targetAccessor??"target",c=t.valueAccessor??"value",u=e=>X(_(e,i,"id"),"unknown"),h=(e,t)=>X(_(e,t,""),"unknown"),d=new Set;for(const e of a)d.add(h(e,s)),d.add(h(e,l));const p=o.length>0?o:[...d].map(e=>({id:e})),f=new Map;for(const e of p)f.set(u(e),{links:0,value:0});for(const e of a){const t=h(e,s),n=h(e,l),r=Z(_(e,c,"value"))??0;for(const e of[t,n]){const t=f.get(e)??{links:0,value:0};t.links+=1,t.value+=r,f.set(e,t)}}const m={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${p.length} nodes and ${a.length} links.${ee(t,"network")}`,children:[]};let g=0;const $=new Map,y=t.colorBy??"group";for(const e of p){const t=X(_(e,y,"group"),"Ungrouped"),n=$.get(t);n?n.push(e):$.set(t,[e])}const b=[...$].map(([e,t],o)=>{const a=[];for(const[e,i]of t.entries()){if(g>=n)break;g+=1;const t=u(i),s=f.get(t)??{links:0,value:0},l=s.value>0?`, ${r(s.value)} total flow`:"";a.push({id:`node-${o}-${e}-${Y(t)}`,role:"datum",level:3,label:`${t}: ${s.links} ${1===s.links?"link":"links"}${l}.`,value:s.value>0?s.value:void 0,datum:i})}return{id:`nodes-${o}-${Y(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:a}});b.length>0&&m.children?.push(...b);const v=a.slice(0,n).map((e,t)=>{const n=h(e,s),o=h(e,l),a=Z(_(e,c,"value"));return{id:`link-${Y(n)}-${Y(o)}-${t}`,role:"datum",level:3,label:`${n} to ${o}${null==a?"":": "+r(a)}.`,value:a,datum:e}});return a.length>n&&v.push({id:"links-more",role:"datum",level:3,label:`…and ${a.length-n} more links.`,value:void 0}),v.length>0&&m.children?.push({id:"links",role:"series",level:2,label:`Links: ${a.length} ${1===a.length?"connection":"connections"}.`,children:v}),m}(u,h,f,w);return te(e,S),e}if(Q.has(u)){const e=function(e,t,n,r){const o=t.data&&"object"==typeof t.data?t.data:null,a=t.childrenAccessor??"children",i=t.valueAccessor??"value",s=t.nodeLabel??t.nodeIdAccessor;let l=0;const c=new WeakMap,u=e=>{const t=c.get(e);if(t)return t;const n=ne(e,a),r=0===n.length?{leaves:1,value:Z(_(e,i,"value"))??0,depth:1}:n.reduce((e,t)=>{const n=u(t);return{leaves:e.leaves+n.leaves,value:e.value+n.value,depth:Math.max(e.depth,n.depth+1)}},{leaves:0,value:0,depth:1});return c.set(e,r),r},h=(e,t,o)=>{const i=ne(e,a),c=X(_(e,s,"name"),"item "+o),d=u(e),p=d.value;if(0===i.length)return n>l?(l+=1,{id:`hierarchy-${Y(o)}-${Y(c)}`,role:"datum",level:t,label:`${c}${p>0?": "+r(p):""}.`,value:p>0?p:void 0,datum:e}):null;const f=i.map((e,n)=>h(e,t+1,`${o}-${n}`)).filter(e=>null!==e);return 0!==f.length||n>l||f.push({id:`hierarchy-${Y(o)}-more`,role:"datum",level:t+1,label:"More hierarchy items are not shown."}),{id:`hierarchy-${Y(o)}-${Y(c)}`,role:"series",level:t,label:`${c}: ${d.leaves} ${1===d.leaves?"descendant":"descendants"}${p>0?", total "+r(p):""}.`,children:f}},d=o?u(o):null,p={id:"root",role:"chart",label:o?`A ${"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"} chart with ${d.leaves} leaves across ${d.depth} hierarchy levels.`:"A hierarchy chart with no hierarchy data loaded.",level:1,children:[]};if(o){const e=h(o,2,"root");e&&(p.children="series"===e.role&&""===X(_(o,s,"name"),"")?e.children:[e])}return p}(u,h,f,w);return te(e,S),e}if(W.has(u)){const e=function(e,t,n,r){const o=function(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];const t=e;return Array.isArray(t.features)?t.features:"Feature"===t.type?[t]:[]}(t.areas),a="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],i=Array.isArray(t.flows)?t.flows:[],s=Array.isArray(t.lines)?t.lines:[],l=t.valueAccessor??t.sizeBy??t.costAccessor??"value",c=t.pointIdAccessor??t.nodeIdAccessor??"id",u={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${o.length} regions.`:"FlowMap"===e?`A flow map with ${i.length} flows and ${a.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${a.length} locations and ${s.length} routes.`:`A proportional-symbol map with ${a.length} locations.`}${ee(t,"geo")}`,children:[]},h=[],d="ChoroplethMap"===e?o:a;d.slice(0,n).forEach((n,o)=>{const a=X(re(n,"ChoroplethMap"===e?t.idAccessor:c,"id")??re(n,"name","name")??re(n,"label","label"),`${"ChoroplethMap"===e?"region":"location"} ${o+1}`),i=Z(re(n,l,"value"));h.push({id:`geo-${Y(a)}-${o}`,role:"datum",level:2,label:`${a}${null==i?"":": "+r(i)}.`,value:i,datum:n})}),d.length>n&&h.push({id:"geo-more",role:"datum",level:2,label:`…and ${d.length-n} more locations.`}),h.length>0&&u.children?.push({id:"ChoroplethMap"===e?"regions":"locations",role:"series",level:2,label:`${"ChoroplethMap"===e?"Regions":"Locations"}: ${d.length} marks.`,children:h.map(e=>({...e,level:3}))});const p="FlowMap"===e?i:s;if(p.length>0){const e=p.slice(0,n).map((e,t)=>{const n=X(e.source,"unknown"),o=X(e.target,"unknown"),a=Z(_(e,l,"value"));return{id:`route-${Y(n)}-${Y(o)}-${t}`,role:"datum",level:3,label:`${n} to ${o}${null==a?"":": "+r(a)}.`,value:a,datum:e}});u.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${p.length} ${1===p.length?"route":"routes"}.`,children:e})}return u}(u,h,f,w);return te(e,S),e}const x=Array.isArray(h.data)?h.data:null,P=r.has(u)||o.has(u)||a.has(u)||i.has(u);if(!x||0===x.length||!P)return S&&(A.children=[S]),A;const{measure:j,measureFallback:F,dimension:D,dimensionFallback:L}=s(u,h),B=t(j,F),M=n(D,L),N="string"==typeof j&&j?j:F,I="string"==typeof D&&D?D:L,T=l(h);let R=0;const O=e=>`${e}-${R++}`,E=(e,t)=>{const n=e.slice(0,f).map(e=>((e,t)=>{const n=B(e),r=c(M(e),w);return{id:O("datum"),role:"datum",level:t,label:`${r}: ${Number.isFinite(n)?w(n):"—"}`,value:Number.isFinite(n)?n:void 0,datum:e}})(e,t));return e.length>f&&n.push({id:O("more"),role:"datum",level:t,label:`…and ${e.length-f} more points`}),n},q=[];if(r.has(u)||o.has(u)){let e=1/0,t=-1/0,n=1/0,r=-1/0;const a=[];let i=!0;for(const o of x){const s=B(o);Number.isFinite(s)&&(e>s&&(e=s),s>t&&(t=s));const l=M(o);a.push(l),"number"==typeof l&&Number.isFinite(l)?(n>l&&(n=l),l>r&&(r=l)):i=!1}const s=new Set,l=[];for(const e of a){const t=e+"";s.has(t)||(s.add(t),l.push(e))}const h=i?`${w(n)} to ${w(r)}`:`${c(l[0],w)} to ${c(l[l.length-1],w)} (${o.has(u)?l.length+" categories":x.length+" points"})`;q.push({id:O("axis"),role:"axis",level:2,label:`${o.has(u)?"Category axis":"X axis"}: ${I}, ${h}.`}),e>t||q.push({id:O("axis"),role:"axis",level:2,label:`Value axis: ${N}, ${w(e)} to ${w(t)}.`})}if(T){const e=n(T,T),t=new Map;for(const n of x){const r=(e(n)??"—")+"",o=t.get(r);o?o.push(n):t.set(r,[n])}const r=[];for(const[e,n]of t){const t=z(u,{...h,data:n},{levels:["l2","l3"],locale:p}).text;r.push({id:O("series"),role:"series",level:2,label:`Series ${e}: ${t}`,children:E(n,3)})}A.children=[...q,...r]}else A.children=[...q,...E(x,2)];return S&&A.children.push(S),A}function ae(e,t){const n=[],r=e=>{if(n.push(e),e.children&&e.children.length>0&&t.has(e.id))for(const t of e.children)r(t)};return r(e),n}function ie(e){let t=1;if(e.children)for(const n of e.children)t+=ie(n);return t}var se=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]);function le(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ce(e){return le(e)?e:void 0}function ue(e){const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function he(e){const t=ue(e);return null==t?void 0:Math.max(0,Math.floor(t))}function de(...e){return e.map(ce).find(Boolean)}function pe(...e){return e.find(Array.isArray)}function fe(e){const t={};for(const[n,r]of Object.entries(e))void 0!==r&&(t[n]=r);return t}function me(e,t,n){return e["string"==typeof t&&t?t:n]}function ge(e){return e instanceof Date?e.toISOString():"number"==typeof e?Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+"":(e??"—")+""}function $e(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function ye(e){return Number.isInteger(e)?e+"":Math.round(1e3*e)/1e3+""}function be(e,t,n){const r=e?.filter(e=>!0===ce(e)?.sensor).length,o=ce(t?.observation),a=ce(o?.sensors),i=pe(n?.activeSensors);return Math.max(r??0,a?Object.keys(a).length:0,i?.length??0)||void 0}function ve(e,t,n={}){const{capability:r,audience:o,locale:a}=n,i=n.levels??["l1","l2","l3"],s=!1!==n.includeStructure,l=M(e,r),c=z(e,t,{levels:l?[...i,"l4"]:i,locale:a,capability:r,audience:o}),{l4:u,...h}=c.levels,d=["l1","l2","l3"].map(e=>c.levels[e]).filter(Boolean).join(" "),p={levels:h,text:c.annotations?`${c.annotations} ${d}`.trim():d,...c.annotations?{annotations:c.annotations}:{}};let f;if(l&&u){const e=(m=r)?"fits"in m||"buildProps"in m?{family:m.family}:{family:m.family,intentScores:m.intentScores}:{};f={act:l,sentence:u,family:e.family,intentScores:e.intentScores}}var m;const g=s?oe(e,t,{maxLeaves:n.maxLeaves,locale:a}):void 0,$=function(e,t,n){if(!1===n)return;const r=le(n)?n:void 0,o=ce(t.physics),a=de(r?.snapshot,o?.snapshot,t.physicsSnapshot,function(e){const t=ce(e);return!!t&&(le(t.world)||"simulationState"in t||"liveBodyOrder"in t)}(t.snapshot)?t.snapshot:void 0),i=de(r?.evidence,o?.evidence,t.physicsEvidence,t.settledEvidence),s=de(r?.config,o?.config,a?.config,t.config),l=de(ce(a?.world),ce(o?.world)),c=de(ce(s?.kernel),ce(l?.options)),u=pe(l?.bodies),h=pe(l?.colliders,s?.colliders),d=pe(a?.queue,o?.queue),p=pe(a?.liveBodyOrder),f=pe(l?.springs),m=pe(a?.activeSensorPairs),g=function(e){if(!e||0===e.length)return;const t=e.map((e,t)=>{const n=ce(e);if(!n)return;const r=ue(n.count??n.value??n.total??n.bodies??n.events);if(null==r)return;const o=(n.label??n.id??n.name??"container "+(t+1))+"",a=null==n.id?void 0:n.id+"",i=ue(n.secondary??n.secondaryCount),s=ue(n.observed??n.observedCount);return fe({id:a,label:o,count:r,secondary:i,secondaryLabel:"string"==typeof n.secondaryLabel?n.secondaryLabel:void 0,observed:s})}).filter(e=>null!=e);if(0===t.length)return;const n=t.reduce((e,t)=>e+t.count,0),r=t.filter(e=>e.count>0).length,o=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:n,populatedCount:r,...o?{leader:o}:{}}}(function(e,t,n,r){const o=ce(e.settledProjection),a=ce(t?.settledProjection);return pe(n?.projectionRows,n?.aggregates,e.settledProjectionRows,e.projectionRows,o?.rows,t?.settledProjectionRows,t?.projectionRows,a?.rows,r?.binCounts)}(t,o,r,i)),$=function(e,t){const n=e?.map((e,t)=>{const n=ce(e);if(!n)return;const r=ue(n.count)??0,o=ue(n.total),a={label:(n.label??n.id??"sediment "+(t+1))+"",count:r};return null!=n.id&&(a.id=n.id+""),null!=o&&(a.total=o),a}).filter(e=>null!=e),r=he(t?.bins)??n?.length??0,o=ue(t?.count)??n?.reduce((e,t)=>e+t.count,0)??0,a=ue(t?.total)??n?.reduce((e,t)=>e+(t.total??0),0),i=n?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==r||0!==o||a)return{bins:r,count:o,...null!=a&&a>0?{total:a}:{},...i?{leader:i}:{}}}(pe(r?.sediment,o?.sediment,a?.sediment),de(r?.sedimentTotals,o?.sedimentTotals)),y=p?.length??u?.length??he(i?.bodyCount),b=function(e){if(e)return e.filter(e=>!0===ce(e)?.sleeping).length}(u)??he(i?.sleepingCount),v=d?.length,C="string"==typeof a?.simulationState?a.simulationState:void 0,w="boolean"==typeof i?.settled?i.settled:C?"settled"===C:null!=y||null!=b||null!=v?null!=y&&b===y&&0===(v??0):void 0,k=ce(c?.gravity),A=ue(k?.x),S=ue(k?.y),x=fe({state:C,settled:w,elapsedSeconds:ue(a?.elapsedSeconds),paused:"boolean"==typeof a?.paused?a.paused:void 0,visible:"boolean"==typeof a?.visible?a.visible:void 0,seed:ue(c?.seed),gravity:null!=A&&null!=S?{x:A,y:S}:void 0,fixedDt:ue(s?.fixedDt??c?.fixedDt),timeScale:ue(s?.timeScale),maxSubsteps:he(s?.maxSubsteps),liveBodies:y,sleepingBodies:b,queued:v,bodyLimit:ue(s?.bodyLimit),eviction:"string"==typeof s?.eviction?s.eviction:void 0}),P=fe({colliders:h?.length,sensors:be(h,s,l),springs:f?.length,activeSensorPairs:m?.length}),j=Object.keys(P).length>0,F=se.has(e);if(!(Object.keys(x).length>0||j||g||$)||!F&&null==n)return;const D={simulation:x,...j?{geometry:P}:{},...g?{aggregates:g}:{},...$?{sediment:$}:{}},L=function(e){const t=[],n=e.simulation,r=[n.state??(n.settled?"settled":void 0),null!=n.liveBodies?`${n.liveBodies} live ${$e(n.liveBodies,"body")}`:void 0,null!=n.sleepingBodies?n.sleepingBodies+" sleeping":void 0,null!=n.queued?n.queued+" queued":void 0,null!=n.seed?"seed "+ye(n.seed):void 0,n.gravity?`gravity (${ye(n.gravity.x)}, ${ye(n.gravity.y)})`:void 0,null!=n.fixedDt?`fixed step ${ye(n.fixedDt)}s`:void 0,null!=n.timeScale?ye(n.timeScale)+"x time":void 0].filter(Boolean);r.length>0&&t.push(`Physics simulation: ${r.join("; ")}.`);const o=e.geometry;if(o){const e=[null!=o.colliders?`${o.colliders} ${$e(o.colliders,"collider")}`:void 0,null!=o.sensors?`${o.sensors} ${$e(o.sensors,"sensor")}`:void 0,null!=o.springs?`${o.springs} ${$e(o.springs,"spring")}`:void 0,null!=o.activeSensorPairs?`${o.activeSensorPairs} active sensor ${$e(o.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}const a=e.aggregates;if(a){const e=a.leader,n=e?` Largest is ${e.label} with ${ye(e.count)}.`:"";t.push(`Physics aggregates: ${ye(a.totalCount)} settled ${$e(a.totalCount,"body")} across ${a.rows.length} ${$e(a.rows.length,"container")}; ${a.populatedCount} populated.${n}`)}const i=e.sediment;if(i){const e=null!=i.total?", value total "+ye(i.total):"",n=i.leader?`; largest sediment bin is ${i.leader.label} with ${ye(i.leader.count)}`:"";t.push(`Physics sediment: ${i.count} retained ${$e(i.count,"body")} in ${i.bins} ${$e(i.bins,"bin")}${e}${n}.`)}return t.join(" ")}(D);return{...D,text:L}}(e,t,n.physics),y=function(e,t,n){const r=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&r.push(`Current value is ${ge(t.value)}.`);const e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,n="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;r.push(`The gauge scale runs from ${ge(e)} to ${ge(n)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){const o=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&r.push(`The ProcessSankey time domain runs from ${ge(t.domain[0])} to ${ge(t.domain[1])}.`),o.length>0){r.push(`${o.length} source flow${1===o.length?"":"s"} are supplied.`);for(const a of o.slice(0,n)){const n=me(a,t.sourceAccessor,"source"),o=me(a,t.targetAccessor,"target"),i=me(a,t.valueAccessor,"value");r.push("ProcessSankey"!==e||null==a.startTime&&null==a.endTime?`${ge(n)} to ${ge(o)} has value ${ge(i)}.`:`${ge(n)} to ${ge(o)} has value ${ge(i)} over ${ge(a.startTime)}–${ge(a.endTime)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){const e=ce(t.data),o="string"==typeof t.childrenAccessor&&t.childrenAccessor?t.childrenAccessor:"children",a="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",i="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",s=[],l=e=>{const t=Array.isArray(e[o])?e[o]:[];if(0!==t.length)for(const e of t){const t=ce(e);t&&l(t)}else s.push(e)};if(e&&l(e),s.length>0){r.push(s.length+" hierarchy leaves are supplied.");for(const e of s.slice(0,n))r.push(`${ge(e[i])} has value ${ge(e[a])}.`)}}if(se.has(e)&&Array.isArray(t.data)){const n=t.data;r.push(`${n.length} observed source row${1===n.length?"":"s"} are supplied.`);const o="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,a="CollisionSwarmChart"===e?"x":"value",i=n.map(e=>ue(me(e,o,a))).filter(e=>null!=e);i.length>0&&r.push(`Observed ${"string"==typeof o?o:a} ranges from ${ge(Math.min(...i))} to ${ge(Math.max(...i))}.`)}if(0!==r.length)return{source:"chart-props",statements:r,text:"Exact chart-prop facts: "+r.join(" ")}}(e,t,Math.max(1,n.maxLeaves??200)),b=[p.text,f?.sentence,$?.text,y?.text].filter(Boolean).join(" ");return{component:e,description:p,intent:f,structure:g,physics:$,facts:y,text:b}}var Ce=["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"],we=new Set(Ce);function ke(e){return we.has(e)}var Ae=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend","recipe","layout"]),Se=new Set(["data","nodes","edges","points","areas","lines","flows"]);function xe(e){if(null==e)return e;if("function"==typeof e)return;if("object"!=typeof e)return e;if(e.$$typeof)return;if(Array.isArray(e))return e.map(xe).filter(e=>void 0!==e);if(e instanceof Date)return e;const t={};for(const[n,r]of Object.entries(e)){if("function"==typeof r)continue;if(r&&"object"==typeof r&&r.$$typeof)continue;const e=xe(r);void 0!==e&&(t[n]=e)}return t}function Pe(e,t){return!!Se.has(e)&&("areas"!==e||"string"!=typeof t)}var je="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e));function Fe(e,t,n){const r=d(e)??p(t.recipe)??p(t.recipeId);if(r)return function(e,t,n){const r=function(e,t,n){const r={};for(const[o,a]of Object.entries(e))if(null!=a&&!Ae.has(o)&&"recipeId"!==o&&(t||!Pe(o,a)))if("function"==typeof a||a?.$$typeof){if(n)throw Error(`Portable recipe prop "${o}" is not JSON-safe.`)}else if(u(a))r[o]=je(a);else if(n)throw Error(`Portable recipe prop "${o}" is not JSON-safe.`);return r}(t,!1!==n?.includeData,"portable"===e.portability),o=e.intents.map(f).filter(e=>!!e),a={name:e.name,intents:o,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily};if("portable"===e.portability){if(!u(r))throw Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:r,manifest:a,version:"1",createdAt:(new Date).toISOString(),...n?.selections?{selections:n.selections}:{}}}return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:"Recipe contains or may depend on non-serializable local layout callbacks.",warnings:["This config is inspectable but cannot be rendered remotely by CLI or MCP."],props:r,manifest:a,version:"1",createdAt:(new Date).toISOString(),...n?.selections?{selections:n.selections}:{}}}(r,t,n);if(!ke(e))throw Error(`Unknown component "${e}". Known components: ${Ce.join(", ")}`);const o=!1!==n?.includeData,a={};for(const[e,n]of Object.entries(t))if(null!=n&&!Ae.has(e)&&(o||!Pe(e,n))&&"function"!=typeof n&&!n?.$$typeof)try{a[e]=je(xe(n))}catch{}return{component:e,props:a,version:"1",createdAt:(new Date).toISOString(),...n?.selections?{selections:n.selections}:{}}}function De(e){if(!e.component||!e.props)throw Error("Invalid chart config: missing component or props");if("ChartRecipe"===e.component||"LocalChartRecipe"===e.component){if(!e.recipeId)throw Error("Invalid chart recipe config: missing recipeId");const t=d(e.recipeId);if(!t)throw Error(`Unknown chart recipe "${e.recipeId}". Register it before deserializing this config.`);if("LocalChartRecipe"!==e.component&&!1!==e.portable&&"portable"!==t.portability)throw Error(`Chart recipe "${e.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...je(e.props),recipeId:e.recipeId}}}if(!ke(e.component))throw Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:je(e.props)}}function Le(e){const t=JSON.stringify(e);return"sc="+btoa(unescape(encodeURIComponent(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Be(e){const t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw Error("No chart config found in URL (missing 'sc' parameter)");const n=t.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(escape(atob(n)));return JSON.parse(r)}async function Me(e,t="json"){const n="jsx"===t?Ne(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(n)}function Ne(e){const{props:t}=e,n=["<"+("LocalChartRecipe"===e.component?"ChartRecipe":e.component)];e.recipeId&&n.push(` recipeId="${e.recipeId}"`);for(const[e,r]of Object.entries(t))if("string"==typeof r)n.push(` ${e}="${r}"`);else if("boolean"==typeof r&&!0===r)n.push(" "+e);else if("boolean"==typeof r&&!1===r)n.push(` ${e}={false}`);else if("number"==typeof r)n.push(` ${e}={${r}}`);else{const t=JSON.stringify(r);n.push(80>t.length?` ${e}={${t}}`:` ${e}={${JSON.stringify(r,null,2)}}`)}return n.push("/>"),n.join("\n")}export{d as getChartRecipe,f as recipeIntentId,m as recipeConfig,y as fieldForRole,B as communicativeActForIntent,M as resolveCommunicativeAct,z as describeChart,oe as buildNavigationTree,ae as flattenVisible,ie as countNodes,ve as buildReaderGrounding,Fe as toConfig,De as fromConfig,Le as toURL,Be as fromURL,Me as copyConfig,Ne as configToJSX};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{renderRectPulse as t}from"./c-GPYOFETM.min.js";import{buildLinearFillGradient as e,clampCornerRadii as o,filterSparseArray as n,hasAnyCornerRadius as i,resolveCSSColor as r,resolveCanvasFill as s,resolveOrdinalAxisChrome as a,resolveXYAxisChrome as l}from"./c-GIKRQI4X.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 o of t){const t=e?e(o):o;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}};function c(t){return t===1/0?1/0:Number.isFinite(t)?Math.max(0,Math.floor(t)):5e3}function u(t){return t===1/0?1/0:Number.isFinite(t)?Math.max(1,Math.floor(t)):5e3}var f=class{constructor(t,e){this.lastBoundedData=null,this.chunkTimer=null,this.pushBuffer=[],this.flushScheduled=!1,this.callback=t,this.chunkThreshold=c(e?.chunkThreshold),this.chunkSize=u(e?.chunkSize)}updateChunkOptions(t){this.chunkThreshold=c(t.chunkThreshold),this.chunkSize=u(t.chunkSize)}clearLastData(){this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1,null!==this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=null)}setBoundedData(t){if(t=n(t),this.lastBoundedData===t)return;if(this.lastBoundedData=t,null!==this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=null),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 o=()=>{if(e>=t.length)return void(this.chunkTimer=null);if(t!==this.lastBoundedData)return void(this.chunkTimer=null);const n=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,n),bounded:!1}),e=n,this.chunkTimer=t.length>e?requestAnimationFrame(o):null};this.chunkTimer=t.length>e?requestAnimationFrame(o):null}setReplacementData(t){if(t=n(t),this.lastBoundedData=t,null!==this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=null),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 o=()=>{if(e>=t.length)return void(this.chunkTimer=null);if(t!==this.lastBoundedData)return void(this.chunkTimer=null);const n=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,n),bounded:!1}),e=n,this.chunkTimer=t.length>e?requestAnimationFrame(o):null};this.chunkTimer=t.length>e?requestAnimationFrame(o):null}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 o=0;t.length>o;o++){const n=t[o];null!=n&&"object"==typeof n&&(this.pushBuffer.push(n),e++)}0!==e&&this.scheduleFlush()}flush(){this.flushPushBuffer()}clear(){null!==this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=null),this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1}},d={stops:[{offset:0,opacity:.8},{offset:1,opacity:.05}]};function g(t,e=d){if(t)return!0===t?e:"stops"in t?Array.isArray(t.stops)?t:void 0:"colorStops"in t?Array.isArray(t.colorStops)?{stops:t.colorStops.map(({offset:t,color:e})=>({offset:t,color:e}))}:void 0:{stops:[{offset:0,opacity:t.topOpacity??e.stops[0]?.opacity??.8},{offset:1,opacity:t.bottomOpacity??e.stops.at(-1)?.opacity??.05}]}}function y(t){return t?g(t):void 0}function p(t){if(t)return Array.isArray(t)?{stops:t.map(({at:t,color:e,opacity:o})=>({offset:t/100,color:e,...null!=o&&{opacity:o}}))}:Array.isArray(t.stops)?t:void 0}function m(t){const e=t?.stops.filter(t=>"string"==typeof t.color&&Number.isFinite(t.offset)).map(({offset:t,color:e,opacity:o})=>({offset:Math.max(0,Math.min(1,t)),color:e,...Number.isFinite(o)&&{opacity:Math.max(0,Math.min(1,o))}})).sort((t,e)=>t.offset-e.offset);if(!e?.length)return;const o=e[0];return o.offset>0?[{...o,offset:0},...e]:e}function _(t){return{stops:t.stops.map(t=>({...t,offset:1-t.offset})).sort((t,e)=>t.offset-e.offset)}}function v(t,e,o,n){return"string"==typeof t?{key:t,fn:null}:"function"==typeof t?{key:o,fn:t}:"string"==typeof e?{key:e,fn:null}:"function"==typeof e?{key:n,fn:e}:{key:void 0,fn:null}}function k(t,e,o){return n=>{if(!n||!o||!t.fn&&!e.fn)return n;let i=!1;const r=n.map(o=>{const n=t.fn&&t.key&&!(t.key in o),r=e.fn&&e.key&&!(e.key in o);if(!n&&!r)return o;i=!0;const s={...o};return n&&(s[t.key]=t.fn(o)),r&&(s[e.key]=e.fn(o)),s});return i?r:n}}function x(t,e){return t.__legendMarginReservedFor===e}function T(t,e){return{legendLayout:t.legendLayout,axisChrome:l({showAxes:t.showAxes,xLabel:t.xLabel,yLabel:t.yLabel,yLabelRight:t.yLabelRight,axes:t.axes}),legendMarginReserved:x(t,e)}}function b(t,e){return{legendLayout:t.legendLayout,axisChrome:a({showAxes:t.showAxes,projection:t.projection,hasCategoryLabel:!!(t.categoryLabel??t.oLabel),hasValueLabel:!!(t.valueLabel??t.rLabel)}),legendMarginReserved:x(t,e)}}function w(t){return new Set(Array.isArray(t)?t:[t])}function A(t){for(const e of t){if(void 0!==e._targetOpacity){const t=e._targetOpacity;e.style={...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}if("point"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0);else if("glyph"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.size=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0);else if("rect"===e.type||"heatcell"===e.type)void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0);else if("candlestick"===e.type)void 0!==e._targetX&&(e.x=e._targetX,void 0!==e._targetOpenY&&(e.openY=e._targetOpenY),void 0!==e._targetCloseY&&(e.closeY=e._targetCloseY),void 0!==e._targetHighY&&(e.highY=e._targetHighY),void 0!==e._targetLowY&&(e.lowY=e._targetLowY),e._targetX=void 0,e._targetOpenY=void 0,e._targetCloseY=void 0,e._targetHighY=void 0,e._targetLowY=void 0);else if("line"===e.type||"area"===e.type){if(e._introClipFraction=void 0,"line"===e.type&&e._targetPath){for(let t=0;e.path.length>t;t++)e.path[t]=e._targetPath[t];e._prevPath=void 0,e._targetPath=void 0}if("area"===e.type){if(e._targetTopPath)for(let t=0;e.topPath.length>t;t++)e.topPath[t]=e._targetTopPath[t];if(e._targetBottomPath)for(let t=0;e.bottomPath.length>t;t++)e.bottomPath[t]=e._targetBottomPath[t];e._prevTopPath=void 0,e._prevBottomPath=void 0,e._targetTopPath=void 0,e._targetBottomPath=void 0}}}}function F(t){for(const e of t){if(void 0!==e._targetOpacity){const t=e._targetOpacity;e.style={...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}"point"===e.type?void 0!==e._targetX?(e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0):void 0!==e._targetR&&(e.r=e._targetR,e._targetR=void 0):"rect"===e.type?void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0):"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0)}}function Y(t,e,o){return"exact"===o?function(t,e){const o=t.domain(),n=o[0],i=o[o.length-1],r=n instanceof Date,s=n instanceof Date?n.getTime():n,a=i instanceof Date?i.getTime():i;if(2>e||s===a)return r?[new Date(s),new Date(a)]:[s,a];const l=(a-s)/(e-1),h=Array(e);for(let t=0;e>t;t++){const o=t===e-1?a:s+t*l;h[t]=r?new Date(o):o}return h}(t,e):t.ticks(e)}function S(t,e){const{x:n,y:i,w:r,h:s}=e,{tl:a,tr:l,br:h,bl:c}=o(e);t.beginPath(),t.moveTo(n+a,i),t.lineTo(n+r-l,i),l>0&&t.arcTo(n+r,i,n+r,i+l,l),t.lineTo(n+r,i+s-h),h>0&&t.arcTo(n+r,i+s,n+r-h,i+s,h),t.lineTo(n+c,i+s),c>0&&t.arcTo(n,i+s,n,i+s-c,c),t.lineTo(n,i+a),a>0&&t.arcTo(n,i,n+a,i,a),t.closePath()}function P(t,o){const n=s(t,o.style.fill,r(t,"var(--semiotic-primary, #007bff)")),i=function(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}}}(o);return(o.fillGradient&&"string"==typeof n?e(t,o.fillGradient,n,i.x0,i.y0,i.x1,i.y1):null)||n}function M(t,e){if(!e.style.stroke||"none"===e.style.stroke)return!1;const o=e.style.strokeWidth??1;return o>0&&(t.strokeStyle=r(t,e.style.stroke)||e.style.stroke,t.lineWidth=o,!0)}var B=(e,o,n,r)=>{const s=o.filter(t=>"rect"===t.type);for(const o of s){if(null!=o.style.opacity&&(e.globalAlpha=o.style.opacity),o.style.icon)R(e,o);else if(o.cornerRadii&&i(o.cornerRadii))e.fillStyle=P(e,o),S(e,o),e.fill(),M(e,o)&&e.stroke();else if(o.roundedTop&&o.roundedTop>0){e.fillStyle=P(e,o);const t=Math.min(o.roundedTop,o.w/2,o.h/2);e.beginPath();const{x:n,y:i,w:r,h:s}=o;switch(o.roundedEdge){case"right":e.moveTo(n,i),e.lineTo(n+r-t,i),e.arcTo(n+r,i,n+r,i+t,t),e.lineTo(n+r,i+s-t),e.arcTo(n+r,i+s,n+r-t,i+s,t),e.lineTo(n,i+s);break;case"left":e.moveTo(n+r,i),e.lineTo(n+t,i),e.arcTo(n,i,n,i+t,t),e.lineTo(n,i+s-t),e.arcTo(n,i+s,n+t,i+s,t),e.lineTo(n+r,i+s);break;case"bottom":e.moveTo(n,i),e.lineTo(n+r,i),e.lineTo(n+r,i+s-t),e.arcTo(n+r,i+s,n+r-t,i+s,t),e.lineTo(n+t,i+s),e.arcTo(n,i+s,n,i+s-t,t);break;default:e.moveTo(n,i+s),e.lineTo(n,i+t),e.arcTo(n,i,n+t,i,t),e.lineTo(n+r-t,i),e.arcTo(n+r,i,n+r,i+t,t),e.lineTo(n+r,i+s)}e.closePath(),e.fill(),M(e,o)&&e.stroke()}else e.fillStyle=P(e,o),e.fillRect(o.x,o.y,o.w,o.h),M(e,o)&&e.strokeRect(o.x,o.y,o.w,o.h);t(e,o),e.globalAlpha=1}};function R(t,e){const o=e.style.icon,n=e.style.iconPadding||2,i=Math.min(e.w,e.h)-n;if(0>=i)return;const r=e.h>e.w;if(t.save(),t.beginPath(),t.rect(e.x,e.y,e.w,e.h),t.clip(),r){const r=i+n,s=e.x+(e.w-i)/2;for(let n=e.y+e.h-i;n>=e.y-i;n-=r)t.drawImage(o,s,n,i,i)}else{const r=i+n,s=e.y+(e.h-i)/2;for(let n=e.x;e.x+e.w>n;n+=r)t.drawImage(o,n,s,i,i)}t.restore()}function L(t,e,o,n,i,r){const s=[];for(const i of t){const t=o(i),r=n(i);Number.isFinite(t)&&Number.isFinite(r)&&s.push({px:e.x(t),py:e.y(r),rawY:r,d:i})}s.sort((t,e)=>t.px-e.px);const a=Array(s.length),l=Array(s.length),h=Array(s.length);for(let t=0;s.length>t;t++){const e=s[t];a[t]=[e.px,e.py],l[t]=e.rawY,h[t]=e.d}return{type:"line",path:a,rawValues:l,style:i,datum:h,group:r}}function X(t,e,o,n,i,r,s,a){const l=[];for(const r of t){const t=o(r),s=n(r);if(!Number.isFinite(t)||!Number.isFinite(s))continue;const h=e.x(t),c=a?a(r):i;l.push({px:h,topY:e.y(s),botY:e.y(c),rawY:s})}l.sort((t,e)=>t.px-e.px);const h=Array(l.length),c=Array(l.length),u=Array(l.length);for(let t=0;l.length>t;t++){const e=l[t];h[t]=[e.px,e.topY],c[t]=[e.px,e.botY],u[t]=e.rawY}return{type:"area",topPath:h,bottomPath:c,rawValues:u,style:r,datum:t,group:s}}function N(t,e,o,n){const i=new Map;if("silhouette"===n)for(const n of t){let t=0;for(const i of e)t+=o(i,n)||0;i.set(n,-t/2)}else if("wiggle"===n){t.length>0&&i.set(t[0],0);for(let n=1;t.length>n;n++){const r=t[n-1],s=t[n];let a=0,l=0,h=0;for(const t of e){const e=o(t,s)||0;a+=(2*h+e)*(e-(o(t,r)||0)),l+=e,h+=e}const c=i.get(r)??0;i.set(s,c-(l>0?a/(2*l):0))}if(t.length>0){let n=0;for(const r of t){let t=0;for(const n of e)t+=o(n,r)||0;n+=(i.get(r)??0)+t/2}const r=n/t.length;for(const e of t)i.set(e,(i.get(e)??0)-r)}}else for(const e of t)i.set(e,0);return i}function D(t,e,o){let n=0,i=0;for(const r of t){let t=0,s=0;for(const n of e){const e=o(n,r)||0;0>e?s+=e:t+=e}n>s&&(n=s),t>i&&(i=t)}return[n,i]}function z(t,e,o,n,i,r,s,a="zero"){const l=new Set;for(const e of t)for(const t of e.data){const e=o(t);Number.isFinite(e)&&l.add(e)}const h=Array.from(l).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=o(i),r=n(i);Number.isFinite(e)&&Number.isFinite(r)&&t.set(e,(t.get(e)||0)+r)}c.set(e.key,t)}let u;if(r){u=new Map;for(const e of h){let o=0;for(const n of t)o+=c.get(n.key)?.get(e)||0;u.set(e,o||1)}}const f=N(h,t.map(t=>t.key),(t,e)=>c.get(t)?.get(e)||0,a),d="diverging"===a&&!r,g=[],y=new Map,p=new Map,m=new Map,_=new Map;for(const t of h)p.set(t,f.get(t)??0),m.set(t,0),_.set(t,0);for(const o of t){const t=c.get(o.key),n=new Map;let a=[],l=[];const f=()=>{if(a.length>=2){const t={type:"area",topPath:a,bottomPath:l,style:i(o.key,o.data[0]),datum:o.data,group:o.key};s&&(t.curve=s),g.push(t)}a=[],l=[]};for(const o of h){const i=t.has(o);let s,h,c=i?t.get(o):0;if(r&&i&&(c/=u.get(o)),!i||!Number.isFinite(c)||0===c){f();continue}d?c>0?(s=m.get(o),h=s+c,m.set(o,h)):(s=_.get(o),h=s+c,_.set(o,h)):(s=p.get(o),h=s+c,p.set(o,h));const g=e.x(o);l.push([g,e.y(s)]),a.push([g,e.y(h)]),n.set(o,h)}f(),y.set(o.key,n)}return{nodes:g,stackedTops:y}}function O(t,e,o,n,i,r,s){const a=o(t),l=n(t);if(!Number.isFinite(a)||!Number.isFinite(l))return null;const h={type:"point",x:e.x(a),y:e.y(l),r:i,style:r,datum:t};return void 0!==s&&(h.pointId=s),h}function C(t,e,o,n,i,r,s,a){const l=o(t),h=n(t);if(!Number.isFinite(l)||!Number.isFinite(h))return null;const c={type:"symbol",x:e.x(l),y:e.y(h),size:i,symbolType:r,style:s,datum:t};return void 0!==a&&(c.pointId=a),c}function H(t,e,o,n,i,r,s){return{type:"rect",x:t,y:e,w:o,h:n,style:i,datum:r,group:s}}function j(t,e,o,n,i,r,s){const a={type:"heatcell",x:t,y:e,w:o,h:n,fill:i,datum:r};return void 0!==s?.value&&(a.value=s.value),s?.showValues&&(a.showValues=!0,s.valueFormat&&(a.valueFormat=s.valueFormat)),a}export{f as DataSourceAdapter,h as IncrementalExtent,w as toIdSet,L as buildLineNode,X as buildAreaNode,N as computeStackOffsets,D as computeDivergingStackExtent,z as buildStackedAreaNodes,O as buildPointNode,C as buildSymbolNode,H as buildRectNode,j as buildHeatcellNode,g as normalizeGradient,y as normalizeColorGradient,p as normalizeSemanticGradient,m as semanticLineStopsForGradient,_ as reverseGradient,A as snapXYIntroTargets,F as snapOrdinalIntroTargets,Y as ticksForMode,v as resolveAnnotationAccessor,k as buildEnrichAnnotationData,B as barCanvasRenderer,T as xyFrameLegendOptions,b as ordinalFrameLegendOptions};
|