semiotic 3.10.0 → 3.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -72
- package/ai/artifact-surface-inventory.json +4 -1
- package/ai/componentMetadata.cjs +3 -1
- package/ai/dist/mcp-server.js +47 -46
- package/ai/examples.md +95 -0
- package/ai/reference.md +80 -1
- package/ai/schema.json +7304 -1990
- package/ai/surface-manifest.json +26 -4
- package/ai/task-packets/compare-category-totals.json +7 -53
- package/ai/task-packets/compare-category-totals.md +4 -4
- package/ai/task-packets/correct-published-chart.json +7 -53
- package/ai/task-packets/correct-published-chart.md +4 -4
- package/ai/task-packets/index.json +9 -9
- package/ai/task-packets/update-live-chart.json +8 -54
- package/ai/task-packets/update-live-chart.md +4 -4
- package/dist/c-27DCB5T6.min.js +18 -0
- package/dist/c-2MONF2P6.min.js +1 -0
- package/dist/c-2TW5H5PD.min.js +1 -0
- package/dist/c-3AGX252H.min.js +1 -0
- package/dist/c-3B6JZEZT.min.js +1 -0
- package/dist/c-3BYZXCX3.min.js +4 -0
- package/dist/c-3DIPZJDO.min.js +1 -0
- package/dist/c-3FOUMWLR.min.js +1 -0
- package/dist/c-3NA6I656.min.js +2 -0
- package/dist/c-3OFVBWQY.min.js +1 -0
- package/dist/{c-QA3HMQJP.min.js → c-3PFVJFBK.min.js} +1 -1
- package/dist/c-3PPO7ZJF.min.js +4 -0
- package/dist/c-3YEW2PK6.min.js +1 -0
- package/dist/c-4JKDJUYD.min.js +1 -0
- package/dist/c-4LKK5YWB.min.js +1 -0
- package/dist/c-4MD53L2J.min.js +33 -0
- package/dist/c-4V3CD337.min.js +1 -0
- package/dist/c-4XLHPQTP.min.js +1 -0
- package/dist/c-5NYONM6V.min.js +5 -0
- package/dist/c-6IVBV5NO.min.js +1 -0
- package/dist/c-6ZU3QVLB.min.js +100 -0
- package/dist/c-72CBVNYX.min.js +209 -0
- package/dist/c-7APWCEPL.min.js +1 -0
- package/dist/c-7ASK4WBF.min.js +1 -0
- package/dist/{c-ORLEBW72.min.js → c-7FKPPCGN.min.js} +1 -1
- package/dist/c-7LY46QUI.min.js +41 -0
- package/dist/c-ABMGCCLT.min.js +1 -0
- package/dist/c-AINGQGUN.min.js +1 -0
- package/dist/c-AKLBQMQF.min.js +391 -0
- package/dist/c-AXJ2QI3F.min.js +1 -0
- package/dist/c-BQYD7T4E.min.js +1 -0
- package/dist/{c-V4XMSLC3.min.js → c-BYJJ7EMG.min.js} +1 -1
- package/dist/{c-JO2UGTCP.min.js → c-C4KIXUWU.min.js} +1 -1
- package/dist/c-C4SXYFXL.min.js +1 -0
- package/dist/c-CLDCKFBE.min.js +1 -0
- package/dist/c-CLJCJSFU.min.js +1 -0
- package/dist/c-CLLCX3PT.min.js +2 -0
- package/dist/c-ECHBKW7U.min.js +1 -0
- package/dist/c-EPJWM2UT.min.js +1 -0
- package/dist/c-F2GGJB2S.min.js +31 -0
- package/dist/c-FD2BXSRG.min.js +1 -0
- package/dist/c-FDUQDCBC.min.js +51 -0
- package/dist/c-FOTTQHOO.min.js +1 -0
- package/dist/c-FU7A5KSY.min.js +1 -0
- package/dist/c-G53AVC42.min.js +113 -0
- package/dist/c-GHN6IR4Y.min.js +1 -0
- package/dist/c-GSCO3FWL.min.js +1 -0
- package/dist/c-GYLOSK7M.min.js +1 -0
- package/dist/c-HK4OSLZA.min.js +1 -0
- package/dist/c-HLGTD5SJ.min.js +1 -0
- package/dist/c-HQ27AHMC.min.js +1 -0
- package/dist/{c-D6HAAPTX.min.js → c-IBRLFKWA.min.js} +1 -1
- package/dist/c-IHWZ2C6D.min.js +26 -0
- package/dist/c-IIV73MUW.min.js +1 -0
- package/dist/c-IPYGNVN6.min.js +116 -0
- package/dist/c-JJKRER47.min.js +1 -0
- package/dist/c-JO6AYCU4.min.js +1 -0
- package/dist/c-JWHPG6S2.min.js +1 -0
- package/dist/c-JXVYIXTV.min.js +1 -0
- package/dist/c-K2ZIYDI3.min.js +1 -0
- package/dist/c-K37JAIWA.min.js +4 -0
- package/dist/c-KGROWFT2.min.js +9 -0
- package/dist/c-MOP2NGLH.min.js +1 -0
- package/dist/c-MTX2AO5S.min.js +1 -0
- package/dist/c-N5WT7TXG.min.js +1 -0
- package/dist/c-NATWERHZ.min.js +1 -0
- package/dist/{c-42PLDTX7.min.js → c-O53GOO7H.min.js} +1 -1
- package/dist/c-OVQB75PE.min.js +1 -0
- package/dist/c-P3SKRNZN.min.js +1 -0
- package/dist/c-P5NXQWIM.min.js +1 -0
- package/dist/c-P7BQMVQQ.min.js +1 -0
- package/dist/{c-GNTXRXRN.min.js → c-PDQHLOKU.min.js} +1 -1
- package/dist/c-PKY4JFY5.min.js +1 -0
- package/dist/c-PQOZPM4G.min.js +1 -0
- package/dist/c-PZ3NEGNG.min.js +1 -0
- package/dist/c-QXLDCATV.min.js +1 -0
- package/dist/c-R2HUSWKB.min.js +1 -0
- package/dist/{c-HYW2XA4Q.min.js → c-RHDOOQ4X.min.js} +1 -1
- package/dist/c-RZPP5ERV.min.js +1 -0
- package/dist/c-SG2Y7EBY.min.js +46 -0
- package/dist/{c-WUWXGQYA.min.js → c-SJIB5RNI.min.js} +1 -1
- package/dist/c-SQNEVNWT.min.js +1 -0
- package/dist/c-STHZWF3D.min.js +1 -0
- package/dist/c-TIDKVMMZ.min.js +1 -0
- package/dist/c-TIMGODBG.min.js +1 -0
- package/dist/c-TR7OHUAO.min.js +2 -0
- package/dist/c-TTKWXGAI.min.js +61 -0
- package/dist/c-TVKZC4BY.min.js +1 -0
- package/dist/c-U5XVLSHN.min.js +1 -0
- package/dist/c-U6NLVFN4.min.js +1 -0
- package/dist/{c-VJTDST2R.min.js → c-UBHICVSC.min.js} +1 -1
- package/dist/c-UOPPO26M.min.js +1 -0
- package/dist/c-UUDAON4Z.min.js +1 -0
- package/dist/c-V32TPPY2.min.js +1 -0
- package/dist/c-V5KFJWQQ.min.js +1 -0
- package/dist/{c-P65V6HLO.min.js → c-VN557BQE.min.js} +1 -1
- package/dist/c-VXIYF7V2.min.js +1 -0
- package/dist/c-Y342FJ6K.min.js +1 -0
- package/dist/c-YM6CT4LJ.min.js +1 -0
- package/dist/{c-MVR3RWF3.min.js → c-YMFUIO54.min.js} +1 -1
- package/dist/c-YQVOKPKR.min.js +1 -0
- package/dist/c-YRJ3BJQZ.min.js +1 -0
- package/dist/c-YT5KPVNP.min.js +1 -0
- package/dist/components/ai/audienceProfile.d.ts +18 -1
- package/dist/components/ai/describeChart.d.ts +5 -1
- package/dist/components/ai/intentManifest.d.ts +16 -0
- package/dist/components/ai/intentRegistry.d.ts +12 -0
- package/dist/components/ai/intents.d.ts +6 -6
- package/dist/components/ai/streamSchema.d.ts +19 -0
- package/dist/components/ai/streamingTypes.d.ts +57 -11
- package/dist/components/ai/suggestCharts.d.ts +1 -1
- package/dist/components/ai/suggestStreamCharts.d.ts +43 -8
- package/dist/components/ai/suggestStreamDashboard.d.ts +35 -0
- package/dist/components/ai/variantDiscovery.d.ts +1 -1
- package/dist/components/charts/ordinal/BarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/DonutChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/PieChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/StackedBarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +14 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +6 -5
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -161
- package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +175 -0
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +6 -5
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +6 -5
- package/dist/components/charts/realtime/aggregate.d.ts +11 -1
- package/dist/components/charts/realtime/resolveWindowSize.d.ts +1 -1
- package/dist/components/charts/shared/DirectLabelLayer.d.ts +25 -0
- package/dist/components/charts/shared/chartDataProps.d.ts +3 -0
- package/dist/components/charts/shared/chartSpecAtlasSchemas.d.ts +5 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +4 -0
- package/dist/components/charts/shared/chartSpecsAtlas.d.ts +2 -0
- package/dist/components/charts/shared/directLabels.d.ts +12 -0
- package/dist/components/charts/shared/hooks.d.ts +3 -1
- package/dist/components/charts/shared/knownChartComponents.d.ts +5 -2
- package/dist/components/charts/shared/lineSeriesSsr.d.ts +0 -12
- package/dist/components/charts/shared/useChartSetup.d.ts +2 -0
- package/dist/components/charts/value/BigNumber.streamCapability.d.ts +2 -0
- package/dist/components/charts/value/GaugeChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/xy/BubbleChart.d.ts +4 -1
- package/dist/components/charts/xy/ConnectedScatterplot.d.ts +4 -1
- package/dist/components/charts/xy/LineChart.d.ts +4 -1
- package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
- package/dist/components/realtime/HyperLogLog.d.ts +19 -0
- package/dist/components/realtime/ReorderBuffer.d.ts +2 -2
- package/dist/components/realtime/TDigest.d.ts +22 -0
- package/dist/components/realtime/WindowAccumulator.d.ts +22 -5
- package/dist/components/realtime/applyChangelog.d.ts +38 -0
- package/dist/components/realtime/minHeap.d.ts +3 -0
- package/dist/components/recipes/atlas/DependencyForestChart.d.ts +20 -0
- package/dist/components/recipes/atlas/DependencyMatrix.d.ts +7 -0
- package/dist/components/recipes/atlas/FlowCircuitChart.d.ts +20 -0
- package/dist/components/recipes/atlas/MotifBraidChart.d.ts +17 -0
- package/dist/components/recipes/atlas/atlasChartOptions.d.ts +11 -0
- package/dist/components/recipes/atlas/braid.d.ts +62 -0
- package/dist/components/recipes/atlas/capsules.d.ts +18 -0
- package/dist/components/recipes/atlas/compare.d.ts +4 -0
- package/dist/components/recipes/atlas/completeness.d.ts +2 -0
- package/dist/components/recipes/atlas/dependencyForest.d.ts +32 -0
- package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +58 -0
- package/dist/components/recipes/atlas/dependencyForestLayout.d.ts +17 -0
- package/dist/components/recipes/atlas/dependencyQueries.d.ts +20 -0
- package/dist/components/recipes/atlas/dependencyTypes.d.ts +21 -0
- package/dist/components/recipes/atlas/directedGraph.d.ts +9 -0
- package/dist/components/recipes/atlas/entityCounts.d.ts +3 -0
- package/dist/components/recipes/atlas/flowCircuit.d.ts +32 -0
- package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +72 -0
- package/dist/components/recipes/atlas/flowCircuitChrome.d.ts +18 -0
- package/dist/components/recipes/atlas/flowCircuitGeometry.d.ts +11 -0
- package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +20 -0
- package/dist/components/recipes/atlas/flowCircuitSemantics.d.ts +26 -0
- package/dist/components/recipes/atlas/flowCircuitTape.d.ts +22 -0
- package/dist/components/recipes/atlas/flowCircuitTypes.d.ts +144 -0
- package/dist/components/recipes/atlas/forests.d.ts +11 -0
- package/dist/components/recipes/atlas/ids.d.ts +6 -0
- package/dist/components/recipes/atlas/index.d.ts +26 -0
- package/dist/components/recipes/atlas/ledger.d.ts +7 -0
- package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +51 -0
- package/dist/components/recipes/atlas/motifBraidGeometry.d.ts +5 -0
- package/dist/components/recipes/atlas/motifBraidLayout.d.ts +11 -0
- package/dist/components/recipes/atlas/motifs.d.ts +3 -0
- package/dist/components/recipes/atlas/prefixForest.d.ts +9 -0
- package/dist/components/recipes/atlas/prepare.d.ts +14 -0
- package/dist/components/recipes/atlas/prepareAsync.d.ts +7 -0
- package/dist/components/recipes/atlas/profile.d.ts +19 -0
- package/dist/components/recipes/atlas/publish.d.ts +10 -0
- package/dist/components/recipes/atlas/queries.d.ts +34 -0
- package/dist/components/recipes/atlas/requiredPaths.d.ts +9 -0
- package/dist/components/recipes/atlas/rootedForest.d.ts +4 -0
- package/dist/components/recipes/atlas/sections.d.ts +3 -0
- package/dist/components/recipes/atlas/support.d.ts +7 -0
- package/dist/components/recipes/atlas/types.d.ts +278 -0
- package/dist/components/recipes/atlas/validate.d.ts +12 -0
- package/dist/components/recipes/layout1d.d.ts +2 -20
- package/dist/components/recipes/minGapPlacement.d.ts +20 -0
- package/dist/components/semiotic-ai-core.d.ts +8 -3
- package/dist/components/semiotic-ai-stream.d.ts +10 -0
- package/dist/components/semiotic-ai.d.ts +4 -6
- package/dist/components/semiotic-atlas-core.d.ts +20 -0
- package/dist/components/semiotic-atlas.d.ts +8 -0
- package/dist/components/semiotic-realtime-core.d.ts +6 -2
- package/dist/components/semiotic-recipes-core.d.ts +9 -0
- package/dist/components/semiotic-stream-types.d.ts +14 -0
- package/dist/components/semiotic-xy.d.ts +1 -0
- package/dist/components/semiotic.d.ts +3 -11
- package/dist/components/server/encodeSvgFramesToGif.d.ts +2 -0
- package/dist/components/server/rasterizeSVG.d.ts +2 -0
- package/dist/components/server/registerServerXYPlugins.d.ts +2 -0
- package/dist/components/server/renderEvidence.d.ts +4 -0
- package/dist/components/server/serverChartConfigs.d.ts +8 -0
- package/dist/components/server/serverChartConfigsAtlas.d.ts +4 -0
- package/dist/components/server/serverChartConfigsRealtime.d.ts +6 -0
- package/dist/components/server/serverRealtimeCategoryColors.d.ts +3 -0
- package/dist/components/server/staticAnnotations.d.ts +9 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +1 -0
- package/dist/components/stream/SceneGraph.d.ts +3 -3
- package/dist/components/stream/StalenessBadge.d.ts +5 -2
- package/dist/components/stream/canvasSetup.d.ts +1 -2
- package/dist/components/stream/fontLoading.d.ts +4 -0
- package/dist/components/stream/networkCustomLayout.d.ts +8 -0
- package/dist/components/stream/networkCustomLayoutCache.d.ts +12 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +0 -7
- package/dist/components/stream/physics/physicsSemanticUI.d.ts +2 -0
- package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +3 -1
- package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +2 -0
- package/dist/components/stream/pipelinePathJoin.d.ts +27 -0
- package/dist/components/stream/pipelineTransitionTypes.d.ts +43 -0
- package/dist/components/stream/pipelineTransitions.d.ts +5 -35
- package/dist/components/stream/seriesGeometry.d.ts +2 -1
- package/dist/components/stream/shallowEqual.d.ts +2 -0
- package/dist/components/stream/streamEncodingTypes.d.ts +9 -0
- package/dist/components/stream/types.d.ts +25 -2
- package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +4 -2
- package/dist/components/text/axisLabelAssessment.d.ts +15 -0
- package/dist/components/text/browserAxisLabelAssessment.d.ts +1 -0
- package/dist/components/text/browserLabelMeasurement.d.ts +3 -0
- package/dist/components/text/labelMeasurement.d.ts +19 -0
- package/dist/components/text/labelPlacement.d.ts +71 -0
- package/dist/components/text/useAxisLabelAssessment.d.ts +6 -0
- package/dist/components/text/useLabelMeasurer.d.ts +3 -0
- package/dist/controls.module.min.js +71 -1
- package/dist/geo.min.js +231 -1
- package/dist/geo.module.min.js +31 -1
- package/dist/network.module.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.module.min.js +1 -1
- package/dist/rough.min.js +2 -1
- package/dist/rough.module.min.js +2 -1
- package/dist/semiotic-access.module.min.js +1 -1
- package/dist/semiotic-ai-artifact-policy-constants.module.min.js +1 -1
- package/dist/semiotic-ai-core.d.ts +8 -3
- package/dist/semiotic-ai-core.min.js +4 -1
- package/dist/semiotic-ai-core.module.min.js +4 -1
- package/dist/semiotic-ai-hash-primitives.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +4 -6
- package/dist/semiotic-ai.module.min.js +14 -1
- package/dist/semiotic-artifact-react.min.js +269 -1
- package/dist/semiotic-artifact-react.module.min.js +137 -1
- package/dist/semiotic-artifact.min.js +3 -1
- package/dist/semiotic-artifact.module.min.js +3 -1
- package/dist/semiotic-atlas-core.d.ts +20 -0
- package/dist/semiotic-atlas-core.min.js +2 -0
- package/dist/semiotic-atlas-core.module.min.js +1 -0
- package/dist/semiotic-atlas-selection.module.min.js +2 -0
- package/dist/semiotic-atlas.d.ts +8 -0
- package/dist/semiotic-atlas.min.js +2 -0
- package/dist/semiotic-atlas.module.min.js +12 -0
- package/dist/semiotic-client-cjs-shared.min.js +1529 -1
- package/dist/semiotic-client-glyph.module.min.js +3 -1
- package/dist/semiotic-client-responsive.module.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -1
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-evidence.min.js +3 -1
- package/dist/semiotic-evidence.module.min.js +3 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +8 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +8 -1
- package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.d.ts +6 -2
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +160 -1
- package/dist/semiotic-recipes-core.d.ts +9 -0
- package/dist/semiotic-recipes-core.module.min.js +72 -1
- package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
- package/dist/semiotic-recipes-react.min.js +3 -1
- package/dist/semiotic-server-edge-node.module.min.js +391 -1
- package/dist/semiotic-server-edge.min.js +651 -1
- package/dist/semiotic-server-edge.module.min.js +372 -1
- package/dist/semiotic-server-node.min.js +651 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-text.min.js +1 -1
- package/dist/semiotic-text.module.min.js +1 -1
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.min.js +11 -1
- package/dist/semiotic-utils-core.module.min.js +8 -1
- package/dist/semiotic-value.module.min.js +15 -1
- package/dist/semiotic-xy.d.ts +1 -0
- package/dist/semiotic.d.ts +3 -11
- package/dist/semiotic.module.min.js +10 -1
- package/dist/server.min.js +651 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +19 -3
- package/dist/c-2N7IU2NY.min.js +0 -1
- package/dist/c-2WK7YJLL.min.js +0 -1
- package/dist/c-33QOXEUG.min.js +0 -1
- package/dist/c-447VIMRO.min.js +0 -1
- package/dist/c-4FN7Q6VQ.min.js +0 -1
- package/dist/c-553QUDKA.min.js +0 -1
- package/dist/c-55BAJ333.min.js +0 -1
- package/dist/c-7242NXSG.min.js +0 -1
- package/dist/c-7EGHJU2F.min.js +0 -1
- package/dist/c-7HP7MB2I.min.js +0 -1
- package/dist/c-7NBU5ZKS.min.js +0 -1
- package/dist/c-AFBSWT77.min.js +0 -1
- package/dist/c-AJ7EC32V.min.js +0 -1
- package/dist/c-AQADQNY7.min.js +0 -1
- package/dist/c-ATM475SA.min.js +0 -1
- package/dist/c-AVO3Q7T7.min.js +0 -1
- package/dist/c-AZKPVBOC.min.js +0 -1
- package/dist/c-BNFJMDHN.min.js +0 -1
- package/dist/c-BNG5ECK5.min.js +0 -1
- package/dist/c-BOHCQILI.min.js +0 -1
- package/dist/c-CCTGN5CK.min.js +0 -1
- package/dist/c-CPSPZH6A.min.js +0 -1
- package/dist/c-CPV4N35K.min.js +0 -1
- package/dist/c-DE5Q3U2X.min.js +0 -1
- package/dist/c-DK662R77.min.js +0 -1
- package/dist/c-DY2676CR.min.js +0 -1
- package/dist/c-E32M6XW5.min.js +0 -1
- package/dist/c-E4JDJH4I.min.js +0 -1
- package/dist/c-E7I2L7CU.min.js +0 -1
- package/dist/c-EBOQ7ER7.min.js +0 -1
- package/dist/c-ELDWAO2V.min.js +0 -1
- package/dist/c-EUBTECGM.min.js +0 -1
- package/dist/c-GSZRZRD6.min.js +0 -1
- package/dist/c-GWX7JGMF.min.js +0 -1
- package/dist/c-GXV3C3MO.min.js +0 -1
- package/dist/c-HHTK2R75.min.js +0 -1
- package/dist/c-HLLFJYTY.min.js +0 -1
- package/dist/c-HPOYKCCG.min.js +0 -1
- package/dist/c-HXDKPIKR.min.js +0 -1
- package/dist/c-I4QJ6YLM.min.js +0 -1
- package/dist/c-IDJV3CZK.min.js +0 -1
- package/dist/c-ITKX3RC5.min.js +0 -1
- package/dist/c-JG2JCQLP.min.js +0 -1
- package/dist/c-JLGRHXGZ.min.js +0 -1
- package/dist/c-JUKIWTBJ.min.js +0 -1
- package/dist/c-KCRJGUHP.min.js +0 -1
- package/dist/c-LMGSSD2E.min.js +0 -1
- package/dist/c-LYQMZMZQ.min.js +0 -1
- package/dist/c-LYVKDBQJ.min.js +0 -1
- package/dist/c-MXCP7GNZ.min.js +0 -1
- package/dist/c-NG7BLZTR.min.js +0 -1
- package/dist/c-NYZ2QNAM.min.js +0 -1
- package/dist/c-OO5QLMJC.min.js +0 -1
- package/dist/c-OOVX2JPQ.min.js +0 -1
- package/dist/c-PP6VY3QU.min.js +0 -1
- package/dist/c-PRIKOLTE.min.js +0 -1
- package/dist/c-PSNI6KAZ.min.js +0 -1
- package/dist/c-PYNW54D2.min.js +0 -1
- package/dist/c-QAVFOEUY.min.js +0 -1
- package/dist/c-ROEHCIGV.min.js +0 -1
- package/dist/c-S3AZX5PP.min.js +0 -1
- package/dist/c-T2V7O2LO.min.js +0 -1
- package/dist/c-TIXX5CAU.min.js +0 -1
- package/dist/c-TKG2NP7G.min.js +0 -1
- package/dist/c-VXLOLYTO.min.js +0 -1
- package/dist/c-W4ZUKSEQ.min.js +0 -1
- package/dist/c-WH2O53VI.min.js +0 -1
- package/dist/c-WNGH47HF.min.js +0 -1
- package/dist/c-XDQKXPX4.min.js +0 -1
- package/dist/c-XSB27XPS.min.js +0 -1
- package/dist/c-YDECTEUW.min.js +0 -1
- package/dist/c-YF3YKVQI.min.js +0 -1
- package/dist/c-YLZIV3VS.min.js +0 -1
- package/dist/c-ZYPXQF7B.min.js +0 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
function e(e,t,o){if(!Mi.isValidElement(e)||!Ti.has(e.type))return null;let i=e,r="text"===i.type?Mi.cloneElement(i,{x:i.props.x??0,y:i.props.y??0,textAnchor:i.props.textAnchor??"middle",dominantBaseline:i.props.dominantBaseline??"middle"}):i;/* @__PURE__ */
|
|
2
|
+
return Ii("g",{className:"semiotic-radial-center-content",transform:`translate(${t},${o})`,pointerEvents:"none",children:r})}function t({content:t,centerX:o,centerY:i,width:r,height:a}){let n=e(t,o,i);return n?/* @__PURE__ */Ii("svg",{width:r,height:a,style:{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible"},children:n}):/* @__PURE__ */Ii("div",{style:{position:"absolute",left:o,top:i,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:t})}function o(e,t,o,i,r,a){let n=e.color??"rgba(255,255,255,0.6)",s=e.glowRadius??4,l=!1;for(let c of t){if("connector"===c.type||"violin"===c.type||"boxplot"===c.type)continue;if("wedge"===c.type){let t=c.category;if(!t)continue;let i=0;for(let n of r(t)??[]){let t=o.get(n);null!=t&&(i=Math.max(i,Xe(e,t,a)))}l=Ye(c,i,n)||l;continue}if(null==c.datum)continue;let t=i.get(c.datum);if(null==t)continue;let h=o.get(t),d=null==h?0:Xe(e,h,a);l=Ye(c,d,n,s)||l}return l}function i(e,t,o){let{scales:i,config:r,getConnector:a,getO:n}=e;if(!a||!i)return[];let s=[],{projection:l}=i,c=/* @__PURE__ */new Map;for(let e of t){if("point"!==e.type&&"rect"!==e.type)continue;let t=e.datum;if(!t)continue;let o,i,r=a(t);r&&("point"===e.type?(o=e.x,i=e.y):(o=e.x+e.w/2,i=e.y+("vertical"===l?0:e.h/2)),c.has(r)||c.set(r,[]),c.get(r).push({x:o,y:i,datum:t,category:n(t)}))}let h=new Map(i.o.domain().map((e,t)=>[e,t])),d=r.connectorStyle,u={stroke:e.config.themeSemantic?.border||e.config.themeSemantic?.secondary||"#999",strokeWidth:1,opacity:.5},m=e=>"function"==typeof d?d(e):d||u,g=(e,t,o)=>{s.push({type:"connector",x1:e.x,y1:e.y,x2:t.x,y2:t.y,style:m(e.datum),datum:e.datum,group:o})};for(let[e,t]of c)if(t.length>=2){t.sort((e,t)=>(h.get(e.category)??-1)-(h.get(t.category)??-1));for(let o=0;t.length-1>o;o++)g(t[o],t[o+1],e);"radial"===l&&t.length>=3&&g(t[t.length-1],t[0],e)}return s}function r(e,t,o){let i="function"==typeof e?e(o?t.w:t.h):e;return"number"==typeof i&&Number.isFinite(i)?Math.max(0,i):0}function a(e){let t=e.getSymbol;return t?yi(t,e.config.symbolMap):null}function n(e,t,o,i,r,a,n){e.push(t?{type:"symbol",x:i,y:r,size:Math.PI*a*a,symbolType:t(o),style:n,datum:o}:{type:"point",x:i,y:r,r:a,style:n,datum:o})}function s(e,t){let{columns:o,config:i,resolvePieceStyle:r}=e,a=[],n=Math.min(t.width,t.height)/2-4,s="donut"===i.chartType?i.innerRadius||60:0,l=-Math.PI/2+(i.startAngle||0)*Math.PI/180,c=null!=i.sweepAngle?i.sweepAngle*Math.PI/180:2*Math.PI,h=null!=i.sweepAngle&&360>i.sweepAngle,d=Object.values(o),u=d.some(e=>{let t=e.pieceData[0];return t&&("number"==typeof t._pct||"number"==typeof t._pctStart||null!=t._roundedEnds)}),m=h&&!u&&d.length>1&&(i.cornerRadius??0)>0;for(let e=0;d.length>e;e++){let t=d[e],o=t.pieceData[0],h="number"==typeof o?._pctStart?o._pctStart:t.pctStart,u=l+h*c,g=l+(h+("number"==typeof o?._pct?o._pct:t.pct))*c,p=r(t.pieceData[0],t.name),f=0===e,y=e===d.length-1,v={type:"wedge",cx:0,cy:0,innerRadius:s,outerRadius:n,startAngle:u,endAngle:g,...i.cornerRadius&&{cornerRadius:i.cornerRadius},style:p,datum:o?._nonInteractive?null:t.pieceData,category:t.name};o?._roundedEnds?v.roundedEnds=o._roundedEnds:m&&(v.roundedEnds={start:f,end:y}),o?._gradientBand&&(v._gradientBand=o._gradientBand),a.push(v)}return a}function l(e,t,o){return{...e[0],...o,category:t,data:e}}function c(e){let t=e.length,o=e[0],i=e[t-1];return{n:t,min:o,q1:zi(e,.25)??o,median:zi(e,.5)??(o+i)/2,q3:zi(e,.75)??i,max:i,mean:e.reduce((e,t)=>e+t,0)/t}}function h(e,t,o,i,r){let a=Array(r).fill(0);for(let n of e)t>n||n>o||a[Math.min(Math.floor((n-t)/i),r-1)]++;return a}function d(e){let{data:t,chartType:o,projection:i,normalize:r,rExtent:a,extentPadding:n=.05,baselinePadding:s,axisExtent:l,getO:c,getR:h,getStack:d,rawRExtent:u}=e,m=n;if("radial"===i&&("pie"===o||"donut"===o))return[0,1];let g=0,p=0;if("bar"===o&&d&&r)g=0,p=1;else if("bar"===o&&d){let e=/* @__PURE__ */new Map,o=/* @__PURE__ */new Map;for(let i of t){let t=c(i),r=h(i);0>r?o.set(t,(o.get(t)||0)+r):e.set(t,(e.get(t)||0)+r)}for(let t of e.values())t>p&&(p=t);for(let e of o.values())g>e&&(g=e)}else if("bar"===o){let e=/* @__PURE__ */new Map;for(let o of t){let t=c(o),i=h(o);e.set(t,(e.get(t)||0)+i)}for(let t of e.values())t>p&&(p=t),g>t&&(g=t)}else if("swimlane"===o){let e=/* @__PURE__ */new Map;for(let o of t){let t=c(o),i=Math.abs(h(o));e.set(t,(e.get(t)||0)+i)}for(let t of e.values())t>p&&(p=t)}else if("clusterbar"===o||"bar-funnel"===o)for(let e of t){let t=h(e);t>p&&(p=t),g>t&&(g=t)}else{let e=u[0],t=u[1];e!==1/0&&(g=e),t!==-1/0&&(p=t)}a&&(null!=a[0]&&(g=a[0]),null!=a[1]&&(p=a[1]));let f="bar"===o||"clusterbar"===o||"bar-funnel"===o||"swimlane"===o;if(f&&(null!=a?.[0]||null!=a?.[1]||(g>0&&(g=0),0>p&&(p=0))),"bar-funnel"!==o&&"exact"!==l){let e=p-g,t=e>0?e*m:1,i=f&&!s&&0===g,r=f&&!s&&0===p||"swimlane"===o;null==a?.[0]&&!i&&(g-=t),null==a?.[1]&&!r&&(p+=t)}return[g,p]}function u(e){let{data:t,oExtent:o,oScale:i,projection:r,layout:a,dynamicColumnWidth:n,getO:s,getR:l}=e,c=/* @__PURE__ */Object.create(null),h=/* @__PURE__ */new Map;for(let e of t){let t=s(e);h.has(t)||h.set(t,[]),h.get(t).push(e)}let d=0;if("radial"===r)for(let e of t)d+=Math.abs(l(e));let u=null;if(n&&"radial"!==r){u=/* @__PURE__ */new Map;let e=0;for(let t of o){let o,i=h.get(t)||[];o="string"==typeof n?i.reduce((e,t)=>e+(Number(t[n])||0),0):n(i),u.set(t,o),e+=o}let t=("horizontal"===r?a.height:a.width)-i.padding()*i.step()*o.length;if(e>0)for(let[o,i]of u)u.set(o,i/e*t)}let m=0,g=0;for(let e of o){let t,o,r=h.get(e)||[],a=r.reduce((e,t)=>e+Math.abs(l(t)),0),n=d>0?a/d:0;u?(t=g,o=u.get(e)||i.bandwidth(),g+=o+i.padding()*i.step()):(t=i(e)??0,o=i.bandwidth()),c[e]={name:e,x:t,y:0,width:o,middle:t+o/2,padding:i.padding()*i.step(),pieceData:r,pct:n,pctStart:m},m+=n}return c}function m(e,t){let o="function"==typeof t,i=o?null:t||"category",r=/* @__PURE__ */new Map;for(let a=0;e.length>a;a++){let n=e[a],s=o?t(n):n[i],l=r.get(s);l?l.push(a):r.set(s,[a])}return r}function g(e){let t="preserve",o=/* @__PURE__ */new Set;for(let i of e){let e=tr[i]??or;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)o.add(t)}return{retainedData:t,invalidations:o}}function p(e){let t=0,o=0;for(let i of e)"point"===i.type&&!1!==i.interactive&&(t++,i.r>o&&(o=i.r));if(500>=t)return{quadtree:null,maxRadius:o};let i=Array(t),r=0;for(let t of e)"point"===t.type&&!1!==t.interactive&&(i[r++]=t);return{maxRadius:o,quadtree:rr().x(e=>e.x).y(e=>e.y).addAll(i)}}function f(e,{storeRef:t,adapterRef:o,dirtyRef:i,scheduleRender:r,hoverRef:a,setHoverPoint:n}){let s=nr(e=>{o.current?.push(e)},[o]),l=nr(e=>{o.current?.pushMany(e)},[o]),c=nr(()=>{o.current?.clear(),t.current?.clear(),i.current=!0,r()},[o,t,i,r]),h=nr(e=>{o.current?.clearLastData(),o.current?.setReplacementData(e)},[o]);sr(e,()=>({push:s,pushMany:l,replace:h,remove:e=>{o.current?.flush();let s=t.current?.remove(e)??[];if(s.length>0){let e=a.current?.data;a.current&&s.some(Array.isArray(e)?t=>e.includes(t):t=>t===e)&&(a.current=null,n(null)),i.current=!0,r()}return s},update:(e,a)=>{o.current?.flush();let n=t.current?.update(e,a)??[];return n.length>0&&(i.current=!0,r()),n},clear:c,getData:()=>(o.current?.flush(),t.current?.getData()??[]),getScales:()=>t.current?.scales??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null}),[s,l,h,c,r,o,t,i,a,n])}function y(e,t,o,i=30,r,a=0){let n=null,s=null;if(r){let e=It(r,t,o,i,a);e&&!1!==e.node.interactive&&(n={node:e.node,datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(let a of e){let e=null;switch(a.type){case"rect":if(null==a.datum)break;e=v(a,t,o);break;case"point":if(!1===a.interactive||r)break;e=b(a,t,o,i);break;case"symbol":e=x(a,t,o,i);break;case"glyph":e=w(a,t,o,i);break;case"wedge":if(null===a.datum)break;e=k(a,t,o);break;case"boxplot":e=A(a,t,o);break;case"violin":e=S(a,t,o);break;case"connector":e=R(a,t,o,i);break;case"trapezoid":e=C(a,t,o)}e&&(e.node=a,"connector"===a.type?(!s||s.distance>e.distance)&&(s=e):(!n||n.distance>e.distance)&&(n=e))}return n??s??P(e,t,o)}function v(e,t,o){let i=_t(t,o,e);return i.hit?{datum:e.datum,x:i.cx,y:e.y,distance:0,category:e.group}:null}function b(e,t,o,i=30){let r=t-e.x,a=o-e.y,n=Math.sqrt(r*r+a*a);return n>Lt(e.r,i)?null:{datum:e.datum,x:e.x,y:e.y,distance:n}}function x(e,t,o,i=30){let r=t-e.x,a=o-e.y,n=Math.sqrt(r*r+a*a);return n>Lt(fi(e.size),i)?null:{datum:e.datum,x:e.x,y:e.y,distance:n}}function w(e,t,o,i=30){if(null==e.datum)return null;let r=vi(e.glyph,e.size),a=e.x+r.centerDx,n=e.y+r.centerDy,s=t-a,l=o-n,c=Math.sqrt(s*s+l*l);return c>Lt(r.radius,i)?null:{datum:e.datum,x:a,y:n,distance:c}}function k(e,t,o){let i=t-e.cx,r=o-e.cy,a=Math.sqrt(i*i+r*r);if(e.innerRadius>a||a>e.outerRadius)return null;let n=Mt(Math.atan2(r,i)),s=Mt(e.startAngle),l=Mt(e.endAngle);if(!(s>l?n>=s||l>=n:n>=s&&l>=n))return null;let c=(e.startAngle+e.endAngle)/2,h=(e.innerRadius+e.outerRadius)/2;return{datum:e.datum,x:e.cx+Math.cos(c)*h,y:e.cy+Math.sin(c)*h,distance:0,category:e.category}}function A(e,t,o){let i=e.columnWidth/2;if("vertical"===e.projection){if(!(e.x-i>t||t>e.x+i||Math.min(e.minPos,e.maxPos)>o||o>Math.max(e.minPos,e.maxPos)))return{datum:e.datum,x:e.x,y:e.medianPos,distance:0,category:e.category,stats:e.stats}}else{let r=e.y-i,a=e.y+i;if(!(Math.min(e.minPos,e.maxPos)>t||t>Math.max(e.minPos,e.maxPos)||r>o||o>a))return{datum:e.datum,x:e.medianPos,y:e.y,distance:0,category:e.category,stats:e.stats}}return null}function S(e,t,o){if(!e.bounds)return null;let{x:i,y:r,width:a,height:n}=e.bounds;return i>t||t>i+a||r>o||o>r+n?null:{datum:e.datum,x:i+a/2,y:r+n/2,distance:0,category:e.category,stats:e.stats}}function R(e,t,o,i){let r=e.style.strokeWidth??1;if(0>=r||"none"===e.style.stroke)return null;let a=L(t,o,e.x1,e.y1,e.x2,e.y2);return!a||a.distance>Math.max(i,r/2)?null:{datum:e.datum,x:a.x,y:a.y,distance:a.distance,category:e.group}}function P(e,t,o){let i=/* @__PURE__ */new Map;for(let t of e){if("connector"!==t.type)continue;let e=t.group||"_default",o=i.get(e);o?o.push(t):i.set(e,[t])}for(let e of i.values()){let i=e[0];if(2>e.length||!i.style.fill||"none"===i.style.fill)continue;let r=[[i.x1,i.y1],...e.map(e=>[e.x2,e.y2])];if(!I(r,t,o))continue;let a=_(r);return{node:i,datum:i.datum,x:a.x,y:a.y,distance:0,category:i.group}}return null}function C(e,t,o){if(3>e.points.length)return null;let i=M(e.points,t,o),r=I(e.points,t,o),a=e.style.strokeWidth??1;if(!(r||e.style.stroke&&"none"!==e.style.stroke&&a>0&&a/2>=i))return null;let n=_(e.points);return{datum:e.datum,x:n.x,y:n.y,distance:r?0:i,category:e.category}}function _(e){let t=e.reduce((e,t)=>({x:e.x+t[0],y:e.y+t[1]}),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function L(e,t,o,i,r,a){let n=r-o,s=a-i,l=n*n+s*s;if(0===l)return null;let c=Math.max(0,Math.min(1,((e-o)*n+(t-i)*s)/l)),h=o+c*n,d=i+c*s;return{x:h,y:d,distance:Math.hypot(e-h,t-d)}}function M(e,t,o){let i=1/0;for(let r=0;e.length>r;r++){let a=e[r],n=e[(r+1)%e.length],s=L(t,o,a[0],a[1],n[0],n[1]);s&&i>s.distance&&(i=s.distance)}return i}function I(e,t,o){if(M(e,t,o)<=16*Number.EPSILON)return!0;let i=!1;for(let r=0,a=e.length-1;e.length>r;a=r++){let[n,s]=e[r],[l,c]=e[a];s>o!=c>o&&(l-n)*(o-s)/(c-s)+n>t&&(i=!i)}return i}function T(e){let t=e.pointer.clientX-e.canvasRect.left-e.margin.left,o=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(0>t||t>e.width||0>o||o>e.height)return{kind:"outside"};if(0===e.scene.length)return{kind:"miss"};let i="radial"===e.projection,r=y(e.scene,i?t-e.width/2:t,i?o-e.height/2:o,e.hoverRadius,e.pointQuadtree,e.maxPointRadius);return r?{kind:"hit",hit:r}:{kind:"miss"}}function H(e,t){return no(e.datum||{},e.x,e.y,{...e.stats&&{stats:e.stats},...e.category&&{category:e.category},__oAccessor:"string"==typeof t.oAccessor?t.oAccessor:void 0,__rAccessor:"string"==typeof t.rAccessor?t.rAccessor:void 0,__chartType:t.chartType})}function B(e){let{width:t,height:o,totalWidth:i,totalHeight:r,margin:a,scales:n,showAxes:s,showGrid:l}=e,{rTickValues:c,axisExtent:h}=e,d="radial"===n?.projection,u="horizontal"===n?.projection,m=lr(()=>n&&!d&&l?(c||De(n.r,5,h)).map(e=>({value:e,pixel:n.r(e)})):[],[n,d,c,h,l]),g=l&&n&&!d,p=s&&n&&!d;return g||p?/* @__PURE__ */ur("svg",{width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:/* @__PURE__ */mr("g",{transform:`translate(${a.left},${a.top})`,children:[g&&/* @__PURE__ */ur("g",{className:"ordinal-grid",children:m.map((e,i)=>/* @__PURE__ */ur("line",{x1:u?e.pixel:0,y1:u?0:e.pixel,x2:u?e.pixel:t,y2:u?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),p&&/* @__PURE__ */ur(dr,{children:/* @__PURE__ */mr(dr,u?{children:[
|
|
3
|
+
/* @__PURE__ */ur("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),
|
|
4
|
+
/* @__PURE__ */ur("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]}:{children:[
|
|
5
|
+
/* @__PURE__ */ur("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),
|
|
6
|
+
/* @__PURE__ */ur("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]})})]})}):null}function F(e){let{width:t,height:o,totalWidth:i,totalHeight:r,margin:a,scales:n,showAxes:s,showCategoryTicks:l,oLabel:c,rLabel:h,oFormat:d,rFormat:u,showGrid:m,title:g,description:p,idPrefix:f,legend:y,legendHoverBehavior:v,legendClickBehavior:b,legendHighlightedCategory:x,legendIsolatedCategories:w,legendPosition:k="right",legendLayout:A,foregroundGraphics:S,annotations:R,onAnnotationActivate:P,onObservation:C,chartId:_,chartType:L,autoPlaceAnnotations:M,svgAnnotationRules:I,xAccessor:T,yAccessor:H,annotationData:B,underlayRendered:F,canvasObscuresUnderlay:$=!0,children:O}=e,W=Kt({onAnnotationActivate:P,onObservation:C,chartId:_,chartType:L}),D="radial"===n?.projection,j="horizontal"===n?.projection,N=!1!==l,E=!F||$,z=Vt({showAxes:s,projection:D?"radial":j?"horizontal":"vertical",hasCategoryLabel:!!c,hasValueLabel:!!h}),V=ti(A,z.leftAxis),G=y&&"left"===k&&V>0?V:a.left,q=lr(()=>{if(!s||!N||!n||D)return[];let e=n.o.bandwidth(),t=n.o.domain().map((t,o)=>({value:t,pixel:(n.o(t)??0)+e/2,label:d?d(t,o):t}));if(2>=t.length)return t;let o=Math.abs(t[1].pixel-t[0].pixel)||e,i=e=>j?"string"==typeof e||"number"==typeof e?16:24:"string"==typeof e||"number"==typeof e?6.5*(e+"").length:60,r=t.map(e=>i(e.label)),a=j?0:6;if(r.every((e,t)=>0===t||o>=(r[t-1]+e)/2+a))return t;let l=Math.max(...r)+a,c=Math.max(1,Math.ceil(l/o));return 1===c?t:t.filter((e,t)=>t%c===0)},[s,N,n,d,D,j]),X=e.rTickValues,Y=e.tickLabelEdgeAlign,Q=e.axisExtent,K=lr(()=>{if(!s&&!m||!n||D)return[];let e=X||De(n.r,5,Q),t=u||Jo(e);return e.map(e=>({value:e,pixel:n.r(e),label:t(e)}))},[s,m,n,u,D,X,Q]),Z=cr(/* @__PURE__ */new Map),J=cr(R?.length??0),U=R?.length??0;J.current!==U&&(J.current=U,Z.current=/* @__PURE__ */new Map);let ee=lr(()=>{if(!R||0===R.length)return null;let e=Bt(R),i=ao("ordinal",W),r="horizontal"===n?.projection,a=n?.o?e=>(n.o(e)??0)+n.o.bandwidth()/2:null,s={scales:n?{x:r?n.r:a||n.r,y:r&&a||n.r,time:n.r,value:n.r,o:n.o}:null,timeAxis:"x",xAccessor:T,yAccessor:H,width:t,height:o,data:B,frameType:"ordinal",projection:r?"horizontal":"vertical",stickyPositionCache:Z.current},l=M?ho({annotations:e,context:s,..."object"==typeof M?M:{}}):e;return ro(l,i,I,s)},[R,M,I,t,o,n,T,H,B,W]),te=s||g||p||y||S||ee&&ee.length>0||m||O,oe=hr(),{titleId:ie,descId:re,labelledBy:ae}=Ot(f||_||oe);return te?/* @__PURE__ */mr("svg",{role:"img","aria-labelledby":ae,width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[
|
|
7
|
+
/* @__PURE__ */ur("title",{id:ie,children:Ft(g,"Ordinal Chart")}),
|
|
8
|
+
/* @__PURE__ */ur("desc",{id:re,children:$t(g,p,{familyPhrase:"ordinal data visualization",fallback:"Ordinal data visualization"})}),
|
|
9
|
+
/* @__PURE__ */mr("g",{transform:`translate(${a.left},${a.top})`,children:[m&&n&&!D&&E&&/* @__PURE__ */ur("g",{className:"ordinal-grid",children:K.map((e,i)=>/* @__PURE__ */ur("line",{x1:j?e.pixel:0,y1:j?0:e.pixel,x2:j?e.pixel:t,y2:j?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),s&&n&&!D&&(()=>{let e={fontSize:"var(--semiotic-tick-font-size, 12px)"},i={fontSize:"var(--semiotic-axis-label-font-size, 12px)"};/* @__PURE__ */
|
|
10
|
+
return ur("g",{className:"ordinal-axes",children:/* @__PURE__ */mr(dr,j?{children:[
|
|
11
|
+
/* @__PURE__ */mr("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[E&&/* @__PURE__ */ur("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),q.map((t,o)=>/* @__PURE__ */mr("g",{transform:`translate(0,${t.pixel})`,children:[
|
|
12
|
+
/* @__PURE__ */ur("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?/* @__PURE__ */ur("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):/* @__PURE__ */ur("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:/* @__PURE__ */ur("div",{style:{textAlign:"right",userSelect:"none",...e},children:t.label})})]},"cat-"+o)),c&&/* @__PURE__ */ur("text",{x:15-G,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-G}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),
|
|
13
|
+
/* @__PURE__ */mr("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[E&&/* @__PURE__ */ur("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),E&&n?.r&&(()=>{let e=n.r(0);return e>1&&t-1>e?/* @__PURE__ */ur("line",{x1:e,y1:0,x2:e,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1,strokeDasharray:"4,4"}):null})(),K.map((t,i)=>{let r=Y?0===i?"start":i===K.length-1?"end":"middle":"middle";/* @__PURE__ */
|
|
14
|
+
return mr("g",{transform:`translate(${t.pixel},${o})`,children:[
|
|
15
|
+
/* @__PURE__ */ur("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),
|
|
16
|
+
/* @__PURE__ */ur("text",{y:18,textAnchor:r,fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+i)}),h&&/* @__PURE__ */ur("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]}:{children:[
|
|
17
|
+
/* @__PURE__ */mr("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[E&&(()=>{let e=n?.r?n.r(0):o,i=0>e||e>o?o:e;/* @__PURE__ */
|
|
18
|
+
return ur("line",{x1:0,y1:i,x2:t,y2:i,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})})(),q.map((t,i)=>/* @__PURE__ */mr("g",{transform:`translate(${t.pixel},${o})`,children:[
|
|
19
|
+
/* @__PURE__ */ur("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?/* @__PURE__ */ur("text",{y:18,textAnchor:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):/* @__PURE__ */ur("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:/* @__PURE__ */ur("div",{style:{textAlign:"center",userSelect:"none",...e},children:t.label})})]},"cat-"+i)),c&&/* @__PURE__ */ur("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),
|
|
20
|
+
/* @__PURE__ */mr("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[E&&/* @__PURE__ */ur("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),K.map((t,o)=>/* @__PURE__ */mr("g",{transform:`translate(0,${t.pixel})`,children:[
|
|
21
|
+
/* @__PURE__ */ur("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),
|
|
22
|
+
/* @__PURE__ */ur("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+o)),h&&/* @__PURE__ */ur("text",{x:15-G,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-G}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]})})})(),ee,S,O]}),
|
|
23
|
+
/* @__PURE__ */ur(go,{title:g,totalWidth:i,marginTop:a.top}),qt({legend:y,totalWidth:i,totalHeight:r,margin:a,legendPosition:k,title:g,legendLayout:A,axisChrome:z,legendHoverBehavior:v,legendClickBehavior:b,legendHighlightedCategory:x,legendIsolatedCategories:w})]}):null}function $(e){let[t,o]=gr.useState(()=>fr);return gr.useEffect(()=>{if(t)return;let e=!1;return(fr?Promise.resolve(fr):(yr||(yr=import("./c-3PPO7ZJF.min.js").then(e=>fr=e.OrdinalBrushOverlay).catch(e=>{throw yr=null,e})),yr)).then(t=>{e||o(()=>t)}),()=>{e=!0}},[t]),t?/* @__PURE__ */pr(t,{...e}):null}function O(e){let{innerRadius:t,outerRadius:o,startAngle:i,endAngle:r}=e,a=0>=t;if(0>=(e.cornerRadius??0)||!e.roundStart&&!e.roundEnd){if(a){let e=br(o,i),t=br(o,r);return`M0,0 L${e.x},${e.y} A${o},${o} 0 ${r-i>Math.PI?1:0} 1 ${t.x},${t.y} Z`}let e=br(o,i),n=br(o,r),s=br(t,r),l=br(t,i),c=r-i>Math.PI?1:0;return`M${e.x},${e.y} A${o},${o} 0 ${c} 1 ${n.x},${n.y} L${s.x},${s.y} A${t},${t} 0 ${c} 0 ${l.x},${l.y} Z`}let n=Math.max(0,Math.min(e.cornerRadius??0,(o-t)/2));if(0===n)return O({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});let s=Math.asin(Math.min(1,n/Math.max(1e-9,o-n))),l=a?0:Math.asin(Math.min(1,n/Math.max(1e-9,t+n))),c=r-i,h=e.roundStart&&e.roundEnd?c/2:c,d=!!e.roundStart&&h>s,u=!!e.roundEnd&&h>s;if(!d&&!u)return O({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});let m=i+(d?s:0),g=r-(u?s:0),p=i+(d?l:0),f=r-(u?l:0),y=br(o,m),v=br(o,g),b=(o-n)*Math.cos(s),x=br(b,i),w=br(b,r),k=a?null:br(t,f),A=a?null:br(t,p),S=a?0:(t+n)*Math.cos(l),R=a?null:br(S,i),P=a?null:br(S,r),C=g-m>Math.PI?1:0,_=a?0:f-p>Math.PI?1:0,L="";if(d)L+=`M${x.x},${x.y}`,L+=` A${n},${n} 0 0 1 ${y.x},${y.y}`;else{let e=br(o,i);L+=`M${e.x},${e.y}`}if(u)L+=` A${o},${o} 0 ${C} 1 ${v.x},${v.y}`,L+=` A${n},${n} 0 0 1 ${w.x},${w.y}`;else{let e=br(o,r);L+=` A${o},${o} 0 ${C} 1 ${e.x},${e.y}`}if(a)L+=" L0,0";else{if(u)L+=` L${P.x},${P.y}`,L+=` A${n},${n} 0 0 1 ${k.x},${k.y}`;else{let e=br(t,r);L+=` L${e.x},${e.y}`}if(d)L+=` A${t},${t} 0 ${_} 0 ${A.x},${A.y}`,L+=` A${n},${n} 0 0 1 ${R.x},${R.y}`;else{let e=br(t,i);L+=` A${t},${t} 0 ${_} 0 ${e.x},${e.y}`}}return L+=" Z",L}function W(e){let t=O({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,cornerRadius:e.cornerRadius,roundStart:e.roundStart,roundEnd:e.roundEnd}),o=[],i=e.colors;if(i.length>0){let t=(e.endAngle-e.startAngle)/i.length;for(let r=0;i.length>r;r++)o.push({d:O({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle+r*t,endAngle:e.endAngle}),color:i[r]})}return{clipPath:t,slices:o}}function D(e,t){let o=t._gradientBand.colors;if(0===o.length)return;let{clipPath:i,slices:r}=W({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds?.start??!0,roundEnd:t.roundedEnds?.end??!0,colors:o}),a=new Path2D(i);e.save(),e.translate(t.cx,t.cy),e.clip(a);for(let t of r)e.fillStyle=xi(e,t.color)||t.color||"#007bff",e.fill(new Path2D(t.d));e.restore();let n=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&n>0&&(e.save(),e.translate(t.cx,t.cy),e.strokeStyle=xi(e,t.style.stroke)||t.style.stroke,e.lineWidth=n,e.stroke(a),e.restore())}function j(e,t){e.beginPath(),t.innerRadius>0?(e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerRadius,t.endAngle,t.startAngle,!0)):(e.moveTo(t.cx,t.cy),e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle)),e.closePath()}function N(e,t){let o={innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle+Math.PI/2,endAngle:t.endAngle+Math.PI/2},i=vr().cornerRadius(t.cornerRadius)(o);if(!i)return;e.save(),e.translate(t.cx,t.cy);let r=new Path2D(i);e.fill(r);let a=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&a>0&&(e.lineWidth=a,e.stroke(r)),e.restore()}function E(e){return 1e6>e?1e4>e?1e3>e?e+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function z(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function V(e,t){let o=`${e}@${"u">typeof window&&window.devicePixelRatio||1}`,i=Pr.get(o);if(void 0!==i)return i;let r=ki({background:e,stroke:"rgba(255,255,255,0.5)",lineWidth:1.5,spacing:6,angle:45},t),a=Ai(r)?null:r;return Pr.set(o,a),a}function G(e,t,o,i,r,a){e.moveTo(t+a,o),e.lineTo(t+i-a,o),e.quadraticCurveTo(t+i,o,t+i,o+a),e.lineTo(t+i,o+r-a),e.quadraticCurveTo(t+i,o+r,t+i-a,o+r),e.lineTo(t+a,o+r),e.quadraticCurveTo(t,o+r,t,o+r-a),e.lineTo(t,o+a),e.quadraticCurveTo(t,o,t+a,o),e.closePath()}function q(e,t){let[o,i,r]=wi(e,t);return(.2126*o+.7152*i+.0722*r)/255>.6}function X(e){return 1e6>e?1e4>e?1e3>e?Math.round(e)+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function Y(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function Q(e){return"rect"===e.type||"point"===e.type||"symbol"===e.type||"glyph"===e.type}function K(e){return(t,o,i,r)=>{e(t,o.filter(Q),{x:i.r,y:i.r},r)}}function Z(e){return 1e6>e?1e4>e?1e3>e?e+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function J(e,t){let o=e.datum;if(!o)return null;let i=[],r=o.__funnelStepLabel,a=Number(o.__funnelStepLabelX),n=Number(o.__funnelStepLabelY),s=Number(o.__funnelRowWidth);"string"==typeof r&&Number.isFinite(a)&&Number.isFinite(n)&&(!Number.isFinite(s)||s>=8.4*r.length+16)&&i.push(
|
|
24
|
+
/* @__PURE__ */$r("text",{x:a,y:n+3,textAnchor:"middle",dominantBaseline:"hanging",fontSize:14,fontWeight:"bold",fill:"#fff",fontFamily:"var(--semiotic-font-family, sans-serif)",stroke:"rgba(0,0,0,0.6)",strokeWidth:3,paintOrder:"stroke",children:r},t+"-funnel-step"));let l=Number(o.__funnelValue),c=Number(o.__funnelValueLabelX),h=Number(o.__funnelValueLabelY),d=Number(o.__funnelBarW);if(Number.isFinite(l)&&0!==l&&Number.isFinite(c)&&Number.isFinite(h)&&d>=60){let e=Number(o.__funnelPercent),r=!0!==o.__funnelIsFirstStep&&Number.isFinite(e)?`${Z(l)} (${.05>Math.abs(e-Math.round(e))?Math.round(e):e.toFixed(1)}%)`:Z(l);7.8*r.length+16>d&&(r=Z(l)),d>=7.8*r.length+16&&i.push(
|
|
25
|
+
/* @__PURE__ */$r("text",{x:c,y:h+22,textAnchor:"middle",dominantBaseline:"hanging",fontSize:13,fontWeight:"bold",fill:"#fff",fontFamily:"var(--semiotic-font-family, sans-serif)",stroke:"rgba(0,0,0,0.5)",strokeWidth:3,paintOrder:"stroke",children:r},t+"-funnel-value"))}return i.length?/* @__PURE__ */$r("g",{children:i},t+"-funnel-labels"):null}function U(e,t,o){return Do(ee(e,t,o),e,"ordinal-cursor-"+t)}function ee(e,t,o){let i=("category"in e?e.category:void 0)||("group"in e?e.group:void 0)||"",r=o=>`ord-${e.type}-${i}-${t}-${o}`,a=`ord-${e.type}-${i}-${t}`;switch(e.type){case"rect":{let t,o,i=e,r=bo(a)+"-grad",n=wo(i,r);if(n)o=`url(#${r})`;else if(Ai(i.style.fill)){let e=bo(a)+"-hatch";t=Si(i.style.fill,e),o=`url(#${e})`}else o=yo(i.style.fill);let s=n||t?/* @__PURE__ */Or("defs",{children:[n,t]}):null;if(i.cornerRadii&&pi(i.cornerRadii)){let e=zt(i);/* @__PURE__ */
|
|
26
|
+
return Or(Br.Fragment,{children:[s,
|
|
27
|
+
/* @__PURE__ */$r("path",{d:e,fill:o,opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth})]},a)}if(i.roundedTop&&i.roundedTop>0){let e,t=Math.min(i.roundedTop,i.w/2,i.h/2),{x:r,y:n,w:l,h:c}=i;switch(i.roundedEdge){case"right":e=`M${r},${n} L${r+l-t},${n} A${t},${t} 0 0 1 ${r+l},${n+t} L${r+l},${n+c-t} A${t},${t} 0 0 1 ${r+l-t},${n+c} L${r},${n+c} Z`;break;case"left":e=`M${r+l},${n} L${r+t},${n} A${t},${t} 0 0 0 ${r},${n+t} L${r},${n+c-t} A${t},${t} 0 0 0 ${r+t},${n+c} L${r+l},${n+c} Z`;break;case"bottom":e=`M${r},${n} L${r+l},${n} L${r+l},${n+c-t} A${t},${t} 0 0 1 ${r+l-t},${n+c} L${r+t},${n+c} A${t},${t} 0 0 1 ${r},${n+c-t} Z`;break;default:e=`M${r},${n+c} L${r},${n+t} A${t},${t} 0 0 1 ${r+t},${n} L${r+l-t},${n} A${t},${t} 0 0 1 ${r+l},${n+t} L${r+l},${n+c} Z`}/* @__PURE__ */
|
|
28
|
+
return Or(Br.Fragment,{children:[s,
|
|
29
|
+
/* @__PURE__ */$r("path",{d:e,fill:o,opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth})]},a)}/* @__PURE__ */
|
|
30
|
+
return Or(Br.Fragment,{children:[s,
|
|
31
|
+
/* @__PURE__ */$r("rect",{x:i.x,y:i.y,width:i.w,height:i.h,fill:o,opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth}),J(i,a)]},a)}case"point":{let t=e;/* @__PURE__ */
|
|
32
|
+
return $r("circle",{cx:t.x,cy:t.y,r:t.r,fill:yo(t.style.fill),opacity:t.style.opacity??t.style.fillOpacity??.8,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},a)}case"symbol":return Ao(e,t,o);case"glyph":return xo(e,e.x,e.y,`${o??""}ord-glyph-${e.pointId??t}`);case"wedge":{let i,r=e;if(r._gradientBand&&r._gradientBand.colors.length>0){let e=bo(`${o?o+"-":""}gauge-grad-${r.category||a}-${t}`),{clipPath:i,slices:n}=W({innerRadius:r.innerRadius,outerRadius:r.outerRadius,startAngle:r.startAngle,endAngle:r.endAngle,cornerRadius:r.cornerRadius,roundStart:r.roundedEnds?.start??!0,roundEnd:r.roundedEnds?.end??!0,colors:r._gradientBand.colors});/* @__PURE__ */
|
|
33
|
+
return Or("g",{transform:`translate(${r.cx},${r.cy})`,opacity:r.style.opacity,fillOpacity:r.style.fillOpacity,children:[
|
|
34
|
+
/* @__PURE__ */$r("defs",{children:/* @__PURE__ */$r("clipPath",{id:e,children:/* @__PURE__ */$r("path",{d:i})})}),
|
|
35
|
+
/* @__PURE__ */$r("g",{clipPath:`url(#${e})`,children:n.map((e,t)=>/* @__PURE__ */$r("path",{d:e.d,fill:yo(e.color)},t))}),r.style.stroke&&"none"!==r.style.stroke&&
|
|
36
|
+
/* @__PURE__ */$r("path",{d:i,fill:"none",stroke:r.style.stroke,strokeWidth:r.style.strokeWidth})]},a)}if(r.roundedEnds)i=O({innerRadius:r.innerRadius,outerRadius:r.outerRadius,startAngle:r.startAngle,endAngle:r.endAngle,cornerRadius:r.cornerRadius,roundStart:r.roundedEnds.start,roundEnd:r.roundedEnds.end});else{let e=Fr().innerRadius(r.innerRadius).outerRadius(r.outerRadius).startAngle(r.startAngle+Math.PI/2).endAngle(r.endAngle+Math.PI/2);r.cornerRadius&&e.cornerRadius(r.cornerRadius),i=e(po)||""}/* @__PURE__ */
|
|
37
|
+
return $r("path",{d:i,transform:`translate(${r.cx},${r.cy})`,fill:yo(r.style.fill),stroke:r.style.stroke,strokeWidth:r.style.strokeWidth,opacity:r.style.opacity},a)}case"boxplot":{let t=e,o=t.columnWidth/2,i=t.style.strokeWidth??1;/* @__PURE__ */
|
|
38
|
+
return Or("g","vertical"===t.projection?{children:[
|
|
39
|
+
/* @__PURE__ */$r("line",{x1:t.x,y1:t.minPos,x2:t.x,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:i}),
|
|
40
|
+
/* @__PURE__ */$r("rect",{x:t.x-o,y:Math.min(t.q1Pos,t.q3Pos),width:t.columnWidth,height:Math.abs(t.q3Pos-t.q1Pos),fill:yo(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:i}),
|
|
41
|
+
/* @__PURE__ */$r("line",{x1:t.x-o,y1:t.medianPos,x2:t.x+o,y2:t.medianPos,stroke:t.style.stroke||"#333",strokeWidth:2*i}),
|
|
42
|
+
/* @__PURE__ */$r("line",{x1:t.x-.5*o,y1:t.minPos,x2:t.x+.5*o,y2:t.minPos,stroke:t.style.stroke||"#333",strokeWidth:i}),
|
|
43
|
+
/* @__PURE__ */$r("line",{x1:t.x-.5*o,y1:t.maxPos,x2:t.x+.5*o,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:i})]}:{children:[
|
|
44
|
+
/* @__PURE__ */$r("line",{x1:t.minPos,y1:t.y,x2:t.maxPos,y2:t.y,stroke:t.style.stroke||"#333",strokeWidth:i}),
|
|
45
|
+
/* @__PURE__ */$r("rect",{x:Math.min(t.q1Pos,t.q3Pos),y:t.y-o,width:Math.abs(t.q3Pos-t.q1Pos),height:t.columnWidth,fill:yo(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:i}),
|
|
46
|
+
/* @__PURE__ */$r("line",{x1:t.medianPos,y1:t.y-o,x2:t.medianPos,y2:t.y+o,stroke:t.style.stroke||"#333",strokeWidth:2*i}),
|
|
47
|
+
/* @__PURE__ */$r("line",{x1:t.minPos,y1:t.y-.5*o,x2:t.minPos,y2:t.y+.5*o,stroke:t.style.stroke||"#333",strokeWidth:i}),
|
|
48
|
+
/* @__PURE__ */$r("line",{x1:t.maxPos,y1:t.y-.5*o,x2:t.maxPos,y2:t.y+.5*o,stroke:t.style.stroke||"#333",strokeWidth:i})]},a)}case"violin":{let t=e,o=[
|
|
49
|
+
/* @__PURE__ */$r("path",{d:t.pathString,transform:t.translateX||t.translateY?`translate(${t.translateX},${t.translateY})`:void 0,fill:yo(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:t.style.strokeWidth??1},r("path"))];if(t.iqrLine&&t.bounds){let e=t.bounds,i=e.x+e.width/2,a=e.y+e.height/2;t.iqrLine.isVertical?o.push(
|
|
50
|
+
/* @__PURE__ */$r("line",{x1:i,y1:t.iqrLine.q1Pos,x2:i,y2:t.iqrLine.q3Pos,stroke:t.style.stroke||"#333",strokeWidth:2},r("iqr")),
|
|
51
|
+
/* @__PURE__ */$r("circle",{cx:i,cy:t.iqrLine.medianPos,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},r("med"))):o.push(
|
|
52
|
+
/* @__PURE__ */$r("line",{x1:t.iqrLine.q1Pos,y1:a,x2:t.iqrLine.q3Pos,y2:a,stroke:t.style.stroke||"#333",strokeWidth:2},r("iqr")),
|
|
53
|
+
/* @__PURE__ */$r("circle",{cx:t.iqrLine.medianPos,cy:a,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},r("med")))}/* @__PURE__ */
|
|
54
|
+
return $r("g",{children:o},a)}case"connector":{let t=e,o=t.style.fill&&"none"!==t.style.fill?yo(t.style.fill,"var(--semiotic-border, #999)"):"var(--semiotic-border, #999)";/* @__PURE__ */
|
|
55
|
+
return $r("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.stroke||o,strokeWidth:t.style.strokeWidth??1,opacity:t.style.opacity??.5},a)}case"trapezoid":{let t=e,o=t.points.map(e=>`${e[0]},${e[1]}`).join(" ");/* @__PURE__ */
|
|
56
|
+
return $r("polygon",{points:o,fill:yo(t.style.fill,"#999"),opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},a)}default:return null}}function te(e){return"connector"===e.node.type}function oe(e,t,o,i){if(2>e.length)return null;let r=e[0].node,a=r.style.fill;if(!a||"none"===a)return null;let n=bo(`${t?t+"-":""}connector-${o}-${i}-hatch`),s=Ai(a)?Si(a,n):null,l=[`${r.x1},${r.y1}`,...e.map(({node:e})=>`${e.x2},${e.y2}`)].join(" "),c=/* @__PURE__ */Dr(Hr.Fragment,{children:[s&&/* @__PURE__ */Wr("defs",{children:s}),
|
|
57
|
+
/* @__PURE__ */Wr("polygon",{points:l,fill:s?`url(#${n})`:yo(a,"#999"),opacity:r.style.fillOpacity??r.style.opacity??.3,"data-semiotic-connector-fill":r.group||"_default"})]});return Do(c,r,`ordinal-connector-fill-${o}-${i}`)}function ie(e,t,o){let i=/* @__PURE__ */new Map;for(let t of e){if(!te(t))continue;let e=t.node.group||"_default",o=i.get(e);o?o.push(t):i.set(e,[t])}if(0===i.size)return;let r=Array.from(i.values()).map((e,i)=>/* @__PURE__ */Dr("g",{children:[oe(e,t,o,i),e.map(e=>e.element)]},`ordinal-connectors-${o}-${i}`)),a=e[0],n=te(a)?null:a.element;for(let e of i.values())for(let t of e)t.element=null;a.element=/* @__PURE__ */Dr(Hr.Fragment,{children:[r,n]},"ordinal-connector-run-"+o)}function re(e){let t=mt({nodes:e.nodes,renderMode:e.renderMode,fallback:(t,o)=>U(t,o,e.idPrefix)}),o=0;for(let i=0;t.length>i;){if(t[i].renderedByBackend){i++;continue}let r=i+1;for(;t.length>r&&!t[r].renderedByBackend;)r++;ie(t.slice(i,r),e.idPrefix,o++),i=r}return t}function ae(e){let t=lo(e,{skipPositional:!1});return null==t.title&&0===t.entries.length?null:/* @__PURE__ */Nr("div",{className:"semiotic-tooltip",style:ii,children:[null!=t.title&&/* @__PURE__ */jr("div",{style:{fontWeight:"bold"},children:t.title+""}),t.entries.map(e=>/* @__PURE__ */Nr("div",{children:[
|
|
58
|
+
/* @__PURE__ */Nr("span",{style:{opacity:.7},children:[e.key,":"]})," ","number"==typeof e.value?e.value.toLocaleString():e.value+""]},e.key))]})}function ne({hover:e}){let t=e.data||{},o=e.stats,i=e.category;if(Array.isArray(t)){let e=i||t[0]?.category||"";if(o)/* @__PURE__ */
|
|
59
|
+
return Nr("div",{className:"semiotic-tooltip",style:ii,children:[e&&/* @__PURE__ */jr("div",{style:{fontWeight:"bold"},children:e+""}),
|
|
60
|
+
/* @__PURE__ */Nr("div",{children:["n = ",o.n]}),
|
|
61
|
+
/* @__PURE__ */Nr("div",{children:["Min: ",o.min.toLocaleString()]}),
|
|
62
|
+
/* @__PURE__ */Nr("div",{children:["Q1: ",o.q1.toLocaleString()]}),
|
|
63
|
+
/* @__PURE__ */Nr("div",{children:["Median: ",o.median.toLocaleString()]}),
|
|
64
|
+
/* @__PURE__ */Nr("div",{children:["Q3: ",o.q3.toLocaleString()]}),
|
|
65
|
+
/* @__PURE__ */Nr("div",{children:["Max: ",o.max.toLocaleString()]}),
|
|
66
|
+
/* @__PURE__ */Nr("div",{style:{opacity:.8},children:["Mean: ",o.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});let r=t.length;/* @__PURE__ */
|
|
67
|
+
return Nr("div",{className:"semiotic-tooltip",style:ii,children:[e&&/* @__PURE__ */jr("div",{style:{fontWeight:"bold"},children:e+""}),
|
|
68
|
+
/* @__PURE__ */Nr("div",{children:[r," items"]})]})}if(null!=t.bin&&null!=t.count){let e=t.range||[];/* @__PURE__ */
|
|
69
|
+
return Nr("div",{className:"semiotic-tooltip",style:ii,children:[t.category&&/* @__PURE__ */jr("div",{style:{fontWeight:"bold"},children:t.category+""}),
|
|
70
|
+
/* @__PURE__ */Nr("div",{children:["Count: ",t.count]}),2===e.length&&/* @__PURE__ */Nr("div",{style:{opacity:.8},children:[Number(e[0]).toFixed(1)," – ",Number(e[1]).toFixed(1)]})]})}let r=e.__oAccessor,a=e.__rAccessor,n=e.__chartType;if("swarm"===n||"point"===n)return ae(t);let s=(r&&null!=t[r]?t[r]:null)||t.category||t.name||t.group||t.__rName||"",l=t.__aggregateValue??(a&&null!=t[a]?t[a]:null)??t.value??t.__rValue??t.pct??"";return s||""!==l?/* @__PURE__ */Nr("div",{className:"semiotic-tooltip",style:ii,children:[s&&/* @__PURE__ */jr("div",{style:{fontWeight:"bold"},children:s+""}),""!==l&&/* @__PURE__ */jr("div",{children:"number"==typeof l?l.toLocaleString():l+""})]}):ae(t)}function se({ref:e,frameRef:t,setup:o}){return Kr(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,o)=>t.current?.update(e,o)??[],replace:e=>t.current?.replace(e),clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t]),{effectiveLegendProps:o.legendBehaviorProps,effectiveMargin:o.margin}}function le(e){let{colorBy:t,colorScale:o,color:i,themeCategorical:r,colorScheme:a,categoryIndexMap:n,userPieceStyle:s,stroke:l,strokeWidth:c,opacity:h,effectiveSelectionHook:d,resolvedSelection:u,cycleByCategory:m=!1,baseStyleExtras:g,linkStrokeToFill:p=!1,styleRules:f,resolveRuleValue:y}=e,v=Zr(()=>(e,s)=>{let l="function"==typeof g?g(e,s):g,c=l?{...l}:{};if(void 0===c.fill)if(t){if(!o)return c;c.fill=ui(e,t,o)}else c.fill=Zt(i,r,a,m?s:void 0,n);if(f&&f.length>0){let t=uo(e,f,{value:y?y(e,s):void 0,category:s});Object.assign(c,t)}return p&&void 0===c.stroke&&void 0!==c.fill&&(c.stroke=c.fill),c},[t,o,i,r,a,n,m,g,p,f,y]),b=Zr(()=>bt(s?"function"==typeof s?(e,t)=>({...v(e,t),...s(e,t)||{}}):(e,t)=>({...v(e,t),...s}):v,{stroke:l,strokeWidth:c,opacity:h}),[v,s,l,c,h]);return Zr(()=>No(b,d??null,u),[b,d,u])}function ce({brushProp:e,onBrushProp:t,linkedBrush:o,valueAccessor:i}){let r=Ur(()=>Wo("string"==typeof o?o:o?{name:o.name,xField:o.rField}:void 0),[o]),a="string"==typeof i?i:"value",n=zo({name:r?.name||"__unused_ordinal_brush__",xField:r?.xField||a}),s=ea(n.brushInteraction);s.current=n.brushInteraction;let l=Jr(e=>{r&&s.current.end(e?e.r:null),t?.(e)},[t,r]),c=!!(e||o||t);return{hasBrush:c,handleBrush:l,brushStreamProps:c?{brush:{dimension:"r"},onBrush:l}:{}}}function he(e,t){if("function"==typeof e)return e;let o=e||t;return e=>e[o]}function de(e,t){if(0>=e)return[];if(t&&Object.prototype.hasOwnProperty.call(ya,t)){let o=ya[t];if(1===e)return[o(.5)];let i=[];for(let t=0;e>t;t++)i.push(o(t/(e-1)));return i}let o=["#da1e28","#ff8389","#ffb3b8"],i=["#a6c8ff","#4589ff","#0043ce"],r="#a8a8a8";if(1===e)return[r];let a=e%2!=0,n=Math.floor(e/2),s=[];for(let e=0;n>e;e++)s.push(o[Math.min(Math.floor(e*o.length/n),o.length-1)]);a&&s.push(r);for(let e=0;n>e;e++)s.push(i[Math.min(Math.floor(e*i.length/n),i.length-1)]);return s}function ue(e,t,o,i,r,a,n={}){let s=/* @__PURE__ */new Map,l=new Set(t);for(let n of e){let e=o(n);s.has(e)||s.set(e,/* @__PURE__ */new Map);let c=s.get(e);if(i){let e=i(n);if(null==e||!Number.isFinite(e))continue;if(!Number.isInteger(e)){"production"!==process.env.NODE_ENV&&console.warn("[LikertChart] Ignoring non-integer Likert score:",e);continue}let o=e-1;if(0>o||o>=t.length)continue;let r=t[o];c.set(r,(c.get(r)||0)+1)}else if(r&&a){let e=r(n),t=a(n);if(!l.has(e))continue;c.set(e,(c.get(e)||0)+(Number.isFinite(t)?t:0))}}let c=[];for(let[e,o]of s){let i=0;for(let e of t)i+=o.get(e)||0;if(0!==i)for(let r=0;t.length>r;r++){let a=t[r],s=o.get(a)||0,l={};n.category&&(l[n.category]=e),n.level&&(l[n.level]=a),n.count&&(l[n.count]=s),n.score&&(l[n.score]=r+1),c.push({...l,__likertCategory:e,__likertLevel:a,__likertLevelLabel:a,__likertCount:s,__likertPct:s/i*100,__likertLevelIndex:r})}}return c}function me(e,t){let o=t.length,i=o%2!=0,r=Math.floor(o/2),a=[];for(let t of e){let e=t.__likertLevelIndex;if(i&&e===r){let e=t.__likertPct/2;a.push({...t,__likertLevel:va,__likertPct:-e}),a.push({...t,__likertLevel:ba,__likertPct:e})}else a.push(r>e?{...t,__likertPct:-t.__likertPct}:t)}return a}function ge(e,t){let o=t.length,i=o%2!=0,r=Math.floor(o/2),a=/* @__PURE__ */new Map;for(let t of e){let e=a.get(t.__likertCategory)||[];e.push(t),a.set(t.__likertCategory,e)}let n=[];for(let[,e]of a){let t,a,s=/* @__PURE__ */new Map;for(let o of e)o.__likertLevel===va?t=o:o.__likertLevel===ba?a=o:s.set(o.__likertLevelIndex,o);i&&t&&n.push(t);for(let e=r-1;e>=0;e--){let t=s.get(e);t&&n.push(t)}i&&a&&n.push(a);for(let e=i?r+1:r;o>e;e++){let t=s.get(e);t&&n.push(t)}}return n}function pe({data:e,levels:t,categoryAccessor:o,valueAccessor:i,levelAccessor:r,countAccessor:a,isDiverging:n,frameRef:s}){let l=!r,c=ga(()=>he(o,"question"),[o]),h=ga(()=>l?he(i,"score"):null,[l,i]),d=ga(()=>l?null:he(r,"level"),[l,r]),u=ga(()=>l?null:he(a,"count"),[l,a]),m=fa([]),g=ga(()=>({category:"string"==typeof o?o:void 0,level:"string"==typeof r?r:void 0,count:"string"==typeof a?a:void 0,score:r||"string"!=typeof i?void 0:i}),[o,a,r,i]);return{processedData:ga(()=>{let o=e||[];if(0===o.length)return[];let i=ue(o,t,c,h,d,u,g);return n&&(i=me(i,t),i=ge(i,t)),i},[e,t,c,h,d,u,g,n]),reAggregate:pa(e=>{let o=ue(e,t,c,h,d,u,g);n&&(o=me(o,t),o=ge(o,t)),s.current?.replace(o)},[t,c,h,d,u,g,n,s]),accumulatorRef:m}}function fe(e){let t=e.__likertPct??e.data?.__likertPct;return"number"==typeof t&&Number.isFinite(t)?t:void 0}function ye(e){return t=>{let o=t.category||t.data&&t.data[0]?.category||"",i=t.stats||(t.data||t).stats;if(i&&null!=i.median)/* @__PURE__ */
|
|
71
|
+
return Ha("div",{className:"semiotic-tooltip",style:ii,children:[o&&/* @__PURE__ */Ta("div",{style:{fontWeight:"bold"},children:o+""}),null!=i.n&&/* @__PURE__ */Ha("div",{children:["n = ",i.n]}),null!=i.min&&/* @__PURE__ */Ha("div",{children:["Min: ",i.min.toLocaleString()]}),null!=i.q1&&/* @__PURE__ */Ha("div",{children:["Q1: ",i.q1.toLocaleString()]}),
|
|
72
|
+
/* @__PURE__ */Ha("div",{children:["Median: ",i.median.toLocaleString()]}),null!=i.q3&&/* @__PURE__ */Ha("div",{children:["Q3: ",i.q3.toLocaleString()]}),null!=i.max&&/* @__PURE__ */Ha("div",{children:["Max: ",i.max.toLocaleString()]}),null!=i.mean&&/* @__PURE__ */Ha("div",{style:{opacity:.8},children:["Mean: ",i.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});if(e?.valueAccessor){let i=e.valueAccessor,r=(Array.isArray(t.data)?t.data:[]).map(e=>Number("function"==typeof i?i(e):e[i])).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t),a=r.length,n=a>0?a%2!=0?r[Math.floor(a/2)]:(r[a/2-1]+r[a/2])/2:null;/* @__PURE__ */
|
|
73
|
+
return Ha("div",{className:"semiotic-tooltip",style:ii,children:[o&&/* @__PURE__ */Ta("div",{style:{fontWeight:"bold"},children:o+""}),a>0&&/* @__PURE__ */Ha("div",{children:["n = ",a]}),null!=n&&/* @__PURE__ */Ha("div",{children:["Median: ",n.toLocaleString()]})]})}/* @__PURE__ */
|
|
74
|
+
return Ta("div",{className:"semiotic-tooltip",style:ii,children:/* @__PURE__ */Ta("div",{style:{fontWeight:"bold"},children:o+""})})}}function ve({value:e,min:t,max:o,radius:i,showScaleLabels:r}){let a=Math.max(16,.3*i);/* @__PURE__ */
|
|
75
|
+
return fn("g",{textAnchor:"middle",children:[
|
|
76
|
+
/* @__PURE__ */pn("text",{y:0,dominantBaseline:"central",fontSize:a,fontWeight:700,fill:"var(--semiotic-text, #333)",children:e}),r&&/* @__PURE__ */fn("text",{y:.7*a+11,fontSize:11,fill:"var(--semiotic-text-secondary, #666)",children:[t," – ",o]})]})}function be(e=240){let t=360-e,o=180+t/2,i=o*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:o,startAngleRad:i,offsetRad:-Math.PI/2+i}}function xe(e=240){let{sweepRad:t,offsetRad:o}=be(e),i=[[Math.cos(o),Math.sin(o)],[Math.cos(o+t),Math.sin(o+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)t+.001>=((e-o)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)&&i.push([Math.cos(e),Math.sin(e)]);let r=i.map(e=>e[0]),a=i.map(e=>e[1]),[n,s]=_i(r),[l,c]=_i(a);return{minX:n,maxX:s,minY:l,maxY:c,width:s-n,height:c-l,cx:(n+s)/2,cy:(l+c)/2}}function we(e){return Math.max(0,Math.min(1,e))}function ke(e){let t=e.trim();if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e.split("").map(e=>e+e).join("")),6===e.length&&/^[0-9a-f]{6}$/i.test(e))return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}let o=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);if(o){let e=[Number(o[1]),Number(o[2]),Number(o[3])];if(e.every(Number.isFinite))return e}return null}function Ae(e,t,o){let i=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0");return`#${i(e)}${i(t)}${i(o)}`}function Se(e,t,o){let i=e.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:we(e.offset),color:e.color??o,opacity:null==e.opacity?1:we(e.opacity)})).sort((e,t)=>e.offset-t.offset);if(0===i.length)return"#999999";let r=e=>{if(1===e.opacity)return e.color;let t=ke(e.color);return t?`rgba(${t[0]},${t[1]},${t[2]},${e.opacity})`:e.color};if(1===i.length)return r(i[0]);let a=we(t);if(i[0].offset>=a)return r(i[0]);if(a>=i[i.length-1].offset)return r(i[i.length-1]);for(let e=0;i.length-1>e;e++){let t=i[e],o=i[e+1];if(t.offset>a||a>o.offset)continue;let n=o.offset-t.offset,s=n>0?(a-t.offset)/n:0,l=ke(t.color),c=ke(o.color);if(!l||!c)return r(.5>s?t:o);let[h,d,u]=l,[m,g,p]=c,f=h+(m-h)*s,y=d+(g-d)*s,v=u+(p-u)*s,b=t.opacity+(o.opacity-t.opacity)*s;return 1===b?Ae(f,y,v):`rgba(${Math.round(f)},${Math.round(y)},${Math.round(v)},${b})`}return r(i[i.length-1])}function Re(e,t,o){return null==o?`${e}-${t}`:`${e}-${t}-${o}`}function Pe(e){let{min:t,max:o,value:i,thresholds:r,fillColor:a,backgroundColor:n,fillZones:s,showScaleLabels:l,gradientFill:c,gradientSteps:h=240}=e,d=o-t||1,u=(Math.max(t,Math.min(o,i))-t)/d,m=r&&r.length>0?[...r].sort((e,t)=>e.value-t.value):[{value:o,color:a||"#007bff"}];m=m.map(e=>({...e,value:Math.max(t,Math.min(o,e.value))})),o>m[m.length-1].value&&m.push({value:o,color:m[m.length-1].color});let g=!!c&&c.stops.length>=2,p=[],f=/* @__PURE__ */new Map,y=[];if(g){let e=s?u:1,t=Re("bg",0);if(p.push({category:t,value:1,_zone:"Track",_isFill:!1,_pctStart:0,_pct:1,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0}),f.set(t,{fill:n,opacity:.4}),e>0){let t=Math.max(1,Math.floor(h)),o=Math.max(1,Math.min(t,Math.round(e*t))),i=[];for(let t=0;o>t;t++)i.push(Se(c.stops,e*(t+.5)/o,a||m[0]?.color||"#007bff"));let r=Re("fill",0);p.push({category:r,value:e,_zone:"Gradient",_isFill:!0,_pctStart:0,_pct:e,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0,_gradientBand:{colors:i}}),f.set(r,{fill:i[0]||n})}}else{let e=t;for(let o=0;m.length>o;o++){let i=m[o],r=(i.value-e)/d,a=(e-t)/d,l=(i.value-t)/d,c=Math.max(0,(s?Math.min(u,l):l)-a),h=s?Math.max(0,r-c):0;if(c>0){let e=Re("fill",o);p.push({category:e,value:c,_zone:i.label||"Zone "+(o+1),_isFill:!0}),f.set(e,{fill:i.color})}if(h>0){let e=Re("bg",o);p.push({category:e,value:h,_zone:i.label||"Zone "+(o+1),_isFill:!1}),f.set(e,{fill:n,opacity:.4})}e=i.value}}if(l&&r&&r.length>0)for(let e of r)e.value>t&&o>e.value&&y.push({type:"gauge-label",value:e.value,label:e.label||e.value+""});return{gaugeData:p,pieceStyle:(e,t)=>f.get(t||e.category)||{fill:n},gaugeAnnotations:y}}import{a as Ce}from"./c-PDQHLOKU.min.js";import{c as _e}from"./c-PQOZPM4G.min.js";import{b as Le}from"./c-IBRLFKWA.min.js";import{a as Me,b as Ie,c as Te}from"./c-HQ27AHMC.min.js";import{a as He}from"./c-PKY4JFY5.min.js";import{a as Be}from"./c-SQNEVNWT.min.js";import{a as Fe,b as $e,c as Oe,e as We,f as De,g as je,h as Ne,j as Ee}from"./c-2TW5H5PD.min.js";import{h as ze,j as Ve,k as Ge}from"./c-HK4OSLZA.min.js";import{a as qe,b as Xe,d as Ye,e as Qe,f as Ke,g as Ze,h as Je,i as Ue,j as et,k as tt,m as ot}from"./c-VXIYF7V2.min.js";import{a as it}from"./c-P5NXQWIM.min.js";import{a as rt}from"./c-TIMGODBG.min.js";import{a as at}from"./c-3AGX252H.min.js";import{a as nt}from"./c-QXLDCATV.min.js";import{a as st,b as lt,d as ct}from"./c-U5XVLSHN.min.js";import{A as ht,D as dt,E as ut,G as mt,L as gt,W as pt,X as ft,Y as yt,Z as vt,_ as bt,a as xt,b as wt,d as kt,e as At,f as St,g as Rt,h as Pt,i as Ct,k as _t,l as Lt,n as Mt,o as It,q as Tt,r as Ht,s as Bt,t as Ft,u as $t,v as Ot,x as Wt}from"./c-KGROWFT2.min.js";import{d as Dt}from"./c-V5KFJWQQ.min.js";import{c as jt}from"./c-CLLCX3PT.min.js";import{a as Nt,b as Et}from"./c-N5WT7TXG.min.js";import{$ as zt,A as Vt,Ca as Gt,D as qt,Eb as Xt,Fa as Yt,Gb as Qt,H as Kt,Hb as Zt,Ia as Jt,J as Ut,Ja as eo,Jb as to,Ka as oo,Kb as io,L as ro,M as ao,Ma as no,Mb as so,Na as lo,Nb as co,R as ho,Sb as uo,Tb as mo,U as go,V as po,Va as fo,W as yo,Wa as vo,X as bo,Y as xo,_ as wo,_a as ko,aa as Ao,ab as So,b as Ro,bb as Po,c as Co,ca as _o,cb as Lo,d as Mo,db as Io,e as To,ea as Ho,f as Bo,fa as Fo,ga as $o,ha as Oo,hb as Wo,ia as Do,ja as jo,jb as No,ka as Eo,nb as zo,o as Vo,oa as Go,p as qo,q as Xo,qa as Yo,ra as Qo,s as Ko,ta as Zo,u as Jo,va as Uo,wa as ei,x as ti,xa as oi,ya as ii}from"./c-G53AVC42.min.js";import{e as ri,f as ai,g as ni,h as si,i as li,j as ci,k as hi,p as di,r as ui,s as mi,u as gi}from"./c-Y342FJ6K.min.js";import{D as pi,b as fi,c as yi,i as vi,k as bi,m as xi,p as wi,q as ki,r as Ai,t as Si,x as Ri,z as Pi}from"./c-3BYZXCX3.min.js";import{e as Ci}from"./c-5NYONM6V.min.js";import{a as _i,c as Li}from"./c-3PFVJFBK.min.js";import*as Mi from"react";import{jsx as Ii}from"react/jsx-runtime";var Ti=/* @__PURE__ */new Set(["svg","g","text","tspan","path","circle","ellipse","rect","line","polyline","polygon","use","image","defs","symbol"]);import{forwardRef as Hi,memo as Bi,useCallback as Fi,useEffect as $i,useMemo as Oi,useRef as Wi,useState as Di}from"react";import{scaleBand as ji,scaleLinear as Ni}from"d3-scale";var Ei=class{constructor(){this.colorSchemeMap=/* @__PURE__ */new Map,this.colorSchemeIndex=0}resetColors(){this.colorSchemeMap.clear(),this.colorSchemeIndex=0}resolvePieceStyle(e,t,o){if(t&&"function"==typeof e.pieceStyle){let i=e.pieceStyle(t,o);return i&&!i.fill&&o?{...i,fill:this.getColorFromScheme(e,o)}:i}return e.pieceStyle&&"object"==typeof e.pieceStyle?e.pieceStyle:e.barColors&&o?{fill:mi(e.barColors,o)??"#007bff"}:{fill:o?this.getColorFromScheme(e,o):"#007bff"}}resolveSummaryStyle(e,t,o){return t&&"function"==typeof e.summaryStyle?e.summaryStyle(t,o):e.summaryStyle&&"object"==typeof e.summaryStyle?e.summaryStyle:{fill:"#007bff",fillOpacity:.6,stroke:"#007bff",strokeWidth:1}}getColorFromScheme(e,t){let o=this.colorSchemeMap.get(t);if(o)return o;let i=Array.isArray(e.colorScheme)?e.colorScheme:e.themeCategorical||di,r=i[this.colorSchemeIndex%i.length];return this.colorSchemeIndex++,this.colorSchemeMap.set(t,r),r}};import{quantileSorted as zi}from"d3-array";import{scaleLinear as Vi}from"d3-scale";var Gi={bar:function(e,t){let{scales:o,columns:i,config:a,getR:n,getStack:s,resolvePieceStyle:l}=e,{r:c,projection:h}=o,d=[],u="vertical"===h,m="horizontal"===h,g=a.normalize,p=[];if(s){let e=/* @__PURE__ */new Set;for(let t of Object.values(i))for(let o of t.pieceData){let t=s(o);e.has(t)||(e.add(t),p.push(t))}}else p.push("_default");for(let e of Object.values(i)){let t=/* @__PURE__ */new Map;for(let o of e.pieceData){let e=s?s(o):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});let i=t.get(e);i.total+=n(o),i.pieces.push(o)}let o=0;if(g)for(let e of t.values())o+=Math.abs(e.total);let i=0,r=0;for(let a of p){let n=t.get(a);if(!n)continue;let h=n.total;g&&o>0&&(h/=o);let p=l(n.pieces[0],s?a:e.name),f={...n.pieces[0],__aggregateValue:n.total,__pieceCount:n.pieces.length,category:e.name};if(u){let t=c(0>h?r:i+h),o=0>h?c(r+h)-c(r):c(i)-c(i+h);d.push(ze(e.x,t,e.width,Math.abs(o),p,f,a)),0>h?r+=h:i+=h}else if(m){let t=c(0>h?r+h:i),o=0>h?c(r)-c(r+h):c(i+h)-c(i);d.push(ze(t,e.x,Math.abs(o),e.width,p,f,a)),0>h?r+=h:i+=h}}}let f="vertical"===h;for(let e of d){if("rect"!==e.type)continue;let t=e.datum?.__aggregateValue??0;e.roundedEdge=f?0>t?"bottom":"top":0>t?"left":"right",a.gradientFill&&(e.fillGradient=a.gradientFill)}if(void 0!==a.roundedTop){let e=/* @__PURE__ */new Map;for(let t of d){if("rect"!==t.type)continue;let o=t.datum?.category||"";e.has(o)||e.set(o,[]),e.get(o).push(t)}for(let t of e.values()){if(0===t.length)continue;let e=t.filter(e=>(e.datum?.__aggregateValue??0)>=0),o=t.filter(e=>0>(e.datum?.__aggregateValue??0));if(e.length>0){let t=e.reduce(f?(e,t)=>t.y>e.y?e:t:(e,t)=>e.x+e.w>t.x+t.w?e:t),o=r(a.roundedTop,t,f);o>0&&(t.roundedTop=o)}if(o.length>0){let e=o.reduce(f?(e,t)=>e.y+e.h>t.y+t.h?e:t:(e,t)=>t.x>e.x?e:t),t=r(a.roundedTop,e,f);t>0&&(e.roundedTop=t)}}}return d},clusterbar:function(e,t){let{scales:o,columns:i,config:a,getR:n,getGroup:s,resolvePieceStyle:l}=e,{r:c,projection:h}=o,d=[],u="vertical"===h,m=[],g=/* @__PURE__ */new Set;for(let e of Object.values(i))for(let t of e.pieceData){let e=s?s(t):"_default";g.has(e)||(g.add(e),m.push(e))}let p=m.length||1;for(let e of Object.values(i)){let t=e.width/p,o=.2*t,i=t-o,r=/* @__PURE__ */new Map;for(let t of e.pieceData){let e=s?s(t):"_default";r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let a=0;m.length>a;a++){let s=r.get(m[a])||[];for(let r of s){let s=n(r),h=l(r,m[a]);if(u){let n=e.x+a*t+o/2,l=c(0),u=c(s);d.push(ze(n,Math.min(l,u),i,Math.abs(l-u),h,r,m[a]))}else{let n=e.x+a*t+o/2,l=c(0),u=c(s);d.push(ze(Math.min(l,u),n,Math.abs(u-l),i,h,r,m[a]))}}}}for(let e of d){if("rect"!==e.type||null==e.datum)continue;let t=n(e.datum),o=r(a.roundedTop,e,u);o>0&&(e.roundedTop=o),e.roundedEdge=u?0>t?"bottom":"top":0>t?"left":"right",a.gradientFill&&(e.fillGradient=a.gradientFill)}return d},point:function(e,t){let{scales:o,columns:i,getR:r,multiScales:s,resolvePieceStyle:l}=e,{r:c,projection:h}=o,d=[],u="vertical"===h,m="radial"===h,g=s.length>0,p=a(e),f=2*Math.PI,y=-Math.PI/2;for(let e of Object.values(i))for(let t of e.pieceData){let o,i,a=t.__rIndex??0,h=t.__rValue??r(t),v=g&&s[a]||c,b=l(t,e.name),x=b.r||5;if(m){let t=y+(e.pctStart+e.pct/2)*f,r=v(h);o=Math.cos(t)*r,i=Math.sin(t)*r}else u?(o=e.middle,i=v(h)):(o=v(h),i=e.middle);n(d,p,t,o,i,x,b)}return d},swarm:function(e,t){let{scales:o,columns:i,getR:r,resolvePieceStyle:s}=e,{r:l,projection:c}=o,h=[],d="vertical"===c,u=a(e);for(let e of Object.values(i)){let t=e.width/2;for(let o=0;e.pieceData.length>o;o++){let i=e.pieceData[o],a=r(i),c=s(i,e.name),m=c.r||4,g=(7919*o%100/100-.5)*t*.8;n(h,u,i,d?e.middle+g:l(a),d?l(a):e.middle+g,m,c)}}return h},pie:s,donut:s,boxplot:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:n}=e,{r:s,projection:h}=o,d=[],u="vertical"===h,m=!1!==r.showOutliers;for(let t of Object.values(i)){let o=t.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(0===o.length)continue;let i=c(o),{min:r,max:h,q1:g,median:p,q3:f}=i,y=f-g,v=g-1.5*y,b=f+1.5*y,x=o.find(e=>e>=v)??r,w=h;for(let e=o.length-1;e>=0;e--)if(b>=o[e]){w=o[e];break}i.min=x,i.max=w;let k=n(l(t.pieceData,t.name,i),t.name),A=[];if(m)for(let e of t.pieceData){let o=a(e);if(v>o||o>b){let i=u?t.middle:s(o),r=u?s(o):t.middle;A.push({px:i,py:r,value:o,datum:e})}}if(d.push({type:"boxplot",x:u?t.middle:0,y:u?0:t.middle,projection:u?"vertical":"horizontal",columnWidth:.6*t.width,minPos:s(x),q1Pos:s(g),medianPos:s(p),q3Pos:s(f),maxPos:s(w),stats:i,style:k,datum:t.pieceData,category:t.name,outliers:A}),m)for(let t of A)d.push({type:"point",x:t.px,y:t.py,r:3,style:{fill:k.fill||e.config.themeSemantic?.secondary||"#999",opacity:.6,cursor:k.cursor},datum:t.datum})}return d},violin:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:n}=e,{r:s,projection:d}=o,u=[],m="vertical"===d,g=r.bins||20,p=!1!==r.showIQR;for(let e of Object.values(i)){let t=e.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;let o,i=t[0],r=t[t.length-1],d=(r-i)/g||1,f=h(t,i,r,d,g),y=Li(f,1),v=e.width/2*.9;if(m){o=`M ${e.middle} ${s(i)}`;for(let t=0;g>t;t++){let r=s(i+(t+.5)*d);o+=` L ${e.middle+f[t]/y*v} ${r}`}o+=` L ${e.middle} ${s(r)}`;for(let t=g-1;t>=0;t--){let r=s(i+(t+.5)*d);o+=` L ${e.middle-f[t]/y*v} ${r}`}o+=" Z"}else{o=`M ${s(i)} ${e.middle}`;for(let t=0;g>t;t++)o+=` L ${s(i+(t+.5)*d)} ${e.middle-f[t]/y*v}`;o+=` L ${s(r)} ${e.middle}`;for(let t=g-1;t>=0;t--)o+=` L ${s(i+(t+.5)*d)} ${e.middle+f[t]/y*v}`;o+=" Z"}let b,x=c(t),w=n(l(e.pieceData,e.name,x),e.name);p&&t.length>=4&&(b={q1Pos:s(x.q1),medianPos:s(x.median),q3Pos:s(x.q3),centerPos:e.middle,isVertical:m});let k=m?{x:e.x,y:Math.min(s(r),s(i)),width:e.width,height:Math.abs(s(r)-s(i))}:{x:Math.min(s(i),s(r)),y:e.x,width:Math.abs(s(r)-s(i)),height:e.width};u.push({type:"violin",pathString:o,translateX:0,translateY:0,bounds:k,iqrLine:b,stats:x,style:w,datum:e.pieceData,category:e.name})}return u},histogram:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:n}=e,{r:s}=o,l=[],c=r.bins||25,d=r.normalize,u=s.domain?.(),m=u?+u[0]:void 0,g=u?+u[1]:void 0;for(let e of Object.values(i)){let t=e.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e));if(0===t.length)continue;let[o,i]=_i(t),r=null!=m&&isFinite(m)?m:o,u=null!=g&&isFinite(g)?g:i,p=(u-r)/c||1,f=h(t,r,u,p,c),y=t.length,v=Li(f,1);for(let t=0;c>t;t++){if(0===f[t])continue;let o=(d?f[t]/y:f[t]/v)*e.width*.9,i=s(r+t*p),a=s(r+(t+1)*p),c=Math.min(i,a),h=Math.abs(a-i),u=e.x+e.width-o,m={...e.pieceData[0],bin:t,count:f[t],range:[r+t*p,r+(t+1)*p],category:e.name,data:e.pieceData},g=n(m,e.name);l.push(ze(c,u,h,o,g,m,e.name))}}return l},ridgeline:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:n}=e,{r:s,projection:d}=o,u=[],m=r.bins||20,g="horizontal"===d,p=r.amplitude||1.5;for(let e of Object.values(i)){let t=e.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;let o,i=t[0],r=t[t.length-1],d=(r-i)/m||1,f=h(t,i,r,d,m),y=Li(f,1),v=c(t),b=n(l(e.pieceData,e.name,v),e.name),x=e.width*p;if(g){let t=e.x+e.width;o=`M ${s(i)} ${t}`;for(let e=0;m>e;e++)o+=` L ${s(i+(e+.5)*d)} ${t-f[e]/y*x}`;o+=` L ${s(r)} ${t} Z`}else{let t=e.x;o=`M ${t} ${s(i)}`;for(let e=0;m>e;e++){let r=s(i+(e+.5)*d);o+=` L ${t+f[e]/y*x} ${r}`}o+=` L ${t} ${s(r)} Z`}let w=g?{x:Math.min(s(i),s(r)),y:e.x,width:Math.abs(s(r)-s(i)),height:e.width}:{x:e.x,y:Math.min(s(r),s(i)),width:e.width,height:Math.abs(s(r)-s(i))};u.push({type:"violin",pathString:o,translateX:0,translateY:0,bounds:w,stats:v,style:{...b,fillOpacity:b.fillOpacity??.5},datum:e.pieceData,category:e.name})}return u},timeline:function(e,t){let{scales:o,columns:i,getRawRange:r,resolvePieceStyle:a}=e,{r:n,projection:s}=o,l=[],c="horizontal"===s;for(let e of Object.values(i))for(let t of e.pieceData){let o=r(t);if(!o)continue;let[i,s]=o,h=a(t,e.name);if(c){let o=n(Math.min(i,s)),r=n(Math.max(i,s));l.push(ze(o,e.x,r-o,e.width,h,t,e.name))}else{let o=n(Math.max(i,s)),r=n(Math.min(i,s));l.push(ze(e.x,o,e.width,r-o,h,t,e.name))}}return l},funnel:function(e,t){let{columns:o,getR:i,getStack:r,resolvePieceStyle:a}=e,n=[],s=t.width/2,l=!1!==e.config.showLabels,c=e.scales.o.domain().map(e=>o[e]).filter(Boolean);if(0===c.length)return n;let h=[],d=/* @__PURE__ */new Set;for(let e of c)for(let t of e.pieceData){let e=r?r(t):"_default";d.has(e)||(d.add(e),h.push(e))}let u=h.length>1&&"_default"!==h[0],m=[],g=0;for(let e of c){let t=/* @__PURE__ */new Map,o=0;for(let a of e.pieceData){let e=r?r(a):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});let n=t.get(e),s=i(a);n.total+=s,n.pieces.push(a),o+=s}m.push({col:e,groups:t,stepTotal:o}),u||o>g&&(g=o)}if(u)for(let e of m){let t=0,o=0;for(let i=0;h.length>i;i++){let r=e.groups.get(h[i]);r&&(i%2==0?t+=r.total:o+=r.total)}let i=Math.max(t,o);i>g&&(g=i)}if(0===g)return n;let p=/* @__PURE__ */new Map;for(let e of h){let t=m[0].groups.get(e);p.set(e,t?.total??0)}let f=m[0].stepTotal,y=u?.95*s:.9*t.width,v=Vi().domain([0,g]).range([0,y]),b=e.config.connectorOpacity??.3,x=/* @__PURE__ */new Map;for(let t=0;m.length>t;t++){let o=m[t],i=o.col,r=0===t,c=i.width,d=.55*c,g=i.x+(c-d)/2,y=/* @__PURE__ */new Map;if(u){let e=0;for(let t of h){let i=o.groups.get(t);i&&(e+=v(i.total))}let t=s,c=s;for(let u=0;h.length>u;u++){let m=h[u],f=o.groups.get(m);if(!f)continue;let b=v(f.total),x=u%2==0,w=x?t:c-b;x?t+=b:c-=b;let k=a(f.pieces[0],m),A=p.get(m)??f.total,S={...f.pieces[0],__funnelValue:f.total,__funnelPercent:A>0?f.total/A*100:0,__funnelStep:i.name,__funnelIsFirstStep:r,__aggregateValue:f.total,__pieceCount:f.pieces.length,category:m};l&&(0===u&&(S.__funnelStepLabel=i.name,S.__funnelStepLabelX=s,S.__funnelStepLabelY=g,S.__funnelRowWidth=e),S.__funnelValueLabelX=w+b/2,S.__funnelValueLabelY=g,S.__funnelBarW=b),n.push(ze(w,g,b,d,k,S,m)),y.set(m,{x:w,y:g,w:b,h:d})}}else{let e=o.stepTotal,t=v(e),c=s-t/2,u=h[0],m="_default"!==u,p=o.groups.get(u)?.pieces[0]??i.pieceData[0],b=m?u:i.name,x=a(p,b),w=f>0?e/f*100:0,k={...p,__funnelValue:e,__funnelPercent:w,__funnelStep:i.name,__funnelIsFirstStep:r,category:m?u:i.name};l&&(k.__funnelStepLabel=i.name,k.__funnelStepLabelX=s,k.__funnelStepLabelY=g,k.__funnelRowWidth=t,k.__funnelValueLabelX=s,k.__funnelValueLabelY=g,k.__funnelBarW=t),n.push(ze(c,g,t,d,x,k,b)),y.set(u,{x:c,y:g,w:t,h:d})}if(t>0&&x.size>0){let t=u?h:[h[0]];for(let r of t){let t=x.get(r),s=y.get(r);if(!t||!s)continue;let l=(()=>{let e=o.groups.get(r);return a(e?e.pieces[0]:i.pieceData[0],"_default"===r?i.name:r)})(),c={type:"trapezoid",points:[[t.x,t.y+t.h],[t.x+t.w,t.y+t.h],[s.x+s.w,s.y],[s.x,s.y]],style:{fill:l.fill||e.config.themeSemantic?.secondary||"#999",opacity:b,cursor:l.cursor},datum:o.groups.get(r)?.pieces[0]??i.pieceData[0],category:"_default"===r?i.name:r};n.push(c)}}x=y}return n},"bar-funnel":function(e,t){let{columns:o,getR:i,getStack:r,resolvePieceStyle:a,scales:n}=e,s=[],l=n.o.domain().map(e=>o[e]).filter(Boolean);if(0===l.length)return s;let c=[],h=/* @__PURE__ */new Set;for(let e of l)for(let t of e.pieceData){let e=r?r(t):"_default";h.has(e)||(h.add(e),c.push(e))}let d=c.length>1&&"_default"!==c[0],u=[];for(let e of l){let t=/* @__PURE__ */new Map,o=0;for(let a of e.pieceData){let e=r?r(a):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});let n=t.get(e),s=i(a);n.total+=s,n.pieces.push(a),o+=s}u.push({col:e,groups:t,stepTotal:o})}let m=/* @__PURE__ */new Map;for(let e of c){let t=u[0]?.groups.get(e);m.set(e,t?.total??0)}let g=n.r,p=d?c.length:1,f=d?.15:0;for(let e=0;u.length>e;e++){let t=u[e],o=t.col,i=0===e,r=e>0?u[e-1]:null,n=o.width/p,l=n*f,h=n-l;for(let e=0;c.length>e;e++){let u=c[e],p=t.groups.get(u);if(!p)continue;let f=p.total,y=m.get(u)??f,v=y>0?f/y*100:0,b=r?.groups.get(u)?.total??f,x=i?0:Math.max(0,b-f),w=o.x+e*n+l/2,k=g(f),A=g(0)-k,S=a(p.pieces[0],d?u:o.name),R={...p.pieces[0],__barFunnelValue:f,__barFunnelPercent:v,__barFunnelIsFirstStep:i,__barFunnelIsDropoff:!1,__barFunnelStep:o.name,__barFunnelDropoffValue:x,__barFunnelCategory:"_default"===u?void 0:u,category:d?u:o.name,__barFunnelLabelX:w+h/2,__barFunnelLabelY:g(f+x)};if(s.push(ze(w,k,h,A,S,R,d?u:o.name)),x>0){let e=g(f+x),t=k-e,i={...S},r={...p.pieces[0],__barFunnelValue:x,__barFunnelPercent:y>0?x/y*100:0,__barFunnelIsFirstStep:!1,__barFunnelIsDropoff:!0,__barFunnelStep:o.name,__barFunnelCategory:"_default"===u?void 0:u,category:d?u:o.name};s.push(ze(w,e,h,t,i,r,d?u:o.name))}}}return s},swimlane:function(e,t){let{scales:o,columns:i,getR:r,getStack:a,resolvePieceStyle:n}=e,{r:s,projection:l}=o,c=[],h="horizontal"===l,d=e.config.gradientFill,u=h?"left":"bottom",m=/* @__PURE__ */new Map,g=t=>{let o=m.get(t);if(void 0!==o)return o;let i="function"==typeof e.config.roundedTop?e.config.roundedTop(t.width):e.config.roundedTop,r="number"==typeof i&&Number.isFinite(i)?Math.max(0,i):0;return m.set(t,r),r},p=e.config.trackFill;if(p){let e="string"==typeof p?p:p.color,t="string"==typeof p?1:p.opacity??1,[o,r]=s.range(),a=Math.min(o,r),n=Math.abs(r-o);for(let o of Object.values(i)){let i={fill:e,opacity:t},r=h?ze(a,o.x,n,o.width,i,null,"__track__"):ze(o.x,a,o.width,n,i,null,"__track__"),s=g(o);s>0&&(r.cornerRadii={tl:s,tr:s,br:s,bl:s}),c.push(r)}}for(let e of Object.values(i)){let t=0,o=c.length,i=g(e);for(let o of e.pieceData){let i=Math.abs(r(o));if(0===i)continue;let l,m=a?a(o):e.name,g=n(o,m);if(h){let r=s(t),a=s(t+i);l=ze(r,e.x,a-r,e.width,g,o,m)}else{let r=s(t+i),a=s(t);l=ze(e.x,r,e.width,a-r,g,o,m)}d&&(l.fillGradient=d,l.roundedEdge=u),c.push(l),t+=i}if(i>0&&c.length>o){let e=c.slice(o),t=e[0],r=e[e.length-1];1===e.length?t.cornerRadii={tl:i,tr:i,br:i,bl:i}:h?(t.cornerRadii={tl:i,bl:i},r.cornerRadii={tr:i,br:i}):(t.cornerRadii={bl:i,br:i},r.cornerRadii={tl:i,tr:i})}}return c}},qi=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Xi=["scene-style","data-paint","accessibility","evidence"],Yi=(e,t)=>({retainedData:e,invalidations:t}),Qi=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ki=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Zi=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ji=["scene-geometry","data-paint","accessibility","evidence"],Ui=["scene-style","data-paint","accessibility","evidence"],er=[],tr={chartType:Yi("rebuild",Qi),runtimeMode:Yi("rebuild",Qi),categoryAccessor:Yi("rebuild",Qi),valueAccessor:Yi("rebuild",Qi),oAccessor:Yi("rebuild",Qi),rAccessor:Yi("rebuild",Qi),stackBy:Yi("rebuild",Qi),groupBy:Yi("rebuild",Qi),timeAccessor:Yi("rebuild",Qi),accessorRevision:Yi("rebuild",Qi),colorAccessor:Yi("rebuild",Ui),symbolAccessor:Yi("rebuild",Ji),connectorAccessor:Yi("rebuild",Ji),dataIdAccessor:Yi("rebuild",Ji),projection:Yi("preserve",Ki),extentPadding:Yi("preserve",Ki),axisExtent:Yi("preserve",Ki),rExtent:Yi("preserve",Ki),oExtent:Yi("preserve",Ki),multiAxis:Yi("preserve",Ki),normalize:Yi("preserve",Ki),bins:Yi("preserve",Ki),oSort:Yi("preserve",Zi),barPadding:Yi("preserve",Zi),roundedTop:Yi("preserve",Zi),baselinePadding:Yi("preserve",Zi),innerRadius:Yi("preserve",Zi),cornerRadius:Yi("preserve",Zi),startAngle:Yi("preserve",Zi),sweepAngle:Yi("preserve",Zi),trackFill:Yi("preserve",Zi),showOutliers:Yi("preserve",Zi),showIQR:Yi("preserve",Zi),amplitude:Yi("preserve",Zi),connectorOpacity:Yi("preserve",Zi),showLabels:Yi("preserve",Zi),dynamicColumnWidth:Yi("rebuild",Zi),customLayout:Yi("preserve",Zi),layoutConfig:Yi("preserve",Zi),layoutMargin:Yi("preserve",Zi),symbolMap:Yi("preserve",Ji),pieceStyle:Yi("preserve",Ui),summaryStyle:Yi("preserve",Ui),connectorStyle:Yi("preserve",Ui),gradientFill:Yi("preserve",Ui),colorScheme:Yi("preserve",Ui),themeCategorical:Yi("preserve",Ui),themeSemantic:Yi("preserve",Ui),themeSequential:Yi("preserve",Ui),themeDiverging:Yi("preserve",Ui),barColors:Yi("preserve",Ui),decay:Yi("preserve",Ui),pulse:Yi("preserve",Ui),staleness:Yi("preserve",Ui),layoutSelection:Yi("preserve",Ui),windowSize:Yi("preserve",er),windowMode:Yi("preserve",er),clock:Yi("preserve",er),transition:Yi("preserve",er),introAnimation:Yi("preserve",er),onLayoutError:Yi("preserve",er)},or=Yi("preserve",Zi),ir=class{constructor(){this.tracker=new qo}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},qi)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Xi):this.recordNoop("restyle")}recordConfig(e){let t=g(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}};import{quadtree as rr}from"d3-quadtree";var ar=class{constructor(e){this.rExtent=new $e,this.rExtents=[],this.windowSizeWarned=!1,this.updateResults=new ir,this.rAccessors=[],this.categories=/* @__PURE__ */new Set,this._hasStreamingData=!1,this.styleResolver=new Ei,this.timestampBuffer=null,this.activeTransition=null,this.prevPositionMap=/* @__PURE__ */new Map,this.exitNodes=[],this.lastIngestTime=0,this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=/* @__PURE__ */new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this.version=0,this._dataVersion=0,this._bufferArrayCache=null,this._pointQuadtree=null,this._maxPointRadius=0,this._datumIndexCache=null,this._categoryIndexCache=null,this._hasRenderedOnce=!1,this.config=e,this.buffer=new qe(e.windowSize),this.getO=ct(e.categoryAccessor||e.oAccessor,"category");let t=e.valueAccessor||e.rAccessor;Array.isArray(t)?(this.rAccessors=t.map(e=>lt(e,"value")),this.getR=this.rAccessors[0],this.rExtents=t.map(()=>new $e)):(this.getR=lt(t,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent]),this.getStack=ct(e.stackBy),this.getGroup=ct(e.groupBy),this.getColor=ct(e.colorAccessor),this.getSymbol=ct(e.symbolAccessor),this.getConnector=ct(e.connectorAccessor),this.getDataId=ct(e.dataIdAccessor),e.pulse&&(this.timestampBuffer=new qe(e.windowSize))}syncPulseTimestampBuffer(){var e,t,o,i;this.timestampBuffer=(e=!!this.config.pulse,t=this.buffer,o=this.timestampBuffer,i=this.currentTime(),e?null!=o&&o.capacity===t.capacity&&o.size===t.size?o:Ze(t,i):null)}currentTime(){return this.config.clock?.()??Bo()}ingest(e){let t=this.currentTime();if(this.lastIngestTime=t,this._dataVersion++,e.bounded){this.buffer.clear(),this.rExtent.clear();for(let e of this.rExtents)e.clear();e.preserveCategoryOrder?this._hasStreamingData=!0:this.categories.clear(),this.timestampBuffer&&this.timestampBuffer.clear(),Ke(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(let o of e.inserts)Je(this.buffer,o,this.timestampBuffer,t),this.categories.add(this.getO(o)),this.pushValueExtent(o)}else{this._hasStreamingData=!0;for(let o of e.inserts){let e=Je(this.buffer,o,this.timestampBuffer,t);this.categories.add(this.getO(o)),this.pushValueExtent(o),null!=e&&this.evictValueExtent(e)}}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}pushValueExtent(e){if("timeline"===this.config.chartType){let t=this.getRawRange(e);t&&(this.rExtent.push(t[0]),this.rExtent.push(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].push(this.rAccessors[t](e));this.rExtent.push(this.getR(e))}else this.rExtent.push(this.getR(e))}evictValueExtent(e){if("timeline"===this.config.chartType){let t=this.getRawRange(e);t&&(this.rExtent.evict(t[0]),this.rExtent.evict(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].evict(this.rAccessors[t](e));this.rExtent.evict(this.getR(e))}else this.rExtent.evict(this.getR(e))}getRawRange(e){let t=this.config.valueAccessor||this.config.rAccessor;if(!t)return null;let o="function"==typeof t?t(e):e[t];return Array.isArray(o)&&o.length>=2?[+o[0],+o[1]]:null}computeScene(e){let{config:t,buffer:o}=this,i=this.scales,r=this.multiScales,a=this.columns;if(0===o.size)return this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,void this.version++;this.rExtent.dirty&&this.rExtent.recalculate(o,this.getR);let n,s,l=this.getBufferArray(),c=t.projection||"vertical",h=t.oExtent||this.resolveCategories(l),d=this.computeValueDomain(l,h),u="horizontal"===c,m="radial"===c,g=Math.min(.9,Math.max(0,null!=t.barPadding?t.barPadding/("vertical"===c?e.width:e.height):.1));if(m){n=ji().domain(h).range([0,1]).padding(0);let o=Math.min(e.width,e.height)/2,i=t.innerRadius||0;s=Ni().domain(d).range([i,o])}else u?(n=ji().domain(h).range([0,e.height]).padding(g),s=Ni().domain(d).range([0,e.width])):(n=ji().domain(h).range([0,e.width]).padding(g),s=Ni().domain(d).range([e.height,0]));this.scales={o:n,r:s,projection:c},this.multiScales=this.rAccessors.length>1&&t.multiAxis?this.rAccessors.map((i,r)=>{let a=this.rExtents[r];a.dirty&&a.recalculate(o,i);let[n,s]=a.extent;n===1/0&&(n=0,s=1);let l=s-n,c=l>0?l*(t.extentPadding??.05):1;return n-=c,s+=c,n>0&&(n=0),u?Ni().domain([n,s]).range([0,e.width]):Ni().domain([n,s]).range([e.height,0])}):[];let p=l;this.rAccessors.length>1&&(p=l.flatMap(e=>this.rAccessors.map((t,o)=>({...e,__rIndex:o,__rValue:t(e),__rName:this.resolveRAccessorName(o)})))),this.columns=this.buildColumns(p,h,n,c,e),this._customLayoutFailedThisBuild=!1;let f=this.buildSceneNodes(p,e);this._customLayoutFailedThisBuild?!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=i,this.multiScales=r,this.columns=a):(this.scene=[],this.rebuildPointQuadtree()):(this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=f,this.rebuildPointQuadtree(),this.config.decay&&this.applyDecay(this.scene,l),this.config.pulse&&this.applyPulse(this.scene,l),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&this.prevPositionMap.size>0&&this.startTransition(),this.version++)}resolveRAccessorName(e){let t=this.config.valueAccessor||this.config.rAccessor,o=Array.isArray(t)?t[e]:t;return"string"==typeof o?o:"value"+e}resolveCategories(e){let t=this.config.oSort,o="streaming"===this.config.runtimeMode||this._hasStreamingData,i="auto"===t?void 0:t,r=null;if(o){r=/* @__PURE__ */new Set;for(let t of e)r.add(this.getO(t))}let a=r?Array.from(this.categories).filter(e=>r.has(e)):Array.from(this.categories);if(o&&void 0===i){let e=Math.max(50,3*r.size);if(this.categories.size>e){let t=this.categories.size-e;for(let e of this.categories){if(0>=t)break;r.has(e)||(this.categories.delete(e),t--)}}return a}if(!1===i)return a;if("function"==typeof i)return a.sort(i);let n=/* @__PURE__ */new Map;for(let t of e){let e=this.getO(t);n.set(e,(n.get(e)||0)+Math.abs(this.getR(t)))}return a.sort("asc"===i?(e,t)=>(n.get(e)||0)-(n.get(t)||0):(e,t)=>(n.get(t)||0)-(n.get(e)||0))}computeValueDomain(e,t){return d({data:e,chartType:this.config.chartType,projection:this.config.projection,normalize:this.config.normalize,rExtent:this.config.rExtent,extentPadding:this.config.extentPadding,baselinePadding:this.config.baselinePadding,axisExtent:this.config.axisExtent,getO:this.getO,getR:this.getR,getStack:this.getStack,rawRExtent:this.rExtent.extent})}buildColumns(e,t,o,i,r){return u({data:e,oExtent:t,oScale:o,projection:i,layout:r,dynamicColumnWidth:this.config.dynamicColumnWidth,getO:this.getO,getR:this.getR})}getSceneContext(){return{scales:this.scales,columns:this.columns,config:this.config,getR:this.getR,getStack:this.getStack,getGroup:this.getGroup,getColor:this.getColor,getSymbol:this.getSymbol,getConnector:this.getConnector,getO:this.getO,multiScales:this.multiScales,rAccessors:this.rAccessors,resolvePieceStyle:(e,t)=>this.styleResolver.resolvePieceStyle(this.config,e,t),resolveSummaryStyle:(e,t)=>this.styleResolver.resolveSummaryStyle(this.config,e,t),getRawRange:e=>this.getRawRange(e)}}buildSceneNodes(e,t){if(!this.scales)return[];if(this.config.customLayout){let o=this.buildLayoutContext(e,t),i=At({family:"ordinal",logLabel:"ordinal customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:this.config.onLayoutError,run:()=>this.config.customLayout(o)});if("failure"===i.kind)return this.lastCustomLayoutFailure=i.diagnostic,this._customLayoutFailedThisBuild=!0,i.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,[]);let r=i.result;this.customLayoutOverlays=r.overlays??null,this.lastCustomLayoutResult=r,this.lastCustomLayoutFailure=null;let a=r.nodes??[];if(this._customRestyle=r.restyle,this.hasCustomRestyle=!!r.restyle,this.hasCustomRestyle){this._baseStyles=/* @__PURE__ */new WeakMap;for(let e of a)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(a,this.config.layoutSelection??null)}return kt({label:"ordinal customLayout",nodes:a,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),a}this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1;let o=this.getSceneContext(),r=Gi[this.config.chartType],a=r?r(o,t):[];return this.getConnector&&this.scales&&(a=[...i(o,a),...a]),a}buildLayoutContext(e,t){let o=this.config,i=o.layoutMargin??{top:0,right:0,bottom:0,left:0},r=Nt(o.colorScheme,o.themeCategorical,di),a=this.scales;return{data:e,scales:{o:a.o,r:a.r,projection:a.projection},dimensions:{width:t.width,height:t.height,margin:i,plot:"radial"===a.projection?{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height}:{x:0,y:0,width:t.width,height:t.height}},theme:{semantic:o.themeSemantic??{},categorical:[...r]},resolveColor:Et(r,o.colorScheme),config:o.layoutConfig??{},selection:o.layoutSelection??null}}computeDecayOpacity(e,t){let o=this.config.decay;return o&&t>1?xt(o,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._dataVersion)return this._datumIndexCache.map;let t=wt(e);return this._datumIndexCache={version:this._dataVersion,map:t},t}getCategoryIndexMap(e){if(this._categoryIndexCache&&this._categoryIndexCache.version===this._dataVersion)return this._categoryIndexCache.map;let t=m(e,this.config.categoryAccessor||this.config.oAccessor);return this._categoryIndexCache={version:this._dataVersion,map:t},t}rebuildPointQuadtree(){let e=p(this.scene);this._pointQuadtree=e.quadtree,this._maxPointRadius=e.maxRadius}get pointQuadtree(){return this._pointQuadtree}get maxPointRadius(){return this._maxPointRadius}applyDecay(e,t){if(!this.config.decay)return;let o=t.length;if(1>=o)return;let i=this.getDatumIndexMap(t);for(let t of e){if("connector"===t.type||"violin"===t.type||"boxplot"===t.type||"wedge"===t.type||!t.datum)continue;let e=i.get(t.datum);if(null==e)continue;let r=this.computeDecayOpacity(e,o);t.style={...t.style,opacity:(t.style?.opacity??1)*r}}}applyPulse(e,t,i=this.currentTime()){return!(!this.config.pulse||!this.timestampBuffer)&&o(this.config.pulse,e,this.timestampBuffer,this.getDatumIndexMap(t),e=>this.getCategoryIndexMap(t).get(e),i)}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&Qe(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}synthesizeIntroPositions(){this.prevPositionMap.clear();let e,t=/* @__PURE__ */new Map,o=this.scales?.r(0)??0,i="horizontal"!==this.scales?.projection;for(let r=0;this.scene.length>r;r++){let a=this.scene[r],n=this.getNodeKey(a,t);n&&("rect"===a.type?this.prevPositionMap.set(n,i?{x:a.x,y:o,w:a.w,h:0,opacity:a.style.opacity??1}:{x:o,y:a.y,w:0,h:a.h,opacity:a.style.opacity??1}):"point"===a.type?this.prevPositionMap.set(n,{x:a.x,y:a.y,r:0,opacity:0}):"wedge"===a.type&&(void 0===e&&(e=a.startAngle),this.prevPositionMap.set(n,{x:a.cx,y:a.cy,startAngle:e,endAngle:e,innerRadius:a.innerRadius,outerRadius:a.outerRadius,opacity:0})))}}getNodeKey(e,t){if("point"===e.type){let o=`p:${e.datum?this.getO(e.datum):""}:${e.datum?this.getR(e.datum):0}`,i=t.get(o)||0;return t.set(o,i+1),`${o}:${i}`}if("rect"===e.type){let o=e.datum?null!=e.datum.category&&""!==e.datum.category?e.datum.category+"":(this.getO(e.datum)??"")+"":"",i=`r:${e.group||""}:${o}`,r=t.get(i)||0;return t.set(i,r+1),0===r?i:`${i}:${r}`}return"wedge"===e.type?"w:"+(e.category??""):null}snapshotPositions(){this.prevPositionMap.clear();let e=/* @__PURE__ */new Map;for(let t=0;this.scene.length>t;t++){let o=this.scene[t],i=this.getNodeKey(o,e);i&&("point"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,r:o.r,opacity:o.style.opacity??o.style.fillOpacity}):"rect"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,w:o.w,h:o.h,opacity:o.style.opacity??o.style.fillOpacity}):"wedge"===o.type&&this.prevPositionMap.set(i,{x:o.cx,y:o.cy,startAngle:o.startAngle,endAngle:o.endAngle,innerRadius:o.innerRadius,outerRadius:o.outerRadius,opacity:o.style.opacity??1}))}}startTransition(){if(!this.config.transition||0===this.prevPositionMap.size)return;let e=this.config.transition.duration??300;if(this.exitNodes.length>0){let e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}let t=!1,o=/* @__PURE__ */new Set,i=/* @__PURE__ */new Map;for(let e=0;this.scene.length>e;e++){let r=this.scene[e],a=this.getNodeKey(r,i);if(!a)continue;r._transitionKey=a;let n=this.prevPositionMap.get(a);if("point"===r.type)n?(o.add(a),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(n.x!==r.x||n.y!==r.y||void 0!==n.r&&n.r!==r.r)&&(r._targetX=r.x,r._targetY=r.y,r._targetR=r.r,r.x=n.x,r.y=n.y,void 0!==n.r&&(r.r=n.r),t=!0)):(r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r._targetR=r.r,r.r=0,r.style={...r.style,opacity:0},t=!0);else if("rect"===r.type)n?(o.add(a),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(n.x!==r.x||n.y!==r.y||n.w!==r.w||n.h!==r.h)&&(r._targetX=r.x,r._targetY=r.y,r._targetW=r.w,r._targetH=r.h,r.x=n.x,r.y=n.y,r.w=n.w??r.w,r.h=n.h??r.h,t=!0)):(r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r.style={...r.style,opacity:0},t=!0);else if("wedge"===r.type)if(n)o.add(a),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(n.startAngle!==r.startAngle||n.endAngle!==r.endAngle)&&(r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle,r.startAngle=n.startAngle,r.endAngle=n.endAngle,t=!0);else{r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle;let e=r.startAngle;r.startAngle=e,r.endAngle=e,r.style={...r.style,opacity:0},this.prevPositionMap.set(a,{x:r.cx,y:r.cy,startAngle:e,endAngle:e,innerRadius:r.innerRadius,outerRadius:r.outerRadius,opacity:0}),t=!0}}this.exitNodes=[];for(let[e,i]of this.prevPositionMap)if(!o.has(e)){if(e.startsWith("p:"))this.exitNodes.push({type:"point",x:i.x,y:i.y,r:i.r??3,style:{opacity:i.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))this.exitNodes.push({type:"rect",x:i.x,y:i.y,w:i.w??0,h:i.h??0,style:{opacity:i.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("w:")){let t=((i.startAngle??0)+(i.endAngle??0))/2,o={type:"wedge",cx:i.x,cy:i.y,innerRadius:i.innerRadius??0,outerRadius:i.outerRadius??100,startAngle:i.startAngle??0,endAngle:i.endAngle??0,style:{opacity:i.opacity??1},datum:null,category:e.slice(2),_targetStartAngle:t,_targetEndAngle:t,_targetOpacity:0,_transitionKey:e};this.exitNodes.push(o)}t=!0}this.exitNodes.length>0&&(this.scene=[...this.scene,...this.exitNodes]),t&&(this.activeTransition={startTime:this.currentTime(),duration:e})}advanceTransition(e){if(!this.activeTransition)return!1;let t=Mo(e,this.activeTransition),o=Co(t,"linear"===this.config.transition?.easing?"linear":"ease-out-cubic");for(let e of this.scene){let t=e._transitionKey;if(t)if("point"===e.type){if(void 0!==e._targetOpacity){let i=this.prevPositionMap.get(t);e.style.opacity=To(i?i.opacity??1:0,e._targetOpacity,o)}let i=this.prevPositionMap.get(t);void 0!==e._targetX&&i&&(e.x=To(i.x,e._targetX,o),e.y=To(i.y,e._targetY,o)),void 0!==e._targetR&&void 0!==i?.r&&(e.r=To(i.r,e._targetR,o))}else if("rect"===e.type){if(void 0!==e._targetOpacity){let i=this.prevPositionMap.get(t);e.style.opacity=To(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX)continue;let i=this.prevPositionMap.get(t);if(!i)continue;e.x=To(i.x,e._targetX,o),e.y=To(i.y,e._targetY,o),void 0!==i.w&&(e.w=To(i.w,e._targetW,o),e.h=To(i.h,e._targetH,o))}else if("wedge"===e.type){if(void 0!==e._targetOpacity){let i=this.prevPositionMap.get(t);e.style={...e.style,opacity:To(i?i.opacity??1:0,e._targetOpacity,o)}}if(void 0!==e._targetStartAngle&&void 0!==e._targetEndAngle){let i=this.prevPositionMap.get(t);i&&void 0!==i.startAngle&&(e.startAngle=To(i.startAngle,e._targetStartAngle,o),e.endAngle=To(i.endAngle,e._targetEndAngle,o))}}}if(t>=1){for(let e of this.scene)if(void 0!==e._targetOpacity&&(e.style={...e.style||{},opacity:0===e._targetOpacity?0:e._targetOpacity},e._targetOpacity=void 0),"point"===e.type){if(void 0===e._targetX&&void 0===e._targetR)continue;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("rect"===e.type){if(void 0===e._targetX)continue;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"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0);if(this.exitNodes.length>0){let e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}return this.activeTransition=null,!1}return!0}cancelIntroAnimation(){this.prevPositionMap.clear(),this.activeTransition=null,We(this.scene),this.exitNodes=[]}getBufferArray(){return this._bufferArrayCache?.version!==this._dataVersion&&(this._bufferArrayCache={version:this._dataVersion,data:this.buffer.toArray()}),this._bufferArrayCache.data}getData(){return this.buffer.toArray()}remove(e){if(!this.getDataId)throw Error("remove() requires dataIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();let t=Oe(e),o=this.getDataId,i=e=>t.has(o(e));Ue(this.buffer,this.timestampBuffer,i);let r=this.buffer.remove(i);if(0===r.length)return this.updateResults.recordNoop("remove"),r;for(let e of r)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach(e=>this.categories.add(this.getO(e))),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",r.length),r}update(e,t){if(!this.getDataId)throw Error("update() requires dataIdAccessor to be configured");let o=Oe(e),i=this.getDataId,r=/* @__PURE__ */new Set;this.buffer.forEach((e,t)=>{o.has(i(e))&&r.add(t)});let a=this.buffer.update(e=>o.has(i(e)),t);if(0===a.length)return this.updateResults.recordNoop("update"),a;for(let e of a)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach((e,t)=>{this.categories.add(this.getO(e)),r.has(t)&&this.pushValueExtent(e)}),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",a.length),a}clear(){this.buffer.clear(),this.rExtent.clear(),this.categories.clear(),this._hasStreamingData=!1,this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this.scales=null,this.scene=[],this.columns={},this.multiScales=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this._pointQuadtree=null,this._maxPointRadius=0,this.styleResolver.resetColors(),this._dataVersion++,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getOAccessor(){return this.getO}getRAccessor(){return this.getR}applyCustomRestyle(e,t){let o=this._customRestyle;if(o)for(let i of e){let e=this._baseStyles.get(i)??i.style??{},r=o(i,t);i.style=r?{...e,...r}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}rebuildAccessorDerivedState(){this.categories.clear(),this.rExtent.clear();for(let e of this.rExtents)e.clear();this._categoryIndexCache=null,this.buffer.forEach(e=>{this.categories.add(this.getO(e)),this.pushValueExtent(e)})}updateConfig(e){let t={...this.config},o=Object.keys(e).filter(o=>e[o]!==t[o]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in e&&e.windowSize!==t.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${t.windowSize} → ${e.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in e&&e.colorScheme!==t.colorScheme||"themeCategorical"in e&&e.themeCategorical!==t.themeCategorical||"colorAccessor"in e&&!st(e.colorAccessor,t.colorAccessor))&&this.styleResolver.resetColors(),("categoryAccessor"in e&&!st(e.categoryAccessor,t.categoryAccessor)||"oAccessor"in e&&!st(e.oAccessor,t.oAccessor))&&(this._categoryIndexCache=null),Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let i=!1;("categoryAccessor"in e||"oAccessor"in e)&&(st(this.config.categoryAccessor||this.config.oAccessor,t.categoryAccessor||t.oAccessor)||(this.getO=ct(this.config.categoryAccessor||this.config.oAccessor,"category"),i=!0));let r=!1;if("valueAccessor"in e||"rAccessor"in e){let e=this.config.valueAccessor||this.config.rAccessor,o=t.valueAccessor||t.rAccessor,i=Array.isArray(e)?e:[e],a=Array.isArray(o)?o:[o];if(r=i.length!==a.length||i.some((e,t)=>!st(e,a[t])),r){let e=this.config.valueAccessor||this.config.rAccessor;Array.isArray(e)?(this.rAccessors=e.map(e=>lt(e,"value")),this.getR=this.rAccessors[0],this.rExtents=e.map(()=>new $e)):(this.getR=lt(e,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent])}}"stackBy"in e&&!st(e.stackBy,t.stackBy)&&(this.getStack=null!=this.config.stackBy?ct(this.config.stackBy):void 0),"groupBy"in e&&!st(e.groupBy,t.groupBy)&&(this.getGroup=null!=this.config.groupBy?ct(this.config.groupBy):void 0),"colorAccessor"in e&&!st(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?ct(this.config.colorAccessor):void 0),"symbolAccessor"in e&&!st(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?ct(this.config.symbolAccessor):void 0),"connectorAccessor"in e&&!st(e.connectorAccessor,t.connectorAccessor)&&(this.getConnector=null!=this.config.connectorAccessor?ct(this.config.connectorAccessor):void 0),(i||r||"accessorRevision"in e&&e.accessorRevision!==t.accessorRevision)&&this.rebuildAccessorDerivedState(),this.updateResults.recordConfig(o)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};St(ar);import{useCallback as nr,useImperativeHandle as sr}from"react";import{useMemo as lr,useRef as cr,useId as hr}from"react";import{Fragment as dr,jsx as ur,jsxs as mr}from"react/jsx-runtime";import*as gr from"react";import{jsx as pr}from"react/jsx-runtime";var fr=null,yr=null;import{arc as vr}from"d3-shape";var br=(e,t)=>({x:e*Math.cos(t),y:e*Math.sin(t)}),xr=(e,t,o,i)=>{let r=t.filter(e=>"wedge"===e.type);for(let t of r){let o=t.style.strokeWidth??1,i=t.style.stroke,r=!(!i||"none"===i||0>=o);if(e.globalAlpha=(t.style.fillOpacity??1)*(t.style.opacity??1),t._gradientBand&&t._gradientBand.colors.length>0)D(e,t),t._pulseIntensity&&t._pulseIntensity>0&&(j(e,t),Dt(e,t)),e.globalAlpha=1;else{if(e.fillStyle=Ri(e,t.style.fill,"#007bff"),t.roundedEnds){r&&(e.strokeStyle=xi(e,i)||i,e.lineWidth=o);let a=O({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds.start,roundEnd:t.roundedEnds.end});e.save(),e.translate(t.cx,t.cy);let n=new Path2D(a);e.fill(n),r&&e.stroke(n),e.restore()}else t.cornerRadius?(r&&(e.strokeStyle=xi(e,i)||i,e.lineWidth=o),N(e,t)):(j(e,t),e.fill(),r&&(e.strokeStyle=xi(e,i)||i,e.lineWidth=o,e.stroke()));t._pulseIntensity&&t._pulseIntensity>0&&(j(e,t),Dt(e,t)),e.globalAlpha=1}}},wr=(e,t,o,i)=>{let r=t.filter(e=>"boxplot"===e.type);for(let t of r){let o=t.columnWidth/2,i="vertical"===t.projection,r=xi(e,"var(--semiotic-primary, #007bff)"),a=xi(e,"var(--semiotic-text, #333)"),n=Ri(e,t.style.fill,r),s=t.style.stroke,l="string"==typeof s?xi(e,s)||s:a,c=t.style.strokeWidth??1,h=c>0&&!("string"==typeof s&&"none"===s.trim().toLowerCase()),d=t.style.fillOpacity??t.style.opacity??.6;if(e.save(),h&&(e.strokeStyle=l,e.lineWidth=c,e.beginPath(),i?(e.moveTo(t.x,t.minPos),e.lineTo(t.x,t.maxPos)):(e.moveTo(t.minPos,t.y),e.lineTo(t.maxPos,t.y)),e.stroke(),e.beginPath(),i?(e.moveTo(t.x-.4*o,t.minPos),e.lineTo(t.x+.4*o,t.minPos),e.moveTo(t.x-.4*o,t.maxPos),e.lineTo(t.x+.4*o,t.maxPos)):(e.moveTo(t.minPos,t.y-.4*o),e.lineTo(t.minPos,t.y+.4*o),e.moveTo(t.maxPos,t.y-.4*o),e.lineTo(t.maxPos,t.y+.4*o)),e.stroke()),e.globalAlpha=d,e.fillStyle=n,i){let i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(t.x-o,i,t.columnWidth,r),e.globalAlpha=1,h&&e.strokeRect(t.x-o,i,t.columnWidth,r)}else{let i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(i,t.y-o,r,t.columnWidth),e.globalAlpha=1,h&&e.strokeRect(i,t.y-o,r,t.columnWidth)}h&&(e.strokeStyle=l,e.lineWidth=2*c,e.beginPath(),i?(e.moveTo(t.x-o,t.medianPos),e.lineTo(t.x+o,t.medianPos)):(e.moveTo(t.medianPos,t.y-o),e.lineTo(t.medianPos,t.y+o)),e.stroke()),e.restore()}},kr=/* @__PURE__ */new WeakMap,Ar=(e,t,o,i)=>{for(let o of t){if("violin"!==o.type)continue;e.save(),(o.translateX||o.translateY)&&e.translate(o.translateX,o.translateY);let t=kr.get(o);(!t||t.source!==o.pathString)&&(t={source:o.pathString,path:new Path2D(o.pathString)},kr.set(o,t));let i=t.path;e.globalAlpha=o.style.fillOpacity??o.style.opacity??.6,e.fillStyle=Ri(e,o.style.fill,"#007bff"),e.fill(i),e.globalAlpha=1;let r=o.style.strokeWidth??1;if(o.style.stroke&&"none"!==o.style.stroke&&r>0&&(e.strokeStyle=xi(e,o.style.stroke)||o.style.stroke,e.lineWidth=r,e.stroke(i)),o.iqrLine){e.strokeStyle="#333",e.lineWidth=2,e.globalAlpha=.8;let t=o.iqrLine.centerPos,i=!1!==o.iqrLine.isVertical;e.beginPath(),i?(e.moveTo(t,o.iqrLine.q1Pos),e.lineTo(t,o.iqrLine.q3Pos)):(e.moveTo(o.iqrLine.q1Pos,t),e.lineTo(o.iqrLine.q3Pos,t)),e.stroke(),e.beginPath(),i?e.arc(t,o.iqrLine.medianPos,3,0,2*Math.PI):e.arc(o.iqrLine.medianPos,t,3,0,2*Math.PI),e.fillStyle="#fff",e.fill(),e.strokeStyle="#333",e.lineWidth=1,e.stroke(),e.globalAlpha=1}e.restore()}},Sr=(e,t,o,i)=>{let r=t.filter(e=>"connector"===e.type);if(0===r.length)return;let a=/* @__PURE__ */new Map;for(let e of r){let t=e.group||"_default";a.has(t)||a.set(t,[]),a.get(t).push(e)}for(let[,t]of a){if(0===t.length)continue;let o=t[0].style;if(o.fill&&"none"!==o.fill){e.beginPath(),e.moveTo(t[0].x1,t[0].y1);for(let o of t)e.lineTo(o.x2,o.y2);e.closePath(),e.globalAlpha=o.fillOpacity??o.opacity??.3,e.fillStyle=Pi(e,o.fill)??"#999",e.fill(),e.globalAlpha=1}for(let o of t){let t=o.style.strokeWidth??1;0>=t||"none"===o.style.stroke||(e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.strokeStyle=xi(e,o.style.stroke)||Ri(e,o.style.fill,"")||xi(e,"var(--semiotic-border, #999)"),e.lineWidth=t,e.globalAlpha=o.style.opacity??.5,e.stroke(),e.globalAlpha=1)}}},Rr=(e,t,o,i)=>{let r=t.filter(e=>"trapezoid"===e.type);for(let t of r){let o=t.points;if(4>o.length)continue;e.globalAlpha=t.style?.opacity??1,e.beginPath(),e.moveTo(o[0][0],o[0][1]);for(let t=1;o.length>t;t++)e.lineTo(o[t][0],o[t][1]);e.closePath(),e.fillStyle=Pi(e,t.style?.fill)||"#999",e.fill();let i=t.style?.strokeWidth??1;t.style?.stroke&&"none"!==t.style.stroke&&i>0&&(e.strokeStyle=xi(e,t.style.stroke)||t.style.stroke,e.lineWidth=i,e.stroke()),e.globalAlpha=1}},Pr=/* @__PURE__ */new Map,Cr=K(Be),_r=K(it),Lr=K(rt),Mr=K(at),Ir=e=>[Sr,...e],Tr={bar:Ir([Cr]),clusterbar:Ir([Cr]),point:Ir([_r,Lr]),swarm:Ir([_r,Lr]),pie:[xr],donut:[xr],boxplot:Ir([wr,_r]),violin:Ir([Ar]),histogram:Ir([Cr]),ridgeline:Ir([Ar]),timeline:Ir([Cr]),funnel:[Cr,Rr,(e,t,o,i)=>{let r=t.filter(e=>"rect"===e.type&&null!=e.datum);if(0===r.length||!r.some(e=>null!=e.datum?.__funnelStepLabel||null!=e.datum?.__funnelValueLabelX))return;let a=xi(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif";e.textBaseline="top",e.lineJoin="round",e.textAlign="center",e.font="bold 14px "+a;for(let t of r){let o=t.datum;if(!o||!o.__funnelStepLabel)continue;let i=o.__funnelStepLabel;if(e.measureText(i).width+16>(o.__funnelRowWidth??o.__funnelBarW??0))continue;let r=o.__funnelStepLabelX,a=o.__funnelStepLabelY+3;e.strokeStyle="rgba(0,0,0,0.6)",e.lineWidth=3,e.strokeText(i,r,a),e.fillStyle="#fff",e.fillText(i,r,a)}e.font="bold 13px "+a;for(let t of r){let o=t.datum;if(!o||null==o.__funnelValueLabelX)continue;let i=o.__funnelBarW??0;if(60>i)continue;let r=o.__funnelValue;if(null==r||0===r)continue;let a,n=o.__funnelPercent,s=!0===o.__funnelIsFirstStep;if(a=s?E(r):null!=n?`${E(r)} (${z(n)})`:E(r),e.measureText(a).width+16>i){if(s||null==n)continue;if(a=E(r),e.measureText(a).width+16>i)continue}let l=o.__funnelValueLabelX,c=(o.__funnelValueLabelY??t.y)+14+5;e.textAlign="center",e.strokeStyle="rgba(0,0,0,0.5)",e.lineWidth=3,e.strokeText(a,l,c),e.fillStyle="#fff",e.fillText(a,l,c)}e.lineWidth=1,e.lineJoin="miter"}],"bar-funnel":[Cr,(e,t,o,i)=>{let r=t.filter(e=>"rect"===e.type&&!0===e.datum?.__barFunnelIsDropoff);for(let t of r){let o=("string"==typeof t.style.fill?t.style.fill:null)||xi(e,"var(--semiotic-border, #999)"),i=V(o,e);e.globalAlpha=t.style.opacity??1,e.beginPath(),e.rect(t.x,t.y,t.w,t.h),i?e.fillStyle=i:(e.fillStyle=o,e.globalAlpha=.4*(t.style.opacity??1)),e.fill(),e.globalAlpha=1}},(e,t,o,i)=>{let r=t.filter(e=>"rect"===e.type&&!0!==e.datum?.__barFunnelIsDropoff&&null!=e.datum?.__barFunnelLabelX);if(0===r.length)return;let a=xi(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif",n=q(e,xi(e,"var(--semiotic-text, #333)")),s=n?"#1f2937":"#ffffff",l=n?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.12)",c=n?"#f3f4f6":"#1a1a1a",h=c;for(let t of r){let o=t.datum;if(!o)continue;let i=o.__barFunnelValue;if(null==i||25>t.w)continue;let r=o.__barFunnelPercent,n=!(!0===o.__barFunnelIsFirstStep)&&null!=r,d=n?Y(r):"",u=X(i);e.font="bold 13px "+a;let m=n?e.measureText(d).width:0;e.font="11px "+a;let g=e.measureText(u).width,p=Math.max(m,g)+12,f=n?32:17,y=o.__barFunnelLabelX,v=y-p/2,b=o.__barFunnelLabelY-f-4;e.save(),e.shadowColor="rgba(0,0,0,0.15)",e.shadowBlur=4,e.shadowOffsetY=1,e.fillStyle=s,e.beginPath(),G(e,v,b,p,f,4),e.fill(),e.restore(),e.strokeStyle=l,e.lineWidth=.5,e.beginPath(),G(e,v,b,p,f,4),e.stroke(),e.textAlign="center",e.textBaseline="top",n?(e.font="bold 13px "+a,e.fillStyle=c,e.fillText(d,y,b+3),e.font="11px "+a,e.fillStyle=h,e.fillText(u,y,b+3+13+2)):(e.font="bold 11px "+a,e.fillStyle=c,e.fillText(u,y,b+3))}e.lineWidth=1}],swimlane:Ir([Cr]),custom:Ir([Cr,_r,Lr,Mr,xr,wr,Ar,Rr])};import*as Hr from"react";import*as Br from"react";import{arc as Fr}from"d3-shape";import{jsx as $r,jsxs as Or}from"react/jsx-runtime";import{jsx as Wr,jsxs as Dr}from"react/jsx-runtime";import{jsx as jr,jsxs as Nr}from"react/jsx-runtime";ne.ownsChrome=!0;import{jsx as Er,jsxs as zr}from"react/jsx-runtime";var Vr=nt,Gr=Bi(Hi(function(e,o){let{chartType:i,runtimeMode:r,data:a,oAccessor:n="category",rAccessor:s="value",colorAccessor:l,symbolAccessor:c,symbolMap:h,stackBy:d,groupBy:u,multiAxis:m,timeAccessor:g,valueAccessor:p,categoryAccessor:y,accessorRevision:v,projection:b="vertical",size:x=[600,400],responsiveWidth:w,responsiveHeight:k,margin:A,maxDevicePixelRatio:S,barPadding:R,roundedTop:P,gradientFill:C,trackFill:_,baselinePadding:L,innerRadius:M,cornerRadius:I,normalize:O,startAngle:W,sweepAngle:D,dynamicColumnWidth:j,bins:N,showOutliers:E,showIQR:z,amplitude:V,connectorOpacity:G,showLabels:q,connectorAccessor:X,connectorStyle:Y,dataIdAccessor:Q,rExtent:K,oExtent:Z,extentPadding:J=.05,oSort:U,windowMode:ee="sliding",windowSize:te=200,pieceStyle:oe,summaryStyle:ie,renderMode:ae,colorScheme:se,barColors:le,showAxes:ce=!0,showCategoryTicks:he,categoryLabel:de,valueLabel:ue,categoryFormat:me,valueFormat:ge,oLabel:pe,rLabel:fe,oFormat:ye,rFormat:ve,rTickValues:be,tickLabelEdgeAlign:xe,axisExtent:we,enableHover:ke=!0,hoverRadius:Ae=30,hoverAnnotation:Se,tooltipContent:Re,customHoverBehavior:Pe,customClickBehavior:Ce,onObservation:_e,annotationObservationCallback:Le,chartId:Me,annotations:Ie,onAnnotationActivate:Te,autoPlaceAnnotations:He,svgAnnotationRules:Be,showGrid:$e=!1,legend:Oe,legendHoverBehavior:We,legendClickBehavior:De,legendHighlightedCategory:ze,legendIsolatedCategories:Ge,legendPosition:qe,legendLayout:Xe,legendCategoryAccessor:Ye,onCategoriesChange:Qe,backgroundGraphics:Ke,foregroundGraphics:Ze,title:Je,className:Ue,background:it,centerContent:rt,decay:at,pulse:nt,transition:st,animate:lt,staleness:ct,frameScheduler:mt,clock:gt,random:ft,seed:yt,paused:vt=!1,suspendWhenHidden:bt=!0,brush:xt,onBrush:wt,accessibleTable:kt=!0,description:At,summary:St,customLayout:_t,onLayoutError:Lt,layoutConfig:Mt,layoutSelection:It}=e,{customHoverBehavior:Bt,customClickBehavior:Ft,hasClickBehavior:$t}=tt({customHoverBehavior:Pe,customClickBehavior:Ce,onObservation:_e,chartId:Me,chartType:"StreamOrdinalFrame"}),Ot=y??n,Dt=p??s,Nt=de??pe,Et=ue??fe,zt=me??ye,Vt=ge??ve,qt=Wi(!0),Xt=Yt({sizeProp:x,responsiveWidth:w,responsiveHeight:k,userMargin:A,marginDefault:Vr,title:Je,legend:Oe,legendPosition:qe,...Ee(e,Oe),animate:lt,transitionProp:st,frameScheduler:mt,clock:gt,random:ft,seed:yt,paused:vt,suspendWhenHidden:bt,themeDirtyRef:qt}),{reducedMotionRef:Qt,responsiveRef:Kt,size:Zt,margin:to,adjustedWidth:io,adjustedHeight:ro,currentTheme:ao,transition:no,introEnabled:so,tableId:lo,rafRef:co,renderFnRef:ho,scheduleRender:uo,frameRuntime:mo}=Xt;$i(()=>bi(()=>{qt.current=!0,uo()}),[uo]);let go=jo(),po=Eo(),fo=Oi(()=>Ro(a),[a]),yo=Wi(null),bo=Wi(!1),[xo,wo]=Di(null),[ko,Ao]=Di(null),So=ht(Ze,Zt,to,ko),Po=ht(Ke,Zt,to,ko),Co=Ke||"transparent"===it?null:/* @__PURE__ */Er("rect",{className:"semiotic-canvas-background","data-semiotic-layer":"canvas-background",x:-to.left,y:-to.top,width:Zt[0],height:Zt[1],fill:it||"var(--semiotic-bg, transparent)"}),Lo=Ke&&it&&"transparent"!==it?/* @__PURE__ */Er("rect",{className:"semiotic-canvas-background semiotic-canvas-background--combined","data-semiotic-layer":"canvas-background",x:-to.left,y:-to.top,width:Zt[0],height:Zt[1],fill:it}):null,[Mo,Io]=Di(0),To=Wi(0),[Bo,Wo]=Di(!1),Do=Wi({w:-1,h:-1}),No=Wi(!1),zo=Xo("StreamOrdinalFrame"),qo=ke||Se,Jo="streaming"===r,ti=Oi(()=>({chartType:i,runtimeMode:Jo?"streaming":"bounded",windowSize:te,windowMode:ee,extentPadding:J,projection:b,oAccessor:Jo?void 0:Ot,rAccessor:Jo?void 0:Dt,accessorRevision:v,colorAccessor:l,symbolAccessor:c,symbolMap:h,stackBy:d,groupBy:u,multiAxis:m,timeAccessor:Jo?g:void 0,valueAccessor:Jo?p||("string"==typeof Dt||"function"==typeof Dt?Dt:void 0):void 0,categoryAccessor:Jo?Ot:void 0,rExtent:K,oExtent:Z,axisExtent:we,barPadding:R,roundedTop:P,gradientFill:Ve(C),trackFill:_,baselinePadding:L,innerRadius:M,cornerRadius:I,normalize:O,startAngle:W,sweepAngle:D,dynamicColumnWidth:j,bins:N,showOutliers:E,showIQR:z,amplitude:V,connectorOpacity:G,showLabels:q,connectorAccessor:X,connectorStyle:Y,dataIdAccessor:Q,oSort:U,pieceStyle:oe,summaryStyle:ie,colorScheme:se,themeCategorical:ao?.colors?.categorical,themeSemantic:Ci(ao),themeSequential:ao?.colors?.sequential,themeDiverging:ao?.colors?.diverging,barColors:le,decay:at,pulse:nt,transition:no,introAnimation:so,staleness:ct,clock:mo.now,customLayout:_t,onLayoutError:Lt,layoutConfig:Mt,layoutMargin:to}),[i,Jo,te,ee,J,b,Ot,Dt,v,l,c,h,d,u,m,g,p,K,Z,we,R,P,C,_,L,M,I,O,W,D,j,N,E,z,V,G,q,X,Y,Q,U,oe,ie,se,ao,le,at,nt,no,so,ct,mo.now,_t,Lt,Mt,to]),ii=Wt(ti),ri=Wi(null);ri.current||(ri.current=new ar(ii));let ai=dt(ri,Ye,Qe,e=>e.getData());Pt(ri,ii,qt,uo),Ct(ri,It,qt,uo);let ni=Wi(null);ni.current||(ni.current=new Fe(e=>{let t=ri.current;t&&t.ingest(e)&&(qt.current=!0,uo())})),f(o,{storeRef:ri,adapterRef:ni,dirtyRef:qt,scheduleRender:uo,hoverRef:yo,setHoverPoint:wo}),$i(()=>{a&&ni.current?.setBoundedData(fo)},[a,fo]);let{canvasRef:si,resolutionDirtyRef:li}=eo(Xt,{storeRef:ri,dirtyRef:qt,hydrated:go,wasHydratingFromSSR:po,cleanup:()=>ni.current?.clear(),maxDevicePixelRatio:S,canvasPaintDependencies:[i,io,ro,ce,it,Ke,ae,uo]}),{hoverHandlerRef:ci,hoverLeaveRef:hi,onPointerMove:di,onPointerLeave:ui,pointerStateRef:mi}=Xt;ci.current=e=>{let t=si.current;if(!t)return;let o=ri.current;if(!o)return void Ho(t);let r=T({pointer:e,canvasRect:t.getBoundingClientRect(),margin:{left:to.left,top:to.top},width:io,height:ro,projection:b,hoverRadius:Ae,scene:o.scene,pointQuadtree:o.pointQuadtree,maxPointRadius:o.maxPointRadius});if(Ho(t,"hit"===r.kind?_o(r.hit.node):void 0),!qo)return;if("hit"!==r.kind)return void(yo.current&&(yo.current=null,wo(null),Bt&&Bt(null),uo()));let a=H(r.hit,{oAccessor:Ot,rAccessor:Dt,chartType:i});yo.current=a,wo(a),Bt?.(a),uo()},hi.current=()=>{Ho(si.current),yo.current&&(yo.current=null,wo(null),Bt?.(null),uo())},Oo(si);let gi=Fi(e=>{if(Ut(e.target)||!Ft)return;let t=si.current;if(!t)return Ft(null),void uo();let o=ri.current;if(!o)return Ft(null),void uo();let r=T({pointer:e,canvasRect:t.getBoundingClientRect(),margin:{left:to.left,top:to.top},width:io,height:ro,projection:b,hoverRadius:Ae,scene:o.scene,pointQuadtree:o.pointQuadtree,maxPointRadius:o.maxPointRadius});if("hit"!==r.kind)return Ft(null),void uo();Ft(H(r.hit,{oAccessor:Ot,rAccessor:Dt,chartType:i}),{type:"activate",inputType:vo(e.nativeEvent.pointerType)}),uo()},[Ft,si,to.left,to.top,io,ro,b,Ae,Ot,Dt,i,uo]),{kbFocusIndexRef:pi,focusedNavPointRef:fi,onKeyDown:yi}=ot({storeRef:ri,hoverRef:yo,setHoverPoint:wo,customHoverBehavior:Bt,customClickBehavior:Ft,scheduleRender:uo,chartType:i,oAccessor:Ot,rAccessor:Dt}),vi=Fi(e=>{pt(mi,e,!!qo,bo.current,si.current,"mouse")&&(pi.current=-1,fi.current=null,di(e))},[si,qo,fi,pi,di,mi]);ho.current=()=>{if(co.current=null,!mo.isActive)return;let e=si.current;if(!e)return;let t=e.getContext("2d");if(!t)return;let o=ri.current;if(!o)return;let r=mo.now(),a=null!=o.activeTransition,n=o.advanceTransition(Qt.current?r+1e6:r),s=!Qt.current&&n,l=Do.current.w!==io||Do.current.h!==ro,c=qt.current,h=o.consumeStylePaintPending(),d=!1,u=zo.current.beforeCompute(o.getLastUpdateResult(),s);var m;(c||l)&&(!s||l)&&(o.computeScene({width:io,height:ro}),Do.current={w:io,h:ro},d=!0,ai()),(d||h)&&(bo.current=Fo(e,o.scene)),bo.current&&(a||d||h)&&$o((m={canvas:e,pointer:mi.current,store:o,margin:{left:to.left,top:to.top},width:io,height:ro,projection:b,hoverRadius:Ae,geometryMoved:a||d}).canvas,m.pointer,e=>{let t=T({pointer:e,canvasRect:m.canvas.getBoundingClientRect(),margin:m.margin,width:m.width,height:m.height,projection:m.projection,hoverRadius:m.hoverRadius,scene:m.store.scene,pointQuadtree:m.geometryMoved?null:m.store.pointQuadtree,maxPointRadius:m.store.maxPointRadius});return"hit"===t.kind?_o(t.hit.node):void 0}),zo.current.afterCompute(u,d,l),qt.current=c&&s&&!d,li.current=!1;let g=et(o,r,d,No);(d||s)&&e.setAttribute("aria-label",Qo(o.scene,i+" chart"));let p=Jt(S,Zt),f=Zt[0]*p,y=Zt[1]*p;(e.width!==f||e.height!==y)&&(e.width=f,e.height=y,e.style.width=Zt[0]+"px",e.style.height=Zt[1]+"px"),t.setTransform(p,0,0,p,0,0),t.clearRect(0,0,Zt[0],Zt[1]);let v=ct&&o.lastIngestTime>0&&r-o.lastIngestTime>(ct?.threshold??5e3);v&&(t.globalAlpha=ct?.dimOpacity??.5);let x="radial"===b;t.save(),t.beginPath(),t.rect(to.left,to.top,io,ro),t.clip(),x?(t.save(),t.translate(to.left+io/2,to.top+ro/2)):t.translate(to.left,to.top);let w=_t?Tr.custom:Tr[i]||[],k={width:io,height:ro},A=o.scales;A&&ut({context:t,nodes:o.scene,renderMode:ae,pixelRatio:p,paintBuiltIn:e=>{for(let o of w)o(t,e,A,k)}}),x&&t.restore(),t.restore(),v&&(t.globalAlpha=1),d&&o.scales?(Ao(o.scales),Io(e=>e+1),To.current=r):s&&o.scales&&r-To.current>=33&&(Io(e=>e+1),To.current=r),ct?.showBadge&&Wo(!!v),(s||null!=o.activeTransition||g.pending)&&uo()},Tt(ct,ri,qt,uo,mo.now,Bo,Wo);let xi=qo&&xo?Re?Re(xo):/* @__PURE__ */Er(ne,{hover:xo}):null,wi="radial"===b,ki=xi?/* @__PURE__ */Er(Gt,{x:xo?wi?xo.x+io/2:xo.x:0,y:xo?wi?xo.y+ro/2:xo.y:0,containerWidth:io,containerHeight:ro,margin:to,className:"stream-ordinal-tooltip",children:xi}):null,Ai="horizontal"===b?Ot:Dt,Si=je("horizontal"===b?Dt:Ot,void 0,"__semiotic_resolvedO",""),Ri=je(Ai,void 0,"__semiotic_resolvedR",""),Pi=Si.key,_i=Ri.key,Li=Ne(Si,Ri,Ie&&Ie.length>0||!1);if(Vo||!go&&po){let e=ri.current;e&&a&&(e.ingest({inserts:fo,bounded:!0}),e.computeScene({width:io,height:ro}));let o=e?.scene??[],i=e?.scales??null,r=ht(Ze,Zt,to,i),n=ht(Ke,Zt,to,i),s="radial"===b,l=s?to.left+io/2:to.left,c=s?to.top+ro/2:to.top;/* @__PURE__ */
|
|
77
|
+
return zr("div",{ref:Kt,className:"stream-ordinal-frame"+(Ue?" "+Ue:""),role:"img","aria-label":At||("string"==typeof Je?Je:"Ordinal chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:w?"100%":Zt[0],height:k?"100%":Zt[1]},children:[
|
|
78
|
+
/* @__PURE__ */Er(Uo,{summary:St}),
|
|
79
|
+
/* @__PURE__ */zr("svg",{xmlns:"http://www.w3.org/2000/svg",width:Zt[0],height:Zt[1],style:{position:"absolute",left:0,top:0},children:[
|
|
80
|
+
/* @__PURE__ */zr("g",{transform:`translate(${to.left},${to.top})`,children:[it&&/* @__PURE__ */Er("rect",{x:0,y:0,width:io,height:ro,fill:it}),n]}),
|
|
81
|
+
/* @__PURE__ */Er("g",{transform:`translate(${l},${c})`,children:re({nodes:o,renderMode:ae,idPrefix:lo}).map(e=>e.element)})]}),
|
|
82
|
+
/* @__PURE__ */Er(F,{width:io,height:ro,totalWidth:Zt[0],totalHeight:Zt[1],margin:to,scales:i,showAxes:ce,showCategoryTicks:he,oLabel:Nt,rLabel:Et,oFormat:zt,rFormat:Vt,rTickValues:be,tickLabelEdgeAlign:xe,axisExtent:we,showGrid:$e,title:Je,description:At,legend:Oe,legendHoverBehavior:We,legendClickBehavior:De,legendHighlightedCategory:ze,legendIsolatedCategories:Ge,legendPosition:qe,legendLayout:Xe,foregroundGraphics:Rt(r,jt(ri.current?.customLayoutOverlays,It??null)),annotations:Ie,onAnnotationActivate:Te,onObservation:Le??_e,chartId:Me,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:He,svgAnnotationRules:Be,annotationFrame:0,xAccessor:Pi,yAccessor:_i,annotationData:Li(e?.getData())}),rt&&"radial"===b&&/* @__PURE__ */Er(t,{content:rt,centerX:to.left+io/2,centerY:to.top+ro/2,width:Zt[0],height:Zt[1]})]})}/* @__PURE__ */
|
|
83
|
+
return zr("div",{ref:Kt,className:"stream-ordinal-frame"+(Ue?" "+Ue:""),role:"group","aria-label":At||("string"==typeof Je?Je:"Ordinal chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:w?"100%":Zt[0],height:k?"100%":Zt[1],overflow:"visible"},onKeyDown:yi,children:["production"!==process.env.NODE_ENV&&ri.current&&/* @__PURE__ */Er(Ko,{store:ri.current,diagnostics:zo.current}),kt&&/* @__PURE__ */zr(Yo,{accessibleTable:kt,children:[
|
|
84
|
+
/* @__PURE__ */Er(ei,{tableId:lo}),
|
|
85
|
+
/* @__PURE__ */Er(Zo,{scene:ri.current?.scene??[],chartType:i+" chart",tableId:lo,chartTitle:"string"==typeof Je?Je:void 0})]}),
|
|
86
|
+
/* @__PURE__ */Er(Uo,{summary:St}),
|
|
87
|
+
/* @__PURE__ */Er(Go,{hoverPoint:xo}),
|
|
88
|
+
/* @__PURE__ */zr("div",{role:"img","aria-label":At||("string"==typeof Je?Je:"Ordinal chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:vi,onMouseLeave:ui,onClick:$t?gi:void 0,children:[
|
|
89
|
+
/* @__PURE__ */zr(oo,{size:Zt,margin:to,children:[Lo,Co,Po]}),
|
|
90
|
+
/* @__PURE__ */Er(B,{width:io,height:ro,totalWidth:Zt[0],totalHeight:Zt[1],margin:to,scales:ko,showAxes:ce,showGrid:$e,rFormat:Vt,rTickValues:be,axisExtent:we}),
|
|
91
|
+
/* @__PURE__ */Er("canvas",{ref:si,"aria-label":Qo(ri.current?.scene??[],i+" chart"),style:{position:"absolute",top:0,left:0,width:Zt[0],height:Zt[1]}}),
|
|
92
|
+
/* @__PURE__ */Er(F,{width:io,height:ro,totalWidth:Zt[0],totalHeight:Zt[1],margin:to,scales:ko,showAxes:ce,showCategoryTicks:he,oLabel:Nt,rLabel:Et,oFormat:zt,rFormat:Vt,rTickValues:be,axisExtent:we,showGrid:$e,title:Je,description:At,legend:Oe,legendHoverBehavior:We,legendClickBehavior:De,legendHighlightedCategory:ze,legendIsolatedCategories:Ge,legendPosition:qe,legendLayout:Xe,foregroundGraphics:Rt(So,jt(ri.current?.customLayoutOverlays,It??null)),annotations:Ie,onAnnotationActivate:Te,onObservation:Le??_e,chartId:Me,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:He,svgAnnotationRules:Be,annotationFrame:Mo,xAccessor:Pi,yAccessor:_i,annotationData:Li(ri.current?.getData()),underlayRendered:!0,canvasObscuresUnderlay:!1}),(xt||wt)&&"radial"!==b&&/* @__PURE__ */Er($,{width:io,height:ro,totalWidth:Zt[0],totalHeight:Zt[1],margin:to,scales:ko,onBrush:wt||(()=>{})}),rt&&"radial"===b&&/* @__PURE__ */Er(t,{content:rt,centerX:to.left+io/2,centerY:to.top+ro/2,width:Zt[0],height:Zt[1]}),ct?.showBadge&&/* @__PURE__ */Er(Ht,{isStale:Bo,position:ct.badgePosition,state:ct.state,settling:ct.settling}),
|
|
93
|
+
/* @__PURE__ */Er(oi,{active:pi.current>=0,hoverPoint:xo,margin:to,size:Zt,shape:fi.current?.shape,width:fi.current?.w,height:fi.current?.h}),ki]})]})}));Gr.displayName="StreamOrdinalFrame";var qr=Gr;import{useMemo as Xr,forwardRef as Yr,useRef as Qr}from"react";import{useImperativeHandle as Kr}from"react";import{useMemo as Zr}from"react";import{useCallback as Jr,useMemo as Ur,useRef as ea}from"react";import{jsx as ta}from"react/jsx-runtime";var oa=Yr(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Qr(null),{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",orientation:c="vertical",valueFormat:h,colorBy:d,colorScheme:u,sort:m=!1,barPadding:g=40,roundedTop:p,gradientFill:f=!1,styleRules:y,baselinePadding:v=!1,tooltip:b,annotations:x,regression:w,valueExtent:k,frameProps:A={},selection:S,linkedHover:R,linkedBrush:P,brush:C,onBrush:_,onObservation:L,onClick:M,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:F,legendInteraction:$,legendPosition:O,color:W,stroke:D,strokeWidth:j,opacity:N,showCategoryTicks:E,categoryFormat:z,dataIdAccessor:V}=e,{width:G,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:J,accessibleTable:U,categoryLabel:ee,valueLabel:te}=o,oe=Xr(()=>Ro(r),[r]),ie=Ie({data:oe,rawData:r,colorBy:d,colorScheme:u,legendInteraction:$,legendPosition:O,frameLegend:A,selection:S,linkedHover:R,fallbackFields:d?["string"==typeof d?d:""]:[],unwrapData:!0,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"BarChart",chartId:T,showLegend:Q,userMargin:a,marginDefaults:o.marginDefaults,loading:H,loadingContent:B,emptyContent:F,width:G,height:q,hasTitle:!!K,axisChrome:Vt({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!ee,hasValueLabel:!!te})}),{effectiveLegendProps:re,effectiveMargin:ae}=se({ref:t,frameRef:i,setup:ie});Io("BarChart",oe,"categoryAccessor",s),Io("BarChart",oe,"valueAccessor",l);let ne=to(oe,m,l),he=Xt(),de=Xr(()=>/* @__PURE__ */new Map,[]),ue=Xr(()=>co(l),[l]),me=ce({brushProp:C,onBrushProp:_,linkedBrush:P,valueAccessor:l}),ge=le({colorBy:d,colorScale:ie.colorScale,color:W,themeCategorical:he,colorScheme:u,categoryIndexMap:de,userPieceStyle:A?.pieceStyle,stroke:D,strokeWidth:j,opacity:N,styleRules:y,resolveRuleValue:ue,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection}),pe=Xr(()=>gt({categoryAccessor:s,valueAccessor:l,groupAccessor:d&&d!==s?d:void 0,groupLabel:"string"==typeof d?d:"group",valueFormat:h}),[s,l,d,h]),fe=Xr(()=>Ve(f),[f]);if(ie.earlyReturn)return ie.earlyReturn;let ye=Le({componentName:"BarChart",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(ye)/* @__PURE__ */return ta(ko,{componentName:"BarChart",message:ye,width:G,height:q});let ve=Ce(w),be=ve?[ve,...x||[]]:x,xe={chartType:"bar",...null!=r&&{data:ne},oAccessor:s,rAccessor:l,projection:"horizontal"===c?"horizontal":"vertical",pieceStyle:ge,size:[G,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ae,barPadding:g,...null!=p&&{roundedTop:p},...fe&&{gradientFill:fe},...V&&{dataIdAccessor:V},baselinePadding:v,enableHover:X,showAxes:o.showAxes,oLabel:ee,rLabel:te,rFormat:h,...z&&{oFormat:z},showGrid:Y,showCategoryTicks:E,oSort:m,...re,...ft({title:K,description:Z,summary:J,accessibleTable:U,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:b,defaultTooltipContent:pe}),...yt({linkedHover:R,selection:S,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...be&&be.length>0&&{annotations:be},...k&&{rExtent:k},...me.brushStreamProps,...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};/* @__PURE__ */
|
|
94
|
+
return ta(So,{componentName:"BarChart",width:G,height:q,children:/* @__PURE__ */ta(qr,{ref:i,...xe})})});oa.displayName="BarChart";import{useMemo as ia,forwardRef as ra,useRef as aa}from"react";import{jsx as na}from"react/jsx-runtime";var sa=ra(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=aa(null),{data:r,margin:a,className:n,categoryAccessor:s="category",stackBy:l,valueAccessor:c="value",orientation:h="vertical",valueFormat:d,colorBy:u,colorScheme:m,normalize:g=!1,sort:p=!1,barPadding:f=40,roundedTop:y,gradientFill:v,styleRules:b,baselinePadding:x=!1,tooltip:w,annotations:k,valueExtent:A,frameProps:S={},selection:R,linkedHover:P,linkedBrush:C,brush:_,onBrush:L,onObservation:M,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:F,emptyContent:$,legendInteraction:O,legendPosition:W,color:D,stroke:j,strokeWidth:N,opacity:E,categoryFormat:z}=e,{width:V,height:G,enableHover:q,showGrid:X,showLegend:Y,title:Q,description:K,summary:Z,accessibleTable:J,categoryLabel:U,valueLabel:ee}=o,te=ia(()=>Ro(r),[r]),oe=u||l,ie=Ie({data:te,rawData:r,colorBy:oe,colorScheme:m,legendInteraction:O,legendPosition:W,frameLegend:S,selection:R,linkedHover:P,fallbackFields:oe?["string"==typeof oe?oe:""]:[],unwrapData:!0,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"StackedBarChart",chartId:H,showLegend:Y,userMargin:a,marginDefaults:o.marginDefaults,loading:B,loadingContent:F,emptyContent:$,width:V,height:G,hasTitle:!!Q,axisChrome:Vt({showAxes:o.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!!U,hasValueLabel:!!ee})}),re=Xt(),ae=ia(()=>/* @__PURE__ */new Map,[]),ne=ia(()=>co(c),[c]),he=ce({brushProp:_,onBrushProp:L,linkedBrush:C,valueAccessor:c}),de=le({colorBy:oe,colorScale:ie.colorScale,color:D,themeCategorical:re,colorScheme:m,categoryIndexMap:ae,userPieceStyle:S?.pieceStyle,stroke:j,strokeWidth:N,opacity:E,styleRules:b,resolveRuleValue:ne,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection}),ue=ia(()=>gt({categoryAccessor:l,valueAccessor:c,groupAccessor:s,valueFormat:d}),[l,s,c,d]),me=Le({componentName:"StackedBarChart",data:r,accessors:{categoryAccessor:s,valueAccessor:c},requiredProps:{stackBy:l}}),{effectiveLegendProps:ge,effectiveMargin:pe}=se({ref:t,frameRef:i,setup:ie}),fe=ia(()=>Ve(v),[v]);if(ie.earlyReturn)return ie.earlyReturn;let ye={chartType:"bar",...null!=r&&{data:te},oAccessor:s,rAccessor:c,stackBy:l,normalize:g,oSort:p,projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:de,size:[V,G],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:pe,barPadding:f,...null!=y&&{roundedTop:y},...fe&&{gradientFill:fe},baselinePadding:x,enableHover:q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:U,rLabel:ee,rFormat:d,...z&&{oFormat:z},showGrid:X,...ge,...ft({title:Q,description:K,summary:Z,accessibleTable:J,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:w,defaultTooltipContent:ue}),...yt({linkedHover:P,selection:R,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...k&&k.length>0&&{annotations:k},...A&&{rExtent:A},...he.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return me?/* @__PURE__ */na(ko,{componentName:"StackedBarChart",message:me,width:V,height:G}):/* @__PURE__ */na(So,{componentName:"StackedBarChart",width:V,height:G,children:/* @__PURE__ */na(qr,{ref:i,...ye})})});sa.displayName="StackedBarChart";import*as la from"react";import{useMemo as ca,useCallback as ha,forwardRef as da,useRef as ua,useImperativeHandle as ma}from"react";import{useMemo as ga,useCallback as pa,useRef as fa}from"react";var ya={RdBu:ri,PiYG:ai,PRGn:ni,BrBG:si,RdYlBu:li,RdYlGn:ci,Spectral:hi},va="__likert_neutral_neg",ba="__likert_neutral_pos",xa=["Very Low","Low","Neutral","High","Very High"];import{jsx as wa}from"react/jsx-runtime";var ka=/* @__PURE__ */new Map,Aa=da(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=ua(null),{data:r,margin:a,className:n,categoryAccessor:s="question",valueAccessor:l,levelAccessor:c,countAccessor:h="count",levels:d=xa,orientation:u="horizontal",colorScheme:m,barPadding:g=20,styleRules:p,tooltip:f,annotations:y,valueExtent:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,valueFormat:P,loading:C,loadingContent:_,emptyContent:L,legendInteraction:M,legendPosition:I,categoryFormat:T,stroke:H,strokeWidth:B,opacity:F}=e,{width:$,height:O,enableHover:W,showGrid:D,showLegend:j,title:N,description:E,summary:z,accessibleTable:V,categoryLabel:G,valueLabel:q}=o,X="horizontal"===u,Y=void 0===r,Q=!c,K=Qt(),Z=ca(()=>m&&Array.isArray(m)&&m.length>=d.length?m:de(d.length,K),[m,d.length,K]),J=ca(()=>{let e=/* @__PURE__ */new Map;for(let t=0;d.length>t;t++)e.set(d[t],Z[t]||"#888");return e},[d,Z]),U=ca(()=>{if(!1!==j)return{legendGroups:[{styleFn:e=>({fill:J.get(e.label)||"#888"}),items:d.map(e=>({label:e})),label:""}]}},[j,d,J]),ee=ca(()=>Object.hasOwn(b,"legend")?b:{...b,legend:U},[b,U]),{processedData:te,reAggregate:oe,accumulatorRef:ie}=pe({data:r,levels:d,categoryAccessor:s,valueAccessor:l,levelAccessor:c,countAccessor:h,isDiverging:X,frameRef:i}),re="__likertLevelLabel",ae=He({isPushMode:Y,colorBy:re,colorScheme:Z,showLegend:j,legendPosition:I}),{wrapPush:ne,wrapPushMany:se}=ae,ce=ha(e=>ne(e=>{ie.current.push(e),oe(ie.current)})(e),[ne,oe,ie]),he=ha(e=>se(e=>{ie.current.push(...e),oe(ie.current)})(e),[se,oe,ie]);ma(t,()=>({push:ce,pushMany:he,remove:e=>i.current?.remove(e)??[],update:(e,t)=>i.current?.update(e,t)??[],replace:e=>i.current?.replace(e),clear:()=>{ie.current=[],ae.resetCategories(),i.current?.clear()},getData:()=>i.current?.getData()??[],getScales:()=>i.current?.getScales()??null}),[ce,he,ie,ae]);let ue=Ie({data:te,rawData:r,colorBy:re,colorScheme:Z,legendInteraction:M,legendPosition:I,frameLegend:ee,selection:x,linkedHover:w,fallbackFields:["__likertLevelLabel"],unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"LikertChart",chartId:R,showLegend:j,userMargin:a,marginDefaults:o.marginDefaults,loading:C,loadingContent:_,emptyContent:L,width:$,height:O,hasTitle:!!N,axisChrome:{hasAxis:!1!==o.showAxes,hasAxisLabel:X?!!q:!!G}}),me=ca(()=>{let e=d.length;return e%2!=0&&J.get(d[Math.floor(e/2)])||"#888"},[d,J]),ge=le({colorBy:void 0,colorScale:void 0,color:void 0,themeCategorical:void 0,colorScheme:void 0,categoryIndexMap:ka,userPieceStyle:b?.pieceStyle,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:ue.effectiveSelectionHook,resolvedSelection:ue.resolvedSelection,styleRules:p,resolveRuleValue:fe,baseStyleExtras:e=>{let t=e.__likertLevelLabel||e.data?.__likertLevelLabel,o=e.__likertLevel||e.data?.__likertLevel;if(o===va||o===ba)return{fill:me};let i=t||o;return i&&J.has(i)?{fill:J.get(i)}:{fill:"#888"}}}),ye=ca(()=>{let e=d.length;return e%2!=0?d[Math.floor(e/2)]:""},[d]),ve=ca(()=>e=>{let t=e.data||e,o=t.__likertLevel||"Unknown",i=o===va||o===ba?ye:o,r=t.__likertCategory||"",a=Math.abs(t.__likertPct||0),n=o===va||o===ba?2*a:a,s=t.__likertCount||0;return la.createElement("div",{className:"semiotic-tooltip",style:ii},la.createElement("div",{style:{fontWeight:"bold"}},r),la.createElement("div",{style:{marginTop:4}},`${i}: ${n.toFixed(1)}% (n=${s})`))},[ye]),be=ca(()=>{if(!d||2>d.length)return"LikertChart requires `levels` with at least 2 entries.";if(l&&c)return"LikertChart: provide either `valueAccessor` (raw responses) or `levelAccessor` + `countAccessor` (pre-aggregated), not both.";if(c&&!h)return"LikertChart: pre-aggregated mode requires both `levelAccessor` and `countAccessor`.";if(void 0!==r&&0===r.length)return null;let e={categoryAccessor:s};return Q?l&&(e.valueAccessor=l):(c&&(e.levelAccessor=c),h&&(e.countAccessor=h)),Le({componentName:"LikertChart",data:r,accessors:e,requiredProps:{levels:d}})},[r,s,l,c,h,d,Q]),xe=ue.legendBehaviorProps,we=ca(()=>{let e={...ue.margin};if(Y&&ue.legend){let t=ue.legendPosition;"bottom"===t&&80>e.bottom?e.bottom=80:"top"===t&&50>e.top?e.top=50:"right"===t&&110>e.right?e.right=110:"left"===t&&110>e.left&&(e.left=110)}else if(ae.streamingMarginAdjust)for(let[t,o]of Object.entries(ae.streamingMarginAdjust))o>e[t]&&(e[t]=o);return X&&100>e.left&&(e.left=100),e},[ue.margin,ue.legend,ue.legendPosition,ae.streamingMarginAdjust,X,Y]),ke=ca(()=>P||(X?e=>Math.abs(Number(e)).toFixed(0)+"%":e=>Number(e).toFixed(0)+"%"),[X,P]);if(ue.earlyReturn)return ue.earlyReturn;let Ae={chartType:"bar",...null!=r&&{data:te},oAccessor:"__likertCategory",rAccessor:"__likertPct",stackBy:"__likertLevel",normalize:!1,projection:X?"horizontal":"vertical",pieceStyle:ge,size:[$,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:we,barPadding:g,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:G,rLabel:q||(X?void 0:"Percentage"),rFormat:ke,...T&&{oFormat:T},showGrid:D,...xe,...N&&{title:N},...E&&{description:E},...z&&{summary:z},...void 0!==V&&{accessibleTable:V},...n&&{className:n},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===f?()=>null:!0===f?ve:fo(f)||ve,...yt({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:ue.mobileInteraction,customHoverBehavior:ue.customHoverBehavior,customClickBehavior:ue.customClickBehavior}),...y&&y.length>0&&{annotations:y},...v&&{rExtent:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return be?/* @__PURE__ */wa(ko,{componentName:"LikertChart",message:be,width:$,height:O}):/* @__PURE__ */wa(So,{componentName:"LikertChart",width:$,height:O,children:/* @__PURE__ */wa(qr,{ref:i,...Ae})})});Aa.displayName="LikertChart";import{useMemo as Sa,forwardRef as Ra,useRef as Pa}from"react";import{jsx as Ca}from"react/jsx-runtime";var _a=Ra(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Pa(null);Te(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",orientation:c="vertical",valueFormat:h,colorBy:d,colorScheme:u,styleRules:m,sizeBy:g,sizeRange:p=[3,8],symbolBy:f,symbolMap:y,pointRadius:v=4,pointOpacity:b=.7,categoryPadding:x=20,tooltip:w,annotations:k,valueExtent:A,brush:S,onBrush:R,linkedBrush:P,frameProps:C={},selection:_,linkedHover:L,onObservation:M,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:F,emptyContent:$,legendInteraction:O,legendPosition:W,color:D,stroke:j,strokeWidth:N,opacity:E,showCategoryTicks:z,categoryFormat:V}=e,{width:G,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:J,accessibleTable:U,categoryLabel:ee,valueLabel:te}=o,oe=Sa(()=>Ro(r),[r]),ie=Ie({data:oe,rawData:r,colorBy:d,colorScheme:u,legendInteraction:O,legendPosition:W,frameLegend:C,selection:_,linkedHover:L,fallbackFields:d?["string"==typeof d?d:""]:["string"==typeof s?s:""],unwrapData:!0,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"SwarmPlot",chartId:H,showLegend:Q,userMargin:a,marginDefaults:o.marginDefaults,loading:B,loadingContent:F,emptyContent:$,width:G,height:q,hasTitle:!!K,axisChrome:Vt({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!ee,hasValueLabel:!!te})}),re=ce({brushProp:S,onBrushProp:R,linkedBrush:P,valueAccessor:l}),ae=Sa(()=>{if(!g)return;let e=oe.map(e=>"function"==typeof g?g(e):e[g]);return _i(e)},[oe,g]),ne=Xt(),se=Sa(()=>/* @__PURE__ */new Map,[]),he=Sa(()=>co(l),[l]),de=le({colorBy:d,colorScale:ie.colorScale,color:D,themeCategorical:ne,colorScheme:u,categoryIndexMap:se,userPieceStyle:C?.pieceStyle,stroke:j,strokeWidth:N,opacity:E,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:e=>({fillOpacity:b,r:g?gi(e,g,p,ae):v}),styleRules:m,resolveRuleValue:he}),ue=Sa(()=>gt({categoryAccessor:s,valueAccessor:l,groupAccessor:d||void 0,valueFormat:h}),[s,l,d,h]);if(ie.earlyReturn)return ie.earlyReturn;let me=Le({componentName:"SwarmPlot",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(me)/* @__PURE__ */return Ca(ko,{componentName:"SwarmPlot",message:me,width:G,height:q});let ge={chartType:"swarm",...null!=r&&{data:oe},oAccessor:s,rAccessor:l,...f&&{symbolAccessor:f},...y&&{symbolMap:y},projection:"horizontal"===c?"horizontal":"vertical",pieceStyle:de,size:[G,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie.margin,barPadding:x,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:ee,rLabel:te,rFormat:h,...V&&{oFormat:V},showGrid:Y,showCategoryTicks:z,...ie.legendBehaviorProps,...ft({title:K,description:Z,summary:J,accessibleTable:U,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:w,defaultTooltipContent:ue}),...yt({linkedHover:L,selection:_,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...k&&k.length>0&&{annotations:k},...A&&{rExtent:A},...re.brushStreamProps,...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};/* @__PURE__ */
|
|
95
|
+
return Ca(So,{componentName:"SwarmPlot",width:G,height:q,children:/* @__PURE__ */Ca(qr,{ref:i,...ge})})});_a.displayName="SwarmPlot";import{useMemo as La,forwardRef as Ma,useRef as Ia}from"react";import{jsx as Ta,jsxs as Ha}from"react/jsx-runtime";import{jsx as Ba}from"react/jsx-runtime";var Fa=Ma(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Ia(null);Te(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",orientation:c="vertical",valueFormat:h,colorBy:d,colorScheme:u,styleRules:m,showOutliers:g=!0,outlierRadius:p=3,categoryPadding:f=20,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:k,onObservation:A,onClick:S,hoverHighlight:R,chartId:P,loading:C,loadingContent:_,emptyContent:L,legendInteraction:M,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:F,showCategoryTicks:$,categoryFormat:O}=e,{width:W,height:D,enableHover:j,showGrid:N,showLegend:E,title:z,description:V,summary:G,accessibleTable:q,categoryLabel:X,valueLabel:Y}=o,Q=La(()=>Ro(r),[r]),K=Ie({data:Q,rawData:r,colorBy:d,colorScheme:u,legendInteraction:M,legendPosition:I,frameLegend:x,selection:w,linkedHover:k,fallbackFields:d?["string"==typeof d?d:""]:["string"==typeof s?s:""],unwrapData:!0,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"BoxPlot",chartId:P,showLegend:E,userMargin:a,marginDefaults:o.marginDefaults,loading:C,loadingContent:_,emptyContent:L,width:W,height:D,hasTitle:!!z,axisChrome:Vt({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!X,hasValueLabel:!!Y})}),Z=Xt(),J=La(()=>/* @__PURE__ */new Map,[]),U=La(()=>{let e=co(l);return t=>"number"==typeof t.median?t.median:e(t)},[l]),ee=le({colorBy:d,colorScale:K.colorScale,color:T,themeCategorical:Z,colorScheme:u,categoryIndexMap:J,userPieceStyle:void 0,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:K.effectiveSelectionHook,resolvedSelection:K.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0,styleRules:m,resolveRuleValue:U}),te=La(()=>ye(),[]);if(K.earlyReturn)return K.earlyReturn;let oe=Le({componentName:"BoxPlot",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(oe)/* @__PURE__ */return Ba(ko,{componentName:"BoxPlot",message:oe,width:W,height:D});let ie={chartType:"boxplot",...null!=r&&{data:Q},oAccessor:s,rAccessor:l,projection:"horizontal"===c?"horizontal":"vertical",summaryStyle:ee,showOutliers:g,size:[W,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:K.margin,barPadding:f,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:X,rLabel:Y,rFormat:h,...O&&{oFormat:O},showGrid:N,showCategoryTicks:$,...K.legendBehaviorProps,...ft({title:z,description:V,summary:G,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:y,defaultTooltipContent:te}),...yt({linkedHover:k,selection:w,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:K.mobileInteraction,customHoverBehavior:K.customHoverBehavior,customClickBehavior:K.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};/* @__PURE__ */
|
|
96
|
+
return Ba(So,{componentName:"BoxPlot",width:W,height:D,children:/* @__PURE__ */Ba(qr,{ref:i,...ie})})});Fa.displayName="BoxPlot";import{useMemo as $a,forwardRef as Oa,useRef as Wa}from"react";import{jsx as Da,jsxs as ja}from"react/jsx-runtime";var Na=e=>{let t=e?.category;return null==t?"All":t+""},Ea=Oa(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:"horizontal",mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Wa(null);Te(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:s=Na,valueAccessor:l="value",bins:c=25,relative:h=!1,valueFormat:d,colorBy:u,colorScheme:m,styleRules:g,categoryPadding:p=("sparkline"===o.mode?0:20),tooltip:f,annotations:y,valueExtent:v,brush:b,onBrush:x,linkedBrush:w,frameProps:k={},selection:A,linkedHover:S,onObservation:R,onClick:P,hoverHighlight:C,chartId:_,loading:L,loadingContent:M,emptyContent:I,legendInteraction:T,legendPosition:H,color:B,stroke:F,strokeWidth:$,opacity:O,showCategoryTicks:W,categoryFormat:D}=e,{width:j,height:N,enableHover:E,showGrid:z,showLegend:V,title:G,description:q,summary:X,accessibleTable:Y,categoryLabel:Q,valueLabel:K}=o,Z=$a(()=>Ro(r),[r]),J=Ie({data:Z,rawData:r,colorBy:u,colorScheme:m,legendInteraction:T,legendPosition:H,frameLegend:k,selection:A,linkedHover:S,fallbackFields:u?["string"==typeof u?u:""]:["string"==typeof s?s:""],unwrapData:!0,onObservation:R,onClick:P,hoverHighlight:C,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"Histogram",chartId:_,showLegend:V,userMargin:a,marginDefaults:o.marginDefaults,loading:L,loadingContent:M,emptyContent:I,width:j,height:N,hasTitle:!!G,axisChrome:Vt({showAxes:o.showAxes,projection:"horizontal",hasCategoryLabel:!!Q,hasValueLabel:!!K})}),U=ce({brushProp:b,onBrushProp:x,linkedBrush:w,valueAccessor:l}),ee=$a(()=>{if(0===Z.length)return;let e="function"==typeof l?l:e=>e[l],t=1/0,o=-1/0;for(let i of Z){let r=e(i);null!=r&&isFinite(r)&&(t>r&&(t=r),r>o&&(o=r))}return t>o?void 0:[t,o]},[Z,l]),te=Xt(),oe=$a(()=>/* @__PURE__ */new Map,[]),ie=$a(()=>{let e=co(l);return t=>"number"==typeof t.count?t.count:e(t)},[l]),re=le({colorBy:u,colorScale:J.colorScale,color:B,themeCategorical:te,colorScheme:m,categoryIndexMap:oe,userPieceStyle:void 0,stroke:F,strokeWidth:$,opacity:O,effectiveSelectionHook:J.effectiveSelectionHook,resolvedSelection:J.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0,styleRules:g,resolveRuleValue:ie}),ae=$a(()=>e=>{let t=e.data||e,o=t.category||e.category||"",i=t.count,r=t.range;/* @__PURE__ */
|
|
97
|
+
return ja("div",{className:"semiotic-tooltip",style:ii,children:[o&&/* @__PURE__ */Da("div",{style:{fontWeight:"bold"},children:o+""}),null!=i&&/* @__PURE__ */ja("div",{children:["Count: ",i]}),r&&2===r.length&&/* @__PURE__ */ja("div",{style:{opacity:.8},children:[Number(r[0]).toFixed(1)," – ",Number(r[1]).toFixed(1)]})]})},[]);if(J.earlyReturn)return J.earlyReturn;let ne=Le({componentName:"Histogram",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(ne)/* @__PURE__ */return Da(ko,{componentName:"Histogram",message:ne,width:j,height:N});let se={chartType:"histogram",...null!=r&&{data:Z},oAccessor:s,rAccessor:l,projection:"horizontal",summaryStyle:re,bins:c,normalize:h,...v?{rExtent:v}:ee&&{rExtent:ee},size:[j,N],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:J.margin,barPadding:p,enableHover:E,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:Q,rLabel:K,rFormat:d,...D&&{oFormat:D},showGrid:z,showCategoryTicks:W,...J.legendBehaviorProps,...ft({title:G,description:q,summary:X,accessibleTable:Y,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:f,defaultTooltipContent:ae}),...yt({linkedHover:S,selection:A,onObservation:R,onClick:P,hoverHighlight:C,mobileInteraction:J.mobileInteraction,customHoverBehavior:J.customHoverBehavior,customClickBehavior:J.customClickBehavior}),...y&&y.length>0&&{annotations:y},...U.brushStreamProps,...Object.fromEntries(Object.entries(k).filter(([e])=>"pieceStyle"!==e))};/* @__PURE__ */
|
|
98
|
+
return Da(So,{componentName:"Histogram",width:j,height:N,children:/* @__PURE__ */Da(qr,{ref:i,...se})})});Ea.displayName="Histogram";import{useMemo as za,forwardRef as Va,useRef as Ga}from"react";import{jsx as qa}from"react/jsx-runtime";var Xa=Va(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Ga(null);Te(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",orientation:c="vertical",bins:h=25,curve:d="catmullRom",showIQR:u=!0,valueFormat:m,colorBy:g,colorScheme:p,styleRules:f,categoryPadding:y=20,tooltip:v,annotations:b,valueExtent:x,brush:w,onBrush:k,linkedBrush:A,frameProps:S={},selection:R,linkedHover:P,onObservation:C,onClick:_,hoverHighlight:L,chartId:M,loading:I,loadingContent:T,emptyContent:H,legendInteraction:B,legendPosition:F,color:$,stroke:O,strokeWidth:W,opacity:D,showCategoryTicks:j,categoryFormat:N}=e,{width:E,height:z,enableHover:V,showGrid:G,showLegend:q,title:X,description:Y,summary:Q,accessibleTable:K,categoryLabel:Z,valueLabel:J}=o,U=za(()=>Ro(r),[r]),ee=Ie({data:U,rawData:r,colorBy:g,colorScheme:p,legendInteraction:B,legendPosition:F,frameLegend:S,selection:R,linkedHover:P,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof s?s:""],unwrapData:!0,onObservation:C,onClick:_,hoverHighlight:L,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"ViolinPlot",chartId:M,showLegend:q,userMargin:a,marginDefaults:o.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:E,height:z,hasTitle:!!X,axisChrome:Vt({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!Z,hasValueLabel:!!J})}),te=ce({brushProp:w,onBrushProp:k,linkedBrush:A,valueAccessor:l}),oe=Xt(),ie=za(()=>/* @__PURE__ */new Map,[]),re=za(()=>{let e=co(l);return t=>"number"==typeof t.median?t.median:e(t)},[l]),ae=le({colorBy:g,colorScale:ee.colorScale,color:$,themeCategorical:oe,colorScheme:p,categoryIndexMap:ie,userPieceStyle:void 0,stroke:O,strokeWidth:W,opacity:D,effectiveSelectionHook:ee.effectiveSelectionHook,resolvedSelection:ee.resolvedSelection,baseStyleExtras:{fillOpacity:.6},linkStrokeToFill:!0,styleRules:f,resolveRuleValue:re}),ne=za(()=>ye({valueAccessor:l}),[l]);if(ee.earlyReturn)return ee.earlyReturn;let se=Le({componentName:"ViolinPlot",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(se)/* @__PURE__ */return qa(ko,{componentName:"ViolinPlot",message:se,width:E,height:z});let he={chartType:"violin",...null!=r&&{data:U},oAccessor:s,rAccessor:l,projection:"horizontal"===c?"horizontal":"vertical",summaryStyle:ae,bins:h,showIQR:u,size:[E,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee.margin,barPadding:y,enableHover:V,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:Z,rLabel:J,rFormat:m,...N&&{oFormat:N},showGrid:G,showCategoryTicks:j,...ee.legendBehaviorProps,...ft({title:X,description:Y,summary:Q,accessibleTable:K,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:v,defaultTooltipContent:ne}),...yt({linkedHover:P,selection:R,onObservation:C,onClick:_,hoverHighlight:L,mobileInteraction:ee.mobileInteraction,customHoverBehavior:ee.customHoverBehavior,customClickBehavior:ee.customClickBehavior}),...b&&b.length>0&&{annotations:b},...x&&{rExtent:x},...te.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};/* @__PURE__ */
|
|
99
|
+
return qa(So,{componentName:"ViolinPlot",width:E,height:z,children:/* @__PURE__ */qa(qr,{ref:i,...he})})});Xa.displayName="ViolinPlot";import{useMemo as Ya,forwardRef as Qa,useRef as Ka}from"react";import{jsx as Za}from"react/jsx-runtime";var Ja=Qa(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Ka(null);Te(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",orientation:c="horizontal",bins:h=20,amplitude:d=1.5,valueFormat:u,colorBy:m,colorScheme:g,styleRules:p,categoryPadding:f=5,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:k,onObservation:A,onClick:S,hoverHighlight:R,chartId:P,loading:C,loadingContent:_,emptyContent:L,legendInteraction:M,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:F,showCategoryTicks:$,categoryFormat:O}=e,{width:W,height:D,enableHover:j,showGrid:N,showLegend:E,title:z,description:V,summary:G,accessibleTable:q,categoryLabel:X,valueLabel:Y}=o,Q=Ya(()=>Ro(r),[r]),K=Ie({data:Q,rawData:r,colorBy:m,colorScheme:g,legendInteraction:M,legendPosition:I,frameLegend:x,selection:w,linkedHover:k,fallbackFields:m?["string"==typeof m?m:""]:["string"==typeof s?s:""],unwrapData:!0,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"RidgelinePlot",chartId:P,showLegend:E,userMargin:a,marginDefaults:o.marginDefaults,loading:C,loadingContent:_,emptyContent:L,width:W,height:D,hasTitle:!!z,axisChrome:Vt({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!X,hasValueLabel:!!Y})}),Z=Xt(),J=Ya(()=>/* @__PURE__ */new Map,[]),U=Ya(()=>{let e=co(l);return t=>"number"==typeof t.median?t.median:e(t)},[l]),ee=le({colorBy:m,colorScale:K.colorScale,color:T,themeCategorical:Z,colorScheme:g,categoryIndexMap:J,userPieceStyle:void 0,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:K.effectiveSelectionHook,resolvedSelection:K.resolvedSelection,baseStyleExtras:{fillOpacity:.5},linkStrokeToFill:!0,styleRules:p,resolveRuleValue:U}),te=Ya(()=>ye(),[]);if(K.earlyReturn)return K.earlyReturn;let oe=Le({componentName:"RidgelinePlot",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(oe)/* @__PURE__ */return Za(ko,{componentName:"RidgelinePlot",message:oe,width:W,height:D});let ie={chartType:"ridgeline",...null!=r&&{data:Q},oAccessor:s,rAccessor:l,projection:"horizontal"===c?"horizontal":"vertical",summaryStyle:ee,bins:h,size:[W,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:K.margin,barPadding:f,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:X,rLabel:Y,rFormat:u,...O&&{oFormat:O},showGrid:N,showCategoryTicks:$,oSort:!1,amplitude:d,...K.legendBehaviorProps,...ft({title:z,description:V,summary:G,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:y,defaultTooltipContent:te}),...yt({linkedHover:k,selection:w,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:K.mobileInteraction,customHoverBehavior:K.customHoverBehavior,customClickBehavior:K.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};/* @__PURE__ */
|
|
100
|
+
return Za(So,{componentName:"RidgelinePlot",width:W,height:D,children:/* @__PURE__ */Za(qr,{ref:i,...ie})})});Ja.displayName="RidgelinePlot";import{useMemo as Ua,forwardRef as en,useRef as tn}from"react";import{jsx as on}from"react/jsx-runtime";var rn=en(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid??!0,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=tn(null);Te(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",orientation:c="horizontal",valueFormat:h,colorBy:d,colorScheme:u,styleRules:m,sort:g="auto",dotRadius:p=5,categoryPadding:f=10,tooltip:y,annotations:v,regression:b,valueExtent:x,frameProps:w={},selection:k,linkedHover:A,onObservation:S,onClick:R,hoverHighlight:P,chartId:C,loading:_,loadingContent:L,emptyContent:M,legendInteraction:I,legendPosition:T,color:H,stroke:B,strokeWidth:F,opacity:$,categoryFormat:O}=e,{width:W,height:D,enableHover:j,showGrid:N,showLegend:E,title:z,description:V,summary:G,accessibleTable:q,categoryLabel:X,valueLabel:Y}=o,Q=Ua(()=>Ro(r),[r]),K=Ie({data:Q,rawData:r,colorBy:d,colorScheme:u,legendInteraction:I,legendPosition:T,frameLegend:w,selection:k,linkedHover:A,fallbackFields:d?["string"==typeof d?d:""]:["string"==typeof s?s:""],unwrapData:!0,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"DotPlot",chartId:C,showLegend:E,userMargin:a,marginDefaults:o.marginDefaults,loading:_,loadingContent:L,emptyContent:M,width:W,height:D,hasTitle:!!z,axisChrome:Vt({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!X,hasValueLabel:!!Y})}),Z=to(Q,g,l),J=Xt(),U=Ua(()=>/* @__PURE__ */new Map,[]),ee=Ua(()=>co(l),[l]),te=le({colorBy:d,colorScale:K.colorScale,color:H,themeCategorical:J,colorScheme:u,categoryIndexMap:U,userPieceStyle:w?.pieceStyle,stroke:B,strokeWidth:F,opacity:$,effectiveSelectionHook:K.effectiveSelectionHook,resolvedSelection:K.resolvedSelection,baseStyleExtras:{r:p,fillOpacity:.8},styleRules:m,resolveRuleValue:ee}),oe=Ua(()=>gt({categoryAccessor:s,valueAccessor:l,valueFormat:h}),[s,l,h]);if(K.earlyReturn)return K.earlyReturn;let ie=Le({componentName:"DotPlot",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(ie)/* @__PURE__ */return on(ko,{componentName:"DotPlot",message:ie,width:W,height:D});let re=Ce(b),ae=re?[re,...v||[]]:v,ne={chartType:"point",...null!=r&&{data:Z},oAccessor:s,rAccessor:l,projection:"horizontal"===c?"horizontal":"vertical",pieceStyle:te,size:[W,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:K.margin,barPadding:f,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:X,rLabel:Y,rFormat:h,...O&&{oFormat:O},showGrid:N,oSort:g,...K.legendBehaviorProps,...ft({title:z,description:V,summary:G,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:y,defaultTooltipContent:oe}),...yt({linkedHover:A,selection:k,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:K.mobileInteraction,customHoverBehavior:K.customHoverBehavior,customClickBehavior:K.customClickBehavior}),...ae&&ae.length>0&&{annotations:ae},...x&&{rExtent:x},...Object.fromEntries(Object.entries(w).filter(([e])=>"pieceStyle"!==e))};/* @__PURE__ */
|
|
101
|
+
return on(So,{componentName:"DotPlot",width:W,height:D,children:/* @__PURE__ */on(qr,{ref:i,...ne})})});rn.displayName="DotPlot";import{useMemo as an,forwardRef as nn,useRef as sn}from"react";import{jsx as ln}from"react/jsx-runtime";var cn=nn(function(e,t){let o=so(e.mode,{width:e.width??400,height:e.height??400,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=sn(null),{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",colorBy:c,colorScheme:h,styleRules:d,startAngle:u=0,cornerRadius:m,valueFormat:g,tooltip:p,annotations:f,frameProps:y={},selection:v,linkedHover:b,onObservation:x,onClick:w,hoverHighlight:k,chartId:A,loading:S,loadingContent:R,emptyContent:P,legendInteraction:C,legendPosition:_,color:L,stroke:M,strokeWidth:I,opacity:T}=e,{width:H,height:B,enableHover:F,showLegend:$,title:O,description:W,summary:D,accessibleTable:j}=o,N=an(()=>Ro(r),[r]),E=c||s,z=Ie({data:N,rawData:r,colorBy:E,colorScheme:h,legendInteraction:C,legendPosition:_,frameLegend:y,selection:v,linkedHover:b,fallbackFields:E?["string"==typeof E?E:""]:[],unwrapData:!0,onObservation:x,onClick:w,hoverHighlight:k,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"PieChart",chartId:A,showLegend:$,userMargin:a,marginDefaults:o.marginDefaults,loading:S,loadingContent:R,emptyContent:P,width:H,height:B,hasTitle:!!O,axisChrome:{hasAxis:!1}}),V=Xt(),G=an(()=>/* @__PURE__ */new Map,[]),q=an(()=>{let e=co(l);return t=>{let o=e(t);return null==o?void 0:Math.abs(o)}},[l]),X=le({colorBy:E,colorScale:z.colorScale,color:L,themeCategorical:V,colorScheme:h,categoryIndexMap:G,userPieceStyle:y?.pieceStyle,stroke:M,strokeWidth:I,opacity:T,effectiveSelectionHook:z.effectiveSelectionHook,resolvedSelection:z.resolvedSelection,cycleByCategory:!0,styleRules:d,resolveRuleValue:q}),Y=an(()=>gt({categoryAccessor:s,valueAccessor:l,groupAccessor:c&&c!==s?c:void 0,groupLabel:"string"==typeof c?c:"group",pieData:!0,valueFormat:g}),[s,l,c,g]),Q=Le({componentName:"PieChart",data:r,accessors:{categoryAccessor:s,valueAccessor:l}}),{effectiveLegendProps:K,effectiveMargin:Z}=se({ref:t,frameRef:i,setup:z});if(z.earlyReturn)return z.earlyReturn;let J={chartType:"pie",...null!=r&&{data:N},oAccessor:s,rAccessor:l,projection:"radial",pieceStyle:X,startAngle:u,...null!=m&&{cornerRadius:m},size:[H,B],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z,enableHover:F,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...K,...ft({title:O,description:W,summary:D,accessibleTable:j,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:p,defaultTooltipContent:Y}),...yt({linkedHover:b,selection:v,onObservation:x,onClick:w,hoverHighlight:k,mobileInteraction:z.mobileInteraction,customHoverBehavior:z.customHoverBehavior,customClickBehavior:z.customClickBehavior}),...f&&f.length>0&&{annotations:f},...Object.fromEntries(Object.entries(y).filter(([e])=>"pieceStyle"!==e))};return Q?/* @__PURE__ */ln(ko,{componentName:"PieChart",message:Q,width:H,height:B}):/* @__PURE__ */ln(So,{componentName:"PieChart",width:H,height:B,children:/* @__PURE__ */ln(qr,{ref:i,...J})})});cn.displayName="PieChart";import{useMemo as hn,forwardRef as dn,useRef as un}from"react";import{jsx as mn}from"react/jsx-runtime";var gn=dn(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,linkedHover:e.linkedHover,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:400,height:400}),i=un(null),{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",innerRadius:c,centerContent:h,colorBy:d,colorScheme:u,styleRules:m,startAngle:g=0,cornerRadius:p,valueFormat:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,loading:P,loadingContent:C,emptyContent:_,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B}=e,{width:F,height:$,enableHover:O,showLegend:W,title:D,description:j,summary:N,accessibleTable:E}=o,z=hn(()=>Ro(r),[r]),V=d||s,G=Ie({data:z,rawData:r,colorBy:V,colorScheme:u,legendInteraction:L,legendPosition:M,frameLegend:b,selection:x,linkedHover:w,fallbackFields:V?["string"==typeof V?V:""]:[],unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"DonutChart",chartId:R,showLegend:W,userMargin:a,marginDefaults:o.marginDefaults,loading:P,loadingContent:C,emptyContent:_,width:F,height:$,hasTitle:!!D,axisChrome:{hasAxis:!1}}),q=c??Math.max(2,.15*Math.min(F,$)),X=Xt(),Y=hn(()=>/* @__PURE__ */new Map,[]),Q=hn(()=>{let e=co(l);return t=>{let o=e(t);return null==o?void 0:Math.abs(o)}},[l]),K=le({colorBy:V,colorScale:G.colorScale,color:I,themeCategorical:X,colorScheme:u,categoryIndexMap:Y,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:G.effectiveSelectionHook,resolvedSelection:G.resolvedSelection,cycleByCategory:!0,styleRules:m,resolveRuleValue:Q}),Z=hn(()=>gt({categoryAccessor:s,valueAccessor:l,groupAccessor:d&&d!==s?d:void 0,groupLabel:"string"==typeof d?d:"group",pieData:!0,valueFormat:f}),[s,l,d,f]),J=Le({componentName:"DonutChart",data:r,accessors:{categoryAccessor:s,valueAccessor:l}}),{effectiveLegendProps:U,effectiveMargin:ee}=se({ref:t,frameRef:i,setup:G});if(G.earlyReturn)return G.earlyReturn;let te={chartType:"donut",...null!=r&&{data:z},oAccessor:s,rAccessor:l,projection:"radial",pieceStyle:K,innerRadius:q,startAngle:g,...null!=p&&{cornerRadius:p},centerContent:h,size:[F,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee,enableHover:O,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...U,...ft({title:D,description:j,summary:N,accessibleTable:E,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:y,defaultTooltipContent:Z}),...yt({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:G.mobileInteraction,customHoverBehavior:G.customHoverBehavior,customClickBehavior:G.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return J?/* @__PURE__ */mn(ko,{componentName:"DonutChart",message:J,width:F,height:$}):/* @__PURE__ */mn(So,{componentName:"DonutChart",width:F,height:$,children:/* @__PURE__ */mn(qr,{ref:i,...te})})});gn.displayName="DonutChart";import{jsx as pn,jsxs as fn}from"react/jsx-runtime";import{useMemo as yn,forwardRef as vn,useRef as bn}from"react";import{jsx as xn,jsxs as wn}from"react/jsx-runtime";var kn=vn(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:!1,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:300,height:250}),i=bn(null),r="context"===o.mode,{compactMode:a}=o,{value:n,min:s=0,max:l=100,thresholds:c,gradientFill:h,color:d,backgroundColor:u="var(--semiotic-grid, #e0e0e0)",arcWidth:m=.3,cornerRadius:g,showNeedle:p=!0,needleColor:f="var(--semiotic-text, #333)",centerContent:y,valueFormat:v,showScaleLabels:b=!a,sweep:x=240,fillZones:w=!0,tooltip:k,styleRules:A,annotations:S,frameProps:R={},className:P,stroke:C,strokeWidth:_,opacity:L}=e,{width:M,height:I,title:T,description:H,summary:B,accessibleTable:F}=o,$=Ge(h),O=Math.max(s,Math.min(l,n)),W=l-s||1,D=(O-s)/W,{gaugeData:j,pieceStyle:N,gaugeAnnotations:E}=yn(()=>Pe({min:s,max:l,value:n,thresholds:c,fillColor:d,backgroundColor:u,fillZones:w,showScaleLabels:b,gradientFill:$}),[n,s,l,c,d,u,b,w,$]),z=yn(()=>mo(N,A,(e,t)=>({value:"number"==typeof e.value?e.value:void 0,category:t??(null==e.category?void 0:e.category+"")})),[N,A]),V=yn(()=>bt(z,{stroke:C,strokeWidth:_,opacity:L}),[z,C,_,L]),{activeSelectionHook:G,customHoverBehavior:q,customClickBehavior:X}=io({selection:e.selection,linkedHover:e.linkedHover,fallbackFields:["category"],onObservation:e.onObservation,chartType:"GaugeChart",chartId:e.chartId,onClick:e.onClick,hoverHighlight:e.hoverHighlight,colorByField:"category",mobileInteraction:o.mobileInteraction}),Y=Me(e.selection),Q=yn(()=>No(V,G,Y),[V,G,Y]),{sweepRad:K,startAngleDeg:Z}=be(x),J=xe(x),U=Math.min(10,Math.max(1,Math.min(M,I)/12)),ee=J.cx,te=J.cy,oe=Math.max(4,Math.min((M-2*U)/J.width,(I-2*U)/J.height)-2),ie=Math.max(0,Math.min(oe-1.5,oe*(1-m))),re=M/2-ee*oe,ae=I/2-te*oe,ne=2*(oe+4),se=yn(()=>a&&null==y?null:null!=y?"function"==typeof y?y(O,s,l):y:ve({value:v?v(O):Math.round(O)+"",min:s,max:l,radius:oe,showScaleLabels:b}),[y,O,s,l,v,b,oe,a]),le=yn(()=>r&&null==y?{type:"gauge-value",text:v?v(O):Math.round(O)+""}:null,[r,y,O,v]),ce=yn(()=>{if(!p)return null;let e=-Math.PI/2+Z*Math.PI/180+D*K,t=ie>20?ie-8:oe-1;return{type:"gauge-needle",tipX:Math.cos(e)*t,tipY:Math.sin(e)*t,color:f}},[p,Z,D,K,ie,oe,f]),he=yn(()=>(e,t,o)=>{if("gauge-needle"===e.type){let i=(o.width||M)/2,r=(o.height||I)/2,a=Math.max(1,oe-ie),n=Math.max(1,Math.min(2.5,.4*a)),s=Math.max(1,Math.min(5,.6*a));/* @__PURE__ */
|
|
102
|
+
return wn("g",{transform:`translate(${i},${r})`,children:[
|
|
103
|
+
/* @__PURE__ */xn("line",{x1:0,y1:0,x2:e.tipX,y2:e.tipY,stroke:e.color,strokeWidth:n,strokeLinecap:"round"}),
|
|
104
|
+
/* @__PURE__ */xn("circle",{cx:0,cy:0,r:s,fill:e.color})]},"gauge-needle-"+t)}if("gauge-label"===e.type){let i,r,a=-Math.PI/2+Z*Math.PI/180+(e.value-s)/W*K,n=(o.width||M)/2,l=(o.height||I)/2,c=ie-1,h=oe+1,d=Math.cos(a)*c,u=Math.sin(a)*c,m=Math.cos(a)*h,g=Math.sin(a)*h,p=oe+10,f=Math.cos(a)*p,y=Math.sin(a)*p,v=((a+Math.PI/2)/(2*Math.PI)*12+12)%12;return v>=11||1>v?(i="middle",r="auto"):v>=1&&5>v?(i="start",r="middle"):v>=5&&7>v?(i="middle",r="hanging"):(i="end",r="middle"),/* @__PURE__ */wn("g",{transform:`translate(${n},${l})`,children:[
|
|
105
|
+
/* @__PURE__ */xn("line",{x1:d,y1:u,x2:m,y2:g,stroke:"var(--semiotic-border, #ccc)",strokeWidth:2,strokeLinecap:"round"}),
|
|
106
|
+
/* @__PURE__ */xn("text",{x:f,y:y,textAnchor:i,dominantBaseline:r,fill:"var(--semiotic-text-secondary, #666)",fontSize:10,style:{userSelect:"none",fontSize:"var(--semiotic-gauge-label-font-size, 10px)"},children:e.label})]},"gauge-label-"+t)}return"gauge-value"===e.type?/* @__PURE__ */xn("text",{x:(o.width||M)/2,y:(o.height||I)/2-.2*ie,textAnchor:"middle",dominantBaseline:"middle",fontSize:Math.max(12,Math.min(22,.28*oe)),fontWeight:700,fill:"var(--semiotic-text, #333)",style:{userSelect:"none"},children:e.text},"gauge-value-"+t):null},[M,I,s,W,Z,K,ie,oe]),de=yn(()=>{let e=[...E,...S||[]];return ce&&e.push(ce),le&&e.push(le),e},[E,S,ce,le]),ue=yn(()=>e=>{let t=e?.data?.[0]||e?.data||e,o=t?._zone||"",i=t?._isFill;/* @__PURE__ */
|
|
107
|
+
return wn("div",{className:"semiotic-tooltip",style:{padding:"6px 10px",background:"var(--semiotic-tooltip-bg, white)",borderRadius:"var(--semiotic-tooltip-radius, 6px)",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0,0,0,0.15))"},children:[
|
|
108
|
+
/* @__PURE__ */xn("div",{style:{fontWeight:600},children:o}),
|
|
109
|
+
/* @__PURE__ */xn("div",{style:{fontSize:"0.85em",color:"var(--semiotic-text-secondary, #666)"},children:i?"Current: "+Math.round(O):"Remaining"})]})},[O]),me=Lo(e.loading,M,I,e.loadingContent),ge=me?null:Po(Number.isFinite(n)?[{value:n}]:[],M,I,e.emptyContent);if(me)return me;if(ge)return ge;if(0===j.length)/* @__PURE__ */
|
|
110
|
+
return xn(ko,{componentName:"GaugeChart",message:"No data to display",width:M,height:I});let pe={chartType:"donut",data:j,oAccessor:"category",rAccessor:"value",oSort:!1,projection:"radial",pieceStyle:Q,innerRadius:ie,startAngle:Z,sweepAngle:x,...null!=g&&{cornerRadius:g},centerContent:se,size:[M,I],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:{top:ae-ne/2,bottom:I-ae-ne/2,left:re-ne/2,right:M-re-ne/2},enableHover:o.enableHover,showAxes:!1,showCategoryTicks:!1,tooltipContent:!1===k?()=>null:fo(k)||ue,...yt({linkedHover:e.linkedHover,selection:e.selection,onObservation:e.onObservation,onClick:e.onClick,hoverRadius:e.hoverRadius,hoverHighlight:e.hoverHighlight,mobileInteraction:o.mobileInteraction,customHoverBehavior:q,customClickBehavior:X}),svgAnnotationRules:he,...de.length>0&&{annotations:de},...T&&{title:T},...H&&{description:H},...B&&{summary:B},...void 0!==F&&{accessibleTable:F},...P&&{className:P},...null!=e.animate&&{animate:e.animate},...R};/* @__PURE__ */
|
|
111
|
+
return xn(So,{componentName:"GaugeChart",width:M,height:I,children:/* @__PURE__ */xn(qr,{ref:i,...pe})})});kn.displayName="GaugeChart";import{useMemo as An,forwardRef as Sn,useRef as Rn}from"react";import{jsx as Pn}from"react/jsx-runtime";var Cn=Sn(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Rn(null),{data:r,margin:a,className:n,categoryAccessor:s="category",groupBy:l,valueAccessor:c="value",orientation:h="vertical",valueFormat:d,colorBy:u,colorScheme:m,sort:g=!1,barPadding:p=60,roundedTop:f,gradientFill:y,styleRules:v,baselinePadding:b=!1,tooltip:x,annotations:w,valueExtent:k,frameProps:A={},selection:S,linkedHover:R,linkedBrush:P,brush:C,onBrush:_,onObservation:L,onClick:M,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:F,legendInteraction:$,legendPosition:O,color:W,stroke:D,strokeWidth:j,opacity:N,categoryFormat:E}=e,{width:z,height:V,enableHover:G,showGrid:q,showLegend:X,title:Y,description:Q,summary:K,accessibleTable:Z,categoryLabel:J,valueLabel:U}=o,ee=An(()=>Ro(r),[r]),te=u||l,oe=Ie({data:ee,rawData:r,colorBy:te,colorScheme:m,legendInteraction:$,legendPosition:O,frameLegend:A,selection:S,linkedHover:R,fallbackFields:te?["string"==typeof te?te:""]:[],unwrapData:!0,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"GroupedBarChart",chartId:T,showLegend:X,userMargin:a,marginDefaults:o.marginDefaults,loading:H,loadingContent:B,emptyContent:F,width:z,height:V,hasTitle:!!Y,axisChrome:Vt({showAxes:o.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!!J,hasValueLabel:!!U})}),ie=Xt(),re=An(()=>/* @__PURE__ */new Map,[]),ae=An(()=>co(c),[c]),ne=ce({brushProp:C,onBrushProp:_,linkedBrush:P,valueAccessor:c}),he=le({colorBy:te,colorScale:oe.colorScale,color:W,themeCategorical:ie,colorScheme:m,categoryIndexMap:re,userPieceStyle:A.pieceStyle,stroke:D,strokeWidth:j,opacity:N,styleRules:v,resolveRuleValue:ae,effectiveSelectionHook:oe.effectiveSelectionHook,resolvedSelection:oe.resolvedSelection}),de=An(()=>gt({categoryAccessor:l,valueAccessor:c,groupAccessor:s,valueFormat:d}),[l,s,c,d]),ue=Le({componentName:"GroupedBarChart",data:r,accessors:{categoryAccessor:s,valueAccessor:c},requiredProps:{groupBy:l}}),{effectiveLegendProps:me,effectiveMargin:ge}=se({ref:t,frameRef:i,setup:oe}),pe=An(()=>Ve(y),[y]);if(oe.earlyReturn)return oe.earlyReturn;let fe={chartType:"clusterbar",...null!=r&&{data:ee},oAccessor:s,rAccessor:c,groupBy:l,oSort:g,projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:he,size:[z,V],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ge,barPadding:p,...null!=f&&{roundedTop:f},...pe&&{gradientFill:pe},baselinePadding:b,enableHover:G,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:J,rLabel:U,rFormat:d,...E&&{oFormat:E},showGrid:q,...me,...ft({title:Y,description:Q,summary:K,accessibleTable:Z,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:x,defaultTooltipContent:de}),...yt({linkedHover:R,selection:S,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:oe.mobileInteraction,customHoverBehavior:oe.customHoverBehavior,customClickBehavior:oe.customClickBehavior}),...w&&w.length>0&&{annotations:w},...k&&{rExtent:k},...ne.brushStreamProps,...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return ue?/* @__PURE__ */Pn(ko,{componentName:"GroupedBarChart",message:ue,width:z,height:V}):/* @__PURE__ */Pn(So,{componentName:"GroupedBarChart",width:z,height:V,children:/* @__PURE__ */Pn(qr,{ref:i,...fe})})});Cn.displayName="GroupedBarChart";import{useMemo as _n,forwardRef as Ln,useRef as Mn}from"react";import{jsx as In,jsxs as Tn}from"react/jsx-runtime";var Hn=Ln(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:!1,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:!1,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Mn(null);Te(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,stepAccessor:s="step",valueAccessor:l="value",categoryAccessor:c,colorBy:h,colorScheme:d,styleRules:u,orientation:m="horizontal",connectorOpacity:g=.3,showLabels:p=!0,valueFormat:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,loading:P,loadingContent:C,emptyContent:_,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B,categoryFormat:F}=e,$="vertical"===m,{width:O,height:W,enableHover:D,showLegend:j,title:N,description:E,summary:z,accessibleTable:V}=o,G=$?{top:N?60:40,right:20,bottom:60,left:60}:{top:N?40:10,right:10,bottom:10,left:10},q=_n(()=>Ro(r),[r]),X=h||c,Y=!X,Q=Ie({data:q,rawData:r,colorBy:X,colorScheme:d,legendInteraction:L,legendPosition:M,frameLegend:b,selection:x,linkedHover:w,fallbackFields:X?["string"==typeof X?X:""]:[],unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"FunnelChart",chartId:R,showLegend:j,userMargin:a,marginDefaults:G,loading:P,loadingContent:C,emptyContent:_,width:O,height:W,hasTitle:!!N,axisChrome:Vt({showAxes:$&&o.showAxes,projection:$?"vertical":"horizontal",hasCategoryLabel:!1,hasValueLabel:!1})});Io("FunnelChart",q,"stepAccessor",s),Io("FunnelChart",q,"valueAccessor",l);let K=Xt(),Z=_n(()=>/* @__PURE__ */new Map,[]),J=_n(()=>co(l),[l]),U=_n(()=>{if(Y)return I||(K?.[0]?K[0]:Array.isArray(d)&&d[0]?d[0]:"#4e79a7")},[Y,I,K,d]),ee=le({colorBy:U?void 0:X,colorScale:Q.colorScale,color:U??I,themeCategorical:K,colorScheme:d,categoryIndexMap:Z,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:Q.effectiveSelectionHook,resolvedSelection:Q.resolvedSelection,styleRules:u,resolveRuleValue:J}),te=_n(()=>e=>{let t=e?.data||e,o=t?.__funnelStep||t?.__barFunnelStep||t?.step||"",i=t?.__funnelValue??t?.__barFunnelValue??t?.value??"",r=t?.__funnelPercent??t?.__barFunnelPercent,a=t?.__funnelIsFirstStep??t?.__barFunnelIsFirstStep,n=t?.__barFunnelIsDropoff,s=t?.__barFunnelCategory??t?.category,l=null==r||a?"":` (${.05>Math.abs(r-Math.round(r))?Math.round(r)+"%":r.toFixed(1)+"%"})`;/* @__PURE__ */
|
|
112
|
+
return Tn("div",{className:"semiotic-tooltip",style:ii,children:[o&&/* @__PURE__ */In("div",{style:{fontWeight:"bold"},children:o+""}),s&&s!==o&&/* @__PURE__ */In("div",{style:{marginTop:2,opacity:.8},children:s+""}),n&&/* @__PURE__ */In("div",{style:{marginTop:2,fontStyle:"italic",opacity:.7},children:"Dropoff"}),
|
|
113
|
+
/* @__PURE__ */Tn("div",{style:{marginTop:4},children:[!f||"number"!=typeof i&&"string"!=typeof i?i+"":f(i),l]})]})},[f]);if(Q.earlyReturn)return Q.earlyReturn;let oe=Le({componentName:"FunnelChart",data:r,accessors:{stepAccessor:s,valueAccessor:l}});if(oe)/* @__PURE__ */return In(ko,{componentName:"FunnelChart",message:oe,width:O,height:W});let ie={chartType:$?"bar-funnel":"funnel",...null!=r&&{data:q},oAccessor:s,rAccessor:l,...c&&{stackBy:c},projection:$?"vertical":"horizontal",barPadding:$?40:0,pieceStyle:ee,size:[O,W],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Q.margin,enableHover:D,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:$&&o.showAxes,showCategoryTicks:$&&o.showAxes,...F&&{oFormat:F},...f&&{rFormat:f},showGrid:$,...!$&&{connectorOpacity:g},showLabels:p,...Q.legendBehaviorProps,...N&&{title:N},...E&&{description:E},...z&&{summary:z},...void 0!==V&&{accessibleTable:V},...n&&{className:n},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===y?()=>null:!0===y||null==y?te:fo(y)||te,...yt({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:Q.mobileInteraction,customHoverBehavior:Q.customHoverBehavior,customClickBehavior:Q.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};/* @__PURE__ */
|
|
114
|
+
return In(So,{componentName:"FunnelChart",width:O,height:W,children:/* @__PURE__ */In(qr,{ref:i,...ie})})});Hn.displayName="FunnelChart";import{useMemo as Bn,forwardRef as Fn,useRef as $n}from"react";import{jsx as On}from"react/jsx-runtime";var Wn=Fn(function(e,t){let o=$n(null);Te(t,{variant:"xy",frameRef:o});let i=so(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:a,className:n,categoryAccessor:s="attribute",valueAccessor:l="value",seriesAccessor:c,colorBy:h,categoryFormat:d,colorScheme:u,styleRules:m,pointRadius:g=4,valueExtent:p,valueFormat:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,loading:P,loadingContent:C,emptyContent:_,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B}=e,{width:F,height:$,enableHover:O,showGrid:W,showLegend:D,title:j,description:N,summary:E,accessibleTable:z}=i,V=Bn(()=>Ro(r),[r]),G=c||("string"==typeof h?h:void 0)||("function"==typeof h?h:void 0),q=G??"__radar",X=h||G,Y=Ie({data:V,rawData:r,colorBy:X,colorScheme:u,legendInteraction:L,legendPosition:M,frameLegend:b,selection:x,linkedHover:w,fallbackFields:["string"==typeof X?X:"","string"==typeof s?s:""].filter(Boolean),unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"RadarChart",chartId:R,showLegend:D,userMargin:a,marginDefaults:i.marginDefaults,loading:P,loadingContent:C,emptyContent:_,width:F,height:$,hasTitle:!!j,axisChrome:Vt({showAxes:!0,projection:"radial",hasCategoryLabel:!1,hasValueLabel:!1})}),Q=Xt(),K=Bn(()=>/* @__PURE__ */new Map,[]),Z=Bn(()=>co(l),[l]),J=le({colorBy:X,colorScale:Y.colorScale,color:I,themeCategorical:Q,colorScheme:u,categoryIndexMap:K,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:Y.effectiveSelectionHook,resolvedSelection:Y.resolvedSelection,baseStyleExtras:{r:g,fillOpacity:.85},styleRules:m,resolveRuleValue:Z}),U=Bn(()=>gt({categoryAccessor:s,valueAccessor:l,groupAccessor:G,groupLabel:"string"==typeof G?G:"series",valueFormat:f}),[s,l,G,f]);if(Y.earlyReturn)return Y.earlyReturn;let ee=Le({componentName:"RadarChart",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(ee)/* @__PURE__ */return On(ko,{componentName:"RadarChart",message:ee,width:F,height:$});let te={chartType:"point",projection:"radial",...null!=r&&{data:V},oAccessor:s,rAccessor:l,connectorAccessor:q,connectorStyle:e=>{let t="function"==typeof J?J(e):{},o="string"==typeof t.fill?t.fill:void 0;return{fill:o,fillOpacity:.15,stroke:o,strokeWidth:2,opacity:.7}},pieceStyle:J,...d&&{oFormat:d},rExtent:p??[0],rFormat:f,oLabel:"",size:[F,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Y.margin,enableHover:O,showAxes:!0,showGrid:W,...Y.legendBehaviorProps,...ft({title:j,description:N,summary:E,accessibleTable:z,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:y,defaultTooltipContent:U}),...yt({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:Y.mobileInteraction,customHoverBehavior:Y.customHoverBehavior,customClickBehavior:Y.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e&&"connectorStyle"!==e))};/* @__PURE__ */
|
|
115
|
+
return On(So,{componentName:"RadarChart",width:F,height:$,children:/* @__PURE__ */On(qr,{ref:o,...te})})});Wn.displayName="RadarChart";import{useMemo as Dn,forwardRef as jn,useRef as Nn}from"react";import{jsx as En}from"react/jsx-runtime";var zn=jn(function(e,t){let o=so(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Nn(null),{data:r,margin:a,className:n,categoryAccessor:s="category",subcategoryAccessor:l,valueAccessor:c="value",orientation:h="horizontal",valueFormat:d,colorBy:u,colorScheme:m,styleRules:g,barPadding:p,tooltip:f,annotations:y,brush:v,onBrush:b,linkedBrush:x,frameProps:w={},selection:k,linkedHover:A,onObservation:S,onClick:R,hoverHighlight:P,chartId:C,loading:_,loadingContent:L,emptyContent:M,legendInteraction:I,legendPosition:T,color:H,stroke:B,strokeWidth:F,opacity:$,categoryFormat:O,rTickValues:W,tickLabelEdgeAlign:D,showCategoryTicks:j,gradientFill:N,trackFill:E,roundedTop:z,valueExtent:V}=e,{width:G,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:J,accessibleTable:U,categoryLabel:ee,valueLabel:te}=o,oe=Dn(()=>Ro(r),[r]),ie=u||l,re=Dn(()=>{if(null!=p)return p;if("sparkline"!==o.mode)return 40;let e=new Set(oe.map(e=>"function"==typeof s?s(e):e[s])),t=Math.max(1,e.size);return t>1?Math.max(0,Math.min(1,(("horizontal"===h?q:G)-2*t)/(t-1))):1},[p,o.mode,oe,s,h,G,q]),ae=Ie({data:oe,rawData:r,colorBy:ie,colorScheme:m,legendInteraction:I,legendPosition:T,frameLegend:w,selection:k,linkedHover:A,fallbackFields:ie?["string"==typeof ie?ie:""]:[],unwrapData:!0,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"SwimlaneChart",chartId:C,showLegend:Q,userMargin:a,marginDefaults:o.marginDefaults,loading:_,loadingContent:L,emptyContent:M,width:G,height:q,hasTitle:!!K,axisChrome:Vt({showAxes:o.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!1!==j&&!!ee,hasValueLabel:!!te})}),ne=ce({brushProp:v,onBrushProp:b,linkedBrush:x,valueAccessor:c}),he=Xt(),de=Dn(()=>/* @__PURE__ */new Map,[]),ue=Dn(()=>co(c),[c]),me=le({colorBy:ie,colorScale:ae.colorScale,color:H,themeCategorical:he,colorScheme:m,categoryIndexMap:de,userPieceStyle:w?.pieceStyle,stroke:B,strokeWidth:F,opacity:$,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection,cycleByCategory:!0,styleRules:g,resolveRuleValue:ue}),ge=Dn(()=>gt({categoryAccessor:l,valueAccessor:c,groupAccessor:s,valueFormat:d}),[l,s,c,d]),pe=Le({componentName:"SwimlaneChart",data:r,accessors:{categoryAccessor:s,valueAccessor:c,subcategoryAccessor:l},requiredProps:{subcategoryAccessor:l}}),{effectiveLegendProps:fe,effectiveMargin:ye}=se({ref:t,frameRef:i,setup:ae}),ve=Dn(()=>Ve(N),[N]);if(ae.earlyReturn)return ae.earlyReturn;let be={chartType:"swimlane",...null!=r&&{data:oe},oAccessor:s,rAccessor:c,stackBy:l,projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:me,size:[G,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ye,barPadding:re,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:!1===j?void 0:ee,rLabel:te,rFormat:d,...W&&{rTickValues:W},...null!=D&&{tickLabelEdgeAlign:D},...O&&{oFormat:O},...void 0!==j&&{showCategoryTicks:j},showGrid:Y,...fe,...ft({title:K,description:Z,summary:J,accessibleTable:U,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...vt({tooltip:f,defaultTooltipContent:ge}),...yt({linkedHover:A,selection:k,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...y&&y.length>0&&{annotations:y},...ve&&{gradientFill:ve},...null!=E&&{trackFill:E},...null!=z&&{roundedTop:z},...V&&{rExtent:V},...ne.brushStreamProps,...Object.fromEntries(Object.entries(w).filter(([e])=>"pieceStyle"!==e))};return pe?/* @__PURE__ */En(ko,{componentName:"SwimlaneChart",message:pe,width:G,height:q}):/* @__PURE__ */En(So,{componentName:"SwimlaneChart",width:G,height:q,children:/* @__PURE__ */En(qr,{ref:i,...be})})});zn.displayName="SwimlaneChart";import{forwardRef as Vn,useMemo as Gn}from"react";import{jsx as qn}from"react/jsx-runtime";var Xn=Vn(function(e,t){let{data:o,layout:i,layoutConfig:r,onLayoutError:a,categoryAccessor:n="category",valueAccessor:s="value",oExtent:l,rExtent:c,projection:h="vertical",margin:d,className:u,colorBy:m,colorScheme:g,tooltip:p,showAxes:f=!1,annotations:y,onObservation:v,onClick:b,selection:x,linkedHover:w,chartId:k,loading:A,loadingContent:S,emptyContent:R,frameProps:P={}}=e,{frameRef:C,resolved:_,safeData:L,setup:M,earlyReturn:I}=_e({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"OrdinalCustomChart",unwrapData:!0,data:o,colorBy:m,colorScheme:g,frameLegend:P,selection:x,linkedHover:w,onObservation:v,onClick:b,chartId:k,loading:A,loadingContent:S,emptyContent:R,margin:d,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),T=M.effectiveSelectionHook,H=Gn(()=>T?.isActive?{isActive:!0,predicate:T.predicate}:null,[T?.isActive,T?.predicate]),B=Gn(()=>fo(p),[p]);if(I)return I;let{width:F,height:$,enableHover:O,showGrid:W,title:D,description:j,summary:N,accessibleTable:E}=_,z={chartType:"custom",...null!=o&&{data:L},customLayout:i,layoutConfig:r,onLayoutError:a,...H&&{layoutSelection:H},oAccessor:n,rAccessor:s,oExtent:l,rExtent:c,projection:h,colorAccessor:m,colorScheme:g,size:[F,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:M.margin,enableHover:O,showAxes:f,showGrid:W,annotations:y,...ft({title:D,description:j,summary:N,accessibleTable:E,className:u,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===p?{tooltipContent:()=>null}:B?{tooltipContent:B}:{},...M.legendBehaviorProps,...yt({linkedHover:w,selection:x,onObservation:v,onClick:b,hoverHighlight:!1,mobileInteraction:M.mobileInteraction,customHoverBehavior:M.customHoverBehavior,customClickBehavior:M.customClickBehavior}),...P};/* @__PURE__ */
|
|
116
|
+
return qn(So,{componentName:"OrdinalCustomChart",width:F,height:$,children:/* @__PURE__ */qn(qr,{ref:C,...z})})});Xn.displayName="OrdinalCustomChart";export{qr as a,oa as b,sa as c,Aa as d,_a as e,Fa as f,Ea as g,Xa as h,Ja as i,rn as j,cn as k,gn as l,kn as m,Cn as n,Hn as o,Wn as p,zn as q,Xn as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,a,o){let n=t.uncertaintyOpacity,r=t.confidenceAccessor;if(!n&&!r)return;let l="object"==typeof n?n:{},i=l.min??.15,s=l.max??1;if(r){let t="function"==typeof r?r:e=>e[r];for(let a of e){let e=t(a);null!=e&&Number.isFinite(e)&&(a[m]=i+Math.max(0,Math.min(1,e))*(s-i))}return}let f=e.map(e=>{let t=a(e),n=o(e);return null!=t&&null!=n&&Number.isFinite(t)&&Number.isFinite(n)?Math.abs(t-n):NaN}),p=f.filter(e=>Number.isFinite(e));if(0===p.length)return;let[c,u]=h(p),y=u-c;e.forEach((e,t)=>{let a=f[t];Number.isFinite(a)&&(e[m]=s-(y>0?(a-c)/y:0)*(s-i))})}function t(e,t){return"function"==typeof t?t(e):!!e[t]}function a(e){return[{type:"anomaly-band",threshold:e.threshold??2,showBand:!1!==e.showBand,fill:e.bandColor||"#6366f1",fillOpacity:e.bandOpacity??.1,anomalyColor:e.anomalyColor||"#ef4444",anomalyRadius:e.anomalyRadius??6,label:e.label}]}function o(a,o,n,r,l){let{isTraining:i,isForecast:s,isAnomaly:f,upperBounds:p,lowerBounds:c,color:u="#6366f1",bandOpacity:h=.15,anomalyColor:y="#ef4444",anomalyRadius:m=6,label:b}=r,g=a.map(e=>{let a="observed";return s&&t(e,s)?a="forecast":i&&t(e,i)&&(a="training"),{...e,[d]:a}}),_=r._groupBy,O=[];if(_){let e=/* @__PURE__ */new Map;for(let t of g){let a=t[_]??"__default";e.has(a)||e.set(a,[]),e.get(a).push(t)}let t=[];for(let[,a]of e)for(let e=0;a.length-1>e;e++)a[e][d]!==a[e+1][d]&&(t.push({...a[e+1],[d]:a[e][d]}),t.push({...a[e],[d]:a[e+1][d]}));O.push(...g,...t)}else for(let e=0;g.length>e;e++)O.push(g[e]),g.length-1>e&&g[e][d]!==g[e+1][d]&&(O.push({...g[e+1],[d]:g[e][d]}),O.push({...g[e],[d]:g[e+1][d]}));if(r.trainUnderline){let e=[];for(let t of O)"training"===t[d]&&e.push({...t,[d]:"training-base"});O.unshift(...e)}let k=[];if(p&&c){let e="string"==typeof p?p:"__envUpper",t="string"==typeof c?c:"__envLower";if("function"==typeof p||"function"==typeof c)for(let a of O)"function"==typeof p&&(a[e]=p(a)),"function"==typeof c&&(a[t]=c(a));k.push({type:"envelope",upperAccessor:e,lowerAccessor:t,fill:u,fillOpacity:h,label:b})}if(r.uncertaintyOpacity||r.confidenceAccessor){let t=p?"function"==typeof p?p:e=>e[p]:()=>{},a=c?"function"==typeof c?c:e=>e[c]:()=>{};e(O.filter(e=>"forecast"===e[d]),r,t,a)}if(f){let e=r.anomalyStyle,a={type:"highlight",filter:e=>t(e,f)};e?(a.style=e,a.r=m):"function"==typeof y?(a.style=e=>{let t=y(e);return{stroke:t,strokeWidth:1.5,fill:t,fillOpacity:.7}},a.r=m):(a.color=y,a.r=m,a.style={stroke:y,strokeWidth:1.5,fill:y,fillOpacity:.7}),k.push(a)}return l&&k.push({type:"anomaly-band",threshold:l.threshold??2,showBand:!1!==l.showBand,fill:l.bandColor||"#6366f1",fillOpacity:l.bandOpacity??.1,anomalyColor:l.anomalyColor||"#ef4444",anomalyRadius:l.anomalyRadius??6,label:l.label}),{processedData:O,annotations:k}}function n(t,a,o,n,r){let{trainEnd:l,steps:i=10,confidence:s=.95,color:f="#6366f1",bandOpacity:h=.15,label:m}=n;if(null==l)return{processedData:t,annotations:[]};let b=[],g=[];for(let e of t)e[a]>l?g.push({...e,[d]:"observed"}):b.push({...e,[d]:"training"});let _=b.map(e=>[e[a],e[o]]).filter(e=>null!=e[0]&&null!=e[1]&&isFinite(e[0])&&isFinite(e[1])).sort((e,t)=>e[0]-t[0]),O=[],k=[];if(_.length>=3){let r=_.length,l=p(_);if(l){let{se:p,meanX:b,ssX:g}=c(_,l),F=u(s),w=t.map(e=>e[a]).filter(e=>null!=e&&isFinite(e)),C=y(w),B=_.length>1?(_[r-1][0]-_[0][0])/(r-1):1;for(let e=1;i>=e;e++){let t=C+e*B,n=l(t),i=p*Math.sqrt(1+1/r+(g>0?(t-b)**2/g:0))*F;k.push({[a]:t,[o]:n,[d]:"forecast",__forecastUpper:n+i,__forecastLower:n-i})}e(k,n,e=>e.__forecastUpper,e=>e.__forecastLower),O.push({type:"envelope",upperAccessor:"__forecastUpper",lowerAccessor:"__forecastLower",fill:f,fillOpacity:h,label:m})}}O.push({type:"x-threshold",x:l,color:"#94a3b8",strokeWidth:1,strokeDasharray:"4,2",label:"Train / Forecast"}),r&&O.push({type:"anomaly-band",threshold:r.threshold??2,showBand:!1!==r.showBand,fill:r.bandColor||"#6366f1",fillOpacity:r.bandOpacity??.1,anomalyColor:r.anomalyColor||"#ef4444",anomalyRadius:r.anomalyRadius??6,label:r.label});let F=[];if(F.push(...b),b.length>0&&g.length>0&&F.push({...b[b.length-1],[d]:"observed"}),F.push(...g),k.length>0){let e=g.length>0?g[g.length-1]:b[b.length-1];e&&F.push({...e,[d]:"forecast"}),F.push(...k)}return{processedData:F,annotations:O}}function r(e){return!!(e.isTraining||e.isForecast||e.isAnomaly||e.upperBounds||e.lowerBounds)}function l(e,t,a,l,i){return r(l)?o(e,0,0,l,i):n(e,t,a,l,i)}function i(e,t){let a=t.trainDasharray??"8,4",o=t.forecastDasharray??"4,4",n=t.color||"#6366f1",r=t.trainOpacity,l=t.forecastOpacity,i=t.trainStroke,p=t.trainLinecap,c=t.trainUnderline;return t=>{let u=e(t),h=t[d];if("training"===h){let e=u.stroke;return"darken"===i?e=s(u.stroke||"#666",.5):i&&(e=i),{...u,stroke:e,strokeDasharray:a,...p&&{strokeLinecap:p},...null!=r&&{strokeOpacity:r}}}if("training-base"===h){let e=u.stroke||"#666";return"lighten"===c&&(e=f(e,.4)),{...u,stroke:e,strokeDasharray:void 0}}if("forecast"===h){let e=t[m]??l;return{...u,stroke:n,strokeDasharray:o,...null!=e&&{strokeOpacity:e}}}return u}}import{a as s,b as f}from"./c-YRJ3BJQZ.min.js";import{c as p,d as c,e as u}from"./c-JXVYIXTV.min.js";import{a as h,c as y}from"./c-3PFVJFBK.min.js";var d="__forecastSegment",m="__forecastOpacity";export{m as FORECAST_OPACITY_FIELD,d as SEGMENT_FIELD,a as buildAnomalyAnnotations,l as buildForecast,i as createSegmentLineStyle,s as darkenColor,f as lightenColor,e as stampForecastOpacity};
|