semiotic 3.10.1 → 3.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -62
- package/ai/artifact-surface-inventory.json +4 -1
- package/ai/dist/mcp-server.js +25 -24
- package/ai/examples.md +28 -0
- package/ai/reference.md +6 -1
- package/ai/schema.json +121 -5
- package/ai/surface-manifest.json +3 -2
- package/ai/task-packets/compare-category-totals.json +7 -53
- package/ai/task-packets/compare-category-totals.md +4 -4
- package/ai/task-packets/correct-published-chart.json +7 -53
- package/ai/task-packets/correct-published-chart.md +4 -4
- package/ai/task-packets/index.json +9 -9
- package/ai/task-packets/update-live-chart.json +8 -54
- package/ai/task-packets/update-live-chart.md +4 -4
- package/dist/c-27DCB5T6.min.js +18 -0
- package/dist/c-2MONF2P6.min.js +1 -0
- package/dist/c-2TW5H5PD.min.js +1 -0
- package/dist/c-3AGX252H.min.js +1 -0
- package/dist/c-3B6JZEZT.min.js +1 -0
- package/dist/c-3BYZXCX3.min.js +4 -0
- package/dist/c-3DIPZJDO.min.js +1 -0
- package/dist/c-3FOUMWLR.min.js +1 -0
- package/dist/c-3NA6I656.min.js +2 -0
- package/dist/c-3OFVBWQY.min.js +1 -0
- package/dist/{c-QA3HMQJP.min.js → c-3PFVJFBK.min.js} +1 -1
- package/dist/c-3PPO7ZJF.min.js +4 -0
- package/dist/c-3YEW2PK6.min.js +1 -0
- package/dist/c-4JKDJUYD.min.js +1 -0
- package/dist/c-4LKK5YWB.min.js +1 -0
- package/dist/c-4MD53L2J.min.js +33 -0
- package/dist/c-4V3CD337.min.js +1 -0
- package/dist/c-4XLHPQTP.min.js +1 -0
- package/dist/c-5NYONM6V.min.js +5 -0
- package/dist/c-6IVBV5NO.min.js +1 -0
- package/dist/c-6ZU3QVLB.min.js +100 -0
- package/dist/c-72CBVNYX.min.js +209 -0
- package/dist/c-7APWCEPL.min.js +1 -0
- package/dist/c-7ASK4WBF.min.js +1 -0
- package/dist/{c-ORLEBW72.min.js → c-7FKPPCGN.min.js} +1 -1
- package/dist/c-7LY46QUI.min.js +41 -0
- package/dist/c-ABMGCCLT.min.js +1 -0
- package/dist/c-AINGQGUN.min.js +1 -0
- package/dist/c-AKLBQMQF.min.js +391 -0
- package/dist/c-AXJ2QI3F.min.js +1 -0
- package/dist/c-BQYD7T4E.min.js +1 -0
- package/dist/{c-V4XMSLC3.min.js → c-BYJJ7EMG.min.js} +1 -1
- package/dist/{c-J6DVC236.min.js → c-C4KIXUWU.min.js} +1 -1
- package/dist/c-C4SXYFXL.min.js +1 -0
- package/dist/c-CLDCKFBE.min.js +1 -0
- package/dist/c-CLJCJSFU.min.js +1 -0
- package/dist/c-CLLCX3PT.min.js +2 -0
- package/dist/c-ECHBKW7U.min.js +1 -0
- package/dist/c-EPJWM2UT.min.js +1 -0
- package/dist/c-F2GGJB2S.min.js +31 -0
- package/dist/c-FD2BXSRG.min.js +1 -0
- package/dist/c-FDUQDCBC.min.js +51 -0
- package/dist/c-FOTTQHOO.min.js +1 -0
- package/dist/c-FU7A5KSY.min.js +1 -0
- package/dist/c-G53AVC42.min.js +113 -0
- package/dist/c-GHN6IR4Y.min.js +1 -0
- package/dist/c-GSCO3FWL.min.js +1 -0
- package/dist/c-GYLOSK7M.min.js +1 -0
- package/dist/c-HK4OSLZA.min.js +1 -0
- package/dist/c-HLGTD5SJ.min.js +1 -0
- package/dist/c-HQ27AHMC.min.js +1 -0
- package/dist/{c-D6HAAPTX.min.js → c-IBRLFKWA.min.js} +1 -1
- package/dist/c-IHWZ2C6D.min.js +26 -0
- package/dist/c-IIV73MUW.min.js +1 -0
- package/dist/c-IPYGNVN6.min.js +116 -0
- package/dist/c-JJKRER47.min.js +1 -0
- package/dist/c-JO6AYCU4.min.js +1 -0
- package/dist/c-JWHPG6S2.min.js +1 -0
- package/dist/c-JXVYIXTV.min.js +1 -0
- package/dist/c-K2ZIYDI3.min.js +1 -0
- package/dist/c-K37JAIWA.min.js +4 -0
- package/dist/c-KGROWFT2.min.js +9 -0
- package/dist/c-MOP2NGLH.min.js +1 -0
- package/dist/c-MTX2AO5S.min.js +1 -0
- package/dist/c-N5WT7TXG.min.js +1 -0
- package/dist/c-NATWERHZ.min.js +1 -0
- package/dist/{c-42PLDTX7.min.js → c-O53GOO7H.min.js} +1 -1
- package/dist/c-OVQB75PE.min.js +1 -0
- package/dist/c-P3SKRNZN.min.js +1 -0
- package/dist/c-P5NXQWIM.min.js +1 -0
- package/dist/c-P7BQMVQQ.min.js +1 -0
- package/dist/{c-GNTXRXRN.min.js → c-PDQHLOKU.min.js} +1 -1
- package/dist/c-PKY4JFY5.min.js +1 -0
- package/dist/c-PQOZPM4G.min.js +1 -0
- package/dist/c-PZ3NEGNG.min.js +1 -0
- package/dist/c-QXLDCATV.min.js +1 -0
- package/dist/c-R2HUSWKB.min.js +1 -0
- package/dist/{c-HYW2XA4Q.min.js → c-RHDOOQ4X.min.js} +1 -1
- package/dist/c-RZPP5ERV.min.js +1 -0
- package/dist/c-SG2Y7EBY.min.js +46 -0
- package/dist/{c-WUWXGQYA.min.js → c-SJIB5RNI.min.js} +1 -1
- package/dist/c-SQNEVNWT.min.js +1 -0
- package/dist/c-STHZWF3D.min.js +1 -0
- package/dist/c-TIDKVMMZ.min.js +1 -0
- package/dist/c-TIMGODBG.min.js +1 -0
- package/dist/c-TR7OHUAO.min.js +2 -0
- package/dist/c-TTKWXGAI.min.js +61 -0
- package/dist/c-TVKZC4BY.min.js +1 -0
- package/dist/c-U5XVLSHN.min.js +1 -0
- package/dist/c-U6NLVFN4.min.js +1 -0
- package/dist/{c-VJTDST2R.min.js → c-UBHICVSC.min.js} +1 -1
- package/dist/c-UOPPO26M.min.js +1 -0
- package/dist/c-UUDAON4Z.min.js +1 -0
- package/dist/c-V32TPPY2.min.js +1 -0
- package/dist/c-V5KFJWQQ.min.js +1 -0
- package/dist/{c-P65V6HLO.min.js → c-VN557BQE.min.js} +1 -1
- package/dist/c-VXIYF7V2.min.js +1 -0
- package/dist/c-Y342FJ6K.min.js +1 -0
- package/dist/c-YM6CT4LJ.min.js +1 -0
- package/dist/{c-MVR3RWF3.min.js → c-YMFUIO54.min.js} +1 -1
- package/dist/c-YQVOKPKR.min.js +1 -0
- package/dist/c-YRJ3BJQZ.min.js +1 -0
- package/dist/c-YT5KPVNP.min.js +1 -0
- package/dist/components/ai/audienceProfile.d.ts +18 -1
- package/dist/components/ai/describeChart.d.ts +5 -1
- package/dist/components/ai/intentManifest.d.ts +16 -0
- package/dist/components/ai/intentRegistry.d.ts +12 -0
- package/dist/components/ai/intents.d.ts +6 -6
- package/dist/components/ai/streamSchema.d.ts +19 -0
- package/dist/components/ai/streamingTypes.d.ts +57 -11
- package/dist/components/ai/suggestCharts.d.ts +1 -1
- package/dist/components/ai/suggestStreamCharts.d.ts +43 -8
- package/dist/components/ai/suggestStreamDashboard.d.ts +35 -0
- package/dist/components/ai/variantDiscovery.d.ts +1 -1
- package/dist/components/charts/ordinal/BarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/DonutChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/PieChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/StackedBarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +14 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +6 -5
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -161
- package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +175 -0
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +6 -5
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +6 -5
- package/dist/components/charts/realtime/aggregate.d.ts +11 -1
- package/dist/components/charts/realtime/resolveWindowSize.d.ts +1 -1
- package/dist/components/charts/shared/DirectLabelLayer.d.ts +25 -0
- package/dist/components/charts/shared/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 +2 -0
- package/dist/components/charts/value/BigNumber.streamCapability.d.ts +2 -0
- package/dist/components/charts/value/GaugeChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/xy/BubbleChart.d.ts +4 -1
- package/dist/components/charts/xy/ConnectedScatterplot.d.ts +4 -1
- package/dist/components/charts/xy/LineChart.d.ts +4 -1
- package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
- package/dist/components/realtime/HyperLogLog.d.ts +19 -0
- package/dist/components/realtime/ReorderBuffer.d.ts +2 -2
- package/dist/components/realtime/TDigest.d.ts +22 -0
- package/dist/components/realtime/WindowAccumulator.d.ts +22 -5
- package/dist/components/realtime/applyChangelog.d.ts +38 -0
- package/dist/components/realtime/minHeap.d.ts +3 -0
- package/dist/components/recipes/atlas/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/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 +1529 -1
- package/dist/semiotic-client-glyph.module.min.js +3 -1
- package/dist/semiotic-client-responsive.module.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -1
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-evidence.min.js +3 -1
- package/dist/semiotic-evidence.module.min.js +3 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +8 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +8 -1
- package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.d.ts +6 -2
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +160 -1
- package/dist/semiotic-recipes-core.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 +4 -3
- 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,t){let o=[],i="bubble"===e.config.chartType?10:5,r=e.config.sizeRange||[3,15],a=null;if(e.getSize&&!e.config.pointStyle){let o=t.map(t=>e.getSize(t)).filter(e=>null!=e&&!Number.isNaN(e));if(o.length>0){let e=1/0,t=-1/0;for(let i of o)e>i&&(e=i),i>t&&(t=i);a=o=>e===t?(r[0]+r[1])/2:r[0]+(o-e)/(t-e)*(r[1]-r[0])}}let n=e.getColor?e.resolveColorMap(t):null,l=e.config.themeSemantic?.primary||"#4e79a7",s=e.getSymbol,c=s?W(s,e.config.symbolMap):null;for(let r of t){let t=e.config.pointStyle?e.config.pointStyle(r):{fill:l,opacity:.8},s=t.r||i;if(a&&e.getSize){let t=e.getSize(r);null!=t&&!Number.isNaN(t)&&(s=a(t))}if(n&&e.getColor&&!t.fill){let o=e.getColor(r);o&&n.has(o)&&(t={...t,fill:n.get(o)})}let f=e.getPointId?e.getPointId(r)+"":void 0;if(c){let i=c(r),a=S(r,e.scales,e.getX,e.getY,Math.PI*s*s,i,t,f);a&&o.push(a)}else{let i=b(r,e.scales,e.getX,e.getY,s,t,f);i&&o.push(i)}}return o}function t(e,t,o){return t===o?128:Math.min(Math.floor(255*(e-t)/(o-t)+.5),255)}function o(e){let t=Object.prototype.hasOwnProperty.call(x,e)?e:"blues",o=V.get(t);if(o)return o;o=Array(O);let i=A(t);for(let e=0;O>e;e++)o[e]=i(e/255);return V.set(t,o),o}function i(e,t,o){let i=o.config.areaStyle?.(t);return i&&("string"==typeof i.fill&&(e.fill=i.fill),e.style=i),e}function r(e,r,n){if(e.config.heatmapAggregation)return a(e,r,n);if(0===r.length)return[];let l=C(e.config.valueAccessor,"value"),s=M(e.config.xAccessor,"x"),c=M(e.config.yAccessor,"y"),f=/* @__PURE__ */new Map,g=/* @__PURE__ */new Map,u=Array(r.length),h=Array(r.length);for(let e=0;r.length>e;e++){let t=r[e],o=s(t),i=c(t);u[e]=o,h[e]=i,f.has(o)||f.set(o,f.size),g.has(i)||g.set(i,g.size)}let m=f.size,y=g.size;if(0===m||0===y)return[];let d=Array.from(f.keys()),p=Array.from(g.keys()),b=d.every(e=>"number"==typeof e&&!isNaN(e)),S=p.every(e=>"number"==typeof e&&!isNaN(e)),v=4096;if(b&&S&&m*y>v&&r.length>v){let t=/* @__PURE__ */new Set;for(let o=0;r.length>o;o++){let i=f.get(u[o]),l=g.get(h[o]);if(void 0!==i&&void 0!==l&&(t.add(l*m+i),t.size>v))return a({...e,config:{...e.config,heatmapAggregation:e.config.valueAccessor?"mean":"count"}},r,n)}}if(b){d.sort((e,t)=>Number(e)-Number(t)),f.clear();for(let e=0;d.length>e;e++)f.set(d[e],e)}if(S){p.sort((e,t)=>Number(e)-Number(t)),g.clear();for(let e=0;p.length>e;e++)g.set(p[e],e)}let k=new Float64Array(r.length),w=new Float64Array(r.length),x=Array(r.length),A=/* @__PURE__ */new Map,F=0;for(let e=0;r.length>e;e++){let t=r[e],o=f.get(u[e]),i=g.get(h[e]);if(void 0===o||void 0===i)continue;let a,n=l(t),s=i*m+o,c=A.get(s);void 0!==c?a=c:(a=F++,A.set(s,a)),k[a]=s,w[a]=n,x[a]=t}let W=1/0,X=-1/0;for(let e=0;F>e;e++){let t=w[e];isFinite(t)&&(W>t&&(W=t),t>X&&(X=t))}if(!isFinite(W)||!isFinite(X))return[];let R=e.config.heatmapColorScale,j=R?void 0:o("string"==typeof e.config.colorScheme?e.config.colorScheme:e.config.themeSequential||"blues"),z=n.width/m,Y=n.height/y,T=e.config.showValues,O=e.config.heatmapValueFormat,V=[];for(let o=0;F>o;o++){let r=w[o];if(!isFinite(r))continue;let a=k[o],n=a%m,l=(a-n)/m,s=t(r,W,X),c=R?R(r):j[s],f=x[o];V.push(i(N(n*z,(y-1-l)*Y,z,Y,c,f,T?{value:r,showValues:!0,valueFormat:O}:{value:r}),f,e))}return V}function a(e,r,a){let n=Math.max(1,Math.floor(e.config.heatmapXBins??20)),l=Math.max(1,Math.floor(e.config.heatmapYBins??20)),s=e.config.heatmapAggregation??"count",c=C(e.config.valueAccessor,"value");if(!e.scales||0===r.length)return[];let[f,g]=e.scales.x.domain(),[u,h]=e.scales.y.domain(),m=(g-f||1)/n,y=(h-u||1)/l,d=n*l;if(d>1e6)return[];let p=new Int32Array(d),b=new Float64Array(d),S=e.config.trackHoverRows||R(e.config.areaStyle)?/* @__PURE__ */new Map:void 0;for(let t=0;r.length>t;t++){let o=r[t],i=e.getX(o),a=e.getY(o);if(!isFinite(i)||!isFinite(a))continue;let s=Math.min(Math.floor((i-f)/m),n-1),g=Math.min(Math.floor((a-u)/y),l-1);if(0>s||0>g)continue;let h=g*n+s;p[h]++;let d=c(o);if(b[h]+=isFinite(d)?d:0,S){let e=S.get(h);e||(e=[],S.set(h,e)),e.push(o)}}let v=1/0,k=-1/0;for(let e=0;d>e;e++){if(0===p[e])continue;let t;switch(s){case"sum":t=b[e];break;case"mean":t=b[e]/p[e];break;default:t=p[e]}v>t&&(v=t),t>k&&(k=t)}if(!isFinite(v))return[];let w=e.config.heatmapColorScale,M=w?void 0:o("string"==typeof e.config.colorScheme?e.config.colorScheme:e.config.themeSequential||"blues"),x=a.width/n,A=a.height/l,F=e.config.showValues,W=e.config.heatmapValueFormat,j=[];for(let o=0;l>o;o++){let r=o*n;for(let a=0;n>a;a++){let n,c=r+a;if(0===p[c])continue;switch(s){case"sum":n=b[c];break;case"mean":n=b[c]/p[c];break;default:n=p[c]}let g=t(n,v,k),h=w?w(n):M[g],d=F?{value:n,showValues:!0,valueFormat:W}:{value:n},C=X({xi:a,yi:o,value:n,count:p[c],sum:b[c],xCenter:f+(a+.5)*m,yCenter:u+(o+.5)*y,agg:s},S?.get(c));j.push(i(N(a*x,(l-1-o)*A,x,A,h,C,d),C,e))}}return j}function n(e,t){if(!e.config.binSize)return{nodes:[],binBoundaries:[]};let o=m(t,e.getX,e.getY,e.config.binSize,e.getCategory,!!e.config.trackHoverRows||R(e.config.areaStyle));if(0===o.size)return{nodes:[],binBoundaries:[]};let i=null;if(e.getCategory){let t=/* @__PURE__ */new Set;for(let e of o.values())for(let o of e.categories.keys())t.add(o);let r=e.config.barColors?Object.keys(e.config.barColors):[],a=new Set(r),n=Array.from(t).filter(e=>!a.has(e)).sort(),l=r.filter(e=>t.has(e)),s=l.join("\0")+""+n.join("\0");e.barCategoryCache&&e.barCategoryCache.key===s?i=e.barCategoryCache.order:(i=[...l,...n],e.barCategoryCache={key:s,order:i})}let r=[],a=e.scales,[n,l]=a.x.domain(),s=e.config.barStyle,c=e.config.themeSemantic?.primary,f=s?.gap,g="number"!=typeof f||0>f?1:f,u={};s?.stroke&&(u.stroke=s.stroke),"number"==typeof s?.strokeWidth&&(u.strokeWidth=s.strokeWidth),"number"==typeof s?.opacity&&(u.opacity=s.opacity),s?.cursor&&(u.cursor=s.cursor);for(let t of o.values()){let o=Math.max(t.start,n),f=Math.min(t.end,l);if(o>=f)continue;let h=a.x(o),m=a.x(f),y=Math.abs(m-h),d=y>g+1?g:0,p=Math.min(h,m)+d/2,b=Math.max(y-d,1);if(b>0)if(i&&t.categories.size>0){let o=0;for(let n of i){let i=t.categories.get(n)||0;if(0===i)continue;let l=a.y(o),f=a.y(o+i),g=Math.min(l,f),h=Math.abs(l-f),m=(e.config.barColors?F(e.config.barColors,n):void 0)??s?.fill??c??"#4e79a7",y=X({binStart:t.start,binEnd:t.end,total:t.total,category:n,categoryValue:i},t.categoryRows?.get(n)),d=e.config.areaStyle?.(y)??{};r.push(v(p,g,b,h,{fill:m,...u,...d},y,n)),o+=i}}else{let o=a.y(0),i=a.y(t.total),n=Math.min(o,i),l=Math.abs(o-i),f=s?.fill||c||"#007bff",g=X({binStart:t.start,binEnd:t.end,total:t.total},t.rows),h=e.config.areaStyle?.(g)??{};r.push(v(p,n,b,l,{fill:f,...u,...h},g))}}let h=/* @__PURE__ */new Set;for(let e of o.values())h.add(e.start),h.add(e.end);return{nodes:r,binBoundaries:Array.from(h).sort((e,t)=>e-t)}}function l(e,t){let o=[],i=e.config.swarmStyle||{},r=i.radius??3,a=i.fill??e.config.themeSemantic?.primary??"#007bff",n=i.opacity??.7,l=i.stroke,s=i.strokeWidth,c=i.cursor;for(let i of t){let t=e.getX(i),f=e.getY(i);if(null==f||Number.isNaN(f))continue;let g=e.scales.x(t),u=e.scales.y(f),h=a;if(e.getCategory){let t=e.getCategory(i)+"";h=(e.config.barColors?F(e.config.barColors,t):void 0)??h}let{r:m,...y}=e.config.pointStyle?.(i)??{},d={type:"point",x:g,y:u,r:m??r,style:{fill:h,opacity:n,stroke:l,strokeWidth:s,cursor:c,...y},datum:i};e.getPointId&&(d.pointId=e.getPointId(i)+""),o.push(d)}return o}function s(e,t,o){let i=[],r=e.scales,a=e.config.waterfallStyle,n=t.filter(t=>{let o=e.getY(t),i=e.getX(t);return null!=o&&!Number.isNaN(o)&&null!=i&&isFinite(i)});if(0===n.length)return i;let l=a?.positiveColor??e.config.themeSemantic?.success??"#28a745",s=a?.negativeColor??e.config.themeSemantic?.danger??"#dc3545",c=a?.gap??1,f=a?.stroke,g=a?.strokeWidth,u=a?.opacity,h=0;for(let t=0;n.length>t;t++){let m=n[t],y=e.getX(m),d=e.getY(m),p=h+d,b=r.x(y),S=t>0?r.x(e.getX(n[t-1])):void 0,N=n.length-1>t?r.x(e.getX(n[t+1])):void 0,k=null!=S?(S+b)/2:null!=N?b-(N-b)/2:b-o.width/20,w=null!=N?(b+N)/2:null!=S?b+(b-S)/2:b+o.width/20,C=Math.min(k,w)+c/2,M=Math.max(k,w)-c/2-C;if(0>=M){h=p;continue}let x=r.y(h),A=r.y(p),F=Math.min(x,A),W=Math.abs(x-A),X=0>d?s:l,R={...m,baseline:h,cumEnd:p,delta:d,_connectorStroke:a?.connectorStroke,_connectorWidth:a?.connectorWidth},j={fill:X,stroke:f,strokeWidth:g,opacity:u,cursor:a?.cursor,...e.config.areaStyle?.(R)};i.push(v(C,F,M,W,j,R)),h=p}return i}function c(e,t,o){if(!e.getHigh||!e.getLow||!e.scales)return[];let i=e.config.candlestickRangeMode??!1;if(!(i||e.getOpen&&e.getClose))return[];let r=[],a=e.config.candlestickStyle||{},n=a.rangeColor||"#6366f1",l=i?n:a.upColor||"#28a745",s=i?n:a.downColor||"#dc3545",c=i?n:a.wickColor||"#333",f=a.wickWidth||(i?2:1),g=a.bodyWidth??0;if(null==a.bodyWidth){let o=t.map(t=>e.getX(t)).filter(e=>null!=e&&!Number.isNaN(e)).sort((e,t)=>e-t);if(o.length>1){let t=1/0,i=e.scales.x(o[0]);for(let r=1;o.length>r;r++){let a=e.scales.x(o[r]),n=Math.abs(a-i);n>0&&t>n&&(t=n),i=a}g=t!==1/0?Math.max(2,Math.min(.6*t,20)):6}else g=6}for(let n of t){let t=e.getX(n);if(null==t||Number.isNaN(t))continue;let u=e.getHigh(n),h=e.getLow(n);if(null==u||Number.isNaN(u)||null==h||Number.isNaN(h))continue;let m=i?u:e.getOpen(n),y=i?h:e.getClose(n);if(!i&&(null==m||Number.isNaN(m)||null==y||Number.isNaN(y)))continue;let d=y>=m,p=e.config.pointStyle?.(n)??{},b="string"==typeof p.fill?p.fill:void 0,S="string"==typeof p.stroke?p.stroke:void 0,v="number"==typeof p.strokeWidth?p.strokeWidth:void 0,N="number"==typeof p.opacity?p.opacity:"number"==typeof p.fillOpacity?p.fillOpacity:void 0,k={type:"candlestick",x:e.scales.x(t),openY:e.scales.y(m),closeY:e.scales.y(y),highY:e.scales.y(u),lowY:e.scales.y(h),bodyWidth:g,upColor:b&&d?b:l,downColor:b&&!d?b:s,wickColor:S??(i&&b?b:c),wickWidth:v??f,isUp:d,style:{cursor:a.cursor,...p,...void 0!==N&&{opacity:N}},datum:n};i&&(k.isRange=!0,k.dotRadius=Math.max(2,Math.min(g/2,.12*o.height))),r.push(k)}return r}import{a as f,b as g,c as u,d as h}from"./c-CLDCKFBE.min.js";import{f as m,i as y}from"./c-MTX2AO5S.min.js";import{a as d}from"./c-R2HUSWKB.min.js";import{a as p}from"./c-SQNEVNWT.min.js";import{f as b,g as S,h as v,i as N}from"./c-HK4OSLZA.min.js";import{a as k}from"./c-P5NXQWIM.min.js";import{a as w}from"./c-TIMGODBG.min.js";import{b as C,c as M}from"./c-U5XVLSHN.min.js";import{c as x,d as A,s as F}from"./c-Y342FJ6K.min.js";import{c as W}from"./c-3BYZXCX3.min.js";import{a as X,e as R}from"./c-U6NLVFN4.min.js";var j={chartType:"stackedarea",buildScene:(e,t)=>y(e,t),canvasRenderers:[d,k]},z=[k,w],Y={chartType:"scatter",buildScene:(t,o)=>e(t,o),canvasRenderers:z},T={chartType:"bubble",buildScene:(t,o)=>e(t,o),canvasRenderers:z},O=256,V=/* @__PURE__ */new Map,B={chartType:"heatmap",buildScene:(e,t,o)=>r(e,t,o),canvasRenderers:[f]},I={chartType:"bar",buildScene:(e,t)=>n(e,t),canvasRenderers:[p]},H={chartType:"swarm",buildScene:(e,t)=>l(e,t),canvasRenderers:[u]},P={chartType:"waterfall",buildScene:(e,t,o)=>s(e,t,o),canvasRenderers:[h]},L={chartType:"candlestick",buildScene:(e,t,o)=>c(e,t,o),canvasRenderers:[g]};export{j as a,Y as b,T as c,B as d,I as e,H as f,P as g,L as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(){j(p),j(e),j(s),j(h),j(m),j(o),j(i),j(r),j(c),j(n),j(t),j(f)}import{a as s,b as m,c as o,d as i,e as r,f as c,g as n,h as t}from"./c-AXJ2QI3F.min.js";import{e as f}from"./c-CLDCKFBE.min.js";import{a as j,h as p,j as e,k as h}from"./c-MTX2AO5S.min.js";export{a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n){return!!(n.dirtyOrRebuilt||n.transitioning||n.animationTicked||n.continuous||n.liveEncoding||n.forced)}function i(n,i){return n||i}export{n as
|
|
1
|
+
function n(n){return!!(n.dirtyOrRebuilt||n.transitioning||n.animationTicked||n.continuous||n.liveEncoding||n.forced)}function i(n,i){return n||i}export{n as a,i as b};
|
|
@@ -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{Nb as n}from"./c-G53AVC42.min.js";export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,a,h,i){if("none"!==t)return"color"===t||null==t?a??i:"accent"===t?h:t}function a(t,a,i=0,n="horizontal"){let[e,o]=t.viewBox??h,r=Math.min(1,Math.max(0,i)),l=Math.min(1,Math.max(0,a));return l>r?r>0||1>l?"vertical"===n?{x:0,y:o*(1-l),width:e,height:o*(l-r)}:{x:e*r,y:0,width:e*(l-r),height:o}:null:{x:0,y:0,width:0,height:0}}var h=[40,40];export{h as a,t as b,a as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,e){let[l,i,o]=c(t,e);return.299*l+.587*i+.114*o>128?"#000":"#fff"}function e(t){return Number.isInteger(t)?t+"":100>Math.abs(t)?1>Math.abs(t)?t.toPrecision(3):t.toFixed(1):t.toFixed(0)}import{a as l}from"./c-R2HUSWKB.min.js";import{b as i}from"./c-STHZWF3D.min.js";import{a as o}from"./c-SQNEVNWT.min.js";import{a}from"./c-P5NXQWIM.min.js";import{a as r}from"./c-TIMGODBG.min.js";import{a as s}from"./c-3AGX252H.min.js";import{b as n}from"./c-V5KFJWQQ.min.js";import{m as h,p as c,r as f,y as m}from"./c-3BYZXCX3.min.js";var y=(l,i,o,a)=>{let r=i.filter(t=>"heatcell"===t.type);l.save();try{let i=h(l,"var(--semiotic-font-family, sans-serif)")||"sans-serif";for(let o of r){let a=o.style;null!=a?.opacity&&(l.globalAlpha=a.opacity);let r=m(l,o.fill,"#4e79a7");l.fillStyle=r,l.fillRect(o.x,o.y,o.w,o.h);let s=Math.max(0,a?.strokeWidth??1);if(s>0&&(l.strokeStyle=h(l,a?.stroke??"var(--semiotic-surface, #fff)"),l.lineWidth=s,l.strokeRect(o.x,o.y,o.w,o.h)),n(l,o),l.globalAlpha=1,o.showValues&&null!=o.value){if(20>o.w||20>o.h)continue;let a=o.valueFormat?o.valueFormat(o.value):e(o.value),s=Math.max(10,Math.min(16,.3*Math.min(o.w,o.h))),n=o.x+o.w/2,h=o.y+o.h/2;l.fillStyle=t(l,"string"==typeof r?r:"#4e79a7"),l.font=`${s}px ${i}`,l.textAlign="center",l.textBaseline="middle",l.fillText(a,n,h)}}}finally{l.restore()}},d=(t,e,l,i)=>{for(let l of e){if("candlestick"!==l.type)continue;let e=l;t.save();let o=(e._decayOpacity??1)*(e.style?.opacity??1);1!==o&&(t.globalAlpha=o);let a=h(t,e.wickColor)||e.wickColor,r=60>i.height,s=r?Math.max(e.wickWidth,2):e.wickWidth,n=()=>{t.beginPath(),t.moveTo(e.x,e.highY),t.lineTo(e.x,e.lowY),t.strokeStyle=a,t.lineWidth=s,t.stroke()};if(r||n(),e.isRange){let l=e.dotRadius??Math.max(2,Math.min(e.bodyWidth/2,.12*i.height)),o=m(t,f(e.style?.fill)?e.style.fill:e.wickColor,e.wickColor);t.fillStyle=o,t.beginPath(),t.arc(e.x,e.highY,l,0,2*Math.PI),t.fill(),t.beginPath(),t.arc(e.x,e.lowY,l,0,2*Math.PI),t.fill()}else if(e.bodyWidth>0){let l=Math.min(e.openY,e.closeY),i=Math.abs(e.openY-e.closeY),o=e.isUp?e.upColor:e.downColor,a=m(t,f(e.style?.fill)?e.style.fill:o,o),r="string"==typeof a?a:h(t,e.wickColor)||e.wickColor;t.fillStyle=a,t.fillRect(e.x-e.bodyWidth/2,l,e.bodyWidth,Math.max(i,1)),t.strokeStyle=r,t.lineWidth=1,t.strokeRect(e.x-e.bodyWidth/2,l,e.bodyWidth,Math.max(i,1))}r&&n(),t.restore()}},u=a,p=(t,e,l,i)=>{o(t,e,l,i);let a=e.filter(t=>"rect"===t.type);if(2>a.length)return;let r=a[0].datum,s=r?._connectorStroke;if(s){t.save(),t.strokeStyle=h(t,s)||s,t.lineWidth=r?._connectorWidth??1,t.setLineDash([]);for(let e=0;a.length-1>e;e++){let i=a[e],o=a[e+1],r=i.datum,s=o.datum;if(null==r?.cumEnd||null==s?.baseline)continue;let n=l.y(r.cumEnd),h=i.x+i.w,c=o.x;t.beginPath(),t.moveTo(h,n),t.lineTo(c,n),t.stroke()}t.restore()}},x={chartType:"custom",buildScene:()=>[],canvasRenderers:[l,o,y,i,a,r,s,d,u,p]};export{y as a,d as b,u as c,p as d,x as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){let o=B();for(let t of e.nodes)R(o,t.id,t.completeness??"known");let n=B();for(let e of t.unsupportedTemplates)R(n,e,"unsupported-template");if(t.incompleteCandidates.length>0){let e=new Set(t.incompleteCandidates.map(e=>e.template));for(let t of e)R(n,t,"incomplete")}let i=t.matches.find(e=>e.truncation),r={nodes:o,motifs:n,traces:e.occurrences?.some(e=>e.missingPrehistory||!1===e.complete)?"incomplete":e.nodes.some(e=>"unknown"===e.completeness)?"unknown":"known"};return i?.truncation&&(r.truncation={disclosed:!0,template:i.template,omitted:i.truncation.omitted}),r}function t(e){let t=new Map(e.nodes.map(e=>[e.id,[]])),o=new Map(e.nodes.map(e=>[e.id,[]]));for(let n of e.edges)t.get(n.source).push(n),o.get(n.target).push(n);return{outgoing:t,incoming:o}}function o(e,t){let o=/* @__PURE__ */new Set,n=[];for(let i of t){if(o.has(i))continue;o.add(i);let t=[{node:i,next:0}];for(;t.length;){let i=t[t.length-1],r=e[i.node][i.next++];void 0===r?(n.push(i.node),t.pop()):o.has(r)||(o.add(r),t.push({node:r,next:0}))}}return n}function n(e){let t=e.nodes.map(e=>e.id).sort(),n=new Map(t.map((e,t)=>[e,t])),i=t.map(()=>[]),r=t.map(()=>[]);for(let t of e.edges){let e=n.get(t.source),o=n.get(t.target);i[e].push(o),r[o].push(e)}let s=/* @__PURE__ */new Set,d=[];for(let e of o(i,t.map((e,t)=>t)).reverse()){if(s.has(e))continue;let o=[],n=[e];for(s.add(e);n.length;){let e=n.pop();o.push(t[e]);for(let t of r[e])s.has(t)||(s.add(t),n.push(t))}d.push(o.sort())}return d.sort((e,t)=>e[0].localeCompare(t[0]))}function i(e,o,n="rooted-traversal:id-asc"){let{outgoing:i}=t(e),r=n.endsWith("id-desc")?-1:1;for(let e of i.values())e.sort((e,t)=>r*e.id.localeCompare(t.id));let s=new Set(o),d=[],a=[...new Set(o)],c=e=>{let t=[{node:e,next:0}];for(;t.length;){let e=t[t.length-1],o=i.get(e.node)?.[e.next++];o?s.has(o.target)||(s.add(o.target),d.push([o.target,o.id]),t.push({node:o.target,next:0})):t.pop()}};for(let e of a)c(e);for(let t of e.nodes.map(e=>e.id).sort())s.has(t)||(a.push(t),s.add(t),c(t));let l=d.map(([,e])=>e),u=new Set(l);return{forest:{kind:"rooted-backbone",roots:a,rankingPolicyId:n,backboneEdgeIds:l,primaryParentEdgeIdByNode:Object.fromEntries(d)},residual:{originalEdgeIds:e.edges.map(e=>e.id),residualEdgeIds:e.edges.filter(e=>!u.has(e.id)).map(e=>e.id)}}}function r(e){let[t,o]=e.split(":");return{mode:"tree-only"===t?"tree-only":"main-transport",order:"id-desc"===o?"id-desc":"id-asc"}}function s(e,t,o){if("ordinal"!==t.coordinate.kind)return!0;let n=e.nodes.find(e=>e.id===o);return!(!n?.sectionId||!t.coordinate.sectionIds.includes(n.sectionId))}function d(e,t){return[...e].sort((e,o)=>"id-asc"===t?e.id.localeCompare(o.id):o.id.localeCompare(e.id))}function a(e,t){if(e.forest.display.rankingPolicyId?.startsWith("rooted-traversal"))return i(t,e.forest.display.roots??[],e.forest.display.rankingPolicyId);let o=t.edges.map(e=>e.id),n=e.forest.display.rankingPolicyId??"main-transport",{mode:a,order:c}=r(n),l=o=>s(t,e,o.source)&&s(t,e,o.target),u=/* @__PURE__ */new Map;for(let e of t.nodes)u.set(e.id,[]);for(let e of t.edges)u.has(e.target)||u.set(e.target,[]),u.get(e.target).push(e);let f,p=B(),g=e.forest.display.roots&&e.forest.display.roots.length>0?e.forest.display.roots:t.nodes[0]?[t.nodes[0].id]:[],m=new Set(g);for(let e of t.nodes){if(m.has(e.id))continue;let t=d(u.get(e.id)??[],c),o=t.find(e=>l(e))??t[0];o&&R(p,e.id,o.id)}f="tree-only"===a?Object.values(p):t.edges.filter(e=>l(e)).map(e=>e.id);let h=new Set(f),y=o.filter(e=>!h.has(e));return{forest:{kind:"rooted-backbone",roots:[...g],rankingPolicyId:n,backboneEdgeIds:f,primaryParentEdgeIdByNode:p},residual:{residualEdgeIds:y,originalEdgeIds:o}}}function c(e,t){let o=new Set(e.originalEdgeIds),n=new Set(t.backboneEdgeIds),i=new Set(e.residualEdgeIds);if(n.size!==t.backboneEdgeIds.length)throw Error("duplicate backbone edge id");if(i.size!==e.residualEdgeIds.length)throw Error("duplicate residual edge id");for(let e of n){if(i.has(e))throw Error(`edge ${e} is both backbone and residual`);if(!o.has(e))throw Error(`backbone edge ${e} is not original`)}for(let e of i)if(!o.has(e))throw Error(`residual edge ${e} is not original`);if(n.size+i.size!==o.size)throw Error("original edge IDs != backbone ⊎ residual")}function l(e){let t=new Map(e.nodes.map(e=>[e.id,/* @__PURE__ */new Set])),o=new Map(e.nodes.map(e=>[e.id,/* @__PURE__ */new Set])),n=/* @__PURE__ */new Map;for(let i of e.edges){t.get(i.target)?.add(i.source),o.get(i.source)?.add(i.target);let e=n.get(i.source);e||n.set(i.source,e=/* @__PURE__ */new Map);let r=e.get(i.target);r?r.push(i.id):e.set(i.target,[i.id])}return{incoming:new Map([...t].map(([e,t])=>[e,[...t]])),outgoing:new Map([...o].map(([e,t])=>[e,[...t]])),sectionByNode:new Map(e.nodes.map(e=>[e.id,e.sectionId])),pairs:n}}function u(e,t){return e.sectionByNode.get(t)}function f(e,t){let o=/* @__PURE__ */new Set,n=[];for(let i of t){let t=u(e,i);!t||o.has(t)||(o.add(t),n.push(t))}return n}function p(e,t,o){return e.pairs.get(t)?.get(o)??[]}function g(e){return e.entityCount??1}function m(e,t){let o=[],n=0;for(let i of e)!i.nodePath.includes(t)||i.missingPrehistory||(o.push(i.entityId),n+=g(i));return{entityIds:o,entityCount:n}}function h(e,t){return null!=t&&e.length>t?{kept:e.slice(0,t),truncation:{disclosed:!0,omitted:e.length-t,fullCount:e.length}}:{kept:e}}function y(e,t,o,n,i,r){if(2>o.length)return;let{kept:s,truncation:d}=h(o,r),a=[t,...s],c=[];for(let o of s){let n="fan-out"===e?p(i,t,o):p(i,o,t);c.push(...n)}let l=f(i,[t,...o]),u=m(n.occurrences??[],t);return{id:`${e}:${t}`,template:e,roles:"fan-out"===e?{source:t,destinations:s}:{destination:t,sources:s},nodePath:a,edgeIds:c,startSectionId:l[0],completionSectionId:l[l.length-1],intersectSectionIds:l,entityIds:u.entityIds,entityWeights:B(),entityCount:u.entityCount,flags:{occurrence:u.entityIds.length>0,temporal:!1,trajectorySupported:u.entityIds.length>0,enriched:!1},truncation:d}}function I(e,t,o){return 1===t.length&&1===o.length}function k(e,t){let o=t.incoming,n=t.outgoing,i=[];for(let r of e.nodes){let s=o.get(r.id)??[],d=n.get(r.id)??[];if(1!==d.length)continue;let a=1===s.length&&I(0,o.get(s[0])??[],n.get(s[0])??[]);if(I(0,s,d)&&a)continue;let c=[r.id],l=r.id,u=/* @__PURE__ */new Set([l]);for(;;){let e=(n.get(l)??[])[0];if(!e||u.has(e)||(c.push(e),u.add(e),!I(0,o.get(e)??[],n.get(e)??[])))break;l=e}if(2>c.length)continue;let g=[];for(let e=0;c.length-1>e;e++)g.push(...p(t,c[e],c[e+1]));let h=f(t,c),y=m(e.occurrences??[],c[0]);i.push({id:"serial-chain:"+c.join(">"),template:"serial-chain",roles:{nodes:c,start:c[0],end:c[c.length-1]},nodePath:c,edgeIds:g,startSectionId:h[0],completionSectionId:h[h.length-1],intersectSectionIds:h,entityIds:y.entityIds,entityWeights:B(),entityCount:y.entityCount,flags:{occurrence:y.entityIds.length>0,temporal:!1,trajectorySupported:y.entityIds.length>0,enriched:!1}})}return i}function b(e,t){let o=t.occurrences??[];if(0!==o.length)for(let t of e){if("repeated-state-episode"===t.template)continue;let e=t.nodePath,n=B();for(let t of o)t.missingPrehistory||!e.some(e=>t.nodePath.includes(e))||R(n,t.entityId,g(t));let i=Object.keys(n);t.entityIds=i,t.entityWeights=n,t.entityCount=i.reduce((e,t)=>e+(n[t]??0),0),t.flags={...t.flags,occurrence:i.length>0,trajectorySupported:i.length>0}}}function w(e,t){let o=[];for(let n of e.occurrences??[]){if(n.missingPrehistory)continue;let e=/* @__PURE__ */new Map,i=/* @__PURE__ */new Set;for(let[r,s]of n.nodePath.entries()){let d=e.get(s);if(null==d){e.set(s,r);continue}if(i.has(s))continue;i.add(s);let a=n.nodePath.slice(d,r+1),c=f(t,a),l=B();R(l,n.entityId,g(n)),o.push({id:`repeated-state-episode:${n.id}:${s}`,template:"repeated-state-episode",roles:{state:s,occurrence:n.id},nodePath:a,edgeIds:[],startSectionId:u(t,a[0]),completionSectionId:u(t,a[a.length-1]),intersectSectionIds:c,entityIds:[n.entityId],entityWeights:l,entityCount:g(n),flags:{occurrence:!0,temporal:!1,trajectorySupported:!0,enriched:!1}})}}return o}function P(e,t){let o=e.motifs.matchBudget,n=l(t),i=[];for(let e of t.nodes){let r=y("fan-out",e.id,n.outgoing.get(e.id)??[],t,n,o);r&&i.push(r);let s=y("fan-in",e.id,n.incoming.get(e.id)??[],t,n,o);s&&i.push(s)}i.push(...k(t,n)),i.push(...w(t,n)),b(i,t);let r=[];for(let e of t.occurrences??[])e.missingPrehistory&&(r.push({template:"serial-chain",occurrenceId:e.id,reason:"missing-prehistory"}),r.push({template:"repeated-state-episode",occurrenceId:e.id,reason:"missing-prehistory"}));let s=K.filter(e=>!F.includes(e));return{catalogId:e.motifs.catalogId,catalogVersion:e.motifs.catalogVersion,matches:i,incompleteCandidates:r,unsupportedTemplates:s}}function C(e){return e.entityCount??1}function S(e,t,o){let n=t??"";e.partitionCounts.set(n,(e.partitionCounts.get(n)??0)+o)}function v(e,t={}){function o(e){let t=[...e.children.keys()];return t.sort((t,o)=>{let n=e.children.get(t),i=e.children.get(o),r=s?n.partitionCounts.get(s)??0:1;return r>0!=(s?i.partitionCounts.get(s)??0:1)>0?r>0?-1:1:t.localeCompare(o)}),t}let n={id:"",stateId:"",prefix:[],children:/* @__PURE__ */new Map,occurrenceIds:[],entityCount:0,partitionCounts:/* @__PURE__ */new Map};for(let t of e){if(t.missingPrehistory)continue;let e=C(t),o=n;o.occurrenceIds.push(t.id),o.entityCount+=e,S(o,t.partition,e);for(let n of t.nodePath){let i=[...o.prefix,n],r=V(i,i.length-1),s=o.children.get(n);s||(s={id:r,stateId:n,prefix:i,children:/* @__PURE__ */new Map,occurrenceIds:[],entityCount:0,partitionCounts:/* @__PURE__ */new Map},o.children.set(n,s)),s.occurrenceIds.push(t.id),s.entityCount+=e,S(s,t.partition,e),o=s}}let i=[],r=[],s=t.referencePartition;return function e(t,n){if(t.id){let e=B();for(let[o,n]of t.partitionCounts)R(e,o,n);i.push({id:t.id,stateId:t.stateId,prefix:t.prefix,parentId:n,childIds:o(t).map(e=>t.children.get(e).id),entityCount:t.entityCount,occurrenceIds:[...t.occurrenceIds],partitionCounts:e}),r.push(t.id)}for(let n of o(t))e(t.children.get(n),t.id||null)}(n,null),{kind:"observed-prefix",rootIds:o(n).map(e=>n.children.get(e).id),nodes:i,order:r,referencePartition:s}}function E(e,t){if("ordinal"!==e.coordinate.kind)return{kind:"ordinal",sectionIds:[],nodeIdsBySection:B()};let o=B();for(let t of e.coordinate.sectionIds)R(o,t,[]);for(let e of t.nodes){if(!e.sectionId)continue;let t=o[e.sectionId];t&&t.push(e.id)}return{kind:"ordinal",sectionIds:[...e.coordinate.sectionIds],nodeIdsBySection:o}}function M(e,t){let n=e.nodes.map(e=>e.id).sort(),i=new Map(n.map((e,t)=>[e,t])),r=n.length,s=Array.from({length:n.length+1},()=>[]),d=s.map(()=>[]),a=(e,t)=>{s[e].push(t),d[t].push(e)};for(let t of e.edges)a(i.get(t.source),i.get(t.target));for(let e of t.roots)a(r,i.get(e));let c=o(s,[r]).reverse(),l=new Map(c.map((e,t)=>[e,t])),u=/* @__PURE__ */new Map([[r,r]]),f=(e,t)=>{for(;e!==t;)l.get(e)>l.get(t)?e=u.get(e):t=u.get(t);return e},p=!0;for(;p;){p=!1;for(let e of c.slice(1)){let t=d[e].filter(e=>u.has(e)).reduce(f);u.get(e)!==t&&(u.set(e,t),p=!0)}}return{...t,roots:[...new Set(t.roots)].sort(),status:e.nodes.some(e=>e.completeness&&"known"!==e.completeness)?"incomplete":"exact",immediateDominatorByNode:Object.fromEntries(n.flatMap((e,t)=>u.has(t)?[[e,u.get(t)===r?null:n[u.get(t)]]]:[])),reachableNodeIds:n.filter((e,t)=>u.has(t)),unreachableNodeIds:n.filter((e,t)=>!u.has(t))}}function x(e,t,o,n){e.push({kind:t,severity:"fatal",message:o,id:n})}function j(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function q(e,t){let o=[];"0.2"!==e.schemaVersion&&x(o,"schema-version","expected schemaVersion 0.2"),(!e.relations.directed||!0!==e.relations.edgeIdRequired)&&x(o,"relations","Phase 1 requires directed edges with ids"),"rooted-backbone"!==e.forest.display.kind&&"observed-prefix"!==e.forest.display.kind&&x(o,"forest","supported display kinds: rooted-backbone, observed-prefix"),"ordinal"!==e.coordinate.kind&&x(o,"coordinate","Phase 1 kernel uses ordinal sections");let n=B();for(let i of t.nodes)i.id?(n[i.id]&&x(o,"duplicate-node","duplicate node id",i.id),R(n,i.id,!0),"ordinal"===e.coordinate.kind&&i.sectionId&&!e.coordinate.sectionIds.includes(i.sectionId)&&x(o,"section-membership",`node section ${i.sectionId} is not in the coordinate`,i.id)):x(o,"node-id","node is missing id");let i=B();for(let e of t.edges)e.id?(i[e.id]&&x(o,"duplicate-edge","duplicate edge id",e.id),R(i,e.id,!0),n[e.source]||x(o,"dangling-source","edge source is not a node",e.id),n[e.target]||x(o,"dangling-target","edge target is not a node",e.id)):x(o,"edge-id","edge is missing id");for(let t of e.forest.display.roots??[])n[t]||x(o,"missing-root","display root is not a node",t);let r=e.forest.requiredPaths;if(r)if("directed-admitted"!==r.relationScopeId&&x(o,"required-path-scope","required paths use the full directed-admitted relation scope"),Array.isArray(r.roots)&&0!==r.roots.length)for(let e of r.roots)n[e]||x(o,"required-path-roots","required-path root is not a node",e);else x(o,"required-path-roots","required paths need declared roots");if("rooted-backbone"===e.forest.display.kind&&0===e.forest.display.roots.length&&x(o,"missing-root","rooted-backbone requires at least one root"),e.comparison&&(2>e.comparison.partitions.length&&x(o,"comparison","comparison requires at least two partitions"),e.measures[e.comparison.denominatorMeasureId]||x(o,"comparison-denominator","comparison denominatorMeasureId is not a declared measure")),j(e.measures))for(let[t,n]of Object.entries(e.measures))"rate"===n.unitKind&&!n.timeDenominator&&x(o,"rate-denominator","rate measures require a timeDenominator",t);else x(o,"measures","measures must be an object");for(let n of t.measureValues)e.measures[n.measureId]?Number.isFinite(n.value)||x(o,"non-finite-measure","measure value is not finite",n.measureId):x(o,"unknown-measure","measureValue refers to an undeclared measure",n.measureId);for(let e of t.occurrences??[])if(e.id&&e.entityId){void 0!==e.stepEntityCounts&&(!Array.isArray(e.stepEntityCounts)||e.stepEntityCounts.length!==e.nodePath.length||Array.from(e.stepEntityCounts).some(e=>!Number.isFinite(e)||0>e))&&x(o,"occurrence-step-counts","stepEntityCounts must contain one finite, nonnegative count per nodePath step",e.id);for(let t of e.nodePath)n[t]||x(o,"occurrence-node","occurrence path references a missing node",e.id)}else x(o,"occurrence","occurrence needs id and entityId");return{ok:o.every(e=>"fatal"!==e.severity),issues:o}}function A(e,t,o){let n=o.measures[e],i=o.measures[t];if(!n||!i)return{ok:!1,reason:"unknown-measure"};if(n.countUnit!==i.countUnit)return{ok:!1,reason:"count-unit-mismatch"};if("rate"===n.unitKind||"rate"===i.unitKind){if(n.unitKind!==i.unitKind)return{ok:!1,reason:"stock-or-capacity-cannot-compare-to-rate"};if(n.timeDenominator!==i.timeDenominator)return{ok:!1,reason:"rate-time-denominator-mismatch"}}return{ok:!0}}function N(e,t,o){return JSON.stringify([o,t.graphRef,t.revision,e],(e,t)=>t&&"object"==typeof t&&!Array.isArray(t)?Object.fromEntries(Object.keys(t).sort().map(e=>[e,t[e]])):t)}function O(t,o,n={}){let i=q(t,o);if(!i.ok)return{ok:!1,issues:i.issues};let r=n.generation??1,s=E(t,o),d=P(t,o),l=a(t,o);c(l.residual,l.forest);let u=$(t,o,s),f=e(o,d),p=D(o),g=N(t,o,r),m="observed-prefix"===t.forest.display.kind||(o.occurrences?.length??0)>0?v(o.occurrences??[],{referencePartition:"observed-prefix"===t.forest.display.kind?t.forest.display.referencePartition??t.comparison?.referencePartition:t.comparison?.referencePartition}):void 0,h={sourceGraphRef:o.graphRef,analysisRevision:g,spec:t,source:o,sections:s,motifs:d,forest:l.forest,residualEdges:l.residual,ports:p,ledger:u,completeness:f,provenance:{sourceRevision:o.revision,analysisRevision:g,generation:r,relationScope:"directed-admitted",motifCatalogVersion:t.motifs.catalogVersion,coordinatePolicy:"ordinal"===t.coordinate.kind?"ordinal:"+t.coordinate.sectionIds.join(","):"numeric:"+t.coordinate.field,forestRoots:[...t.forest.display.roots??l.forest.roots],rankingPolicyId:l.forest.rankingPolicyId,population:t.motifs.countUnit,temporalHorizon:t.temporal.kind,evidencePolicyId:t.evidencePolicyId},prefixForest:m,...t.forest.requiredPaths&&{requiredPaths:M(o,t.forest.requiredPaths)}};return h.comparison=z(h),{ok:!0,atlas:h,issues:i.issues}}import{b as R,c as B,d as V,e as $,g as z,k as D}from"./c-TR7OHUAO.min.js";var W="0.2",K=["serial-chain","repeated-state-episode","fan-out","fan-in","split-rejoin-diamond","shared-upstream-source","connector-bypass"],U=["serial-chain","fan-out","fan-in"],F=[...U,"repeated-state-episode"];export{W as a,K as b,U as c,F as d,t as e,n as f,i as g,c as h,q as i,A as j,O as k};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(){return i??(i=u.createContext(null)),i}function r({value:r,children:t}){let n=e();/* @__PURE__ */
|
|
2
|
+
return a(n.Provider,{value:r,children:t})}function t(){let r=e();return u.useContext(r)??c}function n(e,t){return null!=e?/* @__PURE__ */a(r,{value:t,children:e}):e}import*as u from"react";import{jsx as a}from"react/jsx-runtime";var i,c={isActive:!1,predicate:()=>!0};export{r as a,t as b,n as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as o,c as r}from"./c-FU7A5KSY.min.js";import{h as i}from"./c-TR7OHUAO.min.js";export{i as assignedDenominator,o as prepareMotifBraid,r as ribbonSupportsRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return!!e&&Array.isArray(e[0])}function t({frameRef:t,cellSize:f,onBrush:h}){let m=r(null),b=f-u-c,p=f-a-o;return s(()=>{if(!m.current)return;let r=n(m.current).select(".brush-g"),s=l().extent([[0,0],[b,p]]).on("brush end",r=>{let s=t.current?.getScales();if(!s)return;if(!e(r.selection))return void h(null);let[[l,n],[i,a]]=r.selection,o=[[s.x.invert(l),s.y.invert(n)],[s.x.invert(i),s.y.invert(a)]];h(o)});return r.call(s),r.select(".selection").attr("fill","steelblue").attr("fill-opacity",.15).attr("stroke","steelblue").attr("stroke-width",1),()=>{s.on("brush end",null)}},[b,p,t,h]),/* @__PURE__ */i("svg",{ref:m,width:f,height:f,style:{position:"absolute",top:0,left:0},children:/* @__PURE__ */i("g",{className:"brush-g",transform:`translate(${u},${a})`})})}import{useRef as r,useEffect as s}from"react";import{brush as l}from"d3-brush";import{select as n}from"d3-selection";import{jsx as i}from"react/jsx-runtime";var a=4,o=4,u=4,c=4;export{t as ScatterplotMatrixBrushOverlay};
|
|
@@ -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;pe.lastIndex=0;let i,s=0,n=0;for(;null!==(i=pe.exec(t));){let e=parseFloat(i[1]),t=ge[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:Se,children:[
|
|
3
|
+
/* @__PURE__ */_e("div",{children:[
|
|
4
|
+
/* @__PURE__ */_e("span",{style:He,children:[s,":"]}),c(r)]}),
|
|
5
|
+
/* @__PURE__ */_e("div",{children:[
|
|
6
|
+
/* @__PURE__ */_e("span",{style:He,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:Se,children:[
|
|
8
|
+
/* @__PURE__ */_e("div",{children:[
|
|
9
|
+
/* @__PURE__ */Ce("span",{style:He,children:"x:"}),c(n)]}),
|
|
10
|
+
/* @__PURE__ */_e("div",{children:[
|
|
11
|
+
/* @__PURE__ */Ce("span",{style:He,children:"Δ:"}),a]}),null!=r&&/* @__PURE__ */_e("div",{children:[
|
|
12
|
+
/* @__PURE__ */Ce("span",{style:He,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:Se,children:[
|
|
14
|
+
/* @__PURE__ */_e("div",{children:[
|
|
15
|
+
/* @__PURE__ */Ce("span",{style:He,children:"x:"}),c(e)]}),
|
|
16
|
+
/* @__PURE__ */_e("div",{children:[
|
|
17
|
+
/* @__PURE__ */Ce("span",{style:He,children:"y:"}),c(n)]})]})}/* @__PURE__ */
|
|
18
|
+
return _e("div",{className:"semiotic-tooltip",style:Se,children:[
|
|
19
|
+
/* @__PURE__ */_e("div",{children:[
|
|
20
|
+
/* @__PURE__ */Ce("span",{style:He,children:"range:"}),c(s.binStart),"–",c(s.binEnd)]}),null!=s.total&&/* @__PURE__ */_e("div",{children:[
|
|
21
|
+
/* @__PURE__ */Ce("span",{style:He,children:"count:"}),c(s.total)]}),null!=s.category&&/* @__PURE__ */_e("div",{children:[
|
|
22
|
+
/* @__PURE__ */Ce("span",{style:He,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:Se,children:[
|
|
24
|
+
/* @__PURE__ */_e("div",{children:[
|
|
25
|
+
/* @__PURE__ */_e("span",{style:He,children:[s,":"]}),c(r)]}),
|
|
26
|
+
/* @__PURE__ */_e("div",{children:[
|
|
27
|
+
/* @__PURE__ */_e("span",{style:He,children:[n,":"]}),c(a)]}),null!=u&&/* @__PURE__ */_e("div",{children:[
|
|
28
|
+
/* @__PURE__ */Ce("span",{style:He,children:"count:"}),c(u)]}),"sum"===d&&null!=h&&/* @__PURE__ */_e("div",{children:[
|
|
29
|
+
/* @__PURE__ */Ce("span",{style:He,children:"sum:"}),c(h)]}),"mean"===d&&null!=m&&/* @__PURE__ */_e("div",{children:[
|
|
30
|
+
/* @__PURE__ */Ce("span",{style:He,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 de({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={[Me]:(e.start+e.end)/2,[Pe]:n(e,i),[Ne]:e.count,[Re]:e.partial,[ze]:e.start,[Be]:e.end},a=o(e,s,i,r);return a&&(t[Te]=a[0],t[Ie]=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 ve({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){Le.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 Le.useMemo(()=>s?ee(e??Oe,s,i):e,[s,e,i])}function A(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 k(e,t,i,s=!1){let n=se({axes:t,showAxes:i});return{...j(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(),a=ie(),l=V(),c="function"==typeof o?qe:o,u=Ue(null),h=Ge(()=>{let e=u.current,s=e&&Object.is(e.domainKey,c)?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)te(s,e);return{domainKey:c,indexes:s}},[t,i,n,c]);Je(()=>{u.current=h},[h]);let m=h.indexes,d=Ge(()=>{if(!e)return;let t=l&&l.length>0?l:a?oe:re;return e=>{let n=te(m,e);return(r?ae(r,e):void 0)||(i?ae(i,e):void 0)||s||t[n%t.length]}},[m,i,e,s,a,r,l]),g=Ge(()=>{if(!e||!d)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,d(e)]);continue}let t=i?ae(i,e):void 0;t&&c.push([e,t])}return c.length>0?Object.fromEntries(c):void 0},[t,d,i,e,n]);return{colorScale:d,colorMap:g}}function _(e){/* @__PURE__ */
|
|
31
|
+
return Qe(et,{...e,windowMode:"growing"})}import{a as S}from"./c-C4KIXUWU.min.js";import{d as H,e as M,f as P,g as T}from"./c-AXJ2QI3F.min.js";import{d as I,e as R}from"./c-TTKWXGAI.min.js";import{a as N,h as z}from"./c-MTX2AO5S.min.js";import{a as B}from"./c-PKY4JFY5.min.js";import{C as F,Y as D,_ as L}from"./c-KGROWFT2.min.js";import{Bb as O,C as j,Cb as E,Db as W,Eb as V,Kb as $,Mb as K,Ob as Y,Sa as X,Ta as G,Tb as U,Ua as q,bb as J,cb as Q,fb as Z,jb as ee,tb as te,vb as ie,y as se}from"./c-G53AVC42.min.js";import{d as ne,m as oe,p as re,s as ae}from"./c-Y342FJ6K.min.js";var le=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}},ce=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)}},ue=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}},he=(e,t)=>e-t,me=class{constructor(e,t){this.stats=new le,this.digest=e?new ue:null,this.hll=t?new ce: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)}},de=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 me(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,he)}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,he))}}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}},ge={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},pe=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g,ve=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 fe,useImperativeHandle as we,forwardRef as ye,useCallback as be,useState as xe,useEffect as Ae,useMemo as ke}from"react";import{jsx as Ce,jsxs as _e}from"react/jsx-runtime";var Se={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"},He={opacity:.7,marginRight:4},Me="time",Pe="value",Te="__aggLower",Ie="__aggUpper",Re="__aggPartial",Ne="count",ze="__aggStart",Be="__aggEnd",Fe="__aggSeries",De=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,[Fe]:i});return t}clear(){this.groups.clear()}};import*as Le from"react";var Oe=()=>({});import{jsx as je}from"react/jsx-runtime";N(z);var Ee=ye(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:k,extentPadding:C,stroke:_,strokeWidth:S,strokeDasharray:H,opacity:M,cursor:P,styleRules:T,background:R,tooltipContent:N,tooltip:z,onHover:B,annotations:F,autoPlaceAnnotations:j,svgAnnotationRules:W,tickFormatTime:V,tickFormatValue:K,decay:G,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=_??"#007bff",ye=S??2,Ce="string"==typeof v?v:"Value",_e=ke(()=>{if(i.showLegend)return{legendGroups:[{label:"Series",type:"line",items:[{label:Ce,color:ve}],styleFn:e=>({stroke:e.color||"var(--semiotic-primary, #007bff)",strokeWidth:ye??2})}]}},[i.showLegend,Ce,ve,ye]),Se=E(e.legendInteraction,()=>Ce,[Ce]),{legend:He,margin:Re,legendPosition:Ne}=O({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:ue,userMargin:n,defaults:i.marginDefaults,additionalLegend:_e,chartWidth:pe[0],chartHeight:pe[1],axisChrome:{hasAxis:!1!==i.showAxes}}),ze=u({timeAccessor:p,valueAccessor:v}),Be=q(),Le=X({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=N??Le.tooltipContent,Ee=fe(null),{activeSelectionHook:We,customHoverBehavior:Ve,customClickBehavior:$e}=$({selection:se,linkedHover:ie,unwrapData:!0,onObservation:ne,chartType:"RealtimeLineChart",chartId:oe,mobileInteraction:i.mobileInteraction}),Ke=be(e=>{B&&B(e),Ve(e)},[B,Ve]),Ye=null!=he,[Xe,Ge]=xe([]),Ue=fe(null),qe=fe(he);qe.current=he;let Je=fe(Ye);Je.current=Ye;let Qe=fe(Xe),Ze=be(e=>{Qe.current=e,Ge(e)},[]),et=fe({timeAccessor:p,valueAccessor:v});et.current={timeAccessor:p,valueAccessor:v};let tt=Ye?[he.window??"tumbling",he.size,he.hop??"",he.gap??"",he.retain??"",(he.percentiles??[]).join(","),!0===he.distinct?"1":"0"].join("|"):"";Ae(()=>{if(!Ye)return void(Ue.current=null);let e=qe.current,t=new De(e,m);if(Ue.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,Ye,d,p,v,m,Ze]),Ae(()=>{Ye&&Ue.current&&Ze(Ue.current.emit(qe.current))},[he?.stat,he?.band,he?.sigma]);let it=be(e=>{let t=Ue.current,i=qe.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=fe(null),ot=fe(me);ot.current=me;let rt=fe(st);rt.current=st;let at=fe(ne);at.current=ne;let lt=fe(oe);lt.current=oe;let ct=st?`${me.lateness}|${me.latePolicy??"drop"}`:"",ut=be(e=>{0!==e.length&&(Je.current?it(e):Ee.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=be(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=be(()=>{let e=nt.current;!rt.current||!e||ut(e.flush())},[ut]);we(t,()=>({push:e=>ht([e]),pushMany:e=>ht(e),flush:mt,remove:e=>Je.current?[]:Ee.current?.remove(e)??[],update:(e,t)=>Je.current?[]:Ee.current?.update(e,t)??[],clear:()=>{nt.current?.clear(),Je.current?(Ue.current?.clear(),Ze([])):Ee.current?.clear()},getData:()=>Je.current?Qe.current:Ee.current?.getData()??[],getScales:()=>Ee.current?.getScales()??null}),[mt,ht,Ze]);let dt=Q(re,pe[0],pe[1],ae),gt=dt?null:J(Ye?void 0:d,pe[0],pe[1],le),pt=ke(()=>()=>({stroke:"#007bff",strokeWidth:2}),[]),vt=ke(()=>Y(Ye?Me:p??"time",Ye?Pe:v??"value"),[Ye,p,v]),ft=ke(()=>U(pt,T,vt),[pt,T,vt]),wt=ke(()=>{let e=L(ft,{stroke:_,strokeWidth:S,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),At=ce?`${o||""} semiotic-emphasis-${ce}`.trim():o,kt=Ye?Xe:d,Ct=Ye?Me:p,_t=Ye?Pe:v,St=Ye?"growing":bt,Ht=Ye?Math.max(1,he?.retain??Math.max(Xe.length,600)):xt,Mt=Ye&&he&&"none"!==(he.band??"none")?{y0Accessor:Te,y1Accessor:Ie,perSeries:null!=m}:void 0;return dt||gt||/* @__PURE__ */je(I,{ref:Ee,chartType:"line",runtimeMode:"streaming",size:pe,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Re,className:At,...A(i,Se,e.legendInteraction),arrowOfTime:r,windowMode:St,windowSize:Ht,data:kt,timeAccessor:Ct,valueAccessor:_t,groupAccessor:Ye&&null!=m?Fe:m,xExtent:b,yExtent:k,extentPadding:C,band:Mt,lineStyle:yt??wt,showAxes:de,background:R,hoverAnnotation:ge,tooltipContent:Oe,tooltipMode:Le.tooltipMode,...D({linkedHover:ie,selection:se,onObservation:ne,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ke,customClickBehavior:$e}),annotations:F,legend:He,legendPosition:Ne,autoPlaceAnnotations:j,svgAnnotationRules:W,tickFormatTime:V,tickFormatValue:K,decay:G,pulse:Z,staleness:ee,transition:te,pointIdAccessor:e.pointIdAccessor})});Ee.displayName="RealtimeLineChart";import{useRef as We,forwardRef as Ve,useCallback as $e,useMemo as Ke}from"react";import{useEffect as Ye,useLayoutEffect as Xe,useMemo as Ge,useRef as Ue}from"react";var qe=/* @__PURE__ */Symbol("realtime-function-category-domain"),Je=typeof window>"u"?Ye:Xe;import{jsx as Qe}from"react/jsx-runtime";N(M);var Ze=[],et=Ve(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:_,valueExtent:S,extentPadding:H,categoryAccessor:M,colors:P,fill:T,stroke:N,strokeWidth:z,opacity:L,cursor:j,styleRules:W,gap:V,background:K,tooltipContent:Y,tooltip:X,onHover:q,annotations:Z,autoPlaceAnnotations:ee,svgAnnotationRules:te,tickFormatTime:ie,tickFormatValue:ne,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,Ae=i.showAxes,ke=Ke(()=>{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=se({showAxes:Ae,axes:ke}),_e=k(i.marginDefaults,ke,Ae,!!i.title),Se=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=Ke(()=>F(d??[],M),[d,M]),Te=void 0===d?Me.categories:Pe,{colorScale:Ie,colorMap:Re}=C({enabled:!!M,categories:Te,colors:P,fallbackColor:T,order:"explicit-then-alpha",domainKey:M}),Ne=Ke(()=>{if(!Re)return Te;let e=new Set(Te);return Object.keys(Re).filter(t=>e.has(t))},[Te,Re]),ze=$e(e=>null!=e.category?e.category+"":("function"==typeof M?M(e):M?e[M]:"")+"",[M]),{legend:Be,margin:Fe,legendPosition:De,hasAutomaticLegend:Le}=O({data:Ze,colorBy:M,colorScale:Ie,showLegend:i.showLegend,legendPosition:fe,userMargin:o,defaults:_e,categories:Ne,additionalLegend:we,chartWidth:He[0],chartHeight:He[1],axisChrome:Ce}),Oe=E(e.legendInteraction,M?ze:void 0,Ne,Le,!0),je=Y??G({tooltip:X,defaultTooltipContent:m({timeAccessor:p,valueAccessor:v}),customFunctionContext:"hover"}).tooltipContent,Ee=We(null),{activeSelectionHook:Ve,hoverSelectionHook:Ye,customHoverBehavior:Xe,customClickBehavior:Ge}=$({selection:re,linkedHover:oe,unwrapData:!0,onObservation:he,chartType:"RealtimeHistogram",chartId:me,mobileInteraction:i.mobileInteraction}),Ue=$e(e=>{q&&q(e),Xe(e)},[q,Xe]),qe=!0===ye?{dimension:"x",snap:"bin"}:"x"===ye?{dimension:"x"}:"object"==typeof ye?ye:void 0,Je=$e(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:et}=R({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!=T&&(st.fill=T),null!=N&&(st.stroke=N),null!=z&&(st.strokeWidth=z),null!=L&&(st.opacity=L),null!=j&&(st.cursor=j),null!=V&&(st.gap=V);let nt=Ke(()=>{if(M&&Ie)return e=>null==e.category?{}:{fill:Ie(e.category+"")}},[M,Ie]),ot=Ke(()=>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=Ke(()=>U(nt,W,ot),[nt,W,ot]),at=x(Ke(()=>e=>({...rt(e),...!M&&null!=T&&{fill:T},...null!=N&&{stroke:N},...null!=z&&{strokeWidth:z},...null!=L&&{opacity:L},...null!=j&&{cursor:j}}),[rt,M,T,N,z,L,j]),[Ye||Oe.legendSelectionHook||Ve],re),lt=ve?`${r||""} semiotic-emphasis-${ve}`.trim():r,ct=$e(e=>f(e,p,"time")??NaN,[p]),ut=$e(e=>f(e,v,"value")??NaN,[v]),ht=l??c??"sliding",mt=g(u,d,h);return tt||it||/* @__PURE__ */Qe(I,{ref:Ee,chartType:"bar",runtimeMode:"streaming",size:He,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Fe,className:lt,...A(i,Oe,e.legendInteraction),arrowOfTime:a,windowMode:ht,windowSize:mt,data:d,timeAccessor:ct,valueAccessor:ut,xExtent:_,yExtent:S,invertY:"down"===w,extentPadding:H,binSize:s,categoryAccessor:M,barColors:Re,barStyle:st,areaStyle:at,showAxes:Ae,axes:ke,background:K,hoverAnnotation:Se,tooltipContent:je,...D({linkedHover:oe,selection:re,onObservation:he,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ue,customClickBehavior:Ge}),annotations:Z,autoPlaceAnnotations:ee,svgAnnotationRules:te,tickFormatTime:ie,tickFormatValue:ne,decay:ae,pulse:le,staleness:ce,transition:ue,pointIdAccessor:e.pointIdAccessor,legend:Be,legendPosition:De,...Me.categoryDomainProps,brush:qe||(xe?et.brush:void 0),onBrush:qe||xe?et.onBrush:void 0})});et.displayName="RealtimeHistogram",_.displayName="TemporalHistogram";var tt=et;import{useRef as it,forwardRef as st,useCallback as nt,useMemo as ot}from"react";import{jsx as rt}from"react/jsx-runtime";N(P);var at=[],lt=st(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:k,decay:_,pulse:S,staleness:H,transition:M,categoryAccessor:P,colors:T,radius:R,fill:N,opacity:z,stroke:L,strokeWidth:j,cursor:W,pointStyle:V,styleRules:K,background:X,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:T,showLegend:!1,legendPosition:ge,trackCategoryDomain:fe,registerLinkedCategories:!1}),be=ot(()=>F(m??[],P),[m,P]),xe=void 0===m?ye.categories:be,{colorScale:Ae}=C({enabled:!!P,categories:xe,colors:T,fallbackColor:N,domainKey:P}),{legend:ke,margin:Ce,legendPosition:_e,hasAutomaticLegend:Se}=O({data:at,colorBy:P,colorScale:Ae,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,Se,!0),Me=q??G({tooltip:Z,defaultTooltipContent:u({timeAccessor:d,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,Pe=it(null),{activeSelectionHook:Te,hoverSelectionHook:Ie,customHoverBehavior:Re,customClickBehavior:Ne}=$({selection:ae,linkedHover:re,unwrapData:!0,onObservation:le,chartType:"RealtimeSwarmChart",chartId:ce,mobileInteraction:i.mobileInteraction}),ze=nt(e=>{ee&&ee(e),Re(e)},[ee,Re]);b(t,Pe);let Be=Q(ue,we[0],we[1],he),Fe=Be?null:J(m,we[0],we[1],me),De={};null!=R&&(De.radius=R),null!=N&&(De.fill=N),null!=z&&(De.opacity=z),null!=L&&(De.stroke=L),null!=j&&(De.strokeWidth=j),null!=W&&(De.cursor=W);let Le=V,Oe=ot(()=>{if(P)return e=>{let t="function"==typeof P?P(e):P?e[P]:void 0;return{...P&&Ae?{fill:Ae(t+"")}:void 0}}},[P,Ae]),je=ot(()=>{let e=Y(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=ot(()=>U(Oe,K,je),[Oe,K,je]),We=x(ot(()=>e=>({...Ee(e),...Le?.(e)}),[Ee,Le]),[Ie||He.legendSelectionHook||Te],ae),Ve=de?`${o||""} semiotic-emphasis-${de}`.trim():o,$e=a??l??"sliding",Ke=g(c,m,h);return Be||Fe||/* @__PURE__ */rt(I,{ref:Pe,chartType:"swarm",runtimeMode:"streaming",size:we,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Ce,className:Ve,...A(i,He,e.legendInteraction),arrowOfTime:r,windowMode:$e,windowSize:Ke,data:m,timeAccessor:d,valueAccessor:p,xExtent:v,yExtent:f,yScaleType:w,extentPadding:k,decay:_,pulse:S,staleness:H,transition:M,categoryAccessor:P,swarmStyle:De,pointStyle:We,showAxes:pe,background:X,hoverAnnotation:ve,tooltipContent:Me,...D({linkedHover:re,selection:ae,onObservation:le,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:ze,customClickBehavior:Ne}),annotations:te,autoPlaceAnnotations:ie,svgAnnotationRules:se,tickFormatTime:ne,tickFormatValue:oe,legend:ke,legendPosition:_e,...ye.categoryDomainProps,pointIdAccessor:e.pointIdAccessor})});lt.displayName="RealtimeSwarmChart";import{useRef as ct,forwardRef as ut,useCallback as ht,useMemo as mt}from"react";import{jsx as dt}from"react/jsx-runtime";N(T);var gt=ut(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:k,pulse:C,staleness:_,transition:S,positiveColor:H,negativeColor:M,connectorStroke:P,connectorWidth:T,gap:R,stroke:N,strokeWidth:z,opacity:B,cursor:F,styleRules:L,background:j,tooltipContent:W,tooltip:V,onHover:K,annotations:X,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=mt(()=>{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=ht(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}=O({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??G({tooltip:V,defaultTooltipContent:h({timeAccessor:d,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,xe=ct(null),{activeSelectionHook:Ae,hoverSelectionHook:ke,customHoverBehavior:Ce,customClickBehavior:_e}=$({selection:se,linkedHover:ie,unwrapData:!0,onObservation:ne,chartType:"RealtimeWaterfallChart",chartId:oe,mobileInteraction:i.mobileInteraction}),Se=ht(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!=T&&(Pe.connectorWidth=T),null!=R&&(Pe.gap=R),null!=N&&(Pe.stroke=N),null!=z&&(Pe.strokeWidth=z),null!=B&&(Pe.opacity=B),null!=F&&(Pe.cursor=F);let Te=ke||ve.legendSelectionHook||Ae,Ie=mt(()=>Y(d??"time",p??"value"),[d,p]),Re=mt(()=>U(void 0,L,Ie),[L,Ie]),Ne=x(mt(()=>e=>({...Re(e),...null!=N&&{stroke:N},...null!=z&&{strokeWidth:z},...null!=B&&{opacity:B},...null!=F&&{cursor:F}}),[Re,N,z,B,F]),[Te],se),ze=ce?`${o||""} semiotic-emphasis-${ce}`.trim():o,Be=a??l??"sliding",Fe=g(c,m,u);return He||Me||/* @__PURE__ */dt(I,{ref:xe,chartType:"waterfall",runtimeMode:"streaming",size:de,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:we,className:ze,...A(i,ve,e.legendInteraction),arrowOfTime:r,windowMode:Be,windowSize:Fe,data:m,timeAccessor:d,valueAccessor:p,xExtent:v,yExtent:f,extentPadding:w,decay:k,pulse:C,staleness:_,transition:S,waterfallStyle:Pe,areaStyle:Ne,showAxes:he,background:j,hoverAnnotation:me,tooltipContent:be,...D({linkedHover:ie,selection:se,onObservation:ne,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Se,customClickBehavior:_e}),annotations:X,autoPlaceAnnotations:q,svgAnnotationRules:Z,tickFormatTime:ee,tickFormatValue:te,legend:fe,legendPosition:ye,pointIdAccessor:e.pointIdAccessor})});gt.displayName="RealtimeWaterfallChart";import{useRef as pt,forwardRef as vt,useCallback as ft,useMemo as wt,useState as yt}from"react";import{jsx as bt}from"react/jsx-runtime";N(H);var xt=vt(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:k,heatmapXBins:C=20,heatmapYBins:_=20,aggregation:H="count",colorScheme:M,customColorScale:P,cursor:T,styleRules:R,background:N,tooltipContent:z,tooltip:B,onHover:F,annotations:L,autoPlaceAnnotations:j,svgAnnotationRules:E,tickFormatTime:V,tickFormatValue:K,decay:Y,pulse:X,staleness:q,linkedHover:Z,selection:ee,onObservation:te,chartId:ie,loading:se,loadingContent:oe,emptyContent:re,emphasis:ae,legendPosition:le}=e,ce=i.showAxes,ue=i.enableHover,he=s??[i.width,i.height],[me,de]=yt(null),ge=wt(()=>me??[0,1],[me]),pe=wt(()=>{if("custom"===M&&P)return P;let e=ne(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=wt(()=>i.showLegend?{gradient:{colorFn:pe,domain:ge,label:H}}:void 0,[H,pe,i.showLegend,ge]),{legend:we,margin:ye,legendPosition:be}=O({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??G({tooltip:B,defaultTooltipContent:d({timeAccessor:m,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,Ae=pt(null),{activeSelectionHook:ke,hoverSelectionHook:Ce,customHoverBehavior:_e,customClickBehavior:Se}=$({selection:ee,linkedHover:Z,unwrapData:!0,onObservation:te,chartType:"RealtimeHeatmap",chartId:ie,mobileInteraction:i.mobileInteraction}),He=ft(e=>{F&&F(e),_e(e)},[F,_e]);b(t,Ae);let Me=Q(se,he[0],he[1],oe),Pe=Me?null:J(h,he[0],he[1],re),Te=ae?`${o||""} semiotic-emphasis-${ae}`.trim():o,Ie=a??l??"sliding",Re=g(c,h,u),Ne=wt(()=>{if(null==T)return;let e={cursor:T};return()=>e},[T]),ze=wt(()=>S(m??"time",p??"value",p??"value"),[m,p]),Be=x(wt(()=>U(Ne,R,ze),[Ne,R,ze]),[Ce,ve.legendSelectionHook,ke],ee);return Me||Pe||/* @__PURE__ */bt(I,{ref:Ae,chartType:"heatmap",runtimeMode:"streaming",size:he,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ye,className:Te,...A(i,ve,e.legendInteraction),arrowOfTime:r,windowMode:Ie,windowSize:Re,data:h,timeAccessor:m,valueAccessor:p,categoryAccessor:v,xExtent:f,yExtent:w,extentPadding:k,heatmapXBins:C,heatmapYBins:_,heatmapAggregation:H,colorScheme:"custom"!==M?M:void 0,heatmapColorScale:"custom"===M&&"function"==typeof P?P:void 0,onColorDomainChange:de,areaStyle:Be,showAxes:ce,background:N,hoverAnnotation:ue,tooltipContent:xe,...D({linkedHover:Z,selection:ee,onObservation:te,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:He,customClickBehavior:Se}),annotations:L,autoPlaceAnnotations:j,svgAnnotationRules:E,tickFormatTime:V,tickFormatValue:K,decay:Y,pulse:X,staleness:q,legend:we,legendPosition:be,pointIdAccessor:e.pointIdAccessor})});xt.displayName="RealtimeHeatmap";export{le as a,ce as b,ue as c,de as d,n as e,o as f,r as g,ve as h,Ee as i,et as j,_ as k,tt as l,lt as m,gt as n,xt as o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t({width:t,height:i,margin:o,scales:c,brushDirection:a,extent:f,onBrush:h}){let m=e(null),p=e(null),b=e(!1),x=t+o.left+o.right,d=i+o.top+o.bottom;return r(()=>{if(!m.current||!c)return;let e=s(m.current).select(".brush-group"),r="x"===a?l().extent([[0,0],[t,i]]):n().extent([[0,0],[t,i]]);return r.on("brush end",t=>{if(b.current||!t.sourceEvent)return;let e=t.selection;if(!e)return void h(null);let r=("x"===a?c.x:c.y).invert;if(!r)return;let l=[r(e[0]),r(e[1])];h(l)}),e.call(r),p.current=t=>{e.call(r.move,t)},e.select(".selection").attr("fill","steelblue").attr("fill-opacity",.2).attr("stroke","steelblue").attr("stroke-width",1),()=>{p.current=null,r.on("brush end",null)}},[c,t,i,a,h]),r(()=>{if(!p.current||!c||!m.current)return;let t="x"===a?c.x:c.y;if(b.current=!0,f){let e=[t(f[0]),t(f[1])];p.current(e)}else p.current(null);b.current=!1},[f,c,a]),/* @__PURE__ */u("svg",{ref:m,width:x,height:d,style:{position:"absolute",top:0,left:0,pointerEvents:"all"},children:/* @__PURE__ */u("g",{className:"brush-group",transform:`translate(${o.left},${o.top})`})})}import{useRef as e,useEffect as r}from"react";import{brushX as l,brushY as n}from"d3-brush";import{select as s}from"d3-selection";import{jsx as u}from"react/jsx-runtime";export{t as MinimapBrushOverlay};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
function e(e){let{accessor:t,data:o,isPushMode:i}=e,a=Ft(null),[r,l]=Dt(0),n=Pt(e=>{if(!i||!t)return;let o=!1;for(let i of e){let e="function"==typeof t?t(i):i[t];if(null==e)continue;let r="number"==typeof e?e:Number(e);Number.isFinite(r)&&(a.current?(a.current[0]>r&&(a.current[0]=r,o=!0),r>a.current[1]&&(a.current[1]=r,o=!0)):(a.current=[r,r],o=!0))}o&&l(e=>e+1)},[i,t]),s=Pt(()=>{i&&(a.current=null,l(e=>e+1))},[i]);return{domain:Bt(()=>{if(i)return a.current??void 0;if(!t||0===o.length)return;let e="function"==typeof t?t:e=>e[t],r=1/0,l=-1/0;for(let t of o){let o=e(t);if(null==o)continue;let i="number"==typeof o?o:Number(o);Number.isFinite(i)&&(r>i&&(r=i),i>l&&(l=i))}return Number.isFinite(r)&&Number.isFinite(l)?[r,l]:void 0},[o,t,i,r]),trackPushed:n,reset:s}}function t(e,t){return pt(1===t?.5:e/(t-1))}function o(e){return e instanceof Date?"date:"+e.getTime():`${typeof e}:${e+""}`}function i(e,t,o){return"function"==typeof e?e(t,o):t[e]}function a(e,t){if(!e?.length)return;let i=new Map(t.map((e,t)=>[o(e),t]));return e.map(e=>{let t={...e},a=a=>{if(!(a in e))return;let r=i.get(o(e[a]));void 0!==r&&(t[a]=r)};return a("x"),a("x0"),a("x1"),"string"==typeof e.type&&("x-threshold"===e.type||"x"===e.type)&&a("value"),t})}function r(e){let{seriesOrder:t,overallOrder:o,highlightTop:i,color:a,colorScheme:r,neutralColor:l,themeCategorical:n,themeNeutral:s}=e;if(null==i&&null==a)return r;let c=new Set(o.slice(0,null==i?o.length:Math.max(0,Math.floor(i)))),h=/* @__PURE__ */new Map,m={};for(let e of t)Object.defineProperty(m,e,{configurable:!0,enumerable:!0,writable:!0,value:a??(c.has(e)?De(void 0,n,r,e,h):l??s??"#b8bec8")});return m}function l(e,t={}){let a=t.xAccessor??"x",r=t.yAccessor??"y",l=t.lineBy??"series",n=t.rankDirection??"descending",s=[],c=/* @__PURE__ */new Map,h=/* @__PURE__ */new Map,m=[],d=/* @__PURE__ */new Map,u=1/0,p=-1/0;e.forEach((e,t)=>{let n=i(a,e,t),y=o(n),f=c.get(y);null==f&&(f=s.length,c.set(y,f),s.push(n),h.set(f,[]));let g=i(l,e,t)+"";d.has(g)||(d.set(g,m.length),m.push(g));let b=Number(i(r,e,t));Number.isFinite(b)&&(u=Math.min(u,b),p=Math.max(p,b),h.get(f)?.push({datum:e,inputIndex:t,series:g,value:b}))});let y=[],f=/* @__PURE__ */new Map,g=/* @__PURE__ */new Map;for(let e=0;s.length>e;e++){let t=h.get(e)??[];t.sort((e,t)=>("descending"===n?t.value-e.value:e.value-t.value)||(d.get(e.series)??0)-(d.get(t.series)??0)),t.forEach((t,o)=>{let i=o+1;y.push({datum:t.datum,xIndex:e,xValue:s[e],series:t.series,value:t.value,rank:i}),f.set(t.series,(f.get(t.series)??0)+i),g.set(t.series,(g.get(t.series)??0)+1)})}let b=m.length+1,x=[...m].sort((e,t)=>{let o=g.get(e)??0,i=g.get(t)??0;return((f.get(e)??0)+(s.length-o)*b)/Math.max(1,s.length)-((f.get(t)??0)+(s.length-i)*b)/Math.max(1,s.length)||(d.get(e)??0)-(d.get(t)??0)}),v=new Set(x.slice(0,null==t.highlightTop?x.length:Math.max(0,Math.floor(t.highlightTop))));return{data:y.map(e=>{let t=v.has(e.series);return{...e.datum,x:e.xIndex,y:e.rank,__bumpRaw:e.datum,__bumpSeries:e.series,__bumpColorGroup:t?e.series:"Other",__bumpValue:e.value,__bumpRank:e.rank,__bumpXValue:e.xValue,__bumpHighlighted:t}}),xValues:s,seriesOrder:m,overallOrder:x,valueExtent:u===1/0?[0,0]:[u,p]}}function n({tooltip:e,xValues:t,xFormat:o,yFormat:i}){let a=Yt((e,i)=>{if(0===t.length)return"";let a=t[Math.max(0,Math.min(t.length-1,Math.round(Number(e))))];return o?o(a,i):(a instanceof Date?a.toLocaleDateString():a)+""},[o,t]),r=Yt(e=>i?i(e):e.toLocaleString(),[i]),l=je(e),n=qt(()=>l?void 0:Qe(e),[l,e]),s=Yt(t=>{let o=t?.data??t;return o&&!1!==e?n?n({...t,data:o.__bumpRaw,__semioticHoverData:!0}):/* @__PURE__ */Ut(ut,{children:[
|
|
2
|
+
/* @__PURE__ */Jt("div",{style:{fontWeight:700},children:o.__bumpSeries}),
|
|
3
|
+
/* @__PURE__ */Ut("div",{children:[a(o.x)," · Rank ",o.__bumpRank]}),
|
|
4
|
+
/* @__PURE__ */Ut("div",{children:["Value: ",r(o.__bumpValue)]})]}):null},[r,a,n,e]),c=Yt(t=>{let o=(Array.isArray(t.allSeries)?t.allSeries:[]).map(e=>{let t=e.datum;return{...e,value:t?.__bumpValue??e.value,rank:t?.__bumpRank,datum:t?.__bumpRaw??e.datum}}),i=t?.data??t,l={...i?.__bumpRaw??{},xValue:i?.__bumpXValue??t.xValue,allSeries:o};if(ze(e)&&"function"==typeof e.content)return e.content(l);let n=t.xValue??i?.x;/* @__PURE__ */
|
|
5
|
+
return Ut(ut,{children:[null!=n&&/* @__PURE__ */Jt("div",{style:{fontWeight:700,marginBottom:4},children:a(n)}),o.map((e,t)=>/* @__PURE__ */Ut("div",{style:{display:"flex",alignItems:"center",gap:6},children:[
|
|
6
|
+
/* @__PURE__ */Jt("span",{style:{width:8,height:8,borderRadius:"50%",background:e.color,flexShrink:0}}),
|
|
7
|
+
/* @__PURE__ */Jt("span",{style:{flex:1},children:e.group}),
|
|
8
|
+
/* @__PURE__ */Ut("span",{children:[null!=e.rank?`Rank ${e.rank} · `:"",r(e.value)]})]},`${e.group}-${t}`))]})},[r,a,e]);return{tooltip:qt(()=>!1!==e&&(l?{mode:"multi",content:c}:s),[l,c,s,e]),formatX:a}}function s(e,t,o,i,a){let r=1-a;return r*r*r*e+3*r*r*a*t+3*r*a*a*o+a*a*a*i}function c(e,t,o,i,a){let r=1-a;return 3*r*r*(t-e)+6*r*a*(o-t)+3*a*a*(i-o)}function h(e,t,o,i,a){let r=[],l=(e.x+t.x)/2;for(let n=0;a>=n;n++){let h,m,d,u,p=n/a;"linear"===i?(h=e.x+(t.x-e.x)*p,m=e.y+(t.y-e.y)*p,d=t.x-e.x,u=t.y-e.y):(h=s(e.x,l,l,t.x,p),m=s(e.y,e.y,t.y,t.y,p),d=c(e.x,l,l,t.x,p),u=c(e.y,e.y,t.y,t.y,p)),r.push({x:h,y:m,dx:d,dy:u,radius:e.radius+(t.radius-e.radius)*p,datumIndex:.5>p?o:o+1})}return r}function m(e,t={}){let o=[],i=[],a=[];if(2>e.length)return{topPath:o,bottomPath:i,datumIndices:a};let r=t.curve??"smooth",l=Math.max(2,Math.floor(t.samplesPerSegment??12));for(let t=0;e.length-1>t;t++){let n=h(e[t],e[t+1],t,r,l);for(let e=0===t?0:1;n.length>e;e++){let t=n[e],r=Math.hypot(t.dx,t.dy)||1,l=-t.dy/r,s=t.dx/r,c=Math.max(0,t.radius);o.push([t.x+l*c,t.y+s*c]),i.push([t.x-l*c,t.y-s*c]),a.push(t.datumIndex)}}return{topPath:o,bottomPath:i,datumIndices:a}}function d(e,t,o,i){let a=Math.max(1,Math.floor(t/18)),r="auto"===o?Number.isFinite(i)&&(i??0)>=0?Math.min(a,Math.floor(i)):a:1/0,l=e.map((e,t)=>({candidate:e,index:t})).sort((e,t)=>(t.candidate.priority??0)-(e.candidate.priority??0)||Number(t.candidate.highlighted)-Number(e.candidate.highlighted)||e.candidate.rank-t.candidate.rank||e.index-t.index),n=[];for(let{candidate:e}of l){if(n.length>=r)break;n.some(t=>t.side===e.side&&14>Math.abs(t.y-e.y))||n.push(e)}return new Set(n.map(e=>e.id))}function u({datum:e,x:t,y:o,side:i,color:a,highlighted:r,labelStyle:l}){let n=_e(),s=n.isActive&&!n.predicate(e),c="function"==typeof l?l(e.__bumpRaw):l;/* @__PURE__ */
|
|
9
|
+
return Zt("text",{className:"semiotic-bump-label",x:t+("end"===i?8:-8),y:o,dy:"0.35em",textAnchor:"end"===i?"start":"end",fill:a,fillOpacity:s?.16:1,fontWeight:r?650:450,fontSize:12,style:{pointerEvents:"none",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-axis-label-font-size, 12px)",...c},children:e.__bumpSeries})}function p(e){let t=Array.isArray(e.datum)?e.datum[0]:e.datum;return t&&"object"==typeof t&&"__bumpSeries"in t?t:void 0}function y(e,t,o){let[i,a]=t,[r,l]=o;return a===i?(r+l)/2:r+(l-r)*Math.max(0,Math.min(1,(e-i)/(a-i)))}function f(e){let t=e.__bumpXValue instanceof Date?e.__bumpXValue.getTime():Number(e.__bumpXValue);return{value:e.__bumpValue,x:Number.isFinite(t)?t:void 0,y:e.__bumpValue,category:e.__bumpSeries}}function g(e){let t=e.config,o=/* @__PURE__ */new Map;for(let t of e.data){let e=o.get(t.__bumpSeries)??[];e.push(t),o.set(t.__bumpSeries,e)}let i=t.seriesOrder.filter(e=>o.has(e)).sort((e,i)=>(o.get(e)?.[0]?.__bumpHighlighted?1:0)-(o.get(i)?.[0]?.__bumpHighlighted?1:0)||t.seriesOrder.indexOf(e)-t.seriesOrder.indexOf(i)),a=[],r=[],l=[];for(let r of i){let i=(o.get(r)??[]).sort((e,t)=>e.x-t.x);if(2>i.length)continue;let n=i[0].__bumpHighlighted,s=(t.colorMap&&vt(t.colorMap,r))??e.resolveColor(i[0].__bumpSeries,i[0]),c=t.color??(n?s:t.neutralColor??e.theme.semantic.textSecondary??e.theme.semantic.border??s),h=i.map(o=>({x:e.scales.x(o.x),y:e.scales.y(o.y),radius:t.ribbon?y(o.__bumpValue,t.valueExtent,t.ribbonSizeRange)/2:Math.max(.5,t.lineWidth/2)})),d=m(h,{curve:t.curve,samplesPerSegment:t.samplesPerSegment}),u={fill:c,fillOpacity:1,opacity:n?t.ribbon?t.ribbonOpacity:t.lineOpacity:Math.min(t.ribbon?t.ribbonOpacity:t.lineOpacity,.58)};t.styleRules?.length&&Object.assign(u,Ve(i[0].__bumpRaw,t.styleRules,f(i[0]))),t.areaStyle&&Object.assign(u,t.areaStyle(i[0].__bumpRaw)??{}),void 0!==t.stroke&&(u.stroke=t.stroke),void 0!==t.strokeWidth&&(u.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(u.opacity=t.opacity),a.push({type:"area",topPath:d.topPath,bottomPath:d.bottomPath,style:u,datum:d.datumIndices.map(e=>i[e]),accessibleDatum:i.map(e=>e.__bumpRaw),accessibility:{label:r+" ranking trajectory",tableFields:i.map(e=>e.__bumpRaw)},group:r,interactive:!0}),t.showPoints&&i.forEach((e,o)=>{let i={fill:c,stroke:"none",opacity:n?1:.75};t.styleRules?.length&&Object.assign(i,Ve(e.__bumpRaw,t.styleRules,f(e))),t.pointStyle&&Object.assign(i,t.pointStyle(e.__bumpRaw)??{}),void 0!==t.stroke&&(i.stroke=t.stroke),void 0!==t.strokeWidth&&(i.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(i.opacity=t.opacity),a.push({type:"point",x:h[o].x,y:h[o].y,r:i.r??t.pointRadius,style:i,datum:e,accessibleDatum:e.__bumpRaw,accessibility:{label:`${r}, rank ${e.__bumpRank}, value ${e.__bumpValue}`},pointId:`${r}:${e.x}`})});let p=!0===t.showLabels?"end":t.showLabels,g=(e,o,i)=>{let a=null==t.labelPriorityAccessor?void 0:"function"==typeof t.labelPriorityAccessor?t.labelPriorityAccessor(e.__bumpRaw):Number(e.__bumpRaw[t.labelPriorityAccessor]);l.push({id:`${r}\0${i}`,datum:e,x:h[o].x,y:h[o].y,side:i,rank:e.__bumpRank,highlighted:n,priority:Number.isFinite(a)?a:void 0,color:"string"==typeof u.fill?u.fill:c})};("start"===p||"both"===p)&&g(i[0],0,"start"),("end"===p||"both"===p||"auto"===p)&&g(i.at(-1),i.length-1,"end")}let n=d(l,e.dimensions.plot.height,"auto"!==(!0===t.showLabels?"end":t.showLabels)||"auto",t.maxLabels);for(let e of l)n.has(e.id)&&r.push(
|
|
10
|
+
/* @__PURE__ */Zt(u,{datum:e.datum,x:e.x,y:e.y,side:e.side,color:e.color,highlighted:e.highlighted,labelStyle:t.labelStyle},e.id));return{nodes:a,overlays:r.length?/* @__PURE__ */Zt("g",{className:"semiotic-bump-labels",children:r}):void 0,restyle:(e,t)=>{let o=p(e);if(t?.isActive&&o&&!t.predicate(o))return{opacity:.14}}}}function b({data:e,safeData:t,areaBy:o,lineDataAccessor:i}){if(null==e)return[];let a,r=void 0!==t[0]?.[i];if(!r&&!o)return t;if(r)a=t;else{let e=t.reduce((e,t)=>{let a="function"==typeof o?o(t):t[o],r=a+"";if(!e[r]){let t={[i]:[]};"string"==typeof o&&(t[o]=a),e[r]=t}return e[r][i].push(t),e},{});a=Object.values(e)}return a.flatMap(e=>{let t=Array.isArray(e[i])?e[i]:[];return"string"==typeof o?t.map(t=>({...t,[o]:t[o]??e[o]})):t})}function x(e){let{safeData:t,data:o,areaBy:i,lineDataAccessor:a,colorBy:r,colorScale:l,color:n,stroke:s,strokeWidth:c,opacity:h,effectiveSelectionHook:m,resolvedSelection:d,areaOpacity:u,showLine:p,lineWidth:y,showPoints:f,pointRadius:g,xAccessor:x,yAccessor:v,xLabel:A,yLabel:w,xFormat:S,yFormat:k,groupField:C,styleRules:R,ruleContext:L}=e,_=ro(()=>b({data:o,safeData:t,areaBy:i,lineDataAccessor:a}),[o,t,i,a]),H=ro(()=>e=>{let t={};if(r){if(l){let o=xt(e,r,l);t.fill=o,p?(t.stroke=o,t.strokeWidth=y):t.stroke="none"}}else{let e=n||gt;t.fill=e,p?(t.stroke=e,t.strokeWidth=y):t.stroke="none"}return t.fillOpacity=u,R&&R.length>0&&Object.assign(t,Ve(e,R,L?L(e):{value:void 0})),t},[r,l,n,u,p,y,R,L]),I=ro(()=>Le(H,{stroke:s,strokeWidth:c,opacity:h}),[H,s,c,h]);return{flattenedData:_,lineStyle:ro(()=>tt(I,m??null,d),[I,m,d]),pointStyle:ro(()=>{if(f)return e=>{let t={r:g,fillOpacity:1};return r?l&&(t.fill=xt(e.parentLine||e,r,l)):t.fill=n||gt,t}},[f,g,r,l,n]),defaultTooltipContent:ro(()=>Se([{label:A||Ae(x),accessor:x,role:"x",format:S},{label:w||Ae(v),accessor:v,role:"y",format:k},...C?[{label:Ae(C),accessor:C,role:"group"}]:[],...we(e.band,k)]),[x,v,A,w,C,S,k,e.band])}}function v(e,t,o,i){if(!e.length)return[];let a=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[],l=0,n=null,s=null,c=[],h=(e,t)=>e>t?"A":t>e?"B":null,m=e=>`seg-${l}-${e}`,d=e=>r.push(e),u=(e,t)=>{d({__x:e.x,__y:e.y,__y0:e.y,__diffSegment:m(t),__diffWinner:t,__valA:e.y,__valB:e.y,__sourceDatum:e.datum})};for(let e=0;a.length>e;e++){let r=a[e],p=t(r),y=o(r),f=i(r);if(!Number.isFinite(p)||!Number.isFinite(y)||!Number.isFinite(f))continue;let g=h(y,f);if(null!==g){if(null==n){n=g;for(let e of c)u(e,n);c=[],d({__x:p,__y:f>y?f:y,__y0:f>y?y:f,__diffSegment:m(n),__diffWinner:n,__valA:y,__valB:f,__sourceDatum:r}),s={x:p,a:y,b:f,w:g};continue}if(s&&s.w!==g){let e,t;if(c.length>0)e=c[0].x,t=c[0].y;else{let o=y-s.a-(f-s.b);if(0!==o){let i=Math.max(0,Math.min(1,(s.b-s.a)/o));e=s.x+i*(p-s.x),t=s.a+i*(y-s.a)}else e=s.x,t=s.a}d({__x:e,__y:t,__y0:t,__diffSegment:m(n),__diffWinner:n,__valA:t,__valB:t}),l++,n=g,d({__x:e,__y:t,__y0:t,__diffSegment:m(n),__diffWinner:n,__valA:t,__valB:t});for(let e=1;c.length>e;e++)u(c[e],n)}else for(let e of c)u(e,n);c=[],d({__x:p,__y:f>y?f:y,__y0:f>y?y:f,__diffSegment:m(n),__diffWinner:n,__valA:y,__valB:f,__sourceDatum:r}),s={x:p,a:y,b:f,w:g}}else c.push({x:p,y:y,datum:r})}for(let e of c)u(e,n??"A");return r}function A(e){if("A"===e.__diffWinner||"B"===e.__diffWinner)return e.__diffWinner;let t=(e.__diffSegment??"")+"";return"line-A"===t||t.endsWith("-A")?"A":"B"}function w(e,t){return Xe(e,t,e=>{let t=Number(e.__x),o=Number(e.__y);return{value:Number.isFinite(o)?o:void 0,x:Number.isFinite(t)?t:void 0,y:Number.isFinite(o)?o:void 0,category:A(e)}},e=>e.__sourceDatum?{...e.__sourceDatum,...e}:e)}function S(e){let{seriesAColor:t,seriesBColor:o,areaOpacity:i,styleRules:a}=e;return w(e=>({fill:"A"===A(e)?t:o,stroke:"none",fillOpacity:i}),a)}function k(e){let{seriesAColor:t,seriesBColor:o,lineWidth:i,styleRules:a}=e;return w(e=>({stroke:"A"===A(e)?t:o,strokeWidth:i,fill:"none"}),a)}function C(e){let{seriesAColor:t,seriesBColor:o,pointRadius:i,styleRules:a}=e;return w(e=>({fill:"A"===A(e)?t:o,r:i}),a)}function R(e){if(null==e)return NaN;if("number"==typeof e)return e;if(e instanceof Date)return e.getTime();if("string"==typeof e){if(""===e.trim())return NaN;let t=+e;return Number.isFinite(t)?t:NaN}return NaN}function L(e,t,o,i){if(!e.length)return[];let a=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[];for(let e of a){let a=t(e),l=o(e),n=i(e);Number.isFinite(l)&&r.push({__x:a,__y:l,__diffSegment:"line-A",__diffWinner:"A",__sourceDatum:e}),Number.isFinite(n)&&r.push({__x:a,__y:n,__diffSegment:"line-B",__diffWinner:"B",__sourceDatum:e})}return r}function _(e){let[t,o]=zo.useState(()=>Vo);return zo.useEffect(()=>{if(t)return;let e=!1;return(Vo?Promise.resolve(Vo):(Xo||(Xo=import("./c-EPJWM2UT.min.js").then(e=>Vo=e.ScatterplotMatrixBrushOverlay).catch(e=>{throw Xo=null,e})),Xo)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?/* @__PURE__ */Go(t,{...e}):null}function H({data:e,xField:t,yField:o,fieldLabels:i,cellSize:a,pointRadius:r,pointOpacity:l,styleRules:n,colorBy:s,colorScale:c,brushSelectionName:h,hoverSelectionName:m,unselectedOpacity:d,maxDevicePixelRatio:u,mobileInteraction:p,mode:y,onPointHover:f,onPointClick:g}){let b=jo(null),x=ot({name:h,clientId:`splom-${t}-${o}`,fields:[t,o]}),v=it({name:h,xField:t,yField:o}),A=ot({name:m,clientId:"splom-hover-source",fields:[Ko]}),w=A.selectPoints,S=Eo(e=>{e?v.brushInteraction.during(e):v.brushInteraction.end(null)},[v.brushInteraction]),k=Eo(e=>{if(!e)return void f?.(null);let t=e.data,o=t?.[Ko];void 0!==o&&(w({[Ko]:[o]}),f?.(t,e.x+Yo.left,e.y+Yo.top))},[w,f]),C=Eo(e=>{if(!e)return void g?.(null);let t=e.data;t&&g?.(t,e.x+Yo.left,e.y+Yo.top)},[g]),R=Oo(()=>Ee(t,o),[t,o]),L=Oo(()=>Xe(e=>({opacity:l,r:r,fill:s?xt(e,s,c):gt}),n,R),[l,r,s,c,n,R]),H=Eo(e=>{let t={...L(e)};return"hover"===y?A.isActive&&A.predicate(e)?(t.opacity=1,t.r=2.5*r,t.stroke="#333",t.strokeWidth=1.5):A.isActive&&(t.opacity=.6*("number"==typeof t.opacity?t.opacity:l)):x.isActive&&!x.predicate(e)&&(t.opacity=d),t},[L,y,A,x,d,r,l]);/* @__PURE__ */
|
|
11
|
+
return Qo("div",{style:{position:"relative",width:a,height:a},children:[
|
|
12
|
+
/* @__PURE__ */$o(he,{ref:b,chartType:"scatter",data:e,size:[a,a],xAccessor:t,yAccessor:o,pointStyle:H,margin:Yo,showAxes:!1,maxDevicePixelRatio:u,enableHover:"hover"===y,accessibleTable:!1,description:`${vt(i,t)??t} versus ${vt(i,o)??o} scatterplot`,...Ce({forceHoverBehavior:"hover"===y,forceClickBehavior:!!g,mobileInteraction:p,customHoverBehavior:k,customClickBehavior:C}),tooltipContent:"hover"===y?()=>null:void 0}),"brush"===y&&/* @__PURE__ */$o(_,{frameRef:b,cellSize:a,onBrush:S})]})}function I({data:e,field:t,label:o,cellSize:i,bins:a,colorBy:r,colorScale:l,brushSelectionName:n,hoverSelectionName:s,mode:c}){let h=ot({name:n,clientId:"splom-diag-"+t,fields:[t]}),m=ot({name:s,clientId:`splom-diag-${t}-hover`,fields:[Ko]}),d="hover"===c?m:h,u=d.isActive,p=d.predicate,y=Oo(()=>{let o="string"==typeof r?r:null,l=[],n=/* @__PURE__ */new Set;for(let i of e){let e=i[t];if(null!=e&&!isNaN(e)&&l.push(Number(e)),o){let e=i[o];null!=e&&n.add(e+"")}}if(0===l.length)return{bars:[],selectedBars:[],categoryBars:[],selectedCategoryBars:[],max:0,categories:[]};let[s,c]=Ct(l),h=(c-s)/a||1,m=Array.from(n),d=new Map(m.map((e,t)=>[e,t])),y=Array(a).fill(0),f=Array(a).fill(0),g=Array.from({length:a},()=>Array(m.length).fill(0)),b=Array.from({length:a},()=>Array(m.length).fill(0));for(let i of e){let e=i[t];if(null==e||isNaN(e))continue;let r=Math.min(Math.floor((e-s)/h),a-1);if(y[r]++,(!u||p(i))&&f[r]++,o){let e=d.get(i[o]+"");void 0!==e&&(g[r][e]++,(!u||p(i))&&b[r][e]++)}}let x=Rt(y,1),v=g.map((e,t)=>{let o=0;return e.map((e,r)=>{let l=e/x*(i-24),n={x:t/a*i,w:i/a-1,h:l,y0:o,category:m[r]};return o+=l,n})}),A=b.map((e,t)=>{let o=0;return e.map((e,r)=>{let l=e/x*(i-24),n={x:t/a*i,w:i/a-1,h:l,y0:o,category:m[r]};return o+=l,n})});return{bars:y.map((e,t)=>({x:t/a*i,w:i/a-1,h:e/x*(i-24),count:e})),selectedBars:f.map((e,t)=>({x:t/a*i,w:i/a-1,h:e/x*(i-24),count:e})),categoryBars:v,selectedCategoryBars:A,max:x,categories:m}},[e,t,a,i,u,p,r]);/* @__PURE__ */
|
|
13
|
+
return Qo("svg",{width:i,height:i,style:{overflow:"hidden"},children:[
|
|
14
|
+
/* @__PURE__ */$o("text",{x:i/2,y:14,textAnchor:"middle",fontSize:11,fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)",children:o}),y.categories.length>0?y.categoryBars.map((e,t)=>e.map((e,o)=>/* @__PURE__ */$o("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:l?l(e.category):gt,opacity:u?.3:.6},`bg-${t}-${o}`))):y.bars.map((e,t)=>/* @__PURE__ */$o("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:gt,opacity:u?.3:.6},"bg-"+t)),u&&(y.categories.length>0?y.selectedCategoryBars.map((e,t)=>e.map((e,o)=>/* @__PURE__ */$o("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:l?l(e.category):gt,opacity:.7},`sel-${t}-${o}`))):y.selectedBars.map((e,t)=>/* @__PURE__ */$o("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:gt,opacity:.7},"sel-"+t)))]})}function P({label:e,cellSize:t}){/* @__PURE__ */
|
|
15
|
+
return $o("svg",{width:t,height:t,children:/* @__PURE__ */$o("text",{x:t/2,y:t/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:12,fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)",children:e})})}function B(e){let{data:t,fields:o,fieldLabels:i={},colorBy:a,colorScheme:r,cellSize:l=150,cellGap:n=4,pointRadius:s=2,pointOpacity:c=.5,diagonal:h="histogram",histogramBins:m=20,brushMode:d="crossfilter",hoverMode:u=!0,unselectedOpacity:p=.1,showGrid:y=!1,maxDevicePixelRatio:f,tooltip:g,showLegend:b,idAccessor:x,styleRules:v,width:A,className:w,title:S,description:k,summary:C,accessibleTable:R=!0,onObservation:L,onClick:_,chartId:B}=e,F="splom",D="splom-hover",N=rt(e.mobileInteraction,{mode:e.mode,width:A??o.length*l,mobileSemantics:e.mobileSemantics}),M=u?"hover":d?"brush":"hover",W=St(e=>e.clearSelection),[T,O]=To(null),E=Wo(()=>{W(D),O(null)},[W,D]),j=Mo(()=>(t||[]).map((e,t)=>void 0!==e[Ko]?e:{...e,[Ko]:t}),[t]),z=Ne(j,a,r),G=No.useId().replace(/:/g,"")+"-data-table",V=Mo(()=>(t||[]).map(e=>({type:"point",datum:e})),[t]),X=Mo(()=>Qe(g),[g]),$=40,Q=Wo((e,t,o,i)=>[$+n+e*(l+n)+(o??0),t*(l+n)+(i??0)],[$,l,n]),K=void 0!==b?b:!!a,Y=Mo(()=>{if(!K||!a)return null;let e="string"==typeof a?a:null;return e?Array.from(new Set(j.map(t=>t[e]).filter(e=>null!=e))).map(e=>({label:e+"",color:z?z(e+""):gt})):null},[K,a,j,z]),q=Mo(()=>({display:"grid",gridTemplateColumns:"40px "+o.map(()=>l+"px").join(" "),gridTemplateRows:o.map(()=>l+"px").join(" ")+" 40px",gap:n+"px",width:"fit-content"}),[o,l,n,$]);/* @__PURE__ */
|
|
16
|
+
return Jo("div",{className:w,style:{position:"relative",color:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)"},role:"group","aria-label":k||S||`Scatterplot matrix comparing ${o.length} fields`,children:[S&&/* @__PURE__ */qo("div",{className:"semiotic-chart-title",style:{fontWeight:600,marginBottom:8},children:S}),R&&/* @__PURE__ */qo(at,{accessibleTable:R,children:/* @__PURE__ */qo(ct,{tableId:G})}),
|
|
17
|
+
/* @__PURE__ */qo(st,{summary:C}),Y&&/* @__PURE__ */qo("div",{style:{display:"flex",gap:12,marginBottom:8,flexWrap:"wrap"},children:Y.map(e=>/* @__PURE__ */Jo("div",{style:{display:"flex",alignItems:"center",gap:4},children:[
|
|
18
|
+
/* @__PURE__ */qo("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",backgroundColor:e.color}}),
|
|
19
|
+
/* @__PURE__ */qo("span",{style:{fontSize:11},children:e.label})]},e.label))}),
|
|
20
|
+
/* @__PURE__ */Jo("div",{style:{position:"relative",width:"fit-content"},children:[
|
|
21
|
+
/* @__PURE__ */Jo("div",{style:q,onMouseLeave:"hover"===M?E:void 0,children:[o.map((e,t)=>/* @__PURE__ */Jo(No.Fragment,{children:[
|
|
22
|
+
/* @__PURE__ */qo("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",writingMode:"vertical-rl",transform:"rotate(180deg)",fontSize:11,fontWeight:"bold",color:"var(--semiotic-text, #333)"},children:vt(i,e)??e}),o.map((o,r)=>t===r?"label"===h?/* @__PURE__ */qo(P,{label:vt(i,e)??e,cellSize:l},"diag-"+e):/* @__PURE__ */qo(I,{data:j,field:e,label:vt(i,e)??e,cellSize:l,bins:m,colorBy:a,colorScale:z,brushSelectionName:F,hoverSelectionName:D,unselectedOpacity:p,mode:M},"diag-"+e):/* @__PURE__ */qo(H,{data:j,xField:o,yField:e,fieldLabels:i,cellSize:l,pointRadius:s,pointOpacity:c,styleRules:v,colorBy:a,colorScale:z,brushSelectionName:F,hoverSelectionName:D,unselectedOpacity:p,showGrid:y,maxDevicePixelRatio:f,mobileInteraction:N,mode:M,onPointHover:"hover"===M?(i,a,l)=>{if(i){if(O({datum:i,xField:o,yField:e,colIndex:r,rowIndex:t,px:a??0,py:l??0}),L){let[e,o]=Q(r,t,a,l);L({type:"hover",datum:i,x:e,y:o,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:B})}}else O(null),L&&L({type:"hover-end",timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:B})}:void 0,onPointClick:_||L?(e,o,i)=>{if(!e)return;let[a,l]=Q(r,t,o,i);_&&_(e,{x:a,y:l}),L&&L({type:"click",datum:e,x:a,y:l,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:B})}:void 0},`cell-${e}-${o}`))]},"row-"+e)),
|
|
23
|
+
/* @__PURE__ */qo("div",{})," ",o.map(e=>/* @__PURE__ */qo("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:"bold",color:"#333"},children:vt(i,e)??e},"col-label-"+e))]}),T&&"hover"===M&&!1!==g&&(()=>{let e=T.datum,t=vt(i,T.xField)??T.xField,r=vt(i,T.yField)??T.yField,s=a?"function"==typeof a?a(e):e[a]:null,c=x?"function"==typeof x?x(e):e[x]:"Row "+e[Ko],h=$+n+T.colIndex*(l+n)+T.px,m=T.rowIndex*(l+n)+T.py,d={...e};delete d[Ko];let u="function"==typeof X,p=u?X(d):null,y=/* @__PURE__ */Jo(ut,{style:{color:"var(--semiotic-tooltip-text, #333)",background:"var(--semiotic-tooltip-bg, rgba(255,255,255,0.95))",border:"1px solid var(--semiotic-border, #ddd)",borderRadius:3,padding:"4px 8px",fontSize:11,lineHeight:1.4,whiteSpace:"nowrap",boxShadow:"none"},children:[
|
|
24
|
+
/* @__PURE__ */qo("div",{style:{fontWeight:"bold",marginBottom:2},children:c+""}),
|
|
25
|
+
/* @__PURE__ */Jo("div",{children:[t,": ",null!=e[T.xField]?Number(e[T.xField]).toFixed(1):"–"]}),
|
|
26
|
+
/* @__PURE__ */Jo("div",{children:[r,": ",null!=e[T.yField]?Number(e[T.yField]).toFixed(1):"–"]}),null!=s&&/* @__PURE__ */Jo("div",{style:{opacity:.8},children:["string"==typeof a?a:"group",": ",s+""]})]}),f=u?p:y;return f?/* @__PURE__ */qo(Ie,{x:h,y:m,containerWidth:$+o.length*l+o.length*n,containerHeight:o.length*l+$+o.length*n,margin:{top:0,right:0,bottom:0,left:0},className:"scatterplot-matrix-tooltip",zIndex:10,children:f}):null})()]}),R&&/* @__PURE__ */qo(at,{accessibleTable:R,children:/* @__PURE__ */qo(lt,{scene:V,chartType:"scatterplot matrix",tableId:G,chartTitle:S})})]})}function F(e){let{brushMode:t="crossfilter",hoverMode:o=!0}=e,i={};return!o&&t&&(i.splom={resolution:t}),o&&(i["splom-hover"]={resolution:"union"}),/* @__PURE__ */qo(mt,{selections:i,children:/* @__PURE__ */qo(B,{...e})})}function D(e){let[t,o]=ii.useState(()=>ri);return ii.useEffect(()=>{if(t)return;let e=!1;return(ri?Promise.resolve(ri):(li||(li=import("./c-FD2BXSRG.min.js").then(e=>ri=e.MinimapBrushOverlay).catch(e=>{throw li=null,e})),li)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t?/* @__PURE__ */ai(t,{...e}):null}function N(e){let{data:t,width:o=600,height:i=400,margin:a,className:r,title:l,description:n,summary:s,xLabel:c,yLabel:h,xFormat:m,yFormat:d,xAccessor:u="x",yAccessor:p="y",lineBy:y,lineDataAccessor:f="coordinates",colorBy:g,colorScheme:b,curve:x="linear",lineWidth:v=2,styleRules:A,fillArea:w=!1,areaOpacity:S=.3,showPoints:k=!1,pointRadius:C=3,enableHover:R=!0,showGrid:L=!1,showLegend:_,legendPosition:H,tooltip:I,minimap:P={},renderBefore:B=!1,onBrush:F,brushExtent:N,yExtent:M,frameProps:W={},loading:T,loadingContent:O,emptyContent:E}=e,j=Ue(T,o,i,O),z=j?null:Je(t,o,i,E),G=ti(()=>qe(t),[t]),[V,X]=Uo(null),Q=N??V,K=oi(e=>{N||X(e),F?.(e)},[N,F]),Y=Zo(null),[J,U]=Uo(null);ei(()=>{let e=0,t=!1,o=()=>{if(t)return;let i=Y.current?.getScales?.();i?U(i):e=requestAnimationFrame(o)};return e=requestAnimationFrame(o),()=>{t=!0,e&&cancelAnimationFrame(e)}},[t]);let Z=void 0!==G[0]?.[f],ee=ti(()=>{if(Z)return G;if(y){let e=G.reduce((e,t)=>{let o="function"==typeof y?y(t):t[y];if(!e[o]){let t={[f]:[]};"string"==typeof y&&(t[y]=o),e[o]=t}return e[o][f].push(t),e},{});return Object.values(e)}return[{[f]:G}]},[G,y,f,Z]),te=ti(()=>Z||y?ee.flatMap(e=>{let t=e[f]||[];return y&&"string"==typeof y?t.map(t=>({...t,[y]:e[y]})):t}):G,[ee,f,Z,y,G]),oe=Ne(G,g,b),ie=ti(()=>Ee(u,p),[u,p]),ae=$({lineWidth:v,colorBy:g,colorScale:oe,fillArea:w,areaOpacity:S,styleRules:A,ruleContext:ie}),re=ti(()=>{if(P.lineStyle)return P.lineStyle},[P.lineStyle]),le=$({lineWidth:1,colorBy:g,colorScale:oe,styleRules:A,ruleContext:ie}),ne=re??le,se=ti(()=>k?Xe(e=>{let t={r:C,fillOpacity:1};return t.fill=g?xt(e.parentLine||e,g,oe):gt,t},A,ie,e=>e.parentLine||e):void 0,[k,C,g,oe,A,ie]),{legend:ce,margin:me,legendPosition:de,legendMarginReserved:ue}=He({data:ee,colorBy:g,colorScale:oe,showLegend:_,legendPosition:H,userMargin:a,chartWidth:o,chartHeight:i,frameLegend:W,hasTitle:!!l,axisChrome:dt(W,{showAxes:!0,xLabel:c,yLabel:h})}),pe=P.height||60,ye=ti(()=>({top:P.margin?.top??0,bottom:P.margin?.bottom??20,left:P.margin?.left??me.left,right:P.margin?.right??me.right}),[P.margin,me]),fe=P.brushDirection||"x",ge=ti(()=>Se([{label:c||Ae(u),accessor:u,role:"x",format:m},{label:h||Ae(p),accessor:p,role:"y",format:d}]),[u,p,c,h,m,d]),be=q({componentName:"MinimapChart",data:t,accessors:{xAccessor:u,yAccessor:p}});if(be)/* @__PURE__ */return ni(Ke,{componentName:"MinimapChart",message:be,width:o,height:i});let xe=w?"area":"line",ve={chartType:xe,data:te,xAccessor:u,yAccessor:p,groupAccessor:y||void 0,curve:x,lineStyle:ae,...k&&{pointStyle:se},size:[o,i],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:me,showAxes:!0,xLabel:c,yLabel:h,xFormat:m,yFormat:d,enableHover:R,showGrid:L,...ce&&{legend:ce,legendPosition:de},...ue&&{__legendMarginReservedFor:ce},...l&&{title:l},...n&&{description:n},...s&&{summary:s},...void 0!==e.accessibleTable&&{accessibleTable:e.accessibleTable},...void 0!==e.animate&&{animate:e.animate},...void 0!==e.hoverRadius&&{hoverRadius:e.hoverRadius},...Ge({tooltip:I,defaultTooltipContent:ge}),...Q&&{xExtent:Q},...M&&{yExtent:M},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...W},we={chartType:xe,data:te,xAccessor:u,yAccessor:p,groupAccessor:y||void 0,curve:x,lineStyle:ne,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},size:[o,pe+ye.top+ye.bottom],margin:ye,showAxes:P.showAxes??!1,background:P.background,enableHover:!1,accessibleTable:!1,description:(n||l||"Chart")+" overview minimap",animate:!1,...M&&{yExtent:M}},ke=/* @__PURE__ */si("div",{style:{position:"relative",width:o,overflow:"hidden"},children:[
|
|
27
|
+
/* @__PURE__ */ni(he,{ref:Y,...we}),
|
|
28
|
+
/* @__PURE__ */ni(D,{width:o-ye.left-ye.right,height:pe,margin:ye,scales:J,brushDirection:fe,extent:Q,onBrush:K})]},"minimap"),Ce=/* @__PURE__ */ni("div",{style:{overflow:"hidden"},children:/* @__PURE__ */ni(he,{...ve})},"main");return j||z||/* @__PURE__ */ni(Ye,{componentName:"MinimapChart",width:o,height:i,children:/* @__PURE__ */si("div",{className:"minimap-chart"+(r?" "+r:""),role:"group","aria-label":n||l||"Chart with overview minimap",children:[B?ke:Ce,B?Ce:ke]})})}function M(e,t){return{label:t?.label??e.label,color:t?.color??e.color,opacity:t?.opacity??e.opacity}}function W(e,t,o){let i=bt(t,o,ft),a=t&&"object"==typeof t&&!Array.isArray(t)?t:null;return e.map((e,t)=>{if("string"==typeof e.color&&e.color.length>0)return e.color;let o=e.label||"Series "+(t+1),r=a?.[o];return"string"==typeof r&&r.length>0?r:i[t%i.length]})}function T(e,t){let o=Oe(e),i=t.map((e,t)=>({label:e.label||"Series "+(t+1),readY:Oe(e.yAccessor)}));return(e,t)=>{let a=(e[ki]??t??"")+"",r=(i.find(e=>e.label===a)??i[0])?.readY(e);return{value:r,x:o(e),y:r,category:a||void 0}}}function O(e,t){let o=1/0,i=-1/0,a="function"==typeof t?t:e=>e[t];for(let t of e){let e=a(t);null!=e&&isFinite(e)&&(o>e&&(o=e),e>i&&(i=e))}if(!isFinite(o)||!isFinite(i))return[0,1];if(o===i){let e=0===o?1:.1*Math.abs(o);return[o-e,i+e]}return[o,i]}function E(e,t){let o=t[1]-t[0];return 0===o?.5:(e-t[0])/o}function j(e,t){return t[0]+e*(t[1]-t[0])}import{a as z}from"./c-27DCB5T6.min.js";import{a as G,b as V,c as X,d as $}from"./c-7ASK4WBF.min.js";import{a as Q}from"./c-PDQHLOKU.min.js";import{a as K,c as Y}from"./c-PQOZPM4G.min.js";import{b as q}from"./c-IBRLFKWA.min.js";import{a as J,b as U,c as Z}from"./c-HQ27AHMC.min.js";import{a as ee}from"./c-C4KIXUWU.min.js";import{a as te,b as oe,c as ie,d as ae,g as re,h as le}from"./c-AXJ2QI3F.min.js";import{e as ne}from"./c-CLDCKFBE.min.js";import{b as se,c as ce,d as he,e as me}from"./c-TTKWXGAI.min.js";import{a as de,h as ue,j as pe,k as ye}from"./c-MTX2AO5S.min.js";import{j as fe,k as ge,l as be,m as xe,n as ve}from"./c-HK4OSLZA.min.js";import{H as Ae,J as we,K as Se,X as ke,Y as Ce,Z as Re,_ as Le}from"./c-KGROWFT2.min.js";import{b as _e}from"./c-CLLCX3PT.min.js";import{Bb as He,Ca as Ie,Cb as Pe,Eb as Be,Fb as Fe,Hb as De,Ib as Ne,Kb as Me,Lb as We,Mb as Te,Nb as Oe,Ob as Ee,Qa as je,Ra as ze,Sa as Ge,Sb as Ve,Tb as Xe,Ua as $e,Va as Qe,_a as Ke,ab as Ye,b as qe,bb as Je,cb as Ue,db as Ze,ib as et,jb as tt,kb as ot,nb as it,qa as at,rb as rt,ta as lt,v as nt,va as st,wa as ct,ya as ht,yb as mt,z as dt,za as ut}from"./c-G53AVC42.min.js";import{b as pt,d as yt,m as ft,n as gt,o as bt,r as xt,s as vt,u as At}from"./c-Y342FJ6K.min.js";import{m as wt}from"./c-3BYZXCX3.min.js";import{o as St,v as kt}from"./c-5NYONM6V.min.js";import{a as Ct,c as Rt}from"./c-3PFVJFBK.min.js";import{useMemo as Lt,useCallback as _t,forwardRef as Ht,useRef as It}from"react";import{useCallback as Pt,useMemo as Bt,useRef as Ft,useState as Dt}from"react";import{jsx as Nt}from"react/jsx-runtime";se(z),de(oe);var Mt=Ht(function(t,o){let i=It(null),a=Te(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,xLabel:t.xLabel,yLabel:t.yLabel,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),{data:r,margin:l,className:n,xFormat:s,yFormat:c,xAccessor:h="x",yAccessor:m="y",xScaleType:d,yScaleType:u,colorBy:p,colorScheme:y,styleRules:f,sizeBy:g,sizeRange:b=[3,15],symbolBy:x,symbolMap:v,pointRadius:A=5,pointOpacity:w=.8,tooltip:S,marginalGraphics:k,pointIdAccessor:C,annotations:R,regression:L,forecast:_,anomaly:H,xExtent:I,yExtent:P,pulse:B,decay:F,staleness:D,frameProps:N={},selection:M,linkedHover:W,linkedBrush:T,brush:O,onBrush:E,onObservation:j,onClick:z,hoverHighlight:X,chartId:$,loading:K,loadingContent:Y,emptyContent:J,legendInteraction:ee,legendPosition:te,color:oe,stroke:ie,strokeWidth:ae,opacity:re}=t,{width:le,height:ne,enableHover:se,showGrid:ce,showLegend:de,title:ue,description:pe,summary:ye,accessibleTable:fe,xLabel:ge,yLabel:be}=a,xe=Lt(()=>qe(r),[r]),ve=void 0===r,{domain:we,trackPushed:Le,reset:_e}=e({accessor:g,data:xe,isPushMode:ve}),He=_t(e=>{Le([e]),i.current?.push(e)},[Le]),Ie=_t(e=>{Le(e),i.current?.pushMany(e)},[Le]);Z(o,{variant:"xy",frameRef:i,overrides:{push:He,pushMany:Ie,clear:()=>{_e(),i.current?.clear()}}});let Pe=U({data:xe,rawData:r,colorBy:p,colorScheme:y,legendInteraction:ee,legendPosition:te,frameLegend:N,selection:M,linkedHover:W,fallbackFields:p?["string"==typeof p?p:""]:[],unwrapData:!1,onObservation:j,onClick:z,hoverHighlight:X,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"Scatterplot",chartId:$,showLegend:de,userMargin:l,marginDefaults:a.marginDefaults,loading:K,loadingContent:Y,emptyContent:J,width:le,height:ne,hasTitle:!!ue,axisChrome:dt(N,{showAxes:a.showAxes,xLabel:ge,yLabel:be})}),{brushStreamProps:Be}=me({brush:O,onBrush:E,linkedBrush:T,xAccessor:h,yAccessor:m,defaultDimension:"xy"});Ze("Scatterplot",xe,"xAccessor",h),Ze("Scatterplot",xe,"yAccessor",m);let Fe=Lt(()=>g?we??[0,1]:void 0,[g,we]),De=Lt(()=>g?e=>At(e,g,b,Fe):void 0,[g,b,Fe]),Ne=Lt(()=>Ee(h,m),[h,m]),Me=G({colorBy:p,colorScale:Pe.colorScale,color:oe,pointRadius:A,fillOpacity:w,radiusFn:De,stroke:ie,strokeWidth:ae,opacity:re,styleRules:f,ruleContext:Ne,effectiveSelectionHook:Pe.effectiveSelectionHook,resolvedSelection:Pe.resolvedSelection}),We=Lt(()=>Se([{label:ge||Ae(h),accessor:h,role:"x",format:s},{label:be||Ae(m),accessor:m,role:"y",format:c},...p?[{label:Ae(p),accessor:p,role:"color"}]:[],...g?[{label:Ae(g),accessor:g,role:"size"}]:[]]),[h,m,ge,be,p,g,s,c]),{effectiveData:Oe,statisticalAnnotations:je}=V({data:xe,xAccessor:h,yAccessor:m,forecast:_,anomaly:H}),ze=Lt(()=>{let e=Q(L);return e||0!==je.length?[...e?[e]:[],...R||[],...je]:R},[L,R,je]);if(Pe.earlyReturn)return Pe.earlyReturn;let Ge=q({componentName:"Scatterplot",data:r,accessors:{xAccessor:h,yAccessor:m}});if(Ge)/* @__PURE__ */return Nt(Ke,{componentName:"Scatterplot",message:Ge,width:le,height:ne});let Ve={chartType:"scatter",...null!=r&&{data:Oe},xAccessor:h,yAccessor:m,xScaleType:d,yScaleType:u,colorAccessor:p||void 0,sizeAccessor:g||void 0,...x&&{symbolAccessor:x},...v&&{symbolMap:v},sizeRange:b,pointStyle:Me,colorScheme:y,size:[le,ne],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:Pe.margin,showAxes:a.showAxes,xLabel:ge,yLabel:be,xFormat:s,yFormat:c,enableHover:se,showGrid:ce,...Pe.legendBehaviorProps,...ke({title:ue,description:pe,summary:ye,accessibleTable:fe,className:n,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...Re({tooltip:S,defaultTooltipContent:We}),...Ce({linkedHover:W,selection:M,onObservation:j,onClick:z,hoverHighlight:X,hoverRadius:t.hoverRadius,mobileInteraction:Pe.mobileInteraction,customHoverBehavior:Pe.customHoverBehavior,customClickBehavior:Pe.customClickBehavior}),...k&&{marginalGraphics:k},...C&&{pointIdAccessor:C},...B&&{pulse:B},...F&&{decay:F},...D&&{staleness:D},...ze&&ze.length>0&&{annotations:ze},...I&&{xExtent:I},...P&&{yExtent:P},...Be,...Pe.crosshairProps,...N};/* @__PURE__ */
|
|
29
|
+
return Nt(Ye,{componentName:"Scatterplot",width:le,height:ne,children:/* @__PURE__ */Nt(he,{ref:i,...Ve})})});Mt.displayName="Scatterplot";import{useMemo as Wt,forwardRef as Tt,useRef as Ot}from"react";import{Fragment as Et,jsx as jt}from"react/jsx-runtime";de(oe);var zt=Tt(function(e,o){let i=Ot(null);Z(o,{variant:"xy",frameRef:i});let a=Te(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:l,className:n,xFormat:s,yFormat:c,xAccessor:h="x",yAccessor:m="y",orderAccessor:d,orderLabel:u,styleRules:p,pointRadius:y=4,tooltip:f,pointIdAccessor:g,annotations:b,regression:x,forecast:v,anomaly:A,xExtent:w,yExtent:S,pulse:k,decay:C,staleness:R,frameProps:L={},selection:_,linkedHover:H,onObservation:I,onClick:P,hoverHighlight:B,chartId:F,loading:D,loadingContent:N,emptyContent:M,legendInteraction:W,stroke:T,strokeWidth:O,opacity:E}=e,{width:j,height:z,enableHover:X,showGrid:$,title:K,description:Y,summary:J,accessibleTable:ee,xLabel:te,yLabel:oe}=a,{safeData:ie,orderMap:ae}=Wt(()=>{let e=r||[],t="function"==typeof h?h:e=>e[h],o="function"==typeof m?m:e=>e[m],i=e;if(d&&e.length>0){let t="function"==typeof d?d:e=>e[d];i=[...e].sort((e,o)=>{let i=t(e),a=t(o);return(i instanceof Date?i.getTime():+i)-(a instanceof Date?a.getTime():+a)})}let a=/* @__PURE__ */new WeakMap,l=0;for(let e of i){let i=t(e),a=o(e);null!=i&&null!=a&&isFinite(i)&&isFinite(a)&&l++}let n=0;for(let e of i){let i=t(e),r=o(e);null!=i&&null!=r&&isFinite(i)&&isFinite(r)&&a.set(e,{idx:n++,total:l})}return{safeData:i,orderMap:a}},[r,d,h,m]);Ze("ConnectedScatterplot",ie,"xAccessor",h),Ze("ConnectedScatterplot",ie,"yAccessor",m);let re=U({data:ie,rawData:r,colorBy:void 0,colorScheme:void 0,legendInteraction:W,selection:_,linkedHover:H,fallbackFields:[],unwrapData:!1,onObservation:I,onClick:P,hoverHighlight:B,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"ConnectedScatterplot",chartId:F,showLegend:void 0,userMargin:l,marginDefaults:a.marginDefaults,loading:D,loadingContent:N,emptyContent:M,width:j,height:z,hasTitle:!!K,axisChrome:dt(L,{showAxes:a.showAxes,xLabel:te,yLabel:oe})}),le=re.resolvedSelection?.unselectedOpacity??et,ne=Wt(()=>(e,o)=>{let i=o.filter(e=>"point"===e.type);if(2>i.length)return;let a=re.effectiveSelectionHook?.isActive,r=re.effectiveSelectionHook?.predicate,l=100>i.length,n=i.length;e.lineCap="round";for(let o=0;n-1>o;o++){let s=i[o],c=i[o+1],h=t(o,n),m=!a||!r||r(s.datum??s)||r(c.datum??c),d=a?m?1:le:1;l&&(e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(c.x,c.y),e.strokeStyle="white",e.lineWidth=y+2,e.globalAlpha=.5*d,e.stroke()),e.beginPath(),e.moveTo(s.x,s.y),e.lineTo(c.x,c.y),e.strokeStyle=h,e.lineWidth=y,e.globalAlpha=d,e.stroke()}e.globalAlpha=1},[y,re.effectiveSelectionHook,le]),se=Wt(()=>[ne],[ne]),ce=Wt(()=>(e,o,i)=>{let a=e.filter(e=>"point"===e.type);if(2>a.length)return null;let r=a.length,l=100>r,n=[];for(let e=0;r-1>e;e++){let o=a[e],i=a[e+1],s=t(e,r),c=Math.min("number"==typeof o.style?.opacity?o.style.opacity:1,"number"==typeof i.style?.opacity?i.style.opacity:1);l&&n.push(
|
|
30
|
+
/* @__PURE__ */jt("line",{x1:o.x,y1:o.y,x2:i.x,y2:i.y,stroke:"white",strokeWidth:y+2,strokeLinecap:"round",opacity:.5*c},"halo-"+e)),n.push(
|
|
31
|
+
/* @__PURE__ */jt("line",{x1:o.x,y1:o.y,x2:i.x,y2:i.y,stroke:s,strokeWidth:y,strokeLinecap:"round",opacity:c},"seg-"+e))}/* @__PURE__ */
|
|
32
|
+
return jt(Et,{children:n})},[y]),me=Wt(()=>[ce],[ce]),de=Wt(()=>e=>{let o=ae.get(e),i=o?.idx??0,a=o?.total??1;return{fill:a>0?t(i,a):"#6366f1",stroke:"white",strokeWidth:1,r:y,fillOpacity:1}},[y,ae]),ue=Wt(()=>Ee(h,m),[h,m]),pe=G({colorScale:void 0,baseStyleExtras:de,stroke:T,strokeWidth:O,opacity:E,styleRules:p,ruleContext:ue,effectiveSelectionHook:re.effectiveSelectionHook,resolvedSelection:re.resolvedSelection}),ye=u||("string"==typeof d?d:"Order"),fe=Wt(()=>Se([{label:te||Ae(h),accessor:h,role:"x",format:s},{label:oe||Ae(m),accessor:m,role:"y",format:c},...d?[{label:ye,accessor:d,role:"group"}]:[]]),[h,m,te,oe,d,ye,s,c]),ge=q({componentName:"ConnectedScatterplot",data:r,accessors:{xAccessor:h,yAccessor:m}}),{effectiveData:be,statisticalAnnotations:xe}=V({data:ie,xAccessor:h,yAccessor:m,forecast:v,anomaly:A});if(re.earlyReturn)return re.earlyReturn;let ve=Q(x),we=ve||xe.length>0?[...ve?[ve]:[],...b||[],...xe]:b,Le={chartType:"scatter",...null!=r&&{data:be},xAccessor:h,yAccessor:m,pointStyle:pe,size:[j,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:re.margin,showAxes:a.showAxes,xLabel:te,yLabel:oe,xFormat:s,yFormat:c,enableHover:X,showGrid:$,...ke({title:K,description:Y,summary:J,accessibleTable:ee,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Re({tooltip:f,defaultTooltipContent:fe}),...Ce({linkedHover:H,selection:_,onObservation:I,onClick:P,hoverHighlight:B,hoverRadius:e.hoverRadius,mobileInteraction:re.mobileInteraction,customHoverBehavior:re.customHoverBehavior,customClickBehavior:re.customClickBehavior}),...g&&{pointIdAccessor:g},...k&&{pulse:k},...C&&{decay:C},...R&&{staleness:R},canvasPreRenderers:se,svgPreRenderers:me,...we&&we.length>0&&{annotations:we},...w&&{xExtent:w},...S&&{yExtent:S},...re.crosshairProps,...L};return ge?/* @__PURE__ */jt(Ke,{componentName:"ConnectedScatterplot",message:ge,width:j,height:z}):/* @__PURE__ */jt(Ye,{componentName:"ConnectedScatterplot",width:j,height:z,children:/* @__PURE__ */jt(he,{ref:i,...Le})})});zt.displayName="ConnectedScatterplot";import{forwardRef as Gt,useMemo as Vt}from"react";import{jsx as Xt}from"react/jsx-runtime";de(ne);var $t=Gt(function(e,t){let{data:o,layout:i,layoutConfig:a,onLayoutError:r,xExtent:l,yExtent:n,showAxes:s=!1,margin:c,className:h,annotations:m,onObservation:d,onClick:u,selection:p,linkedHover:y,hoverHighlight:f,chartId:g,loading:b,loadingContent:x,emptyContent:v,colorBy:A,colorScheme:w,legend:S,legendInteraction:k,legendPosition:C,frameProps:R={}}=e,{legend:L,..._}=R,H=Vt(()=>nt(L,S),[L,S]),{frameRef:I,resolved:P,safeData:B,setup:F,earlyReturn:D}=Y({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"XYCustomChart",unwrapData:!1,data:o,colorBy:A,colorScheme:w,legend:H,legendInteraction:k,legendPosition:C,frameLegend:_,selection:p,linkedHover:y,hoverHighlight:f,onObservation:d,onClick:u,chartId:g,loading:b,loadingContent:x,emptyContent:v,margin:c,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules,xLabel:e.xLabel,yLabel:e.yLabel}),N=F.effectiveSelectionHook,M=Vt(()=>N?.isActive?{isActive:!0,predicate:N.predicate}:null,[N?.isActive,N?.predicate]),W=Vt(()=>Ge({tooltip:e.tooltip,defaultTooltipContent:e=>/* @__PURE__ */Xt(ce,{hover:e})}),[e.tooltip]);if(D)return D;let{width:T,height:O,enableHover:E,showGrid:j,title:z,description:G,summary:V,accessibleTable:X,xLabel:$,yLabel:Q}=P,K={chartType:"custom",...null!=o&&{data:B},customLayout:i,layoutConfig:a,onLayoutError:r,...M&&{layoutSelection:M},xExtent:l,yExtent:n,colorAccessor:A,colorScheme:w,size:[T,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:F.margin,showAxes:s,xLabel:$,yLabel:Q,enableHover:E,showGrid:j,...F.legendBehaviorProps,...ke({title:z,description:G,summary:V,accessibleTable:X,className:h,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...W,...Ce({linkedHover:y,selection:p,onObservation:d,onClick:u,hoverRadius:e.hoverRadius,hoverHighlight:f,mobileInteraction:F.mobileInteraction,customHoverBehavior:F.customHoverBehavior,customClickBehavior:F.customClickBehavior}),...m&&m.length>0&&{annotations:m},...F.crosshairProps,..._};/* @__PURE__ */
|
|
33
|
+
return Xt(Ye,{componentName:"XYCustomChart",width:T,height:O,children:/* @__PURE__ */Xt(he,{ref:I,...K})})});$t.displayName="XYCustomChart";import{forwardRef as Qt,useMemo as Kt}from"react";import{useCallback as Yt,useMemo as qt}from"react";import{jsx as Jt,jsxs as Ut}from"react/jsx-runtime";import{jsx as Zt}from"react/jsx-runtime";import{jsx as eo}from"react/jsx-runtime";var to=Qt(function(e,t){let o=Be(),i=kt(),{data:s,xAccessor:c,yAccessor:h,lineBy:m,rankDirection:d="descending",ribbon:u=!1,curve:p="smooth",ribbonSizeRange:y=[4,28],samplesPerSegment:f=12,lineWidth:b=3,highlightTop:x,neutralColor:v,styleRules:A,labelStyle:w,colorScheme:S,ribbonOpacity:k=.82,lineOpacity:C=.9,showPoints:R=!1,pointRadius:L=3,showLabels:_=!0,labelPriorityAccessor:H,maxLabels:I,showAxes:P=!0,showGrid:B=!0,showLegend:F=!1,enableHover:D=!0,hoverHighlight:N=!0,tooltip:M,frameProps:W={},xFormat:T,yFormat:O,onClick:E}=e,j=Kt(()=>l(s,{xAccessor:c,yAccessor:h,lineBy:m,rankDirection:d,highlightTop:x}),[s,c,h,m,d,x]),{axes:z,areaStyle:G,pointStyle:V,...X}=W,$=Kt(()=>r({seriesOrder:j.seriesOrder,overallOrder:j.overallOrder,highlightTop:x,color:e.color,colorScheme:S,neutralColor:v,themeCategorical:o,themeNeutral:i.colors.textSecondary}),[j.seriesOrder,j.overallOrder,x,e.color,S,v,o,i.colors.textSecondary]),Q=Kt(()=>({ribbon:u,curve:p,samplesPerSegment:f,ribbonSizeRange:y,valueExtent:j.valueExtent,seriesOrder:j.seriesOrder,lineWidth:b,ribbonOpacity:k,lineOpacity:C,neutralColor:v,color:e.color,colorMap:$&&"object"==typeof $&&!Array.isArray($)?$:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,styleRules:A,areaStyle:G,pointStyle:V,labelStyle:w,showPoints:R,pointRadius:L,showLabels:_,labelPriorityAccessor:H,maxLabels:I}),[u,p,f,y,j.valueExtent,j.seriesOrder,b,k,C,v,$,e.color,e.stroke,e.strokeWidth,e.opacity,A,G,V,w,R,L,_,H,I]),{tooltip:K,formatX:Y}=n({tooltip:M,xValues:j.xValues,xFormat:T,yFormat:O}),q=Kt(()=>{if(E)return(e,t)=>{E(e.__bumpRaw??e,t)}},[E]),J=Math.max(1,j.seriesOrder.length),U=j.xValues.map((e,t)=>t),Z=Array.from({length:J},(e,t)=>t+1),ee=z??[{orient:"left",tickValues:Z,tickFormat:e=>e+"",label:e.yLabel??"Rank",baseline:!1},{orient:"bottom",tickValues:U,tickFormat:Y,label:e.xLabel,tickAnchor:"edges"}],te=Kt(()=>a(e.annotations,j.xValues),[e.annotations,j.xValues]);/* @__PURE__ */
|
|
34
|
+
return eo($t,{ref:t,data:j.data,layout:g,layoutConfig:Q,xExtent:[0,Math.max(1,j.xValues.length-1)],yExtent:[J+.5,.5],showAxes:P,showGrid:B,showLegend:F,enableHover:D,hoverHighlight:N,colorBy:"__bumpSeries",colorScheme:$,tooltip:K,onClick:q,hoverRadius:e.hoverRadius,width:e.width,height:e.height,responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,responsiveRules:e.responsiveRules,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,mode:e.mode,margin:e.margin??{top:20,right:_?110:24,bottom:48,left:48},className:e.className,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,selection:e.selection,linkedHover:e.linkedHover,legend:e.legend,legendInteraction:e.legendInteraction,legendPosition:e.legendPosition,onObservation:e.onObservation,chartId:e.chartId,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,animate:e.animate,autoPlaceAnnotations:e.autoPlaceAnnotations,annotations:te,xLabel:e.xLabel,yLabel:e.yLabel??"Rank",frameProps:{axes:ee,axisExtent:"exact",...X}})});to.displayName="BumpChart";import{useMemo as oo,forwardRef as io,useRef as ao}from"react";import{useMemo as ro}from"react";import{jsx as lo}from"react/jsx-runtime";de(pe);var no=io(function(e,t){let o=ao(null);Z(t,{variant:"xy",frameRef:o});let i=Te(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:l,xFormat:n,yFormat:s,xAccessor:c="x",yAccessor:h="y",areaBy:m,y0Accessor:d,gradientFill:u=!1,semanticGradient:p,semanticLine:y=!0,lineDataAccessor:f="coordinates",colorBy:g,colorScheme:b,styleRules:v,curve:A="monotoneX",areaOpacity:w=.7,lineGradient:S,showLine:k=!0,lineWidth:C=2,showPoints:R=!1,pointRadius:L=3,tooltip:_,annotations:H,forecast:I,anomaly:P,band:B,xExtent:F,yExtent:D,frameProps:N={},selection:M,linkedHover:W,onObservation:T,onClick:O,hoverHighlight:E,chartId:j,loading:z,loadingContent:G,emptyContent:X,legendInteraction:$,legendPosition:Q,color:K,stroke:Y,strokeWidth:J,opacity:ee}=e,{width:te,height:oe,enableHover:ie,showGrid:ae,showLegend:re,title:le,description:ne,summary:se,accessibleTable:ce,xLabel:me,yLabel:de}=i,ue=oo(()=>qe(a),[a]),pe=g||m,ye=oo(()=>be(p),[p]),Ae=oo(()=>ye?.stops.length?ve(ye):fe(u),[ye,u]),we=oo(()=>ge(S),[S]),Se=oo(()=>y?xe(ye):void 0,[ye,y]);Ze("AreaChart",ue,"xAccessor",c),Ze("AreaChart",ue,"yAccessor",h);let Re=U({data:ue,rawData:a,colorBy:pe,colorScheme:b,legendInteraction:$,legendPosition:Q,frameLegend:N,selection:M,linkedHover:W,fallbackFields:pe?["string"==typeof pe?pe:""]:[],unwrapData:!1,onObservation:T,onClick:O,hoverHighlight:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"AreaChart",chartId:j,showLegend:re,userMargin:r,marginDefaults:i.marginDefaults,loading:z,loadingContent:G,emptyContent:X,width:te,height:oe,hasTitle:!!le,axisChrome:dt(N,{showAxes:i.showAxes,xLabel:me,yLabel:de})}),{effectiveData:Le,statisticalAnnotations:_e}=V({data:ue,xAccessor:c,yAccessor:h,forecast:I,anomaly:P,groupBy:m}),He=oo(()=>Ee(c,h),[c,h]),{flattenedData:Ie,lineStyle:Pe,pointStyle:Be,defaultTooltipContent:Fe}=x({safeData:Le,data:a,areaBy:m,lineDataAccessor:f,colorBy:pe,colorScale:Re.colorScale,color:K,stroke:Y,strokeWidth:J,opacity:ee,effectiveSelectionHook:Re.effectiveSelectionHook,resolvedSelection:Re.resolvedSelection,areaOpacity:w,showLine:k,lineWidth:C,showPoints:R,pointRadius:L,xAccessor:c,yAccessor:h,xLabel:me,yLabel:de,xFormat:n,yFormat:s,groupField:m||g,band:B,styleRules:v,ruleContext:He}),De=q({componentName:"AreaChart",data:a,accessors:{xAccessor:c,yAccessor:h}}),Ne={chartType:"area",...null!=a&&{data:Ie},xAccessor:c,yAccessor:h,groupAccessor:m||void 0,...d&&{y0Accessor:d},...B&&{band:B},...Ae&&{gradientFill:Ae},...we&&{lineGradient:we},...Se&&{semanticLineStops:Se},curve:A,lineStyle:Pe,...R&&Be&&{pointStyle:Be},size:[te,oe],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Re.margin,showAxes:i.showAxes,xLabel:me,yLabel:de,xFormat:n,yFormat:s,enableHover:ie,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:ae,...Re.legendBehaviorProps,...ke({title:le,description:ne,summary:se,accessibleTable:ce,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ge({tooltip:_,defaultTooltipContent:Fe,multiDefaultContent:$e()}),...Ce({linkedHover:W,selection:M,onObservation:T,onClick:O,hoverHighlight:E,hoverRadius:e.hoverRadius,mobileInteraction:Re.mobileInteraction,customHoverBehavior:Re.customHoverBehavior,customClickBehavior:Re.customClickBehavior}),...(H&&H.length>0||_e.length>0)&&{annotations:[...H||[],..._e]},...F&&{xExtent:F},...D&&{yExtent:D},...Re.crosshairProps,...N};return Re.earlyReturn?Re.earlyReturn:De?/* @__PURE__ */lo(Ke,{componentName:"AreaChart",message:De,width:te,height:oe}):/* @__PURE__ */lo(Ye,{componentName:"AreaChart",width:te,height:oe,children:/* @__PURE__ */lo(he,{ref:o,...Ne})})});no.displayName="AreaChart";import{useMemo as so,forwardRef as co,useRef as ho,useState as mo,useImperativeHandle as uo,useCallback as po}from"react";import{jsx as yo,jsxs as fo}from"react/jsx-runtime";de(ye);var go=co(function(e,t){let o=ho(null),i=Te(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:l,xFormat:n,yFormat:s,xAccessor:c="x",seriesAAccessor:h="a",seriesBAccessor:m="b",seriesALabel:d="A",seriesBLabel:u="B",seriesAColor:p="var(--semiotic-danger, #dc2626)",seriesBColor:y="var(--semiotic-info, #2563eb)",showLines:f=!0,lineWidth:g=1.5,showPoints:b=!1,pointRadius:x=3,curve:A="linear",areaOpacity:w=.6,gradientFill:_,styleRules:H,tooltip:I,annotations:P,xExtent:B,yExtent:F,frameProps:D={},selection:N,linkedHover:M,onObservation:W,onClick:T,hoverHighlight:O,chartId:E,loading:j,loadingContent:z,emptyContent:G,legendInteraction:V,legendPosition:X,pointIdAccessor:$,windowSize:Q}=e,{width:K,height:Y,enableHover:q,showGrid:J,showLegend:Z,title:ee,description:te,summary:oe,accessibleTable:ie,xLabel:ae,yLabel:re}=i,le=so(()=>"function"==typeof c?e=>R(c(e)):e=>R(e[c]),[c]),ne=so(()=>"function"==typeof h?e=>R(h(e)):e=>R(e[h]),[h]),se=so(()=>"function"==typeof m?e=>R(m(e)):e=>R(e[m]),[m]),[ce,me]=mo([]),de=ho([]),ue=null==a,pe=so(()=>qe(ue?ce:a),[ue,ce,a]),ye=so(()=>v(pe,le,ne,se),[pe,le,ne,se]),ge=so(()=>f?L(pe,le,ne,se):[],[f,pe,le,ne,se]),be=so(()=>[...ye,...ge],[ye,ge]),xe=so(()=>{let e=/* @__PURE__ */new Set;for(let t of ye)e.add(t.__diffSegment);return Array.from(e)},[ye]);uo(t,()=>{let e=e=>{let t=Q&&e.length>Q?e.slice(e.length-Q):e;de.current=t,me(t)},t=$?"function"==typeof $?$:e=>e[$]:null;return{push:t=>e([...de.current,t]),pushMany:t=>e([...de.current,...t]),remove:o=>{if(!t)return[];let i=Array.isArray(o)?o:[o],a=[],r=[];for(let e of de.current)i.includes(t(e))?a.push(e):r.push(e);return e(r),a},update:(o,i)=>{if(!t)return[];let a=Array.isArray(o)?o:[o],r=[],l=de.current.map(e=>{if(a.includes(t(e))){let t=i(e);return r.push(t),t}return e});return e(l),r},clear:()=>e([]),getData:()=>ue?de.current:pe,getScales:()=>o.current?.getScales()??null}},[ue,pe,$,Q]);let ve=so(()=>!1===Z?void 0:{legendGroups:[{label:"",type:"fill",styleFn:e=>({fill:e.color||"currentColor"}),items:[{label:d,color:p},{label:u,color:y}]}]},[Z,d,u,p,y]),Ae=Object.hasOwn(D,"legend")?D:{...D,legend:ve},we=U({data:pe,rawData:a,colorBy:"__diffWinner",colorScheme:[p,y],legendInteraction:V,legendPosition:X,frameLegend:Ae,selection:N,linkedHover:M,fallbackFields:["__diffWinner"],unwrapData:!1,onObservation:W,onClick:T,hoverHighlight:O,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DifferenceChart",chartId:E,showLegend:Z,userMargin:r,marginDefaults:i.marginDefaults,loading:j,loadingContent:z,emptyContent:G,width:K,height:Y,hasTitle:!!ee,axisChrome:dt(D,{showAxes:i.showAxes,xLabel:ae,yLabel:re})}),Se=so(()=>S({seriesAColor:p,seriesBColor:y,areaOpacity:w,styleRules:H}),[p,y,w,H]),Re=so(()=>k({seriesAColor:p,seriesBColor:y,lineWidth:g,styleRules:H}),[p,y,g,H]),Le=so(()=>C({seriesAColor:p,seriesBColor:y,pointRadius:x,styleRules:H}),[p,y,x,H]),[_e,He,Ie]=so(()=>[Se,Re,Le].map(e=>tt(e,we.effectiveSelectionHook,we.resolvedSelection)),[Se,Re,Le,we.effectiveSelectionHook,we.resolvedSelection]),Pe=po(e=>{let t=e.data,o=e.allSeries,i=e.xValue??t?.__x,a=t?.__valA,r=t?.__valB;if(o&&o.length>0){let e=o.find(e=>"line-A"===e.group),t=o.find(e=>"line-B"===e.group);null!=e?.value&&Number.isFinite(e.value)&&(a=e.value),null!=t?.value&&Number.isFinite(t.value)&&(r=t.value)}if(null!=i&&(null==a||null==r)){let e=pe.find(e=>le(e)===i);e&&(null==a&&(a=ne(e)),null==r&&(r=se(e)))}let l=e=>null!=e&&Number.isFinite(e)?""+Math.round(100*e)/100:"—",s=n&&null!=i?n(i):null!=i?i+"":"";/* @__PURE__ */
|
|
35
|
+
return fo("div",{className:"semiotic-tooltip",style:ht,children:[s&&/* @__PURE__ */yo("div",{style:{fontWeight:600,marginBottom:4},children:s}),
|
|
36
|
+
/* @__PURE__ */fo("div",{style:{display:"flex",alignItems:"center",gap:6},children:[
|
|
37
|
+
/* @__PURE__ */yo("span",{style:{width:10,height:10,background:p,display:"inline-block",borderRadius:2}}),
|
|
38
|
+
/* @__PURE__ */fo("span",{children:[d,": ",l(a)]})]}),
|
|
39
|
+
/* @__PURE__ */fo("div",{style:{display:"flex",alignItems:"center",gap:6},children:[
|
|
40
|
+
/* @__PURE__ */yo("span",{style:{width:10,height:10,background:y,display:"inline-block",borderRadius:2}}),
|
|
41
|
+
/* @__PURE__ */fo("span",{children:[u,": ",l(r)]})]}),null!=a&&null!=r&&Number.isFinite(a)&&Number.isFinite(r)&&/* @__PURE__ */fo("div",{style:{marginTop:4,opacity:.7},children:["Δ = ",l(a-r)]})]})},[pe,le,ne,se,n,p,y,d,u]),{tooltipContent:Be,tooltipMode:Fe}=so(()=>Ge({tooltip:I,defaultTooltipContent:Pe,multiDefaultContent:Pe}),[I,Pe]),De=so(()=>fe(_,{stops:[{offset:0,opacity:.85},{offset:1,opacity:.15}]}),[_]);if(we.earlyReturn)return we.earlyReturn;let Ne={chartType:"mixed",data:be,xAccessor:"__x",yAccessor:"__y",y0Accessor:"__y0",groupAccessor:"__diffSegment",areaGroups:xe,curve:A,areaStyle:_e,lineStyle:He,...b&&{pointStyle:Ie},size:[K,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:we.margin,showAxes:i.showAxes,xLabel:ae,yLabel:re,xFormat:n,yFormat:s,enableHover:q,showGrid:J,...De&&{gradientFill:De},...we.legendBehaviorProps,...ke({title:ee,description:te,summary:oe,accessibleTable:ie,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),tooltipContent:Be,..."multi"===Fe&&{tooltipMode:"multi"},...Ce({linkedHover:M,selection:N,onObservation:W,onClick:T,hoverHighlight:O,hoverRadius:e.hoverRadius,mobileInteraction:we.mobileInteraction,customHoverBehavior:we.customHoverBehavior,customClickBehavior:we.customClickBehavior}),...P&&P.length>0&&{annotations:P},...B&&{xExtent:B},...F&&{yExtent:F},...we.crosshairProps,...D};/* @__PURE__ */
|
|
42
|
+
return yo(Ye,{componentName:"DifferenceChart",width:K,height:Y,children:/* @__PURE__ */yo(he,{ref:o,...Ne})})});"function"==typeof go&&(go.displayName="DifferenceChart");import{useMemo as bo,forwardRef as xo,useRef as vo}from"react";import{jsx as Ao}from"react/jsx-runtime";de(te);var wo=xo(function(e,t){let o=vo(null),i=Te(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:l,xFormat:n,yFormat:s,xAccessor:c="x",yAccessor:h="y",areaBy:m,lineDataAccessor:d="coordinates",colorBy:u,colorScheme:p,styleRules:y,curve:f="monotoneX",areaOpacity:g=.7,showLine:b=!0,lineWidth:v=2,showPoints:A=!1,pointRadius:w=3,normalize:S=!1,baseline:k="zero",stackOrder:C,tooltip:R,annotations:L,xExtent:_,yExtent:H,frameProps:I={},selection:P,linkedHover:B,onObservation:F,onClick:D,hoverHighlight:N,chartId:M,loading:W,loadingContent:T,emptyContent:O,legendInteraction:E,legendPosition:j,color:z,stroke:G,strokeWidth:V,opacity:X}=e,{width:$,height:Q,enableHover:K,showGrid:Y,showLegend:J,title:ee,description:te,summary:oe,accessibleTable:ie,xLabel:ae,yLabel:re}=i,le=bo(()=>qe(a),[a]),ne=u||m;Z(t,{variant:"xy",frameRef:o});let se=U({data:le,rawData:a,colorBy:ne,colorScheme:p,legendInteraction:E,legendPosition:j,frameLegend:I,selection:P,linkedHover:B,fallbackFields:ne?["string"==typeof ne?ne:""]:[],unwrapData:!1,onObservation:F,onClick:D,hoverHighlight:N,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"StackedAreaChart",chartId:M,showLegend:J,userMargin:r,marginDefaults:i.marginDefaults,loading:W,loadingContent:T,emptyContent:O,width:$,height:Q,hasTitle:!!ee,axisChrome:dt(I,{showAxes:i.showAxes,xLabel:ae,yLabel:re})}),ce=bo(()=>Ee(c,h),[c,h]),{flattenedData:me,lineStyle:de,pointStyle:ue,defaultTooltipContent:pe}=x({safeData:le,data:a,areaBy:m,lineDataAccessor:d,colorBy:ne,colorScale:se.colorScale,color:z,stroke:G,strokeWidth:V,opacity:X,effectiveSelectionHook:se.effectiveSelectionHook,resolvedSelection:se.resolvedSelection,areaOpacity:g,showLine:b,lineWidth:v,showPoints:A,pointRadius:w,xAccessor:c,yAccessor:h,xLabel:ae,yLabel:re,xFormat:n,yFormat:s,groupField:m||u,styleRules:y,ruleContext:ce}),ye=q({componentName:"StackedAreaChart",data:a,accessors:{xAccessor:c,yAccessor:h}}),fe={chartType:"stackedarea",...null!=a&&{data:me},xAccessor:c,yAccessor:h,groupAccessor:m||void 0,curve:f,normalize:S,baseline:S?"zero":k,stackOrder:C,lineStyle:de,...A&&ue&&{pointStyle:ue},size:[$,Q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:se.margin,showAxes:i.showAxes,xLabel:ae,yLabel:re,xFormat:n,yFormat:s,enableHover:K,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:Y,...se.legendBehaviorProps,...ke({title:ee,description:te,summary:oe,accessibleTable:ie,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Ge({tooltip:R,defaultTooltipContent:pe,multiDefaultContent:$e()}),...Ce({linkedHover:B,selection:P,onObservation:F,onClick:D,hoverHighlight:N,hoverRadius:e.hoverRadius,mobileInteraction:se.mobileInteraction,customHoverBehavior:se.customHoverBehavior,customClickBehavior:se.customClickBehavior}),...L&&L.length>0&&{annotations:L},..._&&{xExtent:_},...H&&{yExtent:H},...se.crosshairProps,...I};return se.earlyReturn?se.earlyReturn:ye?/* @__PURE__ */Ao(Ke,{componentName:"StackedAreaChart",message:ye,width:$,height:Q}):/* @__PURE__ */Ao(Ye,{componentName:"StackedAreaChart",width:$,height:Q,children:/* @__PURE__ */Ao(he,{ref:o,...fe})})});wo.displayName="StackedAreaChart";import{useMemo as So,forwardRef as ko,useRef as Co}from"react";import{scaleSequential as Ro}from"d3-scale";import{jsx as Lo}from"react/jsx-runtime";de(ae);var _o=ko(function(e,t){let o=Co(null);Z(t,{variant:"xy",frameRef:o});let i=Te(e.mode,{width:e.width,height:e.height,showGrid:void 0,enableHover:e.enableHover,showLegend:void 0,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:l,xAccessor:n="x",yAccessor:s="y",valueAccessor:c="value",xFormat:h,yFormat:m,colorScheme:d,customColorScale:u,showValues:p=!1,valueFormat:y,cellBorderColor:f="#fff",cellBorderWidth:g=1,tooltip:b,annotations:x,heatmapAggregation:v,heatmapXBins:A,heatmapYBins:w,styleRules:S,xExtent:k,yExtent:C,frameProps:R={},selection:L,linkedHover:_,onObservation:H,onClick:I,hoverHighlight:P,chartId:B,loading:F,loadingContent:D,emptyContent:N,showLegend:M,legendPosition:W,legend:T,legendInteraction:O}=e,{width:E,height:j,enableHover:z,title:G,description:V,summary:X,accessibleTable:$,xLabel:Q,yLabel:K}=i,Y=Ue(F,E,j,D),U=Y?null:Je(a,E,j,N),te=So(()=>qe(a),[a]),oe=Fe(),ie=("string"==typeof R.colorScheme?R.colorScheme:void 0)??d??oe??"blues",ae="function"==typeof R.heatmapColorScale?R.heatmapColorScale:"custom"===ie&&"function"==typeof u?u:void 0,re=M??!1,le=W??"right",{activeSelectionHook:ne,customHoverBehavior:se,customClickBehavior:ce,crosshairSourceId:me}=Me({selection:L,linkedHover:_,fallbackFields:[],onObservation:H,onClick:I,chartType:"Heatmap",chartId:B,hoverHighlight:P,colorByField:void 0,mobileInteraction:i.mobileInteraction}),de=J(L),ue=We(_,me);Pe(O,void 0,[]);let pe=So(()=>"function"==typeof c?e=>c(e):e=>e[c],[c]),ye=So(()=>{let e=te.map(pe);return Ct(e)},[te,pe]),fe=So(()=>{if(ae)return ae;let e=yt(ie);return Ro(e).domain(ye)},[ie,ae,ye]),ge=So(()=>{let e=Number.isFinite(g)?Math.max(0,g):1;return()=>({stroke:f,strokeWidth:e})},[f,g]),be=So(()=>ee(n,s,c),[n,s,c]),xe=So(()=>Xe(ge,S,be),[ge,S,be]),ve=So(()=>tt(xe,ne,de),[ne,xe,de]),we=So(()=>Se([{label:Q||Ae(n),accessor:n,role:"x",format:h},{label:K||Ae(s),accessor:s,role:"y",format:m},{label:Ae(c),accessor:c,role:"value",format:y}]),[n,s,Q,K,c,h,m,y]),Le=q({componentName:"Heatmap",data:a,accessors:{xAccessor:n,yAccessor:s,valueAccessor:c}}),_e=So(()=>re?{gradient:{colorFn:e=>fe(e),domain:ye,label:"string"==typeof c?c:"value",format:y},legendDistance:T?.legendDistance}:void 0,[re,fe,ye,c,y,T?.legendDistance]),{margin:Ie,legend:Be,legendPosition:De,legendMarginReserved:Ne}=He({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:le,userMargin:r,defaults:i.marginDefaults,additionalLegend:_e,chartWidth:E,chartHeight:j,legendLayout:R.legendLayout,frameLegend:R,hasTitle:!!G,axisChrome:dt(R,{showAxes:i.showAxes,xLabel:Q,yLabel:K})}),Oe={chartType:"heatmap",...null!=a&&{data:te},xAccessor:n,yAccessor:s,valueAccessor:c,colorScheme:"custom"!==ie?ie:void 0,...ae&&{heatmapColorScale:ae},areaStyle:ve,showValues:p,heatmapValueFormat:y,size:[E,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Ie,showAxes:i.showAxes,xLabel:Q,yLabel:K,xFormat:h,yFormat:m,enableHover:z,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...Be&&{legend:Be,legendPosition:De},...Ne&&{__legendMarginReservedFor:Be},...ke({title:G,description:V,summary:X,accessibleTable:$,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Re({tooltip:b,defaultTooltipContent:we}),...Ce({linkedHover:_,selection:L,onObservation:H,onClick:I,hoverHighlight:P,hoverRadius:e.hoverRadius,mobileInteraction:i.mobileInteraction,customHoverBehavior:se,customClickBehavior:ce}),...x&&x.length>0&&{annotations:x},...v&&{heatmapAggregation:v},...null!=A&&{heatmapXBins:A},...null!=w&&{heatmapYBins:w},...k&&{xExtent:k},...C&&{yExtent:C},...ue,...R};return Y||U||(Le?/* @__PURE__ */Lo(Ke,{componentName:"Heatmap",message:Le,width:E,height:j}):/* @__PURE__ */Lo(Ye,{componentName:"Heatmap",width:E,height:j,children:/* @__PURE__ */Lo(he,{ref:o,...Oe})}))});_o.displayName="Heatmap";import{useMemo as Ho,useCallback as Io,forwardRef as Po,useRef as Bo}from"react";import{jsx as Fo}from"react/jsx-runtime";se(z),de(ie);var Do=Po(function(t,o){let i=Bo(null),a=Te(t.mode,{width:t.width,height:t.height,showGrid:t.showGrid,enableHover:t.enableHover,showLegend:t.showLegend,title:t.title,xLabel:t.xLabel,yLabel:t.yLabel,mobileInteraction:t.mobileInteraction,mobileSemantics:t.mobileSemantics,responsiveRules:t.responsiveRules}),{data:r,margin:l,className:n,xFormat:s,yFormat:c,xAccessor:h="x",yAccessor:m="y",sizeBy:d,sizeRange:u=[5,40],colorBy:p,colorScheme:y,styleRules:f,bubbleOpacity:g=.6,bubbleStrokeWidth:b=1,bubbleStrokeColor:x="white",tooltip:v,marginalGraphics:A,pointIdAccessor:w,annotations:S,regression:k,xExtent:C,yExtent:R,pulse:L,decay:_,staleness:H,frameProps:I={},selection:P,linkedHover:B,linkedBrush:F,brush:D,onBrush:N,onObservation:M,onClick:W,hoverHighlight:T,chartId:O,loading:E,loadingContent:j,emptyContent:z,legendInteraction:V,legendPosition:X,color:$,stroke:K,strokeWidth:Y,opacity:J}=t,{width:ee,height:te,enableHover:oe,showGrid:ie,showLegend:ae,title:re,description:le,summary:ne,accessibleTable:se,xLabel:ce,yLabel:de}=a,ue=Ho(()=>qe(r),[r]),pe=void 0===r,ye=U({data:ue,rawData:r,colorBy:p,colorScheme:y,legendInteraction:V,legendPosition:X,frameLegend:I,selection:P,linkedHover:B,fallbackFields:p?["string"==typeof p?p:""]:[],unwrapData:!1,onObservation:M,onClick:W,hoverHighlight:T,mobileInteraction:a.mobileInteraction,mobileSemantics:a.mobileSemantics,chartType:"BubbleChart",chartId:O,showLegend:ae,userMargin:l,marginDefaults:a.marginDefaults,loading:E,loadingContent:j,emptyContent:z,width:ee,height:te,hasTitle:!!re,axisChrome:dt(I,{showAxes:a.showAxes,xLabel:ce,yLabel:de})}),{domain:fe,trackPushed:ge,reset:be}=e({accessor:d,data:ue,isPushMode:pe}),xe=Io(e=>{ge([e]),i.current?.push(e)},[ge]),ve=Io(e=>{ge(e),i.current?.pushMany(e)},[ge]);Z(o,{variant:"xy",frameRef:i,overrides:{push:xe,pushMany:ve,clear:()=>{be(),i.current?.clear()}}});let{brushStreamProps:we}=me({brush:D,onBrush:N,linkedBrush:F,xAccessor:h,yAccessor:m,defaultDimension:"xy"}),Le=Ho(()=>({stroke:x,strokeWidth:b}),[x,b]),_e=Ho(()=>fe??[0,1],[fe]),He=Io(e=>At(e,d,u,_e),[d,u,_e]),Ie=Ho(()=>Ee(h,m),[h,m]),Pe=G({colorBy:p,colorScale:ye.colorScale,color:$,fillOpacity:g,radiusFn:He,baseStyleExtras:Le,stroke:K,strokeWidth:Y,opacity:J,styleRules:f,ruleContext:Ie,effectiveSelectionHook:ye.effectiveSelectionHook,resolvedSelection:ye.resolvedSelection}),Be=Ho(()=>Se([{label:ce||Ae(h),accessor:h,role:"x",format:s},{label:de||Ae(m),accessor:m,role:"y",format:c},{label:Ae(d),accessor:d,role:"size"},...p?[{label:Ae(p),accessor:p,role:"color"}]:[]]),[h,m,ce,de,d,p,s,c]);if(ye.earlyReturn)return ye.earlyReturn;let Fe=q({componentName:"BubbleChart",data:r,accessors:{xAccessor:h,yAccessor:m},requiredProps:{sizeBy:d}});if(Fe)/* @__PURE__ */return Fo(Ke,{componentName:"BubbleChart",message:Fe,width:ee,height:te});let De=Q(k),Ne=De?[De,...S||[]]:S,Me={chartType:"bubble",...null!=r&&{data:ue},xAccessor:h,yAccessor:m,colorAccessor:p||void 0,sizeAccessor:d,sizeRange:u,pointStyle:Pe,colorScheme:y,size:[ee,te],responsiveWidth:t.responsiveWidth,responsiveHeight:t.responsiveHeight,margin:ye.margin,showAxes:a.showAxes,xLabel:ce,yLabel:de,xFormat:s,yFormat:c,enableHover:oe,showGrid:ie,...ye.legendBehaviorProps,...ke({title:re,description:le,summary:ne,accessibleTable:se,className:n,animate:t.animate,maxDevicePixelRatio:t.maxDevicePixelRatio,axisExtent:t.axisExtent,autoPlaceAnnotations:t.autoPlaceAnnotations}),...Re({tooltip:v,defaultTooltipContent:Be}),...Ce({linkedHover:B,selection:P,onObservation:M,onClick:W,hoverHighlight:T,hoverRadius:t.hoverRadius,mobileInteraction:ye.mobileInteraction,customHoverBehavior:ye.customHoverBehavior,customClickBehavior:ye.customClickBehavior}),...A&&{marginalGraphics:A},...w&&{pointIdAccessor:w},...L&&{pulse:L},..._&&{decay:_},...H&&{staleness:H},...Ne&&Ne.length>0&&{annotations:Ne},...C&&{xExtent:C},...R&&{yExtent:R},...ye.crosshairProps,...we,...I};/* @__PURE__ */
|
|
43
|
+
return Fo(Ye,{componentName:"BubbleChart",width:ee,height:te,children:/* @__PURE__ */Fo(he,{ref:i,...Me})})});Do.displayName="BubbleChart";import*as No from"react";import{useMemo as Mo,useCallback as Wo,useState as To}from"react";import{useMemo as Oo,useCallback as Eo,useRef as jo}from"react";import*as zo from"react";import{jsx as Go}from"react/jsx-runtime";var Vo=null,Xo=null;import{jsx as $o,jsxs as Qo}from"react/jsx-runtime";de(oe);var Ko="__splomIdx",Yo={top:4,bottom:4,left:4,right:4};import{jsx as qo,jsxs as Jo}from"react/jsx-runtime";F.displayName="ScatterplotMatrix";import{useState as Uo,useRef as Zo,useEffect as ei,useMemo as ti,useCallback as oi}from"react";import*as ii from"react";import{jsx as ai}from"react/jsx-runtime";var ri=null,li=null;import{jsx as ni,jsxs as si}from"react/jsx-runtime";X(),N.displayName="MinimapChart";import{useMemo as ci,forwardRef as hi,useRef as mi}from"react";var di={topLeft:{label:"Low / High",color:"#E9C46A",opacity:.08},topRight:{label:"High / High",color:"#2A9D8F",opacity:.08},bottomLeft:{label:"Low / Low",color:"#E76F51",opacity:.08},bottomRight:{label:"High / Low",color:"#86BBD8",opacity:.08}};import{Fragment as ui,jsx as pi,jsxs as yi}from"react/jsx-runtime";de(oe);var fi=hi(function(e,t){let o=mi(null);Z(t,{variant:"xy",frameRef:o});let i=Te(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:l,xFormat:n,yFormat:s,xAccessor:c="x",yAccessor:h="y",xCenter:m,yCenter:d,quadrants:u,centerlineStyle:p={},showQuadrantLabels:y=!0,quadrantLabelSize:f=12,colorBy:g,colorScheme:b,styleRules:x,sizeBy:v,sizeRange:A=[3,15],pointRadius:w=5,pointOpacity:S=.8,tooltip:k,pointIdAccessor:C,annotations:R,frameProps:L={},selection:_,linkedHover:H,onObservation:I,onClick:P,hoverHighlight:B,chartId:F,loading:D,loadingContent:N,emptyContent:W,legendInteraction:T,legendPosition:O,color:E,stroke:j,strokeWidth:z,opacity:V}=e,{width:X,height:$,enableHover:Q,showGrid:K,showLegend:Y,title:J,description:ee,summary:te,accessibleTable:oe,xLabel:ie,yLabel:ae}=i,re=ci(()=>({topLeft:M(di.topLeft,u?.topLeft),topRight:M(di.topRight,u?.topRight),bottomLeft:M(di.bottomLeft,u?.bottomLeft),bottomRight:M(di.bottomRight,u?.bottomRight)}),[u]),le=ci(()=>qe(a),[a]),ne=U({data:le,rawData:a,colorBy:g,colorScheme:b,legendInteraction:T,legendPosition:O,frameLegend:L,selection:_,linkedHover:H,fallbackFields:"string"==typeof g?[g]:[],unwrapData:!1,onObservation:I,onClick:P,hoverHighlight:B,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"QuadrantChart",chartId:F,showLegend:Y,userMargin:r,marginDefaults:i.marginDefaults,loading:D,loadingContent:N,emptyContent:W,width:X,height:$,hasTitle:!!J,axisChrome:dt(L,{showAxes:i.showAxes,xLabel:ie,yLabel:ae})});Ze("QuadrantChart",le,"xAccessor",c),Ze("QuadrantChart",le,"yAccessor",h);let se=ci(()=>{if(!le.length)return;let e="function"==typeof c?c:e=>+e[c],t="function"==typeof h?h:e=>+e[h],o=1/0,i=-1/0,a=1/0,r=-1/0;for(let l of le){let n=e(l),s=t(l);isFinite(n)&&(o>n&&(o=n),n>i&&(i=n)),isFinite(s)&&(a>s&&(a=s),s>r&&(r=s))}if(null!=m&&isFinite(m)&&(o>m&&(o=m),m>i&&(i=m)),null!=d&&isFinite(d)&&(a>d&&(a=d),d>r&&(r=d)),o===1/0)return;let l=.1*(i-o)||1,n=.1*(r-a)||1;return{xExtent:[o-l,i+l],yExtent:[a-n,r+n]}},[le,c,h,m,d]),ce=ci(()=>{if(!v||0===le.length)return;let e=le.map(e=>"function"==typeof v?v(e):e[v]).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0!==e.length?Ct(e):void 0},[le,v]),me=ci(()=>"function"==typeof c?c:e=>+e[c],[c]),de=ci(()=>"function"==typeof h?h:e=>+e[h],[h]),ue=ci(()=>e=>{let t=me(e),o=de(e),i=null!=m?t>=m:void 0,a=null!=d?o>=d:void 0;return void 0===a||void 0===i?E||gt:a&&i?re.topRight.color:a&&!i?re.topLeft.color:!a&&i?re.bottomRight.color:re.bottomLeft.color},[me,de,m,d,re,E]),pe=ci(()=>v?e=>At(e,v,A,ce):void 0,[v,A,ce]),ye=ci(()=>Ee(c,h),[c,h]),fe=G({colorBy:g,colorScale:ne.colorScale,color:E,pointRadius:w,fillOpacity:S,radiusFn:pe,fallbackFill:ue,stroke:j,strokeWidth:z,opacity:V,styleRules:x,ruleContext:ye,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection}),ge=ci(()=>{if(!le.length)return;let e=/* @__PURE__ */new Set;"string"==typeof c&&e.add(c),"string"==typeof h&&e.add(h),"string"==typeof g&&e.add(g),"string"==typeof v&&e.add(v);let t=le[0];for(let o of Object.keys(t))if(!o.startsWith("_")&&!e.has(o)&&"string"==typeof t[o])return o},[le,c,h,g,v]),be=ci(()=>Se([...ge?[{label:ge,accessor:ge,role:"title"}]:[],{label:ie||Ae(c),accessor:c,role:"x",format:n},{label:ae||Ae(h),accessor:h,role:"y",format:s},...g?[{label:Ae(g),accessor:g,role:"color"}]:[],...v?[{label:Ae(v),accessor:v,role:"size"}]:[]]),[ge,c,h,ie,ae,g,v,n,s]),xe=q({componentName:"QuadrantChart",data:a,accessors:{xAccessor:c,yAccessor:h}}),ve=ci(()=>{let e={stroke:p.stroke||"#999",strokeWidth:p.strokeWidth??1,dashArray:p.strokeDasharray||[]};return[(t,o,i,a)=>{if(!i?.x||!i?.y)return;let r=a.width,l=a.height,n=null!=m?i.x(m):r/2,s=null!=d?i.y(d):l/2;if(null!=m&&!isFinite(n)||null!=d&&!isFinite(s))return;let c=Math.max(0,Math.min(r,n)),h=Math.max(0,Math.min(l,s)),u=[{config:re.topLeft,x:0,y:0,w:c,h:h},{config:re.topRight,x:c,y:0,w:r-c,h:h},{config:re.bottomLeft,x:0,y:h,w:c,h:l-h},{config:re.bottomRight,x:c,y:h,w:r-c,h:l-h}];for(let e of u)0>=e.w||0>=e.h||(t.fillStyle=e.config.color,t.globalAlpha=e.config.opacity??.08,t.fillRect(e.x,e.y,e.w,e.h));t.globalAlpha=1,t.strokeStyle=e.stroke,t.lineWidth=e.strokeWidth,e.dashArray.length>0&&t.setLineDash(e.dashArray),t.beginPath(),t.moveTo(c,0),t.lineTo(c,l),t.stroke(),t.beginPath(),t.moveTo(0,h),t.lineTo(r,h),t.stroke(),t.setLineDash([])}]},[m,d,re,p]),we=ci(()=>y?[...ve,(e,t,o,i)=>{if(!o?.x||!o?.y)return;let a=i.width,r=i.height,l=null!=m?o.x(m):a/2,n=null!=d?o.y(d):r/2;if(null!=m&&!isFinite(l)||null!=d&&!isFinite(n))return;let s=wt(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif";e.font=`600 ${f}px ${s}`,e.globalAlpha=.5,e.fillStyle=re.topLeft.color,e.textAlign="left",e.textBaseline="top",e.fillText(re.topLeft.label,8,8),e.fillStyle=re.topRight.color,e.textAlign="right",e.textBaseline="top",e.fillText(re.topRight.label,a-8,8),e.fillStyle=re.bottomLeft.color,e.textAlign="left",e.textBaseline="bottom",e.fillText(re.bottomLeft.label,8,r-8),e.fillStyle=re.bottomRight.color,e.textAlign="right",e.textBaseline="bottom",e.fillText(re.bottomRight.label,a-8,r-8),e.globalAlpha=1}]:ve,[ve,y,f,re,m,d]),ke=ci(()=>{let e=L.canvasPreRenderers||[];return[...we,...e]},[we,L.canvasPreRenderers]),Re=ci(()=>{let e={stroke:p.stroke||"#999",strokeWidth:p.strokeWidth??1,dashArray:p.strokeDasharray?Array.isArray(p.strokeDasharray)?p.strokeDasharray.join(","):p.strokeDasharray:void 0};return[(t,o,i)=>{if(!o?.x||!o?.y)return null;let a=i.width,r=i.height,l=null!=m?o.x(m):a/2,n=null!=d?o.y(d):r/2;if(null!=m&&!isFinite(l)||null!=d&&!isFinite(n))return null;let s=Math.max(0,Math.min(a,l)),c=Math.max(0,Math.min(r,n));/* @__PURE__ */
|
|
44
|
+
return yi(ui,{children:[[{config:re.topLeft,x:0,y:0,w:s,h:c},{config:re.topRight,x:s,y:0,w:a-s,h:c},{config:re.bottomLeft,x:0,y:c,w:s,h:r-c},{config:re.bottomRight,x:s,y:c,w:a-s,h:r-c}].map((e,t)=>e.w>0&&e.h>0?/* @__PURE__ */pi("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:e.config.color,opacity:e.config.opacity??.08},"qf-"+t):null),
|
|
45
|
+
/* @__PURE__ */pi("line",{x1:s,y1:0,x2:s,y2:r,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),
|
|
46
|
+
/* @__PURE__ */pi("line",{x1:0,y1:c,x2:a,y2:c,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),y&&/* @__PURE__ */yi(ui,{children:[
|
|
47
|
+
/* @__PURE__ */pi("text",{x:8,y:8+f,fill:re.topLeft.color,fontWeight:600,fontSize:f,opacity:.5,children:re.topLeft.label}),
|
|
48
|
+
/* @__PURE__ */pi("text",{x:a-8,y:8+f,fill:re.topRight.color,fontWeight:600,fontSize:f,opacity:.5,textAnchor:"end",children:re.topRight.label}),
|
|
49
|
+
/* @__PURE__ */pi("text",{x:8,y:r-8,fill:re.bottomLeft.color,fontWeight:600,fontSize:f,opacity:.5,children:re.bottomLeft.label}),
|
|
50
|
+
/* @__PURE__ */pi("text",{x:a-8,y:r-8,fill:re.bottomRight.color,fontWeight:600,fontSize:f,opacity:.5,textAnchor:"end",children:re.bottomRight.label})]})]})}]},[m,d,re,p,y,f]);if(ne.earlyReturn)return ne.earlyReturn;let Le={chartType:"scatter",...null!=a&&{data:le},xAccessor:c,yAccessor:h,colorAccessor:g||void 0,sizeAccessor:v||void 0,sizeRange:A,pointStyle:fe,colorScheme:b,size:[X,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:ne.margin,showAxes:i.showAxes,xLabel:ie,yLabel:ae,xFormat:n,yFormat:s,enableHover:Q,showGrid:K,...se&&{xExtent:se.xExtent,yExtent:se.yExtent},...ne.legendBehaviorProps,...J&&{title:J},...ee&&{description:ee},...te&&{summary:te},...void 0!==oe&&{accessibleTable:oe},...l&&{className:l},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===k?()=>null:!0===k||void 0===k?be:Qe(k)||be,...Ce({linkedHover:H,selection:_,onObservation:I,onClick:P,hoverHighlight:B,hoverRadius:e.hoverRadius,mobileInteraction:ne.mobileInteraction,customHoverBehavior:ne.customHoverBehavior,customClickBehavior:ne.customClickBehavior}),...C&&{pointIdAccessor:C},...R&&R.length>0&&{annotations:R},canvasPreRenderers:ke,...ne.crosshairProps,...L,...ke.length>0&&{canvasPreRenderers:ke},svgPreRenderers:Re};return xe?/* @__PURE__ */pi(Ke,{componentName:"QuadrantChart",message:xe,width:X,height:$}):/* @__PURE__ */pi(Ye,{componentName:"QuadrantChart",width:X,height:$,children:/* @__PURE__ */pi(he,{ref:o,...Le})})});fi.displayName="QuadrantChart";import*as gi from"react";import{useMemo as bi,useCallback as xi,forwardRef as vi,useRef as Ai,useImperativeHandle as wi}from"react";var Si="__ma_unitized",ki="__ma_series";import{jsx as Ci}from"react/jsx-runtime";de(ue);var Ri=vi(function(e,t){let o=Ai(null),i=Ai([]),a=Ai(e.series);a.current=e.series,wi(t,()=>{let e=()=>(a.current??[]).filter(e=>null!=e&&"object"==typeof e);return{push:t=>{if(!o.current)return;let a=e(),r=t;for(let e=0;a.length>e&&2>e;e++){let t=a[e],l=t.extent||i.current[e];if(!l)continue;let n=("function"==typeof t.yAccessor?t.yAccessor:e=>e[t.yAccessor])(r);null==n||!isFinite(n)||o.current.push({...r,[Si]:E(n,l),[ki]:t.label||"Series "+(e+1)})}},pushMany:t=>{if(!o.current)return;let a=e(),r=[];for(let e of t)for(let t=0;a.length>t&&2>t;t++){let o=a[t],l=o.extent||i.current[t];if(!l)continue;let n=("function"==typeof o.yAccessor?o.yAccessor:e=>e[o.yAccessor])(e);null==n||!isFinite(n)||r.push({...e,[Si]:E(n,l),[ki]:o.label||"Series "+(t+1)})}o.current.pushMany(r)},remove:e=>o.current?.remove(e)??[],update:(e,t)=>o.current?.update(e,t)??[],clear:()=>o.current?.clear(),getData:()=>o.current?.getData()??[],getScales:()=>o.current?.getScales()??null}},[]);let r=Te(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:800,height:400}),{data:l,margin:n,className:s,xFormat:c,xAccessor:h="x",series:m,colorScheme:d,curve:u="monotoneX",lineWidth:p=2,styleRules:y,tooltip:f,annotations:g,frameProps:b={},selection:x,linkedHover:v,onObservation:A,onClick:w,hoverHighlight:S,chartId:k,loading:C,loadingContent:R,emptyContent:L,legendInteraction:_,legendPosition:H,stroke:I,strokeWidth:P,opacity:B}=e,{width:F,height:D,enableHover:N,showGrid:M,showLegend:z=!0,title:G,description:V,summary:X,accessibleTable:Q,xLabel:K}=r,Y=bi(()=>qe(l),[l]),J=bi(()=>qe(m),[m]),Z=J,ee=2===J.length,te=bi(()=>ee?{...b.legendLayout,sideGutter:b.legendLayout?.sideGutter??70}:b.legendLayout,[b.legendLayout,ee]);"u">typeof process&&"production"!==process.env?.NODE_ENV&&!ee&&console.warn(`[MultiAxisLineChart] Expected exactly 2 series for dual-axis mode, got ${J.length}. Rendering as a standard multi-line chart.`);let oe=Ue(C,F,D,R),ie=oe?null:Je(l,F,D,L),ae=Be(),re=bi(()=>W(Z,d,ae),[Z,d,ae]),le=bi(()=>J.map((e,t)=>e.label||"Series "+(t+1)),[J]),{unitizedData:ne,extents:se}=bi(()=>{if(0===Y.length){let e=J.map(e=>e.extent||null).filter(Boolean);return e.length===J.length&&(i.current=e),{unitizedData:[],extents:e.length===J.length?e:[]}}let e=J.map(e=>e.extent||O(Y,e.yAccessor));if(i.current=e,!ee){let t=[];for(let e of Y)for(let o=0;J.length>o;o++){let i=J[o],a=("function"==typeof i.yAccessor?i.yAccessor:e=>e[i.yAccessor])(e);null!=a&&t.push({...e,[Si]:a,[ki]:le[o]})}return{unitizedData:t,extents:e}}let t=[];for(let o of Y)for(let i=0;2>i;i++){let a=J[i],r=("function"==typeof a.yAccessor?a.yAccessor:e=>e[a.yAccessor])(o);null!=r&&t.push({...o,[Si]:E(r,e[i]),[ki]:le[i]})}return{unitizedData:t,extents:e}},[Y,J,ee,le]),ce=bi(()=>{if(!ee||2>se.length)return;let e=e=>t=>{let o=j(t,se[e]),i=J[e]?.format;return"function"==typeof i?i(o):Number.isInteger(o)?o+"":o.toFixed(1)},t=e(0),o=e(1);return[{orient:"left",label:le[0],tickFormat:t},{orient:"right",label:le[1],tickFormat:o},{orient:"bottom"}]},[ee,se,J,le]),me=bi(()=>ne.length>0?ne:le.map(e=>({[ki]:e})),[ne,le]),de=U({data:me,rawData:l,colorBy:ki,colorScheme:re,legendInteraction:_,legendPosition:H,frameLegend:{...b,legendLayout:te},selection:x,linkedHover:v,fallbackFields:[ki],unwrapData:!1,onObservation:A,onClick:w,hoverHighlight:S,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"MultiAxisLineChart",chartId:k,showLegend:z,legendLayout:te,userMargin:n,marginDefaults:ee?{...r.marginDefaults,left:70,right:70}:r.marginDefaults,loading:C,loadingContent:R,emptyContent:L,width:F,height:D,hasTitle:!!G,axisChrome:dt(b,{showAxes:r.showAxes,xLabel:K,yLabel:le[0],yLabelRight:le[1],axes:ce})}),ue=bi(()=>{let e=/* @__PURE__ */new Map;return le.forEach((t,o)=>e.set(t,re[o])),e},[le,re]),pe=xi(e=>ue.get(e[ki])||re[0],[ue,re]),ye=bi(()=>T(h,J),[h,J]),fe=$({lineWidth:p,resolveStroke:pe,stroke:I,strokeWidth:P,opacity:B,effectiveSelectionHook:de.effectiveSelectionHook,resolvedSelection:de.resolvedSelection,styleRules:y,ruleContext:ye}),ge=bi(()=>e=>{let t=e.data||e,o=t[ki],i=le.indexOf(o),a=t[Si],r=ee&&i>=0&&se[i]?j(a,se[i]):a,l=i>=0&&J[i]?.format?J[i].format:e=>Number.isInteger(e)?e+"":e.toFixed(2),n="function"==typeof h?h(t):t[h];return gi.createElement("div",{style:{padding:"6px 10px",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-tooltip-font-size, 13px)"}},gi.createElement("div",{style:{fontWeight:600,marginBottom:4,color:re[i]||"inherit"}},o),gi.createElement("div",null,`${"string"==typeof h?h:"x"}: ${n}`),gi.createElement("div",null,`${o}: ${l(r)}`))},[le,re,se,ee,J,h]),be=xi(e=>{let t=(Array.isArray(e.allSeries)?e.allSeries:[]).map(e=>{let t=le.indexOf(e.group),o=ee&&t>=0&&se[t]?j(e.value,se[t]):e.value,i=e.datum;return i&&(i={...i},delete i[Si],delete i[ki]),{...e,value:o,datum:i}}),o=e.data&&"object"==typeof e.data&&!Array.isArray(e.data)?{...e.data}:e.data;o&&"object"==typeof o&&!Array.isArray(o)&&(delete o[Si],delete o[ki]);let i={...e,data:o,allSeries:t};return delete i[Si],delete i[ki],i},[se,ee,le]),xe=bi(()=>$e(),[]),ve=xi(e=>xe(be(e)),[xe,be]),Ae=bi(()=>ze(f)&&"function"==typeof f.content?{mode:"multi",content:e=>f.content(be(e))}:f,[be,f]),we=bi(()=>Ge({tooltip:Ae,defaultTooltipContent:ge,multiDefaultContent:ve}),[ge,ve,Ae]);if(de.earlyReturn)return de.earlyReturn;let Se=q({componentName:"MultiAxisLineChart",data:l,accessors:{xAccessor:h}}),ke=ee?[0,1]:void 0,Re={chartType:"line",...null!=l&&{data:ne},xAccessor:h,yAccessor:Si,groupAccessor:ki,lineStyle:fe,colorScheme:re,size:[F,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:de.margin,showAxes:r.showAxes,...ce&&{axes:ce},xLabel:K,...ee?{}:{yLabel:le[0]},xFormat:c,...ee&&ke&&{yExtent:ke},enableHover:N,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:M,curve:u,...de.legendBehaviorProps,...G&&{title:G},...V&&{description:V},...X&&{summary:X},...void 0!==Q&&{accessibleTable:Q},...s&&{className:s},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...we,...g&&{annotations:g},...Ce({linkedHover:v,selection:x,onObservation:A,onClick:w,hoverHighlight:S,hoverRadius:e.hoverRadius,mobileInteraction:de.mobileInteraction,customHoverBehavior:de.customHoverBehavior,customClickBehavior:de.customClickBehavior}),...de.crosshairProps,...b,...te&&{legendLayout:te}};return oe||ie||(Se?/* @__PURE__ */Ci(Ke,{componentName:"MultiAxisLineChart",message:Se,width:F,height:D}):/* @__PURE__ */Ci(Ye,{componentName:"MultiAxisLineChart",width:F,height:D,children:/* @__PURE__ */Ci(he,{ref:o,...Re})}))});Ri.displayName="MultiAxisLineChart";import{useMemo as Li,forwardRef as _i,useRef as Hi}from"react";import{jsx as Ii}from"react/jsx-runtime";de(le);var Pi=_i(function(e,t){let o=Hi(null);Z(t,{variant:"xy",frameRef:o});let i=Te(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:l,xFormat:n,yFormat:s,xAccessor:c="x",highAccessor:h="high",lowAccessor:m="low",openAccessor:d,closeAccessor:u,candlestickStyle:p,styleRules:y,tooltip:f,annotations:g,xExtent:b,yExtent:x,frameProps:v={},selection:A,linkedHover:w,onObservation:S,onClick:k,chartId:C,loading:R,loadingContent:L,emptyContent:_}=e,{width:H,height:I,enableHover:P,showGrid:B,title:F,description:D,summary:N,accessibleTable:M,xLabel:W,yLabel:T}=i,O=Ue(R,H,I,L),E=O?null:Je(a,H,I,_),j=Li(()=>qe(a),[a]),z=null==d||null==u;Ze("CandlestickChart",j,"xAccessor",c),Ze("CandlestickChart",j,"highAccessor",h),Ze("CandlestickChart",j,"lowAccessor",m),z||(Ze("CandlestickChart",j,"openAccessor",d),Ze("CandlestickChart",j,"closeAccessor",u));let{activeSelectionHook:G,customHoverBehavior:V,customClickBehavior:X,crosshairSourceId:$}=Me({selection:A,linkedHover:w,onObservation:S,onClick:k,chartType:"CandlestickChart",chartId:C,mobileInteraction:i.mobileInteraction}),Q=J(A),Y=Li(()=>Ee(c,z?h:u),[c,h,u,z]),U=Li(()=>tt(Xe(void 0,y,Y),G,Q),[y,Y,G,Q]),ee=We(w,$),te=Li(()=>{let e=i.marginDefaults,t="sparkline"===i.mode?{...e,top:0,bottom:0}:e;return null==r?t:{...t,...K(r)}},[r,i.marginDefaults,i.mode]),oe=Li(()=>{let e=[{label:W||Ae(c),accessor:c,role:"x",format:n}];return z?(e.push({label:"High",accessor:h,role:"y",format:s}),e.push({label:"Low",accessor:m,format:s})):(e.push({label:"Open",accessor:d,format:s}),e.push({label:"High",accessor:h,format:s}),e.push({label:"Low",accessor:m,format:s}),e.push({label:"Close",accessor:u,format:s})),Se(e)},[c,W,n,s,h,m,d,u,z]),ie=q({componentName:"CandlestickChart",data:a,accessors:{xAccessor:c,highAccessor:h,lowAccessor:m,...!z&&{openAccessor:d,closeAccessor:u}}}),ae=Math.max(2,Math.min(12,Math.round(H/40))),re=H>200?.1:.02,le={chartType:"candlestick",...null!=a&&{data:j},xAccessor:c,yAccessor:h,highAccessor:h,lowAccessor:m,...!z&&{openAccessor:d,closeAccessor:u},...p&&{candlestickStyle:p},...(G||y?.length)&&{pointStyle:U},scalePadding:ae,extentPadding:re,size:[H,I],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te,showAxes:i.showAxes,xLabel:W,yLabel:T,xFormat:n,yFormat:s,enableHover:P,showGrid:B,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...ke({title:F,description:D,summary:N,accessibleTable:M,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Re({tooltip:f,defaultTooltipContent:oe}),...Ce({linkedHover:w,selection:A,onObservation:S,onClick:k,hoverRadius:e.hoverRadius,mobileInteraction:i.mobileInteraction,customHoverBehavior:V,customClickBehavior:X}),...g&&g.length>0&&{annotations:g},...b&&{xExtent:b},...x&&{yExtent:x},...ee,...v};return O||E||(ie?/* @__PURE__ */Ii(Ke,{componentName:"CandlestickChart",message:ie,width:H,height:I}):/* @__PURE__ */Ii(Ye,{componentName:"CandlestickChart",width:H,height:I,children:/* @__PURE__ */Ii(he,{ref:o,...le})}))});Pi.displayName="CandlestickChart";import{useMemo as Bi,forwardRef as Fi,useRef as Di}from"react";import{jsx as Ni}from"react/jsx-runtime";de(re);var Mi=Fi(function(e,t){let o=Di(null);Z(t,{variant:"xy",frameRef:o});let i=Te(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:l,xFormat:n,yFormat:s,xAccessor:c="x",yAccessor:h="y",pointIdAccessor:m,xScaleType:d,positiveColor:u,negativeColor:p,connectorStroke:y,connectorWidth:f,gap:g,styleRules:b,tooltip:x,annotations:v,xExtent:A,yExtent:w,frameProps:S={},selection:k,linkedHover:C,onObservation:R,onClick:L,hoverHighlight:_,chartId:H,loading:I,loadingContent:P,emptyContent:B,legendInteraction:F,legendPosition:D}=e,{areaStyle:N,...M}=S,{width:W,height:T,enableHover:O,showGrid:E,showLegend:j,title:z,description:G,summary:V,accessibleTable:X,xLabel:$,yLabel:Q}=i,K=Bi(()=>qe(a),[a]),Y=Di({next:0,indexOf:/* @__PURE__ */new WeakMap,idOf:/* @__PURE__ */new Map,labels:/* @__PURE__ */new Map}),{plotData:J,plotXAccessor:ee,plotXFormat:te,usesIndex:oe}=Bi(()=>{let e="function"==typeof c?c:e=>e[c],t=m?"function"==typeof m?m:e=>e[m]:void 0,o=e=>"number"==typeof e&&Number.isFinite(e)||e instanceof Date,i=(e,t)=>{let o=e??t;return n?n(o):o+""};if(null!=a&&!K.some((t,i)=>!o(e(t,i))))return{plotData:K,plotXAccessor:c,plotXFormat:n,usesIndex:!1};if(null!=a){let t=K.map((t,o)=>e(t,o));return{plotData:K.map((e,t)=>({...e,__waterfallX:t})),plotXAccessor:"__waterfallX",plotXFormat:e=>i(t[Number(e)],e),usesIndex:!0}}let r=Y.current,l=(e,t,o,i)=>{e&&"object"==typeof e&&(r.indexOf.set(e,t),!Object.isFrozen(e)&&!Object.isSealed(e)&&(e.__waterfallX=t)),o&&r.idOf.set(o,t),r.labels.set(t,i)};return{plotData:K,plotXAccessor:(i,a)=>{let n=e(i,a);if(o(n))return n;let s=t?(t(i,a)??"")+"":"",c=i&&"object"==typeof i?i.__waterfallX:void 0,h="number"==typeof c&&Number.isFinite(c)?c:(i&&"object"==typeof i?r.indexOf.get(i):void 0)??(s?r.idOf.get(s):void 0);if("number"==typeof h)return l(i,h,s,n),h;let m="number"==typeof a?a:r.next;return r.next=Math.max(r.next,m+1),l(i,m,s,n),m},plotXFormat:e=>i(r.labels.get(Number(e)),e),usesIndex:!0}},[a,K,c,n,m]),ie=Bi(()=>{if(oe&&null!=a)return[{orient:"bottom",tickValues:J.map((e,t)=>t)}]},[a,J,oe]),ae=U({data:J,rawData:a,colorBy:void 0,colorScheme:void 0,legendInteraction:F,legendPosition:D,frameLegend:S,selection:k,linkedHover:C,fallbackFields:["string"==typeof c?c:"x"],unwrapData:!1,onObservation:R,onClick:L,hoverHighlight:_,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"WaterfallChart",chartId:H,showLegend:j,userMargin:r,marginDefaults:i.marginDefaults,loading:I,loadingContent:P,emptyContent:B,width:W,height:T,hasTitle:!!z,axisChrome:dt(S,{showAxes:i.showAxes,xLabel:$,yLabel:Q,axes:S.axes??ie})}),re=Bi(()=>({positiveColor:u,negativeColor:p,connectorStroke:y,connectorWidth:f,gap:g,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity}),[u,p,y,f,g,e.stroke,e.strokeWidth,e.opacity]),le=Bi(()=>Ee(c,h),[c,h]),ne=Bi(()=>Xe(void 0,b,le),[b,le]),se=Bi(()=>tt(e=>{let t=ne(e);if(!N)return t;let o="function"==typeof N?N(e):N;return o?{...t,...o}:t},ae.effectiveSelectionHook,ae.resolvedSelection),[ne,N,ae.effectiveSelectionHook,ae.resolvedSelection]),ce=Bi(()=>Se([{label:$||Ae(c),accessor:c,role:"x",format:n},{label:Q||"Change",accessor:h,role:"y",format:s}]),[c,h,$,Q,n,s]);if(ae.earlyReturn)return ae.earlyReturn;let me=q({componentName:"WaterfallChart",data:a,accessors:{xAccessor:c,yAccessor:h}});if(me)/* @__PURE__ */return Ni(Ke,{componentName:"WaterfallChart",message:me,width:W,height:T});let de={chartType:"waterfall",...null!=a&&{data:J},xAccessor:ee,yAccessor:h,xScaleType:null!=a&&oe?"linear":d,waterfallStyle:re,areaStyle:se,size:[W,T],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ae.margin,showAxes:i.showAxes,xLabel:$,yLabel:Q,xFormat:te,yFormat:s,enableHover:O,showGrid:E,...ie&&{axes:ie},...ae.legendBehaviorProps,...ke({title:z,description:G,summary:V,accessibleTable:X,className:l,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...Re({tooltip:x,defaultTooltipContent:ce}),...Ce({linkedHover:C,selection:k,onObservation:R,onClick:L,hoverHighlight:_,hoverRadius:e.hoverRadius,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...m&&{pointIdAccessor:m},...v&&v.length>0&&{annotations:v},...A&&{xExtent:A},...w&&{yExtent:w},...M};/* @__PURE__ */
|
|
51
|
+
return Ni(Ye,{componentName:"WaterfallChart",width:W,height:T,children:/* @__PURE__ */Ni(he,{ref:o,...de})})});Mi.displayName="WaterfallChart";export{Mt as a,zt as b,$t as c,o as d,l as e,to as f,no as g,go as h,wo as i,_o as j,Do as k,F as l,N as m,di as n,fi as o,Ri as p,Pi as q,Mi as r};
|
|
@@ -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};
|