semiotic 3.9.1 → 3.9.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 +102 -48
- package/agent-skill/semiotic-charts/SKILL.md +14 -10
- package/ai/componentMetadata.cjs +13 -3
- package/ai/dist/mcp-server.js +140 -36407
- package/ai/examples.md +109 -6
- package/ai/reference.md +55 -18
- package/ai/schema.json +5964 -1190
- package/ai/surface-manifest.json +51 -7
- package/ai/system-prompt.md +16 -3
- package/dist/c-3SCUN5HI.min.js +1 -0
- package/dist/c-3VVKFA4M.min.js +1 -0
- package/dist/c-43TJZS3F.min.js +1 -0
- package/dist/c-4DTZPSUD.min.js +1 -0
- package/dist/c-4ES5367Y.min.js +1 -0
- package/dist/c-54IRWOGM.min.js +1 -0
- package/dist/c-5D2S4RMI.min.js +1 -0
- package/dist/c-5JWCTX3G.min.js +1 -0
- package/dist/c-6CMMSN6N.min.js +1 -0
- package/dist/c-6HRB2L7H.min.js +1 -0
- package/dist/c-7W4SV36A.min.js +1 -0
- package/dist/c-A4WRGZFX.min.js +1 -0
- package/dist/c-AG7WWVIH.min.js +1 -0
- package/dist/c-AH6J4MTN.min.js +1 -0
- package/dist/c-ALYR5LKK.min.js +1 -0
- package/dist/c-BYDPC44I.min.js +1 -0
- package/dist/c-CFFIU2MW.min.js +1 -0
- package/dist/c-CGNHBHCE.min.js +1 -0
- package/dist/c-CJYSXIFV.min.js +1 -0
- package/dist/c-CKLIFCGN.min.js +1 -0
- package/dist/c-CZF7MV67.min.js +1 -0
- package/dist/c-D53OKBSY.min.js +1 -0
- package/dist/c-DBQ2V7CH.min.js +1 -0
- package/dist/c-DPMVAUAW.min.js +1 -0
- package/dist/c-ECJCKLYY.min.js +1 -0
- package/dist/c-EGATGOWJ.min.js +1 -0
- package/dist/c-EGR6VYBW.min.js +1 -0
- package/dist/c-ENF72HU5.min.js +1 -0
- package/dist/c-ESNR43AN.min.js +1 -0
- package/dist/c-F3LIKINL.min.js +1 -0
- package/dist/c-F5ZB5GJ6.min.js +1 -0
- package/dist/c-G3VYMHKE.min.js +1 -0
- package/dist/c-GR6MOEQC.min.js +1 -0
- package/dist/c-GSVCN34B.min.js +1 -0
- package/dist/c-GYOQCEFP.min.js +1 -0
- package/dist/c-H3DNMTCC.min.js +1 -0
- package/dist/c-I6J3FEZE.min.js +1 -0
- package/dist/c-IGH6MGJ5.min.js +1 -0
- package/dist/c-II2EEAJN.min.js +1 -0
- package/dist/c-J6M4JHRS.min.js +1 -0
- package/dist/c-JM3MGLQV.min.js +1 -0
- package/dist/c-KM3N7F7R.min.js +1 -0
- package/dist/c-LF5BZFNC.min.js +1 -0
- package/dist/c-LKBSGFQC.min.js +1 -0
- package/dist/c-NDJADPIF.min.js +1 -0
- package/dist/c-NVPQCIL5.min.js +1 -0
- package/dist/c-OFWJBEE5.min.js +1 -0
- package/dist/c-OYFHP5F5.min.js +1 -0
- package/dist/c-PGKQGGQ2.min.js +1 -0
- package/dist/c-Q2IPZ3MU.min.js +1 -0
- package/dist/c-QKHMBE2E.min.js +1 -0
- package/dist/c-QMVM3AY6.min.js +1 -0
- package/dist/c-QSGWX53A.min.js +1 -0
- package/dist/c-RJKEKZOO.min.js +1 -0
- package/dist/c-SFDIIU5G.min.js +1 -0
- package/dist/c-SRTBCRVE.min.js +1 -0
- package/dist/c-T6UAIKBH.min.js +1 -0
- package/dist/c-TMCTEVVW.min.js +1 -0
- package/dist/c-TMOSJLT3.min.js +1 -0
- package/dist/c-U6ESPM7V.min.js +1 -0
- package/dist/c-UC5PTTFI.min.js +1 -0
- package/dist/c-VGKUEZBC.min.js +1 -0
- package/dist/c-VN2HG5BS.min.js +1 -0
- package/dist/{c-J5G56TUH.min.js → c-VPZDY5Q4.min.js} +1 -1
- package/dist/c-VRXUB2F2.min.js +1 -0
- package/dist/c-VUBQNQJH.min.js +1 -0
- package/dist/c-VUH4PGZY.min.js +1 -0
- package/dist/c-XDRV7RKW.min.js +1 -0
- package/dist/c-YGZHURXZ.min.js +1 -0
- package/dist/components/Annotation.d.ts +1 -1
- package/dist/components/access/chartAccessCapabilities.generated.d.ts +14 -0
- package/dist/components/access/chartAccessContract.d.ts +90 -0
- package/dist/components/access/chartAccessContractFixtures.d.ts +11 -0
- package/dist/components/ai/aestheticProfileTypes.d.ts +35 -0
- package/dist/components/ai/annotationProvenance.d.ts +2 -7
- package/dist/components/ai/auditVisualHierarchy.d.ts +49 -0
- package/dist/components/ai/builtInChartRecipeLayouts.d.ts +2 -0
- package/dist/components/ai/builtInChartRecipePublic.d.ts +4 -0
- package/dist/components/ai/builtInChartRecipes.d.ts +26 -0
- package/dist/components/ai/chartCapabilities.d.ts +3 -1
- package/dist/components/ai/chartRecipeRegistry.d.ts +2 -1
- package/dist/components/ai/chartRecipes.d.ts +6 -0
- package/dist/components/ai/colorEvidence.d.ts +12 -0
- package/dist/components/ai/evaluateAesthetics.d.ts +47 -0
- package/dist/components/ai/geoNavigation.d.ts +4 -0
- package/dist/components/ai/hierarchyNavigation.d.ts +4 -0
- package/dist/components/ai/navigationTree.d.ts +7 -1
- package/dist/components/ai/qualityFixtures.d.ts +8 -0
- package/dist/components/ai/suggestionPropContracts.d.ts +1 -1
- package/dist/components/ai/useNavigationSync.d.ts +3 -3
- package/dist/components/charts/index.d.ts +4 -0
- package/dist/components/charts/network/ChordDiagram.d.ts +5 -1
- package/dist/components/charts/network/CirclePack.d.ts +8 -1
- package/dist/components/charts/network/OrbitDiagram.d.ts +9 -0
- package/dist/components/charts/network/TreeDiagram.d.ts +8 -1
- package/dist/components/charts/network/Treemap.d.ts +8 -1
- package/dist/components/charts/ordinal/BarChart.d.ts +6 -0
- package/dist/components/charts/ordinal/BoxPlot.d.ts +3 -0
- package/dist/components/charts/ordinal/DonutChart.d.ts +3 -0
- package/dist/components/charts/ordinal/DotPlot.d.ts +3 -0
- package/dist/components/charts/ordinal/FunnelChart.d.ts +3 -0
- package/dist/components/charts/ordinal/GaugeChart.d.ts +3 -0
- package/dist/components/charts/ordinal/Histogram.d.ts +3 -0
- package/dist/components/charts/ordinal/LikertChart.d.ts +3 -0
- package/dist/components/charts/ordinal/PieChart.d.ts +3 -0
- package/dist/components/charts/ordinal/RadarChart.capability.d.ts +2 -0
- package/dist/components/charts/ordinal/RadarChart.d.ts +75 -0
- package/dist/components/charts/ordinal/RidgelinePlot.d.ts +3 -0
- package/dist/components/charts/ordinal/SwarmPlot.d.ts +3 -0
- package/dist/components/charts/ordinal/SwimlaneChart.d.ts +3 -0
- package/dist/components/charts/ordinal/ViolinPlot.d.ts +3 -0
- package/dist/components/charts/physics/GauntletChart.d.ts +1 -5
- package/dist/components/charts/physics/chainReactionTypes.d.ts +3 -0
- package/dist/components/charts/physics/gauntletPhysics.d.ts +1 -0
- package/dist/components/charts/physics/physicsHocUtils.d.ts +7 -1
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +10 -1
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +11 -1
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +14 -5
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +7 -1
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +7 -1
- package/dist/components/charts/realtime/aggregate.d.ts +12 -1
- package/dist/components/charts/realtime/realtimeChartRuntime.d.ts +4 -2
- package/dist/components/charts/realtime/realtimeStyleRules.d.ts +4 -0
- package/dist/components/charts/shared/annotationStatusFilter.d.ts +18 -0
- package/dist/components/charts/shared/chartDefinitionPilot.d.ts +5 -4
- package/dist/components/charts/shared/chartSpecCore.d.ts +2 -2
- package/dist/components/charts/shared/heatmapStyleRules.d.ts +13 -0
- package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
- package/dist/components/charts/shared/networkUtils.d.ts +14 -0
- package/dist/components/charts/shared/selectionUtils.d.ts +3 -1
- package/dist/components/charts/shared/types.d.ts +4 -2
- package/dist/components/charts/shared/useChartLegend.d.ts +2 -1
- package/dist/components/charts/shared/useLikertAggregation.d.ts +8 -2
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +9 -5
- package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +1 -1
- package/dist/components/charts/shared/useXYBrush.d.ts +24 -0
- package/dist/components/charts/xy/Heatmap.d.ts +16 -0
- package/dist/components/charts/xy/LineChart.d.ts +9 -0
- package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
- package/dist/components/charts/xy/WaterfallChart.capability.d.ts +2 -0
- package/dist/components/charts/xy/WaterfallChart.d.ts +68 -0
- package/dist/components/evidence/chartEvidenceEnvelope.d.ts +146 -0
- package/dist/components/evidence/evidenceGate.d.ts +28 -0
- package/dist/components/realtime/BinAccumulator.d.ts +5 -1
- package/dist/components/realtime/types.d.ts +16 -7
- package/dist/components/recipes/adjacencyFlow.d.ts +12 -0
- package/dist/components/recipes/adjacencyFlowAggregation.d.ts +72 -0
- package/dist/components/recipes/adjacencyFlowGeometry.d.ts +79 -0
- package/dist/components/recipes/lineageDag.d.ts +17 -0
- package/dist/components/recipes/lineageDagHulls.d.ts +22 -0
- package/dist/components/recipes/transitDiagram.d.ts +75 -0
- package/dist/components/recipes/transitDiagramGeometry.d.ts +47 -0
- package/dist/components/semiotic-access.d.ts +9 -0
- package/dist/components/semiotic-ai-audits.d.ts +17 -0
- package/dist/components/semiotic-ai-core.d.ts +9 -0
- package/dist/components/semiotic-ai.d.ts +5 -17
- package/dist/components/semiotic-evidence.d.ts +10 -0
- package/dist/components/semiotic-line.d.ts +9 -0
- package/dist/components/semiotic-network.d.ts +3 -0
- package/dist/components/semiotic-ordinal.d.ts +2 -0
- package/dist/components/semiotic-realtime-core.d.ts +3 -2
- package/dist/components/semiotic-recipes-core.d.ts +6 -0
- package/dist/components/semiotic-themes-core.d.ts +3 -0
- package/dist/components/semiotic-utils-core.d.ts +5 -0
- package/dist/components/semiotic-xy.d.ts +3 -0
- package/dist/components/semiotic.d.ts +9 -3
- package/dist/components/server/renderDashboard.d.ts +37 -0
- package/dist/components/server/renderEvidence.d.ts +27 -0
- package/dist/components/server/renderToStaticSVG.d.ts +2 -30
- package/dist/components/server/serverChartConfigShared.d.ts +13 -0
- package/dist/components/server/serverChartConfigs.d.ts +9 -0
- package/dist/components/server/serverChartConfigsComposite.d.ts +4 -0
- package/dist/components/server/serverChartConfigsCustom.d.ts +2 -0
- package/dist/components/server/serverChartConfigsGeo.d.ts +1 -0
- package/dist/components/server/serverChartConfigsOrdinal.d.ts +3 -2
- package/dist/components/server/serverChartConfigsXY.d.ts +1 -0
- package/dist/components/server/serverChartConfigsXYExtra.d.ts +3 -0
- package/dist/components/server/serverCompositeChainReaction.d.ts +3 -0
- package/dist/components/server/serverOrdinalGauge.d.ts +3 -0
- package/dist/components/server/serverOrdinalLikert.d.ts +2 -0
- package/dist/components/store/selectionProvenance.d.ts +8 -0
- package/dist/components/store/themeCore.d.ts +5 -1
- package/dist/components/stream/GeoPipelineStore.d.ts +1 -1
- package/dist/components/stream/MarginalGraphics.d.ts +3 -3
- package/dist/components/stream/MarginalGraphicsLazy.d.ts +22 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +2 -0
- package/dist/components/stream/OrdinalPipelineStore.d.ts +1 -1
- package/dist/components/stream/PipelineStore.d.ts +1 -1
- package/dist/components/stream/SceneToSVG.d.ts +1 -1
- package/dist/components/stream/canvasSetup.d.ts +8 -2
- package/dist/components/stream/customLayoutAttempt.d.ts +21 -0
- package/dist/components/stream/geoTypes.d.ts +1 -1
- package/dist/components/stream/isServerEnvironment.d.ts +6 -0
- package/dist/components/stream/layouts/forceLayoutNodeSize.d.ts +12 -0
- package/dist/components/stream/layouts/forceLayoutPlugin.d.ts +2 -9
- package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +2 -21
- package/dist/components/stream/layouts/forceLayoutWorkerPolicy.d.ts +21 -0
- package/dist/components/stream/layouts/index.d.ts +6 -12
- package/dist/components/stream/layouts/missingPlugin.d.ts +7 -0
- package/dist/components/stream/layouts/registerBuiltIn.d.ts +1 -0
- package/dist/components/stream/layouts/registry.d.ts +12 -0
- package/dist/components/stream/marginalConfig.d.ts +3 -0
- package/dist/components/stream/networkCustomLayout.d.ts +7 -0
- package/dist/components/stream/networkCustomLayoutOutput.d.ts +13 -0
- package/dist/components/stream/networkCustomLayoutRunner.d.ts +1 -1
- package/dist/components/stream/networkTypes.d.ts +5 -1
- package/dist/components/stream/ordinalTypes.d.ts +1 -1
- package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +1 -1
- package/dist/components/stream/pipelineDomainResolution.d.ts +6 -0
- package/dist/components/stream/renderers/pointCanvasRenderer.d.ts +4 -0
- package/dist/components/stream/renderers/resolveCSSColor.d.ts +4 -4
- package/dist/components/stream/types.d.ts +8 -1
- package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +18 -0
- package/dist/components/stream/useMarginalValues.d.ts +13 -0
- package/dist/components/stream/xyCanvasRenderers.d.ts +4 -4
- package/dist/components/stream/xyPlugins/areaPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/barPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/candlestickPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/customPlugin.d.ts +6 -0
- package/dist/components/stream/xyPlugins/heatmapPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/lineFamily.d.ts +5 -0
- package/dist/components/stream/xyPlugins/linePlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/missingPlugin.d.ts +7 -0
- package/dist/components/stream/xyPlugins/mixedPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/pointPlugin.d.ts +3 -0
- package/dist/components/stream/xyPlugins/registerBuiltIn.d.ts +1 -0
- package/dist/components/stream/xyPlugins/registry.d.ts +31 -0
- package/dist/components/stream/xyPlugins/stackedAreaPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/swarmPlugin.d.ts +2 -0
- package/dist/components/stream/xyPlugins/waterfallPlugin.d.ts +2 -0
- package/dist/forceLayoutWorker.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-access.d.ts +9 -0
- package/dist/semiotic-access.min.js +2 -0
- package/dist/semiotic-access.module.min.js +2 -0
- package/dist/semiotic-ai-core.d.ts +9 -0
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +5 -17
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-evidence.d.ts +10 -0
- package/dist/semiotic-evidence.min.js +1 -0
- package/dist/semiotic-evidence.module.min.js +1 -0
- package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -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.d.ts +9 -0
- package/dist/semiotic-line.min.js +2 -0
- package/dist/semiotic-line.module.min.js +2 -0
- package/dist/semiotic-network.d.ts +3 -0
- package/dist/semiotic-ordinal.d.ts +2 -0
- package/dist/semiotic-realtime-core.d.ts +3 -2
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
- package/dist/semiotic-recipes-core.d.ts +6 -0
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +1 -1
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-themes-core.d.ts +3 -0
- 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.d.ts +5 -0
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-xy.d.ts +3 -0
- package/dist/semiotic.d.ts +9 -3
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +39 -60
- package/dist/c-3KZD6AXJ.min.js +0 -1
- package/dist/c-4TWEX5HG.min.js +0 -1
- package/dist/c-5YCIX3VZ.min.js +0 -1
- package/dist/c-6FEKTA3U.min.js +0 -1
- package/dist/c-74HEEZGK.min.js +0 -1
- package/dist/c-BWNB6USU.min.js +0 -1
- package/dist/c-C25ENHIK.min.js +0 -1
- package/dist/c-CDR5AO3R.min.js +0 -1
- package/dist/c-E3JFRRMI.min.js +0 -1
- package/dist/c-EBFPQHHO.min.js +0 -1
- package/dist/c-GIKRQI4X.min.js +0 -1
- package/dist/c-GPYOFETM.min.js +0 -1
- package/dist/c-IDUHYYSI.min.js +0 -1
- package/dist/c-JAZ73J32.min.js +0 -1
- package/dist/c-KG3NXHAL.min.js +0 -1
- package/dist/c-KII3PLZE.min.js +0 -1
- package/dist/c-LIXGXMNS.min.js +0 -1
- package/dist/c-LVEY6D6B.min.js +0 -1
- package/dist/c-M4Y3BHFR.min.js +0 -1
- package/dist/c-MAIICR2Z.min.js +0 -1
- package/dist/c-MG5DM6VE.min.js +0 -1
- package/dist/c-O6U6K4CW.min.js +0 -1
- package/dist/c-OQ7M4AGV.min.js +0 -1
- package/dist/c-OXYMVK7Q.min.js +0 -1
- package/dist/c-QHF5YON3.min.js +0 -1
- package/dist/c-RR3GO5SW.min.js +0 -1
- package/dist/c-S2BXNNJN.min.js +0 -1
- package/dist/c-SUILCHWU.min.js +0 -1
- package/dist/c-US5ZFT6E.min.js +0 -1
- package/dist/c-UUKVD4WB.min.js +0 -1
- package/dist/c-WJCD5EUY.min.js +0 -1
- package/dist/c-YDAY2WFR.min.js +0 -1
- package/dist/c-ZOWWU34K.min.js +0 -1
- /package/dist/{c-COHXCW3Q.min.js → c-YZVRZGX2.min.js} +0 -0
package/dist/c-UUKVD4WB.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{coerceDateLikeValue as t,parseDateLikeString as e}from"./c-W3CE4A4S.min.js";import{DataSourceAdapter as i,IncrementalExtent as o,barCanvasRenderer as n,buildAreaNode as s,buildEnrichAnnotationData as r,buildHeatcellNode as a,buildLineNode as l,buildPointNode as c,buildRectNode as h,buildStackedAreaNodes as u,buildSymbolNode as g,computeDivergingStackExtent as f,computeStackOffsets as d,normalizeColorGradient as p,normalizeGradient as y,resolveAnnotationAccessor as m,snapXYIntroTargets as x,ticksForMode as v,toIdSet as b,xyFrameLegendOptions as k}from"./c-C25ENHIK.min.js";import{AXIS_FRAME_DEFAULT_MARGIN as w,accessorsEquivalent as A,resolveAccessor as C,resolveRawAccessor as S,resolveStringAccessor as _,symbolCanvasRenderer as M}from"./c-RR3GO5SW.min.js";import{lineCanvasRenderer as P,resolveNodeColor as Y}from"./c-ZOWWU34K.min.js";import{RingBuffer as R,applyPulse as T,buildAggregateRibbons as N,buildPerSeriesRibbons as W,compactTimestampBufferForRemoval as D,createTimestampBufferForData as O,enrichDatumWithBand as E,ensureRingBufferCapacity as z,hasActivePulses as L,partitionRibbons as F,pointCanvasRenderer as B,pushWithTimestamp as I,refreshIdlePulse as X,useLegendCategoryEmission as $,useSemanticFrameInteractions as G,useXYKeyboardNavigation as V}from"./c-MG5DM6VE.min.js";import{needsInteractionCanvasPaint as j}from"./c-OCI56QF2.min.js";import{StalenessBadge as H,applyDecay as q,attachUpdateResultStore as U,buildDatumIndexMap as K,composeOverlays as J,computeDecayOpacity as Z,createCustomLayoutFailureDiagnostic as Q,filterAnnotationsByStatus as tt,findHitPointInQuadtree as et,getHitRadius as it,glyphCanvasRenderer as ot,hitTestRect as nt,isTimeLandmark as st,paintCanvasBackground as rt,paintSceneWithBackend as at,renderPathPulse as lt,renderRectPulse as ct,renderSceneWithBackend as ht,resolveCanvasBackground as ut,resolveFrameGraphics as gt,resolveStaleness as ft,shouldHandleFramePointer as dt,useConfigSync as pt,useLayoutSelectionSync as yt,useStableShallow as mt,useStalenessCheck as xt,warnCustomLayoutDiagnostics as vt}from"./c-GPYOFETM.min.js";import{wrapWithCustomLayoutSelection as bt}from"./c-G36WS6LN.min.js";import{AccessibleDataTable as kt,AccessibleTablePortal as wt,AriaLiveTooltip as At,CanvasFrameBackground as Ct,FlippingTooltip as St,FocusRing as _t,SEQUENTIAL_INTERPOLATORS as Mt,STREAMING_PALETTE as Pt,SVGChartTitle as Yt,SceneRevisionDiagnosticsObserver as Rt,ScreenReaderSummary as Tt,SkipToTableLink as Nt,UpdateResultTracker as Wt,annotationLayout as Dt,buildHoverData as Ot,buildLinearFillGradient as Et,buildThresholdLineSegments as zt,computeCanvasAriaLabel as Lt,computeEasing as Ft,computeRawProgress as Bt,createDefaultAnnotationRules as It,defaultTooltipStyle as Xt,filterSparseArray as $t,getCSSColorCacheVersion as Gt,getDevicePixelRatio as Vt,getPointerHitRadius as jt,getSequentialInterpolator as Ht,glyphHitGeometry as qt,isAnnotationActivationTarget as Ut,isServerEnvironment as Kt,lerp as Jt,makeSymbolResolver as Zt,now as Qt,observationInputType as te,parseCanvasColor as ee,prepareCanvas as ie,rehitCanvasMarkCursor as oe,renderAnnotationPass as ne,renderLegendFromConfig as se,resolveCSSColor as re,resolveCanvasFill as ae,resolveCanvasPaint as le,resolveCurveFactory as ce,resolveExplicitColor as he,resolveLegendSideGutter as ue,resolveXYAxisChrome as ge,sceneHasAuthoredCursor as fe,sceneMarkCursor as de,setCanvasMarkCursor as pe,smartTooltipEntries as ye,symbolRadius as me,syncCanvasSize as xe,unlockCrosshair as ve,useAnnotationActivationOptions as be,useCanvasMarkCursorCleanup as ke,useCrosshairPosition as we,useFrame as Ae,useFrameCanvasHost as Ce,useHydration as Se,useSceneRevisionDiagnostics as _e,useWasHydratingFromSSR as Me,xySceneNodeToSVG as Pe}from"./c-GIKRQI4X.min.js";import{resolveThemeSemanticColors as Ye}from"./c-YDAY2WFR.min.js";import{getMax as Re}from"./c-WJCD5EUY.min.js";import*as Te from"react";import{forwardRef as Ne,memo as We,useCallback as De,useEffect as Oe,useId as Ee,useImperativeHandle as ze,useMemo as Le,useRef as Fe,useState as Be}from"react";import*as Ie from"react";import{jsx as Xe}from"react/jsx-runtime";var $e=null,Ge=null;function Ve(t){const[e,i]=Ie.useState(()=>$e);return Ie.useEffect(()=>{if(e)return;let t=!1;return($e?Promise.resolve($e):(Ge||(Ge=import("./c-6O5EVOPH.min.js").then(t=>$e=t.XYBrushOverlay).catch(t=>{throw Ge=null,t})),Ge)).then(e=>{t||i(()=>e)}),()=>{t=!0}},[e]),e?Xe(e,{...t}):null}function je(t,e,i){if(e._transitionKey)return e._transitionKey;switch(e.type){case"point":if(e.pointId)return"p:"+e.pointId;if("streaming"===t.runtimeMode&&e.datum){const i=t.getX(e.datum),o=t.getY(e.datum);if(t.getCategory)return`p:${t.getCategory(e.datum)}:${i}:${o}`;if(null!=i&&null!=o)return`p:${i}:${o}`}return"p:"+i;case"glyph":return e.pointId?"g:"+e.pointId:"g:"+i;case"rect":return`r:${e.group||""}:${e.datum?.binStart??e.datum?.category??i}`;case"heatcell":return`h:${e.x}_${e.y}`;case"candlestick":return null==e.datum?"c:"+i:"c:"+t.getX(e.datum);case"line":return"l:"+(e.group||"_default");case"area":return"a:"+(e.group||"_default");default:return null}}function He(t){return t?null!=t.opacity?t.opacity:null!=t.fillOpacity?t.fillOpacity:1:1}function qe(t,e,i,o){if(!t.config.pointStyle)return;const n=o??t.getY;for(const o of e){const e=t.resolveGroupColor(o.key);for(const s of o.data){let o=t.config.pointStyle(s);!o.fill&&e&&(o={...o,fill:e});const r=o.r??3,a=t.getPointId?t.getPointId(s)+"":void 0,l=c(s,t.scales,t.getX,n,r,o,a);l&&i.push(l)}}}function Ue(t){return"threshold"===t.type&&"string"==typeof t.color&&"number"==typeof t.value}function Ke(t){return y(t)}var Je=new Map;function Ze(t){const e=Object.prototype.hasOwnProperty.call(Mt,t)?t:"blues";let i=Je.get(e);if(i)return i;i=Array(256);const o=Ht(e);for(let t=0;256>t;t++)i[t]=o(t/255);return Je.set(e,i),i}function Qe(t,e,i){const o=i.config.areaStyle?.(e);return o&&("string"==typeof o.fill&&(t.fill=o.fill),t.style=o),t}function ti(t,e,i,o,n){const s=new Map;for(const r of t){const t=e(r),a=i(r);if(null==t||null==a||Number.isNaN(t)||Number.isNaN(a))continue;const l=Math.floor(t/o)*o;let c=s.get(l);if(c||(c={start:l,end:l+o,total:0,categories:new Map},s.set(l,c)),c.total+=a,n){const t=n(r);c.categories.set(t,(c.categories.get(t)||0)+a)}}return s}function ei(t,e){const i="function"==typeof t?t:i=>i[t||e];return t=>{const e=i(t);return null==e?NaN:+e}}function ii(t){const e=[],i=["bar","swarm","waterfall"].includes(t.chartType)||"streaming"===t.runtimeMode,o=ei(i&&t.valueAccessor||t.yAccessor,i?"value":"y");if(t.boundsAccessor){const i=C(t.boundsAccessor,"bounds");e.push({kind:"bounds",getTop:t=>{const e=o(t);if(!Number.isFinite(e))return NaN;const n=i(t);return Number.isFinite(n)&&0!==n?e+n:e},getBottom:t=>{const e=o(t);if(!Number.isFinite(e))return NaN;const n=i(t);return Number.isFinite(n)&&0!==n?e-n:e},style:t.boundsStyle,perSeries:!0,interactive:!1})}if(t.band){const i=Array.isArray(t.band)?t.band:[t.band];for(const t of i)e.push({kind:"band",getTop:ei(t.y1Accessor,"y1"),getBottom:ei(t.y0Accessor,"y0"),style:t.style,perSeries:!1!==t.perSeries,interactive:!0===t.interactive})}return e}import{scaleLinear as oi,scaleLog as ni,scaleSymlog as si,scaleTime as ri}from"d3-scale";function ai(t,e){return e?[e[0]??t[0],e[1]??t[1]]:t}function li(t,e,i){if("log"===t){const t=[Math.max(e[0],1e-6),Math.max(e[1],1e-6)];return ni().domain(t).range(i).clamp(!0)}return"symlog"===t?si().domain(e).range(i):"time"===t?ri().domain([new Date(e[0]),new Date(e[1])]).range(i):oi().domain(e).range(i)}var ci=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],hi=["scene-style","data-paint","accessibility","evidence"],ui=(t,e)=>({retainedData:t,invalidations:e}),gi=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],fi=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],di=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],pi=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],yi=["scene-geometry","data-paint","accessibility","evidence"],mi=["scene-style","data-paint","accessibility","evidence"],xi=[],vi={chartType:ui("rebuild",gi),runtimeMode:ui("rebuild",gi),xAccessor:ui("rebuild",gi),yAccessor:ui("rebuild",gi),timeAccessor:ui("rebuild",gi),valueAccessor:ui("rebuild",gi),y0Accessor:ui("rebuild",gi),boundsAccessor:ui("rebuild",gi),band:ui("rebuild",gi),openAccessor:ui("rebuild",gi),highAccessor:ui("rebuild",gi),lowAccessor:ui("rebuild",gi),closeAccessor:ui("rebuild",gi),candlestickRangeMode:ui("rebuild",gi),accessorRevision:ui("rebuild",gi),groupAccessor:ui("rebuild",fi),categoryAccessor:ui("rebuild",fi),lineDataAccessor:ui("rebuild",fi),colorAccessor:ui("rebuild",mi),sizeAccessor:ui("rebuild",yi),symbolAccessor:ui("rebuild",yi),pointIdAccessor:ui("rebuild",yi),xScaleType:ui("preserve",di),yScaleType:ui("preserve",di),xExtent:ui("preserve",di),yExtent:ui("preserve",di),extentPadding:ui("preserve",di),scalePadding:ui("preserve",di),axisExtent:ui("preserve",di),yAxisExtent:ui("preserve",di),binSize:ui("preserve",di),normalize:ui("preserve",di),heatmapAggregation:ui("preserve",di),heatmapXBins:ui("preserve",di),heatmapYBins:ui("preserve",di),arrowOfTime:ui("preserve",pi),baseline:ui("preserve",pi),stackOrder:ui("preserve",pi),sizeRange:ui("preserve",pi),curve:ui("preserve",pi),areaGroups:ui("preserve",pi),customLayout:ui("preserve",pi),layoutConfig:ui("preserve",pi),layoutMargin:ui("preserve",pi),symbolMap:ui("preserve",yi),showValues:ui("preserve",yi),heatmapValueFormat:ui("preserve",yi),lineStyle:ui("preserve",mi),pointStyle:ui("preserve",mi),areaStyle:ui("preserve",mi),barStyle:ui("preserve",mi),swarmStyle:ui("preserve",mi),waterfallStyle:ui("preserve",mi),candlestickStyle:ui("preserve",mi),boundsStyle:ui("preserve",mi),gradientFill:ui("preserve",mi),lineGradient:ui("preserve",mi),semanticLineStops:ui("preserve",mi),colorScheme:ui("preserve",mi),themeCategorical:ui("preserve",mi),themeSemantic:ui("preserve",mi),themeSequential:ui("preserve",mi),themeDiverging:ui("preserve",mi),barColors:ui("preserve",mi),decay:ui("preserve",mi),pulse:ui("preserve",mi),staleness:ui("preserve",mi),layoutSelection:ui("preserve",mi),annotations:ui("preserve",["overlay","accessibility","evidence"]),windowSize:ui("preserve",xi),windowMode:ui("preserve",xi),maxCapacity:ui("preserve",xi),clock:ui("preserve",xi),transition:ui("preserve",xi),introAnimation:ui("preserve",xi),onLayoutError:ui("preserve",xi)},bi=ui("preserve",pi),ki=class{constructor(){this.tracker=new Wt}get last(){return this.tracker.last}subscribe(t){return this.tracker.subscribe(t)}recordData(t,e){return this.tracker.record({kind:t,...void 0===e?{}:{count:e}},ci)}recordNoop(t){return this.tracker.record({kind:t,..."restyle"===t?{}:{count:0}},[])}recordRestyle(t){return t?this.tracker.record({kind:"restyle"},hi):this.recordNoop("restyle")}recordConfig(t){const e=function(t){let e="preserve";const i=new Set;for(const o of t){const t=vi[o]??bi;"rebuild"===t.retainedData&&(e="rebuild");for(const e of t.invalidations)i.add(e)}return{retainedData:e,invalidations:i}}(t);return this.tracker.record({kind:"config",keys:t},e.invalidations)}};import{quadtree as wi}from"d3-quadtree";var Ai=class{constructor(){this.maxRadius=0,this.tree=null}get quadtree(){return this.tree}get maxPointRadius(){return this.maxRadius}clear(){this.tree=null,this.maxRadius=0}rebuild(t,e){if("scatter"!==t&&"bubble"!==t&&"custom"!==t)return void this.clear();let i=0,o=0;for(const t of e)"point"===t.type&&!1!==t.interactive&&(i++,t.r>o&&(o=t.r));if(this.maxRadius=o,500>=i)return void(this.tree=null);const n=Array(i);let s=0;for(const t of e)"point"===t.type&&!1!==t.interactive&&(n[s++]=t);this.tree=wi().x(t=>t.x).y(t=>t.y).addAll(n)}},Ci=class i{constructor(t){if(this.xExtent=new o,this.yExtent=new o,this.growingCapacityWarned=!1,this.windowSizeWarned=!1,this.resolvedRibbons=[],this.timestampBuffer=null,this.activeTransition=null,this._hasRenderedOnce=!1,this.prevPositionMap=new Map,this.prevPathMap=new Map,this.exitNodes=[],this.lastIngestTime=0,this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this._ingestVersion=0,this._datumIndexCache=null,this._bufferArrayCache=null,this._bufferDirty=!0,this.needsFullRebuild=!0,this.lastLayout=null,this.updateResults=new ki,this.scales=null,this.scene=[],this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.xIsDate=!1,this.spatialIndex=new Ai,this._lastBoundedInsertsRef=null,this.applyPulse=(t,e,i)=>!(!this.config.pulse||!this.timestampBuffer)&&T(this.config.pulse,t,e,this.timestampBuffer,this.getDatumIndexMap(e),i),this.config=t,this.buffer=new R(t.windowSize),this.growingCap=t.windowSize,["bar","swarm","waterfall"].includes(t.chartType)||"streaming"===t.runtimeMode?(this.getX=C(t.timeAccessor||t.xAccessor,"time"),this.getY=C(t.valueAccessor||t.yAccessor,"value")):(this.getX=C(t.xAccessor,"x"),this.getY=C(t.yAccessor,"y")),this.getGroup=_(t.groupAccessor),this.getCategory=_(t.categoryAccessor),this.getSize=t.sizeAccessor?C(t.sizeAccessor,"size"):void 0,this.getColor=_(t.colorAccessor),this.getSymbol=_(t.symbolAccessor),this.getY0=t.y0Accessor?C(t.y0Accessor,"y0"):void 0,this.resolvedRibbons=ii(t),this.getPointId=_(t.pointIdAccessor),"candlestick"===t.chartType){const e=null!=t.openAccessor,i=null!=t.closeAccessor;this.getOpen=e?C(t.openAccessor,"open"):void 0,this.getHigh=C(t.highAccessor,"high"),this.getLow=C(t.lowAccessor,"low"),this.getClose=i?C(t.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!e&&!i}t.pulse&&(this.timestampBuffer=new R(t.windowSize))}currentTime(){return this.config.clock?.()??Qt()}syncPulseTimestampBuffer(){this.config.pulse?null!=this.timestampBuffer&&this.timestampBuffer.capacity===this.buffer.capacity&&this.timestampBuffer.size===this.buffer.size||(this.timestampBuffer=O(this.buffer,this.currentTime())):this.timestampBuffer=null}pushDatumYExtent(t){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.push(this.getHigh(t)),void this.yExtent.push(this.getLow(t));this.yExtent.push(this.getY(t)),this.getY0&&this.yExtent.push(this.getY0(t));for(const e of this.resolvedRibbons){const i=e.getTop(t),o=e.getBottom(t);Number.isFinite(i)&&this.yExtent.push(i),Number.isFinite(o)&&this.yExtent.push(o)}}evictDatumYExtent(t){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.evict(this.getHigh(t)),void this.yExtent.evict(this.getLow(t));this.yExtent.evict(this.getY(t)),this.getY0&&this.yExtent.evict(this.getY0(t));for(const e of this.resolvedRibbons){const i=e.getTop(t),o=e.getBottom(t);Number.isFinite(i)&&this.yExtent.evict(i),Number.isFinite(o)&&this.yExtent.evict(o)}}rebuildYExtent(){this.yExtent.clear();for(const t of this.buffer)this.pushDatumYExtent(t)}rebuildExtents(){this.xExtent.clear(),this.yExtent.clear();for(const t of this.buffer)this.xExtent.push(this.getX(t)),this.pushDatumYExtent(t)}ingest(i){if(i.bounded&&this._lastBoundedInsertsRef===i.inserts)return this.updateResults.recordNoop("replace"),!1;const o=this.currentTime();if(this.lastIngestTime=o,this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,i.bounded){this._lastBoundedInsertsRef=i.inserts,this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this.timestampBuffer&&this.timestampBuffer.clear();const n=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode;if(this.getX=n?C(this.config.timeAccessor||this.config.xAccessor,"time"):C(this.config.xAccessor,"x"),this.xIsDate=!1,i.inserts.length>0){const o=i.inserts[0],n=this.config.xAccessor,s="function"==typeof n?n(o):o[n||"x"],r=s instanceof Date,a="string"==typeof s&&Number.isFinite(e(s));if(this.xIsDate=r||a,a){const e="string"==typeof n?n:void 0;this.getX=e?i=>t(i[e]):e=>t(n(e))}}z(this.buffer,i.totalSize||i.inserts.length,this.timestampBuffer);for(const t of i.inserts)I(this.buffer,t,this.timestampBuffer,o),this.xExtent.push(this.getX(t)),this.pushDatumYExtent(t)}else for(const t of i.inserts){if("growing"===this.config.windowMode&&this.buffer.full){const t=this.config.maxCapacity??1e5;t>this.growingCap&&(this.growingCap=Math.min(2*this.growingCap,t),this.buffer.resize(this.growingCap),this.timestampBuffer&&this.timestampBuffer.resize(this.growingCap),"production"===process.env.NODE_ENV||this.growingCapacityWarned||5e4>this.growingCap||(this.growingCapacityWarned=!0,console.warn(`[Semiotic] Growing window buffer reached ${this.growingCap} points (cap ${t}). Large canvas scenes are expensive — prefer a sliding window, aggregation, or an explicit maxCapacity if this is intentional.`)))}const e=I(this.buffer,t,this.timestampBuffer,o);this.xExtent.push(this.getX(t)),this.pushDatumYExtent(t),null!=e&&(this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e))}return this.updateResults.recordData(i.bounded?"replace":"ingest",i.inserts.length),!0}ingestWithResult(t){return this.ingest(t),this.updateResults.last}computeScene(t){const{config:e,buffer:i}=this,o=this.scales,n=this.lastLayout;if(!this.needsFullRebuild&&!e.customLayout&&this.lastLayout&&this.scene.length>0&&this.scales&&0>=(this.config.scalePadding??0)&&(this.lastLayout.width!==t.width||this.lastLayout.height!==t.height))return void this.remapScene(t);this.xExtent.dirty&&this.xExtent.recalculate(i,this.getX),this.yExtent.dirty&&this.rebuildYExtent();const s=this.getBufferArray(),r=this.yExtent.extent;let a=ai(this.xExtent.extent,e.xExtent),l=ai(r,e.yExtent);const c=!(!(h=e.yExtent)||null==h[0]||null==h[1]);var h;const u="exact"===(e.yAxisExtent??e.axisExtent);if("stackedarea"===e.chartType&&!c&&i.size>0){const t=function(t){const{config:e,groups:i,getX:o,getY:n}=t,s="exact"===(e.yAxisExtent??e.axisExtent);if(e.normalize){const i=[0,s?1:1+e.extentPadding];return{yDomain:i,stackExtentCache:{key:`${t.bufferSize}:${t.ingestVersion}:norm`,yDomain:i}}}const r=`${t.bufferSize}:${t.ingestVersion}:${e.baseline??"zero"}:${e.stackOrder??"key"}`;if(t.stackExtentCache&&t.stackExtentCache.key===r)return{yDomain:t.stackExtentCache.yDomain,stackExtentCache:t.stackExtentCache};const a=new Map,l=new Set;let c=0;const h=new Map,u=new Map;for(const t of i){const e=new Map;let i=0;for(const s of t.data){const t=o(s),r=n(s);if(!Number.isFinite(t)||!Number.isFinite(r))continue;e.set(t,(e.get(t)||0)+r),l.add(t),i+=r;const a=(h.get(t)||0)+r;h.set(t,a),a>c&&(c=a)}a.set(t.key,e),u.set(t.key,i)}const g=e.stackOrder??"key",p=(t,e)=>e>t?-1:t>e?1:0;let y,m;if("input"===g)y=i.map(t=>t.key);else if("insideOut"===g){const t=[...i].map(t=>t.key).sort((t,e)=>{const i=(u.get(e)??0)-(u.get(t)??0);return 0!==i?i:p(t,e)}),e=[],o=[];let n=0,s=0;for(const i of t)s>n?(e.push(i),n+=u.get(i)??0):(o.push(i),s+=u.get(i)??0);y=[...o.reverse(),...e]}else y="asc"===g?i.map(t=>t.key).sort((t,e)=>{const i=(u.get(t)??0)-(u.get(e)??0);return 0!==i?i:p(t,e)}):"desc"===g?i.map(t=>t.key).sort((t,e)=>{const i=(u.get(e)??0)-(u.get(t)??0);return 0!==i?i:p(t,e)}):i.map(t=>t.key).sort(p);if("wiggle"===e.baseline||"silhouette"===e.baseline){const t=Array.from(l).sort((t,e)=>t-e),i=d(t,y,(t,e)=>a.get(t)?.get(e)||0,e.baseline);let o=1/0,n=-1/0;for(const e of t){const t=i.get(e)??0,s=h.get(e)??0;o>t&&(o=t),t+s>n&&(n=t+s)}Number.isFinite(o)&&Number.isFinite(n)||(o=0,n=0);const r=n-o,c=s?0:r>0?r*e.extentPadding:1;m=[o-c,n+c]}else if("diverging"===e.baseline){const t=Array.from(l).sort((t,e)=>t-e),[i,o]=f(t,y,(t,e)=>a.get(t)?.get(e)||0),n=o-i,r=s?0:n>0?n*e.extentPadding:1;m=[i-r,o+r]}else m=[0,c+(s?0:c>0?c*e.extentPadding:1)];return{yDomain:m,stackExtentCache:{key:r,yDomain:m}}}({config:e,groups:this.groupData(s),getX:this.getX,getY:this.getY,bufferSize:i.size,ingestVersion:this._ingestVersion,stackExtentCache:this._stackExtentCache});l=t.yDomain,this._stackExtentCache=t.stackExtentCache}else"bar"===e.chartType&&e.binSize&&!c&&i.size>0?l=function(t,e,i,o,n,s,r){const[,a]=function(t,e,i,o,n){const s=ti(t,e,i,o,n);if(0===s.size)return[0,0];let r=0;for(const t of s.values())t.total>r&&(r=t.total);return[0,r]}(t,e,i,o,n);return[0,r?a:a+a*s]}(i,this.getX,this.getY,e.binSize,this.getCategory,e.extentPadding,u):"waterfall"===e.chartType&&!c&&i.size>0?l=function(t,e,i,o){const[n,s]=function(t,e){let i=0,o=0,n=0;for(const s of t){const t=e(s);null==t||Number.isNaN(t)||(n+=t,i>n&&(i=n),n>o&&(o=n))}return[i,o]}(t,e),r=s-n,a=o?0:r>0?r*i:1;return[Math.min(0,n-Math.abs(a)),Math.max(0,s+Math.abs(a))]}(i,this.getY,e.extentPadding,u):c||l[0]===1/0||(l=function(t,e,i){if(!i.length)return t;let[o,n]=t;for(const t of e)for(const e of i){const i=e.getTop(t),s=e.getBottom(t);Number.isFinite(i)&&(o>i&&(o=i),i>n&&(n=i)),Number.isFinite(s)&&(o>s&&(o=s),s>n&&(n=s))}return[o,n]}(l,s,this.resolvedRibbons),l=function(t,e){const i=t[1]-t[0],o=e.exactMode?0:i>0?i*e.extentPadding:1,n=[null!=e.userMin?t[0]:t[0]-o,null!=e.userMax?t[1]:t[1]+o];return"log"!==e.yScaleType||n[0]>0||0>=e.dataYDomain[0]||e.exactMode||null==e.userMin&&(n[0]=e.dataYDomain[0]/(1+e.extentPadding)),n}(l,{exactMode:u,extentPadding:e.extentPadding,userMin:e.yExtent?.[0],userMax:e.yExtent?.[1],yScaleType:e.yScaleType,dataYDomain:r}));l=function(t,e,i){if(!e||i)return t;const o=e[0],n=e[1];return null==o&&null==n?t:[null!=o?o:t[0],null!=n?n:t[1]]}(l,e.yExtent,!!c),({xDomain:a,yDomain:l}=function(t,e,i){let o=t,n=e;if(o[0]===1/0||o[1]===-1/0)if("time"===i){const t=Date.now();o=[t-864e5,t]}else o=[0,1];return n[0]!==1/0&&n[1]!==-1/0||(n=[0,1]),{xDomain:o,yDomain:n}}(a,l,e.xScaleType)),this.scales=function(t){const{config:e,layout:i,xDomain:o,yDomain:n}=t,s="streaming"===e.runtimeMode,r=Math.max(0,Math.min(e.scalePadding||0,Math.min(i.width,i.height)/2-1));if(s){const t="left"===e.arrowOfTime?[i.width-r,r]:[r,i.width-r];return{x:oi().domain(o).range(t),y:li(e.yScaleType,n,[i.height-r,r])}}return{x:li(e.xScaleType,o,[r,i.width-r]),y:li(e.yScaleType,n,[i.height-r,r])}}({config:e,layout:t,xDomain:a,yDomain:l}),this._customLayoutFailedThisBuild=!1;const g=this.buildSceneNodes(t,s);if(this._customLayoutFailedThisBuild)return!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=o,this.lastLayout=n):(this.scene=[],this.spatialIndex.rebuild(this.config.chartType,this.scene)),void(this.needsFullRebuild=!0);this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=g,this.config.decay&&this.applyDecay(this.scene,s),this.config.pulse&&this.applyPulse(this.scene,s,this.currentTime()),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&(this.prevPositionMap.size>0||this.prevPathMap.size>0)&&this.startTransition(),this.spatialIndex.rebuild(this.config.chartType,this.scene),this.needsFullRebuild=!1,this.lastLayout={width:t.width,height:t.height},this.version++}get quadtree(){return this.spatialIndex.quadtree}get maxPointRadius(){return this.spatialIndex.maxPointRadius}remapScene(t){const e=t.width/this.lastLayout.width,i=t.height/this.lastLayout.height;for(const t of this.scene)switch(t.type){case"line":for(const o of t.path)o[0]*=e,o[1]*=i;break;case"area":for(const o of t.topPath)o[0]*=e,o[1]*=i;for(const o of t.bottomPath)o[0]*=e,o[1]*=i;t.clipRect&&(t.clipRect={x:t.clipRect.x*e,y:t.clipRect.y*i,width:t.clipRect.width*e,height:t.clipRect.height*i}),t.strokeColorBands&&(t.strokeColorBands=t.strokeColorBands.map(t=>({...t,y:t.y*i,height:t.height*i})));break;case"point":case"glyph":t.x*=e,t.y*=i;break;case"rect":case"heatcell":t.x*=e,t.y*=i,t.w*=e,t.h*=i;break;case"candlestick":t.x*=e,t.openY*=i,t.closeY*=i,t.highY*=i,t.lowY*=i}const o=this.scales.x.domain(),n=this.scales.y.domain(),s=this.scales.x.range(),r=this.scales.y.range(),a=li,l=Math.max(0,Math.min(this.config.scalePadding||0,Math.min(t.width,t.height)/2-1)),c=r[1]>r[0];this.scales={x:a(this.config.xScaleType,o,s[0]>s[1]?[t.width-l,l]:[l,t.width-l]),y:a(this.config.yScaleType,n,c?[l,t.height-l]:[t.height-l,l])},this.lastLayout={width:t.width,height:t.height},this.spatialIndex.rebuild(this.config.chartType,this.scene),this.version++}buildSceneNodes(t,e){const{config:i,scales:o}=this;if(!o)return[];if(i.customLayout){const n={data:e,scales:o,dimensions:{width:t.width,height:t.height,margin:i.layoutMargin??{top:0,right:0,bottom:0,left:0},plot:{x:0,y:0,width:t.width,height:t.height}},theme:{semantic:i.themeSemantic??{},categorical:i.themeCategorical??Pt},resolveColor:(t,e)=>{const o=this.resolveGroupColor(t);if(o)return o;const n=this.resolveLineStyle(t,e);return n.stroke?n.stroke:"string"==typeof n.fill?n.fill:i.themeSemantic?.primary??"#4e79a7"},config:i.layoutConfig??{},selection:i.layoutSelection??null};let s;try{s=i.customLayout(n)}catch(t){const e=null!==this.lastCustomLayoutResult,o=Q("xy",t,e,this.version);this.lastCustomLayoutFailure=o,this._customLayoutFailedThisBuild=!0,"production"!==process.env.NODE_ENV&&console.error("[semiotic] customLayout threw:",t);try{i.onLayoutError?.(o)}catch(t){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",t)}return e?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[])}this.customLayoutOverlays=s.overlays??null,this.lastCustomLayoutResult=s,this.lastCustomLayoutFailure=null;const r=s.nodes??[];if(this._customRestyle=s.restyle,this.hasCustomRestyle=!!s.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(const t of r)t.style&&this._baseStyles.set(t,t.style);this.applyCustomRestyle(r,i.layoutSelection??null)}return vt({label:"customLayout",nodes:r,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),r}if(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,0===e.length)return[];const n={scales:o,config:i,getX:this.getX,getY:this.getY,getY0:this.getY0,getSize:this.getSize,getColor:this.getColor,getSymbol:this.getSymbol,getGroup:this.getGroup,getCategory:this.getCategory,getPointId:this.getPointId,ribbons:this.resolvedRibbons,getOpen:this.getOpen,getHigh:this.getHigh,getLow:this.getLow,getClose:this.getClose,resolveLineStyle:(t,e)=>this.resolveLineStyle(t,e),resolveAreaStyle:(t,e)=>this.resolveAreaStyle(t,e),resolveBoundsStyle:(t,e)=>this.resolveBoundsStyle(t,e),resolveColorMap:t=>this.resolveColorMap(t),resolveGroupColor:t=>this.resolveGroupColor(t),groupData:t=>this.groupData(t),barCategoryCache:this._barCategoryCache};switch(i.chartType){case"line":return function(t,e){const i=t.groupData(e),o=[],n=t.config.annotations?.filter(Ue).map(t=>({value:t.value,color:t.color,thresholdType:t.thresholdType||"greater"}));if(t.ribbons&&t.ribbons.length>0){const{perSeries:n,aggregate:s}=F(t.ribbons);if(s.length>0&&o.push(...N(t,e,s)),n.length>0)for(const e of i)o.push(...W(t,e.data,e.key,n))}for(const e of i){const i=t.resolveLineStyle(e.key,e.data[0]),s=l(e.data,t.scales,t.getX,t.getY,i,e.key);n&&n.length>0&&(s.colorThresholds=n),t.config.curve&&"linear"!==t.config.curve&&(s.curve=t.config.curve),t.config.lineGradient&&(s.strokeGradient=t.config.lineGradient),o.push(s)}return qe(t,i,o),o}(n,e);case"area":return function(t,e){const i=t.groupData(e),o=[];if(t.ribbons&&t.ribbons.length>0){const{perSeries:n,aggregate:s}=F(t.ribbons);if(s.length>0&&o.push(...N(t,e,s)),n.length>0)for(const e of i)o.push(...W(t,e.data,e.key,n))}const n=t.scales.y.domain(),r=n[0],a=t.config.semanticLineStops?.filter(t=>Number.isFinite(t.offset)).map(t=>({value:n[0]+Math.max(0,Math.min(1,t.offset))*(n[1]-n[0]),color:t.color,opacity:t.opacity,thresholdType:"greater"})).sort((t,e)=>t.value-e.value),l=a&&a.length>0?(()=>{const e=a.reduce((t,e)=>(t.at(-1)?.value===e.value?t[t.length-1]=e:t.push(e),t),[]),i=[{from:n[0],to:e[0].value,color:e[0].color,opacity:e[0].opacity}];for(let t=0;e.length>t;t++)i.push({from:e[t].value,to:e[t+1]?.value??n[1],color:e[t].color,opacity:e[t].opacity});return i.map(({from:e,to:i,color:o,opacity:n})=>{const s=t.scales.y(e),r=t.scales.y(i);return{y:Math.min(s,r),height:Math.abs(r-s),color:o,...null!=n&&{opacity:n}}}).filter(t=>t.height>0)})():void 0,c=t.getY0?e=>{const i=t.getY0(e);return null==i?r:i}:void 0;for(const e of i){const i=t.resolveAreaStyle(e.key,e.data[0]),n=s(e.data,t.scales,t.getX,t.getY,r,i,e.key,c),h=Ke(t.config.gradientFill);h&&(n.fillGradient=h),t.config.curve&&"linear"!==t.config.curve&&(n.curve=t.config.curve),t.config.lineGradient&&(n.strokeGradient=t.config.lineGradient),a&&a.length>0&&(n.colorThresholds=a,n.strokeColorBands=l),o.push(n)}return qe(t,i,o),o}(n,e);case"mixed":return function(t,e){const i=t.groupData(e),o=[],n=t.config.areaGroups||new Set;if(t.ribbons&&t.ribbons.length>0){const{perSeries:n,aggregate:s}=F(t.ribbons);if(s.length>0&&o.push(...N(t,e,s)),n.length>0)for(const e of i)o.push(...W(t,e.data,e.key,n))}const r=t.scales.y.domain()[0],a=t.getY0?e=>{const i=t.getY0(e);return null==i?r:i}:void 0;for(const e of i)if(n.has(e.key)){const i=t.resolveAreaStyle(e.key,e.data[0]),n=s(e.data,t.scales,t.getX,t.getY,r,i,e.key,a),l=Ke(t.config.gradientFill);l&&(n.fillGradient=l),t.config.curve&&"linear"!==t.config.curve&&(n.curve=t.config.curve),t.config.lineGradient&&(n.strokeGradient=t.config.lineGradient),o.push(n)}else{const i=t.resolveLineStyle(e.key,e.data[0]),n=l(e.data,t.scales,t.getX,t.getY,i,e.key);t.config.curve&&"linear"!==t.config.curve&&(n.curve=t.config.curve),t.config.lineGradient&&(n.strokeGradient=t.config.lineGradient),o.push(n)}return qe(t,i,o),o}(n,e);case"stackedarea":return function(t,e){const i=t.groupData(e),o=t.config.stackOrder??"key",n=()=>i.sort((t,e)=>e.key>t.key?-1:t.key>e.key?1:0);if("input"===o);else if("key"===o)n();else if("asc"===o||"desc"===o||"insideOut"===o){const e=new Map;for(const o of i){let i=0;for(const e of o.data){const o=t.getX(e),n=t.getY(e);Number.isFinite(o)&&Number.isFinite(n)&&(i+=n)}e.set(o.key,i)}const n=(t,e)=>e>t?-1:t>e?1:0;if("asc"===o)i.sort((t,i)=>{const o=(e.get(t.key)??0)-(e.get(i.key)??0);return 0!==o?o:n(t.key,i.key)});else if("desc"===o)i.sort((t,i)=>{const o=(e.get(i.key)??0)-(e.get(t.key)??0);return 0!==o?o:n(t.key,i.key)});else{const t=[...i].sort((t,i)=>{const o=(e.get(i.key)??0)-(e.get(t.key)??0);return 0!==o?o:n(t.key,i.key)}),o=[],s=[];let r=0,a=0;for(const i of t)a>r?(o.push(i),r+=e.get(i.key)??0):(s.push(i),a+=e.get(i.key)??0);i.length=0,i.push(...s.reverse(),...o)}}else n();const s=t.config.curve&&"linear"!==t.config.curve?t.config.curve:void 0,r=t.config.normalize?"zero":t.config.baseline??"zero",{nodes:a,stackedTops:l}=u(i,t.scales,t.getX,t.getY,(e,i)=>t.resolveAreaStyle(e,i),t.config.normalize,s,r),c=a;if(t.config.pointStyle){const e=new WeakMap;for(const o of i){const i=l.get(o.key);if(i)for(const n of o.data){const o=t.getX(n),s=t.getY(n);null==o||Number.isNaN(o)||null==s||Number.isNaN(s)||!i.has(o)||e.set(n,i.get(o))}}const o=i=>e.get(i)??t.getY(i);qe(t,i,c,o)}return c}(n,e);case"scatter":case"bubble":return function(t,e){const i=[],o="bubble"===t.config.chartType?10:5,n=t.config.sizeRange||[3,15];let s=null;if(t.getSize&&!t.config.pointStyle){const i=e.map(e=>t.getSize(e)).filter(t=>null!=t&&!Number.isNaN(t));if(i.length>0){let t=1/0,e=-1/0;for(const o of i)t>o&&(t=o),o>e&&(e=o);s=i=>t===e?(n[0]+n[1])/2:n[0]+(i-t)/(e-t)*(n[1]-n[0])}}const r=t.getColor?t.resolveColorMap(e):null,a=t.config.themeSemantic?.primary||"#4e79a7",l=t.getSymbol,h=l?Zt(l,t.config.symbolMap):null;for(const n of e){let e=t.config.pointStyle?t.config.pointStyle(n):{fill:a,opacity:.8},l=e.r||o;if(s&&t.getSize){const e=t.getSize(n);null==e||Number.isNaN(e)||(l=s(e))}if(r&&t.getColor&&!e.fill){const i=t.getColor(n);i&&r.has(i)&&(e={...e,fill:r.get(i)})}const u=t.getPointId?t.getPointId(n)+"":void 0;if(h){const o=h(n),s=g(n,t.scales,t.getX,t.getY,Math.PI*l*l,o,e,u);s&&i.push(s)}else{const o=c(n,t.scales,t.getX,t.getY,l,e,u);o&&i.push(o)}}return i}(n,e);case"heatmap":return function(t,e,i){if(t.config.heatmapAggregation)return function(t,e,i){const o=Math.max(1,Math.floor(t.config.heatmapXBins??20)),n=Math.max(1,Math.floor(t.config.heatmapYBins??20)),s=t.config.heatmapAggregation??"count",r=C(t.config.valueAccessor,"value");if(!t.scales||0===e.length)return[];const[l,c]=t.scales.x.domain(),[h,u]=t.scales.y.domain(),g=(c-l||1)/o,f=(u-h||1)/n,d=o*n;if(d>1e6)return[];const p=new Int32Array(d),y=new Float64Array(d);for(let i=0;e.length>i;i++){const s=e[i],a=t.getX(s),c=t.getY(s);if(!isFinite(a)||!isFinite(c))continue;const u=Math.min(Math.floor((a-l)/g),o-1),d=Math.min(Math.floor((c-h)/f),n-1);if(0>u||0>d)continue;const m=d*o+u;p[m]++;const x=r(s);y[m]+=isFinite(x)?x:0}let m=1/0,x=-1/0;for(let t=0;d>t;t++){if(0===p[t])continue;let e;switch(s){case"sum":e=y[t];break;case"mean":e=y[t]/p[t];break;default:e=p[t]}m>e&&(m=e),e>x&&(x=e)}if(!isFinite(m))return[];const v=x-m||1,b=t.config.heatmapColorScale,k=b?void 0:Ze("string"==typeof t.config.colorScheme?t.config.colorScheme:t.config.themeSequential||"blues"),w=255/v,A=i.width/o,S=i.height/n,_=t.config.showValues,M=t.config.heatmapValueFormat,P=[];for(let e=0;n>e;e++){const i=e*o;for(let r=0;o>r;r++){const o=i+r;if(0===p[o])continue;let c;switch(s){case"sum":c=y[o];break;case"mean":c=y[o]/p[o];break;default:c=p[o]}const u=Math.min((c-m)*w+.5|0,255),d=b?b(c):k[u],x={xi:r,yi:e,value:c,count:p[o],sum:y[o],xCenter:l+(r+.5)*g,yCenter:h+(e+.5)*f,agg:s};P.push(Qe(a(r*A,(n-1-e)*S,A,S,d,x,_?{value:c,showValues:!0,valueFormat:M}:{value:c}),x,t))}}return P}(t,e,i);if(0===e.length)return[];const o=C(t.config.valueAccessor,"value"),n=S(t.config.xAccessor,"x"),s=S(t.config.yAccessor,"y"),r=new Map,l=new Map,c=Array(e.length),h=Array(e.length);for(let t=0;e.length>t;t++){const i=e[t],o=n(i),a=s(i);c[t]=o,h[t]=a,r.has(o)||r.set(o,r.size),l.has(a)||l.set(a,l.size)}const u=r.size,g=l.size;if(0===u||0===g)return[];const f=Array.from(r.keys()),d=Array.from(l.keys()),p=f.every(t=>"number"==typeof t&&!isNaN(t)),y=d.every(t=>"number"==typeof t&&!isNaN(t));if(p){f.sort((t,e)=>Number(t)-Number(e)),r.clear();for(let t=0;f.length>t;t++)r.set(f[t],t)}if(y){d.sort((t,e)=>Number(t)-Number(e)),l.clear();for(let t=0;d.length>t;t++)l.set(d[t],t)}const m=new Float64Array(e.length),x=new Float64Array(e.length),v=Array(e.length),b=new Map;let k=0;for(let t=0;e.length>t;t++){const i=e[t],n=r.get(c[t]),s=l.get(h[t]);if(void 0===n||void 0===s)continue;const a=o(i),g=s*u+n,f=b.get(g);let d;void 0!==f?d=f:(d=k++,b.set(g,d)),m[d]=g,x[d]=a,v[d]=i}let w=1/0,A=-1/0;for(let t=0;k>t;t++){const e=x[t];isFinite(e)&&(w>e&&(w=e),e>A&&(A=e))}if(!isFinite(w)||!isFinite(A))return[];const _=t.config.heatmapColorScale,M=_?void 0:Ze("string"==typeof t.config.colorScheme?t.config.colorScheme:t.config.themeSequential||"blues"),P=255/(A-w||1),Y=i.width/u,R=i.height/g,T=t.config.showValues,N=t.config.heatmapValueFormat,W=[];for(let e=0;k>e;e++){const i=x[e];if(!isFinite(i))continue;const o=m[e],n=o%u,s=(o-n)/u,r=Math.min((i-w)*P+.5|0,255),l=_?_(i):M[r],c=v[e];W.push(Qe(a(n*Y,(g-1-s)*R,Y,R,l,c,T?{value:i,showValues:!0,valueFormat:N}:{value:i}),c,t))}return W}(n,e,t);case"bar":{const t=function(t,e){if(!t.config.binSize)return{nodes:[],binBoundaries:[]};const i=ti(e,t.getX,t.getY,t.config.binSize,t.getCategory);if(0===i.size)return{nodes:[],binBoundaries:[]};let o=null;if(t.getCategory){const e=new Set;for(const t of i.values())for(const i of t.categories.keys())e.add(i);const n=t.config.barColors?Object.keys(t.config.barColors):[],s=new Set(n),r=Array.from(e).filter(t=>!s.has(t)).sort(),a=n.filter(t=>e.has(t)),l=a.join("\0")+""+r.join("\0");t.barCategoryCache&&t.barCategoryCache.key===l?o=t.barCategoryCache.order:(o=[...a,...r],t.barCategoryCache={key:l,order:o})}const n=[],s=t.scales,[r,a]=s.x.domain(),l=t.config.barStyle,c=t.config.themeSemantic?.primary,u=l?.gap,g="number"!=typeof u||0>u?1:u,f={};l?.stroke&&(f.stroke=l.stroke),"number"==typeof l?.strokeWidth&&(f.strokeWidth=l.strokeWidth),"number"==typeof l?.opacity&&(f.opacity=l.opacity),l?.cursor&&(f.cursor=l.cursor);for(const e of i.values()){const i=Math.max(e.start,r),u=Math.min(e.end,a);if(i>=u)continue;const d=s.x(i),p=s.x(u),y=Math.abs(p-d),m=y>g+1?g:0,x=Math.min(d,p)+m/2,v=Math.max(y-m,1);if(v>0)if(o&&e.categories.size>0){let i=0;for(const r of o){const o=e.categories.get(r)||0;if(0===o)continue;const a=s.y(i),u=s.y(i+o),g=Math.min(a,u),d=Math.abs(a-u),p=(t.config.barColors?he(t.config.barColors,r):void 0)??l?.fill??c??"#4e79a7",y={binStart:e.start,binEnd:e.end,total:e.total,category:r,categoryValue:o},m=t.config.areaStyle?.(y)??{};n.push(h(x,g,v,d,{fill:p,...f,...m},y,r)),i+=o}}else{const i=s.y(0),o=s.y(e.total),r=Math.min(i,o),a=Math.abs(i-o),u=l?.fill||c||"#007bff",g={binStart:e.start,binEnd:e.end,total:e.total},d=t.config.areaStyle?.(g)??{};n.push(h(x,r,v,a,{fill:u,...f,...d},g))}}const d=new Set;for(const t of i.values())d.add(t.start),d.add(t.end);return{nodes:n,binBoundaries:Array.from(d).sort((t,e)=>t-e)}}(n,e);return this._barCategoryCache=n.barCategoryCache??null,this._binBoundaries=t.binBoundaries,t.nodes}case"swarm":return function(t,e){const i=[],o=t.config.swarmStyle||{},n=o.radius??3,s=o.fill??t.config.themeSemantic?.primary??"#007bff",r=o.opacity??.7,a=o.stroke,l=o.strokeWidth,c=o.cursor;for(const o of e){const e=t.getX(o),h=t.getY(o);if(null==h||Number.isNaN(h))continue;const u=t.scales.x(e),g=t.scales.y(h);let f=s;if(t.getCategory){const e=t.getCategory(o)+"";f=(t.config.barColors?he(t.config.barColors,e):void 0)??f}const{r:d,...p}=t.config.pointStyle?.(o)??{},y={type:"point",x:u,y:g,r:d??n,style:{fill:f,opacity:r,stroke:a,strokeWidth:l,cursor:c,...p},datum:o};t.getPointId&&(y.pointId=t.getPointId(o)+""),i.push(y)}return i}(n,e);case"waterfall":return function(t,e,i){const o=[],n=t.scales,s=t.config.waterfallStyle,r=e.filter(e=>{const i=t.getY(e),o=t.getX(e);return null!=i&&!Number.isNaN(i)&&null!=o&&isFinite(o)});if(0===r.length)return o;const a=s?.positiveColor??t.config.themeSemantic?.success??"#28a745",l=s?.negativeColor??t.config.themeSemantic?.danger??"#dc3545",c=s?.gap??1,u=s?.stroke,g=s?.strokeWidth,f=s?.opacity;let d=0;for(let e=0;r.length>e;e++){const p=r[e],y=t.getX(p),m=t.getY(p),x=d+m;let v;v=r.length-1>e?t.getX(r[e+1])-y:e>0?y-t.getX(r[e-1]):0;const b=n.x(y),k=0!==v?n.x(y+v):b+i.width/10,w=Math.min(b,k)+c/2,A=Math.max(b,k)-c/2-w;if(0>=A){d=x;continue}const C=n.y(d),S=n.y(x),_=Math.min(C,S),M=Math.abs(C-S),P=0>m?l:a,Y={...p,baseline:d,cumEnd:x,delta:m,_connectorStroke:s?.connectorStroke,_connectorWidth:s?.connectorWidth},R={fill:P,stroke:u,strokeWidth:g,opacity:f,cursor:s?.cursor,...t.config.areaStyle?.(Y)};o.push(h(w,_,A,M,R,Y)),d=x}return o}(n,e,t);case"candlestick":return function(t,e,i){if(!t.getHigh||!t.getLow||!t.scales)return[];const o=t.config.candlestickRangeMode??!1;if(!(o||t.getOpen&&t.getClose))return[];const n=[],s=t.config.candlestickStyle||{},r=s.rangeColor||"#6366f1",a=o?r:s.upColor||"#28a745",l=o?r:s.downColor||"#dc3545",c=o?r:s.wickColor||"#333",h=s.wickWidth||(o?2:1),u=e.map(e=>t.getX(e)).filter(t=>null!=t&&!Number.isNaN(t)).sort((t,e)=>t-e);let g=s.bodyWidth??0;if(null==s.bodyWidth)if(u.length>1){let e=1/0;for(let i=1;u.length>i;i++){const o=Math.abs(t.scales.x(u[i])-t.scales.x(u[i-1]));o>0&&e>o&&(e=o)}g=e!==1/0?Math.max(2,Math.min(.6*e,20)):6}else g=6;for(const r of e){const e=t.getX(r);if(null==e||Number.isNaN(e))continue;const u=t.getHigh(r),f=t.getLow(r);if(null==u||Number.isNaN(u)||null==f||Number.isNaN(f))continue;const d=o?u:t.getOpen(r),p=o?f:t.getClose(r);if(!o&&[d,p].some(t=>null==t||Number.isNaN(t)))continue;const y=p>=d,m={type:"candlestick",x:t.scales.x(e),openY:t.scales.y(d),closeY:t.scales.y(p),highY:t.scales.y(u),lowY:t.scales.y(f),bodyWidth:g,upColor:a,downColor:l,wickColor:c,wickWidth:h,isUp:y,style:{cursor:s.cursor},datum:r};o&&(m.isRange=!0,m.dotRadius=Math.max(2,Math.min(g/2,.12*i.height))),n.push(m)}return n}(n,e,t);default:return[]}}resolveBoundsStyle(t,e){return function(t,e,i,o){const n=t.boundsStyle;if("function"==typeof n)return n(i||{},e);if(n&&"object"==typeof n)return n;const s=o(e,i);return{fill:s.stroke||t.themeSemantic?.primary||"#4e79a7",fillOpacity:.2,stroke:"none",cursor:s.cursor}}(this.config,t,e,(t,e)=>this.resolveLineStyle(t,e))}computeDecayOpacity(t,e){const i=this.config.decay;return i&&e>1?Z(i,t,e):1}getDatumIndexMap(t){if(this._datumIndexCache&&this._datumIndexCache.version===this._ingestVersion)return this._datumIndexCache.map;const e=K(t);return this._datumIndexCache={version:this._ingestVersion,map:e},e}applyDecay(t,e){this.config.decay&&q(this.config.decay,t,e,this.getDatumIndexMap(e))}refreshPulse(t){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),t)}hasActivePulsesAt(t){return!!this.config.pulse&&L(this.config.pulse,this.timestampBuffer,t)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}get transitionContext(){return{runtimeMode:this.config.runtimeMode,getX:this.getX,getY:this.getY,getCategory:this.getCategory}}snapshotPositions(){!function(t,e,i,o){i.clear(),o.clear();for(let n=0;e.length>n;n++){const s=e[n],r=je(t,s,n);r&&("point"===s.type?i.set(r,{x:s.x,y:s.y,r:s.r,opacity:He(s.style)}):"glyph"===s.type?i.set(r,{x:s.x,y:s.y,r:s.size,opacity:He(s.style),glyph:s.glyph}):"rect"===s.type||"heatcell"===s.type?i.set(r,{x:s.x,y:s.y,w:s.w,h:s.h,opacity:He(s.style)}):"candlestick"===s.type?i.set(r,{x:s.x,y:s.openY,w:s.bodyWidth,openY:s.openY,closeY:s.closeY,highY:s.highY,lowY:s.lowY,opacity:He(s.style)}):"line"===s.type?o.set(r,{path:s.path.map(t=>[t[0],t[1]]),opacity:s.style?.opacity}):"area"===s.type&&o.set(r,{topPath:s.topPath.map(t=>[t[0],t[1]]),bottomPath:s.bottomPath.map(t=>[t[0],t[1]]),opacity:s.style?.opacity}))}}(this.transitionContext,this.scene,this.prevPositionMap,this.prevPathMap)}synthesizeIntroPositions(){this.prevPositionMap.clear(),this.prevPathMap.clear();const t=this.scales?.y(0)??0;for(let e=0;this.scene.length>e;e++){const i=this.scene[e],o=je(this.transitionContext,i,e);o&&("point"===i.type?this.prevPositionMap.set(o,{x:i.x,y:i.y,r:0,opacity:0}):"rect"===i.type?this.prevPositionMap.set(o,{x:i.x,y:t,w:i.w,h:0,opacity:i.style.opacity??1}):"heatcell"===i.type?this.prevPositionMap.set(o,{x:i.x,y:i.y,w:i.w,h:i.h,opacity:0}):"line"===i.type?(i._introClipFraction=0,this.prevPathMap.set(o,{path:i.path.map(t=>[t[0],t[1]]),opacity:i.style.opacity})):"area"===i.type&&(i._introClipFraction=0,this.prevPathMap.set(o,{topPath:i.topPath.map(t=>[t[0],t[1]]),bottomPath:i.bottomPath.map(t=>[t[0],t[1]]),opacity:i.style.opacity})))}}startTransition(){if(!this.config.transition)return;const t=function(t,e,i,o,n,s=Qt()){if(0===o.size&&0===n.size)return i;const r=e.duration??300;if(i.exitNodes.length>0){const t=new Set(i.exitNodes);i.scene=i.scene.filter(e=>!t.has(e)),i.exitNodes=[]}let a=!1;const l=new Set,c=new Set;for(let e=0;i.scene.length>e;e++){const s=i.scene[e],r=je(t,s,e);if(!r)continue;if(s._transitionKey=r,"line"===s.type||"area"===s.type){const t=n.get(r);if(t){if(c.add(r),"line"===s.type&&t.path&&t.path.length===s.path.length){s._targetPath=s.path.map(t=>[t[0],t[1]]),s._prevPath=t.path;for(let e=0;s.path.length>e;e++)s.path[e]=[t.path[e][0],t.path[e][1]];a=!0}else if("area"===s.type&&t.topPath&&t.bottomPath&&t.topPath.length===s.topPath.length&&t.bottomPath.length===s.bottomPath.length){s._targetTopPath=s.topPath.map(t=>[t[0],t[1]]),s._targetBottomPath=s.bottomPath.map(t=>[t[0],t[1]]),s._prevTopPath=t.topPath,s._prevBottomPath=t.bottomPath;for(let e=0;s.topPath.length>e;e++)s.topPath[e]=[t.topPath[e][0],t.topPath[e][1]];for(let e=0;s.bottomPath.length>e;e++)s.bottomPath[e]=[t.bottomPath[e][0],t.bottomPath[e][1]];a=!0}s._targetOpacity=s.style.opacity??1,s._startOpacity=t.opacity??s.style.opacity??1}else s._targetOpacity=s.style.opacity??1,s._startOpacity=0,s.style={...s.style,opacity:0},a=!0;continue}const h=o.get(r);if("point"===s.type)if(h){l.add(r);const t={x:s.x,y:s.y,r:s.r};s._targetOpacity=He(s.style),h.x===t.x&&h.y===t.y&&h.r===t.r||(s._targetX=t.x,s._targetY=t.y,s._targetR=t.r,s.x=h.x,s.y=h.y,s.r=h.r??s.r,a=!0)}else s._targetOpacity=He(s.style),s.style={...s.style,opacity:0},a=!0;else if("glyph"===s.type)if(h){l.add(r);const t={x:s.x,y:s.y,size:s.size};s._targetOpacity=He(s.style),h.x===t.x&&h.y===t.y&&h.r===t.size||(s._targetX=t.x,s._targetY=t.y,s._targetR=t.size,s.x=h.x,s.y=h.y,s.size=h.r??s.size,a=!0)}else s._targetOpacity=He(s.style),s.style={...s.style,opacity:0},a=!0;else if("rect"===s.type)if(h){l.add(r);const t={x:s.x,y:s.y,w:s.w,h:s.h};s._targetOpacity=He(s.style),h.x===t.x&&h.y===t.y&&h.w===t.w&&h.h===t.h||(s._targetX=t.x,s._targetY=t.y,s._targetW=t.w,s._targetH=t.h,s.x=h.x,s.y=h.y,s.w=h.w??s.w,s.h=h.h??s.h,a=!0)}else s._targetOpacity=He(s.style),s.style={...s.style,opacity:0},a=!0;else if("heatcell"===s.type)if(h){l.add(r);const t={x:s.x,y:s.y,w:s.w,h:s.h};s._targetOpacity=He(s.style),h.x===t.x&&h.y===t.y&&h.w===t.w&&h.h===t.h||(s._targetX=t.x,s._targetY=t.y,s._targetW=t.w,s._targetH=t.h,s.x=h.x,s.y=h.y,s.w=h.w??s.w,s.h=h.h??s.h,a=!0)}else s._targetOpacity=He(s.style),s.style={...s.style||{},opacity:0},a=!0;else if("candlestick"===s.type)if(h&&null!=h.openY){l.add(r);const t={x:s.x,openY:s.openY,closeY:s.closeY,highY:s.highY,lowY:s.lowY};s._targetOpacity=He(s.style),(h.x!==t.x||h.openY!==t.openY||h.closeY!==t.closeY||h.highY!==t.highY||h.lowY!==t.lowY)&&(s._targetX=t.x,s._targetOpenY=t.openY,s._targetCloseY=t.closeY,s._targetHighY=t.highY,s._targetLowY=t.lowY,s.x=h.x,s.openY=h.openY,s.closeY=h.closeY??s.closeY,s.highY=h.highY??s.highY,s.lowY=h.lowY??s.lowY,a=!0)}else s._targetOpacity=He(s.style),s.style={...s.style||{},opacity:0},a=!0}for(const[t,e]of n)if(!c.has(t))if(t.startsWith("l:")&&e.path){const o={type:"line",path:e.path.map(t=>[t[0],t[1]]),group:t.slice(2),style:{stroke:"#999",strokeWidth:1,opacity:e.opacity??1},_targetOpacity:0,_transitionKey:t,datum:null};i.exitNodes.push(o),a=!0}else if(t.startsWith("a:")&&e.topPath&&e.bottomPath){const o={type:"area",topPath:e.topPath.map(t=>[t[0],t[1]]),bottomPath:e.bottomPath.map(t=>[t[0],t[1]]),group:t.slice(2),style:{fill:"#999",opacity:e.opacity??1},_targetOpacity:0,_transitionKey:t,datum:null};i.exitNodes.push(o),a=!0}for(const[t,e]of o)if(!l.has(t)){if(t.startsWith("p:"))i.exitNodes.push({type:"point",x:e.x,y:e.y,r:e.r??3,style:{opacity:e.opacity??1},datum:null,_targetOpacity:0,_transitionKey:t});else if(t.startsWith("g:")&&e.glyph)i.exitNodes.push({type:"glyph",x:e.x,y:e.y,size:e.r??12,glyph:e.glyph,color:"#999",accent:"#999",style:{opacity:e.opacity??1},datum:null,_targetOpacity:0,_transitionKey:t});else if(t.startsWith("r:"))i.exitNodes.push({type:"rect",x:e.x,y:e.y,w:e.w??0,h:e.h??0,style:{opacity:e.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:t});else if(t.startsWith("h:"))i.exitNodes.push({type:"heatcell",x:e.x,y:e.y,w:e.w??0,h:e.h??0,fill:"#999",datum:null,style:{opacity:e.opacity??1},_targetOpacity:0,_transitionKey:t});else if(t.startsWith("c:")){const o=e.openY??e.y;i.exitNodes.push({type:"candlestick",x:e.x,openY:o,closeY:e.closeY??o,highY:e.highY??o,lowY:e.lowY??o,bodyWidth:e.w??6,upColor:"#999",downColor:"#999",wickColor:"#999",wickWidth:1,isUp:!0,datum:null,style:{opacity:e.opacity??1},_targetOpacity:0,_transitionKey:t})}a=!0}return i.exitNodes.length>0&&(i.scene=[...i.scene,...i.exitNodes]),a&&(i.activeTransition={startTime:s,duration:r}),i}(this.transitionContext,this.config.transition,{scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},this.prevPositionMap,this.prevPathMap,this.currentTime());this.scene=t.scene,this.exitNodes=t.exitNodes,this.activeTransition=t.activeTransition}advanceTransition(t){if(!this.activeTransition||!this.config.transition)return!1;const e={scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},i=function(t,e,i,o){if(!i.activeTransition)return!1;const n=Bt(t,i.activeTransition),s=Ft(n,"linear"===e.easing?"linear":"ease-out-cubic");for(const t of i.scene){const e=t._transitionKey;if("point"===t.type){if(void 0!==t._targetOpacity){const i=e?o.get(e):void 0;t.style.opacity=Jt(i?i.opacity??1:0,t._targetOpacity,s)}if(void 0===t._targetX)continue;if(!e)continue;const i=o.get(e);if(!i)continue;t.x=Jt(i.x,t._targetX,s),t.y=Jt(i.y,t._targetY,s),void 0!==t._targetR&&void 0!==i.r&&(t.r=Jt(i.r,t._targetR,s))}else if("glyph"===t.type){if(void 0!==t._targetOpacity){const i=e?o.get(e):void 0;t.style.opacity=Jt(i?i.opacity??1:0,t._targetOpacity,s)}if(void 0===t._targetX)continue;if(!e)continue;const i=o.get(e);if(!i)continue;t.x=Jt(i.x,t._targetX,s),t.y=Jt(i.y,t._targetY,s),void 0!==t._targetR&&void 0!==i.r&&(t.size=Jt(i.r,t._targetR,s))}else if("rect"===t.type){if(void 0!==t._targetOpacity){const i=e?o.get(e):void 0;t.style.opacity=Jt(i?i.opacity??1:0,t._targetOpacity,s)}if(void 0===t._targetX)continue;if(!e)continue;const i=o.get(e);if(!i)continue;t.x=Jt(i.x,t._targetX,s),t.y=Jt(i.y,t._targetY,s),void 0!==i.w&&(t.w=Jt(i.w,t._targetW,s)),void 0!==i.h&&(t.h=Jt(i.h,t._targetH,s))}else if("heatcell"===t.type){if(void 0!==t._targetOpacity){const i=e?o.get(e):void 0;t.style={...t.style||{},opacity:Jt(i?i.opacity??1:0,t._targetOpacity,s)}}if(void 0===t._targetX)continue;if(!e)continue;const i=o.get(e);if(!i)continue;t.x=Jt(i.x,t._targetX,s),t.y=Jt(i.y,t._targetY,s),void 0!==i.w&&(t.w=Jt(i.w,t._targetW,s)),void 0!==i.h&&(t.h=Jt(i.h,t._targetH,s))}else if("candlestick"===t.type){if(void 0!==t._targetOpacity){const i=e?o.get(e):void 0;t.style={...t.style||{},opacity:Jt(i?i.opacity??1:0,t._targetOpacity,s)}}if(void 0===t._targetX)continue;if(!e)continue;const i=o.get(e);if(!i)continue;t.x=Jt(i.x,t._targetX,s),void 0!==i.openY&&(t.openY=Jt(i.openY,t._targetOpenY,s)),void 0!==i.closeY&&(t.closeY=Jt(i.closeY,t._targetCloseY,s)),void 0!==i.highY&&(t.highY=Jt(i.highY,t._targetHighY,s)),void 0!==i.lowY&&(t.lowY=Jt(i.lowY,t._targetLowY,s))}else if("line"===t.type){void 0!==t._targetOpacity&&(t.style={...t.style,opacity:Jt(t._startOpacity??0,t._targetOpacity,s)}),void 0!==t._introClipFraction&&(t._introClipFraction=s);const e=t._prevPath,i=t._targetPath;if(e&&i&&e.length===t.path.length)for(let o=0;t.path.length>o;o++)t.path[o][0]=Jt(e[o][0],i[o][0],s),t.path[o][1]=Jt(e[o][1],i[o][1],s)}else if("area"===t.type){void 0!==t._targetOpacity&&(t.style={...t.style,opacity:Jt(t._startOpacity??0,t._targetOpacity,s)}),void 0!==t._introClipFraction&&(t._introClipFraction=s);const e=t._prevTopPath,i=t._prevBottomPath,o=t._targetTopPath,n=t._targetBottomPath;if(e&&o&&e.length===t.topPath.length)for(let i=0;t.topPath.length>i;i++)t.topPath[i][0]=Jt(e[i][0],o[i][0],s),t.topPath[i][1]=Jt(e[i][1],o[i][1],s);if(i&&n&&i.length===t.bottomPath.length)for(let e=0;t.bottomPath.length>e;e++)t.bottomPath[e][0]=Jt(i[e][0],n[e][0],s),t.bottomPath[e][1]=Jt(i[e][1],n[e][1],s)}}if(n>=1){for(const t of i.scene){if(void 0!==t._targetOpacity){const e=t._targetOpacity;t.style="line"===t.type||"area"===t.type?{...t.style,opacity:0===e?0:e}:{...t.style||{},opacity:0===e?0:e},t._targetOpacity=void 0}if("point"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,void 0!==t._targetR&&(t.r=t._targetR),t._targetX=void 0,t._targetY=void 0,t._targetR=void 0}else if("glyph"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,void 0!==t._targetR&&(t.size=t._targetR),t._targetX=void 0,t._targetY=void 0,t._targetR=void 0}else if("rect"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,t.w=t._targetW,t.h=t._targetH,t._targetX=void 0,t._targetY=void 0,t._targetW=void 0,t._targetH=void 0}else if("heatcell"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,t.w=t._targetW,t.h=t._targetH,t._targetX=void 0,t._targetY=void 0,t._targetW=void 0,t._targetH=void 0}else if("candlestick"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,void 0!==t._targetOpenY&&(t.openY=t._targetOpenY),void 0!==t._targetCloseY&&(t.closeY=t._targetCloseY),void 0!==t._targetHighY&&(t.highY=t._targetHighY),void 0!==t._targetLowY&&(t.lowY=t._targetLowY),t._targetX=void 0,t._targetOpenY=void 0,t._targetCloseY=void 0,t._targetHighY=void 0,t._targetLowY=void 0}else if("line"===t.type){const e=t._targetPath;if(e)for(let i=0;t.path.length>i;i++)t.path[i]=e[i];t._prevPath=void 0,t._targetPath=void 0,t._introClipFraction=void 0}else if("area"===t.type){const e=t._targetTopPath,i=t._targetBottomPath;if(e)for(let i=0;t.topPath.length>i;i++)t.topPath[i]=e[i];if(i)for(let e=0;t.bottomPath.length>e;e++)t.bottomPath[e]=i[e];t._prevTopPath=void 0,t._prevBottomPath=void 0,t._targetTopPath=void 0,t._targetBottomPath=void 0,t._introClipFraction=void 0}}if(i.exitNodes.length>0){const t=new Set(i.exitNodes);i.scene=i.scene.filter(e=>!t.has(e)),i.exitNodes=[]}return i.activeTransition=null,!1}return!0}(t,this.config.transition,e,this.prevPositionMap);return this.scene=e.scene,this.exitNodes=e.exitNodes,this.activeTransition=e.activeTransition,i}cancelIntroAnimation(){this.prevPositionMap.clear(),this.prevPathMap.clear(),this.activeTransition=null,x(this.scene),this.exitNodes=[]}groupData(t){const{result:e,cache:i}=function(t,e,i,o){if(o&&o.version===i&&o.group===e&&o.data===t)return{result:o.result,cache:o};let n;if(e){const i=new Map;for(const o of t){const t=e(o);i.has(t)||i.set(t,[]),i.get(t).push(o)}n=Array.from(i.entries()).map(([t,e])=>({key:t,data:e}))}else n=[{key:"_default",data:t}];return{result:n,cache:{version:i,group:e,data:t,result:n}}}(t,this.getGroup,this._ingestVersion,this._groupDataCache);return this._groupDataCache=i,e}resolveColorMap(t){const{map:e,cache:i}=function(t,e,i,o,n){if(n&&n.version===o)return{map:n.map,cache:n};const s=new Set;if(e)for(const i of t){const t=e(i);t&&s.add(t)}const r=Array.from(s).sort(),a=r.join("\0");if(n&&n.key===a){const t={...n,version:o};return{map:t.map,cache:t}}const l=Array.isArray(i.colorScheme)?i.colorScheme:i.themeCategorical||Pt,c=new Map;for(let t=0;r.length>t;t++)c.set(r[t],l[t%l.length]);return{map:c,cache:{key:a,map:c,version:o}}}(t,this.getColor,this.config,this._ingestVersion,this._colorMapCache);return this._colorMapCache=i,e}resolveLineStyle(t,e){return function(t,e,i,o){const n=t.lineStyle;if("function"==typeof n){const t=n(i||{},e);if(t&&!t.stroke&&e){const i=o(e);if(i)return{...t,stroke:i}}return t}const s=t.themeSemantic?.primary;return n&&"object"==typeof n?{stroke:n.stroke||s||"#007bff",strokeWidth:n.strokeWidth??2,strokeDasharray:n.strokeDasharray,fill:n.fill,fillOpacity:n.fillOpacity,opacity:n.opacity,cursor:n.cursor}:{stroke:o(e)||s||"#007bff",strokeWidth:2}}(this.config,t,e,t=>this.resolveGroupColor(t))}resolveAreaStyle(t,e){return function(t,e,i,o){if(t.areaStyle){const n=t.areaStyle(i||{});if(n&&!n.fill&&e){const t=o(e);if(t)return{...n,fill:t,stroke:n.stroke||t}}return n}const n=t.lineStyle;if("function"==typeof n){const t=n(i||{},e);if(t&&!t.fill&&e){const i=o(e);if(i)return{...t,fill:i,stroke:t.stroke||i}}return t}const s=t.themeSemantic?.primary;if(n&&"object"==typeof n)return{fill:n.fill||n.stroke||s||"#4e79a7",fillOpacity:n.fillOpacity??.7,stroke:n.stroke||s||"#4e79a7",strokeWidth:n.strokeWidth??2,cursor:n.cursor};const r=o(e)||s||"#4e79a7";return{fill:r,fillOpacity:.7,stroke:r,strokeWidth:2}}(this.config,t,e,t=>this.resolveGroupColor(t))}resolveGroupColor(t){const{color:e,groupColorCounter:o}=function(t){const{group:e,colorMapCache:i,groupColorMap:o,groupColorMapCap:n,config:s}=t;let{groupColorCounter:r}=t;if(i){const t=i.map.get(e);if(t)return{color:t,groupColorCounter:r}}const a=o.get(e);if(a)return{color:a,groupColorCounter:r};const l=(Array.isArray(s.colorScheme)&&s.colorScheme.length>0?s.colorScheme:null)||(Array.isArray(s.themeCategorical)&&s.themeCategorical.length>0?s.themeCategorical:null)||Pt;if(0===l.length)return{color:null,groupColorCounter:r};const c=l[r%l.length];if(r++,o.set(e,c),o.size>n){const t=o.keys().next().value;void 0!==t&&o.delete(t)}return{color:c,groupColorCounter:r}}({group:t,colorMapCache:this._colorMapCache,groupColorMap:this._groupColorMap,groupColorCounter:this._groupColorCounter,groupColorMapCap:i.GROUP_COLOR_MAP_CAP,config:this.config});return this._groupColorCounter=o,e}getBufferArray(){return!this._bufferDirty&&this._bufferArrayCache||(this._bufferArrayCache=this.buffer.toArray(),this._bufferDirty=!1),this._bufferArrayCache}getData(){return this.getBufferArray()}remove(t){if(!this.getPointId)throw Error("remove() requires pointIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();const e=b(t),i=this.getPointId,o=t=>e.has(i(t));D(this.buffer,this.timestampBuffer,o);const n=this.buffer.remove(o);if(0===n.length)return this.updateResults.recordNoop("remove"),n;for(const t of n)this.xExtent.evict(this.getX(t)),this.evictDatumYExtent(t);return this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",n.length),n}update(t,e){if(!this.getPointId)throw Error("update() requires pointIdAccessor to be configured");const i=b(t),o=this.getPointId,n=new Set;this.buffer.forEach((t,e)=>{i.has(o(t))&&n.add(e)});const s=this.buffer.update(t=>i.has(o(t)),e);if(0===s.length)return this.updateResults.recordNoop("update"),s;for(const t of s)this.xExtent.evict(this.getX(t)),this.evictDatumYExtent(t);return this.buffer.forEach((t,e)=>{n.has(e)&&(this.xExtent.push(this.getX(t)),this.pushDatumYExtent(t))}),this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",s.length),s}getBinBoundaries(){return this._binBoundaries}getExtents(){return this.xExtent.min===1/0?null:{x:this.xExtent.extent,y:this.yExtent.extent}}clear(){this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.prevPathMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this._lastBoundedInsertsRef=null,this.needsFullRebuild=!0,this._bufferDirty=!0,this._bufferArrayCache=null,this._datumIndexCache=null,this.lastLayout=null,this.scales=null,this.scene=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.spatialIndex.clear(),this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getBuffer(){return this.buffer}getXAccessor(){return this.getX}getYAccessor(){return this.getY}getCategoryAccessor(){return this.getCategory}applyCustomRestyle(t,e){const i=this._customRestyle;if(i)for(const o of t){const t=this._baseStyles.get(o)??o.style??{},n=i(o,e);o.style=n?{...t,...n}:t}}restyleScene(t){this._customRestyle?(this.applyCustomRestyle(this.scene,t),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}updateConfig(t){const e={...this.config},i=Object.keys(t).filter(i=>t[i]!==e[i]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in t&&t.windowSize!==e.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${e.windowSize} → ${t.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in t||"themeCategorical"in t||"colorAccessor"in t)&&(this._colorMapCache=null,this._groupColorMap=new Map,this._groupColorCounter=0),("barColors"in t||"colorScheme"in t)&&(this._barCategoryCache=null),("normalize"in t||"extentPadding"in t||"xAccessor"in t||"yAccessor"in t||"timeAccessor"in t||"valueAccessor"in t||"boundsAccessor"in t||"band"in t||"y0Accessor"in t||"openAccessor"in t||"highAccessor"in t||"lowAccessor"in t||"closeAccessor"in t||"groupAccessor"in t||"categoryAccessor"in t||"chartType"in t||"runtimeMode"in t)&&(this._stackExtentCache=null);let o=!1,n=!1;Object.assign(this.config,t),"pulse"in t&&this.syncPulseTimestampBuffer();const s="chartType"in t&&t.chartType!==e.chartType||"runtimeMode"in t&&t.runtimeMode!==e.runtimeMode;if(s||"xAccessor"in t||"yAccessor"in t||"timeAccessor"in t||"valueAccessor"in t){const t=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode,i=t&&this.config.valueAccessor||this.config.yAccessor,r=t&&e.valueAccessor||e.yAccessor,a=s||!A(t&&this.config.timeAccessor||this.config.xAccessor,t&&e.timeAccessor||e.xAccessor),l=s||!A(i,r);(a||l)&&(t?(this.getX=C(this.config.timeAccessor||this.config.xAccessor,"time"),this.getY=C(this.config.valueAccessor||this.config.yAccessor,"value")):(this.getX=C(this.config.xAccessor,"x"),this.getY=C(this.config.yAccessor,"y")),l&&this.resolvedRibbons.some(t=>"bounds"===t.kind)&&(this.resolvedRibbons=ii(this.config)),o=!0,n=!0)}if("groupAccessor"in t&&!A(t.groupAccessor,e.groupAccessor)&&(this.getGroup=null!=this.config.groupAccessor?_(this.config.groupAccessor):void 0,o=!0),"categoryAccessor"in t&&!A(t.categoryAccessor,e.categoryAccessor)&&(this.getCategory=null!=this.config.categoryAccessor?_(this.config.categoryAccessor):void 0,o=!0),"sizeAccessor"in t&&!A(t.sizeAccessor,e.sizeAccessor)&&(this.getSize=this.config.sizeAccessor?C(this.config.sizeAccessor,"size"):void 0,o=!0),"symbolAccessor"in t&&!A(t.symbolAccessor,e.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?_(this.config.symbolAccessor):void 0,o=!0),"colorAccessor"in t&&!A(t.colorAccessor,e.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?_(this.config.colorAccessor):void 0,o=!0),"y0Accessor"in t&&!A(t.y0Accessor,e.y0Accessor)&&(this.getY0=this.config.y0Accessor?C(this.config.y0Accessor,"y0"):void 0,o=!0,n=!0),("boundsAccessor"in t&&!A(t.boundsAccessor,e.boundsAccessor)||"band"in t&&t.band!==e.band||"boundsStyle"in t&&t.boundsStyle!==e.boundsStyle)&&(this.resolvedRibbons=ii(this.config),o=!0,n=!0),"pointIdAccessor"in t&&!A(t.pointIdAccessor,e.pointIdAccessor)&&(this.getPointId=null!=this.config.pointIdAccessor?_(this.config.pointIdAccessor):void 0,o=!0),"candlestick"===this.config.chartType&&(s||"openAccessor"in t&&!A(t.openAccessor,e.openAccessor)||"closeAccessor"in t&&!A(t.closeAccessor,e.closeAccessor)||"highAccessor"in t&&!A(t.highAccessor,e.highAccessor)||"lowAccessor"in t&&!A(t.lowAccessor,e.lowAccessor))){const t=null!=this.config.openAccessor,e=null!=this.config.closeAccessor;this.getOpen=t?C(this.config.openAccessor,"open"):void 0,this.getHigh=C(this.config.highAccessor,"high"),this.getLow=C(this.config.lowAccessor,"low"),this.getClose=e?C(this.config.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!t&&!e,o=!0,n=!0}if("accessorRevision"in t&&t.accessorRevision!==e.accessorRevision&&(o=!0,n=!0),!o){const i=Object.keys(t).filter(t=>!t.endsWith("Accessor")&&"timeAccessor"!==t&&"valueAccessor"!==t);for(const n of i)if(t[n]!==e[n]){o=!0;break}}o&&(n&&this.rebuildExtents(),this.needsFullRebuild=!0),this.updateResults.recordConfig(i)}updateConfigWithResult(t){return this.updateConfig(t),this.updateResults.last}};Ci.GROUP_COLOR_MAP_CAP=1e3;var Si=Ci;U(Si);import{line as _i}from"d3-shape";var Mi=new WeakMap;function Pi(t,e){const i=ce(e);if(!i)return t;const o=Mi.get(t);if(o)return o;const n=function(t,e,i=8){if(!e||2>t.length)return t.map(([t,e])=>[t,e]);const o=[];let n=null;const s={moveTo(t,e){n=[t,e],o.push([t,e])},lineTo(t,e){n=[t,e],o.push([t,e])},bezierCurveTo(t,e,s,r,a,l){if(!n)return n=[a,l],void o.push([a,l]);const[c,h]=n;for(let n=1;i>=n;n++){const u=n/i,g=1-u;o.push([g*g*g*c+3*g*g*u*t+3*g*u*u*s+u*u*u*a,g*g*g*h+3*g*g*u*e+3*g*u*u*r+u*u*u*l])}n=[a,l]},closePath(){},arc(){},rect(){},arcTo(){},quadraticCurveTo(t,e,i,s){n=[i,s],o.push([i,s])}};return _i().x(t=>t[0]).y(t=>t[1]).curve(e).context(s)(t),o}(t,i);return Mi.set(t,n),n}function Yi(t,e,i,o=30,n,s=0){let r=null;if(n){const t=et(n,e,i,o,s);t&&!1!==t.node.interactive&&(r={node:t.node,datum:t.node.datum,x:t.node.x,y:t.node.y,distance:t.distance})}for(const s of t){let t=null;switch(s.type){case"point":if(!1===s.interactive)break;if(n)break;t=Ti(s,e,i,o);break;case"symbol":t=Ni(s,e,i,o);break;case"glyph":t=Wi(s,e,i,o);break;case"line":t=Di(s,e,i,o);break;case"rect":if(null==s.datum)break;t=Ei(s,e,i);break;case"heatcell":t=zi(s,e,i);break;case"area":if(!1===s.interactive)break;t=Fi(s,e,i,o);break;case"candlestick":t=Li(s,e,i)}t&&(r&&t.distance>=r.distance||(r=t))}return r}function Ri(t,e,i){if(0===t.length)return null;if(t[0][0]>e||e>t[t.length-1][0])return null;const o=Bi(t,e);if(0>o)return null;if(Math.abs(t[o][0]-e)>i)return null;let n=o,s=o;o>0&&t[o][0]>=e?(n=o-1,s=o):t.length-1>o&&(n=o,s=o+1);const[r,a]=t[n],[l,c]=t[s];return l===r?a:a+Math.max(0,Math.min(1,(e-r)/(l-r)))*(c-a)}function Ti(t,e,i,o=30){const n=e-t.x,s=i-t.y,r=Math.sqrt(n*n+s*s);return r>it(t.r,o)?null:{node:t,datum:t.datum,x:t.x,y:t.y,distance:r}}function Ni(t,e,i,o=30){const n=e-t.x,s=i-t.y,r=Math.sqrt(n*n+s*s);return r>it(me(t.size),o)?null:{node:t,datum:t.datum,x:t.x,y:t.y,distance:r}}function Wi(t,e,i,o=30){if(null==t.datum)return null;const n=qt(t.glyph,t.size),s=t.x+n.centerDx,r=t.y+n.centerDy,a=e-s,l=i-r,c=Math.sqrt(a*a+l*l);return c>it(n.radius,o)?null:{node:t,datum:t.datum,x:s,y:r,distance:c}}function Di(t,e,i,o=30){if(0===t.path.length)return null;const n=Bi(t.path,e);if(0>n)return null;const[s,r]=t.path[n];let a;if(t.path.length>1){let o=1/0;const s=Math.max(0,n-1),r=Math.min(t.path.length-2,n);for(let n=s;r>=n;n++){const[s,r]=t.path[n],[a,l]=t.path[n+1],c=Oi(e,i,s,r,a,l);o>c&&(o=c)}a=o}else{const t=e-s,o=i-r;a=Math.sqrt(t*t+o*o)}const l=t.style;return a>Math.max(5,(l.strokeWidth??l.lineWidth??1)/2+2,o)?null:{node:t,datum:Array.isArray(t.datum)&&t.datum[n]?t.datum[n]:t.datum,x:s,y:r,distance:a}}function Oi(t,e,i,o,n,s){const r=n-i,a=s-o,l=r*r+a*a;if(0===l)return Math.sqrt((t-i)**2+(e-o)**2);let c=((t-i)*r+(e-o)*a)/l;return c=Math.max(0,Math.min(1,c)),Math.sqrt((t-(i+c*r))**2+(e-(o+c*a))**2)}function Ei(t,e,i){const o=nt(e,i,t);return o.hit?{node:t,datum:t.datum,x:o.cx,y:o.cy,distance:0}:null}function zi(t,e,i){const o=nt(e,i,t);return o.hit?{node:t,datum:t.datum,x:o.cx,y:o.cy,distance:0}:null}function Li(t,e,i){const o=t.bodyWidth/2,n=Math.min(t.openY,t.closeY);if(!(t.x-o-3>e||e>t.x+o+3||t.highY-3>i||i>t.lowY+3)){const o=n+Math.max(Math.max(t.openY,t.closeY)-n,1)/2,s=e-t.x,r=i-o;return{node:t,datum:t.datum,x:t.x,y:o,distance:Math.sqrt(s*s+r*r)}}return null}function Fi(t,e,i,o){if(0===t.topPath.length)return null;if(t.clipRect&&(t.clipRect.x>e||e>t.clipRect.x+t.clipRect.width||t.clipRect.y>i||i>t.clipRect.y+t.clipRect.height))return null;const n=Pi(t.topPath,t.curve),s=Bi(n,e),r=Bi(t.topPath,e);if(0>s||0>r)return null;let a;if(n.length>1){let t=1/0;const o=Math.max(0,s-1),r=Math.min(n.length-2,s);for(let s=o;r>=s;s++){const[o,r]=n[s],[a,l]=n[s+1];t=Math.min(t,Oi(e,i,o,r,a,l))}a=t}else{const t=e-n[0][0],o=i-n[0][1];a=Math.sqrt(t*t+o*o)}if(a>o)return null;const[l,c]=t.topPath[r];return{node:t,datum:Array.isArray(t.datum)&&t.datum[r]?t.datum[r]:t.datum,x:l,y:c,distance:a}}function Bi(t,e){if(0===t.length)return-1;let i=0,o=t.length-1;for(;o>i;){const n=i+o>>1;e>t[n][0]?i=n+1:o=n}return i>0&&Math.abs(t[i][0]-e)>=Math.abs(t[i-1][0]-e)?i-1:i}import{useMemo as Ii,useRef as Xi,useEffect as $i}from"react";import{useMemo as Gi}from"react";import{bin as Vi}from"d3-array";import{jsx as ji,jsxs as Hi}from"react/jsx-runtime";function qi(t){return"string"==typeof t?{type:t}:t}function Ui({orient:t,config:e,values:i,scale:o,size:n,length:s}){const r=function(t){return{type:t.type,bins:t.bins??20,fill:t.fill??"#4e79a7",fillOpacity:t.fillOpacity??.5,stroke:t.stroke??"none",strokeWidth:t.strokeWidth??1}}(e),a="top"===t||"bottom"===t,l=Gi(()=>{if(0===i.length)return null;const e=o.domain(),l=n-8;if("boxplot"===r.type){const e=function(t){const e=[...t].sort((t,e)=>t-e),i=e.length;if(0===i)return null;const o=e[Math.floor(.25*i)],n=e[Math.floor(.5*i)],s=e[Math.floor(.75*i)],r=s-o;return{q1:o,median:n,q3:s,whiskerLow:Math.max(e[0],o-1.5*r),whiskerHigh:Math.min(e[i-1],s+1.5*r)}}(i);if(!e)return null;const{q1:n,median:s,q3:c,whiskerLow:h,whiskerHigh:u}=e,g=Math.min(.5*l,20),f=(l-g)/2+4;if(a){const e=o(n),i=o(c),a=o(s),l=o(h),d=o(u),p="top"===t?-1:1,y=0;return Hi("g",{"data-testid":"marginal-boxplot-"+t,children:[ji("line",{x1:l,y1:y+p*(f+g/2),x2:d,y2:y+p*(f+g/2),stroke:r.fill,strokeWidth:r.strokeWidth}),ji("line",{x1:l,y1:y+p*f,x2:l,y2:y+p*(f+g),stroke:r.fill,strokeWidth:r.strokeWidth}),ji("line",{x1:d,y1:y+p*f,x2:d,y2:y+p*(f+g),stroke:r.fill,strokeWidth:r.strokeWidth}),ji("rect",{x:Math.min(e,i),y:"top"===t?y-f-g:y+f,width:Math.abs(i-e),height:g,fill:r.fill,fillOpacity:r.fillOpacity,stroke:"none"===r.stroke?r.fill:r.stroke,strokeWidth:r.strokeWidth}),ji("line",{x1:a,y1:"top"===t?y-f-g:y+f,x2:a,y2:"top"===t?y-f:y+f+g,stroke:r.fill,strokeWidth:2})]})}{const e=o(n),i=o(c),a=o(s),l=o(h),d=o(u),p="left"===t?-1:1,y=0;return Hi("g",{"data-testid":"marginal-boxplot-"+t,children:[ji("line",{x1:y+p*(f+g/2),y1:l,x2:y+p*(f+g/2),y2:d,stroke:r.fill,strokeWidth:r.strokeWidth}),ji("line",{x1:y+p*f,y1:l,x2:y+p*(f+g),y2:l,stroke:r.fill,strokeWidth:r.strokeWidth}),ji("line",{x1:y+p*f,y1:d,x2:y+p*(f+g),y2:d,stroke:r.fill,strokeWidth:r.strokeWidth}),ji("rect",{x:"left"===t?y-f-g:y+f,y:Math.min(e,i),width:g,height:Math.abs(i-e),fill:r.fill,fillOpacity:r.fillOpacity,stroke:"none"===r.stroke?r.fill:r.stroke,strokeWidth:r.strokeWidth}),ji("line",{x1:"left"===t?y-f-g:y+f,y1:a,x2:"left"===t?y-f:y+f+g,y2:a,stroke:r.fill,strokeWidth:2})]})}}const c=Vi().domain(e).thresholds(r.bins)(i);if(0===c.length)return null;const h=Re(c.map(t=>t.length));if(0===h)return null;if("histogram"===r.type)return ji("g",{"data-testid":"marginal-histogram-"+t,children:c.map((e,i)=>{if(null==e.x0||null==e.x1)return null;const n=e.length/h*l;if(a){const s=o(e.x0),a=o(e.x1)-o(e.x0);return ji("rect",{x:s,y:"top"===t?-4-n:4,width:Math.max(a,.5),height:n,fill:r.fill,fillOpacity:r.fillOpacity,stroke:r.stroke,strokeWidth:r.strokeWidth},i)}{const s=o(e.x0),a=o(e.x1)-o(e.x0);return ji("rect",{x:"left"===t?-4-n:4,y:Math.min(s,s+a),width:n,height:Math.abs(a),fill:r.fill,fillOpacity:r.fillOpacity,stroke:r.stroke,strokeWidth:r.strokeWidth},i)}})});if("violin"===r.type){const e=l/2+4,i=[];for(const n of c){if(null==n.x0||null==n.x1)continue;const s=n.length/h*(l/2),r=o((n.x0+n.x1)/2);i.push(a?`${r},${"top"===t?-(e-s):e-s}`:`${"left"===t?-(e-s):e-s},${r}`)}for(let n=c.length-1;n>=0;n--){const s=c[n];if(null==s.x0||null==s.x1)continue;const r=s.length/h*(l/2),u=o((s.x0+s.x1)/2);i.push(a?`${u},${"top"===t?-(e+r):e+r}`:`${"left"===t?-(e+r):e+r},${u}`)}return ji("g",{"data-testid":"marginal-violin-"+t,children:ji("polygon",{points:i.join(" "),fill:r.fill,fillOpacity:r.fillOpacity,stroke:"none"===r.stroke?r.fill:r.stroke,strokeWidth:r.strokeWidth})})}if("ridgeline"===r.type){const e=[];if(a){const i=0,n=null!=c[0].x0?o(c[0].x0):0;e.push(`M${n},${i}`);for(const i of c){if(null==i.x0||null==i.x1)continue;const n=i.length/h*l,s=o((i.x0+i.x1)/2);e.push(`L${s},${"top"===t?-n-4:n+4}`)}const r=null!=c[c.length-1].x1?o(c[c.length-1].x1):s;e.push(`L${r},${i}`),e.push("Z")}else{const i=0,n=null!=c[0].x0?o(c[0].x0):0;e.push(`M${i},${n}`);for(const i of c){if(null==i.x0||null==i.x1)continue;const n=i.length/h*l,s=o((i.x0+i.x1)/2);e.push(`L${"left"===t?-n-4:n+4},${s}`)}const r=null!=c[c.length-1].x1?o(c[c.length-1].x1):s;e.push(`L${i},${r}`),e.push("Z")}return ji("g",{"data-testid":"marginal-ridgeline-"+t,children:ji("path",{d:e.join(" "),fill:r.fill,fillOpacity:r.fillOpacity,stroke:"none"===r.stroke?r.fill:r.stroke,strokeWidth:r.strokeWidth})})}return null},[i,o,r,n,s,t,a,4]);return l?ji("g",{className:"marginal-"+t,"data-testid":"marginal-"+t,children:l}):null}function Ki(t,e,i){if("edges"===t){if(e)return"start";if(i)return"end"}return"middle"}function Ji(t,e,i){if("edges"===t){if(e)return"hanging";if(i)return"auto"}return"middle"}function Zi(t){if(0===t.length)return{min:null,max:null};let e=1/0,i=-1/0;for(const o of t)e>o.pixel&&(e=o.pixel),o.pixel>i&&(i=o.pixel);return{min:e,max:i}}function Qi(t){if(t)return"object"==typeof t?t.strokeDasharray:"dashed"===t?"6,4":"dotted"===t?"2,4":t}function to(t,e){return t&&"string"!=typeof t?{stroke:t.stroke??e.stroke,strokeWidth:t.strokeWidth??e.strokeWidth,...null!=t.strokeOpacity&&{strokeOpacity:t.strokeOpacity},...t.strokeDasharray&&{strokeDasharray:t.strokeDasharray}}:{...e,..."string"==typeof t&&{strokeDasharray:Qi(t)}}}function eo(t,e,i){if("left"===t||"right"===t){const o="left"===t?i:0,n="left"===t?-1:1,s=Math.ceil(e/8);let r="M0,"+o;for(let t=0;s>t;t++){const i=8*(t+1);r+=`L${Math.min(8*t+4,e)},${o+4*n}`,r+=`L${Math.min(i,e)},${o}`}return r}const o="bottom"===t?0:e,n="bottom"===t?1:-1,s=Math.ceil(i/8);let r=`M${o},0`;for(let t=0;s>t;t++){const e=8*(t+1);r+=`L${o+4*n},${Math.min(8*t+4,i)}`,r+=`L${o},${Math.min(e,i)}`}return r}function io(t,e){return t?.ticks??t?.tickCount??e}function oo(t,e,i){return t instanceof Date?`${t.toLocaleString("en",{month:"short"})} ${t.getDate()}`:"number"==typeof t?Math.round(100*t)/100+"":t+""}function no(t,e){return!("string"!=typeof t&&"number"!=typeof t||"string"!=typeof e&&"number"!=typeof e||t+""!=e+"")}function so(t,e){if(2>=t.length)return t;const i=[t[0]];for(let o=1;t.length-1>o;o++)e>Math.abs(t[o].pixel-i[i.length-1].pixel)||i.push(t[o]);const o=t[t.length-1];return e>Math.abs(o.pixel-i[i.length-1].pixel)?i[i.length-1]=o:i.push(o),i}import{useMemo as ro}from"react";import{jsx as ao,jsxs as lo}from"react/jsx-runtime";function co(t){const{width:e,height:i,totalWidth:o,totalHeight:n,margin:s,scales:r,showAxes:a,axes:l,showGrid:c,xFormat:h,yFormat:u,axisExtent:g}=t,f=ro(()=>{if(!r)return[];const t=l?.find(t=>"bottom"===t.orient),i=l?.find(t=>"top"===t.orient),o=t??i,n=o?.extent??g,s=o?.tickFormat||h||oo,a=Math.max(2,Math.floor(e/70)),c=io(o,5),u="exact"===n?Math.max(2,c):Math.min(c,a),f=o?.tickValues??v(r.x,u,n),d=f.map(t=>t.valueOf()),p=f.map((t,e)=>({value:t,pixel:r.x(t),label:s(t,e,d)})),y=p.reduce((t,e)=>Math.max(t,"string"==typeof e.label?6.5*e.label.length:"number"==typeof e.label?6.5*(e.label+"").length:60),0),m=o?.autoRotate?Math.max(20,Math.min(y+8,55)):Math.max(55,y+8);let x=so(p,m);if(x.length>1&&(x=x.filter((t,e)=>0===e||!no(t.label,x[e-1].label))),o?.includeMax&&x.length>0&&"exact"!==n&&!o.tickValues){const t=r.x.domain()[1],e=r.x(t),i=x[x.length-1].pixel;if(Math.abs(e-i)>1){const o=s(t,x.length,d);m>Math.abs(e-i)&&x.length>1&&(x=x.slice(0,-1)),x.push({value:t,pixel:e,label:o})}}return x},[r,l,h,e,g]),d=ro(()=>{if(!r)return[];const t=l?.find(t=>"left"===t.orient),e=l?.find(t=>"right"===t.orient),o=t??e,n=o?.extent??g,s=o?.tickFormat||u||oo,a=Math.max(2,Math.floor(i/30)),c=io(o,5),h="exact"===n?Math.max(2,c):Math.min(c,a);let f=so((o?.tickValues??v(r.y,h,n)).map(t=>({value:t,pixel:r.y(t),label:s(t)})),22);if(f.length>1&&(f=f.filter((t,e)=>0===e||!no(t.label,f[e-1].label))),o?.includeMax&&f.length>0&&"exact"!==n&&!o.tickValues){const t=r.y.domain()[1],e=r.y(t),i=f[f.length-1].pixel;if(Math.abs(e-i)>1){const o=s(t);22>Math.abs(e-i)&&f.length>1&&(f=f.slice(0,-1)),f.push({value:t,pixel:e,label:o})}}return f},[r,l,u,i,g]),p=c&&r,y=a&&r;if(!p&&!y)return null;const m=l?.find(t=>"bottom"===t.orient),x=l?.find(t=>"top"===t.orient),b=l?.find(t=>"left"===t.orient),k=l?.find(t=>"right"===t.orient),w=m??x,A=b??k,C=m?"bottom":x?"top":"bottom",S=b?"left":k?"right":"left",_="top"===C?0:i,M="right"===S?e:0,P=y&&(!w||!1!==w.baseline),Y=y&&(!A||!1!==A.baseline),R=w?.jaggedBase||!1,T=A?.jaggedBase||!1,N=to(w?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),W=to(A?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),D=to(w?.gridStyle,{stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1}),O=to(A?.gridStyle,{stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1}),E=Qi(w?.gridStyle),z=Qi(A?.gridStyle);return ao("svg",{width:o,height:n,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:lo("g",{transform:`translate(${s.left},${s.top})`,children:[p&&lo("g",{className:"stream-grid",children:[!1!==w?.grid&&f.map((t,e)=>ao("line",{x1:t.pixel,y1:0,x2:t.pixel,y2:i,...D,strokeDasharray:E??D.strokeDasharray},"xgrid-"+e)),!1!==A?.grid&&d.map((t,i)=>ao("line",{x1:0,y1:t.pixel,x2:e,y2:t.pixel,...O,strokeDasharray:z??O.strokeDasharray},"ygrid-"+i))]}),P&&!R&&ao("line",{x1:0,y1:_,x2:e,y2:_,...N}),R&&ao("path",{d:eo(C,e,i),fill:"none",...N}),Y&&!T&&ao("line",{x1:M,y1:0,x2:M,y2:i,...W}),T&&ao("path",{d:eo(S,e,i),fill:"none",...W})]})})}import{Fragment as ho,jsx as uo,jsxs as go}from"react/jsx-runtime";function fo(t){const{width:e,height:i,totalWidth:o,totalHeight:n,margin:s,scales:r,showAxes:a,axes:l,xLabel:c,yLabel:h,yLabelRight:u,xFormat:g,yFormat:f,axisExtent:d,showGrid:p,title:y,legend:m,legendHoverBehavior:x,legendClickBehavior:b,legendHighlightedCategory:k,legendIsolatedCategories:w,legendPosition:A="right",legendLayout:C,foregroundGraphics:S,marginalGraphics:_,xValues:M,yValues:P,annotations:Y,onAnnotationActivate:R,onObservation:T,chartId:N,chartType:W,autoPlaceAnnotations:D,svgAnnotationRules:O,xAccessor:E,yAccessor:z,annotationData:L,pointNodes:F,curve:B,underlayRendered:I,canvasObscuresUnderlay:X=!0,linkedCrosshairName:$,linkedCrosshairSourceId:G,children:V}=t,j=be({onAnnotationActivate:R,onObservation:T,chartId:N,chartType:W}),H=ge({showAxes:a,xLabel:c,yLabel:h,yLabelRight:u,axes:l}),q=ue(C,H.leftAxis),U=ue(C,H.rightAxis),K=m&&"left"===A&&q>0?q:s.left,J=m&&"right"===A&&U>0?U:s.right,Z=Ii(()=>{if(!a||!r)return[];const t=l?.find(t=>"bottom"===t.orient),i=l?.find(t=>"top"===t.orient),o=t??i,n=o?.extent??d,s=o?.tickFormat||g||oo,c=Math.max(2,Math.floor(e/70)),h=io(o,5),u="exact"===n?Math.max(2,h):Math.min(h,c),f=o?.tickValues??v(r.x,u,n),p=f.map(t=>t.valueOf()),y=f.map((t,e)=>({value:t,pixel:r.x(t),label:s(t,e,p)})),m=y.reduce((t,e)=>Math.max(t,"string"==typeof e.label?6.5*e.label.length:"number"==typeof e.label?6.5*(e.label+"").length:60),0),x=o?.autoRotate?Math.max(20,Math.min(m+8,55)):Math.max(55,m+8);let b=so(y,x);if(b.length>1&&(b=b.filter((t,e)=>0===e||!no(t.label,b[e-1].label))),o?.includeMax&&b.length>0&&"exact"!==n&&!o?.tickValues){const t=r.x.domain()[1],e=r.x(t),i=b[b.length-1].pixel;if(Math.abs(e-i)>1){const o=s(t,b.length,p);x>e-i&&b.length>1&&(b=b.slice(0,-1)),b.push({value:t,pixel:e,label:o})}}return b},[a,r,l,g,e,d]),Q=Ii(()=>{const t=l?.find(t=>"bottom"===t.orient),i=l?.find(t=>"top"===t.orient),o=t??i;if(!o?.autoRotate||1>=Z.length)return!1;const n=e/Math.max(Z.length-1,1);return Z.reduce((t,e)=>Math.max(t,"string"==typeof e.label?6.5*e.label.length:60),0)+8>n},[l,Z,e]),et=Ii(()=>{if(!a||!r)return[];const t=l?.find(t=>"left"===t.orient),e=l?.find(t=>"right"===t.orient),o=t??e,n=o?.extent??d,s=o?.tickFormat||f||oo,c=Math.max(2,Math.floor(i/30)),h=io(o,5),u="exact"===n?Math.max(2,h):Math.min(h,c);let g=so((o?.tickValues??v(r.y,u,n)).map(t=>({value:t,pixel:r.y(t),label:s(t)})),22);if(g.length>1&&(g=g.filter((t,e)=>0===e||!no(t.label,g[e-1].label))),o?.includeMax&&g.length>0&&"exact"!==n&&!o?.tickValues){const t=r.y.domain()[1],e=r.y(t),i=g[g.length-1].pixel;if(Math.abs(e-i)>1){const o=s(t);22>Math.abs(e-i)&&g.length>1&&(g=g.slice(0,-1)),g.push({value:t,pixel:e,label:o})}}return g},[a,r,l,f,i,d]),it=Ii(()=>{if(!a||!r)return[];const t=l?.find(t=>"right"===t.orient);if(!t)return[];const e=t.extent??d,o=t.tickFormat||f||oo,n=Math.max(2,Math.floor(i/30)),s=io(t,5);let c=so((t.tickValues??v(r.y,"exact"===e?Math.max(2,s):Math.min(s,n),e)).map(t=>({value:t,pixel:r.y(t),label:o(t)})),22);if(c.length>1&&(c=c.filter((t,e)=>0===e||!no(t.label,c[e-1].label))),t.includeMax&&c.length>0&&"exact"!==e&&!t.tickValues){const t=r.y.domain()[1],e=r.y(t),i=c[c.length-1].pixel;if(Math.abs(e-i)>1){const n=o(t);22>Math.abs(e-i)&&c.length>1&&(c=c.slice(0,-1)),c.push({value:t,pixel:e,label:n})}}return c},[a,r,l,f,i,d]),ot=Xi(new Map),nt=Xi(Y?.length??0),rt=Y?.length??0;nt.current!==rt&&(nt.current=rt,ot.current=new Map);const at=Ii(()=>{if(!Y||0===Y.length)return null;const t=tt(Y),o=It("xy",j),n={scales:r?{x:r.x,y:r.y,time:r.x,value:r.y}:null,timeAxis:"x",xAccessor:E,yAccessor:z,width:e,height:i,data:L,frameType:"xy",pointNodes:F,curve:B,stickyPositionCache:ot.current},s=D?Dt({annotations:t,context:n,..."object"==typeof D?D:{}}):t;return ne(s,o,O,n)},[Y,D,O,e,i,E,z,L,r,F,B,j]),lt=we($);return $i(()=>{if(!lt?.locked||!$)return;const t=t=>{"Escape"===t.key&&ve($)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[lt?.locked,$]),a||y||m||S||_||at&&at.length>0||p||V||lt?go("svg",{role:"img",width:o,height:n,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[uo("title",{children:"string"==typeof y?y:"XY Chart"}),uo("desc",{children:"string"==typeof y?y+" (XY data visualization)":"XY data visualization"}),go("g",{transform:`translate(${s.left},${s.top})`,children:[p&&r&&(!I||X)&&(()=>{const t=l?.find(t=>"bottom"===t.orient),o=l?.find(t=>"top"===t.orient),n=l?.find(t=>"left"===t.orient),s=l?.find(t=>"right"===t.orient),r=t??o,a=n??s,c=Qi(r?.gridStyle),h=Qi(a?.gridStyle),u=to(r?.gridStyle,{stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1}),g=to(a?.gridStyle,{stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1}),f=!1!==r?.grid,d=!1!==a?.grid;return go("g",{className:"stream-grid",children:[f&&Z.map((t,e)=>uo("line",{x1:t.pixel,y1:0,x2:t.pixel,y2:i,...u,strokeDasharray:c??u.strokeDasharray},"xgrid-"+e)),d&&et.map((t,i)=>uo("line",{x1:0,y1:t.pixel,x2:e,y2:t.pixel,...g,strokeDasharray:h??g.strokeDasharray},"ygrid-"+i))]})})(),a&&r&&(()=>{const t=l?.find(t=>"bottom"===t.orient),o=l?.find(t=>"top"===t.orient),n=l?.find(t=>"left"===t.orient),s=l?.find(t=>"right"===t.orient),r=t??o,a=n??s,g=t?"bottom":o?"top":"bottom",f=n?"left":s?"right":"left",d="top"===g?0:i,p="right"===f?e:0,y="top"===g?-1:1,m="right"===f?1:-1,x=!r||!1!==r.baseline,v=!a||!1!==a.baseline,b=r?.jaggedBase||!1,k=a?.jaggedBase||!1,w=r?.landmarkTicks,A=a?.landmarkTicks,C=to(r?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),S=to(a?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),_="var(--semiotic-text-secondary, var(--semiotic-text, #666))",M="var(--semiotic-text, #333)",P=Q,Y={fontSize:"var(--semiotic-tick-font-size, 12px)"},R={fontSize:"calc(var(--semiotic-tick-font-size, 12px) + 1px)"},T={fontSize:"var(--semiotic-axis-label-font-size, 12px)"},N=r?.tickAnchor,W=a?.tickAnchor,D=r?.label??c,O=a?.label??("right"===f?u??h:h),E="right"===f?e+J-15:15-K,z=Zi(Z),L=Zi(et);return go("g",{className:"stream-axes",style:{fontFamily:"var(--semiotic-font-family, sans-serif)"},children:[go("g",{className:"semiotic-axis semiotic-axis-"+g,"data-orient":g,children:[(!I||X)&&x&&!b&&uo("line",{x1:0,y1:d,x2:e,y2:d,...C}),(!I||X)&&b&&uo("path",{d:eo(g,e,i),fill:"none",...C}),Z.map((t,e)=>{const i=!!w&&("function"==typeof w?w(t.value,e):st(t.value,e>0?Z[e-1].value:void 0));return go("g",{transform:`translate(${t.pixel},${d})`,children:[uo("line",{y2:5*y,...C}),"string"==typeof t.label||"number"==typeof t.label?uo("text",{y:y*(P?12:18),textAnchor:P?"end":Ki(N,t.pixel===z.min,t.pixel===z.max),fontWeight:i?600:400,fill:_,fontSize:i?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...i?R:Y},transform:P?"top"===g?"rotate(45)":"rotate(-45)":void 0,children:t.label}):uo("foreignObject",{x:-30,y:"top"===g?-30:6,width:60,height:24,style:{overflow:"visible"},children:uo("div",{style:{textAlign:"center",userSelect:"none",...Y},children:t.label})})]},"xtick-"+e)}),D&&uo("text",{x:e/2,y:"top"===g?-(P?58:40):i+(P?58:40),textAnchor:"middle",fill:M,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...T},children:D})]}),go("g",{className:"semiotic-axis semiotic-axis-"+f,"data-orient":f,children:[(!I||X)&&v&&!k&&uo("line",{x1:p,y1:0,x2:p,y2:i,...S}),(!I||X)&&k&&uo("path",{d:eo(f,e,i),fill:"none",...S}),et.map((t,e)=>{const i=!!A&&("function"==typeof A?A(t.value,e):st(t.value,e>0?et[e-1].value:void 0));return go("g",{transform:`translate(${p},${t.pixel})`,children:[uo("line",{x2:5*m,...S}),"string"==typeof t.label||"number"==typeof t.label?uo("text",{x:8*m,textAnchor:"right"===f?"start":"end",dominantBaseline:Ji(W,t.pixel===L.min,t.pixel===L.max),fontWeight:i?600:400,fill:_,fontSize:i?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...i?R:Y},children:t.label}):uo("foreignObject",{x:"right"===f?8:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:uo("div",{style:{textAlign:"right"===f?"left":"right",userSelect:"none",...Y},children:t.label})})]},"ytick-"+e)}),O&&uo("text",{x:E,y:i/2,textAnchor:"middle",fill:M,transform:`rotate(${"right"===f?90:-90}, ${E}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...T},children:O})]}),(()=>{const t=l?.find(t=>"right"===t.orient);if(!n||!t||0===it.length)return null;const o=!1!==t.baseline,s=t.landmarkTicks,r=t.label||u,a=t.tickAnchor,c=to(t.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),h=Zi(it);return go("g",{className:"semiotic-axis semiotic-axis-right","data-orient":"right",children:[o&&!t.jaggedBase&&uo("line",{x1:e,y1:0,x2:e,y2:i,...c}),t.jaggedBase&&uo("path",{d:eo("right",e,i),fill:"none",...c}),it.map((t,i)=>{const o=!!s&&("function"==typeof s?s(t.value,i):st(t.value,i>0?it[i-1].value:void 0));return go("g",{transform:`translate(${e},${t.pixel})`,children:[uo("line",{x2:5,...c}),"string"==typeof t.label||"number"==typeof t.label?uo("text",{x:8,textAnchor:"start",dominantBaseline:Ji(a,t.pixel===h.min,t.pixel===h.max),fontWeight:o?600:400,fill:_,fontSize:o?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...o?R:Y},children:t.label}):uo("foreignObject",{x:8,y:-12,width:60,height:24,style:{overflow:"visible"},children:uo("div",{style:{textAlign:"left",userSelect:"none",...Y},children:t.label})})]},"ytick-r-"+i)}),r&&uo("text",{x:e+J-15,y:i/2,textAnchor:"middle",fill:M,transform:`rotate(90, ${e+J-15}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...T},children:r})]})})()]})})(),at,_&&r&&M&&P&&go(ho,{children:[_.top&&uo("g",{transform:"translate(0, 0)",children:uo(Ui,{orient:"top",config:qi(_.top),values:M,scale:r.x,size:s.top,length:e})}),_.bottom&&uo("g",{transform:`translate(0, ${i})`,children:uo(Ui,{orient:"bottom",config:qi(_.bottom),values:M,scale:r.x,size:s.bottom,length:e})}),_.left&&uo("g",{transform:"translate(0, 0)",children:uo(Ui,{orient:"left",config:qi(_.left),values:P,scale:r.y,size:s.left,length:i})}),_.right&&uo("g",{transform:`translate(${e}, 0)`,children:uo(Ui,{orient:"right",config:qi(_.right),values:P,scale:r.y,size:s.right,length:i})})]}),S,lt&<.sourceId!==G&&r?.x&&(()=>{const t=r.x(lt.xValue);if(null==t||0>t||t>e)return null;const o=lt.locked;return uo("line",{x1:t,y1:0,x2:t,y2:i,stroke:o?"white":"var(--semiotic-text-secondary, rgba(0,0,0,0.25))",strokeWidth:o?1.5:1,strokeDasharray:o?"6,3":"4,4",pointerEvents:"none"})})(),V]}),uo(Yt,{title:y,totalWidth:o,marginTop:s.top}),se({legend:m,totalWidth:o,totalHeight:n,margin:s,legendPosition:A,title:y,legendLayout:C,axisChrome:H,legendHoverBehavior:x,legendClickBehavior:b,legendHighlightedCategory:k,legendIsolatedCategories:w})]}):null}var po={axisStroke:"#ccc",tickText:"#666",crosshair:"rgba(0, 0, 0, 0.25)",hoverFill:"rgba(255, 255, 255, 0.3)",hoverStroke:"rgba(0, 0, 0, 0.4)",pointRing:"white",primary:"#007bff",background:""};function yo(t,e){const i=t.trim();if(/^#[0-9a-f]{3}$/i.test(i)){const t=i[1],o=i[2],n=i[3];return`#${t}${t}${o}${o}${n}${n}${e}`}if(/^#[0-9a-f]{6}$/i.test(i))return`${i}${e}`;const o=i.match(/^rgb\s*\(\s*([^)]+?)\s*\)$/i);return o?`rgba(${o[1]}, ${(parseInt(e,16)/255).toFixed(3)})`:i}var mo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],xo=3156e7;function vo(t){const e=t[1]-t[0];return 864e5>e?t=>{const e=new Date(t);return`${(e.getUTCHours()+"").padStart(2,"0")}:${(e.getUTCMinutes()+"").padStart(2,"0")}`}:xo>e?t=>{const e=new Date(t);return`${mo[e.getUTCMonth()]} ${e.getUTCDate()}`}:5*xo>e?t=>{const e=new Date(t);return`${mo[e.getUTCMonth()]} ${e.getUTCFullYear()}`}:t=>new Date(t).getUTCFullYear()+""}function bo(t){if(!t)return;const e=[];for(const i of t)if("point"===i.type)e.push(i);else if("symbol"===i.type)e.push({pointId:i.pointId,x:i.x,y:i.y,r:me(i.size)});else if("glyph"===i.type){const t=qt(i.glyph,i.size);e.push({pointId:i.pointId,x:i.x+t.centerDx,y:i.y+t.centerDy,r:t.radius})}return e}import{area as ko,line as wo}from"d3-shape";function Ao(t,e){const i=ce(e.curve);if(!i||2>e.topPath.length||2>e.bottomPath.length){t.beginPath(),t.moveTo(e.topPath[0][0],e.topPath[0][1]);for(let i=1;e.topPath.length>i;i++)t.lineTo(e.topPath[i][0],e.topPath[i][1]);for(let i=e.bottomPath.length-1;i>=0;i--)t.lineTo(e.bottomPath[i][0],e.bottomPath[i][1]);t.closePath()}else{const o=ko().x(t=>t[0]).y0((t,i)=>e.bottomPath[i][1]).y1(t=>t[1]).curve(i).context(t);t.beginPath(),o(e.topPath)}}function Co(t,e){const i=ce(e.curve);if(t.beginPath(),i)wo().x(t=>t[0]).y(t=>t[1]).curve(i).context(t)(e.topPath);else{t.moveTo(e.topPath[0][0],e.topPath[0][1]);for(let i=1;e.topPath.length>i;i++)t.lineTo(e.topPath[i][0],e.topPath[i][1])}}var So=(t,e,i,o)=>{const n=e.filter(t=>"area"===t.type);for(const e of n){if(2>e.topPath.length)continue;let i=!1;e.clipRect&&(t.save(),t.beginPath(),t.rect(e.clipRect.x,e.clipRect.y,e.clipRect.width,e.clipRect.height),t.clip(),i=!0);const n=e._introClipFraction;void 0!==n&&1>n&&(t.save(),t.beginPath(),t.rect(0,0,o.width*n,o.height),t.clip());const s=ae(t,e.style.fill,"#4e79a7"),r=e._decayOpacities,a=!(!e.colorThresholds?.length||!e.rawValues||e.rawValues.length!==e.topPath.length),l=!!e.strokeColorBands?.length;if(r&&r.length===e.topPath.length&&!a&&!l){const i=e.style.fillOpacity??.7;t.fillStyle=s;for(let o=0;e.topPath.length-1>o;o++)t.globalAlpha=.5*(r[o]+r[o+1])*i,t.beginPath(),t.moveTo(e.topPath[o][0],e.topPath[o][1]),t.lineTo(e.topPath[o+1][0],e.topPath[o+1][1]),t.lineTo(e.bottomPath[o+1][0],e.bottomPath[o+1][1]),t.lineTo(e.bottomPath[o][0],e.bottomPath[o][1]),t.closePath(),t.fill();const o=e.style.strokeWidth??2;if(e.style.stroke&&"none"!==e.style.stroke&&o>0){t.strokeStyle=re(t,e.style.stroke)||e.style.stroke,t.lineWidth=o,t.setLineDash([]);for(let i=0;e.topPath.length-1>i;i++)t.globalAlpha=.5*(r[i]+r[i+1]),t.beginPath(),t.moveTo(e.topPath[i][0],e.topPath[i][1]),t.lineTo(e.topPath[i+1][0],e.topPath[i+1][1]),t.stroke()}t.globalAlpha=1;continue}const c=e.style.opacity??1;if(Ao(t,e),e.fillGradient&&e.fillGradient.stops.length>=2&&e.fillGradient){let i=1/0;for(const t of e.topPath)i>t[1]&&(i=t[1]);let o=-1/0;for(const t of e.bottomPath)t[1]>o&&(o=t[1]);const n=Et(t,e.fillGradient,"string"==typeof s?s:"#4e79a7",0,i,0,o);t.fillStyle=n||s,t.globalAlpha=c}else t.globalAlpha=(e.style.fillOpacity??.7)*c,t.fillStyle=s;t.fill(),e._pulseIntensity&&e._pulseIntensity>0&&(Ao(t,e),lt(t,e));const h=e.style.strokeWidth??2;if(e.style.stroke&&"none"!==e.style.stroke&&h>0){t.globalAlpha=c;const i=re(t,e.style.stroke)||e.style.stroke,o=a||l||!e.strokeGradient||2>e.topPath.length?null:Et(t,e.strokeGradient,i,e.topPath[0][0],0,e.topPath[e.topPath.length-1][0],0);if(t.lineWidth=h,t.setLineDash([]),l){let o=1/0,n=-1/0;for(const[t]of e.topPath)o=Math.min(o,t),n=Math.max(n,t);const s=t.lineWidth;for(const r of e.strokeColorBands){t.save(),t.beginPath(),t.rect(o-s,r.y,n-o+2*s,r.height),t.clip();const a=r.color??i;t.strokeStyle=re(t,a)||a,t.globalAlpha=c*(r.opacity??1),Co(t,e),t.stroke(),t.restore()}}else if(a){const o=zt(e.topPath,e.rawValues,e.colorThresholds,i);for(const e of o){t.beginPath(),t.strokeStyle=re(t,e.color)||e.color,t.moveTo(e.path[0][0],e.path[0][1]);for(let i=1;e.path.length>i;i++)t.lineTo(e.path[i][0],e.path[i][1]);t.stroke()}}else t.strokeStyle=o||i,Co(t,e),t.stroke()}void 0!==n&&1>n&&t.restore(),i&&t.restore(),t.globalAlpha=1}};function _o(t,e){const[i,o,n]=ee(t,e);return.299*i+.587*o+.114*n>128?"#000":"#fff"}function Mo(t){return Number.isInteger(t)?t+"":100>Math.abs(t)?1>Math.abs(t)?t.toPrecision(3):t.toFixed(1):t.toFixed(0)}var Po=(t,e,i,o)=>{const n=e.filter(t=>"heatcell"===t.type);t.save();try{for(const e of n){const i=e.style;null!=i?.opacity&&(t.globalAlpha=i.opacity);const o=le(t,e.fill,"#4e79a7");t.fillStyle=o,t.fillRect(e.x,e.y,e.w,e.h);const n=Math.max(0,i?.strokeWidth??1);if(n>0&&(t.strokeStyle=re(t,i?.stroke??"var(--semiotic-surface, #fff)"),t.lineWidth=n,t.strokeRect(e.x,e.y,e.w,e.h)),ct(t,e),t.globalAlpha=1,e.showValues&&null!=e.value){if(20>e.w||20>e.h)continue;const i=e.valueFormat?e.valueFormat(e.value):Mo(e.value),n=Math.max(10,Math.min(16,.3*Math.min(e.w,e.h))),s=e.x+e.w/2,r=e.y+e.h/2;t.fillStyle=_o(t,"string"==typeof o?o:"#4e79a7"),t.font=n+"px sans-serif",t.textAlign="center",t.textBaseline="middle",t.fillText(i,s,r)}}}finally{t.restore()}},Yo=(t,e,i,o)=>{for(const i of e){if("candlestick"!==i.type)continue;const e=i;t.save();const n=(e._decayOpacity??1)*(e.style?.opacity??1);1!==n&&(t.globalAlpha=n);const s=re(t,e.wickColor)||e.wickColor,r=60>o.height,a=r?Math.max(e.wickWidth,2):e.wickWidth,l=()=>{t.beginPath(),t.moveTo(e.x,e.highY),t.lineTo(e.x,e.lowY),t.strokeStyle=s,t.lineWidth=a,t.stroke()};if(r||l(),e.isRange){const i=e.dotRadius??Math.max(2,Math.min(e.bodyWidth/2,.12*o.height));t.fillStyle=s,t.beginPath(),t.arc(e.x,e.highY,i,0,2*Math.PI),t.fill(),t.beginPath(),t.arc(e.x,e.lowY,i,0,2*Math.PI),t.fill()}else if(e.bodyWidth>0){const i=Math.min(e.openY,e.closeY),o=Math.abs(e.openY-e.closeY),n=e.isUp?e.upColor:e.downColor,s=re(t,n)||n;t.fillStyle=s,t.fillRect(e.x-e.bodyWidth/2,i,e.bodyWidth,Math.max(o,1)),t.strokeStyle=s,t.lineWidth=1,t.strokeRect(e.x-e.bodyWidth/2,i,e.bodyWidth,Math.max(o,1))}r&&l(),t.restore()}},Ro={line:[So,P,B],area:[So,B],stackedarea:[So,B],scatter:[B,M],bubble:[B,M],heatmap:[Po],bar:[n],swarm:[B],waterfall:[(t,e,i,o)=>{n(t,e,i,o);const s=e.filter(t=>"rect"===t.type);if(2>s.length)return;const r=s[0].datum,a=r?._connectorStroke;if(a){t.save(),t.strokeStyle=re(t,a)||a,t.lineWidth=r?._connectorWidth??1,t.setLineDash([]);for(let e=0;s.length-1>e;e++){const o=s[e],n=s[e+1],r=o.datum,a=n.datum;if(null==r?.cumEnd||null==a?.baseline)continue;const l=i.y(r.cumEnd),c=o.x+o.w,h=n.x;t.beginPath(),t.moveTo(c,l),t.lineTo(h,l),t.stroke()}t.restore()}}],candlestick:[Yo],mixed:[So,P,B],custom:[So,n,Po,P,B,M,ot,Yo]};import{jsx as To,jsxs as No}from"react/jsx-runtime";function Wo(t){return null==t?"":"number"==typeof t?Number.isInteger(t)?t+"":t.toFixed(2):t instanceof Date?t.toLocaleString():t+""}function Do({hover:t}){const e=t.data??{},i=e.y??e.value,o=e.x??e.time;if(void 0===i&&void 0===o){const t=ye(e);if(null!=t.title||t.entries.length>0)return No("div",{className:"semiotic-tooltip",style:Xt,children:[null!=t.title&&To("div",{style:{fontWeight:600,marginBottom:t.entries.length?2:0},children:t.title+""}),t.entries.map(t=>No("div",{style:{opacity:.7,fontSize:11},children:[t.key,":"," ",To("span",{style:{fontWeight:600},children:Wo(t.value)})]},t.key))]})}return No("div",{className:"semiotic-tooltip",style:Xt,children:[To("div",{style:{fontWeight:600,marginBottom:2},children:Wo(i)}),To("div",{style:{opacity:.7,fontSize:11},children:Wo(o)})]})}function Oo(t,e){if(!e||0===t.length)return t;if(!t.some(t=>null!=t&&"object"==typeof t&&Array.isArray(t[e])))return t;const i=[];for(const o of t){if(null==o||"object"!=typeof o)continue;const t=o[e];if(!Array.isArray(t))continue;const n=o.label??o.id??o.key;for(const e of t)null!=e&&"object"==typeof e&&i.push(null==n?e:{...e,_lineGroup:n})}return i}Do.ownsChrome=!0;import{jsx as Eo,jsxs as zo}from"react/jsx-runtime";var Lo=w,Fo=po;function Bo(t){if(t)return"x"===t.dimension?"pan-y":"y"===t.dimension?"pan-x":"none"}var Io=We(Ne(function(t,e){const{chartType:o,runtimeMode:n,data:s,chunkThreshold:a,chunkSize:l,xAccessor:c,yAccessor:h,accessorRevision:u,colorAccessor:g,sizeAccessor:f,symbolAccessor:d,symbolMap:x,groupAccessor:v,lineDataAccessor:b,curve:w,normalize:A,baseline:C,stackOrder:S,binSize:_,valueAccessor:M,arrowOfTime:P="right",windowMode:R="sliding",windowSize:T=200,timeAccessor:N,xExtent:W,yExtent:D,extentPadding:O=.1,scalePadding:z,sizeRange:L,size:F=[500,300],responsiveWidth:B,responsiveHeight:I,margin:q,className:U,background:K,maxDevicePixelRatio:Z,renderMode:Q,lineStyle:tt,pointStyle:et,areaStyle:it,barStyle:ot,waterfallStyle:nt,swarmStyle:st,barColors:lt,colorScheme:ct,boundsAccessor:vt,boundsStyle:Mt,y0Accessor:Pt,band:Yt,gradientFill:Wt,lineGradient:Dt,semanticLineStops:Et,areaGroups:zt,openAccessor:Ft,highAccessor:Bt,lowAccessor:It,closeAccessor:Xt,candlestickStyle:Ht,showAxes:qt=!0,axes:Jt,xLabel:Zt,yLabel:Qt,yLabelRight:ee,xFormat:ne,yFormat:se,axisExtent:re,tickFormatTime:ae,tickFormatValue:le,hoverAnnotation:ce,tooltipContent:he,customHoverBehavior:ue,customClickBehavior:ge,onObservation:ye,annotationObservationCallback:me,chartId:ve,enableHover:be,hoverRadius:we=30,tooltipMode:Re,annotations:Ne,onAnnotationActivate:We,autoPlaceAnnotations:Ie,svgAnnotationRules:Xe,showGrid:$e,legend:Ge,legendHoverBehavior:je,legendClickBehavior:He,legendHighlightedCategory:qe,legendIsolatedCategories:Ue,legendPosition:Ke,legendLayout:Je,legendCategoryAccessor:Ze,onCategoriesChange:Qe,backgroundGraphics:ti,foregroundGraphics:ei,canvasPreRenderers:ii,svgPreRenderers:oi,title:ni,categoryAccessor:si,brush:ri,onBrush:ai,decay:li,pulse:ci,transition:hi,animate:ui,staleness:gi,frameScheduler:fi,clock:di,random:pi,seed:yi,paused:mi=!1,suspendWhenHidden:xi=!0,heatmapAggregation:vi,heatmapXBins:bi,heatmapYBins:ki,showValues:wi,heatmapValueFormat:Ai,heatmapColorScale:Ci,onColorDomainChange:_i,marginalGraphics:Mi,pointIdAccessor:Ti,xScaleType:Ni,yScaleType:Wi,accessibleTable:Di=!0,description:Oi,summary:Ei,linkedCrosshairName:zi,linkedCrosshairSourceId:Li,customLayout:Fi,onLayoutError:Ii,layoutConfig:Xi,layoutSelection:$i}=t,{customHoverBehavior:Gi,customClickBehavior:Vi,hasClickBehavior:ji}=G({customHoverBehavior:ue,customClickBehavior:ge,onObservation:ye,chartId:ve,chartType:"StreamXYFrame"}),Hi=Ee().replace(/:/g,""),qi=Fe(!1),Ui=Fe({w:-1,h:-1}),Ki=Fe(!1),Ji=Ae({sizeProp:F,responsiveWidth:B,responsiveHeight:I,userMargin:q,marginDefault:Lo,title:ni,legend:Ge,legendPosition:Ke,...k(t,Ge),animate:ui,transitionProp:hi,frameScheduler:fi,clock:di,random:pi,seed:yi,paused:mi,suspendWhenHidden:xi,themeDirtyRef:qi}),Zi=Se(),Qi=Me(),{reducedMotionRef:to,responsiveRef:eo,size:io,currentTheme:oo,transition:no,introEnabled:so,tableId:ro,rafRef:ao,renderFnRef:lo,scheduleRender:ho,frameRuntime:uo}=Ji;let go=Ji.margin;if(Mi){const t=60,e={...Ji.margin};Mi.top&&t>e.top&&(e.top=t),Mi.bottom&&t>e.bottom&&(e.bottom=t),Mi.left&&t>e.left&&(e.left=t),Mi.right&&t>e.right&&(e.right=t),go=e}const mo=io[0]-go.left-go.right,xo=io[1]-go.top-go.bottom,ko=(Jt?.find(t=>"left"===t.orient)??Jt?.find(t=>"right"===t.orient))?.extent??re,wo=Le(()=>$t(s),[s]),Ao=ce??be,[Co,So]=Be(0),_o=Fe(0),[Mo,Po]=Be(null),Yo=gt(ei,io,go,Mo),To=gt(ti,io,go,Mo),No=Fe(null),Wo=Fe(!1),Io=Fe(null),Xo=Fe(void 0),[$o,Go]=Be(null),Vo=Fe(Fo.primary),jo=Fe(function(){let t=-1,e=po;return{resolve(i){if(!i)return po;const o=Gt();return o===t||(e=function(t){if(!t)return po;const e=getComputedStyle(t),i=e.getPropertyValue("--semiotic-border").trim(),o=e.getPropertyValue("--semiotic-text-secondary").trim(),n=e.getPropertyValue("--semiotic-bg").trim(),s=e.getPropertyValue("--semiotic-primary").trim(),r=o||e.getPropertyValue("--text-secondary").trim(),a=e.getPropertyValue("--text-primary").trim(),l=i||e.getPropertyValue("--surface-3").trim(),c=n||e.getPropertyValue("--surface-0").trim();return r||a||i||s?{axisStroke:l||po.axisStroke,tickText:r||po.tickText,crosshair:r?yo(r,"66"):po.crosshair,hoverFill:c?yo(c,"4D"):po.hoverFill,hoverStroke:r?yo(r,"99"):po.hoverStroke,pointRing:c||po.pointRing,primary:s||po.primary,background:c||po.background}:po}(i),t=o),e},invalidate(){t=-1}}}()),Ho=Fe(!1),qo=_e("StreamXYFrame"),[Uo,Ko]=Be(!1),[Jo,Zo]=Be([]),[Qo,tn]=Be([]),en="streaming"===n||["bar","swarm","waterfall"].includes(o),on=Le(()=>({chartType:o,runtimeMode:en?"streaming":"bounded",windowSize:T,windowMode:R,arrowOfTime:en?P:"right",extentPadding:O,scalePadding:z,axisExtent:re,yAxisExtent:ko,xAccessor:c,yAccessor:h,accessorRevision:u,timeAccessor:en?N:void 0,valueAccessor:M,colorAccessor:g,sizeAccessor:f,symbolAccessor:d,symbolMap:x,groupAccessor:v||(b?"_lineGroup":void 0),categoryAccessor:si,lineDataAccessor:b,xScaleType:Ni,yScaleType:Wi,xExtent:W,yExtent:D,sizeRange:L,binSize:_,normalize:A,baseline:C,stackOrder:S,boundsAccessor:vt,boundsStyle:Mt,y0Accessor:Pt,band:Yt,gradientFill:y(Wt),areaGroups:zt?new Set(zt):void 0,lineGradient:p(Dt),semanticLineStops:Et,openAccessor:Ft,highAccessor:Bt,lowAccessor:It,closeAccessor:Xt,candlestickStyle:Ht,lineStyle:tt,pointStyle:et,areaStyle:it,swarmStyle:st,waterfallStyle:nt,colorScheme:ct,barColors:lt,barStyle:ot,annotations:Ne,decay:li,pulse:ci,transition:no,introAnimation:so,staleness:gi,clock:uo.now,heatmapAggregation:vi,heatmapXBins:bi,heatmapYBins:ki,showValues:wi,heatmapValueFormat:Ai,heatmapColorScale:Ci,pointIdAccessor:Ti,curve:w,themeCategorical:oo?.colors?.categorical,themeSemantic:Ye(oo),themeSequential:oo?.colors?.sequential,themeDiverging:oo?.colors?.diverging,customLayout:Fi,onLayoutError:Ii,layoutConfig:Xi,layoutMargin:go}),[o,en,T,R,P,O,z,re,ko,c,h,u,N,M,g,f,d,x,v,b,si,Ni,Wi,W,D,L,_,A,C,S,vt,Mt,Pt,Yt,Wt,zt,Dt,Et,Ft,Bt,It,Xt,Ht,tt,et,it,st,nt,ct,lt,ot,Ne,li,ci,no,so,gi,uo.now,vi,bi,ki,wi,Ai,Ci,Ti,w,oo,Fi,Ii,Xi,go]),nn=mt(on),sn=Fe(null);sn.current||(sn.current=new Si(nn));const rn=$(sn,Ze,Qe,t=>t.getData()),an=Fe({onColorDomainChange:_i,chartType:o}),ln=Fe(void 0);an.current={onColorDomainChange:_i,chartType:o};const cn=De(()=>{const{onColorDomainChange:t,chartType:e}=an.current;if(!t||"heatmap"!==e)return;let i=1/0,o=-1/0;for(const t of sn.current?.scene??[]){if("heatcell"!==t.type)continue;const e=Number(t.value??t.datum?.value);Number.isFinite(e)&&(i>e&&(i=e),e>o&&(o=e))}const n=Number.isFinite(i)&&Number.isFinite(o)?[i,o]:null,s=ln.current;null===s&&null===n||s&&n&&s[0]===n[0]&&s[1]===n[1]||(ln.current=n,t(n))},[]);pt(sn,nn,qi,ho),yt(sn,$i,qi,ho);const hn=Fe(null);hn.current||(hn.current=new i(t=>{const e=sn.current;e&&e.ingest(t)&&(qi.current=!0,ho())},{chunkThreshold:a,chunkSize:l})),Oe(()=>{hn.current?.updateChunkOptions({chunkThreshold:a,chunkSize:l})},[a,l]);const un=De(t=>{hn.current?.push(t)},[]),gn=De(t=>{hn.current?.pushMany(t)},[]),fn=De(()=>{hn.current?.clear(),sn.current?.clear(),qi.current=!0,ho()},[ho]);ze(e,()=>({push:un,pushMany:gn,remove:t=>{hn.current?.flush();const e=sn.current?.remove(t)??[];return e.length>0&&(No.current&&e.some(t=>t===No.current?.data)&&(No.current=null,Go(null)),qi.current=!0,ho()),e},update:(t,e)=>{hn.current?.flush();const i=sn.current?.update(t,e)??[];return i.length>0&&(qi.current=!0,ho()),i},clear:fn,getData:()=>(hn.current?.flush(),sn.current?.getData()??[]),getScales:()=>sn.current?.scales??null,getExtents:()=>sn.current?.getExtents()??null,getCustomLayout:()=>sn.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>sn.current?.lastCustomLayoutFailure??null}),[un,gn,fn,ho]),Oe(()=>{s&&hn.current?.setBoundedData(Oo(wo,b))},[s,wo,b]);const{canvasRef:dn,interactionCanvasRef:pn,resolutionDirtyRef:yn}=Ce(Ji,{storeRef:sn,dirtyRef:qi,hydrated:Zi,wasHydratingFromSSR:Qi,cleanup:()=>hn.current?.clear(),maxDevicePixelRatio:Z,canvasPaintDependencies:[o,mo,xo,qt,K,ti,tt,Q,ii,ho]}),{hoverHandlerRef:mn,hoverLeaveRef:xn,onPointerMove:vn,onPointerLeave:bn,pointerStateRef:kn}=Ji;mn.current=t=>{const e=dn.current;if(!e)return;const i=e.getBoundingClientRect(),n=t.clientX-i.left-go.left,s=t.clientY-i.top-go.top;if(0>n||n>mo||0>s||s>xo){if(pe(e),!Ao)return;return void(No.current&&(No.current=null,Io.current=null,Go(null),Gi?.(null),ho()))}const r=sn.current;if(!r||0===r.scene.length)return void pe(e);const a=jt(we,t.pointerType),l=Yi(r.scene,n,s,a,r.quadtree,r.maxPointRadius);if(pe(e,de(l?.node)),!Ao)return;const h="multi"===Re,u=()=>{No.current&&(No.current=null,Io.current=null,Go(null),Gi&&Gi(null),ho())};if(!l&&!h)return void u();const g=h||!l?n:l.x,f=h||!l?s:l.y,d=l?.datum?E(l.datum,r.resolvedRibbons):{},p=r.scales?.x?.invert,y="function"==typeof p?p(g):void 0;let m=Ot(d,g,f,null!=y?{xValue:y,xPx:g}:void 0);if(h&&r.scene.length>0&&r.scales){const t=function(t,e,i=30){const o=[];for(const n of t)if("line"===n.type){const t=n;if(2>t.path.length)continue;const s=Ri(Pi(t.path,t.curve),e,i);if(null===s)continue;const r=Bi(t.path,e);o.push({node:n,datum:Array.isArray(t.datum)&&t.datum[r]?t.datum[r]:t.datum,x:t.path[r][0],y:s,group:t.group,color:t.style.stroke})}else if("area"===n.type){const t=n;if(!1===t.interactive)continue;if(2>t.topPath.length)continue;const s=Pi(t.topPath,t.curve),r=Pi(t.bottomPath,t.curve),a=Ri(s,e,i);if(null===a)continue;const l=Ri(r,e,i),c=Bi(t.topPath,e);o.push({node:n,datum:Array.isArray(t.datum)&&t.datum[c]?t.datum[c]:t.datum,x:t.topPath[c][0],y:a,y0:l??void 0,group:t.group,color:"string"==typeof t.style.stroke?t.style.stroke:"string"==typeof t.style.fill?t.style.fill:void 0})}return o}(r.scene,g,Math.max(a,mo));if(t.length>0){const e=r.scales.y.invert,i=Vo.current,n=p?p(g):g;if(l)m.xValue=n,m.xPx=g;else{const t={xValue:n};"string"==typeof c&&(t[c]=n),m=Ot(t,g,f,{xValue:n,xPx:g})}m.allSeries=t.map(t=>{const n=e?e(t.y):t.y,s=null!=t.y0?e?e(t.y0):t.y0:void 0;return{group:t.group||"",value:"stackedarea"===o&&null!=s?n-s:n,valuePx:t.y,color:t.color||i,datum:E(t.datum,r.resolvedRibbons)}})}}l||m.allSeries?.length?(No.current=m,Io.current=l?.node??null,Go(m),Gi?.(m),ho()):u()},xn.current=()=>{pe(dn.current),No.current&&(No.current=null,Io.current=null,Go(null),Gi?.(null),ho())},ke(dn);const wn=Fe(()=>{});wn.current=t=>{if(Ut(t.target))return;if(!Vi)return;const e=dn.current;if(!e)return;const i=e.getBoundingClientRect(),o=t.clientX-i.left-go.left,n=t.clientY-i.top-go.top;if(0>o||o>mo||0>n||n>xo)return void Vi(null);const s=sn.current;if(!s||0===s.scene.length)return void Vi(null);const r=jt(we,Xo.current),a=Yi(s.scene,o,n,r,s.quadtree,s.maxPointRadius);if(!a)return void Vi(null);const l=a.datum||{},c=s.scales?.x?.invert,h="function"==typeof c?c(a.x):void 0;Vi(Ot(l,a.x,a.y,null!=h?{xValue:h,xPx:a.x}:void 0),{type:"activate",inputType:te(Xo.current)})};const An=De(t=>wn.current(t),[]),{kbFocusIndexRef:Cn,focusedNavPointRef:Sn,onKeyDown:_n}=V({storeRef:sn,hoverRef:No,hoveredNodeRef:Io,setHoverPoint:Go,customHoverBehavior:Gi,customClickBehavior:Vi,scheduleRender:ho}),Mn=De(t=>{dt(kn,t,!!Ao,Wo.current,dn.current)&&(Xo.current=t.pointerType,Cn.current=-1,Sn.current=null,vn(t))},[dn,Ao,Sn,Cn,vn,kn]),Pn=De(t=>{dt(kn,t,!!Ao,Wo.current,dn.current,"mouse")&&(Xo.current="mouse",Cn.current=-1,Sn.current=null,vn({clientX:t.clientX,clientY:t.clientY,pointerType:"mouse"}))},[dn,Ao,Sn,Cn,vn,kn]),Yn=De(t=>{Xo.current=t.pointerType},[]);lo.current=()=>{if(ao.current=null,!uo.isActive)return;const t=dn.current,e=pn.current;if(!t||!e)return;const i=sn.current;if(!i)return;const n=uo.now(),s=null!=i.activeTransition,r=i.advanceTransition(to.current?n+1e6:n),a=!to.current&&r,l=Ui.current.w!==mo||Ui.current.h!==xo,u=yn.current,g=qi.current||s||l,f=s&&!r,d=i.consumeStylePaintPending();let p=!1;const y=i.getLastUpdateResult(),m=qo.current.beforeCompute(y,a);!qi.current&&!l||a&&!l||(i.computeScene({width:mo,height:xo}),Ui.current={w:mo,h:xo},p=!0,rn(),cn()),(p||d)&&(Wo.current=fe(i.scene),Wo.current||pe(t)),Wo.current&&(s||p||d)&&function(t){const{canvas:e,pointer:i,store:o,margin:n,width:s,height:r}=t;oe(e,i,i=>{const a=e.getBoundingClientRect(),l=i.clientX-a.left-n.left,c=i.clientY-a.top-n.top;if(0>l||l>s||0>c||c>r)return;const h=Yi(o.scene,l,c,jt(t.hoverRadius,i.pointerType),t.geometryMoved?null:o.quadtree,o.maxPointRadius);return de(h?.node)})}({canvas:t,pointer:kn.current,store:i,margin:go,width:mo,height:xo,hoverRadius:we,geometryMoved:s||p}),qo.current.afterCompute(m,p,l);const x=X(i,n,p,Ki),v=Vt(Z);xe(t,io,v),xe(e,io,v);const b=jo.current.resolve(t);Vo.current=b.primary;const k=ft(gi,i.lastIngestTime>0?n-i.lastIngestTime:0),w=gi&&k.isStale;if(g||d||x.changed||u){const e=ie(t,io,go,v);if(e){if(e.clearRect(-go.left,-go.top,io[0],io[1]),gi&&1>k.alpha&&(e.globalAlpha=k.alpha),rt(e,{background:K,hasBackgroundGraphics:!!ti,themeBackground:b.background,x:-go.left,y:-go.top,width:io[0],height:io[1]}),e.save(),"function"==typeof e.rect&&(e.beginPath(),e.rect(0,0,mo,xo),e.clip()),ii&&i.scales)for(const t of ii)e.save(),t(e,i.scene,i.scales,{width:mo,height:xo}),e.restore();const t=Fi?Ro.custom:Ro[o];at({context:e,nodes:i.scene,renderMode:Q,pixelRatio:v,paintBuiltIn:o=>{if(t&&i.scales)for(const n of t)n(e,o,i.scales,{width:mo,height:xo})}}),e.restore(),gi&&1>k.alpha&&(e.globalAlpha=1)}}const A=!!(Ao&&No.current&&i.scales),C=!!(Io.current&&Array.isArray(ce)&&ce.some(t=>t&&"object"==typeof t&&"highlight"===t.type)),S=A||C;if(j(S,Ho.current)){const t=ie(e,io,go,v);if(t&&(t.clearRect(-go.left,-go.top,io[0],io[1]),A&&No.current&&function(t,e,i,o,n,s,r){if(!1===n.crosshair)return;const a=e.allSeries,l=a&&a.length>0,c=e.xPx??e.x;t.save();const h="object"==typeof n.crosshair?n.crosshair:{};t.strokeStyle=h.stroke||r.crosshair;const u=h.strokeWidth??1;if(t.setLineDash(h.strokeDasharray?h.strokeDasharray.split(/[\s,]+/).map(Number):[4,4]),u>0&&(t.lineWidth=u,t.beginPath(),t.moveTo(l?c:e.x,0),t.lineTo(l?c:e.x,o),t.stroke(),l||(t.beginPath(),t.moveTo(0,e.y),t.lineTo(i,e.y),t.stroke())),t.restore(),l){t.lineWidth=2,t.strokeStyle=r.pointRing;for(const e of a)null!=e.valuePx&&(t.beginPath(),t.arc(c,e.valuePx,4,0,2*Math.PI),t.fillStyle=e.color||r.primary,t.fill(),t.stroke())}else{const i=n.pointColor||Y(s)||r.primary;t.beginPath(),t.arc(e.x,e.y,4,0,2*Math.PI),t.fillStyle=i,t.fill(),t.strokeStyle=r.pointRing,t.lineWidth=2,t.stroke()}}(t,No.current,mo,xo,"object"==typeof Ao?Ao:{},Io.current,b),C&&Io.current&&Array.isArray(ce))){const e=ce.find(t=>t&&"object"==typeof t&&"highlight"===t.type);e&&function(t,e,i,o,n){if(!i)return;const s="group"in i?i.group:void 0;if(void 0!==s)for(const i of e){if("line"!==i.type)continue;if(i.group!==s)continue;if(2>i.path.length)continue;const e="function"==typeof o.style?i.datum?o.style(i.datum):{}:o.style||{};t.save(),t.beginPath(),t.moveTo(i.path[0][0],i.path[0][1]);for(let e=1;i.path.length>e;e++)t.lineTo(i.path[e][0],i.path[e][1]);t.strokeStyle=e.stroke||i.style.stroke||n.primary;const r=e.strokeWidth??(i.style.strokeWidth??2)+2;r>0?(t.lineWidth=r,t.globalAlpha=e.opacity??1,t.stroke(),t.restore()):t.restore()}}(t,i.scene,Io.current,e,b)}Ho.current=S}g&&t&&t.setAttribute("aria-label",Lt(i.scene,o+" chart"));const _=qi.current;if(qi.current=_&&a&&!p,yn.current=!1,_&&i.scales){const t=t=>"object"==typeof t&&null!==t&&"function"==typeof t.valueOf?t.valueOf():t;if((!Mo||t(Mo.x.domain()[0])!==t(i.scales.x.domain()[0])||t(Mo.x.domain()[1])!==t(i.scales.x.domain()[1])||t(Mo.y.domain()[0])!==t(i.scales.y.domain()[0])||t(Mo.y.domain()[1])!==t(i.scales.y.domain()[1])||Mo.x.range()[0]!==i.scales.x.range()[0]||Mo.x.range()[1]!==i.scales.x.range()[1]||Mo.y.range()[0]!==i.scales.y.range()[0]||Mo.y.range()[1]!==i.scales.y.range()[1])&&Po(i.scales),Mi){const t=i.getData(),e="function"==typeof c?c:t=>t[c||"x"],o="function"==typeof h?h:t=>t[h||"y"];Zo(t.map(t=>e(t)).filter(t=>"number"==typeof t&&isFinite(t))),tn(t.map(t=>o(t)).filter(t=>"number"==typeof t&&isFinite(t)))}}(Ne&&Ne.length>0||Fi)&&(p||s)&&(p||f||n-_o.current>=33)&&(So(t=>t+1),_o.current=n),gi?.showBadge&&Ko(!!w),(a||null!=i.activeTransition||x.pending)&&ho()},xt(gi,sn,qi,ho,uo.now,Uo,Ko);const Rn=Le(()=>{if(ne||ae)return;const t=sn.current;return t?.xIsDate&&Mo?vo(Mo.x.domain()):void 0},[ne,ae,Mo]),Tn=ne||ae||Rn,Nn=Ao&&$o?he?he($o):Eo(Do,{hover:$o}):null,Wn=Nn?Eo(St,{x:$o.x,y:$o.y,containerWidth:mo,containerHeight:xo,margin:go,className:"stream-frame-tooltip",children:Nn}):null,Dn=Sn.current,On=Eo(_t,{active:Cn.current>=0,hoverPoint:$o,margin:go,size:io,shape:Dn?.shape,width:Dn?.w,height:Dn?.h}),En=m(c,N,"__semiotic_resolvedX","__semiotic_resolvedTime"),zn=m(h,M,"__semiotic_resolvedY","__semiotic_resolvedValue"),Ln=En.key,Fn=zn.key,Bn=r(En,zn,Ne&&Ne.length>0||!1);if(Kt||!Zi&&Qi){const t=sn.current;t&&s&&(t.ingest({inserts:Oo(wo,b),bounded:!0}),t.computeScene({width:mo,height:xo}));const e=t?.scene??[],i=t?.scales??null,o=gt(ei,io,go,i),n=gt(ti,io,go,i),r=Tn||(()=>{if(t?.xIsDate&&i)return vo(i.x.domain())})();return zo("div",{ref:eo,className:"stream-xy-frame"+(U?" "+U:""),role:"img","aria-label":Oi||("string"==typeof ni?ni:"XY chart"),style:{position:"relative",width:B?"100%":io[0],height:I?"100%":io[1]},children:[Eo(Tt,{summary:Ei}),zo("svg",{xmlns:"http://www.w3.org/2000/svg",width:io[0],height:io[1],style:{position:"absolute",left:0,top:0},children:[zo("g",{transform:`translate(${go.left},${go.top})`,children:[K&&Eo("rect",{x:0,y:0,width:mo,height:xo,fill:K}),n]}),zo("g",{transform:`translate(${go.left},${go.top})`,children:[oi&&i&&oi.map((t,o)=>Eo(Te.Fragment,{children:t(e,i,{width:mo,height:xo})},"svgpre-"+o)),e.map((t,e)=>ht({node:t,index:e,renderMode:Q,fallback:()=>Pe(t,e,Hi,we)})).filter(Boolean)]})]}),Eo(fo,{width:mo,height:xo,totalWidth:io[0],totalHeight:io[1],margin:go,scales:i,showAxes:qt,axes:Jt,xLabel:Zt,yLabel:Qt,yLabelRight:ee,xFormat:r,yFormat:se||le,axisExtent:re,showGrid:$e,title:ni,legend:Ge,legendHoverBehavior:je,legendClickBehavior:He,legendHighlightedCategory:qe,legendIsolatedCategories:Ue,legendPosition:Ke,legendLayout:Je,foregroundGraphics:J(o,bt(sn.current?.customLayoutOverlays,$i??null)),marginalGraphics:Mi,xValues:[],yValues:[],annotations:Ne,onAnnotationActivate:We,onObservation:me??ye,chartId:ve,chartType:"StreamXYFrame",autoPlaceAnnotations:Ie,svgAnnotationRules:Xe,annotationFrame:0,xAccessor:Ln,yAccessor:Fn,annotationData:Bn(sn.current?.getData()),pointNodes:bo(sn.current?.scene),curve:"string"==typeof w?w:void 0,linkedCrosshairName:zi,linkedCrosshairSourceId:Li})]})}return zo("div",{ref:eo,className:"stream-xy-frame"+(U?" "+U:""),role:"group","aria-label":Oi||("string"==typeof ni?ni:"XY chart"),tabIndex:0,style:{position:"relative",width:B?"100%":io[0],height:I?"100%":io[1],overflow:"visible",touchAction:Bo(ri)},onKeyDown:_n,children:["production"!==process.env.NODE_ENV&&sn.current&&Eo(Rt,{store:sn.current,diagnostics:qo.current}),Di&&zo(wt,{accessibleTable:Di,children:[Eo(Nt,{tableId:ro}),Eo(kt,{scene:sn.current?.scene??[],chartType:o+" chart",tableId:ro,chartTitle:"string"==typeof ni?ni:void 0})]}),Eo(Tt,{summary:Ei}),Eo(At,{hoverPoint:$o}),zo("div",{role:"img","aria-label":Oi||("string"==typeof ni?ni:"XY chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:Mn,onMouseMove:Pn,onPointerLeave:bn,onMouseLeave:bn,onPointerDown:Ao||ji?Yn:void 0,onClick:ji?An:void 0,children:[Eo(Ct,{size:io,margin:go,backdropFill:ti?K:void 0,children:To}),Eo(co,{width:mo,height:xo,totalWidth:io[0],totalHeight:io[1],margin:go,scales:Mo,showAxes:qt,axes:Jt,showGrid:$e,xFormat:Tn,yFormat:se||le,axisExtent:re}),Eo("canvas",{ref:dn,"aria-label":Lt(sn.current?.scene??[],o+" chart"),style:{position:"absolute",left:0,top:0}}),Eo("canvas",{ref:pn,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),Eo(fo,{width:mo,height:xo,totalWidth:io[0],totalHeight:io[1],margin:go,scales:Mo,showAxes:qt,axes:Jt,xLabel:Zt,yLabel:Qt,yLabelRight:ee,xFormat:Tn,yFormat:se||le,axisExtent:re,showGrid:$e,title:ni,legend:Ge,legendHoverBehavior:je,legendClickBehavior:He,legendHighlightedCategory:qe,legendIsolatedCategories:Ue,legendPosition:Ke,legendLayout:Je,foregroundGraphics:J(Yo,bt(sn.current?.customLayoutOverlays,$i??null)),marginalGraphics:Mi,xValues:Jo,yValues:Qo,annotations:Ne,onAnnotationActivate:We,onObservation:me??ye,chartId:ve,chartType:"StreamXYFrame",autoPlaceAnnotations:Ie,svgAnnotationRules:Xe,annotationFrame:Co,xAccessor:Ln,yAccessor:Fn,annotationData:Bn(sn.current?.getData()),pointNodes:bo(sn.current?.scene),curve:"string"==typeof w?w:void 0,underlayRendered:!0,canvasObscuresUnderlay:!!ut({background:K,hasBackgroundGraphics:!!ti,themeBackground:oo?.colors.background}),linkedCrosshairName:zi,linkedCrosshairSourceId:Li}),(ri||ai)&&Eo(Ve,{width:mo,height:xo,totalWidth:io[0],totalHeight:io[1],margin:go,dimension:ri?.dimension??"xy",scales:Mo,onBrush:ai??(()=>{}),binSize:_,snap:ri?.snap,binBoundaries:ri?.binBoundaries??("bar"===o?sn.current?.getBinBoundaries():void 0),snapDuring:ri?.snapDuring,streaming:"streaming"===n}),gi?.showBadge&&Eo(H,{isStale:Uo,position:gi.badgePosition}),On,Wn]})]})}));Io.displayName="StreamXYFrame";var Xo=Io;export{Do as DefaultTooltip,Xo as StreamXYFrame_default};
|
package/dist/c-WJCD5EUY.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t){let n=1/0,o=-1/0;for(const e of t)n>e&&(n=e),e>o&&(o=e);return[n,o]}function n(t,n=1/0){let o=n;for(const n of t)o>n&&(o=n);return o}function o(t,n=-1/0){let o=n;for(const n of t)n>o&&(o=n);return o}function e(t){return Math.round(100*t)/100}function r(t){const n=[0,0,0,0];let o=0;for(const[e,r]of t)null!==r&&(o++,n[0]+=e,n[1]+=r,n[2]+=e*e,n[3]+=e*r);const r=o*n[2]-n[0]*n[0],u=0===r?0:e((o*n[3]-n[0]*n[1])/r),f=e(n[1]/o-u*n[0]/o);return{points:t.map(([t])=>[e(t),e(u*t+f)]),equation:[u,f]}}function u(t,n=2){const o=[],r=[],u=n+1;for(let n=0;u>n;n++){let e=0;for(const[o,r]of t)null!==r&&(e+=o**n*r);o.push(e);const f=[];for(let o=0;u>o;o++){let e=0;for(const[r,u]of t)null!==u&&(e+=r**(n+o));f.push(e)}r.push(f)}r.push(o);const f=function(t,n){const o=t,e=t.length-1,r=[n];for(let t=0;e>t;t++){let n=t;for(let r=t+1;e>r;r++)Math.abs(o[t][r])>Math.abs(o[t][n])&&(n=r);for(let r=t;e+1>r;r++){const e=o[r][t];o[r][t]=o[r][n],o[r][n]=e}for(let n=t+1;e>n;n++)for(let r=e;r>=t;r--)o[r][n]-=o[r][t]*o[t][n]/o[t][t]}for(let t=e-1;t>=0;t--){let n=0;for(let u=t+1;e>u;u++)n+=o[u][t]*r[u];r[t]=(o[e][t]-n)/o[t][t]}return r}(r,u).map(e);return{points:t.map(([t])=>[e(t),e(f.reduce((n,o,e)=>n+o*t**e,0))]),equation:[...f].reverse()}}function f(t){const n=t.length;let o=0,e=0,r=0,u=0;for(const[n,f]of t)o+=n,e+=f,r+=n*n,u+=n*f;const f=n*r-o*o;if(1e-12>Math.abs(f))return null;const c=(n*u-o*e)/f,s=(e-c*o)/n;return t=>s+c*t}function c(t,n){const o=t.length,e=t.map(([t,o])=>o-n(t)).reduce((t,n)=>t+n*n,0),r=Math.sqrt(e/Math.max(o-2,1)),u=t.reduce((t,n)=>t+n[0],0)/o,f=t.reduce((t,n)=>t+(n[0]-u)**2,0);return{se:r,meanX:u,ssX:f}}function s(t){return.99>t?.95>t?.9>t?1:1.645:1.96:2.576}export{t as getMinMax,n as getMin,o as getMax,r as linearRegression,u as polynomialRegression,f as fitLinearForForecast,c as forecastIntervalStats,s as confidenceZScore};
|
package/dist/c-YDAY2WFR.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],r={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"transparent",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},t={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},o={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:e,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"};function a(e){if(!e?.colors)return;const r=e.colors;return{primary:r.primary,secondary:r.secondary||r.primary,surface:r.surface||r.background,success:r.success,danger:r.danger,warning:r.warning,error:r.error,info:r.info,text:r.text,textSecondary:r.textSecondary,border:r.border,grid:r.grid}}function i(r){if(!r.accessibility)return r;let t=r;if(r.accessibility.colorBlindSafe&&(t={...t,colors:{...t.colors,categorical:e}}),r.accessibility.highContrast){const e="dark"===t.mode;t={...t,colors:{...t.colors,text:e?"#ffffff":"#000000",textSecondary:e?"#cccccc":"#333333",grid:e?"#666666":"#999999",border:e?"#888888":"#000000"}}}return t}function n(e,a){if("light"===a)return r;if("dark"===a)return t;if("high-contrast"===a)return o;if("string"==typeof a)return void 0!==console&&console.warn(`[ThemeStore] Unknown theme preset "${a}". Keeping current theme.`),e;if(a.mode&&"auto"!==a.mode){const e="dark"===a.mode?t:r;return i({...e,...a,colors:{...e.colors,...a.colors||{}},typography:{...e.typography,...a.typography||{}}})}return i({...e,...a,colors:{...e.colors,...a.colors||{}},typography:{...e.typography,...a.typography||{}}})}import{createContext as c,useCallback as s,useContext as f,useMemo as d,useRef as l,useSyncExternalStore as u}from"react";import{jsx as p}from"react/jsx-runtime";function g(e){let r=null;const t=()=>(r||(r=c(null)),r),o=b(e);return[function({children:r,initialState:o}){const a=l(o),i=d(()=>b(e,a.current),[]),n=t();return p(n.Provider,{value:i,children:r})},(e,r)=>{const a=t(),i=f(a)??o,n=l(e);n.current=e;const c=l({hasValue:!1,value:void 0}),d=s(()=>{const e=n.current(i.getState()),t=c.current;return t.hasValue&&r&&r(t.value,e)?t.value:(c.current={hasValue:!0,value:e},e)},[i,r]),p=s(()=>n.current(i.getState()),[i]);return u(i.subscribe,d,p)}]}function b(e,r){const t=new Set;let o={...e(function(e){const r=e(o);if(y(r)){o={...o,...r};for(const e of t)e()}}),...r??{}};return{getState:()=>o,subscribe:function(e){return t.add(e),()=>{t.delete(e)}}}}function y(e){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r))return!0;return!1}var[m,h]=g(e=>({observations:[],maxObservations:100,version:0,pushObservation(r){e(e=>{const t=e.observations;return t.push(r),t.length>e.maxObservations&&t.shift(),{version:e.version+1}})},clearObservations(){e(()=>({observations:[],version:0}))}}));import{useState as x,useEffect as S}from"react";function w(e,r){if("function"==typeof e.addEventListener)return e.addEventListener("change",r),()=>e.removeEventListener("change",r);const t=e;return t.addListener(r),()=>t.removeListener(r)}function k(e){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(e).matches}function z(){const[e,r]=x(()=>k("(prefers-reduced-motion: reduce)"));return S(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return r(e.matches),w(e,e=>r(e.matches))},[]),e}function v(){const[e,r]=x(()=>k("(forced-colors: active)"));return S(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(forced-colors: active)");return r(e.matches),w(e,e=>r(e.matches))},[]),e}function F(e){const r=[];for(const[t,o]of Object.entries(e.fields))if("point"===o.type)r.push(e=>o.values.has(e[t]));else{const[e,a]=o.range;r.push(r=>{const o=r[t];return o>=e&&a>=o})}return e=>r.every(r=>r(e))}function R(e,r){const t=[];for(const[o,a]of e.clauses)"crossfilter"===e.resolution&&o===r||t.push(F(a));return 0===t.length?()=>!0:"intersect"===e.resolution?e=>t.every(r=>r(e)):e=>t.some(r=>r(e))}function M(e,r){let t=e.get(r);return t||(t={name:r,resolution:"union",clauses:new Map},e.set(r,t)),t}function q(e,r){if(e.type!==r.type)return!1;if("interval"===e.type&&"interval"===r.type)return e.range[0]===r.range[0]&&e.range[1]===r.range[1];if("point"===e.type&&"point"===r.type){if(e.values.size!==r.values.size)return!1;for(const t of e.values)if(!r.values.has(t))return!1;return!0}return!1}var[O,B]=g(e=>({selections:new Map,setClause(r,t){e(e=>{const o=e.selections.get(r),a=o?.clauses.get(t.clientId);if(a&&function(e,r){if(e.clientId!==r.clientId||e.type!==r.type)return!1;const t=Object.entries(e.fields);if(t.length!==function(e){let r=0;for(const t in e)r++;return r}(r.fields))return!1;for(const[e,o]of t){const t=r.fields[e];if(!t||!q(o,t))return!1}return!0}(a,t))return{};const i=new Map(e.selections),n=M(i,r),c=new Map(n.clauses);return c.set(t.clientId,t),i.set(r,{...n,clauses:c}),{selections:i}})},clearClause(r,t){e(e=>{const o=e.selections.get(r);if(!o||!o.clauses.has(t))return{};const a=new Map(e.selections),i=new Map(o.clauses);return i.delete(t),a.set(r,{...o,clauses:i}),{selections:a}})},setResolution(r,t){e(e=>{const o=e.selections.get(r);if(o?.resolution===t)return{};const a=new Map(e.selections),i=M(a,r);return a.set(r,{...i,resolution:t}),{selections:a}})},clearSelection(r){e(e=>{const t=e.selections.get(r);if(!t||0===t.clauses.size)return{};const o=new Map(e.selections);return o.set(r,{...t,clauses:new Map}),{selections:o}})}})),E=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],C={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},I={light:r,dark:t,"high-contrast":o,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}};function N(e){return Object.prototype.hasOwnProperty.call(I,e)?I[e]:void 0}function j(e){const r={"--semiotic-bg":e.colors.background,"--semiotic-text":e.colors.text,"--semiotic-text-secondary":e.colors.textSecondary,"--semiotic-grid":e.colors.grid,"--semiotic-border":e.colors.border,"--semiotic-cell-border":e.colors.cellBorder||e.colors.border,"--semiotic-primary":e.colors.primary,"--semiotic-font-family":e.typography.fontFamily,"--semiotic-secondary":e.colors.secondary||e.colors.primary,"--semiotic-surface":e.colors.surface||e.colors.background};e.colors.categorical.forEach((e,t)=>{r["--semiotic-category-"+(t+1)]=e}),e.colors.focus&&(r["--semiotic-focus"]=e.colors.focus),e.colors.selection&&(r["--semiotic-selection-color"]=e.colors.selection),null!=e.colors.selectionOpacity&&(r["--semiotic-selection-opacity"]=e.colors.selectionOpacity+""),e.colors.diverging&&(r["--semiotic-diverging"]=e.colors.diverging),e.colors.annotation&&(r["--semiotic-annotation-color"]=e.colors.annotation),e.colors.success&&(r["--semiotic-success"]=e.colors.success),e.colors.danger&&(r["--semiotic-danger"]=e.colors.danger),e.colors.warning&&(r["--semiotic-warning"]=e.colors.warning),e.colors.error&&(r["--semiotic-error"]=e.colors.error),e.colors.info&&(r["--semiotic-info"]=e.colors.info),e.tooltip?.background&&(r["--semiotic-tooltip-bg"]=e.tooltip.background),e.tooltip?.text&&(r["--semiotic-tooltip-text"]=e.tooltip.text),e.tooltip?.borderRadius&&(r["--semiotic-tooltip-radius"]=e.tooltip.borderRadius),e.tooltip?.fontSize&&(r["--semiotic-tooltip-font-size"]=e.tooltip.fontSize),e.tooltip?.shadow&&(r["--semiotic-tooltip-shadow"]=e.tooltip.shadow),e.borderRadius&&(r["--semiotic-border-radius"]=e.borderRadius);const t=e.typography.legendSize??e.typography.labelSize;null!=t&&(r["--semiotic-legend-font-size"]=t+"px"),null!=e.typography.legendFontFamily&&(r["--semiotic-legend-font-family"]=e.typography.legendFontFamily),null!=e.typography.legendFontWeight&&(r["--semiotic-legend-font-weight"]=e.typography.legendFontWeight+"");const o=e.typography.titleFontSize??e.typography.titleSize;return null!=o&&(r["--semiotic-title-font-size"]=o+"px"),null!=e.typography.titleFontFamily&&(r["--semiotic-title-font-family"]=e.typography.titleFontFamily),null!=e.typography.titleFontWeight&&(r["--semiotic-title-font-weight"]=e.typography.titleFontWeight+""),null!=e.typography.tickFontFamily&&(r["--semiotic-tick-font-family"]=e.typography.tickFontFamily),null!=e.typography.tickSize&&(r["--semiotic-tick-font-size"]=e.typography.tickSize+"px"),null!=e.typography.labelSize&&(r["--semiotic-axis-label-font-size"]=e.typography.labelSize+"px"),r}import*as P from"react";var[L,A]=g(e=>({theme:r,setTheme(r){e(e=>({theme:n(e.theme,r)}))}}));import{jsx as H,jsxs as T}from"react/jsx-runtime";var G=P.createContext(void 0),U="undefined"==typeof window?P.useEffect:P.useLayoutEffect;function W(e){if("string"!=typeof e)return e;if("light"===e)return"light";if("dark"===e)return"dark";if("high-contrast"===e)return"high-contrast";return N(e)||(void 0!==console&&console.warn(`[ThemeProvider] Unknown theme preset "${e}". Falling back to light theme.`),"light")}function V({theme:e}){const a=A(e=>e.setTheme),i=A(e=>e.theme),n=P.useRef(i);n.current=i;const c=P.useRef(null);P.useEffect(()=>{if(void 0!==e)return;if("undefined"==typeof window||!window.matchMedia)return;const i=window.matchMedia("(forced-colors: active)");return i.matches&&(c.current=n.current===o?r:n.current,a("high-contrast")),w(i,e=>{e.matches?(c.current=n.current===o?c.current??r:n.current,a("high-contrast")):(function(e,a){e(a===r?"light":a===t?"dark":a===o?"high-contrast":a)}(a,c.current??r),c.current=null)})},[e,a]);const s=P.useRef(!1);return U(()=>{s.current?void 0!==e&&a(W(e)):s.current=!0},[e,a]),null}function $({children:e}){const r=A(e=>e.theme),t={position:"relative",colorScheme:"auto"===r.mode?"light dark":r.mode,...j(r)},o=P.useContext(G),a={};return o&&(a["data-semiotic-theme"]=o),a["data-semiotic-theme-mode"]=r.mode,H("div",{style:t,...a,children:e})}function D({theme:e,children:t}){const a="string"==typeof e&&N(e)?e:void 0,i=P.useMemo(()=>function(e){return void 0!==e?n(r,W(e)):"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(forced-colors: active)").matches?o:r}(e),[e]);return H(L,{initialState:{theme:i},children:T(G.Provider,{value:a,children:[H(V,{theme:e}),H($,{children:t})]})})}function K(){return A(e=>e.theme)}export{e as COLOR_BLIND_SAFE_CATEGORICAL,r as LIGHT_THEME,t as DARK_THEME,o as HIGH_CONTRAST_THEME,a as resolveThemeSemanticColors,g as createStore,y as hasOwnEnumerableKey,m as ObservationProvider,h as useObservationSelector,A as useThemeSelector,z as useReducedMotion,v as useHighContrast,R as buildPredicate,O as SelectionProvider,B as useSelectionSelector,E as CARBON_CATEGORICAL_14,C as CARBON_ALERT,I as THEME_PRESETS,N as resolveThemePreset,j as themeToCSSVariables,D as ThemeProviderWrapper,K as useTheme};
|
package/dist/c-ZOWWU34K.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{buildLinearFillGradient as t,buildThresholdLineSegments as e,resolveCSSColor as l,resolveCanvasFill as o,resolveCurveFactory as n}from"./c-GIKRQI4X.min.js";import{line as a}from"d3-shape";function i(t,e,l,o,n,a){if(2>e.length)return;const i=[0];for(let t=1;e.length>t;t++){const l=e[t][0]-e[t-1][0],o=e[t][1]-e[t-1][1];i.push(i[t-1]+Math.sqrt(l*l+o*o))}const h=i[i.length-1];if(0===h)return;const s=Math.min(.2*h,40);t.strokeStyle=l,t.lineWidth=o,t.lineCap=a;for(let l=0;e.length-1>l;l++){const o=(i[l]+i[l+1])/2;let a=n;s>o&&(a*=o/s),s>h-o&&(a*=(h-o)/s),t.globalAlpha=Math.max(0,a),t.beginPath(),t.moveTo(e[l][0],e[l][1]),t.lineTo(e[l+1][0],e[l+1][1]),t.stroke()}}var h=(h,s,r,p)=>{const c=s.filter(t=>"line"===t.type);for(const s of c){if(2>s.path.length)continue;const r=s._introClipFraction;void 0!==r&&1>r&&(h.save(),h.beginPath(),h.rect(0,0,p.width*r,p.height),h.clip());const c=s.style.stroke||"#007bff",f=l(h,c)||c,y=s.style.strokeWidth??2,g=s.colorThresholds,u=s.rawValues;if(h.setLineDash(s.style.strokeDasharray?s.style.strokeDasharray.split(/[\s,]+/).map(Number):[]),null!=s.style.opacity&&(h.globalAlpha=s.style.opacity),y>0&&(h.lineWidth=y),h.lineCap=s.style.strokeLinecap||"butt",s.style._edgeFade&&y>0){i(h,s.path,f,y,s.style.opacity??1,s.style.strokeLinecap||"butt"),h.globalAlpha=1,h.setLineDash([]),h.lineCap="butt";continue}const k=n(s.curve),b=g&&g.length>0&&u&&u.length===s.path.length,d=s._decayOpacities;if(y>0&&d&&d.length===s.path.length&&!b){h.strokeStyle=f;const t=s.style.opacity??1;for(let e=0;s.path.length-1>e;e++)h.globalAlpha=.5*(d[e]+d[e+1])*t,h.beginPath(),h.moveTo(s.path[e][0],s.path[e][1]),h.lineTo(s.path[e+1][0],s.path[e+1][1]),h.stroke()}else if(y>0&&!b){h.beginPath();const e=s.strokeGradient&&s.path.length>=2?t(h,s.strokeGradient,f,s.path[0][0],0,s.path[s.path.length-1][0],0):null;if(h.strokeStyle=e||f,k)a().x(t=>t[0]).y(t=>t[1]).curve(k).context(h)(s.path);else{const[t,e]=s.path[0];h.moveTo(t,e);for(let t=1;s.path.length>t;t++)h.lineTo(s.path[t][0],s.path[t][1])}h.stroke()}else if(y>0){const t=e(s.path,u,g,f);for(const e of t){h.beginPath(),h.strokeStyle=l(h,e.color)||e.color,h.moveTo(e.path[0][0],e.path[0][1]);for(let t=1;e.path.length>t;t++)h.lineTo(e.path[t][0],e.path[t][1]);h.stroke()}}if(s.style.fill&&s.style.fillOpacity&&s.style.fillOpacity>0){if(h.beginPath(),h.globalAlpha=s.style.fillOpacity,h.fillStyle=o(h,s.style.fill,s.style.fill),k&&!b)a().x(t=>t[0]).y(t=>t[1]).curve(k).context(h)(s.path);else{const[t,e]=s.path[0];h.moveTo(t,e);for(let t=1;s.path.length>t;t++)h.lineTo(s.path[t][0],s.path[t][1])}const t=s.path[0][0];h.lineTo(s.path[s.path.length-1][0],p.height),h.lineTo(t,p.height),h.closePath(),h.fill()}void 0!==r&&1>r&&h.restore(),h.globalAlpha=1,h.setLineDash([]),h.lineCap="butt"}};function s(t){if(!t)return null;if("heatcell"===t.type)return t.fill||null;if("candlestick"===t.type)return t.isUp?t.upColor:t.downColor;const{style:e}=t;if(!e)return null;const l="string"==typeof e.fill?e.fill:null;return"line"===t.type||"area"===t.type?e.stroke||l||null:l||e.stroke||null}export{h as lineCanvasRenderer,s as resolveNodeColor};
|
|
File without changes
|