semiotic 3.10.1 → 3.10.3
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 +64 -63
- package/ai/artifact-surface-inventory.json +4 -1
- package/ai/behaviorContracts.cjs +1 -1
- package/ai/dist/mcp-server.js +25 -24
- package/ai/examples.md +28 -0
- package/ai/reference.md +9 -4
- package/ai/schema.json +121 -5
- package/ai/surface-manifest.json +3 -2
- package/ai/system-prompt.md +1 -1
- 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-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-43XNOQNQ.min.js +391 -0
- package/dist/c-4JKDJUYD.min.js +1 -0
- package/dist/c-4LKK5YWB.min.js +1 -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-5PIKBUMF.min.js +1 -0
- package/dist/c-6IVBV5NO.min.js +1 -0
- package/dist/c-7APWCEPL.min.js +1 -0
- package/dist/{c-ORLEBW72.min.js → c-7FKPPCGN.min.js} +1 -1
- package/dist/c-ABMGCCLT.min.js +1 -0
- package/dist/c-AINGQGUN.min.js +1 -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-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-CO4NDAD6.min.js +51 -0
- package/dist/c-ECHBKW7U.min.js +1 -0
- package/dist/c-EPJWM2UT.min.js +1 -0
- package/dist/c-FD2BXSRG.min.js +1 -0
- package/dist/c-FHNY57SO.min.js +209 -0
- package/dist/c-FMCUQ6JX.min.js +1 -0
- package/dist/c-FOTTQHOO.min.js +1 -0
- package/dist/c-FU7A5KSY.min.js +1 -0
- package/dist/c-GHN6IR4Y.min.js +1 -0
- package/dist/{c-J6DVC236.min.js → c-GK263BF4.min.js} +1 -1
- 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-HNHKIMIV.min.js +61 -0
- package/dist/{c-D6HAAPTX.min.js → c-IBRLFKWA.min.js} +1 -1
- package/dist/c-IIV73MUW.min.js +1 -0
- package/dist/c-IJCZGUG6.min.js +31 -0
- package/dist/c-ISA6IJ6V.min.js +41 -0
- package/dist/c-JC76YAHB.min.js +33 -0
- package/dist/c-JJKRER47.min.js +1 -0
- package/dist/c-JO6AYCU4.min.js +1 -0
- package/dist/c-JOPGDP6N.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-KXH7LFIL.min.js +26 -0
- package/dist/c-M43PK7K4.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-PITYSOPK.min.js +1 -0
- package/dist/c-QPO24R7Q.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-SAP5KY6R.min.js +9 -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-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-UMGHCBH5.min.js +114 -0
- 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-VEMCBQZZ.min.js +100 -0
- package/dist/{c-P65V6HLO.min.js → c-VN557BQE.min.js} +1 -1
- package/dist/c-WD2RL76M.min.js +116 -0
- package/dist/c-Y342FJ6K.min.js +1 -0
- package/dist/c-YL7HJL5J.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/c-Z6GRGS53.min.js +1 -0
- package/dist/c-ZVOFLE2P.min.js +46 -0
- package/dist/components/CategoryColors.d.ts +7 -0
- package/dist/components/LinkedCharts.d.ts +2 -1
- 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/directLabels.d.ts +12 -0
- package/dist/components/charts/shared/knownChartComponents.d.ts +4 -1
- package/dist/components/charts/shared/lineSeriesSsr.d.ts +0 -12
- package/dist/components/charts/shared/useChartSetup.d.ts +3 -1
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -1
- 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/data/transforms.d.ts +1 -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/flowCircuitChartProps.d.ts +1 -1
- 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-realtime-core.d.ts +6 -2
- 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 +5 -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/SceneGraph.d.ts +3 -3
- package/dist/components/stream/StalenessBadge.d.ts +5 -2
- 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/streamEncodingTypes.d.ts +9 -0
- package/dist/components/stream/types.d.ts +25 -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/physicsWorker.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.min.js +2 -1
- package/dist/semiotic-atlas-core.module.min.js +1 -1
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-atlas.module.min.js +11 -1
- package/dist/semiotic-client-cjs-shared.min.js +1530 -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.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 +8 -7
- package/dist/c-2N7IU2NY.min.js +0 -1
- package/dist/c-2RL2QPZJ.min.js +0 -1
- package/dist/c-2WK7YJLL.min.js +0 -1
- package/dist/c-45CQWZZ6.min.js +0 -1
- package/dist/c-4BRHKVKV.min.js +0 -1
- package/dist/c-7242NXSG.min.js +0 -1
- package/dist/c-7DVPSB5C.min.js +0 -1
- package/dist/c-7EGHJU2F.min.js +0 -1
- package/dist/c-A7OGOFSL.min.js +0 -1
- package/dist/c-AFBSWT77.min.js +0 -1
- package/dist/c-AH5HWZWS.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-B7GW7IHJ.min.js +0 -1
- package/dist/c-BNFJMDHN.min.js +0 -1
- package/dist/c-BOHCQILI.min.js +0 -1
- package/dist/c-C3TZLTZK.min.js +0 -1
- package/dist/c-CGQAQWBV.min.js +0 -1
- package/dist/c-CPV4N35K.min.js +0 -1
- package/dist/c-DIPEYUOW.min.js +0 -1
- package/dist/c-E4JDJH4I.min.js +0 -1
- package/dist/c-E72OTUZU.min.js +0 -1
- package/dist/c-E7I2L7CU.min.js +0 -1
- package/dist/c-ELDWAO2V.min.js +0 -1
- package/dist/c-EUBTECGM.min.js +0 -1
- package/dist/c-EUMPMDCS.min.js +0 -1
- package/dist/c-EZZT2WAE.min.js +0 -1
- package/dist/c-FHBVFCQB.min.js +0 -1
- package/dist/c-G4HCO2IQ.min.js +0 -1
- package/dist/c-G5VIJEOK.min.js +0 -1
- package/dist/c-GHVOXAYH.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-HP4ZFM47.min.js +0 -1
- package/dist/c-HPOYKCCG.min.js +0 -1
- package/dist/c-HYDTS5OP.min.js +0 -1
- package/dist/c-I4QJ6YLM.min.js +0 -1
- package/dist/c-IK33LNZ6.min.js +0 -1
- package/dist/c-IK3PZHRY.min.js +0 -1
- package/dist/c-JIMJF6F6.min.js +0 -1
- package/dist/c-JUKIWTBJ.min.js +0 -1
- package/dist/c-KKPMHAZC.min.js +0 -1
- package/dist/c-L6WNDBHV.min.js +0 -1
- package/dist/c-LDEX5OFW.min.js +0 -1
- package/dist/c-LESEUVC5.min.js +0 -1
- package/dist/c-LYQMZMZQ.min.js +0 -1
- package/dist/c-MB6CV5NC.min.js +0 -1
- package/dist/c-MOKJOIPE.min.js +0 -1
- package/dist/c-N3FXLRNT.min.js +0 -1
- package/dist/c-N5NPTJVJ.min.js +0 -1
- package/dist/c-NHBL4J67.min.js +0 -1
- package/dist/c-ODG6TFSY.min.js +0 -1
- package/dist/c-PRIKOLTE.min.js +0 -1
- package/dist/c-PSKKFZNP.min.js +0 -1
- package/dist/c-PSNI6KAZ.min.js +0 -1
- package/dist/c-QAVFOEUY.min.js +0 -1
- package/dist/c-R2P4RR7Q.min.js +0 -1
- package/dist/c-RFC7UAG7.min.js +0 -1
- package/dist/c-S3AZX5PP.min.js +0 -1
- package/dist/c-SGAURYHG.min.js +0 -1
- package/dist/c-SJMWU6UX.min.js +0 -1
- package/dist/c-STIIGQOD.min.js +0 -1
- package/dist/c-T2ASIJVZ.min.js +0 -1
- package/dist/c-T2V7O2LO.min.js +0 -1
- package/dist/c-TKG2NP7G.min.js +0 -1
- package/dist/c-TX3THUTO.min.js +0 -1
- package/dist/c-TX7XJM3Z.min.js +0 -1
- package/dist/c-UC7SIU2W.min.js +0 -1
- package/dist/c-UMXSJIOV.min.js +0 -1
- package/dist/c-VRSXMLYF.min.js +0 -1
- package/dist/c-VSLWSAN2.min.js +0 -1
- package/dist/c-VXLOLYTO.min.js +0 -1
- package/dist/c-W4ZUKSEQ.min.js +0 -1
- package/dist/c-WCBRPILW.min.js +0 -1
- package/dist/c-WGHT7OCY.min.js +0 -1
- package/dist/c-WWCW3APR.min.js +0 -1
- package/dist/c-XSB27XPS.min.js +0 -1
- package/dist/c-Y6PYUMFU.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-ZIVPFTOC.min.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let t=L(e=>e.theme.colors.selectionOpacity);return C(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}function t(t){let{data:r,rawData:n,colorBy:L,colorScheme:C,legendInteraction:S,legendPosition:M,selection:F,linkedHover:B,fallbackFields:A,unwrapData:D=!1,onObservation:P,chartType:w,chartId:I,showLegend:R,legend:O,legendLayout:T,frameLegend:x,userMargin:j,marginDefaults:N,onClick:_,hoverHighlight:J,mobileInteraction:Y,mobileSemantics:G,loading:K,loadingContent:U,emptyContent:V,width:W,height:q,hasTitle:z,axisChrome:E}=t,Q=void 0===n,X=H(()=>g(r),[r]),[Z,$]=k([]),ee=b(e=>{$(t=>t.length===e.length&&t.every((t,r)=>t===e[r])?t:e)},[]),te="string"==typeof L?L:void 0,re=H(()=>m(Y,{width:W,mobileSemantics:G}),[Y,W,G]),{activeSelectionHook:ne,hoverSelectionHook:oe,customHoverBehavior:ae,customClickBehavior:le,crosshairSourceId:ie}=s({selection:F,linkedHover:B,fallbackFields:A,unwrapData:D,onObservation:P,chartType:w,chartId:I,onClick:_,hoverHighlight:J,colorByField:te,mobileInteraction:re}),ue=c(B,ie),se=u(X,L,C),ce=H(()=>o(X,L),[X,L]),ge=H(()=>Q&&Z.length>0?Z:ce,[Q,Z,ce]),de=l(S,L,ge),he=H(()=>oe||(de.legendSelectionHook?de.legendSelectionHook:ne),[oe,de.legendSelectionHook,ne]),ye=e(F),me=i(),pe=y(null!=C),fe=H(()=>{if(se&&(!Q||0===ge.length))return se;if(!L||0===ge.length)return;let e=Array.isArray(C)&&C.length>0||"string"==typeof C&&C.length>0?C:me&&me.length>0?me:p,t="__streamCat",r=ge.map(e=>({[t]:e})),n=v(r,t,e);return e=>(pe?f(pe,e):void 0)??(C&&"object"==typeof C&&!Array.isArray(C)?f(C,e):void 0)??n(e)??"#999"},[se,Q,L,ge,C,me,pe]),{legend:ve,margin:Le,legendPosition:Ce,legendLayout:be,legendMarginReserved:He}=a({data:X,colorBy:L,colorScale:fe,showLegend:R,legendPosition:M,userMargin:j,defaults:N,categories:ge,additionalLegend:O,chartWidth:W,chartHeight:q,legendLayout:T,frameLegend:x,hasTitle:z,axisChrome:E}),ke=H(()=>{let e={};return ve&&(e.legend=ve,e.legendPosition=Ce,He&&(e.__legendMarginReservedFor=ve),be&&(e.legendLayout=be)),S&&"none"!==S&&(e.legendHoverBehavior=de.onLegendHover,e.legendClickBehavior=de.onLegendClick,e.legendHighlightedCategory=de.highlightedCategory,e.legendIsolatedCategories=de.isolatedCategories),Q&&L&&(e.legendCategoryAccessor=L,e.onCategoriesChange=ee),e},[ve,Ce,be,He,S,de.onLegendHover,de.onLegendClick,de.highlightedCategory,de.isolatedCategories,Q,L,ee]),Se=Array.isArray(n)?g(n):n,Me=h(K,W,q,U),Fe=Me?null:d(Se,W,q,V);return{data:X,colorScale:fe,categoryColorScale:fe,allCategories:ge,legendState:de,effectiveSelectionHook:he,activeSelectionHook:ne,customHoverBehavior:ae,customClickBehavior:le,mobileInteraction:re,legend:ve,margin:Le,legendPosition:Ce,earlyReturn:Me||Fe||null,legendBehaviorProps:ke,crosshairProps:ue,resolvedSelection:ye}}function r(e,t){let{variant:r,frameRef:o,overrides:a}=t,l=M(a);l.current=a,S(e,()=>{let e=n(r,o);return new Proxy(e,{get(e,t,r){if("string"==typeof t){let e=l.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,r)},has:(e,t)=>!("string"!=typeof t||!l.current||!(t in l.current))||Reflect.has(e,t)})},[])}function n(e,t){if("xy"===e){let e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,r)=>e.current?.update(t,r)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){let e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{let r=Array.isArray(t)?t:[t],n=e.current?.getTopology()?.nodes??[],o=[];for(let t of r){let r=n.find(e=>e.id===t);r&&o.push({...r.data??{},id:t}),e.current?.removeNode(t)}return o},update:(t,r)=>(Array.isArray(t)?t:[t]).flatMap(t=>{let n=e.current?.updateNode(t,r);return n?[{...n,id:t}]:[]}),clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){let e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,r)=>{let n=e.current?.removePoint(t)??[];for(let t of n)e.current?.push(r(t));return n},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}let r=t;return{push:e=>r.current?.pushLine(e),pushMany:e=>r.current?.pushManyLines(e),remove:e=>r.current?.removeLine(e)??[],update:(e,t)=>{let n=r.current?.removeLine(e)??[];for(let e of n)r.current?.pushLine(t(e));return n},clear:()=>r.current?.clear(),getData:()=>r.current?.getLines()??[],getCustomLayout:()=>r.current?.getCustomLayout?.()??null,getLayoutFailure:()=>r.current?.getLayoutFailure?.()??null}}import{Bb as o,Cb as a,Db as l,Fb as i,Jb as u,Lb as s,Mb as c,b as g,bb as d,cb as h,eb as y,sb as m}from"./c-UMGHCBH5.min.js";import{p,s as f,t as v}from"./c-Y342FJ6K.min.js";import{h as L}from"./c-5NYONM6V.min.js";import{useMemo as C}from"react";import{useCallback as b,useMemo as H,useState as k}from"react";import{useImperativeHandle as S,useRef as M}from"react";export{e as a,t as b,r as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){if(null==t)return()=>{};let e="function"==typeof t?t:e=>e[t];return t=>n(e(t))}function e(e,i){let n=t(e),r=t(i);return(t,e)=>{let i=r(t);return{value:i,x:n(t),y:i,category:e}}}function i(e,i){let n=t(i??"value"),r=null==e?void 0:"function"==typeof e?e:t=>t[e];return t=>{let e=r?r(t):void 0;return{value:n(t),category:null==e?void 0:e+""}}}function n(t){if("number"==typeof t)return Number.isFinite(t)?t:void 0;if("string"==typeof t&&""!==t.trim()){let e=Number(t);return Number.isFinite(e)?e:void 0}}function r(t,e,i){let r=null!=t.axis?i[t.axis]:null!=t.field?e[t.field]:i.value;if(void 0!==t.eq&&r!==t.eq||void 0!==t.ne&&r===t.ne||void 0!==t.in&&!t.in.includes(r))return!1;if(void 0===t.gt&&void 0===t.gte&&void 0===t.lt&&void 0===t.lte&&void 0===t.within&&void 0===t.outside)return!0;let u=n(r);if(void 0===u||void 0!==t.gt&&t.gt>=u||void 0!==t.gte&&t.gte>u||void 0!==t.lt&&u>=t.lt||void 0!==t.lte&&u>t.lte)return!1;if(void 0!==t.within){let[e,i]=t.within;if(e>u||u>i)return!1}if(void 0!==t.outside){let[e,i]=t.outside;if(u>=e&&i>=u)return!1}return!0}function u(t,e,i){let n=t.when;return void 0===n||!0===n||!1!==n&&("function"==typeof n?n(e,i):r(n,e,i))}function o(t,e,i){if(!e||0===e.length)return{};let n={};for(let r of e){if(!u(r,t,i))continue;let e="function"==typeof r.style?r.style(t,i):r.style;e&&(n={...n,...e})}return n}function l(t,e,i,n=t=>t){let r=t??(()=>({}));return e&&0!==e.length?(t,u)=>{let l=n(t),f={...r(t,u)};return Object.assign(f,o(l,e,i(l,u))),f}:r}function f(t,e,n,r){if(!t||0===t.length)return r;let u=i(e,n);return(e,i)=>{let n=e&&e.data||e,l=o(n,t,u(n)),f=r?r(e,i):void 0;return f?{...l,...f}:l}}export{t as a,e as b,i as c,u as d,o as e,l as f,f as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){let e=t.roles.occurrence;return"string"==typeof e?[e]:t.entityIds}function e(e,o={}){let n=new Set(o.templates??["repeated-state-episode"]),i=e.filter(t=>n.has(t.template)).map(e=>({id:"capsule:"+e.id,matchId:e.id,template:e.template,entryState:"string"==typeof e.roles.state?e.roles.state:e.nodePath[0],exitState:e.nodePath[e.nodePath.length-1],entityCount:e.entityCount,occurrenceIds:t(e),selected:!1})).sort((t,e)=>e.entityCount!==t.entityCount?e.entityCount-t.entityCount:t.id.localeCompare(e.id)),s=/* @__PURE__ */new Set;for(let t of i)if(!t.occurrenceIds.some(t=>s.has(t))){t.selected=!0;for(let e of t.occurrenceIds)s.add(e)}return i}function o(t,e={}){let o=e.templates??["repeated-state-episode"],n="ordinal"===t.spec.coordinate.kind?t.spec.coordinate.sectionIds:[],i=void 0!==e.partition?u(t,e.partition)??0:t.spec.comparison?t.comparison?.rows.reduce((t,e)=>t+e.assigned,0)??0:t.ledger.entries.find(e=>"global"===e.subjectKind&&e.measureId===t.spec.motifs.denominatorRef)?.value??0,s=o=>a(o,t.source.occurrences,e.partition??t.spec.comparison?.partitions),r=[],d=t.motifs.incompleteCandidates.length>0;for(let a of o)for(let o of n){let n=t.motifs.matches.filter(t=>t.template===a),p=s(n.filter(t=>t.completionSectionId===o)),u=s(n.filter(t=>t.intersectSectionIds.includes(o)));r.push({template:a,sectionId:o,partition:e.partition,completionCount:p,intersectionCount:u,denominator:i,status:d?"incomplete":"exact"})}return{templates:o,sections:n,cells:r}}function n(t){return t.entityCount??1}function i(t){if(!t.missingPrehistory)return{id:"group:"+t.id,occurrenceId:t.id,partition:t.partition,nodePath:t.nodePath,entityCount:n(t),...t.stepEntityCounts&&{stepEntityCounts:[...t.stepEntityCounts]},signature:d(t.nodePath,t.nodePath.length-1)}}function s(t){let n=t.prefixForest;if(!n)return{atlas:t,groups:[],signatureOrder:[],ribbons:[],capsules:[],profile:o(t),differences:[],prefixForest:{kind:"observed-prefix",rootIds:[],nodes:[],order:[]},sceneSeeds:{nodes:[],edges:[]}};let s=(t.source.occurrences??[]).map(i).filter(t=>!!t),r=/* @__PURE__ */new Map;for(let t of s){let e=n.order.indexOf(t.signature),o=r.get(t.signature),i=-1===e?n.order.length:e;(null==o||o>i)&&r.set(t.signature,i)}let a=[...new Set(s.map(t=>t.signature))].sort((t,e)=>{let o=(r.get(t)??0)-(r.get(e)??0);return 0!==o?o:t.localeCompare(e)}),u=[];for(let t of s)for(let e=0;t.nodePath.length-1>e;e++){let o=d(t.nodePath,e),n=d(t.nodePath,e+1);u.push({id:`ribbon:${t.id}:${e}`,groupId:t.id,partition:t.partition,fromPrefixId:o,toPrefixId:n,fromState:t.nodePath[e],toState:t.nodePath[e+1],entityCount:t.stepEntityCounts?.[e]??t.entityCount,...t.stepEntityCounts&&{toEntityCount:t.stepEntityCounts[e+1]}})}let l=e(t.motifs.matches),f=t.comparison??p(t),m=[];if(f&&f.partitions.length>=2){let t=f.rows[0],e=f.rows[1],o=Math.min(t.assigned,e.assigned)||t.assigned,n=t.motifUsers["repeated-state-episode"]??0,i=e.motifUsers["repeated-state-episode"]??0;m.push({motif:"repeated-state-episode",leftPartition:t.partition,rightPartition:e.partition,leftCount:n,rightCount:i,deltaCount:i-n,deltaBps:c(n,i,o),denominator:o}),m.push({motif:"purchases",leftPartition:t.partition,rightPartition:e.partition,leftCount:t.outcomes.purchases??0,rightCount:e.outcomes.purchases??0,deltaCount:(e.outcomes.purchases??0)-(t.outcomes.purchases??0),deltaBps:c(t.outcomes.purchases??0,e.outcomes.purchases??0,o),denominator:o})}let h={nodes:s.map(t=>({id:t.id,partition:t.partition,signature:t.signature})),edges:u.map(t=>({id:t.id,source:t.fromPrefixId,target:t.toPrefixId}))};return{atlas:t,groups:s,signatureOrder:a,ribbons:u,capsules:l,profile:o(t),differences:m,prefixForest:n,sceneSeeds:h}}function r(t,e){return t.groups.some(t=>l(t.nodePath,e))}import{a,d,g as p,h as u,i as c,j as l}from"./c-TR7OHUAO.min.js";export{o as a,s as b,r as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let r=e.trim(),i=/^(\d{4})-(\d{2})-(\d{2})/.exec(r);if(i){let e=Number(i[1]),r=Number(i[2]),t=Number(i[3]),n=new Date(Date.UTC(e,r,0)).getUTCDate();if(1>r||r>12||1>t||t>n)return NaN}return/^\d{4}-\d{2}-\d{2}$/.test(r)?Date.parse(r+"T00:00:00Z"):/(?:z|[+-]\d{2}:\d{2})$/i.test(r)?Date.parse(r):NaN}function r(r){if(!r)return;let i=e(r);return Number.isFinite(i)?i:void 0}function i(e,i){let t=e.presentation?.label?.trim();if(!t||!c.test(t)||p.test(t)||m.test(t))return;let n=r(e.eventTime?.value);if(void 0===n)return;let o=[i,e.observedAt,e.ingestedAt,e.processedAt,e.publishedAt,e.snapshotAt].map(r).filter(e=>void 0!==e);return 0!==o.length&&n<Math.max(...o)?{id:"time.presentation.event-time-as-now",relation:"time",status:"fail",path:"time.presentation.label",message:"The presentation describes older event-time data as current wall-clock state.",repair:"State the exact event time or use bounded language such as ‘as of’ or ‘through’."}:void 0}function t(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function n(e){throw new TypeError("Invalid custom artifact policy: "+e)}function o(e){for(let r of Object.values(e))Object.freeze(r.rules),Object.freeze(r.requiredRelations),Object.freeze(r);return Object.freeze(e)}function s(e){return{...e,rules:{...e.rules},requiredRelations:[...e.requiredRelations]}}function a(e,r){return e.id===r.id&&e.version===r.version&&e.label===r.label&&e.description===r.description&&e.minimumStakes===r.minimumStakes&&v.every(i=>e.rules[i]===r.rules[i])&&e.requiredRelations.length===r.requiredRelations.length&&e.requiredRelations.every((e,i)=>e===r.requiredRelations[i])}function l(e){if(!t(e))return n("expected an object.");let r=Object.keys(e).filter(e=>!h.has(e));if(r.length>0)return n(`unexpected field${1===r.length?"":"s"}: ${r.join(", ")}.`);for(let r of["id","version","label","description"])if("string"!=typeof e[r]||!e[r].trim())return n(r+" must be a non-empty string.");let i=e.id,o=Object.prototype.hasOwnProperty.call(w,i)?w[i]:void 0;if(!o&&!Object.prototype.hasOwnProperty.call(e,"minimumStakes")||Object.prototype.hasOwnProperty.call(e,"minimumStakes")&&("string"!=typeof e.minimumStakes||!g.has(e.minimumStakes)))return n("minimumStakes is required and must be exploratory, informational, operational, or high.");if(!t(e.rules))return n("rules must be an object.");let l=new Set(v),u=Object.keys(e.rules).filter(e=>!l.has(e));if(u.length>0)return n(`unexpected rule${1===u.length?"":"s"}: ${u.join(", ")}.`);for(let r of v)if(!Object.prototype.hasOwnProperty.call(e.rules,r)||"boolean"!=typeof e.rules[r])return n(`rule "${r}" must be a boolean.`);if(!Array.isArray(e.requiredRelations)||0===e.requiredRelations.length)return n("requiredRelations must be a non-empty array of recognized relations.");let d=[];for(let r of e.requiredRelations){if("string"!=typeof r||!y.has(r))return n(`requiredRelations contains an unrecognized relation: ${r+""}.`);d.push(r)}if(new Set(d).size!==d.length)return n("requiredRelations must not contain duplicates.");let c={id:i,version:e.version,label:e.label,description:e.description,...void 0!==e.minimumStakes?{minimumStakes:e.minimumStakes}:{},rules:{...e.rules},requiredRelations:d};return o&&!a(c,o)?n(`built-in policy id "${c.id}" cannot be redefined; use a distinct id for an extension.`):o?s(o):c}function u(e){if(void 0===e)return s(w.exploratory);if("string"!=typeof e)return l(e);let r=Object.prototype.hasOwnProperty.call(w,e)?w[e]:void 0;if(!r)throw Error(`Unknown artifact policy "${e}".`);return s(r)}function d(r,i=[],t){let n={...r.rules},o=[],s=[],a=t?e(t):NaN;for(let t of i){let i=t.rule,l=Object.prototype.hasOwnProperty.call(n,i),u=[t.expiresAt,t.reviewAt],d=u.some(e=>void 0!==e&&("string"!=typeof e||0===e.trim().length)),c=u.filter(e=>"string"==typeof e&&e.trim().length>0),p=c.map(e),m="string"==typeof t.rationale&&t.rationale.trim().length>0&&"string"==typeof t.owner&&t.owner.trim().length>0,f=Number.isFinite(a)&&!d&&c.length>0&&p.every(e=>Number.isFinite(e)&&e>a);r.rules.allowExceptions&&l&&!0===n[i]&&"allowExceptions"!==i&&"allowManualChecks"!==i&&m&&f?(n[i]=!1,o.push(t)):s.push(t)}return{rules:n,appliedExceptions:o,rejectedExceptions:s}}var c=/\b(?:now|current(?:ly)?|latest|live|real[ -]?time|up[ -]?to[ -]?date)\b/i,p=/\b(?:as of|through|up to(?!\s+date\b)|event time|observed (?:at|through)|data (?:from|through|as of))\b/i,m=/\b(?:not|isn['’]?t|is not|no longer|never)\b(?:\s+[a-z'-]+){0,3}\s+(?:now|current|latest|live|real[ -]?time|up[ -]?to[ -]?date)\b/i,f={requireClaims:!0,requireEvidenceIdentity:!1,requireReviewForModelClaims:!1,requireRenderEvidence:!1,requireSettledTime:!1,requireFreshnessForLive:!1,refuseUnsupportedClaims:!1,refuseUnknownClaims:!1,refuseCriticalAccessibilityFailures:!0,refuseChartErrors:!0,refuseUnknownTime:!1,allowManualChecks:!0,allowExceptions:!0},b=["claim-support","representation-fit","reception","time","abstention"],v=Object.keys(f),h=/* @__PURE__ */new Set(["id","version","label","description","minimumStakes","rules","requiredRelations"]),y=/* @__PURE__ */new Set(["claim-support","representation-fit","reception","time","challenge-and-correction","accountability","abstention","preservation"]),g=/* @__PURE__ */new Set(["exploratory","informational","operational","high"]),w=/* @__PURE__ */o({exploratory:{id:"exploratory",version:"0.1",label:"Exploratory",description:"Keeps uncertainty visible while allowing incomplete work to remain inspectable.",rules:{...f,requireClaims:!1,refuseCriticalAccessibilityFailures:!1,refuseChartErrors:!1},requiredRelations:["claim-support","representation-fit"]},"operational-streaming":{id:"operational-streaming",version:"0.1",label:"Operational streaming",description:"Blocks action when render proof, live freshness, completeness, evidence identity, or model review is unresolved.",minimumStakes:"operational",rules:{...f,requireEvidenceIdentity:!0,requireReviewForModelClaims:!0,requireRenderEvidence:!0,requireSettledTime:!0,requireFreshnessForLive:!0,refuseUnsupportedClaims:!0,refuseUnknownClaims:!0,refuseUnknownTime:!0},requiredRelations:[...b,"accountability","challenge-and-correction"]},editorial:{id:"editorial",version:"0.1",label:"Editorial",description:"Requires render proof, attributable evidence, settled publication language, and visible correction history.",minimumStakes:"informational",rules:{...f,requireEvidenceIdentity:!0,requireReviewForModelClaims:!0,requireRenderEvidence:!0,requireSettledTime:!0,refuseUnsupportedClaims:!0,refuseUnknownClaims:!0,refuseUnknownTime:!0},requiredRelations:[...b,"challenge-and-correction","accountability","preservation"]},"public-civic":{id:"public-civic",version:"0.1",label:"Public information",description:"Prioritizes render proof, accessible reception, source answerability, uncertainty, privacy, and correction paths.",minimumStakes:"informational",rules:{...f,requireEvidenceIdentity:!0,requireReviewForModelClaims:!0,requireRenderEvidence:!0,refuseUnsupportedClaims:!0,refuseUnknownClaims:!1,refuseUnknownTime:!1},requiredRelations:[...b,"challenge-and-correction","preservation"]},"agent-generated":{id:"agent-generated",version:"0.1",label:"Agent generated",description:"Requires render proof, independent evidence, explicit review state, safe grounding, and refusal when support is absent.",rules:{...f,requireEvidenceIdentity:!0,requireReviewForModelClaims:!0,requireRenderEvidence:!0,requireSettledTime:!0,refuseUnsupportedClaims:!0,refuseUnknownClaims:!0},requiredRelations:[...b,"accountability","preservation"]}});export{e as a,i as b,w as c,u as d,d as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,r,u){let o=n(e),i=n(r),f=n(u);return e=>{let n="string"==typeof e.agg&&"number"==typeof e.count&&"number"==typeof e.xCenter&&"number"==typeof e.yCenter;return{value:n?t(e.value):f(e),x:n?t(e.xCenter):o(e),y:n?t(e.yCenter):i(e)}}}function t(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}import{
|
|
1
|
+
function e(e,r,u){let o=n(e),i=n(r),f=n(u);return e=>{let n="string"==typeof e.agg&&"number"==typeof e.count&&"number"==typeof e.xCenter&&"number"==typeof e.yCenter;return{value:n?t(e.value):f(e),x:n?t(e.xCenter):o(e),y:n?t(e.yCenter):i(e)}}}function t(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}import{Ob as n}from"./c-UMGHCBH5.min.js";export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){return null==t?void 0:t+""}function e(e){let a=t(e.id);return{type:"point",x:e.x,y:e.y,r:e.r??8,style:{...u,cursor:e.cursor},datum:e.datum,pointId:a,_transitionKey:a}}function a(t){return e(t)}function r(t){let[[e,a],[r,i]]=t.bounds;return{type:"geoarea",pathData:t.pathData,centroid:t.centroid,bounds:t.bounds,screenArea:t.screenArea??Math.abs((r-e)*(i-a)),style:{...u,cursor:t.cursor},datum:t.datum,group:t.group,interactive:!0}}function i(e){return{type:"rect",x:e.x,y:e.y,w:e.width,h:e.height,style:{...u,cursor:e.cursor},datum:e.datum,group:e.group,_transitionKey:t(e.id)}}function c(e){let a=t(e.id);return"width"in e&&"height"in e?{type:"rect",x:e.x,y:e.y,w:e.width,h:e.height,style:{...u,cursor:e.cursor},datum:e.datum,id:a,label:e.label,accessibleDatum:e.accessibleDatum,accessibility:e.accessibility}:{type:"circle",cx:e.x,cy:e.y,r:e.r??8,style:{...u,cursor:e.cursor},datum:e.datum,id:a,label:e.label,accessibleDatum:e.accessibleDatum,accessibility:e.accessibility}}function s(e){let a={style:{...u,cursor:e.cursor},datum:e.datum,id:t(e.id),label:e.label,accessibleDatum:e.accessibleDatum,accessibility:e.accessibility,interactive:e.interactive??!0};return"pathD"in e?{type:e.type??"curved",pathD:e.pathD,...a}:{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,...a}}var u={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",opacity:0},n=8;export{n as a,e as b,a as c,r as d,i as e,c as f,s as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let t=/* @__PURE__ */new Map;return(i,r)=>{let s=JSON.stringify([i,r.family,r.version,r.size,r.weight]),n=t.get(s);if(n)return n;let a=e(i,r);return t.size>=512&&t.delete(t.keys().next().value),t.set(s,a),a}}var t=(e,t)=>({width:Array.from(e).length*t.size*.65,height:1.2*t.size,ascent:.9*t.size,source:"estimated"});export{t as a,e as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,e=h){if(t)return!0===t?e:"stops"in t?Array.isArray(t.stops)?t:void 0:"colorStops"in t?Array.isArray(t.colorStops)?{stops:t.colorStops.map(({offset:t,color:e})=>({offset:t,color:e}))}:void 0:{stops:[{offset:0,opacity:t.topOpacity??e.stops[0]?.opacity??.8},{offset:1,opacity:t.bottomOpacity??e.stops.at(-1)?.opacity??.05}]}}function e(e){return e?t(e):void 0}function o(t){if(t)return Array.isArray(t)?{stops:t.map(({at:t,color:e,opacity:o})=>({offset:t/100,color:e,...null!=o&&{opacity:o}}))}:Array.isArray(t.stops)?t:void 0}function s(t){let e=t?.stops.filter(t=>"string"==typeof t.color&&Number.isFinite(t.offset)).map(({offset:t,color:e,opacity:o})=>({offset:Math.max(0,Math.min(1,t)),color:e,...Number.isFinite(o)&&{opacity:Math.max(0,Math.min(1,o))}})).sort((t,e)=>t.offset-e.offset);if(!e?.length)return;let o=e[0];return o.offset>0?[{...o,offset:0},...e]:e}function a(t){return{stops:t.stops.map(t=>({...t,offset:1-t.offset})).sort((t,e)=>t.offset-e.offset)}}function r(t,e,o,s,a,r,i){let{topPath:l,rawValues:f,datum:n,pathIds:u}=c(t,e,o,s,void 0,i),p={type:"line",path:l,rawValues:f,style:a,datum:n,group:r};return u&&(p.pathIds=u),p}function i(t,e,o,s,a,r,i,l,f){return{type:"area",...c(t,e,o,s,l??(()=>a),f),style:r,group:i}}function l(t,e,o,s){let a=/* @__PURE__ */new Map;if("silhouette"===s)for(let s of t){let t=0;for(let a of e)t+=o(a,s)||0;a.set(s,-t/2)}else if("wiggle"===s){t.length>0&&a.set(t[0],0);for(let s=1;t.length>s;s++){let r=t[s-1],i=t[s],l=0,f=0,n=0;for(let t of e){let e=o(t,i)||0;l+=(2*n+e)*(e-(o(t,r)||0)),f+=e,n+=e}let u=a.get(r)??0;a.set(i,u-(f>0?l/(2*f):0))}if(t.length>0){let s=0;for(let r of t){let t=0;for(let s of e)t+=o(s,r)||0;s+=(a.get(r)??0)+t/2}let r=s/t.length;for(let e of t)a.set(e,(a.get(e)??0)-r)}}else for(let e of t)a.set(e,0);return a}function f(t,e,o){let s=0,a=0;for(let r of t){let t=0,i=0;for(let s of e){let e=o(s,r)||0;0>e?i+=e:t+=e}s>i&&(s=i),t>a&&(a=t)}return[s,a]}function n(t,e,o,s,a,r,i,f="zero",n){let u=/* @__PURE__ */new Set,p=/* @__PURE__ */new Map;for(let e of t){let t=/* @__PURE__ */new Map;for(let a of e.data){let e=o(a),r=s(a);if(!Number.isFinite(e)||(u.add(e),!Number.isFinite(r)))continue;let i=t.get(e);i?(i.value+=r,i.sources?i.sources.push(a):i.sources=[i.datum,a]):t.set(e,{value:r,datum:a})}p.set(e.key,t)}let m,y=Array.from(u).sort((t,e)=>t-e);if(r){m=/* @__PURE__ */new Map;for(let e of y){let o=0;for(let s of t)o+=p.get(s.key)?.get(e)?.value||0;m.set(e,o||1)}}let c=l(y,t.map(t=>t.key),(t,e)=>p.get(t)?.get(e)?.value||0,f),h="diverging"===f&&!r,d=[],v=/* @__PURE__ */new Map,b=/* @__PURE__ */new Map,w=/* @__PURE__ */new Map,F=/* @__PURE__ */new Map;for(let t of y)b.set(t,c.get(t)??0),w.set(t,0),F.set(t,0);for(let o of t){let t=p.get(o.key),s=/* @__PURE__ */new Map,l=[],f=[],u=[],c=[],N=[],M=n?[]:void 0,x=!1,k=()=>{if(0!==l.length){if(l.length>=2){let t=x?l.map((t,e)=>e).sort((t,e)=>l[t][0]-l[e][0]):void 0,e=t?t.map(t=>c[t]):c,s={type:"area",topPath:t?t.map(t=>l[t]):l,bottomPath:t?t.map(t=>f[t]):f,rawValues:t?t.map(t=>u[t]):u,style:a(o.key,g(o.data)),datum:e,accessibleDatum:t?t.map(t=>N[t]):N,group:o.key};M&&(s.pathIds=t?t.map(t=>M[t]):M),i&&(s.curve=i),d.push(s)}l=[],f=[],u=[],c=[],N=[],M=n?[]:void 0,x=!1}};for(let a of y){let i,n,p=t.get(a),y=void 0!==p,g=p?.value??0;if(r&&y&&(g/=m.get(a)),!y||!Number.isFinite(g)||0===g){k();continue}h?g>0?(i=w.get(a),n=i+g,w.set(a,n)):(i=F.get(a),n=i+g,F.set(a,n)):(i=b.get(a),n=i+g,b.set(a,n));let d=e.x(a),v=e.y(i),A=e.y(n);if(!Number.isFinite(d)||!Number.isFinite(v)||!Number.isFinite(A)){k();continue}let V=p.sources,_=p.value,I=V?{...V[0],__aggregateValue:_,__aggregateCount:V.length,__aggregateRows:V}:p.datum;l.length>0&&l[l.length-1][0]>d&&(x=!0),l.push([d,A]),f.push([d,v]),c.push(I),u.push(_),M&&M.push("x:"+a),N.push(V?{x:a,value:_,group:o.key,observations:V.length}:I),s.set(a,n)}k(),v.set(o.key,s)}return{nodes:d,stackedTops:v}}function u(t,e,o,s,a,r,i){let l=o(t),f=s(t);if(!Number.isFinite(l)||!Number.isFinite(f))return null;let n={type:"point",x:e.x(l),y:e.y(f),r:a,style:r,datum:t};return void 0!==i&&(n.pointId=i),n}function p(t,e,o,s,a,r,i,l){let f=o(t),n=s(t);if(!Number.isFinite(f)||!Number.isFinite(n))return null;let u={type:"symbol",x:e.x(f),y:e.y(n),size:a,symbolType:r,style:i,datum:t};return void 0!==l&&(u.pointId=l),u}function m(t,e,o,s,a,r,i){return{type:"rect",x:t,y:e,w:o,h:s,style:a,datum:r,group:i}}function y(t,e,o,s,a,r,i){let l={type:"heatcell",x:t,y:e,w:o,h:s,fill:a,datum:r};return void 0!==i?.value&&(l.value=i.value),i?.showValues&&(l.showValues=!0,i.valueFormat&&(l.valueFormat=i.valueFormat)),l}import{a as c}from"./c-NATWERHZ.min.js";import{d as g}from"./c-U6NLVFN4.min.js";var h={stops:[{offset:0,opacity:.8},{offset:1,opacity:.05}]};export{r as a,i as b,l as c,f as d,n as e,u as f,p as g,m as h,y as i,t as j,e as k,o as l,s as m,a as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){if("u">typeof DOMException)return new DOMException(e+" aborted","AbortError");let t=Error(e+" aborted");return t.name="AbortError",t}function t(e){let t=Error(e.message);return t.name=e.name??"Error",e.stack&&(t.stack=e.stack),t}function r(e){return e&&"object"==typeof e?{requestId:e.requestId,error:e.error}:{}}function s(e){let t=null;return{get:()=>((!t||t.isDead)&&(t=e()),t),resetForTest:()=>{if(t){try{t.terminate()}catch{}t=null}}}}var n=class{constructor(e){this.nextRequestId=1,this.pending=/* @__PURE__ */new Map,this.dead=!1,this.options=e,this.worker=e.createWorker(),this.worker.onmessage=e=>{let t=this.options.parseMessage(e.data),r=t.requestId,s=null!=r?this.pending.get(r):this.pending.values().next().value;if(s){if(null!=r)this.pending.delete(r);else{for(let e of this.pending.values())e!==s&&(e.cleanup(),e.reject(Error(this.options.name+" worker response missing requestId")));this.pending.clear()}if(s.cleanup(),!t.ok)return void s.reject(t.error);s.resolve(t.payload)}},this.worker.onerror=e=>{this.rejectAll(Error(e.message||this.options.name+" worker failed")),this.terminate()}}get isDead(){return this.dead}request(t,r){if(this.dead)return Promise.reject(Error(this.options.name+" worker session is closed"));if(r?.aborted)return Promise.reject(e(this.options.name));let s=this.nextRequestId;this.nextRequestId+=1;let n=this.options.encodeRequest?.(s,t)??{requestId:s,request:t};return new Promise((t,i)=>{let o=()=>{let t=1===this.pending.size;this.pending.delete(s),r?.removeEventListener("abort",o),i(e(this.options.name)),this.options.terminateOnAbort&&t&&this.terminate()},a=()=>r?.removeEventListener("abort",o);this.pending.set(s,{cleanup:a,reject:i,resolve:t}),r?.addEventListener("abort",o,{once:!0});try{this.worker.postMessage(n)}catch(e){this.pending.delete(s),a(),i(e instanceof Error?e:Error(e+""))}})}terminate(){this.dead||(this.dead=!0,this.rejectAll(Error(this.options.name+" worker terminated")),this.worker.terminate())}rejectAll(e){for(let t of this.pending.values())t.cleanup(),t.reject(e);this.pending.clear()}};export{t as a,r as b,n as c,s as d};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
function e(e){let[t,i]=Or.useState(()=>Ir);return Or.useEffect(()=>{if(t)return;let e=!1;return(Ir?Promise.resolve(Ir):(Nr||(Nr=import("./c-K37JAIWA.min.js").then(e=>Ir=e.XYBrushOverlay).catch(e=>{throw Nr=null,e})),Nr)).then(t=>{e||i(()=>t)}),()=>{e=!0}},[t]),t?/* @__PURE__ */Br(t,{...e}):null}function t(e){return[e[0],e[1]]}function i(e,i,r,s){let a,n=/* @__PURE__ */new Map;for(let t=0;i.length>t;t++)n.set(i[t],e[t]);for(let e of s){let t=n.get(e);if(t){a=t;break}}let o,l=Array(r.length),c=Array(r.length);for(let e=0;r.length>e;e++){c[e]=t(r[e]);let i=n.get(s[e]);i?(l[e]=t(i),o=i):l[e]=t(o??a??r[e])}return{prev:l,target:c}}function r(e,t,i){if(Array.isArray(t)&&t.length===i&&0!==i){if(e.getPointId){let i=t.map(t=>e.getPointId(t)+"");if(i.every(e=>e.length>0))return i}if("streaming"===e.runtimeMode){let i=t.map(t=>"x:"+e.getX(t));if(new Set(i).size===i.length)return i}}}function s(e,t,i){return t.pathIds&&t.pathIds.length===i?t.pathIds:r(e,t.datum,i)}function a(e,t){if(e.length!==t.length)return!0;for(let i=0;e.length>i;i++)if(e[i][0]!==t[i][0]||e[i][1]!==t[i][1])return!0;return!1}function n(e,i,r,a){a.set(r,"line"!==i.type?{topPath:i.topPath.map(t),bottomPath:i.bottomPath.map(t),pathIds:s(e,i,i.topPath.length),opacity:i.style?.opacity}:{path:i.path.map(t),pathIds:s(e,i,i.path.length),opacity:i.style?.opacity})}function o(e,r,n){if(!n.path)return!1;let o=s(e,r,r.path.length),l=n.pathIds;if(l&&o&&l.length===n.path.length&&o.length===r.path.length){let e=i(n.path,l,r.path,o);return!(!a(e.prev,e.target)&&void 0===r._introClipFraction||(r._targetPath=e.target,r._prevPath=e.prev,r.path=e.prev.map(t),0))}if(n.path.length===r.path.length){r._targetPath=r.path.map(t),r._prevPath=n.path;for(let e=0;r.path.length>e;e++)r.path[e]=t(n.path[e]);return!0}return!1}function l(e,r,n){if(!n.topPath||!n.bottomPath)return!1;let o=s(e,r,r.topPath.length),l=n.pathIds;if(l&&o&&l.length===n.topPath.length&&o.length===r.topPath.length&&n.bottomPath.length===n.topPath.length&&r.bottomPath.length===r.topPath.length){let e=i(n.topPath,l,r.topPath,o),s=i(n.bottomPath,l,r.bottomPath,o);return!(!a(e.prev,e.target)&&!a(s.prev,s.target)&&void 0===r._introClipFraction||(r._targetTopPath=e.target,r._targetBottomPath=s.target,r._prevTopPath=e.prev,r._prevBottomPath=s.prev,r.topPath=e.prev.map(t),r.bottomPath=s.prev.map(t),0))}if(n.topPath.length===r.topPath.length&&n.bottomPath.length===r.bottomPath.length){r._targetTopPath=r.topPath.map(t),r._targetBottomPath=r.bottomPath.map(t),r._prevTopPath=n.topPath,r._prevBottomPath=n.bottomPath;for(let e=0;r.topPath.length>e;e++)r.topPath[e]=t(n.topPath[e]);for(let e=0;r.bottomPath.length>e;e++)r.bottomPath[e]=t(n.bottomPath[e]);return!0}return!1}function c(e,t,i,r,s){if(!i)return t._targetOpacity=t.style.opacity??1,t._startOpacity=0,t.style={...t.style,opacity:0},!0;r.add(s);let a="line"===t.type?o(e,t,i):l(e,t,i);return t._targetOpacity=t.style.opacity??1,t._startOpacity=i.opacity??t.style.opacity??1,a}function h(e,i){let r=[];for(let[s,a]of e)if(!i.has(s))if(s.startsWith("l:")&&a.path){let e={type:"line",path:a.path.map(t),group:s.slice(2),style:{stroke:"#999",strokeWidth:1,opacity:a.opacity??1},_targetOpacity:0,_transitionKey:s,datum:null};r.push(e)}else if(s.startsWith("a:")&&a.topPath&&a.bottomPath){let e={type:"area",topPath:a.topPath.map(t),bottomPath:a.bottomPath.map(t),group:s.slice(2),style:{fill:"#999",opacity:a.opacity??1},_targetOpacity:0,_transitionKey:s,datum:null};r.push(e)}return r}function u(e,t){if(void 0!==e._targetOpacity&&(e.style={...e.style,opacity:$i(e._startOpacity??0,e._targetOpacity,t)}),void 0!==e._introClipFraction&&(e._introClipFraction=t),"line"===e.type){let i=e._prevPath,r=e._targetPath;if(i&&r&&i.length===e.path.length)for(let s=0;e.path.length>s;s++)e.path[s][0]=$i(i[s][0],r[s][0],t),e.path[s][1]=$i(i[s][1],r[s][1],t);return}let i=e._prevTopPath,r=e._prevBottomPath,s=e._targetTopPath,a=e._targetBottomPath;if(i&&s&&i.length===e.topPath.length)for(let r=0;e.topPath.length>r;r++)e.topPath[r][0]=$i(i[r][0],s[r][0],t),e.topPath[r][1]=$i(i[r][1],s[r][1],t);if(r&&a&&r.length===e.bottomPath.length)for(let i=0;e.bottomPath.length>i;i++)e.bottomPath[i][0]=$i(r[i][0],a[i][0],t),e.bottomPath[i][1]=$i(r[i][1],a[i][1],t)}function d(e){if("line"===e.type){let t=e._targetPath;if(t)for(let i=0;e.path.length>i;i++)e.path[i]=t[i];return e._prevPath=void 0,e._targetPath=void 0,void(e._introClipFraction=void 0)}let t=e._targetTopPath,i=e._targetBottomPath;if(t)for(let i=0;e.topPath.length>i;i++)e.topPath[i]=t[i];if(i)for(let t=0;e.bottomPath.length>t;t++)e.bottomPath[t]=i[t];e._prevTopPath=void 0,e._prevBottomPath=void 0,e._targetTopPath=void 0,e._targetBottomPath=void 0,e._introClipFraction=void 0}function p(e,t,i){if(t._transitionKey)return t._transitionKey;switch(t.type){case"point":if(t.pointId)return"p:"+t.pointId;if("streaming"===e.runtimeMode&&t.datum){let i=e.getX(t.datum),r=e.getY(t.datum);if(e.getCategory)return`p:${e.getCategory(t.datum)}:${i}:${r}`;if(null!=i&&null!=r)return`p:${i}:${r}`}return"p:"+i;case"glyph":return t.pointId?"g:"+t.pointId:"g:"+i;case"rect":return`r:${t.group||""}:${t.datum?.binStart??t.datum?.category??i}`;case"heatcell":return`h:${t.x}_${t.y}`;case"candlestick":return null==t.datum?"c:"+i:"c:"+e.getX(t.datum);case"line":return"l:"+(t.group||"_default");case"area":return"a:"+(t.group||"_default");default:return null}}function g(e){return e?null!=e.opacity?e.opacity:null!=e.fillOpacity?e.fillOpacity:1:1}function y(e,t,i,r){i.clear(),r.clear();for(let s=0;t.length>s;s++){let a=t[s],o=p(e,a,s);o&&("point"===a.type?i.set(o,{x:a.x,y:a.y,r:a.r,opacity:g(a.style)}):"glyph"===a.type?i.set(o,{x:a.x,y:a.y,r:a.size,opacity:g(a.style),glyph:a.glyph}):"rect"===a.type||"heatcell"===a.type?i.set(o,{x:a.x,y:a.y,w:a.w,h:a.h,opacity:g(a.style)}):"candlestick"===a.type?i.set(o,{x:a.x,y:a.openY,w:a.bodyWidth,openY:a.openY,closeY:a.closeY,highY:a.highY,lowY:a.lowY,opacity:g(a.style)}):("line"===a.type||"area"===a.type)&&n(e,a,o,r))}}function f(e,t,i,r,s,a=Xi()){if(0===r.size&&0===s.size)return i;let n=t.duration??300;if(i.exitNodes.length>0){let e=new Set(i.exitNodes);i.scene=i.scene.filter(t=>!e.has(t)),i.exitNodes=[]}let o=!1,l=/* @__PURE__ */new Set,u=/* @__PURE__ */new Set;for(let t=0;i.scene.length>t;t++){let a=i.scene[t],n=p(e,a,t);if(!n)continue;if(a._transitionKey=n,"line"===a.type||"area"===a.type){c(e,a,s.get(n),u,n)&&(o=!0);continue}let h=r.get(n);if("point"===a.type)if(h){l.add(n);let e={x:a.x,y:a.y,r:a.r};a._targetOpacity=g(a.style),(h.x!==e.x||h.y!==e.y||h.r!==e.r)&&(a._targetX=e.x,a._targetY=e.y,a._targetR=e.r,a.x=h.x,a.y=h.y,a.r=h.r??a.r,o=!0)}else a._targetOpacity=g(a.style),a.style={...a.style,opacity:0},o=!0;else if("glyph"===a.type)if(h){l.add(n);let e={x:a.x,y:a.y,size:a.size};a._targetOpacity=g(a.style),(h.x!==e.x||h.y!==e.y||h.r!==e.size)&&(a._targetX=e.x,a._targetY=e.y,a._targetR=e.size,a.x=h.x,a.y=h.y,a.size=h.r??a.size,o=!0)}else a._targetOpacity=g(a.style),a.style={...a.style,opacity:0},o=!0;else if("rect"===a.type)if(h){l.add(n);let e={x:a.x,y:a.y,w:a.w,h:a.h};a._targetOpacity=g(a.style),(h.x!==e.x||h.y!==e.y||h.w!==e.w||h.h!==e.h)&&(a._targetX=e.x,a._targetY=e.y,a._targetW=e.w,a._targetH=e.h,a.x=h.x,a.y=h.y,a.w=h.w??a.w,a.h=h.h??a.h,o=!0)}else a._targetOpacity=g(a.style),a.style={...a.style,opacity:0},o=!0;else if("heatcell"===a.type)if(h){l.add(n);let e={x:a.x,y:a.y,w:a.w,h:a.h};a._targetOpacity=g(a.style),(h.x!==e.x||h.y!==e.y||h.w!==e.w||h.h!==e.h)&&(a._targetX=e.x,a._targetY=e.y,a._targetW=e.w,a._targetH=e.h,a.x=h.x,a.y=h.y,a.w=h.w??a.w,a.h=h.h??a.h,o=!0)}else a._targetOpacity=g(a.style),a.style={...a.style||{},opacity:0},o=!0;else if("candlestick"===a.type)if(h&&null!=h.openY){l.add(n);let e={x:a.x,openY:a.openY,closeY:a.closeY,highY:a.highY,lowY:a.lowY};a._targetOpacity=g(a.style),(h.x!==e.x||h.openY!==e.openY||h.closeY!==e.closeY||h.highY!==e.highY||h.lowY!==e.lowY)&&(a._targetX=e.x,a._targetOpenY=e.openY,a._targetCloseY=e.closeY,a._targetHighY=e.highY,a._targetLowY=e.lowY,a.x=h.x,a.openY=h.openY,a.closeY=h.closeY??a.closeY,a.highY=h.highY??a.highY,a.lowY=h.lowY??a.lowY,o=!0)}else a._targetOpacity=g(a.style),a.style={...a.style||{},opacity:0},o=!0}let d=h(s,u);d.length&&(i.exitNodes.push(...d),o=!0);for(let[e,t]of r)if(!l.has(e)){if(e.startsWith("p:"))i.exitNodes.push({type:"point",x:t.x,y:t.y,r:t.r??3,style:{opacity:t.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("g:")&&t.glyph)i.exitNodes.push({type:"glyph",x:t.x,y:t.y,size:t.r??12,glyph:t.glyph,color:"#999",accent:"#999",style:{opacity:t.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))i.exitNodes.push({type:"rect",x:t.x,y:t.y,w:t.w??0,h:t.h??0,style:{opacity:t.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("h:"))i.exitNodes.push({type:"heatcell",x:t.x,y:t.y,w:t.w??0,h:t.h??0,fill:"#999",datum:null,style:{opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e});else if(e.startsWith("c:")){let r=t.openY??t.y;i.exitNodes.push({type:"candlestick",x:t.x,openY:r,closeY:t.closeY??r,highY:t.highY??r,lowY:t.lowY??r,bodyWidth:t.w??6,upColor:"#999",downColor:"#999",wickColor:"#999",wickWidth:1,isUp:!0,datum:null,style:{opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e})}o=!0}return i.exitNodes.length>0&&(i.scene=[...i.scene,...i.exitNodes]),o&&(i.activeTransition={startTime:a,duration:n}),i}function m(e,t,i,r,s){if(!i.activeTransition)return!1;let a=zi(e,i.activeTransition),n=Ii(a,"linear"===t.easing?"linear":"ease-out-cubic");for(let e of i.scene){let t=e._transitionKey;if("line"!==e.type&&"area"!==e.type){if("point"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style.opacity=$i(i?i.opacity??1:0,e._targetOpacity,n)}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=$i(i.x,e._targetX,n),e.y=$i(i.y,e._targetY,n),void 0!==e._targetR&&void 0!==i.r&&(e.r=$i(i.r,e._targetR,n))}else if("glyph"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style.opacity=$i(i?i.opacity??1:0,e._targetOpacity,n)}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=$i(i.x,e._targetX,n),e.y=$i(i.y,e._targetY,n),void 0!==e._targetR&&void 0!==i.r&&(e.size=$i(i.r,e._targetR,n))}else if("rect"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style.opacity=$i(i?i.opacity??1:0,e._targetOpacity,n)}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=$i(i.x,e._targetX,n),e.y=$i(i.y,e._targetY,n),void 0!==i.w&&(e.w=$i(i.w,e._targetW,n)),void 0!==i.h&&(e.h=$i(i.h,e._targetH,n))}else if("heatcell"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style={...e.style||{},opacity:$i(i?i.opacity??1:0,e._targetOpacity,n)}}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=$i(i.x,e._targetX,n),e.y=$i(i.y,e._targetY,n),void 0!==i.w&&(e.w=$i(i.w,e._targetW,n)),void 0!==i.h&&(e.h=$i(i.h,e._targetH,n))}else if("candlestick"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style={...e.style||{},opacity:$i(i?i.opacity??1:0,e._targetOpacity,n)}}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=$i(i.x,e._targetX,n),void 0!==i.openY&&(e.openY=$i(i.openY,e._targetOpenY,n)),void 0!==i.closeY&&(e.closeY=$i(i.closeY,e._targetCloseY,n)),void 0!==i.highY&&(e.highY=$i(i.highY,e._targetHighY,n)),void 0!==i.lowY&&(e.lowY=$i(i.lowY,e._targetLowY,n))}}else u(e,n)}if(a>=1){for(let e of i.scene){if(void 0!==e._targetOpacity){let t=e._targetOpacity;e.style={...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}if("line"!==e.type&&"area"!==e.type){if("point"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("glyph"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.size=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("rect"===e.type){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 if("heatcell"===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 if("candlestick"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,void 0!==e._targetOpenY&&(e.openY=e._targetOpenY),void 0!==e._targetCloseY&&(e.closeY=e._targetCloseY),void 0!==e._targetHighY&&(e.highY=e._targetHighY),void 0!==e._targetLowY&&(e.lowY=e._targetLowY),e._targetX=void 0,e._targetOpenY=void 0,e._targetCloseY=void 0,e._targetHighY=void 0,e._targetLowY=void 0}}else d(e)}if(i.exitNodes.length>0){let e=new Set(i.exitNodes);i.scene=i.scene.filter(t=>!e.has(t)),i.exitNodes=[]}return i.activeTransition=null,!1}return!0}function x(e,t){let i="function"==typeof e?e:i=>i[e||t];return e=>{let t=i(e);return null==t?NaN:+t}}function v(e){let t=[],i=["bar","swarm","waterfall"].includes(e.chartType)||"streaming"===e.runtimeMode,r=x(i&&e.valueAccessor||e.yAccessor,i?"value":"y");if(e.boundsAccessor){let i=Lt(e.boundsAccessor,"bounds");t.push({kind:"bounds",getTop:e=>{let t=r(e);if(!Number.isFinite(t))return NaN;let s=i(e);return Number.isFinite(s)&&0!==s?t+s:t},getBottom:e=>{let t=r(e);if(!Number.isFinite(t))return NaN;let s=i(e);return Number.isFinite(s)&&0!==s?t-s:t},style:e.boundsStyle,perSeries:!0,interactive:!1})}if(e.band){let i=Array.isArray(e.band)?e.band:[e.band];for(let e of i)t.push({kind:"band",getTop:x(e.y1Accessor,"y1"),getBottom:x(e.y0Accessor,"y0"),style:e.style,perSeries:!1!==e.perSeries,interactive:!0===e.interactive})}return t}function b(e,t){let i=0,r=0,s=0;for(let a of e){let e=t(a);null==e||Number.isNaN(e)||(s+=e,i>s&&(i=s),s>r&&(r=s))}return[i,r]}function w(e,t){return t?[t[0]??e[0],t[1]??e[1]]:e}function k(e){let{config:t,groups:i,getX:r,getY:s}=e,a="exact"===(t.yAxisExtent??t.axisExtent);if(t.normalize){let i=[0,a?1:1+t.extentPadding];return{yDomain:i,stackExtentCache:{key:`${e.bufferSize}:${e.ingestVersion}:norm`,yDomain:i}}}let n=`${e.bufferSize}:${e.ingestVersion}:${t.baseline??"zero"}:${t.stackOrder??"key"}`;if(e.stackExtentCache&&e.stackExtentCache.key===n)return{yDomain:e.stackExtentCache.yDomain,stackExtentCache:e.stackExtentCache};let o=/* @__PURE__ */new Map,l=/* @__PURE__ */new Set,c=0,h=/* @__PURE__ */new Map,u=/* @__PURE__ */new Map;for(let e of i){let t=/* @__PURE__ */new Map,i=0;for(let a of e.data){let e=r(a),n=s(a);if(!Number.isFinite(e)||!Number.isFinite(n))continue;t.set(e,(t.get(e)||0)+n),l.add(e),i+=n;let o=(h.get(e)||0)+n;h.set(e,o),o>c&&(c=o)}o.set(e.key,t),u.set(e.key,i)}let d,p,g=t.stackOrder??"key",y=(e,t)=>t>e?-1:e>t?1:0;if("input"===g)d=i.map(e=>e.key);else if("insideOut"===g){let e=[...i].map(e=>e.key).sort((e,t)=>{let i=(u.get(t)??0)-(u.get(e)??0);return 0!==i?i:y(e,t)}),t=[],r=[],s=0,a=0;for(let i of e)a>s?(t.push(i),s+=u.get(i)??0):(r.push(i),a+=u.get(i)??0);d=[...r.reverse(),...t]}else d="asc"===g?i.map(e=>e.key).sort((e,t)=>{let i=(u.get(e)??0)-(u.get(t)??0);return 0!==i?i:y(e,t)}):"desc"===g?i.map(e=>e.key).sort((e,t)=>{let i=(u.get(t)??0)-(u.get(e)??0);return 0!==i?i:y(e,t)}):i.map(e=>e.key).sort(y);if("wiggle"===t.baseline||"silhouette"===t.baseline){let e=Array.from(l).sort((e,t)=>e-t),i=gt(e,d,(e,t)=>o.get(e)?.get(t)||0,t.baseline),r=1/0,s=-1/0;for(let t of e){let e=i.get(t)??0,a=h.get(t)??0;r>e&&(r=e),e+a>s&&(s=e+a)}(!Number.isFinite(r)||!Number.isFinite(s))&&(r=0,s=0);let n=s-r,c=a?0:n>0?n*t.extentPadding:1;p=[r-c,s+c]}else if("diverging"===t.baseline){let e=Array.from(l).sort((e,t)=>e-t),[i,r]=yt(e,d,(e,t)=>o.get(e)?.get(t)||0),s=r-i,n=a?0:s>0?s*t.extentPadding:1;p=[i-n,r+n]}else p=[0,c+(a?0:c>0?c*t.extentPadding:1)];return{yDomain:p,stackExtentCache:{key:n,yDomain:p}}}function A(e,t,i,r,s,a,n){let[,o]=Qe(e,t,i,r,s);return[0,n?o:o+o*a]}function _(e,t,i,r){let[s,a]=b(e,t),n=a-s,o=r?0:n>0?n*i:1;return[Math.min(0,s-Math.abs(o)),Math.max(0,a+Math.abs(o))]}function C(e,t,i,r,s){let a=Array.from(new Set(e.map(t).filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(2>a.length)return w(i,r);let n=a[0],o=a[1],l=a[a.length-1],c=a[a.length-2];return w("log"===s&&n>0?[n/Math.sqrt(o/n),l*Math.sqrt(l/c)]:[n-(o-n)/2,l+(l-c)/2],r)}function P(e,t,i){if(!i.length)return e;let[r,s]=e;for(let e of t)for(let t of i){let i=t.getTop(e),a=t.getBottom(e);Number.isFinite(i)&&(r>i&&(r=i),i>s&&(s=i)),Number.isFinite(a)&&(r>a&&(r=a),a>s&&(s=a))}return[r,s]}function S(e,t){let i=e[1]-e[0],r=t.exactMode?0:i>0?i*t.extentPadding:1,s=[null!=t.userMin?e[0]:e[0]-r,null!=t.userMax?e[1]:e[1]+r];return"log"!==t.yScaleType||s[0]>0||0>=t.dataYDomain[0]||t.exactMode||null==t.userMin&&(s[0]=t.dataYDomain[0]/(1+t.extentPadding)),s}function M(e,t,i){if(!t||i)return e;let r=t[0],s=t[1];return null==r&&null==s?e:[r??e[0],s??e[1]]}function R(e,t,i){let r=e,s=t;if(r[0]===1/0||r[1]===-1/0)if("time"===i){let e=Date.now();r=[e-864e5,e]}else r=[0,1];return(s[0]===1/0||s[1]===-1/0)&&(s=[0,1]),{xDomain:r,yDomain:s}}function Y(e,t,i){if("log"===e){let e=[Math.max(t[0],1e-6),Math.max(t[1],1e-6)];return $r().domain(e).range(i).clamp(!0)}return"symlog"===e?Wr().domain(t).range(i):"time"===e?Xr().domain([new Date(t[0]),new Date(t[1])]).range(i):Fr().domain(t).range(i)}function T(e){let{config:t,layout:i,xDomain:r}=e,s=t.invertY?[e.yDomain[1],e.yDomain[0]]:e.yDomain,a="streaming"===t.runtimeMode,n=Math.max(0,Math.min(t.scalePadding||0,Math.min(i.width,i.height)/2-1));if(a){let e="left"===t.arrowOfTime?[i.width-n,n]:[n,i.width-n];return{x:Fr().domain(r).range(e),y:Y(t.yScaleType,s,[i.height-n,n])}}return{x:Y(t.xScaleType,r,[n,i.width-n]),y:Y(t.yScaleType,s,[i.height-n,n])}}function L(e,t){return e&&"object"==typeof e&&!Array.isArray(e)?yr(e,t):void 0}function D(e,t,i,r){if(r&&r.version===i&&r.group===t&&r.data===e)return{result:r.result,cache:r};let s;if(t){let i=/* @__PURE__ */new Map;for(let r of e){let e=t(r);i.has(e)||i.set(e,[]),i.get(e).push(r)}s=Array.from(i.entries()).map(([e,t])=>({key:e,data:t}))}else s=[{key:"_default",data:e}];return{result:s,cache:{version:i,group:t,data:e,result:s}}}function E(e,t,i,r,s){if(s&&s.version===r)return{map:s.map,cache:s};let a=/* @__PURE__ */new Set;if(t)for(let i of e){let e=t(i);e&&a.add(e)}let n=Array.from(a).sort(),o=n.join("\0");if(s&&s.key===o){let e={...s,version:r};return{map:e.map,cache:e}}let l=pr(i.colorScheme,i.themeCategorical,gr),c=/* @__PURE__ */new Map;for(let e=0;n.length>e;e++)c.set(n[e],L(i.colorScheme,n[e])??l[e%l.length]);return{map:c,cache:{key:o,map:c,version:r}}}function O(e){let{group:t,colorMapCache:i,groupColorMap:r,groupColorMapCap:s,config:a}=e,{groupColorCounter:n}=e,o=L(a.colorScheme,t);if(o)return{color:o,groupColorCounter:n};if(i){let e=i.map.get(t);if(e)return{color:e,groupColorCounter:n}}let l=r.get(t);if(l)return{color:l,groupColorCounter:n};let c=pr(a.colorScheme,a.themeCategorical,gr);if(0===c.length)return{color:null,groupColorCounter:n};let h=c[n%c.length];if(n++,r.set(t,h),r.size>s){let e=r.keys().next().value;void 0!==e&&r.delete(e)}return{color:h,groupColorCounter:n}}function B(e,t,i,r){let s=e.lineStyle;if("function"==typeof s){let e=s(i||{},t);if(e&&!e.stroke&&t){let i=r(t);if(i)return{...e,stroke:i}}return e}let a=e.themeSemantic?.primary;return s&&"object"==typeof s?{stroke:s.stroke||a||"#007bff",strokeWidth:s.strokeWidth??2,strokeDasharray:s.strokeDasharray,fill:s.fill,fillOpacity:s.fillOpacity,opacity:s.opacity,cursor:s.cursor}:{stroke:r(t)||a||"#007bff",strokeWidth:2}}function I(e,t,i,r){if(e.areaStyle){let s=e.areaStyle(i||{});if(s&&!s.fill&&t){let e=r(t);if(e)return{...s,fill:e,stroke:s.stroke||e}}return s}let s=e.lineStyle;if("function"==typeof s){let e=s(i||{},t);if(e&&!e.fill&&t){let i=r(t);if(i)return{...e,fill:i,stroke:e.stroke||i}}return e}let a=e.themeSemantic?.primary;if(s&&"object"==typeof s)return{fill:s.fill||s.stroke||a||"#4e79a7",fillOpacity:s.fillOpacity??.7,stroke:s.stroke||a||"#4e79a7",strokeWidth:s.strokeWidth??2,cursor:s.cursor};let n=r(t)||a||"#4e79a7";return{fill:n,fillOpacity:.7,stroke:n,strokeWidth:2}}function N(e,t,i,r){let s=e.boundsStyle;if("function"==typeof s)return s(i||{},t);if(s&&"object"==typeof s)return s;let a=r(t,i);return{fill:a.stroke||e.themeSemantic?.primary||"#4e79a7",fillOpacity:.2,...null!=a.opacity&&{opacity:a.opacity},stroke:"none",cursor:a.cursor}}function z(e){let t="preserve",i=/* @__PURE__ */new Set;for(let r of e){let e=es[r]??ts;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)i.add(t)}return{retainedData:t,invalidations:i}}function F(e,{storeRef:t,adapterRef:i,dirtyRef:r,scheduleRender:s,hoverRef:a,setHoverPoint:n}){let o=os(e=>{i.current?.push(e)},[i]),l=os(e=>{i.current?.pushMany(e)},[i]),c=os(()=>{i.current?.clear(),t.current?.clear(),r.current=!0,s()},[i,t,r,s]);ls(e,()=>({push:o,pushMany:l,remove:e=>{i.current?.flush();let o=t.current?.remove(e)??[];return o.length>0&&(a.current&&o.some(e=>e===a.current?.data)&&(a.current=null,n(null)),r.current=!0,s()),o},update:(e,a)=>{i.current?.flush();let n=t.current?.update(e,a)??[];return n.length>0&&(r.current=!0,s()),n},clear:c,getData:()=>(i.current?.flush(),t.current?.getData()??[]),getScales:()=>t.current?.scales??null,getExtents:()=>t.current?.getExtents()??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null}),[o,l,c,s,i,t,r,a,n])}function $(e,t,i=8){if(!t||2>e.length)return e.map(([e,t])=>[e,t]);let r=[],s=null,a={moveTo(e,t){s=[e,t],r.push([e,t])},lineTo(e,t){s=[e,t],r.push([e,t])},bezierCurveTo(e,t,a,n,o,l){if(!s)return s=[o,l],void r.push([o,l]);let[c,h]=s;for(let s=1;i>=s;s++){let u=s/i,d=1-u;r.push([d*d*d*c+3*d*d*u*e+3*d*u*u*a+u*u*u*o,d*d*d*h+3*d*d*u*t+3*d*u*u*n+u*u*u*l])}s=[o,l]},closePath(){},arc(){},rect(){},arcTo(){},quadraticCurveTo(e,t,i,a){s=[i,a],r.push([i,a])}};return cs().x(e=>e[0]).y(e=>e[1]).curve(t).context(a)(e),r}function W(e,t){let i=kr(t);if(!i)return e;let r=hs.get(e),s=r?.get(i);if(s)return s;let a=$(e,i);return r||(r=/* @__PURE__ */new Map,hs.set(e,r)),r.set(i,a),a}function X(e,t,i,r=30,s,a=0){let n=null;if(s){let e=Zt(s,t,i,r,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"point":if(!1===a.interactive||s)break;e=H(a,t,i,r);break;case"symbol":e=G(a,t,i,r);break;case"glyph":e=U(a,t,i,r);break;case"line":e=q(a,t,i,r);break;case"rect":if(null==a.datum)break;e=K(a,t,i);break;case"heatcell":e=J(a,t,i);break;case"area":if(!1===a.interactive)break;e=Q(a,t,i,r);break;case"candlestick":e=Z(a,t,i)}e&&(!n||n.distance>e.distance)&&(n=e)}return n}function j(e,t,i){if(0===e.length)return null;if(e[0][0]>t||t>e[e.length-1][0])return null;let r=ee(e,t);if(0>r||Math.abs(e[r][0]-t)>i)return null;let s=r,a=r;r>0&&e[r][0]>=t?(s=r-1,a=r):e.length-1>r&&(s=r,a=r+1);let[n,o]=e[s],[l,c]=e[a];return l===n?o:o+Math.max(0,Math.min(1,(t-n)/(l-n)))*(c-o)}function V(e,t,i=30){let r=[];for(let s of e)if("line"===s.type){let e=s;if(2>e.path.length)continue;let a=j(W(e.path,e.curve),t,i);if(null===a)continue;let n=ee(e.path,t);r.push({node:s,datum:Array.isArray(e.datum)&&e.datum[n]?e.datum[n]:e.datum,x:e.path[n][0],y:a,group:e.group,color:e.style.stroke})}else if("area"===s.type){let e=s;if(!1===e.interactive||2>e.topPath.length)continue;let a=W(e.topPath,e.curve),n=W(e.bottomPath,e.curve),o=j(a,t,i);if(null===o)continue;let l=j(n,t,i),c=ee(e.topPath,t);r.push({node:s,datum:Array.isArray(e.datum)&&e.datum[c]?e.datum[c]:e.datum,x:e.topPath[c][0],y:o,y0:l??void 0,group:e.group,color:"string"==typeof e.style.stroke?e.style.stroke:"string"==typeof e.style.fill?e.style.fill:void 0})}return r}function H(e,t,i,r=30){let s=t-e.x,a=i-e.y,n=Math.sqrt(s*s+a*a);return n>Kt(e.r,r)?null:{node:e,datum:e.datum,x:e.x,y:e.y,distance:n}}function G(e,t,i,r=30){let s=t-e.x,a=i-e.y,n=Math.sqrt(s*s+a*a);return n>Kt(fr(e.size),r)?null:{node:e,datum:e.datum,x:e.x,y:e.y,distance:n}}function U(e,t,i,r=30){if(null==e.datum)return null;let s=mr(e.glyph,e.size),a=e.x+s.centerDx,n=e.y+s.centerDy,o=t-a,l=i-n,c=Math.sqrt(o*o+l*l);return c>Kt(s.radius,r)?null:{node:e,datum:e.datum,x:a,y:n,distance:c}}function q(e,t,i,r=30){if(0===e.path.length)return null;let s=ee(e.path,t);if(0>s)return null;let a,[n,o]=e.path[s];if(e.path.length>1){let r=1/0,n=Math.max(0,s-1),o=Math.min(e.path.length-2,s);for(let s=n;o>=s;s++){let[a,n]=e.path[s],[o,l]=e.path[s+1],c=Ut(t,i,a,n,o,l);r>c&&(r=c)}a=r}else{let e=t-n,r=i-o;a=Math.sqrt(e*e+r*r)}let l=e.style;return a>Math.max(5,(l.strokeWidth??l.lineWidth??1)/2+2,r)?null:{node:e,datum:Array.isArray(e.datum)&&e.datum[s]?e.datum[s]:e.datum,x:n,y:o,distance:a}}function K(e,t,i){let r=qt(t,i,e);return r.hit?{node:e,datum:e.datum,x:r.cx,y:r.cy,distance:0}:null}function J(e,t,i){let r=qt(t,i,e);return r.hit?{node:e,datum:e.datum,x:r.cx,y:r.cy,distance:0}:null}function Z(e,t,i){let r=e.bodyWidth/2,s=Math.min(e.openY,e.closeY);if(!(e.x-r-3>t||t>e.x+r+3||e.highY-3>i||i>e.lowY+3)){let r=s+Math.max(Math.max(e.openY,e.closeY)-s,1)/2,a=t-e.x,n=i-r;return{node:e,datum:e.datum,x:e.x,y:r,distance:Math.sqrt(a*a+n*n)}}return null}function Q(e,t,i,r){if(0===e.topPath.length||e.clipRect&&(e.clipRect.x>t||t>e.clipRect.x+e.clipRect.width||e.clipRect.y>i||i>e.clipRect.y+e.clipRect.height))return null;let s,a=W(e.topPath,e.curve),n=ee(a,t),o=ee(e.topPath,t);if(0>n||0>o)return null;if(a.length>1){let e=1/0,r=Math.max(0,n-1),o=Math.min(a.length-2,n);for(let s=r;o>=s;s++){let[r,n]=a[s],[o,l]=a[s+1];e=Math.min(e,Ut(t,i,r,n,o,l))}s=e}else{let e=t-a[0][0],r=i-a[0][1];s=Math.sqrt(e*e+r*r)}if(s>r)return null;let[l,c]=e.topPath[o];return{node:e,datum:Array.isArray(e.datum)&&e.datum[o]?e.datum[o]:e.datum,x:l,y:c,distance:s}}function ee(e,t){if(0===e.length)return-1;let i=0,r=e.length-1;for(;r>i;){let s=i+r>>1;t>e[s][0]?i=s+1:r=s}return i>0&&Math.abs(e[i][0]-t)>=Math.abs(e[i-1][0]-t)?i-1:i}function te(e,t){let i=e.filter(e=>e._directLabel);if(!i.length)return{node:null};let r=i[0]._directLabel.position,s=t.measure??st,a=i.map(e=>({family:t.fontFamily||"sans-serif",version:t.fontVersion??0,weight:400,size:e.fontSize||11})),n=i.map((e,i)=>{let r=(e,t)=>{if(null==e||!t)return NaN;try{return t(Number(e))}catch{return NaN}};return{id:e._directLabel.id+"",anchor:{x:r(e.x,t.scales?.x),y:r(e.y,t.scales?.y)},measurement:s(e.label+"",a[i])}}),o=Math.max(0,(t.margin?.["end"===r?"right":"left"]??0)-10),l=rt(n,{x:"end"===r?t.width+6:-o-6,y:0,width:o,height:t.height},r),c=l.dispositions.map((e,r)=>{if("omitted"===e.status)return null;let s=e.box,o=e.connector,c=i[r],h=/* @__PURE__ */ps("g",{"data-direct-label-id":e.id,children:[o&&/* @__PURE__ */ds("line",{...o,stroke:c.color,strokeWidth:.75}),
|
|
2
|
+
/* @__PURE__ */ds("text",{x:s.x+(n[r].measurement.left??0),y:s.y+n[r].measurement.ascent,fontFamily:a[r].family,fontWeight:a[r].weight,fontSize:a[r].size,fill:c.color,textAnchor:"start",children:c.label})]},e.id),u=t.renderLabel?t.renderLabel({...c,dx:s.x+(n[r].measurement.left??0)-n[r].anchor.x,dy:s.y+n[r].measurement.ascent-n[r].anchor.y,fontFamily:a[r].family},r,h):h;if(!u){let t=l.evidence;t.rendered--,t.omitted++,20>t.omittedIds.length&&t.omittedIds.push(e.id),Math.abs(e.offset.y)>.01&&t.displaced--,t.displacedIds=t.displacedIds.filter(t=>t!==e.id);for(let i of["RENDER_FAILURE","LABEL_OMITTED"]){let r=t.findings.find(e=>e.code===i);r||(r={code:i,count:0,labelIds:[],remedy:it[i]},t.findings.push(r)),r.count++,20>r.labelIds.length&&r.labelIds.push(e.id)}}if(u!==h&&(l.evidence.status="incomplete",u)){let t=l.evidence.findings.find(e=>"UNSUPPORTED_GEOMETRY"===e.code);t||(t={code:"UNSUPPORTED_GEOMETRY",count:0,labelIds:[],remedy:it.UNSUPPORTED_GEOMETRY},l.evidence.findings.push(t)),t.count++,20>t.labelIds.length&&t.labelIds.push(e.id)}return u?/* @__PURE__ */ds(us.Fragment,{children:u},e.id):null}),h=/* @__PURE__ */ds("g",{role:"list","aria-label":"Series endpoints","data-direct-label-fallback":"accessible-series-list",children:i.map((e,t)=>/* @__PURE__ */ds("g",{role:"listitem","aria-label":`${e.label}: x ${e.x+""}, y ${e.y+""}`,children:/* @__PURE__ */ds("title",{children:`${e.label}: x ${e.x+""}, y ${e.y+""}`})},n[t].id))});return{evidence:l.evidence,node:/* @__PURE__ */ps("g",{className:"semiotic-direct-labels","data-label-layout":JSON.stringify(l.evidence),children:[c,h]},"direct-labels")}}function ie(e,t,i="x",r="y"){let s="function"==typeof i?i:e=>e[i],a="function"==typeof r?r:e=>e[r],n="function"==typeof t.colorBy?t.colorBy:e=>e[t.colorBy],o=/* @__PURE__ */new Map;for(let i of e){let e=n(i)??(i.parentLine&&n(i.parentLine));if(null==e||e+""=="")continue;let r=e+"",a=o.get(r);(!a||("end"===t.position?Number(s(i))>Number(s(a)):Number(s(i))<Number(s(a))))&&o.set(r,i)}return[...o].map(([e,n])=>({type:"text",label:e,["string"==typeof i?i:"x"]:s(n),["string"==typeof r?r:"y"]:a(n),x:s(n),y:a(n),_directLabel:{id:e,position:t.position},color:t.color(e),fontSize:t.fontSize}))}function re(e,t=[],i,r){return e.flatMap(e=>e._directLabelRequest?ie(t,e._directLabelRequest,i,r):[e])}function se(e=[]){let t=e.filter(e=>e._directLabel);return t.length?` Series endpoints: ${t.map(e=>`${e.label}: x ${e.x+""}, y ${e.y+""}`).join("; ")}.`:""}function ae(e,t){let i=ys(null),[r,s]=fs({status:"not-assessed",checked:0,unsupported:0,collisions:0,overflows:0,findings:[]});return gs(()=>{let t=i.current;if(!e||!t)return;let r=!0;return import("./c-AINGQGUN.min.js").then(({readAxisLabelAssessment:e})=>{if(!r)return;let i=e(t);s(e=>JSON.stringify(e)===JSON.stringify(i)?e:i)}),()=>{r=!1}},[e,t]),{ref:i,assessment:r}}function ne(e){let[t,i]=xs();return ms(()=>{if(!e)return;let t=!0,r=()=>{};return import("./c-K2ZIYDI3.min.js").then(({browserLabelMeasurer:e})=>{if(!t)return;let s=()=>i(()=>e());s(),r=xr(s)}),()=>{t=!1,r()}},[e]),e?t:void 0}function oe(e,t,i){if("edges"===e){if(t)return"start";if(i)return"end"}return"middle"}function le(e,t,i){if("edges"===e){if(t)return"hanging";if(i)return"auto"}return"middle"}function ce(e){if(0===e.length)return{min:null,max:null};let t=1/0,i=-1/0;for(let r of e)t>r.pixel&&(t=r.pixel),r.pixel>i&&(i=r.pixel);return{min:t,max:i}}function he(e){if(e)return"object"==typeof e?e.strokeDasharray:"dashed"===e?"6,4":"dotted"===e?"2,4":e}function ue(e,t){return e&&"string"!=typeof e?{stroke:e.stroke??t.stroke,strokeWidth:e.strokeWidth??t.strokeWidth,...null!=e.strokeOpacity&&{strokeOpacity:e.strokeOpacity},...e.strokeDasharray&&{strokeDasharray:e.strokeDasharray}}:{...t,..."string"==typeof e&&{strokeDasharray:he(e)}}}function de(e,t,i){if("left"===e||"right"===e){let r="left"===e?i:0,s="left"===e?-1:1,a=Math.ceil(t/8),n="M0,"+r;for(let e=0;a>e;e++){let i=8*(e+1);n+=`L${Math.min(8*e+4,t)},${r+4*s}`,n+=`L${Math.min(i,t)},${r}`}return n}let r="bottom"===e?0:t,s="bottom"===e?1:-1,a=Math.ceil(i/8),n=`M${r},0`;for(let e=0;a>e;e++){let t=8*(e+1);n+=`L${r+4*s},${Math.min(8*e+4,i)}`,n+=`L${r},${Math.min(t,i)}`}return n}function pe({axes:e,xTicks:t,yTicks:i,width:r,height:s}){let{xAxis:a,yAxis:n}=sr(e);/* @__PURE__ */
|
|
3
|
+
return vs("g",{className:"stream-grid",children:[a,n].map((e,a)=>{if(!1===e?.grid)return null;let n=0===a,o=ue(e?.gridStyle,{stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1});return(n?t:i).map((t,i)=>/* @__PURE__ */vs("line",{x1:n?t.pixel:0,y1:n?0:t.pixel,x2:n?t.pixel:r,y2:n?s:t.pixel,...o,strokeDasharray:he(e?.gridStyle)??o.strokeDasharray},`${a}-${i}`))})})}function ge(e){Ps=e}function ye(e,t,i){let r="function"==typeof t?t:e=>e[t||"x"],s="function"==typeof i?i:e=>e[i||"y"],a=[],n=[];for(let t of e){let e=r(t),i=s(t);"number"==typeof e&&isFinite(e)&&a.push(e),"number"==typeof i&&isFinite(i)&&n.push(i)}return{xValues:a,yValues:n}}function fe(e){let[t,i]=_s.useState(()=>Ps);return _s.useEffect(()=>{if(t)return;let e=!1;return(Ps?Promise.resolve(Ps):(Ss||(Ss=import("./c-YQVOKPKR.min.js").then(e=>Ps=e.MarginalGraphics).catch(e=>{throw Ss=null,e})),Ss)).then(t=>{e||i(()=>t)}),()=>{e=!0}},[t]),t?/* @__PURE__ */Cs(t,{...e}):null}function me(e,t){return e?.ticks??e?.tickCount??t}function xe(e,t){return!("string"!=typeof e&&"number"!=typeof e||"string"!=typeof t&&"number"!=typeof t||e+""!=t+"")}function ve(e,t){if(2>=e.length)return e;let i=[e[0]];for(let r=1;e.length-1>r;r++)Math.abs(e[r].pixel-i[i.length-1].pixel)>=t&&i.push(e[r]);let r=e[e.length-1];return t>Math.abs(r.pixel-i[i.length-1].pixel)?i[i.length-1]=r:i.push(r),i}function be(e){let t=new Date(e instanceof Date?e.valueOf():e);return`${Ms[t.getUTCMonth()]} ${t.getUTCDate()}`}function we(e){let t=Math.abs(e[1]-e[0]);return 864e5>t?e=>{let i=new Date(e instanceof Date?e.valueOf():e),r=`${(i.getUTCHours()+"").padStart(2,"0")}:${(i.getUTCMinutes()+"").padStart(2,"0")}`;return 3e5>t&&(r+=":"+(i.getUTCSeconds()+"").padStart(2,"0")),1e4>t&&(r+="."+(i.getUTCMilliseconds()+"").padStart(3,"0")),r}:3156e7>t?be:1578e8>t?e=>{let t=new Date(e instanceof Date?e.valueOf():e);return`${Ms[t.getUTCMonth()]} ${t.getUTCFullYear()}`}:e=>new Date(e instanceof Date?e.valueOf():e).getUTCFullYear()+""}function ke(e){return"string"==typeof e||"number"==typeof e?6.5*(e+"").length:60}function Ae(e){for(let t=1;e.length>t;t++){let i=e[t-1],r=e[t];if(Math.abs(r.pixel-i.pixel)<(ke(i.label)+ke(r.label))/2+8)return!0}return!1}function _e(e){let{scale:t,axis:i,size:r,horizontal:s=!1,axisExtent:a}=e,n=i?.extent??a,o=t.domain(),l=me(i,5),c=Math.max(2,Math.floor(r/(s?70:30))),h="exact"===n?Math.max(2,l):Math.min(l,c),u=i?.tickValues??ht(t,h,n),d=u.map(e=>e.valueOf()),p=i?.tickFormat||e.format||(o[0]instanceof Date||u[0]instanceof Date?we([o[0].valueOf(),o[o.length-1].valueOf()]):nr(d)),g=(e,t)=>s?p(e,t,d):p(e),y=u.map((e,i)=>({value:e,pixel:t(e),label:g(e,i)})),f=22;if(s){let e=y.reduce((e,t)=>Math.max(e,ke(t.label)),0);f=i?.autoRotate?Math.max(20,Math.min(e+8,55)):Math.max(55,e+8)}let m=ve(y,f);if(m.length>1&&(m=m.filter((e,t)=>0===t||!xe(e.label,m[t-1].label))),i?.includeMax&&m.length>0&&"exact"!==n&&!i.tickValues){let e=o[o.length-1];if(null!=e){let i=t(e),r=Math.abs(i-m[m.length-1].pixel);if(r>1){let t=g(e,m.length);f>r&&m.length>1&&(m=m.slice(0,-1)),m=[...m,{value:e,pixel:i,label:t}]}}}return m}function Ce(e){let{width:t,height:i,totalWidth:r,totalHeight:s,margin:a,scales:n,showAxes:o,axes:l,showGrid:c,xFormat:h,yFormat:u,axisExtent:d}=e,p=Rs(()=>{if(!n||!c)return[];let e=l?.find(e=>"bottom"===e.orient)??l?.find(e=>"top"===e.orient);return _e({scale:n.x,axis:e,size:t,horizontal:!0,format:h,axisExtent:d})},[n,l,h,t,d,c]),g=Rs(()=>{if(!n||!c)return[];let e=l?.find(e=>"left"===e.orient)??l?.find(e=>"right"===e.orient);return _e({scale:n.y,axis:e,size:i,format:u,axisExtent:d})},[n,l,u,i,d,c]),y=c&&n,f=o&&n;if(!y&&!f)return null;let{xAxis:m,yAxis:x,xOrient:v,yOrient:b}=sr(l),w="top"===v?0:i,k="right"===b?t:0,A=f&&!1!==m?.visible&&(!m||!1!==m.baseline),_=f&&!1!==x?.visible&&(!x||!1!==x.baseline),C=m?.jaggedBase||!1,P=x?.jaggedBase||!1,S=ue(m?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),M=ue(x?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1});/* @__PURE__ */
|
|
4
|
+
return Ys("svg",{width:r,height:s,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:/* @__PURE__ */Ts("g",{transform:`translate(${a.left},${a.top})`,children:[y&&/* @__PURE__ */Ys(pe,{axes:l,xTicks:p,yTicks:g,width:t,height:i}),A&&!C&&/* @__PURE__ */Ys("line",{x1:0,y1:w,x2:t,y2:w,...S}),f&&!1!==m?.visible&&C&&/* @__PURE__ */Ys("path",{d:de(v,t,i),fill:"none",...S}),_&&!P&&/* @__PURE__ */Ys("line",{x1:k,y1:0,x2:k,y2:i,...M}),f&&!1!==x?.visible&&P&&/* @__PURE__ */Ys("path",{d:de(b,t,i),fill:"none",...M})]})})}function Pe(e){let{width:t,height:i,totalWidth:r,totalHeight:s,margin:a,scales:n,showAxes:o,axes:l,xLabel:c,yLabel:h,yLabelRight:u,xFormat:d,yFormat:p,axisExtent:g,showGrid:y,title:f,description:m,idPrefix:x,legend:v,legendHoverBehavior:b,legendClickBehavior:w,legendHighlightedCategory:k,legendIsolatedCategories:A,legendPosition:_="right",legendLayout:C,foregroundGraphics:P,marginalGraphics:S,xValues:M,yValues:R,annotations:Y,onAnnotationActivate:T,onObservation:L,chartId:D,chartType:E,autoPlaceAnnotations:O,svgAnnotationRules:B,xAccessor:I,yAccessor:N,annotationData:z,pointNodes:F,curve:$,underlayRendered:W,canvasObscuresUnderlay:X=!0,linkedCrosshairName:j,linkedCrosshairSourceId:V,children:H}=e,G=gi({onAnnotationActivate:T,onObservation:L,chartId:D,chartType:E}),U=ur({showAxes:o,xLabel:c,yLabel:h,yLabelRight:u,axes:l}),q=cr(C,U.leftAxis),K=cr(C,U.rightAxis),J=v&&"left"===_&&q>0?q:a.left,Z=v&&"right"===_&&K>0?K:a.right,Q=bs(()=>{if(!o&&!y||!n)return[];let e=l?.find(e=>"bottom"===e.orient)??l?.find(e=>"top"===e.orient);return _e({scale:n.x,axis:e,size:t,horizontal:!0,format:d,axisExtent:g})},[o,y,n,l,d,t,g]),ee=bs(()=>!(!(l?.find(e=>"bottom"===e.orient)??l?.find(e=>"top"===e.orient))?.autoRotate||!Ae(Q)),[l,Q]),ie=bs(()=>{if(!o&&!y||!n)return[];let e=l?.find(e=>"left"===e.orient)??l?.find(e=>"right"===e.orient);return _e({scale:n.y,axis:e,size:i,format:p,axisExtent:g})},[o,y,n,l,p,i,g]),he=bs(()=>{if(!o||!n||!l?.some(e=>"left"===e.orient))return[];let e=l?.find(e=>"right"===e.orient);return e?_e({scale:n.y,axis:e,size:i,format:p,axisExtent:g}):[]},[o,n,l,p,i,g]),ge=ws(/* @__PURE__ */new Map),ye=ws(Y?.length??0),me=Y?.length??0;ye.current!==me&&(ye.current=me,ge.current=/* @__PURE__ */new Map);let xe=_r(e=>e.theme),ve=!!Y?.some(e=>e._directLabel||e._directLabelRequest),be=ne(ve),we=bs(()=>ve?re(Y||[],z,I,N):Y,[ve,Y,z,I,N]),ke=bs(()=>te(we||[],{width:t,height:i,margin:a,scales:n,measure:be,fontFamily:xe.typography.fontFamily,...B?{renderLabel:(e,r,s)=>B(e,r,{width:t,height:i,scales:n?{...n,time:n.x,value:n.y}:null,frameType:"xy",xAccessor:I,yAccessor:N,data:z})??s}:{}}),[we,t,i,a,n,be,xe,B,I,N,z]),Ce=bs(()=>{if(!Y||0===Y.length)return null;let e=ii(Y).filter(e=>!e._directLabel&&!e._directLabelRequest),r=ki("xy",G),s={scales:n?{x:n.x,y:n.y,time:n.x,value:n.y}:null,timeAxis:"x",xAccessor:I,yAccessor:N,width:t,height:i,data:z,frameType:"xy",pointNodes:F,curve:$,stickyPositionCache:ge.current},a=O?Ci({annotations:e,context:s,..."object"==typeof O?O:{}}):e;return bi(a,r,B,s)},[Y,O,B,t,i,I,N,z,n,F,$,G]),Pe=Si(j);ks(()=>{if(!Pe?.locked||!j)return;let e=e=>{"Escape"===e.key&&Pi(j)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[Pe?.locked,j]);let Se=ke.node||o||f||m||v||P||S||Ce&&Ce.length>0||y||H||Pe,Me=bs(()=>({width:t,height:i,xTicks:Q,yTicks:ie,yTicksRight:he,labelMeasurer:be,axes:l}),[t,i,Q,ie,he,be,l]),Re=ae(ve&&!!be,Me),Ye=As(),{titleId:Te,descId:Le,labelledBy:De}=ai(x||D||Ye);return Se?/* @__PURE__ */Es("svg",{ref:Re.ref,"data-axis-label-layout":ve?JSON.stringify(Re.assessment):void 0,role:"img","aria-labelledby":De,width:r,height:s,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[
|
|
5
|
+
/* @__PURE__ */Ds("title",{id:Te,children:ri(f,"XY Chart")}),
|
|
6
|
+
/* @__PURE__ */Es("desc",{id:Le,children:[si(f,m,{familyPhrase:"XY data visualization",fallback:"XY data visualization"}),se(we)]}),
|
|
7
|
+
/* @__PURE__ */Es("g",{transform:`translate(${a.left},${a.top})`,children:[y&&n&&(!W||X)&&/* @__PURE__ */Ds(pe,{axes:l,xTicks:Q,yTicks:ie,width:t,height:i}),o&&n&&(()=>{let{xAxis:e,yAxis:r,xOrient:s,yOrient:a,leftAxis:n}=sr(l),o="top"===s?0:i,d="right"===a?t:0,p="top"===s?-1:1,g="right"===a?1:-1,y=!e||!1!==e.baseline,f=!r||!1!==r.baseline,m=e?.jaggedBase||!1,x=r?.jaggedBase||!1,v=e?.landmarkTicks,b=r?.landmarkTicks,w=ue(e?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),k=ue(r?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),A="var(--semiotic-text-secondary, var(--semiotic-text, #666))",_="var(--semiotic-text, #333)",C=ee,P={fontSize:"var(--semiotic-tick-font-size, 12px)"},S={fontSize:"calc(var(--semiotic-tick-font-size, 12px) + 1px)"},M={fontSize:"var(--semiotic-axis-label-font-size, 12px)"},R=e?.tickAnchor,Y=r?.tickAnchor,T=e?.label??c,L=r?.label??("right"===a?u??h:h),D="right"===a?t+Z-15:15-J,E=ce(Q),O=ce(ie);/* @__PURE__ */
|
|
8
|
+
return Es("g",{className:"stream-axes",style:{fontFamily:"var(--semiotic-font-family, sans-serif)"},children:[!1!==e?.visible&&/* @__PURE__ */Es("g",{className:"semiotic-axis semiotic-axis-"+s,"data-orient":s,children:[(!W||X)&&y&&!m&&/* @__PURE__ */Ds("line",{x1:0,y1:o,x2:t,y2:o,...w}),(!W||X)&&m&&/* @__PURE__ */Ds("path",{d:de(s,t,i),fill:"none",...w}),Q.map((e,t)=>{let i=!!v&&("function"==typeof v?v(e.value,t):Jt(e.value,t>0?Q[t-1].value:void 0));/* @__PURE__ */
|
|
9
|
+
return Es("g",{transform:`translate(${e.pixel},${o})`,children:[
|
|
10
|
+
/* @__PURE__ */Ds("line",{y2:5*p,...w}),"string"==typeof e.label||"number"==typeof e.label?/* @__PURE__ */Ds("text",{y:p*(C?12:18),textAnchor:C?"end":oe(R,e.pixel===E.min,e.pixel===E.max),fontWeight:i?600:400,fill:A,fontSize:i?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...i?S:P},transform:C?"top"===s?"rotate(45)":"rotate(-45)":void 0,children:e.label}):/* @__PURE__ */Ds("foreignObject",{x:-30,y:"top"===s?-30:6,width:60,height:24,style:{overflow:"visible"},children:/* @__PURE__ */Ds("div",{style:{textAlign:"center",userSelect:"none",...P},children:e.label})})]},"xtick-"+t)}),T&&/* @__PURE__ */Ds("text",{x:t/2,y:"top"===s?-(C?58:40):i+(C?58:40),textAnchor:"middle",fill:_,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...M},children:T})]}),!1!==r?.visible&&/* @__PURE__ */Es("g",{className:"semiotic-axis semiotic-axis-"+a,"data-orient":a,children:[(!W||X)&&f&&!x&&/* @__PURE__ */Ds("line",{x1:d,y1:0,x2:d,y2:i,...k}),(!W||X)&&x&&/* @__PURE__ */Ds("path",{d:de(a,t,i),fill:"none",...k}),ie.map((e,t)=>{let i=!!b&&("function"==typeof b?b(e.value,t):Jt(e.value,t>0?ie[t-1].value:void 0));/* @__PURE__ */
|
|
11
|
+
return Es("g",{transform:`translate(${d},${e.pixel})`,children:[
|
|
12
|
+
/* @__PURE__ */Ds("line",{x2:5*g,...k}),"string"==typeof e.label||"number"==typeof e.label?/* @__PURE__ */Ds("text",{x:8*g,textAnchor:"right"===a?"start":"end",dominantBaseline:le(Y,e.pixel===O.min,e.pixel===O.max),fontWeight:i?600:400,fill:A,fontSize:i?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...i?S:P},children:e.label}):/* @__PURE__ */Ds("foreignObject",{x:"right"===a?8:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:/* @__PURE__ */Ds("div",{style:{textAlign:"right"===a?"left":"right",userSelect:"none",...P},children:e.label})})]},"ytick-"+t)}),L&&/* @__PURE__ */Ds("text",{x:D,y:i/2,textAnchor:"middle",fill:_,transform:`rotate(${"right"===a?90:-90}, ${D}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...M},children:L})]}),(()=>{let e=l?.find(e=>"right"===e.orient);if(!n||!e||!1===e.visible||0===he.length)return null;let r=!1!==e.baseline,s=e.landmarkTicks,a=e.label||u,o=e.tickAnchor,c=ue(e.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),h=ce(he);/* @__PURE__ */
|
|
13
|
+
return Es("g",{className:"semiotic-axis semiotic-axis-right","data-orient":"right",children:[r&&!e.jaggedBase&&/* @__PURE__ */Ds("line",{x1:t,y1:0,x2:t,y2:i,...c}),e.jaggedBase&&/* @__PURE__ */Ds("path",{d:de("right",t,i),fill:"none",...c}),he.map((e,i)=>{let r=!!s&&("function"==typeof s?s(e.value,i):Jt(e.value,i>0?he[i-1].value:void 0));/* @__PURE__ */
|
|
14
|
+
return Es("g",{transform:`translate(${t},${e.pixel})`,children:[
|
|
15
|
+
/* @__PURE__ */Ds("line",{x2:5,...c}),"string"==typeof e.label||"number"==typeof e.label?/* @__PURE__ */Ds("text",{x:8,textAnchor:"start",dominantBaseline:le(o,e.pixel===h.min,e.pixel===h.max),fontWeight:r?600:400,fill:A,fontSize:r?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...r?S:P},children:e.label}):/* @__PURE__ */Ds("foreignObject",{x:8,y:-12,width:60,height:24,style:{overflow:"visible"},children:/* @__PURE__ */Ds("div",{style:{textAlign:"left",userSelect:"none",...P},children:e.label})})]},"ytick-r-"+i)}),a&&/* @__PURE__ */Ds("text",{x:t+Z-15,y:i/2,textAnchor:"middle",fill:_,transform:`rotate(90, ${t+Z-15}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...M},children:a})]})})()]})})(),Ce,ke.node,S&&n&&M&&R&&/* @__PURE__ */Es(Ls,{children:[S.top&&/* @__PURE__ */Ds("g",{transform:"translate(0, 0)",children:/* @__PURE__ */Ds(fe,{orient:"top",config:at(S.top),values:M,scale:n.x,size:a.top,length:t})}),S.bottom&&/* @__PURE__ */Ds("g",{transform:`translate(0, ${i})`,children:/* @__PURE__ */Ds(fe,{orient:"bottom",config:at(S.bottom),values:M,scale:n.x,size:a.bottom,length:t})}),S.left&&/* @__PURE__ */Ds("g",{transform:"translate(0, 0)",children:/* @__PURE__ */Ds(fe,{orient:"left",config:at(S.left),values:R,scale:n.y,size:a.left,length:i})}),S.right&&/* @__PURE__ */Ds("g",{transform:`translate(${t}, 0)`,children:/* @__PURE__ */Ds(fe,{orient:"right",config:at(S.right),values:R,scale:n.y,size:a.right,length:i})})]}),P,Pe&&Pe.sourceId!==V&&n?.x&&(()=>{let e=n.x(Pe.xValue);if(null==e||0>e||e>t)return null;let r=Pe.locked;/* @__PURE__ */
|
|
16
|
+
return Ds("line",{x1:e,y1:0,x2:e,y2:i,stroke:r?"white":"var(--semiotic-text-secondary, rgba(0,0,0,0.25))",strokeWidth:r?1.5:1,strokeDasharray:r?"6,3":"4,4",pointerEvents:"none"})})(),H]}),
|
|
17
|
+
/* @__PURE__ */Ds(Mi,{title:f,totalWidth:r,marginTop:a.top}),ui({legend:v,totalWidth:r,totalHeight:s,margin:a,legendPosition:_,title:f,legendLayout:C,axisChrome:U,legendHoverBehavior:b,legendClickBehavior:w,legendHighlightedCategory:k,legendIsolatedCategories:A})]}):null}function Se(e,t,i,r,s){let[a,n]=Is([]),[o,l]=Is([]),c=null!=t,h=c?[t.top,t.bottom,t.left,t.right].join("|"):"",u=Os((t=e.current?.getData()??[])=>{let i=ye(t,r,s);n(i.xValues),l(i.yValues)},[e,r,s]);return Bs(()=>{if(!c)return n([]),void l([]);u()},[i,c,h,u]),{marginalXValues:a,marginalYValues:o,refreshMarginalValues:u}}function Me(e){if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length)return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}let t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return t?[+t[1],+t[2],+t[3]]:[128,128,128]}function Re(e,t){let i=e.fillGradient;if(!i||"object"!=typeof i)return null;let r=1/0;for(let[,t]of e.topPath)r=Math.min(r,t);let s=-1/0;for(let[,t]of e.bottomPath)s=Math.max(s,t);if(!Number.isFinite(r)||!Number.isFinite(s))return null;let a=Di(i.stops,Ri(e.style.fill));return a?/* @__PURE__ */$s("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:0,y1:r,x2:0,y2:s,children:a}):null}function Ye(e,t,i,r){if(!e||2>t.length)return null;let s=Di(e.stops,r);return s?/* @__PURE__ */$s("linearGradient",{id:i,gradientUnits:"userSpaceOnUse",x1:t[0][0],y1:0,x2:t[t.length-1][0],y2:0,children:s}):null}function Te(e,t,i,r=30){let s=Le(e,t,i,r);return"area"===e.type?s:Hi(s,e,"xy-cursor-"+t)}function Le(e,t,i,r=30){switch(e.type){case"line":{let r=e;if(0===r.path.length)return null;let s=kr(r.curve),a=s?Fs().x(([e])=>e).y(([,e])=>e).curve(s)(r.path)??"":"M"+r.path.map(([e,t])=>`${e},${t}`).join("L"),n=Ti(`${i?i+"-":""}line-${t}-stroke-gradient`),o=Ye(r.strokeGradient,r.path,n,r.style.stroke||"#4e79a7");/* @__PURE__ */
|
|
18
|
+
return Ws(Ns.Fragment,{children:[o&&/* @__PURE__ */$s("defs",{children:o}),
|
|
19
|
+
/* @__PURE__ */$s("path",{d:a,fill:"none",stroke:o?`url(#${n})`:r.style.stroke||"#4e79a7",strokeWidth:r.style.strokeWidth??2,strokeDasharray:r.style.strokeDasharray,opacity:r.style.opacity})]},"line-"+t)}case"area":{let s=e;if(0===s.topPath.length)return null;let a=kr(s.curve),n=!a||2>s.topPath.length||2>s.bottomPath.length?`M${s.topPath.map(([e,t])=>`${e},${t}`).join("L")}L${[...s.bottomPath].reverse().map(([e,t])=>`${e},${t}`).join("L")}Z`:zs().x(([e])=>e).y0((e,t)=>s.bottomPath[t][1]).y1(([,e])=>e).curve(a)(s.topPath)??"",o=`${i?i+"-":""}area-${t}-hatch`,l=br(s.style.fill)?wr(s.style.fill,o):void 0,c=Ti(`${i?i+"-":""}area-${t}-gradient`),h=Re(s,c),u=h?`url(#${c})`:l?`url(#${o})`:Ri(s.style.fill),d=h?void 0:s.style.fillOpacity??s.style.opacity??.7,p=a?Fs().x(([e])=>e).y(([,e])=>e).curve(a)(s.topPath)??"":"M"+s.topPath.map(([e,t])=>`${e},${t}`).join("L"),g=Ni(s),y=g&&r>=0?/* @__PURE__ */$s("path",{d:p,fill:"none",stroke:"transparent",strokeWidth:Math.max(1,2*r),strokeLinecap:"round",pointerEvents:"stroke",style:{cursor:g},"data-semiotic-mark-cursor":g,"data-semiotic-cursor-hit-target":"area-top-path","aria-hidden":"true"},`area-${t}-cursor-target`):null,f=Ti(`${i?i+"-":""}area-${t}-stroke-gradient`),m=!(!s.colorThresholds?.length||!s.rawValues||s.rawValues.length!==s.topPath.length),x=!!s.strokeColorBands?.length,v=m||x?null:Ye(s.strokeGradient,s.topPath,f,s.style.stroke||"#4e79a7"),b=s.style.strokeWidth??2,w=1/0,k=-1/0;for(let[e]of s.topPath)w>e&&(w=e),e>k&&(k=e);let A=x?s.strokeColorBands.map((e,r)=>Ti(`${i?i+"-":""}area-${t}-stroke-band-${r}`)):[],_=x?s.strokeColorBands.map((e,t)=>/* @__PURE__ */$s("clipPath",{id:A[t],children:/* @__PURE__ */$s("rect",{x:w-b,y:e.y,width:k-w+2*b,height:e.height})},A[t])):null,C=s.style.stroke&&"none"!==s.style.stroke?x?s.strokeColorBands.map((e,i)=>/* @__PURE__ */$s("path",{d:p,fill:"none",stroke:e.color??Ri(s.style.stroke),strokeWidth:b,opacity:(s.style.opacity??1)*(e.opacity??1),clipPath:`url(#${A[i]})`},`area-${t}-stroke-band-${i}`)):m?tt(s.topPath,s.rawValues,s.colorThresholds,Ri(s.style.stroke)).map((e,i)=>/* @__PURE__ */$s("path",{d:"M"+e.path.map(([e,t])=>`${e},${t}`).join("L"),fill:"none",stroke:e.color,strokeWidth:b,opacity:s.style.opacity},`area-${t}-threshold-${i}`)):/* @__PURE__ */$s("path",{d:p,fill:"none",stroke:v?`url(#${f})`:Ri(s.style.stroke),strokeWidth:b,opacity:s.style.opacity}):null;if(s.clipRect){let e=`${i?i+"-":""}area-clip-${t}`;/* @__PURE__ */
|
|
20
|
+
return Ws("g",{children:[
|
|
21
|
+
/* @__PURE__ */Ws("defs",{children:[h,!h&&l,v,_,
|
|
22
|
+
/* @__PURE__ */$s("clipPath",{id:e,children:/* @__PURE__ */$s("rect",{x:s.clipRect.x,y:s.clipRect.y,width:s.clipRect.width,height:s.clipRect.height})})]}),
|
|
23
|
+
/* @__PURE__ */Ws("g",{clipPath:`url(#${e})`,children:[
|
|
24
|
+
/* @__PURE__ */$s("path",{d:n,fill:u,fillOpacity:d,opacity:h?s.style.opacity:void 0,stroke:"none"}),C,y]})]},"area-"+t)}/* @__PURE__ */
|
|
25
|
+
return Ws(Ns.Fragment,{children:[(h||l||v||_)&&/* @__PURE__ */Ws("defs",{children:[h,!h&&l,v,_]}),
|
|
26
|
+
/* @__PURE__ */$s("path",{d:n,fill:u,fillOpacity:d,opacity:h?s.style.opacity:void 0,stroke:"none"}),C,y]},"area-"+t)}case"point":case"rect":return Bi(e,t,i);case"symbol":return Ei(e,t);case"glyph":return Li(e,e.x,e.y,`${i??""}glyph-${e.pointId??t}`);case"heatcell":{let i=e,r={x:i.x,y:i.y,width:i.w,height:i.h,fill:i.fill,stroke:i.style?.stroke,strokeWidth:i.style?.strokeWidth,...null!=i.style?.opacity&&{opacity:i.style.opacity}};if(i.showValues&&null!=i.value&&i.w>=20&&i.h>=20){let e=i.valueFormat?i.valueFormat(i.value):Number.isInteger(i.value)?i.value+"":100>Math.abs(i.value)?1>Math.abs(i.value)?i.value.toPrecision(3):i.value.toFixed(1):i.value.toFixed(0),[s,a,n]=Me(i.fill),o=.299*s+.587*a+.114*n>128?"#000":"#fff",l=Math.max(10,Math.min(16,.3*Math.min(i.w,i.h)));/* @__PURE__ */
|
|
27
|
+
return Ws("g",{children:[
|
|
28
|
+
/* @__PURE__ */$s("rect",{...r}),
|
|
29
|
+
/* @__PURE__ */$s("text",{className:"semiotic-heatmap-value",x:i.x+i.w/2,y:i.y+i.h/2,textAnchor:"middle",dominantBaseline:"middle",fill:o,fontSize:l+"px",fontFamily:"var(--semiotic-font-family, sans-serif)",children:e})]},"heatcell-"+t)}/* @__PURE__ */
|
|
30
|
+
return $s("rect",{...r},"heatcell-"+t)}case"candlestick":{let r=e,s=`${i?i+"-":""}candle-${t}-hatch`,a=br(r.style?.fill)?wr(r.style.fill,s):void 0,n=a?`url(#${s})`:void 0,{fill:o,...l}=r.style??{};if(r.isRange){let e=r.dotRadius??Math.max(2,r.bodyWidth/2),i=n??r.wickColor;/* @__PURE__ */
|
|
31
|
+
return Ws(Ns.Fragment,{children:[a&&/* @__PURE__ */$s("defs",{children:a}),
|
|
32
|
+
/* @__PURE__ */Ws("g",{style:l,children:[
|
|
33
|
+
/* @__PURE__ */$s("line",{x1:r.x,y1:r.highY,x2:r.x,y2:r.lowY,stroke:r.wickColor,strokeWidth:r.wickWidth,opacity:r.style?.opacity}),
|
|
34
|
+
/* @__PURE__ */$s("circle",{cx:r.x,cy:r.highY,r:e,fill:i,opacity:r.style?.opacity}),
|
|
35
|
+
/* @__PURE__ */$s("circle",{cx:r.x,cy:r.lowY,r:e,fill:i,opacity:r.style?.opacity})]})]},"candle-"+t)}let c=Math.min(r.openY,r.closeY),h=Math.max(Math.abs(r.openY-r.closeY),1),u=r.isUp?r.upColor:r.downColor,d=n??u;/* @__PURE__ */
|
|
36
|
+
return Ws(Ns.Fragment,{children:[a&&/* @__PURE__ */$s("defs",{children:a}),
|
|
37
|
+
/* @__PURE__ */Ws("g",{style:l,children:[
|
|
38
|
+
/* @__PURE__ */$s("line",{x1:r.x,y1:r.highY,x2:r.x,y2:r.lowY,stroke:r.wickColor,strokeWidth:r.wickWidth,opacity:r.style?.opacity}),
|
|
39
|
+
/* @__PURE__ */$s("rect",{x:r.x-r.bodyWidth/2,y:c,width:r.bodyWidth,height:h,fill:d,stroke:n?r.wickColor:u,strokeWidth:1,opacity:r.style?.opacity})]})]},"candle-"+t)}default:return null}}function De(e,t){let i=e.trim();if(/^#[0-9a-f]{3}$/i.test(i)){let e=i[1],r=i[2],s=i[3];return`#${e}${e}${r}${r}${s}${s}${t}`}if(/^#[0-9a-f]{6}$/i.test(i))return`${i}${t}`;let r=i.match(/^rgb\s*\(\s*([^)]+?)\s*\)$/i);return r?`rgba(${r[1]}, ${(parseInt(t,16)/255).toFixed(3)})`:i}function Ee(e){if(!e)return Xs;let t=getComputedStyle(e),i=t.getPropertyValue("--semiotic-border").trim(),r=t.getPropertyValue("--semiotic-text-secondary").trim(),s=t.getPropertyValue("--semiotic-bg").trim(),a=t.getPropertyValue("--semiotic-primary").trim(),n=r||t.getPropertyValue("--text-secondary").trim(),o=t.getPropertyValue("--text-primary").trim(),l=i||t.getPropertyValue("--surface-3").trim(),c=s||t.getPropertyValue("--surface-0").trim();return n||o||i||a?{axisStroke:l||Xs.axisStroke,tickText:n||Xs.tickText,crosshair:n?De(n,"66"):Xs.crosshair,hoverFill:c?De(c,"4D"):Xs.hoverFill,hoverStroke:n?De(n,"99"):Xs.hoverStroke,pointRing:c||Xs.pointRing,primary:a||Xs.primary,background:c||Xs.background}:Xs}function Oe(){let e=-1,t=Xs;return{resolve(i){if(!i)return Xs;let r=vr();return r===e||(t=Ee(i),e=r),t},invalidate(){e=-1}}}function Be(e){if(!e)return;let t=[];for(let i of e)if("point"===i.type)t.push(i);else if("symbol"===i.type)t.push({pointId:i.pointId,x:i.x,y:i.y,r:fr(i.size)});else if("glyph"===i.type){let e=mr(i.glyph,i.size);t.push({pointId:i.pointId,x:i.x+e.centerDx,y:i.y+e.centerDy,r:e.radius})}return t}function Ie(e,t,i,r,s){js(()=>{let a=!1,n=[];if(t&&!qe("custom")?.canvasRenderers.length&&n.push(import("./c-ABMGCCLT.min.js").then(e=>{Ue(e.customXYPlugin)})),!t&&"custom"!==e&&!qe(e)?.canvasRenderers.length&&n.push(import("./c-IIV73MUW.min.js").then(e=>{e.registerBuiltInXYPlugins()})),0!==n.length)return Promise.all(n).then(()=>{a||(t?s.current?.markStylePaintPending():i.current=!0,r())}),()=>{a=!0}},[e,t,i,r,s])}function Ne(e,t,i,r,s,a,n){if(!1===s.crosshair)return;let o=t.allSeries,l=o&&o.length>0,c=t.xPx??t.x;e.save();let h="object"==typeof s.crosshair?s.crosshair:{};e.strokeStyle=h.stroke||n.crosshair;let u=h.strokeWidth??1;if(e.setLineDash(h.strokeDasharray?h.strokeDasharray.split(/[\s,]+/).map(Number):[4,4]),u>0&&(e.lineWidth=u,e.beginPath(),e.moveTo(l?c:t.x,0),e.lineTo(l?c:t.x,r),e.stroke(),l||(e.beginPath(),e.moveTo(0,t.y),e.lineTo(i,t.y),e.stroke())),e.restore(),l){e.lineWidth=2,e.strokeStyle=n.pointRing;for(let t of o)null!=t.valuePx&&(e.beginPath(),e.arc(c,t.valuePx,4,0,2*Math.PI),e.fillStyle=t.color||n.primary,e.fill(),e.stroke())}else{let i=s.pointColor||et(a)||n.primary;e.beginPath(),e.arc(t.x,t.y,4,0,2*Math.PI),e.fillStyle=i,e.fill(),e.strokeStyle=n.pointRing,e.lineWidth=2,e.stroke()}}function ze(e,t,i,r,s){if(!i)return;let a="group"in i?i.group:void 0;if(void 0!==a)for(let i of t){if("line"!==i.type||i.group!==a||2>i.path.length)continue;let t="function"==typeof r.style?i.datum?r.style(i.datum):{}:r.style||{};e.save(),e.beginPath(),e.moveTo(i.path[0][0],i.path[0][1]);for(let t=1;i.path.length>t;t++)e.lineTo(i.path[t][0],i.path[t][1]);e.strokeStyle=t.stroke||i.style.stroke||s.primary;let n=t.strokeWidth??(i.style.strokeWidth??2)+2;n>0?(e.lineWidth=n,e.globalAlpha=t.opacity??1,e.stroke(),e.restore()):e.restore()}}function Fe(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?e+"":e.toFixed(2):e instanceof Date?e.toLocaleString():e+""}function $e({hover:e}){let t=e.data??{},i=t.__aggregateValue??t.y??t.value,r=t.x??t.time;if(void 0===i&&void 0===r){let e=_i(t);if(null!=e.title||e.entries.length>0)/* @__PURE__ */
|
|
40
|
+
return Hs("div",{className:"semiotic-tooltip",style:dr,children:[null!=e.title&&/* @__PURE__ */Vs("div",{style:{fontWeight:600,marginBottom:e.entries.length?2:0},children:e.title+""}),e.entries.map(e=>/* @__PURE__ */Hs("div",{style:{opacity:.7,fontSize:11},children:[e.key,":"," ",
|
|
41
|
+
/* @__PURE__ */Vs("span",{style:{fontWeight:600},children:Fe(e.value)})]},e.key))]})}/* @__PURE__ */
|
|
42
|
+
return Hs("div",{className:"semiotic-tooltip",style:dr,children:[
|
|
43
|
+
/* @__PURE__ */Vs("div",{style:{fontWeight:600,marginBottom:2},children:Fe(i)}),
|
|
44
|
+
/* @__PURE__ */Vs("div",{style:{opacity:.7,fontSize:11},children:Fe(r)})]})}function We(e,t){if(!t||0===e.length||!e.some(e=>null!=e&&"object"==typeof e&&Array.isArray(e[t])))return e;let i=[];for(let r of e){if(null==r||"object"!=typeof r)continue;let e=r[t];if(!Array.isArray(e))continue;let s=r.label??r.id??r.key;for(let t of e)null==t||"object"!=typeof t||i.push(null==s?t:{...t,_lineGroup:s})}return i}function Xe(e){let{canvas:t,pointer:i,store:r,margin:s,width:a,height:n}=e;ji(t,i,i=>{let o=t.getBoundingClientRect(),l=i.clientX-o.left-s.left,c=i.clientY-o.top-s.top;if(0>l||l>a||0>c||c>n)return;let h=X(r.scene,l,c,wi(e.hoverRadius,i.pointerType),e.geometryMoved?null:r.quadtree,r.maxPointRadius);return Ni(h?.node)})}function je(e){if(e)return"x"===e.dimension?"pan-y":"y"===e.dimension?"pan-x":"none"}function Ve({brush:e,onBrush:t,linkedBrush:i,xAccessor:r,yAccessor:s,defaultDimension:a="xy"}){let n=Gi(i),o=!!e||!!n||!!t,l=n?.xField||("string"==typeof r?r:void 0),c=n?.yField||("string"==typeof s?s:void 0),h="y"!==a||n?.xField?l:void 0,u="x"!==a||n?.yField?c:void 0,d=Zi({name:n?.name||"__unused_brush__",xField:h,yField:u}),p=n?"xyBrush"===d.brushInteraction.brush?"xy":"xBrush"===d.brushInteraction.brush?"x":"y":a,g=ea(d.brushInteraction);g.current=d.brushInteraction;let y=Qs(e=>{let i=g.current;if(!e)return n&&i.end(null),void t?.(null);n&&i.end("xyBrush"===i.brush?[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:"xBrush"===i.brush?e.x:e.y),t?.(e)},[n,t]);return o?{brushStreamProps:{brush:{dimension:p},onBrush:y}}:{brushStreamProps:{}}}import{a as He,b as Ge}from"./c-VN557BQE.min.js";import{a as Ue,b as qe,c as Ke,d as Je,e as Ze,g as Qe}from"./c-MTX2AO5S.min.js";import{a as et}from"./c-7FKPPCGN.min.js";import{a as tt}from"./c-STHZWF3D.min.js";import{a as it,b as rt}from"./c-TVKZC4BY.min.js";import{a as st}from"./c-GYLOSK7M.min.js";import{a as at}from"./c-UUDAON4Z.min.js";import{a as nt,b as ot,c as lt,d as ct,f as ht,g as ut,h as dt,i as pt}from"./c-QPO24R7Q.min.js";import{c as gt,d as yt,j as ft,k as mt}from"./c-HK4OSLZA.min.js";import{a as xt,c as vt,e as bt,f as wt,g as kt,h as At,i as _t,j as Ct,k as Pt,l as St}from"./c-JOPGDP6N.min.js";import{e as Mt}from"./c-NATWERHZ.min.js";import{b as Rt}from"./c-BYJJ7EMG.min.js";import{a as Yt}from"./c-QXLDCATV.min.js";import{a as Tt,b as Lt,d as Dt}from"./c-U5XVLSHN.min.js";import{A as Et,D as Ot,E as Bt,F as It,W as Nt,a as zt,b as Ft,c as $t,d as Wt,e as Xt,f as jt,g as Vt,h as Ht,i as Gt,j as Ut,k as qt,l as Kt,m as Jt,o as Zt,p as Qt,q as ei,r as ti,s as ii,t as ri,u as si,v as ai,x as ni,y as oi,z as li}from"./c-SAP5KY6R.min.js";import{c as ci}from"./c-CLLCX3PT.min.js";import{Ca as hi,D as ui,Fa as di,Ga as pi,H as gi,Ha as yi,Ia as fi,J as mi,Ja as xi,Ka as vi,L as bi,La as wi,M as ki,Ma as Ai,Na as _i,R as Ci,S as Pi,T as Si,U as Mi,W as Ri,Wa as Yi,X as Ti,Y as Li,Z as Di,aa as Ei,b as Oi,ba as Bi,c as Ii,ca as Ni,d as zi,da as Fi,e as $i,ea as Wi,f as Xi,ga as ji,ha as Vi,ia as Hi,ib as Gi,ja as Ui,ka as qi,o as Ki,oa as Ji,ob as Zi,p as Qi,q as er,qa as tr,ra as ir,s as rr,t as sr,ta as ar,u as nr,va as or,wa as lr,x as cr,xa as hr,y as ur,ya as dr}from"./c-UMGHCBH5.min.js";import{o as pr,p as gr,s as yr}from"./c-Y342FJ6K.min.js";import{b as fr,i as mr,k as xr,o as vr,r as br,t as wr,w as kr}from"./c-3BYZXCX3.min.js";import{e as Ar,h as _r}from"./c-5NYONM6V.min.js";import{e as Cr}from"./c-U6NLVFN4.min.js";import*as Pr from"react";import{forwardRef as Sr,memo as Mr,useCallback as Rr,useEffect as Yr,useId as Tr,useMemo as Lr,useRef as Dr,useState as Er}from"react";import*as Or from"react";import{jsx as Br}from"react/jsx-runtime";var Ir=null,Nr=null,zr=/* @__PURE__ */new Set;import{scaleLinear as Fr,scaleLog as $r,scaleSymlog as Wr,scaleTime as Xr}from"d3-scale";var jr=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Vr=["scene-style","data-paint","accessibility","evidence"],Hr=(e,t)=>({retainedData:e,invalidations:t}),Gr=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ur=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],qr=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Kr=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Jr=["scene-geometry","data-paint","accessibility","evidence"],Zr=["scene-style","data-paint","accessibility","evidence"],Qr=[],es={chartType:Hr("rebuild",Gr),runtimeMode:Hr("rebuild",Gr),xAccessor:Hr("rebuild",Gr),yAccessor:Hr("rebuild",Gr),timeAccessor:Hr("rebuild",Gr),valueAccessor:Hr("rebuild",Gr),y0Accessor:Hr("rebuild",Gr),boundsAccessor:Hr("rebuild",Gr),band:Hr("rebuild",Gr),openAccessor:Hr("rebuild",Gr),highAccessor:Hr("rebuild",Gr),lowAccessor:Hr("rebuild",Gr),closeAccessor:Hr("rebuild",Gr),candlestickRangeMode:Hr("rebuild",Gr),accessorRevision:Hr("rebuild",Gr),groupAccessor:Hr("rebuild",Ur),categoryAccessor:Hr("rebuild",Ur),lineDataAccessor:Hr("rebuild",Ur),colorAccessor:Hr("rebuild",Zr),sizeAccessor:Hr("rebuild",Jr),symbolAccessor:Hr("rebuild",Jr),pointIdAccessor:Hr("rebuild",Jr),xScaleType:Hr("preserve",qr),yScaleType:Hr("preserve",qr),xExtent:Hr("preserve",qr),invertY:Hr("preserve",qr),yExtent:Hr("preserve",qr),extentPadding:Hr("preserve",qr),scalePadding:Hr("preserve",qr),axisExtent:Hr("preserve",qr),yAxisExtent:Hr("preserve",qr),binSize:Hr("preserve",qr),normalize:Hr("preserve",qr),heatmapAggregation:Hr("preserve",qr),heatmapXBins:Hr("preserve",qr),heatmapYBins:Hr("preserve",qr),arrowOfTime:Hr("preserve",Kr),baseline:Hr("preserve",Kr),stackOrder:Hr("preserve",Kr),sizeRange:Hr("preserve",Kr),curve:Hr("preserve",Kr),areaGroups:Hr("preserve",Kr),customLayout:Hr("preserve",Kr),layoutConfig:Hr("preserve",Kr),layoutMargin:Hr("preserve",Kr),symbolMap:Hr("preserve",Jr),showValues:Hr("preserve",Jr),heatmapValueFormat:Hr("preserve",Jr),trackHoverRows:Hr("preserve",Jr),lineStyle:Hr("preserve",Zr),pointStyle:Hr("preserve",Zr),areaStyle:Hr("preserve",Zr),barStyle:Hr("preserve",Zr),swarmStyle:Hr("preserve",Zr),waterfallStyle:Hr("preserve",Zr),candlestickStyle:Hr("preserve",Zr),boundsStyle:Hr("preserve",Zr),gradientFill:Hr("preserve",Zr),lineGradient:Hr("preserve",Zr),semanticLineStops:Hr("preserve",Zr),colorScheme:Hr("preserve",Zr),themeCategorical:Hr("preserve",Zr),themeSemantic:Hr("preserve",Zr),themeSequential:Hr("preserve",Zr),themeDiverging:Hr("preserve",Zr),barColors:Hr("preserve",Zr),decay:Hr("preserve",Zr),pulse:Hr("preserve",Zr),staleness:Hr("preserve",Zr),layoutSelection:Hr("preserve",Zr),annotations:Hr("preserve",["overlay","accessibility","evidence"]),windowSize:Hr("preserve",Qr),windowMode:Hr("preserve",Qr),maxCapacity:Hr("preserve",Qr),clock:Hr("preserve",Qr),transition:Hr("preserve",Qr),introAnimation:Hr("preserve",Qr),onLayoutError:Hr("preserve",Qr)},ts=Hr("preserve",Kr),is=class{constructor(){this.tracker=new Qi}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}},jr)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Vr):this.recordNoop("restyle")}recordConfig(e,t=!1){let i=z(e);return this.tracker.record({kind:"config",keys:e},t?/* @__PURE__ */new Set([...i.invalidations,...Jr]):i.invalidations)}};import{quadtree as rs}from"d3-quadtree";var ss=class{constructor(){this.maxRadius=0,this.tree=null}get quadtree(){return this.tree}get maxPointRadius(){return this.maxRadius}clear(){this.tree=null,this.maxRadius=0}rebuild(e,t){if("scatter"!==e&&"bubble"!==e&&"custom"!==e)return void this.clear();let i=0,r=0;for(let e of t)"point"===e.type&&!1!==e.interactive&&(i++,e.r>r&&(r=e.r));if(this.maxRadius=r,500>=i)return void(this.tree=null);let s=Array(i),a=0;for(let e of t)"point"===e.type&&!1!==e.interactive&&(s[a++]=e);this.tree=rs().x(e=>e.x).y(e=>e.y).addAll(s)}},as=class e{constructor(e){if(this.xExtent=new ot,this.yExtent=new ot,this.growingCapacityWarned=!1,this.windowSizeWarned=!1,this.resolvedRibbons=[],this.timestampBuffer=null,this.activeTransition=null,this._hasRenderedOnce=!1,this.prevPositionMap=/* @__PURE__ */new Map,this.prevPathMap=/* @__PURE__ */new Map,this.exitNodes=[],this.lastIngestTime=0,this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=/* @__PURE__ */new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this._ingestVersion=0,this._datumIndexCache=null,this._bufferArrayCache=null,this._bufferDirty=!0,this.needsFullRebuild=!0,this.lastLayout=null,this.updateResults=new is,this.scales=null,this.scene=[],this.version=0,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.xIsDate=!1,this.spatialIndex=new ss,this._lastBoundedInsertsRef=null,this.applyPulse=(e,t,i)=>!(!this.config.pulse||!this.timestampBuffer)&&vt(this.config.pulse,e,t,this.timestampBuffer,this.getDatumIndexMap(t),i),this.config=e,this.buffer=new xt(e.windowSize),this.growingCap=e.windowSize,["bar","swarm","waterfall"].includes(e.chartType)||"streaming"===e.runtimeMode?(this.getX=Lt(e.timeAccessor||e.xAccessor,"time"),this.getY=Lt(e.valueAccessor||e.yAccessor,"value")):(this.getX=Lt(e.xAccessor,"x"),this.getY=Lt(e.yAccessor,"y")),this.getGroup=Dt(e.groupAccessor),this.getCategory=Dt(e.categoryAccessor),this.getSize=e.sizeAccessor?Lt(e.sizeAccessor,"size"):void 0,this.getColor=Dt(e.colorAccessor),this.getSymbol=Dt(e.symbolAccessor),this.getY0=e.y0Accessor?Lt(e.y0Accessor,"y0"):void 0,this.resolvedRibbons=v(e),this.getPointId=Dt(e.pointIdAccessor),"candlestick"===e.chartType){let t=null!=e.openAccessor,i=null!=e.closeAccessor;this.getOpen=t?Lt(e.openAccessor,"open"):void 0,this.getHigh=Lt(e.highAccessor,"high"),this.getLow=Lt(e.lowAccessor,"low"),this.getClose=i?Lt(e.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!t&&!i}e.pulse&&(this.timestampBuffer=new xt(e.windowSize))}currentTime(){return this.config.clock?.()??Xi()}syncPulseTimestampBuffer(){this.config.pulse?null!=this.timestampBuffer&&this.timestampBuffer.capacity===this.buffer.capacity&&this.timestampBuffer.size===this.buffer.size||(this.timestampBuffer=kt(this.buffer,this.currentTime())):this.timestampBuffer=null}pushDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.push(this.getHigh(e)),void this.yExtent.push(this.getLow(e));this.yExtent.push(this.getY(e)),this.getY0&&this.yExtent.push(this.getY0(e));for(let t of this.resolvedRibbons){let i=t.getTop(e),r=t.getBottom(e);Number.isFinite(i)&&this.yExtent.push(i),Number.isFinite(r)&&this.yExtent.push(r)}}evictDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.evict(this.getHigh(e)),void this.yExtent.evict(this.getLow(e));this.yExtent.evict(this.getY(e)),this.getY0&&this.yExtent.evict(this.getY0(e));for(let t of this.resolvedRibbons){let i=t.getTop(e),r=t.getBottom(e);Number.isFinite(i)&&this.yExtent.evict(i),Number.isFinite(r)&&this.yExtent.evict(r)}}rebuildYExtent(){this.yExtent.clear();for(let e of this.buffer)this.pushDatumYExtent(e)}rebuildExtents(){this.xExtent.clear(),this.yExtent.clear();for(let e of this.buffer)this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e)}ingest(e){if(e.bounded&&this._lastBoundedInsertsRef===e.inserts)return this.updateResults.recordNoop("replace"),!1;let t=this.currentTime();if(this.lastIngestTime=t,this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,e.bounded){this._lastBoundedInsertsRef=e.inserts,this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this.timestampBuffer&&this.timestampBuffer.clear();let i=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode;if(this.getX=i?Lt(this.config.timeAccessor||this.config.xAccessor,"time"):Lt(this.config.xAccessor,"x"),this.xIsDate=!1,e.inserts.length>0){let t=e.inserts[0],i=this.config.xAccessor,r="function"==typeof i?i(t):t[i||"x"],s=r instanceof Date,a="string"==typeof r&&Number.isFinite(He(r));if(this.xIsDate=s||a,a){let e="string"==typeof i?i:void 0;this.getX=e?t=>Ge(t[e]):e=>Ge(i(e))}}wt(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(let i of e.inserts)At(this.buffer,i,this.timestampBuffer,t),this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i)}else for(let i of e.inserts){if("growing"===this.config.windowMode&&this.buffer.full){let e=this.config.maxCapacity??1e5;e>this.growingCap&&(this.growingCap=Math.min(2*this.growingCap,e),this.buffer.resize(this.growingCap),this.timestampBuffer&&this.timestampBuffer.resize(this.growingCap),"production"!==process.env.NODE_ENV&&!this.growingCapacityWarned&&this.growingCap>=5e4&&(this.growingCapacityWarned=!0,console.warn(`[Semiotic] Growing window buffer reached ${this.growingCap} points (cap ${e}). Large canvas scenes are expensive — prefer a sliding window, aggregation, or an explicit maxCapacity if this is intentional.`)))}let e=At(this.buffer,i,this.timestampBuffer,t);this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i),null!=e&&(this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e))}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}computeScene(e){let{config:t,buffer:i}=this,r=this.scales,s=this.lastLayout;if(!this.needsFullRebuild&&!t.customLayout&&this.lastLayout&&this.scene.length>0&&this.scales&&0>=(this.config.scalePadding??0)&&(this.lastLayout.width!==e.width||this.lastLayout.height!==e.height))return void this.remapScene(e);this.xExtent.dirty&&this.xExtent.recalculate(i,this.getX),this.yExtent.dirty&&this.rebuildYExtent();let a=this.getBufferArray(),n=this.xExtent.extent,o=this.yExtent.extent,l="waterfall"===t.chartType&&i.size>0?C(a,this.getX,n,t.xExtent,t.xScaleType):w(n,t.xExtent),c=w(o,t.yExtent),h=!(!(d=t.yExtent)||null==d[0]||null==d[1]),u="exact"===(t.yAxisExtent??t.axisExtent);var d;if("stackedarea"===t.chartType&&!h&&i.size>0){let e=k({config:t,groups:this.groupData(a),getX:this.getX,getY:this.getY,bufferSize:i.size,ingestVersion:this._ingestVersion,stackExtentCache:this._stackExtentCache});c=e.yDomain,this._stackExtentCache=e.stackExtentCache}else"bar"===t.chartType&&t.binSize&&!h&&i.size>0?c=A(i,this.getX,this.getY,t.binSize,this.getCategory,t.extentPadding,u):"waterfall"===t.chartType&&!h&&i.size>0?c=_(i,this.getY,t.extentPadding,u):!h&&c[0]!==1/0&&(c=P(c,a,this.resolvedRibbons),c=S(c,{exactMode:u,extentPadding:t.extentPadding,userMin:t.yExtent?.[0],userMax:t.yExtent?.[1],yScaleType:t.yScaleType,dataYDomain:o}));c=M(c,t.yExtent,!!h),({xDomain:l,yDomain:c}=R(l,c,t.xScaleType)),this.scales=T({config:t,layout:e,xDomain:l,yDomain:c}),this._customLayoutFailedThisBuild=!1;let p=this.buildSceneNodes(e,a);if(this._customLayoutFailedThisBuild)return!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=r,this.lastLayout=s):(this.scene=[],this.spatialIndex.rebuild(this.config.chartType,this.scene)),void(this.needsFullRebuild=!0);this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=p,this.config.decay&&this.applyDecay(this.scene,a),this.config.pulse&&this.applyPulse(this.scene,a,this.currentTime()),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.prevPathMap.size>0)&&this.startTransition(),this.spatialIndex.rebuild(this.config.chartType,this.scene),this.needsFullRebuild=!1,this.lastLayout={width:e.width,height:e.height},this.version++}get quadtree(){return this.spatialIndex.quadtree}get maxPointRadius(){return this.spatialIndex.maxPointRadius}remapScene(e){let t=e.width/this.lastLayout.width,i=e.height/this.lastLayout.height;for(let e of this.scene)switch(e.type){case"line":for(let r of e.path)r[0]*=t,r[1]*=i;break;case"area":for(let r of e.topPath)r[0]*=t,r[1]*=i;for(let r of e.bottomPath)r[0]*=t,r[1]*=i;e.clipRect&&(e.clipRect={x:e.clipRect.x*t,y:e.clipRect.y*i,width:e.clipRect.width*t,height:e.clipRect.height*i}),e.strokeColorBands&&(e.strokeColorBands=e.strokeColorBands.map(e=>({...e,y:e.y*i,height:e.height*i})));break;case"point":case"glyph":e.x*=t,e.y*=i;break;case"rect":case"heatcell":e.x*=t,e.y*=i,e.w*=t,e.h*=i;break;case"candlestick":e.x*=t,e.openY*=i,e.closeY*=i,e.highY*=i,e.lowY*=i}let r=this.scales.x.domain(),s=this.scales.y.domain(),a=this.scales.x.range(),n=this.scales.y.range(),o=Y,l=Math.max(0,Math.min(this.config.scalePadding||0,Math.min(e.width,e.height)/2-1)),c=n[1]>n[0];this.scales={x:o(this.config.xScaleType,r,a[0]>a[1]?[e.width-l,l]:[l,e.width-l]),y:o(this.config.yScaleType,s,c?[l,e.height-l]:[e.height-l,l])},this.lastLayout={width:e.width,height:e.height},this.spatialIndex.rebuild(this.config.chartType,this.scene),this.version++}buildSceneNodes(e,t){let{config:i,scales:r}=this;if(!r)return[];if(i.customLayout){let s={data:t,scales:r,dimensions:{width:e.width,height:e.height,margin:i.layoutMargin??{top:0,right:0,bottom:0,left:0},plot:{x:0,y:0,width:e.width,height:e.height}},theme:{semantic:i.themeSemantic??{},categorical:i.themeCategorical??gr},resolveColor:(e,t)=>{let r=this.resolveGroupColor(e);if(r)return r;let s=this.resolveLineStyle(e,t);return s.stroke?s.stroke:"string"==typeof s.fill?s.fill:i.themeSemantic?.primary??"#4e79a7"},config:i.layoutConfig??{},selection:i.layoutSelection??null},a=Xt({family:"xy",logLabel:"customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:i.onLayoutError,run:()=>i.customLayout(s)});if("failure"===a.kind)return this.lastCustomLayoutFailure=a.diagnostic,this._customLayoutFailedThisBuild=!0,a.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,[]);let n=a.result;this.customLayoutOverlays=n.overlays??null,this.lastCustomLayoutResult=n,this.lastCustomLayoutFailure=null;let o=n.nodes??[];if(this._customRestyle=n.restyle,this.hasCustomRestyle=!!n.restyle,this.hasCustomRestyle){this._baseStyles=/* @__PURE__ */new WeakMap;for(let e of o)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(o,i.layoutSelection??null)}return Wt({label:"customLayout",nodes:o,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),o}if(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,0===t.length)return[];let s={scales:r,config:i,getX:this.getX,getY:this.getY,getY0:this.getY0,getSize:this.getSize,getColor:this.getColor,getSymbol:this.getSymbol,getGroup:this.getGroup,getCategory:this.getCategory,getPointId:this.getPointId,ribbons:this.resolvedRibbons,getOpen:this.getOpen,getHigh:this.getHigh,getLow:this.getLow,getClose:this.getClose,resolveLineStyle:(e,t)=>this.resolveLineStyle(e,t),resolveAreaStyle:(e,t)=>this.resolveAreaStyle(e,t),resolveBoundsStyle:(e,t)=>this.resolveBoundsStyle(e,t),resolveColorMap:e=>this.resolveColorMap(e),resolveGroupColor:e=>this.resolveGroupColor(e),groupData:e=>this.groupData(e),barCategoryCache:this._barCategoryCache},a=Ke(i.chartType);if(!a)return qe(n=i.chartType)||Ki&&(zr.has(n)||(zr.add(n),console.warn(`[semiotic] StreamXYFrame: no XY plugin registered for "${n}" during SSR. Import a chart HOC, or call registerBuiltInXYPlugins() from "semiotic/xy" or "semiotic/realtime/core" before render.`))),[];var n;let o=Ze(a(s,t,e));return"bar"===i.chartType&&(this._barCategoryCache=s.barCategoryCache??null,this._binBoundaries=o.binBoundaries),o.nodes}resolveBoundsStyle(e,t){return N(this.config,e,t,(e,t)=>this.resolveLineStyle(e,t))}computeDecayOpacity(e,t){let i=this.config.decay;return i&&t>1?zt(i,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._ingestVersion)return this._datumIndexCache.map;let t=Ft(e);return this._datumIndexCache={version:this._ingestVersion,map:t},t}applyDecay(e,t){this.config.decay&&$t(this.config.decay,e,t,this.getDatumIndexMap(t))}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&bt(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}get transitionContext(){return{runtimeMode:this.config.runtimeMode,getX:this.getX,getY:this.getY,getCategory:this.getCategory,getPointId:this.getPointId}}snapshotPositions(){y(this.transitionContext,this.scene,this.prevPositionMap,this.prevPathMap)}synthesizeIntroPositions(){this.prevPositionMap.clear(),this.prevPathMap.clear();let e=this.scales?.y(0)??0;for(let t=0;this.scene.length>t;t++){let i=this.scene[t],r=p(this.transitionContext,i,t);r&&("point"===i.type?this.prevPositionMap.set(r,{x:i.x,y:i.y,r:0,opacity:0}):"rect"===i.type?this.prevPositionMap.set(r,{x:i.x,y:e,w:i.w,h:0,opacity:i.style.opacity??1}):"heatcell"===i.type?this.prevPositionMap.set(r,{x:i.x,y:i.y,w:i.w,h:i.h,opacity:0}):"line"===i.type?(i._introClipFraction=0,this.prevPathMap.set(r,{path:i.path.map(e=>[e[0],e[1]]),pathIds:i.pathIds?.slice(),opacity:i.style.opacity})):"area"===i.type&&(i._introClipFraction=0,this.prevPathMap.set(r,{topPath:i.topPath.map(e=>[e[0],e[1]]),bottomPath:i.bottomPath.map(e=>[e[0],e[1]]),pathIds:i.pathIds?.slice(),opacity:i.style.opacity})))}}startTransition(){if(!this.config.transition)return;let e=f(this.transitionContext,this.config.transition,{scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},this.prevPositionMap,this.prevPathMap,this.currentTime());this.scene=e.scene,this.exitNodes=e.exitNodes,this.activeTransition=e.activeTransition}advanceTransition(e){if(!this.activeTransition||!this.config.transition)return!1;let t={scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},i=m(e,this.config.transition,t,this.prevPositionMap);return this.scene=t.scene,this.exitNodes=t.exitNodes,this.activeTransition=t.activeTransition,i}cancelIntroAnimation(){this.prevPositionMap.clear(),this.prevPathMap.clear(),this.activeTransition=null,ct(this.scene),this.exitNodes=[]}groupData(e){let{result:t,cache:i}=D(e,this.getGroup,this._ingestVersion,this._groupDataCache);return this._groupDataCache=i,t}resolveColorMap(e){let{map:t,cache:i}=E(e,this.getColor,this.config,this._ingestVersion,this._colorMapCache);return this._colorMapCache=i,t}resolveLineStyle(e,t){return B(this.config,e,t,e=>this.resolveGroupColor(e))}resolveAreaStyle(e,t){return I(this.config,e,t,e=>this.resolveGroupColor(e))}resolveGroupColor(t){let{color:i,groupColorCounter:r}=O({group:t,colorMapCache:this._colorMapCache,groupColorMap:this._groupColorMap,groupColorCounter:this._groupColorCounter,groupColorMapCap:e.GROUP_COLOR_MAP_CAP,config:this.config});return this._groupColorCounter=r,i}getBufferArray(){return(this._bufferDirty||!this._bufferArrayCache)&&(this._bufferArrayCache=this.buffer.toArray(),this._bufferDirty=!1),this._bufferArrayCache}getData(){return this.getBufferArray()}remove(e){if(!this.getPointId)throw Error("remove() requires pointIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();let t=lt(e),i=this.getPointId,r=e=>t.has(i(e));_t(this.buffer,this.timestampBuffer,r);let s=this.buffer.remove(r);if(0===s.length)return this.updateResults.recordNoop("remove"),s;for(let e of s)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",s.length),s}update(e,t){if(!this.getPointId)throw Error("update() requires pointIdAccessor to be configured");let i=lt(e),r=this.getPointId,s=/* @__PURE__ */new Set;this.buffer.forEach((e,t)=>{i.has(r(e))&&s.add(t)});let a=this.buffer.update(e=>i.has(r(e)),t);if(0===a.length)return this.updateResults.recordNoop("update"),a;for(let e of a)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.buffer.forEach((e,t)=>{s.has(t)&&(this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e))}),this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",a.length),a}getBinBoundaries(){return this._binBoundaries}getExtents(){return this.xExtent.min===1/0?null:{x:this.xExtent.extent,y:this.yExtent.extent}}clear(){this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.prevPathMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this._lastBoundedInsertsRef=null,this.needsFullRebuild=!0,this._bufferDirty=!0,this._bufferArrayCache=null,this._datumIndexCache=null,this.lastLayout=null,this.scales=null,this.scene=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this.spatialIndex.clear(),this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=/* @__PURE__ */new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getBuffer(){return this.buffer}getXAccessor(){return this.getX}getYAccessor(){return this.getY}getCategoryAccessor(){return this.getCategory}applyCustomRestyle(e,t){let i=this._customRestyle;if(i)for(let r of e){let e=this._baseStyles.get(r)??r.style??{},s=i(r,t);r.style=s?{...e,...s}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}updateConfig(e){let t={...this.config},i=Object.keys(e).filter(i=>e[i]!==t[i]);"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||"themeCategorical"in e||"colorAccessor"in e)&&(this._colorMapCache=null,this._groupColorMap=/* @__PURE__ */new Map,this._groupColorCounter=0),("barColors"in e||"colorScheme"in e)&&(this._barCategoryCache=null),("normalize"in e||"extentPadding"in e||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e||"boundsAccessor"in e||"band"in e||"y0Accessor"in e||"openAccessor"in e||"highAccessor"in e||"lowAccessor"in e||"closeAccessor"in e||"groupAccessor"in e||"categoryAccessor"in e||"chartType"in e||"runtimeMode"in e)&&(this._stackExtentCache=null);let r=!1,s=!1;Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let a="chartType"in e&&e.chartType!==t.chartType||"runtimeMode"in e&&e.runtimeMode!==t.runtimeMode;if(a||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e){let e=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode,i=e&&this.config.valueAccessor||this.config.yAccessor,n=e&&t.valueAccessor||t.yAccessor,o=a||!Tt(e&&this.config.timeAccessor||this.config.xAccessor,e&&t.timeAccessor||t.xAccessor),l=a||!Tt(i,n);(o||l)&&(e?(this.getX=Lt(this.config.timeAccessor||this.config.xAccessor,"time"),this.getY=Lt(this.config.valueAccessor||this.config.yAccessor,"value")):(this.getX=Lt(this.config.xAccessor,"x"),this.getY=Lt(this.config.yAccessor,"y")),l&&this.resolvedRibbons.some(e=>"bounds"===e.kind)&&(this.resolvedRibbons=v(this.config)),r=!0,s=!0)}if("groupAccessor"in e&&!Tt(e.groupAccessor,t.groupAccessor)&&(this.getGroup=null!=this.config.groupAccessor?Dt(this.config.groupAccessor):void 0,r=!0),"categoryAccessor"in e&&!Tt(e.categoryAccessor,t.categoryAccessor)&&(this.getCategory=null!=this.config.categoryAccessor?Dt(this.config.categoryAccessor):void 0,r=!0),"sizeAccessor"in e&&!Tt(e.sizeAccessor,t.sizeAccessor)&&(this.getSize=this.config.sizeAccessor?Lt(this.config.sizeAccessor,"size"):void 0,r=!0),"symbolAccessor"in e&&!Tt(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?Dt(this.config.symbolAccessor):void 0,r=!0),"colorAccessor"in e&&!Tt(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?Dt(this.config.colorAccessor):void 0,r=!0),"y0Accessor"in e&&!Tt(e.y0Accessor,t.y0Accessor)&&(this.getY0=this.config.y0Accessor?Lt(this.config.y0Accessor,"y0"):void 0,r=!0,s=!0),("boundsAccessor"in e&&!Tt(e.boundsAccessor,t.boundsAccessor)||"band"in e&&e.band!==t.band||"boundsStyle"in e&&e.boundsStyle!==t.boundsStyle)&&(this.resolvedRibbons=v(this.config),r=!0,s=!0),"pointIdAccessor"in e&&!Tt(e.pointIdAccessor,t.pointIdAccessor)&&(this.getPointId=null!=this.config.pointIdAccessor?Dt(this.config.pointIdAccessor):void 0,r=!0),"candlestick"===this.config.chartType&&(a||"openAccessor"in e&&!Tt(e.openAccessor,t.openAccessor)||"closeAccessor"in e&&!Tt(e.closeAccessor,t.closeAccessor)||"highAccessor"in e&&!Tt(e.highAccessor,t.highAccessor)||"lowAccessor"in e&&!Tt(e.lowAccessor,t.lowAccessor))){let e=null!=this.config.openAccessor,t=null!=this.config.closeAccessor;this.getOpen=e?Lt(this.config.openAccessor,"open"):void 0,this.getHigh=Lt(this.config.highAccessor,"high"),this.getLow=Lt(this.config.lowAccessor,"low"),this.getClose=t?Lt(this.config.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!e&&!t,r=!0,s=!0}if("accessorRevision"in e&&e.accessorRevision!==t.accessorRevision&&(r=!0,s=!0),!r){let i=Object.keys(e).filter(e=>!e.endsWith("Accessor")&&"timeAccessor"!==e&&"valueAccessor"!==e);for(let s of i)if(e[s]!==t[s]){r=!0;break}}r&&(s&&this.rebuildExtents(),this.needsFullRebuild=!0),this.updateResults.recordConfig(i,("bar"===this.config.chartType||"heatmap"===this.config.chartType)&&!this.config.trackHoverRows&&Cr(t.areaStyle)!==Cr(this.config.areaStyle))}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};as.GROUP_COLOR_MAP_CAP=1e3;var ns=as;jt(ns);import{useCallback as os,useImperativeHandle as ls}from"react";import{line as cs}from"d3-shape";var hs=/* @__PURE__ */new WeakMap;import*as us from"react";import{jsx as ds,jsxs as ps}from"react/jsx-runtime";import{useEffect as gs,useRef as ys,useState as fs}from"react";import{useEffect as ms,useState as xs}from"react";import{jsx as vs}from"react/jsx-runtime";import{useMemo as bs,useRef as ws,useEffect as ks,useId as As}from"react";import*as _s from"react";import{jsx as Cs}from"react/jsx-runtime";var Ps=null,Ss=null,Ms=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];import{useMemo as Rs}from"react";import{jsx as Ys,jsxs as Ts}from"react/jsx-runtime";import{Fragment as Ls,jsx as Ds,jsxs as Es}from"react/jsx-runtime";import{useCallback as Os,useEffect as Bs,useState as Is}from"react";import*as Ns from"react";import{area as zs,line as Fs}from"d3-shape";import{jsx as $s,jsxs as Ws}from"react/jsx-runtime";var Xs={axisStroke:"#ccc",tickText:"#666",crosshair:"rgba(0, 0, 0, 0.25)",hoverFill:"rgba(255, 255, 255, 0.3)",hoverStroke:"rgba(0, 0, 0, 0.4)",pointRing:"white",primary:"#007bff",background:""};import{useEffect as js}from"react";import{jsx as Vs,jsxs as Hs}from"react/jsx-runtime";$e.ownsChrome=!0;import{jsx as Gs,jsxs as Us}from"react/jsx-runtime";var qs=Yt,Ks=Xs,Js=Mr(Sr(function(t,i){let{chartType:r,runtimeMode:s,data:a,chunkThreshold:n,chunkSize:o,xAccessor:l,yAccessor:c,accessorRevision:h,colorAccessor:u,sizeAccessor:d,symbolAccessor:p,symbolMap:g,groupAccessor:y,lineDataAccessor:f,curve:m,normalize:x,baseline:v,stackOrder:b,binSize:w,valueAccessor:k,arrowOfTime:A="right",windowMode:_,capacityMode:C,windowSize:P,capacity:S,timeAccessor:M,xExtent:R,yExtent:Y,invertY:T,extentPadding:L=.1,scalePadding:D,sizeRange:E,size:O=[500,300],responsiveWidth:B,responsiveHeight:I,margin:N,className:z,background:$,maxDevicePixelRatio:W,renderMode:j,lineStyle:H,pointStyle:G,areaStyle:U,barStyle:q,waterfallStyle:K,swarmStyle:J,barColors:Z,colorScheme:Q,boundsAccessor:ee,boundsStyle:te,y0Accessor:ie,band:re,gradientFill:se,lineGradient:ae,semanticLineStops:ne,areaGroups:oe,openAccessor:le,highAccessor:ce,lowAccessor:he,closeAccessor:ue,candlestickStyle:de,showAxes:pe=!0,axes:ge,xLabel:fe,yLabel:me,yLabelRight:xe,xFormat:ve,yFormat:be,axisExtent:ke,tickFormatTime:Ae,tickFormatValue:_e,hoverAnnotation:Me,tooltipContent:Re,customHoverBehavior:Ye,customClickBehavior:Le,onObservation:De,annotationObservationCallback:Ee,chartId:Fe,enableHover:Ve,hoverRadius:He=30,tooltipMode:Ge,annotations:Ue,onAnnotationActivate:qe,autoPlaceAnnotations:Ke,svgAnnotationRules:Ze,showGrid:Qe,legend:et,legendHoverBehavior:tt,legendClickBehavior:it,legendHighlightedCategory:rt,legendIsolatedCategories:st,legendPosition:at,legendLayout:ot,legendCategoryAccessor:lt,onCategoriesChange:ct,backgroundGraphics:ht,foregroundGraphics:gt,canvasPreRenderers:yt,svgPreRenderers:xt,title:vt,categoryAccessor:bt,brush:wt,onBrush:kt,decay:At,pulse:_t,transition:Yt,animate:Tt,staleness:Lt,frameScheduler:Dt,clock:zt,random:Ft,seed:$t,paused:Wt=!1,suspendWhenHidden:Xt=!0,heatmapAggregation:jt,heatmapXBins:Ut,heatmapYBins:qt,showValues:Kt,heatmapValueFormat:Jt,heatmapColorScale:Zt,onColorDomainChange:ii,marginalGraphics:ri,pointIdAccessor:si,xScaleType:ai,yScaleType:ui,accessibleTable:gi=!0,description:bi,summary:ki,linkedCrosshairName:_i,linkedCrosshairSourceId:Ci,customLayout:Pi,onLayoutError:Si,layoutConfig:Mi,layoutSelection:Ri}=t,Ti=_??C??"sliding",Li=P??S??200,{customHoverBehavior:Di,customClickBehavior:Ei,hasClickBehavior:Bi}=Pt({customHoverBehavior:Ye,customClickBehavior:Le,onObservation:De,chartId:Fe,chartType:"StreamXYFrame"}),Ii=Tr().replace(/:/g,""),zi=Dr(!1),$i=Dr({w:-1,h:-1}),Xi=Dr(!1),ji=di({sizeProp:O,responsiveWidth:B,responsiveHeight:I,userMargin:N,marginDefault:qs,title:vt,legend:et,legendPosition:at,...pt(t,et),animate:Tt,transitionProp:Yt,frameScheduler:Dt,clock:zt,random:Ft,seed:$t,paused:Wt,suspendWhenHidden:Xt,themeDirtyRef:zi}),Hi=Ui(),Gi=qi(),{reducedMotionRef:Zi,responsiveRef:Qi,size:sr,currentTheme:nr,transition:cr,introEnabled:ur,tableId:dr,rafRef:pr,renderFnRef:gr,scheduleRender:yr,frameRuntime:fr}=ji;Yr(()=>xr(()=>{zi.current=!0,yr()}),[yr]);let mr=ji.margin;if(ri){let e={...ji.margin};ri.top&&60>e.top&&(e.top=60),ri.bottom&&60>e.bottom&&(e.bottom=60),ri.left&&60>e.left&&(e.left=60),ri.right&&60>e.right&&(e.right=60),mr=e}let vr=sr[0]-mr.left-mr.right,br=sr[1]-mr.top-mr.bottom,wr=(ge?.find(e=>"left"===e.orient)??ge?.find(e=>"right"===e.orient))?.extent??ke,kr=Lr(()=>Oi(a),[a]),_r=Me??Ve,[Cr,Sr]=Er(0),Mr=Dr(0),[Or,Br]=Er(null),Ir=Et(gt,sr,mr,Or),Nr=Et(ht,sr,mr,Or),zr=Dr(null),Fr=Dr(!1),$r=Dr(null),Wr=Dr(void 0),[Xr,jr]=Er(null),Vr=Dr(Ks.primary),Hr=Dr(Oe()),Gr=Dr(!1),Ur=er("StreamXYFrame"),[qr,Kr]=Er(!1),Jr="streaming"===s||["bar","swarm","waterfall"].includes(r),Zr=!!Di,Qr=Lr(()=>({chartType:r,runtimeMode:Jr?"streaming":"bounded",windowSize:Li,windowMode:Ti,arrowOfTime:Jr?A:"right",extentPadding:L,scalePadding:D,axisExtent:ke,yAxisExtent:wr,xAccessor:l,yAccessor:c,accessorRevision:h,timeAccessor:Jr?M:void 0,valueAccessor:k,colorAccessor:u,sizeAccessor:d,symbolAccessor:p,symbolMap:g,groupAccessor:y||(f?"_lineGroup":void 0),categoryAccessor:bt,lineDataAccessor:f,xScaleType:ai,yScaleType:ui,xExtent:R,yExtent:Y,invertY:T,sizeRange:E,binSize:w,normalize:x,baseline:v,stackOrder:b,boundsAccessor:ee,boundsStyle:te,y0Accessor:ie,band:re,gradientFill:ft(se),areaGroups:oe?new Set(oe):void 0,lineGradient:mt(ae),semanticLineStops:ne,openAccessor:le,highAccessor:ce,lowAccessor:he,closeAccessor:ue,candlestickStyle:de,lineStyle:H,trackHoverRows:Zr,pointStyle:G,areaStyle:U,swarmStyle:J,waterfallStyle:K,colorScheme:Q,barColors:Z,barStyle:q,annotations:Ue,decay:At,pulse:_t,transition:cr,introAnimation:ur,staleness:Lt,clock:fr.now,heatmapAggregation:jt,heatmapXBins:Ut,heatmapYBins:qt,showValues:Kt,heatmapValueFormat:Jt,heatmapColorScale:Zt,pointIdAccessor:si,curve:m,themeCategorical:nr?.colors?.categorical,themeSemantic:Ar(nr),themeSequential:nr?.colors?.sequential,themeDiverging:nr?.colors?.diverging,customLayout:Pi,onLayoutError:Si,layoutConfig:Mi,layoutMargin:mr}),[r,Jr,Li,Ti,A,L,D,ke,wr,l,c,h,M,k,u,d,p,g,y,f,bt,ai,ui,R,Y,T,E,w,x,v,b,ee,te,ie,re,se,oe,ae,ne,le,ce,he,ue,de,H,Zr,G,U,J,K,Q,Z,q,Ue,At,_t,cr,ur,Lt,fr.now,jt,Ut,qt,Kt,Jt,Zt,si,m,nr,Pi,Si,Mi,mr]),es=ni(Qr),ts=Dr(null);ts.current||(ts.current=new ns(es));let is=Ot(ts,lt,ct,e=>e.getData()),rs=Dr({onColorDomainChange:ii,chartType:r}),ss=Dr(void 0);rs.current={onColorDomainChange:ii,chartType:r};let as=Rr(()=>{let{onColorDomainChange:e,chartType:t}=rs.current;if(!e||"heatmap"!==t)return;let i=1/0,r=-1/0;for(let e of ts.current?.scene??[]){if("heatcell"!==e.type)continue;let t=Number(e.value??e.datum?.value);Number.isFinite(t)&&(i>t&&(i=t),t>r&&(r=t))}let s=Number.isFinite(i)&&Number.isFinite(r)?[i,r]:null,a=ss.current;null===a&&null===s||a&&s&&a[0]===s[0]&&a[1]===s[1]||(ss.current=s,e(s))},[]);Ie(r,Pi,zi,yr,ts),Ht(ts,es,zi,yr),Gt(ts,Ri,zi,yr);let os=Dr(null);os.current||(os.current=new nt(e=>{let t=ts.current;t&&t.ingest(e)&&(zi.current=!0,yr())},{chunkThreshold:n,chunkSize:o})),Yr(()=>{os.current?.updateChunkOptions({chunkThreshold:n,chunkSize:o})},[n,o]),F(i,{storeRef:ts,adapterRef:os,dirtyRef:zi,scheduleRender:yr,hoverRef:zr,setHoverPoint:jr}),Yr(()=>{a&&os.current?.setBoundedData(We(kr,f))},[a,kr,f]);let{marginalXValues:ls,marginalYValues:cs,refreshMarginalValues:hs}=Se(ts,ri,kr,l,c),{canvasRef:us,interactionCanvasRef:ds,resolutionDirtyRef:ps}=xi(ji,{storeRef:ts,dirtyRef:zi,hydrated:Hi,wasHydratingFromSSR:Gi,cleanup:()=>os.current?.clear(),maxDevicePixelRatio:W,canvasPaintDependencies:[r,vr,br,pe,$,ht,H,j,yt,yr]}),{hoverHandlerRef:gs,hoverLeaveRef:ys,onPointerMove:fs,onPointerLeave:ms,pointerStateRef:xs}=ji;gs.current=e=>{let t=us.current;if(!t)return;let i=t.getBoundingClientRect(),s=e.clientX-i.left-mr.left,a=e.clientY-i.top-mr.top;if(0>s||s>vr||0>a||a>br){if(Wi(t),!_r)return;return void(zr.current&&(zr.current=null,$r.current=null,jr(null),Di?.(null),yr()))}let n=ts.current;if(!n||0===n.scene.length)return void Wi(t);let o=wi(He,e.pointerType),c=X(n.scene,s,a,o,n.quadtree,n.maxPointRadius);if(Wi(t,Ni(c?.node)),!_r)return;let h="multi"===Ge,u=()=>{zr.current&&(zr.current=null,$r.current=null,jr(null),Di&&Di(null),yr())};if(!c&&!h)return void u();let d=h||!c?s:c.x,p=h||!c?a:c.y,g=c?.datum?Mt(c.datum,n.resolvedRibbons):{},y=n.scales?.x?.invert,f="function"==typeof y?y(d):void 0,m=Ai(g,d,p,null!=f?{xValue:f,xPx:d}:void 0);if(h&&n.scene.length>0&&n.scales){let e=V(n.scene,d,Math.max(o,vr));if(e.length>0){let t=n.scales.y.invert,i=Vr.current,s=y?y(d):d;if(c)m.xValue=s,m.xPx=d;else{let e={xValue:s};"string"==typeof l&&(e[l]=s),m=Ai(e,d,p,{xValue:s,xPx:d})}m.allSeries=e.map(e=>{let s=t?t(e.y):e.y,a=null!=e.y0?t?t(e.y0):e.y0:void 0;return{group:e.group||"",value:"stackedarea"===r&&null!=a?s-a:s,valuePx:e.y,color:e.color||i,datum:Mt(e.datum,n.resolvedRibbons)}})}}c||m.allSeries?.length?(zr.current=m,$r.current=c?.node??null,jr(m),Di?.(m),yr()):u()},ys.current=()=>{Wi(us.current),zr.current&&(zr.current=null,$r.current=null,jr(null),Di?.(null),yr())},Vi(us);let vs=Dr(()=>{});vs.current=e=>{if(mi(e.target)||!Ei)return;let t=us.current;if(!t)return;let i=t.getBoundingClientRect(),r=e.clientX-i.left-mr.left,s=e.clientY-i.top-mr.top;if(0>r||r>vr||0>s||s>br)return void Ei(null);let a=ts.current;if(!a||0===a.scene.length)return void Ei(null);let n=wi(He,Wr.current),o=X(a.scene,r,s,n,a.quadtree,a.maxPointRadius);if(!o)return void Ei(null);let l=o.datum||{},c=a.scales?.x?.invert,h="function"==typeof c?c(o.x):void 0;Ei(Ai(l,o.x,o.y,null!=h?{xValue:h,xPx:o.x}:void 0),{type:"activate",inputType:Yi(Wr.current)})};let bs=Rr(e=>vs.current(e),[]),{kbFocusIndexRef:ws,focusedNavPointRef:ks,onKeyDown:As}=St({storeRef:ts,hoverRef:zr,hoveredNodeRef:$r,setHoverPoint:jr,customHoverBehavior:Di,customClickBehavior:Ei,scheduleRender:yr}),_s=Rr(e=>{Nt(xs,e,!!_r,Fr.current,us.current)&&(Wr.current=e.pointerType,ws.current=-1,ks.current=null,fs(e))},[us,_r,ks,ws,fs,xs]),Cs=Rr(e=>{Nt(xs,e,!!_r,Fr.current,us.current,"mouse")&&(Wr.current="mouse",ws.current=-1,ks.current=null,fs({clientX:e.clientX,clientY:e.clientY,pointerType:"mouse"}))},[us,_r,ks,ws,fs,xs]),Ps=Rr(e=>{Wr.current=e.pointerType},[]);gr.current=()=>{if(pr.current=null,!fr.isActive)return;let e=us.current,t=ds.current;if(!e||!t)return;let i=ts.current;if(!i)return;let s=fr.now(),a=null!=i.activeTransition,n=i.advanceTransition(Zi.current?s+1e6:s),o=!Zi.current&&n,l=$i.current.w!==vr||$i.current.h!==br,c=ps.current,h=zi.current||a||l,u=a&&!n,d=i.consumeStylePaintPending(),p=!1,g=i.getLastUpdateResult(),y=Ur.current.beforeCompute(g,o);(zi.current||l)&&(!o||l)&&(i.computeScene({width:vr,height:br}),$i.current={w:vr,h:br},p=!0,is(),as()),(p||d)&&(Fr.current=Fi(i.scene),Fr.current||Wi(e)),Fr.current&&(a||p||d)&&Xe({canvas:e,pointer:xs.current,store:i,margin:mr,width:vr,height:br,hoverRadius:He,geometryMoved:a||p}),Ur.current.afterCompute(y,p,l);let f=Ct(i,s,p,Xi),m=fi(W,sr);pi(e,sr,m),pi(t,sr,m);let x=Hr.current.resolve(e);Vr.current=x.primary;let v=Qt(Lt,i.lastIngestTime>0?s-i.lastIngestTime:0),b=Lt&&v.isStale;if(h||d||f.changed||c){let t=yi(e,sr,mr,m);if(t){if(t.clearRect(-mr.left,-mr.top,sr[0],sr[1]),Lt&&1>v.alpha&&(t.globalAlpha=v.alpha),li(t,{background:$,hasBackgroundGraphics:!!ht,themeBackground:x.background,x:-mr.left,y:-mr.top,width:sr[0],height:sr[1]}),t.save(),"function"==typeof t.rect&&(t.beginPath(),t.rect(0,0,vr,br),t.clip()),yt&&i.scales)for(let e of yt)t.save(),e(t,i.scene,i.scales,{width:vr,height:br}),t.restore();let e=Je(r,!!Pi);Bt({context:t,nodes:i.scene,renderMode:j,pixelRatio:m,paintBuiltIn:r=>{if(e&&i.scales)for(let s of e)s(t,r,i.scales,{width:vr,height:br})}}),t.restore(),Lt&&1>v.alpha&&(t.globalAlpha=1)}}let w=!!(_r&&zr.current&&i.scales),k=!!($r.current&&Array.isArray(Me)&&Me.some(e=>e&&"object"==typeof e&&"highlight"===e.type)),A=w||k;if(Rt(A,Gr.current)){let e=yi(t,sr,mr,m);if(e&&(e.clearRect(-mr.left,-mr.top,sr[0],sr[1]),w&&zr.current&&Ne(e,zr.current,vr,br,"object"==typeof _r?_r:{},$r.current,x),k&&$r.current&&Array.isArray(Me))){let t=Me.find(e=>e&&"object"==typeof e&&"highlight"===e.type);t&&ze(e,i.scene,$r.current,t,x)}Gr.current=A}h&&e&&e.setAttribute("aria-label",ir(i.scene,r+" chart"));let _=zi.current;if(zi.current=_&&o&&!p,ps.current=!1,_&&i.scales){let e=e=>"object"==typeof e&&null!==e&&"function"==typeof e.valueOf?e.valueOf():e;(!Or||e(Or.x.domain()[0])!==e(i.scales.x.domain()[0])||e(Or.x.domain()[1])!==e(i.scales.x.domain()[1])||e(Or.y.domain()[0])!==e(i.scales.y.domain()[0])||e(Or.y.domain()[1])!==e(i.scales.y.domain()[1])||Or.x.range()[0]!==i.scales.x.range()[0]||Or.x.range()[1]!==i.scales.x.range()[1]||Or.y.range()[0]!==i.scales.y.range()[0]||Or.y.range()[1]!==i.scales.y.range()[1])&&Br(i.scales),ri&&hs(i.getData())}(Ue&&Ue.length>0||Pi)&&(p||a)&&(p||u||s-Mr.current>=33)&&(Sr(e=>e+1),Mr.current=s),Lt?.showBadge&&Kr(!!b),(o||null!=i.activeTransition||f.pending)&&yr()},ei(Lt,ts,zi,yr,fr.now,qr,Kr);let Ss=Lr(()=>{if(!ve&&!Ae&&ts.current?.xIsDate&&Or)return we(Or.x.domain())},[ve,Ae,Or]),Ms=ve||Ae||Ss,Rs=_r&&Xr?Re?Re(Xr):/* @__PURE__ */Gs($e,{hover:Xr}):null,Ys=Rs?/* @__PURE__ */Gs(hi,{x:Xr.x,y:Xr.y,containerWidth:vr,containerHeight:br,margin:mr,className:"stream-frame-tooltip",children:Rs}):null,Ts=ks.current,Ls=/* @__PURE__ */Gs(hr,{active:ws.current>=0,hoverPoint:Xr,margin:mr,size:sr,shape:Ts?.shape,width:Ts?.w,height:Ts?.h}),Ds=ut(l,M,"__semiotic_resolvedX","__semiotic_resolvedTime"),Es=ut(c,k,"__semiotic_resolvedY","__semiotic_resolvedValue"),Os=Ds.key,Bs=Es.key,Is=dt(Ds,Es,Ue&&Ue.length>0||!1);if(Ki||!Hi&&Gi){let e=ts.current;e&&a&&(e.ingest({inserts:We(kr,f),bounded:!0}),e.computeScene({width:vr,height:br}));let t=e?.scene??[],i=e?.scales??null,r=Et(gt,sr,mr,i),s=Et(ht,sr,mr,i),n=Ms||(()=>{if(e?.xIsDate&&i)return we(i.x.domain())})(),o=bi||("string"==typeof vt?vt:"XY chart"),h=ri&&e?ye(e.getData(),l,c):{xValues:[],yValues:[]};/* @__PURE__ */
|
|
45
|
+
return Us("div",{ref:Qi,className:"stream-xy-frame"+(z?" "+z:""),role:"img","aria-label":o,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:B?"100%":sr[0],height:I?"100%":sr[1]},children:[
|
|
46
|
+
/* @__PURE__ */Gs(or,{summary:ki}),
|
|
47
|
+
/* @__PURE__ */Us("svg",{xmlns:"http://www.w3.org/2000/svg",width:sr[0],height:sr[1],style:{position:"absolute",left:0,top:0},children:[
|
|
48
|
+
/* @__PURE__ */Us("g",{transform:`translate(${mr.left},${mr.top})`,children:[$&&/* @__PURE__ */Gs("rect",{x:0,y:0,width:vr,height:br,fill:$}),s]}),
|
|
49
|
+
/* @__PURE__ */Us("g",{transform:`translate(${mr.left},${mr.top})`,children:[xt&&i&&xt.map((e,r)=>/* @__PURE__ */Gs(Pr.Fragment,{children:e(t,i,{width:vr,height:br})},"svgpre-"+r)),t.map((e,t)=>It({node:e,index:t,renderMode:j,fallback:()=>Te(e,t,Ii,He)})).filter(Boolean)]})]}),
|
|
50
|
+
/* @__PURE__ */Gs(Pe,{width:vr,height:br,totalWidth:sr[0],totalHeight:sr[1],margin:mr,scales:i,showAxes:pe,axes:ge,xLabel:fe,yLabel:me,yLabelRight:xe,xFormat:n,yFormat:be||_e,axisExtent:ke,showGrid:Qe,title:vt,description:bi,legend:et,legendHoverBehavior:tt,legendClickBehavior:it,legendHighlightedCategory:rt,legendIsolatedCategories:st,legendPosition:at,legendLayout:ot,foregroundGraphics:Vt(r,ci(ts.current?.customLayoutOverlays,Ri??null)),marginalGraphics:ri,xValues:h.xValues,yValues:h.yValues,annotations:Ue,onAnnotationActivate:qe,onObservation:Ee??De,chartId:Fe,chartType:"StreamXYFrame",autoPlaceAnnotations:Ke,svgAnnotationRules:Ze,annotationFrame:0,xAccessor:Os,yAccessor:Bs,annotationData:Is(ts.current?.getData()),pointNodes:Be(ts.current?.scene),curve:"string"==typeof m?m:void 0,linkedCrosshairName:_i,linkedCrosshairSourceId:Ci})]})}/* @__PURE__ */
|
|
51
|
+
return Us("div",{ref:Qi,className:"stream-xy-frame"+(z?" "+z:""),role:"group","aria-label":bi||("string"==typeof vt?vt:"XY chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:B?"100%":sr[0],height:I?"100%":sr[1],overflow:"visible",touchAction:je(wt)},onKeyDown:As,children:["production"!==process.env.NODE_ENV&&ts.current&&/* @__PURE__ */Gs(rr,{store:ts.current,diagnostics:Ur.current}),gi&&/* @__PURE__ */Us(tr,{accessibleTable:gi,children:[
|
|
52
|
+
/* @__PURE__ */Gs(lr,{tableId:dr}),
|
|
53
|
+
/* @__PURE__ */Gs(ar,{scene:ts.current?.scene??[],chartType:r+" chart",tableId:dr,chartTitle:"string"==typeof vt?vt:void 0})]}),
|
|
54
|
+
/* @__PURE__ */Gs(or,{summary:ki}),
|
|
55
|
+
/* @__PURE__ */Gs(Ji,{hoverPoint:Xr}),
|
|
56
|
+
/* @__PURE__ */Us("div",{role:"img","aria-label":bi||("string"==typeof vt?vt:"XY chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:_s,onMouseMove:Cs,onPointerLeave:ms,onMouseLeave:ms,onPointerDown:_r||Bi?Ps:void 0,onClick:Bi?bs:void 0,children:[
|
|
57
|
+
/* @__PURE__ */Gs(vi,{size:sr,margin:mr,backdropFill:ht?$:void 0,children:Nr}),
|
|
58
|
+
/* @__PURE__ */Gs(Ce,{width:vr,height:br,totalWidth:sr[0],totalHeight:sr[1],margin:mr,scales:Or,showAxes:pe,axes:ge,showGrid:Qe,xFormat:Ms,yFormat:be||_e,axisExtent:ke}),
|
|
59
|
+
/* @__PURE__ */Gs("canvas",{ref:us,"aria-label":ir(ts.current?.scene??[],r+" chart"),style:{position:"absolute",left:0,top:0}}),
|
|
60
|
+
/* @__PURE__ */Gs("canvas",{ref:ds,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),
|
|
61
|
+
/* @__PURE__ */Gs(Pe,{width:vr,height:br,totalWidth:sr[0],totalHeight:sr[1],margin:mr,scales:Or,showAxes:pe,axes:ge,xLabel:fe,yLabel:me,yLabelRight:xe,xFormat:Ms,yFormat:be||_e,axisExtent:ke,showGrid:Qe,title:vt,description:bi,legend:et,legendHoverBehavior:tt,legendClickBehavior:it,legendHighlightedCategory:rt,legendIsolatedCategories:st,legendPosition:at,legendLayout:ot,foregroundGraphics:Vt(Ir,ci(ts.current?.customLayoutOverlays,Ri??null)),marginalGraphics:ri,xValues:ls,yValues:cs,annotations:Ue,onAnnotationActivate:qe,onObservation:Ee??De,chartId:Fe,chartType:"StreamXYFrame",autoPlaceAnnotations:Ke,svgAnnotationRules:Ze,annotationFrame:Cr,xAccessor:Os,yAccessor:Bs,annotationData:Is(ts.current?.getData()),pointNodes:Be(ts.current?.scene),curve:"string"==typeof m?m:void 0,underlayRendered:!0,canvasObscuresUnderlay:!!oi({background:$,hasBackgroundGraphics:!!ht,themeBackground:nr?.colors.background}),linkedCrosshairName:_i,linkedCrosshairSourceId:Ci}),(wt||kt)&&/* @__PURE__ */Gs(e,{width:vr,height:br,totalWidth:sr[0],totalHeight:sr[1],margin:mr,dimension:wt?.dimension??"xy",scales:Or,onBrush:kt??(()=>{}),binSize:w,snap:wt?.snap,binBoundaries:wt?.binBoundaries??("bar"===r?ts.current?.getBinBoundaries():void 0),snapDuring:wt?.snapDuring,streaming:"streaming"===s}),Lt?.showBadge&&/* @__PURE__ */Gs(ti,{isStale:qr,position:Lt.badgePosition,state:Lt.state,settling:Lt.settling}),Ls,Ys]})]})}));Js.displayName="StreamXYFrame";var Zs=Js;import{useCallback as Qs,useRef as ea}from"react";export{ie as a,ge as b,$e as c,Zs as d,Ve as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,r){let t=e.length,n=r.length,a=Array(n+1);for(let e=0;n>=e;e++)a[e]=e;for(let o=1;t>=o;o++){let t=a[0];a[0]=o;for(let i=1;n>=i;i++){let n=a[i];a[i]=e[o-1]===r[i-1]?t:1+Math.min(t,a[i],a[i-1]),t=n}}return a[n]}function r(r,t,n=3){let a,o=n+1;for(let n of t){let t=e(r.toLowerCase(),n.toLowerCase());o>t&&(o=t,a=n)}return o>n?void 0:a}function t(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:[...e]}function n(e,t){if(0===t.length)return null;let n=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(n)||n.includes(e.toLowerCase()))||(r(e,t,3)??null)}function a(e){return` Or use a function: ${e}={d => d.myValue}.`}function o({componentName:e,data:r,accessors:o,requiredProps:i}){if(i)for(let[r,t]of Object.entries(i))if(null==t)return`${e}: ${r} is required. Provide a field name or function.`;if(null==r)return null;if(!Array.isArray(r)&&"object"==typeof r)return e+": data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.";if(!Array.isArray(r)||0===r.length)return e+": No data provided. Pass a non-empty array to the data prop.";if(o){let i=t(r).find(e=>e&&"object"==typeof e);if(i){let r=Object.keys(i);for(let[t,l]of Object.entries(o))if(l&&"string"==typeof l&&!(l in i)){let o=n(l,r),i=o?` Try ${t}="${o}".`:"";return`${e}: ${t} "${l}" not found in data. Available fields: ${r.join(", ")}.${i}`+a(t)}}}return null}function i({componentName:e,data:r,dataLabel:t="data"}){return null==r?`${e}: No ${t} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(r)?`${e}: ${t} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:null}function l({componentName:e,nodes:r,edges:o,nodesRequired:i=!1,edgesRequired:l=!0,accessors:
|
|
1
|
+
function e(e,r){let t=e.length,n=r.length,a=Array(n+1);for(let e=0;n>=e;e++)a[e]=e;for(let o=1;t>=o;o++){let t=a[0];a[0]=o;for(let i=1;n>=i;i++){let n=a[i];a[i]=e[o-1]===r[i-1]?t:1+Math.min(t,a[i],a[i-1]),t=n}}return a[n]}function r(r,t,n=3){let a,o=n+1;for(let n of t){let t=e(r.toLowerCase(),n.toLowerCase());o>t&&(o=t,a=n)}return o>n?void 0:a}function t(e){return e.length>3?[e[0],e[Math.floor(e.length/2)],e[e.length-1]]:[...e]}function n(e,t){if(0===t.length)return null;let n=e.toLowerCase();return t.find(e=>e.toLowerCase().includes(n)||n.includes(e.toLowerCase()))||(r(e,t,3)??null)}function a(e){return` Or use a function: ${e}={d => d.myValue}.`}function o({componentName:e,data:r,accessors:o,requiredProps:i}){if(i)for(let[r,t]of Object.entries(i))if(null==t)return`${e}: ${r} is required. Provide a field name or function.`;if(null==r)return null;if(!Array.isArray(r)&&"object"==typeof r)return e+": data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.";if(!Array.isArray(r)||0===r.length)return e+": No data provided. Pass a non-empty array to the data prop.";if(o){let i=t(r).find(e=>e&&"object"==typeof e);if(i){let r=Object.keys(i);for(let[t,l]of Object.entries(o))if(l&&"string"==typeof l&&!(l in i)){let o=n(l,r),i=o?` Try ${t}="${o}".`:"";return`${e}: ${t} "${l}" not found in data. Available fields: ${r.join(", ")}.${i}`+a(t)}}}return null}function i({componentName:e,data:r,dataLabel:t="data"}){return null==r?`${e}: No ${t} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(r)?`${e}: ${t} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:null}function l({componentName:e,nodes:r,edges:o,nodesRequired:i=!1,edgesRequired:l=!0,accessors:s}){if(null==r&&null==o)return null;if(l&&(!o||!Array.isArray(o)||0===o.length))return e+': No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.';if(i&&(!r||!Array.isArray(r)||0===r.length))return e+': No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.';if(s&&r&&r.length>0){let o=t(r).find(e=>e&&"object"==typeof e);if(o){let r=Object.keys(o);for(let[t,i]of Object.entries(s))if(i&&"string"==typeof i&&!(i in o)){let o=n(i,r),l=o?` Try ${t}="${o}".`:"";return`${e}: ${t} "${i}" not found in node data. Available fields: ${r.join(", ")}.${l}`+a(t)}}}return null}export{r as a,o as b,i as c,l as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./c-BQYD7T4E.min.js";import"./c-AXJ2QI3F.min.js";import"./c-CLDCKFBE.min.js";import"./c-MTX2AO5S.min.js";import"./c-R2HUSWKB.min.js";import"./c-STHZWF3D.min.js";import"./c-SQNEVNWT.min.js";import"./c-HK4OSLZA.min.js";import"./c-NATWERHZ.min.js";import"./c-P5NXQWIM.min.js";import"./c-TIMGODBG.min.js";import"./c-3AGX252H.min.js";import"./c-U5XVLSHN.min.js";import"./c-V5KFJWQQ.min.js";import"./c-Y342FJ6K.min.js";import"./c-3BYZXCX3.min.js";import"./c-U6NLVFN4.min.js";export{i as registerBuiltInXYPlugins};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function e(e){let t=2166136261;for(let i=0;e.length>i;i++)t^=e.charCodeAt(i),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2146121005),t^=t>>>15,t=Math.imul(t,2221713035),t^=t>>>16,t>>>0}function t(e){return"p"+(Math.round(1e3*e)/10+"").replace(".","_")}function i(e,t,i){let s=e.length;for(e.push(t);s>0;){let n=s-1>>>1;if(0>=i(e[n],t))break;e[s]=e[n],s=n}e[s]=t}function s(e,t){let i=e[0],s=e.pop();if(e.length>0){let i=0;for(;e.length>2*i+1;){let n=2*i+1;if(e.length>n+1&&0>t(e[n+1],e[n])&&n++,0>=t(s,e[n]))break;e[i]=e[n],i=n}e[i]=s}return i}function n(e,t){switch(t){case"distinct":return e.distinct??0;case"p50":case"p95":case"p99":return e.percentiles?.[t]??NaN;default:return e[t]??e.mean}}function o(e,t,i,s=1){if("none"===t)return null;if("minmax"===t)return[e.min,e.max];let o=n(e,i),r=e.stddev*s;return[o-r,o+r]}function r(e){if("number"==typeof e)return Number.isFinite(e)&&e>0?e:null;if("string"!=typeof e)return null;let t=e.trim();if(""===t)return null;ve.lastIndex=0;let i,s=0,n=0;for(;null!==(i=ve.exec(t));){let e=parseFloat(i[1]),t=pe[i[2]];if(null==t||!Number.isFinite(e))return null;s+=e*t,n+=i[0].length}return n!==t.length?null:s>0?s:null}function a(e,t){return e.time-t.time||e.order-t.order}function l(e,t,i){return null==e?void 0:"function"==typeof t?t(e):e["string"==typeof t?t:i]}function c(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?e+"":e.toFixed(2):e instanceof Date?e.toLocaleString():e+""}function u(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:s="x",yLabel:n="y"}=e;return e=>{let o=e?.data??null,r=l(o,t,"time"),a=l(o,i,"value");/* @__PURE__ */
|
|
2
|
+
return _e("div",{className:"semiotic-tooltip",style:He,children:[
|
|
3
|
+
/* @__PURE__ */_e("div",{children:[
|
|
4
|
+
/* @__PURE__ */_e("span",{style:Me,children:[s,":"]}),c(r)]}),
|
|
5
|
+
/* @__PURE__ */_e("div",{children:[
|
|
6
|
+
/* @__PURE__ */_e("span",{style:Me,children:[n,":"]}),c(a)]})]})}}function h(e={}){let{timeAccessor:t,valueAccessor:i}=e;return e=>{let s=e?.data??null,n=l(s,t,"time"),o=s?.delta??l(s,i,"value"),r=s?.cumEnd,a="number"!=typeof o||0>o?c(o):"+"+c(o);/* @__PURE__ */
|
|
7
|
+
return _e("div",{className:"semiotic-tooltip",style:He,children:[
|
|
8
|
+
/* @__PURE__ */_e("div",{children:[
|
|
9
|
+
/* @__PURE__ */Se("span",{style:Me,children:"x:"}),c(n)]}),
|
|
10
|
+
/* @__PURE__ */_e("div",{children:[
|
|
11
|
+
/* @__PURE__ */Se("span",{style:Me,children:"Δ:"}),a]}),null!=r&&/* @__PURE__ */_e("div",{children:[
|
|
12
|
+
/* @__PURE__ */Se("span",{style:Me,children:"total:"}),c(r)]})]})}}function m(e={}){let{timeAccessor:t,valueAccessor:i}=e;return e=>{let s=e?.data??null;if(null==s?.binStart||null==s?.binEnd){let e=l(s,t,"time"),n=l(s,i,"value");/* @__PURE__ */
|
|
13
|
+
return _e("div",{className:"semiotic-tooltip",style:He,children:[
|
|
14
|
+
/* @__PURE__ */_e("div",{children:[
|
|
15
|
+
/* @__PURE__ */Se("span",{style:Me,children:"x:"}),c(e)]}),
|
|
16
|
+
/* @__PURE__ */_e("div",{children:[
|
|
17
|
+
/* @__PURE__ */Se("span",{style:Me,children:"y:"}),c(n)]})]})}/* @__PURE__ */
|
|
18
|
+
return _e("div",{className:"semiotic-tooltip",style:He,children:[
|
|
19
|
+
/* @__PURE__ */_e("div",{children:[
|
|
20
|
+
/* @__PURE__ */Se("span",{style:Me,children:"range:"}),c(s.binStart),"–",c(s.binEnd)]}),null!=s.total&&/* @__PURE__ */_e("div",{children:[
|
|
21
|
+
/* @__PURE__ */Se("span",{style:Me,children:"count:"}),c(s.total)]}),null!=s.category&&/* @__PURE__ */_e("div",{children:[
|
|
22
|
+
/* @__PURE__ */Se("span",{style:Me,children:"category:"}),c(s.category)]})]})}}function d(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:s="x",yLabel:n="y"}=e;return e=>{let o=e?.data??null,r=o?.xCenter??l(o,t,"time"),a=o?.yCenter??l(o,i,"value"),u=o?.count,h=o?.sum,m=o?.value,d=o?.agg??"count";/* @__PURE__ */
|
|
23
|
+
return _e("div",{className:"semiotic-tooltip",style:He,children:[
|
|
24
|
+
/* @__PURE__ */_e("div",{children:[
|
|
25
|
+
/* @__PURE__ */_e("span",{style:Me,children:[s,":"]}),c(r)]}),
|
|
26
|
+
/* @__PURE__ */_e("div",{children:[
|
|
27
|
+
/* @__PURE__ */_e("span",{style:Me,children:[n,":"]}),c(a)]}),null!=u&&/* @__PURE__ */_e("div",{children:[
|
|
28
|
+
/* @__PURE__ */Se("span",{style:Me,children:"count:"}),c(u)]}),"sum"===d&&null!=h&&/* @__PURE__ */_e("div",{children:[
|
|
29
|
+
/* @__PURE__ */Se("span",{style:Me,children:"sum:"}),c(h)]}),"mean"===d&&null!=m&&/* @__PURE__ */_e("div",{children:[
|
|
30
|
+
/* @__PURE__ */Se("span",{style:Me,children:"mean:"}),c(m)]})]})}}function g(e,t,i){return e??i??Math.max(t?.length??0,200)}function p(e){let t=e.window??"tumbling",i=r("session"===t?e.gap??e.size:e.size);if(null==i)return null;let s=null!=e.hop?r(e.hop):void 0,n=null!=e.gap?r(e.gap):void 0;return new ge({window:t,size:i,hop:s??void 0,gap:n??void 0,retain:e.retain,percentiles:e.percentiles,distinct:e.distinct})}function v(e,t){let i=t.stat??"mean",s=t.band??"none",r=t.sigma??1;return e.emit().map(e=>{let t={[Pe]:(e.start+e.end)/2,[Ie]:n(e,i),[ze]:e.count,[Re]:e.partial,[Be]:e.start,[Fe]:e.end},a=o(e,s,i,r);return a&&(t[Te]=a[0],t[Ne]=a[1]),t})}function f(e,t,i){let s="function"==typeof t?t(e):e[(t??i)+""];if(null==s||"string"==typeof s&&""===s.trim())return null;let n=Number(s);return Number.isFinite(n)?n:null}function w(e,t){let i=r(e.lateness);return null==i?null:new fe({lateness:i,getTime:t,latePolicy:e.latePolicy??"drop"})}function y(e){return{...K(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,showAxes:e.showAxes,showLegend:e.showLegend,enableHover:null==e.enableHover?void 0:!!e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight}}function b(e,t){Oe.useImperativeHandle(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,i)=>t.current?.update(e,e=>i(e))??[],clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t])}function x(e,t,i){let s=t.find(Boolean)??null;return Oe.useMemo(()=>s?te(e??je,s,i):e,[s,e,i])}function k(e,t,i){return{responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,legendHoverBehavior:t.onLegendHover,legendClickBehavior:t.onLegendClick,legendHighlightedCategory:t.highlightedCategory,legendIsolatedCategories:"isolate"===i?t.isolatedCategories:void 0}}function A(e,t,i,s=!1){let n=ne({axes:t,showAxes:i});return{...O(e,t,s),...!n.hasAxis&&{bottom:0},...!n.leftAxis?.hasAxis&&{left:0}}}function C({enabled:e,categories:t,colors:i,fallbackColor:s,order:n="discovery",domainKey:o}){let r=Z(!0),a=ee(),l=se(),c=V(),u="function"==typeof o?Je:o,h=Xe(null),m=qe(()=>{let e=h.current,s=e&&Object.is(e.domainKey,u)?new Map(e.indexes):/* @__PURE__ */new Map,o=new Set(t),r="explicit-then-alpha"===n?[...Object.keys(i??{}).filter(e=>o.has(e)),...t.filter(e=>!Object.prototype.hasOwnProperty.call(i??{},e)).sort()]:t;for(let e of r)ie(s,e);return{domainKey:u,indexes:s}},[t,i,n,u]);Qe(()=>{h.current=m},[m]);let d=m.indexes,g=qe(()=>{if(!e)return;let t=c&&c.length>0?c:l?re:ae;return e=>{let n=ie(d,e);return(r?le(r,e):void 0)||(i?le(i,e):void 0)||s||(a?le(a,e):void 0)||t[n%t.length]}},[d,i,e,s,l,a,r,c]),p=qe(()=>{if(!e||!g)return i;let s=Object.keys(i??{}),o=new Set(s),r=t.filter(e=>!o.has(e));"explicit-then-alpha"===n&&r.sort();let a=[...s,...r];if(0===a.length)return;let l=new Set(t),c=[];for(let e of a){if(l.has(e)){c.push([e,g(e)]);continue}let t=i?le(i,e):void 0;t&&c.push([e,t])}return c.length>0?Object.fromEntries(c):void 0},[t,g,i,e,n]);return{colorScale:g,colorMap:p}}function S(e){/* @__PURE__ */
|
|
31
|
+
return Ze(tt,{...e,windowMode:"growing"})}import{a as _}from"./c-GK263BF4.min.js";import{d as H,e as M,f as P,g as I}from"./c-AXJ2QI3F.min.js";import{d as T,e as N}from"./c-HNHKIMIV.min.js";import{a as R,h as z}from"./c-MTX2AO5S.min.js";import{a as B}from"./c-Z6GRGS53.min.js";import{C as F,Y as D,_ as L}from"./c-SAP5KY6R.min.js";import{C as O,Cb as j,Db as E,Eb as W,Fb as V,Lb as $,Nb as K,Pb as G,Sa as Y,Ta as U,Ua as q,Ub as X,bb as J,cb as Q,eb as Z,gb as ee,kb as te,ub as ie,wb as se,y as ne}from"./c-UMGHCBH5.min.js";import{d as oe,m as re,p as ae,s as le}from"./c-Y342FJ6K.min.js";var ce=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;let t=e-this._mean;this._mean+=t/this._count,this._m2+=t*(e-this._mean),this._min>e&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);let t=this._count+e._count,i=e._mean-this._mean;this._mean+=i*e._count/t,this._m2+=e._m2+i*i*this._count*e._count/t,this._count=t,this._min>e._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){let t=new e;return t.merge(this),t}get count(){return this._count}get mean(){return this._mean}get sum(){return this._mean*this._count}get variance(){return 2>this._count?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return 2>this._count?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},ue=class t{constructor(e=10){let t=Math.max(4,Math.min(16,Math.floor(e)));this.p=t,this.m=1<<t,this.registers=new Uint8Array(this.m),this.alpha=.7213/(1+1.079/this.m),this.harmonicSum=this.m,this.zeros=this.m}add(t){let i=e(t+""),s=i>>>32-this.p,n=Math.min(Math.clz32(i<<this.p),32-this.p)+1;this.updateRegister(s,n)}updateRegister(e,t){let i=this.registers[e];i>=t||(this.registers[e]=t,this.harmonicSum+=2**-t-2**-i,0===i&&this.zeros--)}merge(e){if(e.m===this.m)for(let t=0;this.m>t;t++)this.updateRegister(t,e.registers[t])}clone(){let e=new t(this.p);return e.registers.set(this.registers),e.harmonicSum=this.harmonicSum,e.zeros=this.zeros,e}count(){let e=this.alpha*this.m*this.m/this.harmonicSum;return Math.round(2.5*this.m>=e&&this.zeros>0?this.m*Math.log(this.m/this.zeros):e)}},he=class e{constructor(e=100){this.centroids=[],this.total=0,this.pending=0,this.compression=Math.max(20,e)}push(e){Number.isFinite(e)&&(this.centroids.push({mean:e,weight:1}),this.total+=1,this.pending++,this.pending>=2*this.compression&&this.compress())}merge(e){if(0===e.total)return;let t=0===this.total,i=e.centroids.length;for(let t=0;i>t;t++)this.centroids.push({...e.centroids[t]});this.total+=e.total,this.pending=t&&this.compression===e.compression?e.pending:this.pending+i,t||this.compress()}clone(){let t=new e(this.compression);return t.merge(this),t}quantile(e){if(0===this.total||Number.isNaN(e))return NaN;let t=Math.min(1,Math.max(0,e));this.compress();let i=t*this.total,s=this.centroids[0].weight/2;if(s>=i)return this.centroids[0].mean;for(let e=1;this.centroids.length>e;e++){let t=this.centroids[e-1],n=this.centroids[e],o=(t.weight+n.weight)/2,r=s+o;if(r>=i)return t.mean+(i-s)/o*(n.mean-t.mean);s=r}return this.centroids[this.centroids.length-1].mean}get count(){return this.total}compress(){if(0===this.pending||(this.pending=0,1>=this.centroids.length))return;this.centroids.sort((e,t)=>e.mean-t.mean);let e=0,t=0,i=this.total,s=this.compression;for(let n=1;this.centroids.length>n;n++){let o=this.centroids[e],r=this.centroids[n],a=(t+o.weight/2)/i;if(o.weight+r.weight>Math.max(1,4*i*a*(1-a)/s))t+=o.weight,this.centroids[++e]=r;else{let e=o.weight+r.weight;o.mean=(o.mean*o.weight+r.mean*r.weight)/e,o.weight=e}}this.centroids.length=e+1}},me=(e,t)=>e-t,de=class{constructor(e,t){this.stats=new ce,this.digest=e?new he:null,this.hll=t?new ue:null}push(e,t){this.stats.push(e),this.digest?.push(e),this.hll&&this.hll.add(t??e)}merge(e){this.stats.merge(e.stats),this.digest?.merge(e.digest),this.hll?.merge(e.hll)}},ge=class{constructor(e){this.windows=/* @__PURE__ */new Map,this.starts=[],this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;let t=e.hop??e.size;this.hop=t>0&&e.size>=t?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0,this.percentiles=e.percentiles??[],this.wantDistinct=!0===e.distinct}newBucket(){return new de(this.percentiles.length>0,this.wantDistinct)}push(e,t,i){!Number.isFinite(e)||!Number.isFinite(t)||(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t,i):this.pushFixed(e,t,i),this.prune())}pushFixed(e,t,i){if("tumbling"===this.type||this.hop>=this.size)return void this.bump(Math.floor(e/this.size)*this.size,t,i);let s=this.hop,n=Math.floor(e/s);for(let o=Math.floor((e-this.size)/s)+1;n>=o;o++)this.bump(o*s,t,i)}bump(e,t,s){let n=this.windows.get(e);if(!n){if(this.windows.size>=this.retain&&this.starts[0]>e)return;n=this.newBucket(),this.windows.set(e,n),this.retain!==1/0&&i(this.starts,e,me)}n.push(t,s)}pushSession(e,t,i){let s=e-this.gap,n=e+this.gap,o=0,r=this.sessions.length,a=this.sessions[r-1];if(a&&a.end>e)for(;r>o;){let e=o+r>>>1;s>this.sessions[e].end?o=e+1:r=e}else o=r,a&&a.end>=s&&n>=a.start&&o--;let l=this.sessions[o];if(!l||l.start>n){let s=this.newBucket();return s.push(t,i),void this.sessions.splice(o,0,{start:e,end:e,bucket:s})}l.bucket.push(t,i),l.start=Math.min(l.start,e),l.end=Math.max(l.end,e);let c=o+1;for(;this.sessions.length>c&&n>=this.sessions[c].start;){let e=this.sessions[c++];l.bucket.merge(e.bucket),l.end=Math.max(l.end,e.end)}c>o+1&&this.sessions.splice(o+1,c-o-1)}prune(){if(this.retain!==1/0){if("session"===this.type)return void(this.sessions.length>this.retain&&this.sessions.splice(0,this.sessions.length-this.retain));for(;this.windows.size>this.retain;)this.windows.delete(s(this.starts,me))}}emit(){if("session"===this.type)return this.sessions.map(e=>this.row(e.start,e.end,e.bucket,this.gap>this.latest-e.end));let e=[];for(let[t,i]of this.windows){let s=t+this.size;e.push(this.row(t,s,i,s>this.latest))}return e.sort((e,t)=>e.start-t.start),e}row(e,i,s,n){let o=s.stats,r={start:e,end:i,count:o.count,mean:o.mean,sum:o.sum,min:o.min,max:o.max,stddev:o.stddev,partial:n};if(s.digest){let e={};for(let i of this.percentiles)e[t(i)]=s.digest.quantile(i);r.percentiles=e}return s.hll&&(r.distinct=s.hll.count()),r}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.starts=[],this.sessions=[],this.latest=-1/0}},pe={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},ve=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g,fe=class{constructor(e){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){let t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};let s=[];return this._watermark!==-1/0&&Math.max(this._watermark-this.lateness,this._releasedThrough)>t?(this._lateCount+=1,s.push(e),"drop"===this.latePolicy?{released:[],late:s}:{released:[e],late:s}):(t>this._watermark&&(this._watermark=t),i(this.held,{item:e,time:t,order:this.nextOrder++},a),{released:this.drain(this._watermark-this.lateness),late:s})}drain(e){let t=[],i=this.held[0];for(;i&&e>=i.time;)s(this.held,a),t.push(i.item),this._releasedThrough=Math.max(this._releasedThrough,i.time),i=this.held[0];return t}flush(){return this.drain(1/0)}clear(){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}};import{useRef as we,useImperativeHandle as ye,forwardRef as be,useCallback as xe,useState as ke,useEffect as Ae,useMemo as Ce}from"react";import{jsx as Se,jsxs as _e}from"react/jsx-runtime";var He={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},Me={opacity:.7,marginRight:4},Pe="time",Ie="value",Te="__aggLower",Ne="__aggUpper",Re="__aggPartial",ze="count",Be="__aggStart",Fe="__aggEnd",De="__aggSeries",Le=class{constructor(e,t){this.config=e,this.seriesAccessor=t,this.groups=/* @__PURE__ */new Map}push(e,t,i){let s=f(e,t,"time"),n=f(e,i,"value");if(null==s||null==n)return;let o=null==this.seriesAccessor?"":("function"==typeof this.seriesAccessor?this.seriesAccessor(e):e[this.seriesAccessor])+"",r=this.groups.get(o);if(!r){if(r=p(this.config),!r)return;this.groups.set(o,r)}r.push(s,n)}emit(e){let t=[];for(let[i,s]of this.groups)for(let n of v(s,e))t.push(null==this.seriesAccessor?n:{...n,[De]:i});return t}clear(){this.groups.clear()}};import*as Oe from"react";var je=()=>({});import{jsx as Ee}from"react/jsx-runtime";R(z);var We=be(function(e,t){let i=y(e),{size:s,margin:n,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:h,seriesAccessor:m,data:d,timeAccessor:p,valueAccessor:v,timeExtent:b,valueExtent:A,extentPadding:C,stroke:S,strokeWidth:_,strokeDasharray:H,opacity:M,cursor:P,styleRules:I,background:N,tooltipContent:R,tooltip:z,onHover:B,annotations:F,autoPlaceAnnotations:O,svgAnnotationRules:W,tickFormatTime:V,tickFormatValue:K,decay:U,pulse:Z,staleness:ee,transition:te,linkedHover:ie,selection:se,onObservation:ne,chartId:oe,loading:re,loadingContent:ae,emptyContent:le,emphasis:ce,legendPosition:ue,aggregate:he,eventTime:me}=e,de=i.showAxes,ge=i.enableHover,pe=s??[i.width,i.height],ve=S??"#007bff",fe=_??2,be="string"==typeof v?v:"Value",Se=Ce(()=>{if(i.showLegend)return{legendGroups:[{label:"Series",type:"line",items:[{label:be,color:ve}],styleFn:e=>({stroke:e.color||"var(--semiotic-primary, #007bff)",strokeWidth:fe??2})}]}},[i.showLegend,be,ve,fe]),_e=E(e.legendInteraction,()=>be,[be]),{legend:He,margin:Me,legendPosition:Re}=j({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:ue,userMargin:n,defaults:i.marginDefaults,additionalLegend:Se,chartWidth:pe[0],chartHeight:pe[1],axisChrome:{hasAxis:!1!==i.showAxes}}),ze=u({timeAccessor:p,valueAccessor:v}),Be=q(),Fe=Y({tooltip:z,defaultTooltipContent:ze,customFunctionContext:"hover",multiDefaultContent:e=>Be({...e,allSeries:Array.isArray(e.allSeries)?e.allSeries.map(e=>({...e,group:e.group||("string"==typeof v?v:"value")})):e.allSeries})}),Oe=R??Fe.tooltipContent,je=we(null),{activeSelectionHook:We,customHoverBehavior:Ve,customClickBehavior:$e}=$({selection:se,linkedHover:ie,unwrapData:!0,onObservation:ne,chartType:"RealtimeLineChart",chartId:oe,mobileInteraction:i.mobileInteraction}),Ke=xe(e=>{B&&B(e),Ve(e)},[B,Ve]),Ge=null!=he,[Ye,Ue]=ke([]),qe=we(null),Xe=we(he);Xe.current=he;let Je=we(Ge);Je.current=Ge;let Qe=we(Ye),Ze=xe(e=>{Qe.current=e,Ue(e)},[]),et=we({timeAccessor:p,valueAccessor:v});et.current={timeAccessor:p,valueAccessor:v};let tt=Ge?[he.window??"tumbling",he.size,he.hop??"",he.gap??"",he.retain??"",(he.percentiles??[]).join(","),!0===he.distinct?"1":"0"].join("|"):"";Ae(()=>{if(!Ge)return void(qe.current=null);let e=Xe.current,t=new Le(e,m);if(qe.current=t,d){let{timeAccessor:e,valueAccessor:i}=et.current;for(let s of d)t.push(s,e,i)}Ze(t.emit(e))},[tt,Ge,d,p,v,m,Ze]),Ae(()=>{Ge&&qe.current&&Ze(qe.current.emit(Xe.current))},[he?.stat,he?.band,he?.sigma]);let it=xe(e=>{let t=qe.current,i=Xe.current;if(!t||!i)return;let{timeAccessor:s,valueAccessor:n}=et.current;for(let i of e)t.push(i,s,n);Ze(t.emit(i))},[Ze]),st=null!=me,nt=we(null),ot=we(me);ot.current=me;let rt=we(st);rt.current=st;let at=we(ne);at.current=ne;let lt=we(oe);lt.current=oe;let ct=st?`${me.lateness}|${me.latePolicy??"drop"}`:"",ut=xe(e=>{0!==e.length&&(Je.current?it(e):je.current?.pushMany(e))},[it]);Ae(()=>{let e=nt.current;if(e&&ut(e.flush()),!st)return void(nt.current=null);let t=p;nt.current=w(ot.current,e=>f(e,t,"time")??NaN)},[ct,st,ut,p]);let ht=xe(e=>{let t=nt.current;if(!rt.current||!t)return void ut(e);let i=[];for(let s of e){let e=t.push(s);for(let t of e.released)i.push(t);if(e.late.length){let i=at.current;if(i){let{timeAccessor:s}=et.current,n=ot.current?.latePolicy??"drop";for(let o of e.late)i({type:"late-data",datum:o,eventTime:f(o,s,"time")??NaN,watermark:t.watermark,policy:n,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:lt.current})}}}ut(i)},[ut]),mt=xe(()=>{let e=nt.current;!rt.current||!e||ut(e.flush())},[ut]);ye(t,()=>({push:e=>ht([e]),pushMany:e=>ht(e),flush:mt,remove:e=>Je.current?[]:je.current?.remove(e)??[],update:(e,t)=>Je.current?[]:je.current?.update(e,t)??[],clear:()=>{nt.current?.clear(),Je.current?(qe.current?.clear(),Ze([])):je.current?.clear()},getData:()=>Je.current?Qe.current:je.current?.getData()??[],getScales:()=>je.current?.getScales()??null}),[mt,ht,Ze]);let dt=Q(re,pe[0],pe[1],ae),gt=dt?null:J(Ge?void 0:d,pe[0],pe[1],le),pt=Ce(()=>()=>({stroke:"#007bff",strokeWidth:2}),[]),vt=Ce(()=>G(Ge?Pe:p??"time",Ge?Ie:v??"value"),[Ge,p,v]),ft=Ce(()=>X(pt,I,vt),[pt,I,vt]),wt=Ce(()=>{let e=L(ft,{stroke:S,strokeWidth:_,opacity:M});return t=>({...e(t),...null!=H&&{strokeDasharray:H},...null!=P&&{cursor:P}})},[ft,S,_,M,H,P]),yt=x(wt,[We],se),bt=a??l??"sliding",xt=g(c,d,h),kt=ce?`${o||""} semiotic-emphasis-${ce}`.trim():o,At=Ge?Ye:d,Ct=Ge?Pe:p,St=Ge?Ie:v,_t=Ge?"growing":bt,Ht=Ge?Math.max(1,he?.retain??Math.max(Ye.length,600)):xt,Mt=Ge&&he&&"none"!==(he.band??"none")?{y0Accessor:Te,y1Accessor:Ne,perSeries:null!=m}:void 0;return dt||gt||/* @__PURE__ */Ee(T,{ref:je,chartType:"line",runtimeMode:"streaming",size:pe,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Me,className:kt,...k(i,_e,e.legendInteraction),arrowOfTime:r,windowMode:_t,windowSize:Ht,data:At,timeAccessor:Ct,valueAccessor:St,groupAccessor:Ge&&null!=m?De:m,xExtent:b,yExtent:A,extentPadding:C,band:Mt,lineStyle:yt??wt,showAxes:de,background:N,hoverAnnotation:ge,tooltipContent:Oe,tooltipMode:Fe.tooltipMode,...D({linkedHover:ie,selection:se,onObservation:ne,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ke,customClickBehavior:$e}),annotations:F,legend:He,legendPosition:Re,autoPlaceAnnotations:O,svgAnnotationRules:W,tickFormatTime:V,tickFormatValue:K,decay:U,pulse:Z,staleness:ee,transition:te,pointIdAccessor:e.pointIdAccessor})});We.displayName="RealtimeLineChart";import{useRef as Ve,forwardRef as $e,useCallback as Ke,useMemo as Ge}from"react";import{useEffect as Ye,useLayoutEffect as Ue,useMemo as qe,useRef as Xe}from"react";var Je=/* @__PURE__ */Symbol("realtime-function-category-domain"),Qe=typeof window>"u"?Ye:Ue;import{jsx as Ze}from"react/jsx-runtime";R(M);var et=[],tt=$e(function(e,t){let i=y(e),{binSize:s,size:n,margin:o,className:r,arrowOfTime:a="right",windowMode:l,capacityMode:c,windowSize:u,capacity:h,data:d,timeAccessor:p,valueAccessor:v,direction:w="up",timeExtent:S,valueExtent:_,extentPadding:H,categoryAccessor:M,colors:P,fill:I,stroke:R,strokeWidth:z,opacity:L,cursor:O,styleRules:W,gap:V,background:K,tooltipContent:G,tooltip:Y,onHover:q,annotations:Z,autoPlaceAnnotations:ee,svgAnnotationRules:te,tickFormatTime:ie,tickFormatValue:se,linkedHover:oe,selection:re,decay:ae,pulse:le,staleness:ce,transition:ue,onObservation:he,chartId:me,loading:de,loadingContent:ge,emptyContent:pe,emphasis:ve,legendPosition:fe,legend:we,brush:ye,onBrush:be,linkedBrush:xe}=e,ke=i.showAxes,Ae=Ge(()=>{return(t={axes:e.axes,showTimeAxis:e.showTimeAxis,showValueAxis:e.showValueAxis}).axes??[{orient:"bottom",visible:!1!==t.showTimeAxis},{orient:"left",visible:!1!==t.showValueAxis}];var t},[e.axes,e.showTimeAxis,e.showValueAxis]),Ce=ne({showAxes:ke,axes:Ae}),Se=A(i.marginDefaults,Ae,ke,!!i.title),_e=i.enableHover,He=n??[i.width,i.height],Me=B({isPushMode:void 0===d,colorBy:M,colorScheme:P,showLegend:!1,legendPosition:fe,trackCategoryDomain:!1!==i.showLegend,registerLinkedCategories:!1}),Pe=Ge(()=>F(d??[],M),[d,M]),Ie=void 0===d?Me.categories:Pe,{colorScale:Te,colorMap:Ne}=C({enabled:!!M,categories:Ie,colors:P,fallbackColor:I,order:"explicit-then-alpha",domainKey:M}),Re=Ge(()=>{if(!Ne)return Ie;let e=new Set(Ie);return Object.keys(Ne).filter(t=>e.has(t))},[Ie,Ne]),ze=Ke(e=>null!=e.category?e.category+"":("function"==typeof M?M(e):M?e[M]:"")+"",[M]),{legend:Be,margin:Fe,legendPosition:De,hasAutomaticLegend:Le}=j({data:et,colorBy:M,colorScale:Te,showLegend:i.showLegend,legendPosition:fe,userMargin:o,defaults:Se,categories:Re,additionalLegend:we,chartWidth:He[0],chartHeight:He[1],axisChrome:Ce}),Oe=E(e.legendInteraction,M?ze:void 0,Re,Le,!0),je=G??U({tooltip:Y,defaultTooltipContent:m({timeAccessor:p,valueAccessor:v}),customFunctionContext:"hover"}).tooltipContent,Ee=Ve(null),{activeSelectionHook:We,hoverSelectionHook:$e,customHoverBehavior:Ye,customClickBehavior:Ue}=$({selection:re,linkedHover:oe,unwrapData:!0,onObservation:he,chartType:"RealtimeHistogram",chartId:me,mobileInteraction:i.mobileInteraction}),qe=Ke(e=>{q&&q(e),Ye(e)},[q,Ye]),Xe=!0===ye?{dimension:"x",snap:"bin"}:"x"===ye?{dimension:"x"}:"object"==typeof ye?ye:void 0,Je=Ke(e=>{be&&be(e),he&&he(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:me}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:me})},[be,he,me]),{brushStreamProps:Qe}=N({linkedBrush:xe,xAccessor:"string"==typeof p?p:"time",defaultDimension:"x",onBrush:Je});b(t,Ee);let tt=Q(de,He[0],He[1],ge),it=tt?null:J(d,He[0],He[1],pe),st={};null!=I&&(st.fill=I),null!=R&&(st.stroke=R),null!=z&&(st.strokeWidth=z),null!=L&&(st.opacity=L),null!=O&&(st.cursor=O),null!=V&&(st.gap=V);let nt=Ge(()=>{if(M&&Te)return e=>null==e.category?{}:{fill:Te(e.category+"")}},[M,Te]),ot=Ge(()=>e=>{let t=e.categoryValue??e.total,i="number"==typeof t&&Number.isFinite(t)?t:void 0,s=Number(e.binStart),n=Number(e.binEnd);return{value:i,x:Number.isFinite(s)&&Number.isFinite(n)?(s+n)/2:void 0,y:i,category:null==e.category?void 0:e.category+""}},[]),rt=Ge(()=>X(nt,W,ot),[nt,W,ot]),at=x(Ge(()=>e=>({...rt(e),...!M&&null!=I&&{fill:I},...null!=R&&{stroke:R},...null!=z&&{strokeWidth:z},...null!=L&&{opacity:L},...null!=O&&{cursor:O}}),[rt,M,I,R,z,L,O]),[$e||Oe.legendSelectionHook||We],re),lt=ve?`${r||""} semiotic-emphasis-${ve}`.trim():r,ct=Ke(e=>f(e,p,"time")??NaN,[p]),ut=Ke(e=>f(e,v,"value")??NaN,[v]),ht=l??c??"sliding",mt=g(u,d,h);return tt||it||/* @__PURE__ */Ze(T,{ref:Ee,chartType:"bar",runtimeMode:"streaming",size:He,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Fe,className:lt,...k(i,Oe,e.legendInteraction),arrowOfTime:a,windowMode:ht,windowSize:mt,data:d,timeAccessor:ct,valueAccessor:ut,xExtent:S,yExtent:_,invertY:"down"===w,extentPadding:H,binSize:s,categoryAccessor:M,barColors:Ne,barStyle:st,areaStyle:at,showAxes:ke,axes:Ae,background:K,hoverAnnotation:_e,tooltipContent:je,...D({linkedHover:oe,selection:re,onObservation:he,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:qe,customClickBehavior:Ue}),annotations:Z,autoPlaceAnnotations:ee,svgAnnotationRules:te,tickFormatTime:ie,tickFormatValue:se,decay:ae,pulse:le,staleness:ce,transition:ue,pointIdAccessor:e.pointIdAccessor,legend:Be,legendPosition:De,...Me.categoryDomainProps,brush:Xe||(xe?Qe.brush:void 0),onBrush:Xe||xe?Qe.onBrush:void 0})});tt.displayName="RealtimeHistogram",S.displayName="TemporalHistogram";var it=tt;import{useRef as st,forwardRef as nt,useCallback as ot,useMemo as rt}from"react";import{jsx as at}from"react/jsx-runtime";R(P);var lt=[],ct=nt(function(e,t){let i=y(e),{size:s,margin:n,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:h,data:m,timeAccessor:d,valueAccessor:p,timeExtent:v,valueExtent:f,yScaleType:w,extentPadding:A,decay:S,pulse:_,staleness:H,transition:M,categoryAccessor:P,colors:I,radius:N,fill:R,opacity:z,stroke:L,strokeWidth:O,cursor:W,pointStyle:V,styleRules:K,background:Y,tooltipContent:q,tooltip:Z,onHover:ee,annotations:te,autoPlaceAnnotations:ie,svgAnnotationRules:se,tickFormatTime:ne,tickFormatValue:oe,linkedHover:re,selection:ae,onObservation:le,chartId:ce,loading:ue,loadingContent:he,emptyContent:me,emphasis:de,legendPosition:ge}=e,pe=i.showAxes,ve=i.enableHover,fe=!0===i.showLegend,we=s??[i.width,i.height],ye=B({isPushMode:void 0===m,colorBy:P,colorScheme:I,showLegend:!1,legendPosition:ge,trackCategoryDomain:fe,registerLinkedCategories:!1}),be=rt(()=>F(m??[],P),[m,P]),xe=void 0===m?ye.categories:be,{colorScale:ke}=C({enabled:!!P,categories:xe,colors:I,fallbackColor:R,domainKey:P}),{legend:Ae,margin:Ce,legendPosition:Se,hasAutomaticLegend:_e}=j({data:lt,colorBy:P,colorScale:ke,showLegend:fe,legendPosition:ge,userMargin:n,defaults:i.marginDefaults,categories:xe,chartWidth:we[0],chartHeight:we[1],axisChrome:{hasAxis:!1!==i.showAxes}}),He=E(e.legendInteraction,P,xe,_e,!0),Me=q??U({tooltip:Z,defaultTooltipContent:u({timeAccessor:d,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,Pe=st(null),{activeSelectionHook:Ie,hoverSelectionHook:Te,customHoverBehavior:Ne,customClickBehavior:Re}=$({selection:ae,linkedHover:re,unwrapData:!0,onObservation:le,chartType:"RealtimeSwarmChart",chartId:ce,mobileInteraction:i.mobileInteraction}),ze=ot(e=>{ee&&ee(e),Ne(e)},[ee,Ne]);b(t,Pe);let Be=Q(ue,we[0],we[1],he),Fe=Be?null:J(m,we[0],we[1],me),De={};null!=N&&(De.radius=N),null!=R&&(De.fill=R),null!=z&&(De.opacity=z),null!=L&&(De.stroke=L),null!=O&&(De.strokeWidth=O),null!=W&&(De.cursor=W);let Le=V,Oe=rt(()=>{if(P)return e=>{let t="function"==typeof P?P(e):P?e[P]:void 0;return{...P&&ke?{fill:ke(t+"")}:void 0}}},[P,ke]),je=rt(()=>{let e=G(d??"time",p??"value");return t=>{let i="function"==typeof P?P(t):P?t[P]:void 0;return e(t,null==i?void 0:i+"")}},[d,p,P]),Ee=rt(()=>X(Oe,K,je),[Oe,K,je]),We=x(rt(()=>e=>({...Ee(e),...Le?.(e)}),[Ee,Le]),[Te||He.legendSelectionHook||Ie],ae),Ve=de?`${o||""} semiotic-emphasis-${de}`.trim():o,$e=a??l??"sliding",Ke=g(c,m,h);return Be||Fe||/* @__PURE__ */at(T,{ref:Pe,chartType:"swarm",runtimeMode:"streaming",size:we,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Ce,className:Ve,...k(i,He,e.legendInteraction),arrowOfTime:r,windowMode:$e,windowSize:Ke,data:m,timeAccessor:d,valueAccessor:p,xExtent:v,yExtent:f,yScaleType:w,extentPadding:A,decay:S,pulse:_,staleness:H,transition:M,categoryAccessor:P,swarmStyle:De,pointStyle:We,showAxes:pe,background:Y,hoverAnnotation:ve,tooltipContent:Me,...D({linkedHover:re,selection:ae,onObservation:le,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:ze,customClickBehavior:Re}),annotations:te,autoPlaceAnnotations:ie,svgAnnotationRules:se,tickFormatTime:ne,tickFormatValue:oe,legend:Ae,legendPosition:Se,...ye.categoryDomainProps,pointIdAccessor:e.pointIdAccessor})});ct.displayName="RealtimeSwarmChart";import{useRef as ut,forwardRef as ht,useCallback as mt,useMemo as dt}from"react";import{jsx as gt}from"react/jsx-runtime";R(I);var pt=ht(function(e,t){let i=y(e),{size:s,margin:n,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:m,timeAccessor:d,valueAccessor:p,timeExtent:v,valueExtent:f,extentPadding:w,decay:A,pulse:C,staleness:S,transition:_,positiveColor:H,negativeColor:M,connectorStroke:P,connectorWidth:I,gap:N,stroke:R,strokeWidth:z,opacity:B,cursor:F,styleRules:L,background:O,tooltipContent:W,tooltip:V,onHover:K,annotations:Y,autoPlaceAnnotations:q,svgAnnotationRules:Z,tickFormatTime:ee,tickFormatValue:te,linkedHover:ie,selection:se,onObservation:ne,chartId:oe,loading:re,loadingContent:ae,emptyContent:le,emphasis:ce,legendPosition:ue}=e,he=i.showAxes,me=i.enableHover,de=s??[i.width,i.height],ge=dt(()=>{if(i.showLegend)return{legendGroups:[{label:"Change",type:"fill",items:[{label:"Positive",color:H},{label:"Negative",color:M}],styleFn:e=>({fill:e.color||("Positive"===e.label?"var(--semiotic-success, #28a745)":"var(--semiotic-danger, #dc3545)")})}]}},[M,H,i.showLegend]),pe=mt(e=>{let t=e.delta??("function"==typeof p?p(e):e[p??"value"]);return 0>Number(t)?"Negative":"Positive"},[p]),ve=E(e.legendInteraction,pe,["Positive","Negative"]),{legend:fe,margin:we,legendPosition:ye}=j({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:ue,userMargin:n,defaults:i.marginDefaults,additionalLegend:ge,chartWidth:de[0],chartHeight:de[1],axisChrome:{hasAxis:!1!==i.showAxes}}),be=W??U({tooltip:V,defaultTooltipContent:h({timeAccessor:d,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,xe=ut(null),{activeSelectionHook:ke,hoverSelectionHook:Ae,customHoverBehavior:Ce,customClickBehavior:Se}=$({selection:se,linkedHover:ie,unwrapData:!0,onObservation:ne,chartType:"RealtimeWaterfallChart",chartId:oe,mobileInteraction:i.mobileInteraction}),_e=mt(e=>{K&&K(e),Ce(e)},[K,Ce]);b(t,xe);let He=Q(re,de[0],de[1],ae),Me=He?null:J(m,de[0],de[1],le),Pe={};null!=H&&(Pe.positiveColor=H),null!=M&&(Pe.negativeColor=M),null!=P&&(Pe.connectorStroke=P),null!=I&&(Pe.connectorWidth=I),null!=N&&(Pe.gap=N),null!=R&&(Pe.stroke=R),null!=z&&(Pe.strokeWidth=z),null!=B&&(Pe.opacity=B),null!=F&&(Pe.cursor=F);let Ie=Ae||ve.legendSelectionHook||ke,Te=dt(()=>G(d??"time",p??"value"),[d,p]),Ne=dt(()=>X(void 0,L,Te),[L,Te]),Re=x(dt(()=>e=>({...Ne(e),...null!=R&&{stroke:R},...null!=z&&{strokeWidth:z},...null!=B&&{opacity:B},...null!=F&&{cursor:F}}),[Ne,R,z,B,F]),[Ie],se),ze=ce?`${o||""} semiotic-emphasis-${ce}`.trim():o,Be=a??l??"sliding",Fe=g(c,m,u);return He||Me||/* @__PURE__ */gt(T,{ref:xe,chartType:"waterfall",runtimeMode:"streaming",size:de,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:we,className:ze,...k(i,ve,e.legendInteraction),arrowOfTime:r,windowMode:Be,windowSize:Fe,data:m,timeAccessor:d,valueAccessor:p,xExtent:v,yExtent:f,extentPadding:w,decay:A,pulse:C,staleness:S,transition:_,waterfallStyle:Pe,areaStyle:Re,showAxes:he,background:O,hoverAnnotation:me,tooltipContent:be,...D({linkedHover:ie,selection:se,onObservation:ne,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:_e,customClickBehavior:Se}),annotations:Y,autoPlaceAnnotations:q,svgAnnotationRules:Z,tickFormatTime:ee,tickFormatValue:te,legend:fe,legendPosition:ye,pointIdAccessor:e.pointIdAccessor})});pt.displayName="RealtimeWaterfallChart";import{useRef as vt,forwardRef as ft,useCallback as wt,useMemo as yt,useState as bt}from"react";import{jsx as xt}from"react/jsx-runtime";R(H);var kt=ft(function(e,t){let i=y(e),{size:s,margin:n,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:h,timeAccessor:m,valueAccessor:p,categoryAccessor:v,timeExtent:f,valueExtent:w,extentPadding:A,heatmapXBins:C=20,heatmapYBins:S=20,aggregation:H="count",colorScheme:M,customColorScale:P,cursor:I,styleRules:N,background:R,tooltipContent:z,tooltip:B,onHover:F,annotations:L,autoPlaceAnnotations:O,svgAnnotationRules:E,tickFormatTime:V,tickFormatValue:K,decay:G,pulse:Y,staleness:q,linkedHover:Z,selection:ee,onObservation:te,chartId:ie,loading:se,loadingContent:ne,emptyContent:re,emphasis:ae,legendPosition:le}=e,ce=i.showAxes,ue=i.enableHover,he=s??[i.width,i.height],[me,de]=bt(null),ge=yt(()=>me??[0,1],[me]),pe=yt(()=>{if("custom"===M&&P)return P;let e=oe(M||"blues");return t=>e(Math.max(0,Math.min(1,(t-ge[0])/(ge[1]-ge[0]||1))))},[M,P,ge]),ve=W(e.legendInteraction,e=>Number(e.value),ge),fe=yt(()=>i.showLegend?{gradient:{colorFn:pe,domain:ge,label:H}}:void 0,[H,pe,i.showLegend,ge]),{legend:we,margin:ye,legendPosition:be}=j({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:le,userMargin:n,defaults:i.marginDefaults,additionalLegend:fe,chartWidth:he[0],chartHeight:he[1],axisChrome:{hasAxis:!1!==i.showAxes}}),xe=z??U({tooltip:B,defaultTooltipContent:d({timeAccessor:m,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,ke=vt(null),{activeSelectionHook:Ae,hoverSelectionHook:Ce,customHoverBehavior:Se,customClickBehavior:_e}=$({selection:ee,linkedHover:Z,unwrapData:!0,onObservation:te,chartType:"RealtimeHeatmap",chartId:ie,mobileInteraction:i.mobileInteraction}),He=wt(e=>{F&&F(e),Se(e)},[F,Se]);b(t,ke);let Me=Q(se,he[0],he[1],ne),Pe=Me?null:J(h,he[0],he[1],re),Ie=ae?`${o||""} semiotic-emphasis-${ae}`.trim():o,Te=a??l??"sliding",Ne=g(c,h,u),Re=yt(()=>{if(null==I)return;let e={cursor:I};return()=>e},[I]),ze=yt(()=>_(m??"time",p??"value",p??"value"),[m,p]),Be=x(yt(()=>X(Re,N,ze),[Re,N,ze]),[Ce,ve.legendSelectionHook,Ae],ee);return Me||Pe||/* @__PURE__ */xt(T,{ref:ke,chartType:"heatmap",runtimeMode:"streaming",size:he,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ye,className:Ie,...k(i,ve,e.legendInteraction),arrowOfTime:r,windowMode:Te,windowSize:Ne,data:h,timeAccessor:m,valueAccessor:p,categoryAccessor:v,xExtent:f,yExtent:w,extentPadding:A,heatmapXBins:C,heatmapYBins:S,heatmapAggregation:H,colorScheme:"custom"!==M?M:void 0,heatmapColorScale:"custom"===M&&"function"==typeof P?P:void 0,onColorDomainChange:de,areaStyle:Be,showAxes:ce,background:R,hoverAnnotation:ue,tooltipContent:xe,...D({linkedHover:Z,selection:ee,onObservation:te,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:He,customClickBehavior:_e}),annotations:L,autoPlaceAnnotations:O,svgAnnotationRules:E,tickFormatTime:V,tickFormatValue:K,decay:G,pulse:Y,staleness:q,legend:we,legendPosition:be,pointIdAccessor:e.pointIdAccessor})});kt.displayName="RealtimeHeatmap";export{ce as a,ue as b,he as c,ge as d,n as e,o as f,r as g,fe as h,We as i,tt as j,S as k,it as l,ct as m,pt as n,kt as o};
|