semiotic 3.8.7 → 3.8.8
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/CLAUDE.md +2 -2
- package/README.md +56 -46
- package/ai/dist/mcp-server.js +28 -2
- package/ai/schema.json +124 -4
- package/ai/surface-manifest.json +1 -1
- package/ai/system-prompt.md +1 -1
- package/dist/{chunk-chartContainerDataAudit-JDSVSKGM.module.min.js → chunk-chartContainerDataAudit-IQ3NBN3Q.module.min.js} +1 -1
- package/dist/chunk-chunk-2B3AIKUZ.module.min.js +2 -0
- package/dist/chunk-chunk-2NVFEB7P.module.min.js +2 -0
- package/dist/chunk-chunk-3GCILWPB.module.min.js +2 -0
- package/dist/chunk-chunk-46KRGJQP.module.min.js +1 -0
- package/dist/{chunk-chunk-5SD6BHVW.module.min.js → chunk-chunk-4MLLQUGW.module.min.js} +1 -1
- package/dist/chunk-chunk-57RBPDBQ.module.min.js +2 -0
- package/dist/chunk-chunk-5VVNW5AZ.module.min.js +1 -0
- package/dist/chunk-chunk-66PCWJUG.module.min.js +1 -0
- package/dist/chunk-chunk-7LE56WAE.module.min.js +2 -0
- package/dist/chunk-chunk-7T25U75Z.module.min.js +2 -0
- package/dist/chunk-chunk-AF53TBSN.module.min.js +2 -0
- package/dist/chunk-chunk-BTZYH2IE.module.min.js +1 -0
- package/dist/chunk-chunk-BWV55BZK.module.min.js +2 -0
- package/dist/{chunk-chunk-FRO4TRXK.module.min.js → chunk-chunk-BZNOAHJV.module.min.js} +1 -1
- package/dist/chunk-chunk-CD6PVVS3.module.min.js +2 -0
- package/dist/chunk-chunk-DTSNLGRK.module.min.js +2 -0
- package/dist/{chunk-chunk-BNGBEY7N.module.min.js → chunk-chunk-FC3NZWYR.module.min.js} +1 -1
- package/dist/chunk-chunk-FEPXDKJP.module.min.js +1 -0
- package/dist/chunk-chunk-FJ76HWQZ.module.min.js +1 -0
- package/dist/chunk-chunk-FRGBMTZR.module.min.js +1 -0
- package/dist/chunk-chunk-G75OPF5N.module.min.js +2 -0
- package/dist/{chunk-chunk-NH4MEAKP.module.min.js → chunk-chunk-H5IFO6CU.module.min.js} +1 -1
- package/dist/chunk-chunk-HADHLMY5.module.min.js +1 -0
- package/dist/chunk-chunk-HBFA4NN6.module.min.js +1 -0
- package/dist/chunk-chunk-HCNDE26Q.module.min.js +2 -0
- package/dist/chunk-chunk-JJ4BSUYL.module.min.js +2 -0
- package/dist/chunk-chunk-JRHXQGEV.module.min.js +2 -0
- package/dist/chunk-chunk-L6FFYGYS.module.min.js +1 -0
- package/dist/{chunk-chunk-Z2AJERX5.module.min.js → chunk-chunk-LJDH3WV3.module.min.js} +1 -1
- package/dist/chunk-chunk-LSJUXBMF.module.min.js +1 -0
- package/dist/chunk-chunk-N3Q33XCB.module.min.js +2 -0
- package/dist/chunk-chunk-NWIGA3UK.module.min.js +1 -0
- package/dist/chunk-chunk-OG3TTJGJ.module.min.js +2 -0
- package/dist/{chunk-chunk-XEVJDUTH.module.min.js → chunk-chunk-OZK46A5U.module.min.js} +1 -1
- package/dist/chunk-chunk-PMR47KRY.module.min.js +2 -0
- package/dist/chunk-chunk-QQJNG23C.module.min.js +2 -0
- package/dist/{chunk-chunk-LG7YKJAK.module.min.js → chunk-chunk-RGJ6TKAH.module.min.js} +1 -1
- package/dist/{chunk-chunk-JWXLNZSM.module.min.js → chunk-chunk-SFLUSZ73.module.min.js} +1 -1
- package/dist/chunk-chunk-TCMHJWFJ.module.min.js +1 -0
- package/dist/{chunk-chunk-LVHDZAT3.module.min.js → chunk-chunk-UEZ6SHW5.module.min.js} +1 -1
- package/dist/chunk-chunk-VUWYT7DY.module.min.js +2 -0
- package/dist/{chunk-chunk-OI7R7EJB.module.min.js → chunk-chunk-W5HWGQMD.module.min.js} +1 -1
- package/dist/chunk-chunk-WFHZHWT7.module.min.js +1 -0
- package/dist/chunk-chunk-WGROBM3I.module.min.js +2 -0
- package/dist/{chunk-chunk-GU2EJIDJ.module.min.js → chunk-chunk-WSDJFBKX.module.min.js} +1 -1
- package/dist/chunk-statisticalOverlays-HMYYSGPE.module.min.js +2 -0
- package/dist/components/charts/index.d.ts +2 -2
- package/dist/components/charts/network/ProcessSankey.d.ts +105 -74
- package/dist/components/charts/network/processSankey/accessors.d.ts +7 -0
- package/dist/components/charts/network/processSankey/algorithm.d.ts +14 -193
- package/dist/components/charts/network/processSankey/axisChrome.d.ts +31 -0
- package/dist/components/charts/network/processSankey/bandPaths.d.ts +45 -0
- package/dist/components/charts/network/processSankey/buildScenes.d.ts +41 -3
- package/dist/components/charts/network/processSankey/fixtures.d.ts +17 -0
- package/dist/components/charts/network/processSankey/frameMargins.d.ts +11 -0
- package/dist/components/charts/network/processSankey/groupBonding.d.ts +13 -0
- package/dist/components/charts/network/processSankey/inventoryAtTime.d.ts +41 -0
- package/dist/components/charts/network/processSankey/labelPlacement.d.ts +34 -0
- package/dist/components/charts/network/processSankey/layoutGeometry.d.ts +47 -0
- package/dist/components/charts/network/processSankey/layoutOrchestrator.d.ts +44 -0
- package/dist/components/charts/network/processSankey/layoutQualityProduct.d.ts +27 -0
- package/dist/components/charts/network/processSankey/massSimulation.d.ts +16 -0
- package/dist/components/charts/network/processSankey/ordering.d.ts +55 -0
- package/dist/components/charts/network/processSankey/orderingBond.d.ts +33 -0
- package/dist/components/charts/network/processSankey/orientation.d.ts +5 -0
- package/dist/components/charts/network/processSankey/packing.d.ts +8 -0
- package/dist/components/charts/network/processSankey/packingCache.d.ts +23 -0
- package/dist/components/charts/network/processSankey/processSankeyLayoutAsync.d.ts +27 -0
- package/dist/components/charts/network/processSankey/processSankeyLayoutWorkerClient.d.ts +72 -0
- package/dist/components/charts/network/processSankey/processSankeyTooltip.d.ts +26 -0
- package/dist/components/charts/network/processSankey/processSankeyTypes.d.ts +163 -0
- package/dist/components/charts/network/processSankey/ribbonInputs.d.ts +26 -2
- package/dist/components/charts/network/processSankey/ribbonRunway.d.ts +45 -0
- package/dist/components/charts/network/processSankey/streamingLayout.d.ts +23 -0
- package/dist/components/charts/network/processSankey/time.d.ts +11 -0
- package/dist/components/charts/network/processSankey/useProcessSankeyPush.d.ts +29 -0
- package/dist/components/charts/network/processSankey/useProcessSankeyScenes.d.ts +26 -0
- package/dist/components/charts/network/processSankey/validation.d.ts +33 -0
- package/dist/components/charts/shared/chartFamilySets.d.ts +1 -0
- package/dist/components/charts/shared/formatUtils.d.ts +12 -1
- package/dist/components/charts/shared/hatchFill.d.ts +2 -0
- package/dist/components/charts/shared/hooks.d.ts +1 -1
- package/dist/components/charts/shared/leastSquaresRegression.d.ts +31 -0
- package/dist/components/charts/shared/styleRules.d.ts +5 -1
- package/dist/components/charts/shared/useChartLegend.d.ts +6 -0
- package/dist/components/charts/shared/useChartSetup.d.ts +1 -1
- package/dist/components/charts/shared/validateProps.d.ts +2 -2
- package/dist/components/charts/shared/withChartWrapper.d.ts +0 -6
- package/dist/components/data/numericFieldProfiler.d.ts +2 -0
- package/dist/components/recipes/layout1d.d.ts +68 -0
- package/dist/components/semiotic-network.d.ts +2 -2
- package/dist/components/semiotic-recipes-core.d.ts +2 -0
- package/dist/components/semiotic.d.ts +2 -0
- package/dist/components/server/staticSVGChrome.d.ts +2 -1
- package/dist/components/store/createStore.d.ts +2 -0
- package/dist/components/stream/OrdinalPipelineStore.d.ts +3 -0
- package/dist/components/stream/PipelineStore.d.ts +5 -0
- package/dist/components/stream/accessorUtils.d.ts +21 -0
- package/dist/components/stream/frameKeyboardNavigation.d.ts +3 -2
- package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +3 -8
- package/dist/components/stream/layouts/index.d.ts +1 -1
- package/dist/components/stream/moduleWorkerSession.d.ts +67 -0
- package/dist/components/stream/networkTypes.d.ts +2 -0
- package/dist/components/stream/ordinalSceneBuilders/sceneBuilderMap.d.ts +2 -1
- package/dist/components/stream/physics/PhysicsKernel.d.ts +9 -0
- package/dist/components/stream/pipelineIntroCancellation.d.ts +6 -0
- package/dist/components/stream/pipelineTransitions.d.ts +15 -1
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +16 -4
- package/dist/components/stream/renderers/symbolCanvasRenderer.d.ts +4 -0
- package/dist/components/stream/symbolPath.d.ts +8 -0
- package/dist/components/stream/types.d.ts +2 -0
- package/dist/components/stream/useCanvasFrameHost.d.ts +6 -0
- package/dist/components/stream/useSemanticFrameInteractions.d.ts +12 -3
- package/dist/components/stream/xyFrameAxisTypes.d.ts +4 -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.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -0
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.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-experimental.min.js +1 -1
- package/dist/semiotic-experimental.module.min.js +1 -1
- package/dist/semiotic-network.d.ts +2 -2
- package/dist/semiotic-realtime-core.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core.d.ts +2 -0
- package/dist/semiotic-recipes-core.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +1 -1
- package/dist/semiotic-recipes.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.module.min.js +1 -1
- package/dist/semiotic-themes-react.module.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils-react.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-value.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic.d.ts +2 -0
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +4 -3
- package/dist/chunk-chunk-2YAZHXL4.module.min.js +0 -2
- package/dist/chunk-chunk-3NGIKFD6.module.min.js +0 -1
- package/dist/chunk-chunk-7TTBHSAG.module.min.js +0 -2
- package/dist/chunk-chunk-7ZDJSYKI.module.min.js +0 -2
- package/dist/chunk-chunk-BGHPD3RA.module.min.js +0 -1
- package/dist/chunk-chunk-BMRZ2SPU.module.min.js +0 -2
- package/dist/chunk-chunk-C7APLVQD.module.min.js +0 -2
- package/dist/chunk-chunk-DGWFBOGB.module.min.js +0 -1
- package/dist/chunk-chunk-DIVE2DRA.module.min.js +0 -2
- package/dist/chunk-chunk-DSNGDNJY.module.min.js +0 -1
- package/dist/chunk-chunk-FBUNUIPV.module.min.js +0 -2
- package/dist/chunk-chunk-G7QVPZUD.module.min.js +0 -2
- package/dist/chunk-chunk-GBPYV4FP.module.min.js +0 -2
- package/dist/chunk-chunk-KXAFCCDB.module.min.js +0 -2
- package/dist/chunk-chunk-LWITSR2O.module.min.js +0 -2
- package/dist/chunk-chunk-MX35T6RX.module.min.js +0 -2
- package/dist/chunk-chunk-NJETWX42.module.min.js +0 -2
- package/dist/chunk-chunk-NW25WGLS.module.min.js +0 -2
- package/dist/chunk-chunk-ONMLEXHR.module.min.js +0 -2
- package/dist/chunk-chunk-OY66GCE6.module.min.js +0 -1
- package/dist/chunk-chunk-PRDGLMJT.module.min.js +0 -2
- package/dist/chunk-chunk-PZFT457G.module.min.js +0 -1
- package/dist/chunk-chunk-Q3WW6JGR.module.min.js +0 -1
- package/dist/chunk-chunk-Q6XKQTOQ.module.min.js +0 -1
- package/dist/chunk-chunk-RJRM2E6P.module.min.js +0 -1
- package/dist/chunk-chunk-RPL7WYXI.module.min.js +0 -1
- package/dist/chunk-chunk-V3OAKG32.module.min.js +0 -1
- package/dist/chunk-chunk-WCX6U47H.module.min.js +0 -2
- package/dist/chunk-chunk-WLOIUMWG.module.min.js +0 -2
- package/dist/chunk-chunk-XEGXX4F7.module.min.js +0 -1
- package/dist/chunk-chunk-XFRBLXYM.module.min.js +0 -1
- package/dist/chunk-chunk-ZXYDYAB7.module.min.js +0 -2
- package/dist/chunk-statisticalOverlays-6MVAK5RW.module.min.js +0 -2
- package/dist/components/stream/renderers/networkSymbolRenderer.d.ts +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{lineCanvasRenderer as t,resolveNodeColor as e}from"./chunk-chunk-AF53TBSN.module.min.js";import{coerceDateLikeValue as i,parseDateLikeString as o}from"./chunk-chunk-6V5VQVCT.module.min.js";import{DataSourceAdapter as s,IncrementalExtent as n,barCanvasRenderer as r,buildAreaNode as a,buildEnrichAnnotationData as l,buildHeatcellNode as c,buildLineNode as h,buildPointNode as u,buildRectNode as g,buildStackedAreaNodes as d,buildSymbolNode as f,computeDivergingStackExtent as p,computeStackOffsets as y,normalizeColorGradient as m,normalizeGradient as x,resolveAnnotationAccessor as v,resolveFrameGraphics as b,snapXYIntroTargets as k,ticksForMode as w,toIdSet as A}from"./chunk-chunk-57RBPDBQ.module.min.js";import{RingBuffer as C,applyPulse as _,buildAggregateRibbons as S,buildPerSeriesRibbons as M,compactTimestampBufferForRemoval as P,createTimestampBufferForData as Y,enrichDatumWithBand as R,ensureRingBufferCapacity as T,hasActivePulses as N,partitionRibbons as W,pointCanvasRenderer as O,pushWithTimestamp as D,refreshIdlePulse as z,useLegendCategoryEmission as L,useSemanticFrameInteractions as B,useXYKeyboardNavigation as E}from"./chunk-chunk-QQJNG23C.module.min.js";import{needsInteractionCanvasPaint as F,paintCanvasBackground as I,resolveCanvasBackground as X}from"./chunk-chunk-W5HWGQMD.module.min.js";import{symbolCanvasRenderer as $}from"./chunk-chunk-CD6PVVS3.module.min.js";import{StalenessBadge as V,applyDecay as G,attachUpdateResultStore as H,buildDatumIndexMap as j,composeOverlays as q,computeDecayOpacity as U,createCustomLayoutFailureDiagnostic as K,findHitPointInQuadtree as Q,getHitRadius as J,glyphCanvasRenderer as Z,hitTestRect as tt,isTimeLandmark as et,paintSceneWithBackend as it,renderPathPulse as ot,renderRectPulse as st,renderSceneWithBackend as nt,resolveStaleness as rt,useConfigSync as at,useLayoutSelectionSync as lt,useStableShallow as ct,useStalenessCheck as ht,warnCustomLayoutDiagnostics as ut}from"./chunk-chunk-H5IFO6CU.module.min.js";import{wrapWithCustomLayoutSelection as gt}from"./chunk-chunk-5UKL5W76.module.min.js";import{accessorsEquivalent as dt,resolveAccessor as ft,resolveRawAccessor as pt,resolveStringAccessor as yt}from"./chunk-chunk-NWIGA3UK.module.min.js";import{filterAnnotationsByStatus as mt}from"./chunk-chunk-FC3NZWYR.module.min.js";import{AccessibleDataTable as xt,AriaLiveTooltip as vt,CanvasFrameBackground as bt,FlippingTooltip as kt,FocusRing as wt,SEQUENTIAL_INTERPOLATORS as At,STREAMING_PALETTE as Ct,SceneRevisionDiagnosticsObserver as _t,ScreenReaderSummary as St,SkipToTableLink as Mt,TITLE_BASELINE as Pt,UpdateResultTracker as Yt,annotationLayout as Rt,buildHoverData as Tt,buildLinearFillGradient as Nt,buildThresholdLineSegments as Wt,computeCanvasAriaLabel as Ot,computeEasing as Dt,computeRawProgress as zt,createDefaultAnnotationRules as Lt,defaultTooltipStyle as Bt,filterSparseArray as Et,getCSSColorCacheVersion as Ft,getDevicePixelRatio as It,getPointerHitRadius as Xt,getSequentialInterpolator as $t,isAnnotationActivationTarget as Vt,isServerEnvironment as Gt,lerp as Ht,makeSymbolResolver as jt,now as qt,observationInputType as Ut,prepareCanvas as Kt,renderAnnotationPass as Qt,renderLegendFromConfig as Jt,resolveCSSColor as Zt,resolveCanvasFill as te,resolveCurveFactory as ee,resolveLegendSideGutter as ie,smartTooltipEntries as oe,symbolRadius as se,unlockCrosshair as ne,useAnnotationActivationOptions as re,useCrosshairPosition as ae,useFrame as le,useFrameCanvasHost as ce,useSceneRevisionDiagnostics as he,xySceneNodeToSVG as ue}from"./chunk-chunk-HCNDE26Q.module.min.js";import{getMax as ge}from"./chunk-chunk-2NVFEB7P.module.min.js";import{resolveThemeSemanticColors as de}from"./chunk-chunk-PMR47KRY.module.min.js";import{glyphHitGeometry as fe}from"./chunk-chunk-KTWEBFMX.module.min.js";import{useHydration as pe,useWasHydratingFromSSR as ye}from"./chunk-chunk-ACLDBMRH.module.min.js";import*as me from"react";import{useRef as xe,useState as ve,useEffect as be,useMemo as ke,useCallback as we,useImperativeHandle as Ae,useId as Ce,forwardRef as _e,memo as Se}from"react";import*as Me from"react";import{jsx as Pe}from"react/jsx-runtime";var Ye=null,Re=null;function Te(t){const[e,i]=Me.useState(()=>Ye);return Me.useEffect(()=>{if(e)return;let t=!1;return(Ye?Promise.resolve(Ye):(Re||(Re=import("./chunk-XYBrushOverlay-EP2SV3UI.module.min.js").then(t=>Ye=t.XYBrushOverlay).catch(t=>{throw Re=null,t})),Re)).then(e=>{t||i(()=>e)}),()=>{t=!0}},[e]),e?Pe(e,{...t}):null}function Ne(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 We(t){return t?null!=t.opacity?t.opacity:null!=t.fillOpacity?t.fillOpacity:1:1}function Oe(t,e,i,o){if(!t.config.pointStyle)return;const s=o??t.getY;for(const o of e){const e=t.resolveGroupColor(o.key);for(const n of o.data){let o=t.config.pointStyle(n);!o.fill&&e&&(o={...o,fill:e});const r=o.r??3,a=t.getPointId?t.getPointId(n)+"":void 0,l=u(n,t.scales,t.getX,s,r,o,a);l&&i.push(l)}}}function De(t){return"threshold"===t.type&&"string"==typeof t.color&&"number"==typeof t.value}function ze(t){return x(t)}var Le=new Map;function Be(t,e,i){const o=i.config.areaStyle?.(e);return o&&(t.style=o),t}function Ee(t,e,i,o,s){const n=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=n.get(l);if(c||(c={start:l,end:l+o,total:0,categories:new Map},n.set(l,c)),c.total+=a,s){const t=s(r);c.categories.set(t,(c.categories.get(t)||0)+a)}}return n}function Fe(t,e){const i="function"==typeof t?t:i=>i[t||e];return t=>{const e=i(t);return null==e?NaN:+e}}function Ie(t){const e=[],i=["bar","swarm","waterfall"].includes(t.chartType)||"streaming"===t.runtimeMode,o=Fe(i&&t.valueAccessor||t.yAccessor,i?"value":"y");if(t.boundsAccessor){const i=ft(t.boundsAccessor,"bounds");e.push({kind:"bounds",getTop:t=>{const e=o(t);if(!Number.isFinite(e))return NaN;const s=i(t);return Number.isFinite(s)&&0!==s?e+s:e},getBottom:t=>{const e=o(t);if(!Number.isFinite(e))return NaN;const s=i(t);return Number.isFinite(s)&&0!==s?e-s: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:Fe(t.y1Accessor,"y1"),getBottom:Fe(t.y0Accessor,"y0"),style:t.style,perSeries:!1!==t.perSeries,interactive:!0===t.interactive})}return e}import{scaleLinear as Xe,scaleLog as $e,scaleSymlog as Ve,scaleTime as Ge}from"d3-scale";function He(t,e){return e?[e[0]??t[0],e[1]??t[1]]:t}function je(t,e,i){if("log"===t){const t=[Math.max(e[0],1e-6),Math.max(e[1],1e-6)];return $e().domain(t).range(i).clamp(!0)}return"symlog"===t?Ve().domain(e).range(i):"time"===t?Ge().domain([new Date(e[0]),new Date(e[1])]).range(i):Xe().domain(e).range(i)}var qe=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ue=["scene-style","data-paint","accessibility","evidence"],Ke=(t,e)=>({retainedData:t,invalidations:e}),Qe=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Je=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ze=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],ti=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],ei=["scene-geometry","data-paint","accessibility","evidence"],ii=["scene-style","data-paint","accessibility","evidence"],oi=[],si={chartType:Ke("rebuild",Qe),runtimeMode:Ke("rebuild",Qe),xAccessor:Ke("rebuild",Qe),yAccessor:Ke("rebuild",Qe),timeAccessor:Ke("rebuild",Qe),valueAccessor:Ke("rebuild",Qe),y0Accessor:Ke("rebuild",Qe),boundsAccessor:Ke("rebuild",Qe),band:Ke("rebuild",Qe),openAccessor:Ke("rebuild",Qe),highAccessor:Ke("rebuild",Qe),lowAccessor:Ke("rebuild",Qe),closeAccessor:Ke("rebuild",Qe),candlestickRangeMode:Ke("rebuild",Qe),accessorRevision:Ke("rebuild",Qe),groupAccessor:Ke("rebuild",Je),categoryAccessor:Ke("rebuild",Je),lineDataAccessor:Ke("rebuild",Je),colorAccessor:Ke("rebuild",ii),sizeAccessor:Ke("rebuild",ei),symbolAccessor:Ke("rebuild",ei),pointIdAccessor:Ke("rebuild",ei),xScaleType:Ke("preserve",Ze),yScaleType:Ke("preserve",Ze),xExtent:Ke("preserve",Ze),yExtent:Ke("preserve",Ze),extentPadding:Ke("preserve",Ze),scalePadding:Ke("preserve",Ze),axisExtent:Ke("preserve",Ze),binSize:Ke("preserve",Ze),normalize:Ke("preserve",Ze),heatmapAggregation:Ke("preserve",Ze),heatmapXBins:Ke("preserve",Ze),heatmapYBins:Ke("preserve",Ze),arrowOfTime:Ke("preserve",ti),baseline:Ke("preserve",ti),stackOrder:Ke("preserve",ti),sizeRange:Ke("preserve",ti),curve:Ke("preserve",ti),areaGroups:Ke("preserve",ti),customLayout:Ke("preserve",ti),layoutConfig:Ke("preserve",ti),layoutMargin:Ke("preserve",ti),symbolMap:Ke("preserve",ei),showValues:Ke("preserve",ei),heatmapValueFormat:Ke("preserve",ei),lineStyle:Ke("preserve",ii),pointStyle:Ke("preserve",ii),areaStyle:Ke("preserve",ii),barStyle:Ke("preserve",ii),swarmStyle:Ke("preserve",ii),waterfallStyle:Ke("preserve",ii),candlestickStyle:Ke("preserve",ii),boundsStyle:Ke("preserve",ii),gradientFill:Ke("preserve",ii),lineGradient:Ke("preserve",ii),semanticLineStops:Ke("preserve",ii),colorScheme:Ke("preserve",ii),themeCategorical:Ke("preserve",ii),themeSemantic:Ke("preserve",ii),themeSequential:Ke("preserve",ii),themeDiverging:Ke("preserve",ii),barColors:Ke("preserve",ii),decay:Ke("preserve",ii),pulse:Ke("preserve",ii),staleness:Ke("preserve",ii),layoutSelection:Ke("preserve",ii),annotations:Ke("preserve",["overlay","accessibility","evidence"]),windowSize:Ke("preserve",oi),windowMode:Ke("preserve",oi),maxCapacity:Ke("preserve",oi),clock:Ke("preserve",oi),transition:Ke("preserve",oi),introAnimation:Ke("preserve",oi),onLayoutError:Ke("preserve",oi)},ni=Ke("preserve",ti),ri=class{constructor(){this.tracker=new Yt}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}},qe)}recordNoop(t){return this.tracker.record({kind:t,..."restyle"===t?{}:{count:0}},[])}recordRestyle(t){return t?this.tracker.record({kind:"restyle"},Ue):this.recordNoop("restyle")}recordConfig(t){const e=function(t){let e="preserve";const i=new Set;for(const o of t){const t=si[o]??ni;"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 ai}from"d3-quadtree";var li=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&&(i++,t.r>o&&(o=t.r));if(this.maxRadius=o,500>=i)return void(this.tree=null);const s=Array(i);let n=0;for(const t of e)"point"===t.type&&(s[n++]=t);this.tree=ai().x(t=>t.x).y(t=>t.y).addAll(s)}},ci=class t{constructor(t){if(this.xExtent=new n,this.yExtent=new n,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 ri,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 li,this._lastBoundedInsertsRef=null,this.applyPulse=(t,e,i)=>!(!this.config.pulse||!this.timestampBuffer)&&_(this.config.pulse,t,e,this.timestampBuffer,this.getDatumIndexMap(e),i),this.config=t,this.buffer=new C(t.windowSize),this.growingCap=t.windowSize,["bar","swarm","waterfall"].includes(t.chartType)||"streaming"===t.runtimeMode?(this.getX=ft(t.timeAccessor||t.xAccessor,"time"),this.getY=ft(t.valueAccessor||t.yAccessor,"value")):(this.getX=ft(t.xAccessor,"x"),this.getY=ft(t.yAccessor,"y")),this.getGroup=yt(t.groupAccessor),this.getCategory=yt(t.categoryAccessor),this.getSize=t.sizeAccessor?ft(t.sizeAccessor,"size"):void 0,this.getColor=yt(t.colorAccessor),this.getSymbol=yt(t.symbolAccessor),this.getY0=t.y0Accessor?ft(t.y0Accessor,"y0"):void 0,this.resolvedRibbons=Ie(t),this.getPointId=yt(t.pointIdAccessor),"candlestick"===t.chartType){const e=null!=t.openAccessor,i=null!=t.closeAccessor;this.getOpen=e?ft(t.openAccessor,"open"):void 0,this.getHigh=ft(t.highAccessor,"high"),this.getLow=ft(t.lowAccessor,"low"),this.getClose=i?ft(t.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!e&&!i}t.pulse&&(this.timestampBuffer=new C(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=Y(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(t){if(t.bounded&&this._lastBoundedInsertsRef===t.inserts)return this.updateResults.recordNoop("replace"),!1;const e=this.currentTime();if(this.lastIngestTime=e,this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,t.bounded){this._lastBoundedInsertsRef=t.inserts,this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this.timestampBuffer&&this.timestampBuffer.clear();const s=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode;if(this.getX=s?ft(this.config.timeAccessor||this.config.xAccessor,"time"):ft(this.config.xAccessor,"x"),this.xIsDate=!1,t.inserts.length>0){const e=t.inserts[0],s=this.config.xAccessor,n="function"==typeof s?s(e):e[s||"x"],r=n instanceof Date,a="string"==typeof n&&Number.isFinite(o(n));if(this.xIsDate=r||a,a){const t="string"==typeof s?s:void 0;this.getX=t?e=>i(e[t]):t=>i(s(t))}}T(this.buffer,t.totalSize||t.inserts.length,this.timestampBuffer);for(const i of t.inserts)D(this.buffer,i,this.timestampBuffer,e),this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i)}else for(const i of t.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 t=D(this.buffer,i,this.timestampBuffer,e);this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i),null!=t&&(this.xExtent.evict(this.getX(t)),this.evictDatumYExtent(t))}return this.updateResults.recordData(t.bounded?"replace":"ingest",t.inserts.length),!0}ingestWithResult(t){return this.ingest(t),this.updateResults.last}computeScene(t){const{config:e,buffer:i}=this,o=this.scales,s=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 n=this.getBufferArray(),r=this.yExtent.extent;let a=He(this.xExtent.extent,e.xExtent),l=He(r,e.yExtent);const c=!(!(h=e.yExtent)||null==h[0]||null==h[1]);var h;const u="exact"===e.axisExtent;if("stackedarea"===e.chartType&&!c&&i.size>0){const t=function(t){const{config:e,groups:i,getX:o,getY:s}=t,n="exact"===e.axisExtent;if(e.normalize){const i=[0,n?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 n of t.data){const t=o(n),r=s(n);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",d=(t,e)=>e>t?-1:t>e?1:0;let f,m;if("input"===g)f=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:d(t,e)}),e=[],o=[];let s=0,n=0;for(const i of t)n>s?(e.push(i),s+=u.get(i)??0):(o.push(i),n+=u.get(i)??0);f=[...o.reverse(),...e]}else f="asc"===g?i.map(t=>t.key).sort((t,e)=>{const i=(u.get(t)??0)-(u.get(e)??0);return 0!==i?i:d(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:d(t,e)}):i.map(t=>t.key).sort(d);if("wiggle"===e.baseline||"silhouette"===e.baseline){const t=Array.from(l).sort((t,e)=>t-e),i=y(t,f,(t,e)=>a.get(t)?.get(e)||0,e.baseline);let o=1/0,s=-1/0;for(const e of t){const t=i.get(e)??0,n=h.get(e)??0;o>t&&(o=t),t+n>s&&(s=t+n)}Number.isFinite(o)&&Number.isFinite(s)||(o=0,s=0);const r=s-o,c=n?0:r>0?r*e.extentPadding:1;m=[o-c,s+c]}else if("diverging"===e.baseline){const t=Array.from(l).sort((t,e)=>t-e),[i,o]=p(t,f,(t,e)=>a.get(t)?.get(e)||0),s=o-i,r=n?0:s>0?s*e.extentPadding:1;m=[i-r,o+r]}else m=[0,c+(n?0:c>0?c*e.extentPadding:1)];return{yDomain:m,stackExtentCache:{key:r,yDomain:m}}}({config:e,groups:this.groupData(n),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,s,n,r){const[,a]=function(t,e,i,o,s){const n=Ee(t,e,i,o,s);if(0===n.size)return[0,0];let r=0;for(const t of n.values())t.total>r&&(r=t.total);return[0,r]}(t,e,i,o,s);return[0,r?a:a+a*n]}(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[s,n]=function(t,e){let i=0,o=0,s=0;for(const n of t){const t=e(n);null==t||Number.isNaN(t)||(s+=t,i>s&&(i=s),s>o&&(o=s))}return[i,o]}(t,e),r=n-s,a=o?0:r>0?r*i:1;return[Math.min(0,s-Math.abs(a)),Math.max(0,n+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,s]=t;for(const t of e)for(const e of i){const i=e.getTop(t),n=e.getBottom(t);Number.isFinite(i)&&(o>i&&(o=i),i>s&&(s=i)),Number.isFinite(n)&&(o>n&&(o=n),n>s&&(s=n))}return[o,s]}(l,n,this.resolvedRibbons),l=function(t,e){const i=t[1]-t[0],o=e.exactMode?0:i>0?i*e.extentPadding:1,s=[null!=e.userMin?t[0]:t[0]-o,null!=e.userMax?t[1]:t[1]+o];return"log"!==e.yScaleType||s[0]>0||0>=e.dataYDomain[0]||e.exactMode||null==e.userMin&&(s[0]=e.dataYDomain[0]/(1+e.extentPadding)),s}(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],s=e[1];return null==o&&null==s?t:[null!=o?o:t[0],null!=s?s:t[1]]}(l,e.yExtent,!!c),({xDomain:a,yDomain:l}=function(t,e,i){let o=t,s=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 s[0]!==1/0&&s[1]!==-1/0||(s=[0,1]),{xDomain:o,yDomain:s}}(a,l,e.xScaleType)),this.scales=function(t){const{config:e,layout:i,xDomain:o,yDomain:s}=t,n="streaming"===e.runtimeMode,r=Math.max(0,Math.min(e.scalePadding||0,Math.min(i.width,i.height)/2-1));if(n){if("x"==("up"===(a=e.arrowOfTime)||"down"===a?"y":"x")){const t="right"===e.arrowOfTime?[r,i.width-r]:[i.width-r,r];return{x:Xe().domain(o).range(t),y:je(e.yScaleType,s,[i.height-r,r])}}const t="down"===e.arrowOfTime?[r,i.height-r]:[i.height-r,r];return{x:je(e.yScaleType,s,[r,i.width-r]),y:Xe().domain(o).range(t)}}var a;return{x:je(e.xScaleType,o,[r,i.width-r]),y:je(e.yScaleType,s,[i.height-r,r])}}({config:e,layout:t,xDomain:a,yDomain:l}),this._customLayoutFailedThisBuild=!1;const g=this.buildSceneNodes(t,n);if(this._customLayoutFailedThisBuild)return!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=o,this.lastLayout=s):(this.scene=[],this.spatialIndex.rebuild(this.config.chartType,this.scene)),void(this.needsFullRebuild=!0);this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=g,this.config.decay&&this.applyDecay(this.scene,n),this.config.pulse&&this.applyPulse(this.scene,n,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(),s=this.scales.y.domain(),n=this.scales.x.range(),r=this.scales.y.range(),a=je,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,n[0]>n[1]?[t.width-l,l]:[l,t.width-l]),y:a(this.config.yScaleType,s,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 s={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??Ct},resolveColor:(t,e)=>{const o=this.resolveGroupColor(t);if(o)return o;const s=this.resolveLineStyle(t,e);return s.stroke?s.stroke:"string"==typeof s.fill?s.fill:i.themeSemantic?.primary??"#4e79a7"},config:i.layoutConfig??{},selection:i.layoutSelection??null};let n;try{n=i.customLayout(s)}catch(t){const e=null!==this.lastCustomLayoutResult,o=K("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=n.overlays??null,this.lastCustomLayoutResult=n,this.lastCustomLayoutFailure=null;const r=n.nodes??[];if(this._customRestyle=n.restyle,this.hasCustomRestyle=!!n.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 ut({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 s={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=[],s=t.config.annotations?.filter(De).map(t=>({value:t.value,color:t.color,thresholdType:t.thresholdType||"greater"}));if(t.ribbons&&t.ribbons.length>0){const{perSeries:s,aggregate:n}=W(t.ribbons);if(n.length>0&&o.push(...S(t,e,n)),s.length>0)for(const e of i)o.push(...M(t,e.data,e.key,s))}for(const e of i){const i=t.resolveLineStyle(e.key,e.data[0]),n=h(e.data,t.scales,t.getX,t.getY,i,e.key);s&&s.length>0&&(n.colorThresholds=s),t.config.curve&&"linear"!==t.config.curve&&(n.curve=t.config.curve),t.config.lineGradient&&(n.strokeGradient=t.config.lineGradient),o.push(n)}return Oe(t,i,o),o}(s,e);case"area":return function(t,e){const i=t.groupData(e),o=[];if(t.ribbons&&t.ribbons.length>0){const{perSeries:s,aggregate:n}=W(t.ribbons);if(n.length>0&&o.push(...S(t,e,n)),s.length>0)for(const e of i)o.push(...M(t,e.data,e.key,s))}const s=t.scales.y.domain(),n=s[0],r=t.config.semanticLineStops?.filter(t=>Number.isFinite(t.offset)).map(t=>({value:s[0]+Math.max(0,Math.min(1,t.offset))*(s[1]-s[0]),color:t.color,thresholdType:"greater"})).sort((t,e)=>t.value-e.value),l=r&&r.length>0?(()=>{const e=r.reduce((t,e)=>(t.at(-1)?.value===e.value?t[t.length-1]=e:t.push(e),t),[]),i=[{from:s[0],to:e[0].value}];for(let t=0;e.length>t;t++)i.push({from:e[t].value,to:e[t+1]?.value??s[1],color:e[t].color});return i.map(({from:e,to:i,color:o})=>{const s=t.scales.y(e),n=t.scales.y(i);return{y:Math.min(s,n),height:Math.abs(n-s),color:o}}).filter(t=>t.height>0)})():void 0,c=t.getY0?e=>{const i=t.getY0(e);return null==i?n:i}:void 0;for(const e of i){const i=t.resolveAreaStyle(e.key,e.data[0]),s=a(e.data,t.scales,t.getX,t.getY,n,i,e.key,c),h=ze(t.config.gradientFill);h&&(s.fillGradient=h),t.config.curve&&"linear"!==t.config.curve&&(s.curve=t.config.curve),t.config.lineGradient&&(s.strokeGradient=t.config.lineGradient),r&&r.length>0&&(s.colorThresholds=r,s.strokeColorBands=l),o.push(s)}return Oe(t,i,o),o}(s,e);case"mixed":return function(t,e){const i=t.groupData(e),o=[],s=t.config.areaGroups||new Set;if(t.ribbons&&t.ribbons.length>0){const{perSeries:s,aggregate:n}=W(t.ribbons);if(n.length>0&&o.push(...S(t,e,n)),s.length>0)for(const e of i)o.push(...M(t,e.data,e.key,s))}const n=t.scales.y.domain()[0],r=t.getY0?e=>{const i=t.getY0(e);return null==i?n:i}:void 0;for(const e of i)if(s.has(e.key)){const i=t.resolveAreaStyle(e.key,e.data[0]),s=a(e.data,t.scales,t.getX,t.getY,n,i,e.key,r),l=ze(t.config.gradientFill);l&&(s.fillGradient=l),t.config.curve&&"linear"!==t.config.curve&&(s.curve=t.config.curve),t.config.lineGradient&&(s.strokeGradient=t.config.lineGradient),o.push(s)}else{const i=t.resolveLineStyle(e.key,e.data[0]),s=h(e.data,t.scales,t.getX,t.getY,i,e.key);t.config.curve&&"linear"!==t.config.curve&&(s.curve=t.config.curve),t.config.lineGradient&&(s.strokeGradient=t.config.lineGradient),o.push(s)}return Oe(t,i,o),o}(s,e);case"stackedarea":return function(t,e){const i=t.groupData(e),o=t.config.stackOrder??"key",s=()=>i.sort((t,e)=>e.key>t.key?-1:t.key>e.key?1:0);if("input"===o);else if("key"===o)s();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),s=t.getY(e);Number.isFinite(o)&&Number.isFinite(s)&&(i+=s)}e.set(o.key,i)}const s=(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:s(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:s(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:s(t.key,i.key)}),o=[],n=[];let r=0,a=0;for(const i of t)a>r?(o.push(i),r+=e.get(i.key)??0):(n.push(i),a+=e.get(i.key)??0);i.length=0,i.push(...n.reverse(),...o)}}else s();const n=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}=d(i,t.scales,t.getX,t.getY,(e,i)=>t.resolveAreaStyle(e,i),t.config.normalize,n,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 s of o.data){const o=t.getX(s),n=t.getY(s);null==o||Number.isNaN(o)||null==n||Number.isNaN(n)||!i.has(o)||e.set(s,i.get(o))}}const o=i=>e.get(i)??t.getY(i);Oe(t,i,c,o)}return c}(s,e);case"scatter":case"bubble":return function(t,e){const i=[],o="bubble"===t.config.chartType?10:5,s=t.config.sizeRange||[3,15];let n=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);n=i=>t===e?(s[0]+s[1])/2:s[0]+(i-t)/(e-t)*(s[1]-s[0])}}const r=t.getColor?t.resolveColorMap(e):null,a=t.config.themeSemantic?.primary||"#4e79a7",l=t.getSymbol,c=l?jt(l,t.config.symbolMap):null;for(const s of e){let e=t.config.pointStyle?t.config.pointStyle(s):{fill:a,opacity:.8},l=e.r||o;if(n&&t.getSize){const e=t.getSize(s);null==e||Number.isNaN(e)||(l=n(e))}if(r&&t.getColor&&!e.fill){const i=t.getColor(s);i&&r.has(i)&&(e={...e,fill:r.get(i)})}const h=t.getPointId?t.getPointId(s)+"":void 0;if(c){const o=c(s),n=f(s,t.scales,t.getX,t.getY,Math.PI*l*l,o,e,h);n&&i.push(n)}else{const o=u(s,t.scales,t.getX,t.getY,l,e,h);o&&i.push(o)}}return i}(s,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)),s=Math.max(1,Math.floor(t.config.heatmapYBins??20)),n=t.config.heatmapAggregation??"count",r=ft(t.config.valueAccessor,"value");if(!t.scales||0===e.length)return[];const[a,l]=t.scales.x.domain(),[h,u]=t.scales.y.domain(),g=(l-a||1)/o,d=(u-h||1)/s,f=o*s;if(f>1e6)return[];const p=new Int32Array(f),y=new Float64Array(f);for(let i=0;e.length>i;i++){const n=e[i],l=t.getX(n),c=t.getY(n);if(!isFinite(l)||!isFinite(c))continue;const u=Math.min(Math.floor((l-a)/g),o-1),f=Math.min(Math.floor((c-h)/d),s-1);if(0>u||0>f)continue;const m=f*o+u;p[m]++;const x=r(n);y[m]+=isFinite(x)?x:0}let m=1/0,x=-1/0;for(let t=0;f>t;t++){if(0===p[t])continue;let e;switch(n){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=i.width/o,k=i.height/s,w=t.config.showValues,A=t.config.heatmapValueFormat,C=[];for(let e=0;s>e;e++){const i=e*o;for(let r=0;o>r;r++){const o=i+r;if(0===p[o])continue;let l;switch(n){case"sum":l=y[o];break;case"mean":l=y[o]/p[o];break;default:l=p[o]}const u=(l-m)/v,f={xi:r,yi:e,value:l,count:p[o],sum:y[o],xCenter:a+(r+.5)*g,yCenter:h+(e+.5)*d,agg:n};C.push(Be(c(r*b,(s-1-e)*k,b,k,`rgb(${220-(180*u+.5)|0},${220-(100*u+.5)|0},${255-(50*u+.5)|0})`,f,w?{value:l,showValues:!0,valueFormat:A}:void 0),f,t))}}return C}(t,e,i);if(0===e.length)return[];const o=ft(t.config.valueAccessor,"value"),s=pt(t.config.xAccessor,"x"),n=pt(t.config.yAccessor,"y"),r=new Map,a=new Map,l=Array(e.length),h=Array(e.length);for(let t=0;e.length>t;t++){const i=e[t],o=s(i),c=n(i);l[t]=o,h[t]=c,r.has(o)||r.set(o,r.size),a.has(c)||a.set(c,a.size)}const u=r.size,g=a.size;if(0===u||0===g)return[];const d=Array.from(r.keys()),f=Array.from(a.keys()),p=d.every(t=>"number"==typeof t&&!isNaN(t)),y=f.every(t=>"number"==typeof t&&!isNaN(t));if(p){d.sort((t,e)=>Number(t)-Number(e)),r.clear();for(let t=0;d.length>t;t++)r.set(d[t],t)}if(y){f.sort((t,e)=>Number(t)-Number(e)),a.clear();for(let t=0;f.length>t;t++)a.set(f[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],s=r.get(l[t]),n=a.get(h[t]);if(void 0===s||void 0===n)continue;const c=o(i),g=n*u+s,d=b.get(g);let f;void 0!==d?f=d:(f=k++,b.set(g,f)),m[f]=g,x[f]=c,v[f]=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 C=function(t){const e=t in At?t:"blues";let i=Le.get(e);if(i)return i;i=Array(256);const o=$t(e);for(let t=0;256>t;t++)i[t]=o(t/255);return Le.set(e,i),i}("string"==typeof t.config.colorScheme?t.config.colorScheme:t.config.themeSequential||"blues"),_=255/(A-w||1),S=i.width/u,M=i.height/g,P=t.config.showValues,Y=t.config.heatmapValueFormat,R=[];for(let e=0;k>e;e++){const i=x[e];if(!isFinite(i))continue;const o=m[e],s=o%u,n=v[e];R.push(Be(c(s*S,(g-1-(o-s)/u)*M,S,M,C[Math.min((i-w)*_+.5|0,255)],n,P?{value:i,showValues:!0,valueFormat:Y}:void 0),n,t))}return R}(s,e,t);case"bar":{const t=function(t,e){if(!t.config.binSize)return{nodes:[],binBoundaries:[]};const i=Ee(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 s=t.config.barColors?Object.keys(t.config.barColors):[],n=new Set(s),r=Array.from(e).filter(t=>!n.has(t)).sort(),a=s.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 s=[],n=t.scales,[r,a]=n.x.domain(),l=t.config.barStyle,c=t.config.themeSemantic?.primary,h=l?.gap,u="number"!=typeof h||0>h?1:h,d={};l?.stroke&&(d.stroke=l.stroke),"number"==typeof l?.strokeWidth&&(d.strokeWidth=l.strokeWidth),"number"==typeof l?.opacity&&(d.opacity=l.opacity);for(const e of i.values()){const i=Math.max(e.start,r),h=Math.min(e.end,a);if(i>=h)continue;const f=n.x(i),p=n.x(h),y=Math.abs(p-f),m=y>u+1?u:0,x=Math.min(f,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=n.y(i),h=n.y(i+o);s.push(g(x,Math.min(a,h),v,Math.abs(a-h),{fill:t.config.barColors?.[r]||l?.fill||c||"#4e79a7",...d},{binStart:e.start,binEnd:e.end,total:e.total,category:r,categoryValue:o},r)),i+=o}}else{const t=n.y(0),i=n.y(e.total);s.push(g(x,Math.min(t,i),v,Math.abs(t-i),{fill:l?.fill||c||"#007bff",...d},{binStart:e.start,binEnd:e.end,total:e.total}))}}const f=new Set;for(const t of i.values())f.add(t.start),f.add(t.end);return{nodes:s,binBoundaries:Array.from(f).sort((t,e)=>t-e)}}(s,e);return this._barCategoryCache=s.barCategoryCache??null,this._binBoundaries=t.binBoundaries,t.nodes}case"swarm":return function(t,e){const i=[],o=t.config.swarmStyle||{},s=o.radius??3,n=o.fill??t.config.themeSemantic?.primary??"#007bff",r=o.opacity??.7,a=o.stroke,l=o.strokeWidth;for(const o of e){const e=t.getX(o),c=t.getY(o);if(null==c||Number.isNaN(c))continue;const h=t.scales.x(e),u=t.scales.y(c);let g=n;if(t.getCategory){const e=t.getCategory(o);g=t.config.barColors?.[e]||g}const{r:d,...f}=t.config.pointStyle?.(o)??{},p={type:"point",x:h,y:u,r:d??s,style:{fill:g,opacity:r,stroke:a,strokeWidth:l,...f},datum:o};t.getPointId&&(p.pointId=t.getPointId(o)+""),i.push(p)}return i}(s,e);case"waterfall":return function(t,e,i){const o=[],s=t.scales,n=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=n?.positiveColor??t.config.themeSemantic?.success??"#28a745",l=n?.negativeColor??t.config.themeSemantic?.danger??"#dc3545",c=n?.gap??1,h=n?.stroke,u=n?.strokeWidth,d=n?.opacity;let f=0;for(let e=0;r.length>e;e++){const p=r[e],y=t.getX(p),m=t.getY(p),x=f+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=s.x(y),k=0!==v?s.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){f=x;continue}const C=s.y(f),_=s.y(x),S=Math.min(C,_),M=Math.abs(C-_),P={fill:0>m?l:a,stroke:h,strokeWidth:u};null!=d&&(P.opacity=d),o.push(g(w,S,A,M,P,{...p,baseline:f,cumEnd:x,delta:m,_connectorStroke:n?.connectorStroke,_connectorWidth:n?.connectorWidth})),f=x}return o}(s,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 s=[],n=t.config.candlestickStyle||{},r=n.rangeColor||"#6366f1",a=o?r:n.upColor||"#28a745",l=o?r:n.downColor||"#dc3545",c=o?r:n.wickColor||"#333",h=n.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=n.bodyWidth??0;if(null==n.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 n of e){const e=t.getX(n);if(null==e||Number.isNaN(e))continue;const r=t.getHigh(n),u=t.getLow(n);if(null==r||Number.isNaN(r)||null==u||Number.isNaN(u))continue;const d=o?r:t.getOpen(n),f=o?u:t.getClose(n);if(!o&&[d,f].some(t=>null==t||Number.isNaN(t)))continue;const p=f>=d,y={type:"candlestick",x:t.scales.x(e),openY:t.scales.y(d),closeY:t.scales.y(f),highY:t.scales.y(r),lowY:t.scales.y(u),bodyWidth:g,upColor:a,downColor:l,wickColor:c,wickWidth:h,isUp:p,datum:n};o&&(y.isRange=!0,y.dotRadius=Math.max(2,Math.min(g/2,.12*i.height))),s.push(y)}return s}(s,e,t);default:return[]}}resolveBoundsStyle(t,e){return function(t,e,i,o){const s=t.boundsStyle;return"function"==typeof s?s(i||{},e):s&&"object"==typeof s?s:{fill:o(e,i).stroke||t.themeSemantic?.primary||"#4e79a7",fillOpacity:.2,stroke:"none"}}(this.config,t,e,(t,e)=>this.resolveLineStyle(t,e))}computeDecayOpacity(t,e){const i=this.config.decay;return i&&e>1?U(i,t,e):1}getDatumIndexMap(t){if(this._datumIndexCache&&this._datumIndexCache.version===this._ingestVersion)return this._datumIndexCache.map;const e=j(t);return this._datumIndexCache={version:this._ingestVersion,map:e},e}applyDecay(t,e){this.config.decay&&G(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&&N(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 s=0;e.length>s;s++){const n=e[s],r=Ne(t,n,s);r&&("point"===n.type?i.set(r,{x:n.x,y:n.y,r:n.r,opacity:We(n.style)}):"glyph"===n.type?i.set(r,{x:n.x,y:n.y,r:n.size,opacity:We(n.style),glyph:n.glyph}):"rect"===n.type||"heatcell"===n.type?i.set(r,{x:n.x,y:n.y,w:n.w,h:n.h,opacity:We(n.style)}):"candlestick"===n.type?i.set(r,{x:n.x,y:n.openY,w:n.bodyWidth,openY:n.openY,closeY:n.closeY,highY:n.highY,lowY:n.lowY,opacity:We(n.style)}):"line"===n.type?o.set(r,{path:n.path.map(t=>[t[0],t[1]]),opacity:n.style?.opacity}):"area"===n.type&&o.set(r,{topPath:n.topPath.map(t=>[t[0],t[1]]),bottomPath:n.bottomPath.map(t=>[t[0],t[1]]),opacity:n.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=Ne(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,s,n=qt()){if(0===o.size&&0===s.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 n=i.scene[e],r=Ne(t,n,e);if(!r)continue;if(n._transitionKey=r,"line"===n.type||"area"===n.type){const t=s.get(r);if(t){if(c.add(r),"line"===n.type&&t.path&&t.path.length===n.path.length){n._targetPath=n.path.map(t=>[t[0],t[1]]),n._prevPath=t.path;for(let e=0;n.path.length>e;e++)n.path[e]=[t.path[e][0],t.path[e][1]];a=!0}else if("area"===n.type&&t.topPath&&t.bottomPath&&t.topPath.length===n.topPath.length&&t.bottomPath.length===n.bottomPath.length){n._targetTopPath=n.topPath.map(t=>[t[0],t[1]]),n._targetBottomPath=n.bottomPath.map(t=>[t[0],t[1]]),n._prevTopPath=t.topPath,n._prevBottomPath=t.bottomPath;for(let e=0;n.topPath.length>e;e++)n.topPath[e]=[t.topPath[e][0],t.topPath[e][1]];for(let e=0;n.bottomPath.length>e;e++)n.bottomPath[e]=[t.bottomPath[e][0],t.bottomPath[e][1]];a=!0}n._targetOpacity=n.style.opacity??1,n._startOpacity=t.opacity??n.style.opacity??1}else n._targetOpacity=n.style.opacity??1,n._startOpacity=0,n.style={...n.style,opacity:0},a=!0;continue}const h=o.get(r);if("point"===n.type)if(h){l.add(r);const t={x:n.x,y:n.y,r:n.r};n._targetOpacity=We(n.style),h.x===t.x&&h.y===t.y&&h.r===t.r||(n._targetX=t.x,n._targetY=t.y,n._targetR=t.r,n.x=h.x,n.y=h.y,n.r=h.r??n.r,a=!0)}else n._targetOpacity=We(n.style),n.style={...n.style,opacity:0},a=!0;else if("glyph"===n.type)if(h){l.add(r);const t={x:n.x,y:n.y,size:n.size};n._targetOpacity=We(n.style),h.x===t.x&&h.y===t.y&&h.r===t.size||(n._targetX=t.x,n._targetY=t.y,n._targetR=t.size,n.x=h.x,n.y=h.y,n.size=h.r??n.size,a=!0)}else n._targetOpacity=We(n.style),n.style={...n.style,opacity:0},a=!0;else if("rect"===n.type)if(h){l.add(r);const t={x:n.x,y:n.y,w:n.w,h:n.h};n._targetOpacity=We(n.style),h.x===t.x&&h.y===t.y&&h.w===t.w&&h.h===t.h||(n._targetX=t.x,n._targetY=t.y,n._targetW=t.w,n._targetH=t.h,n.x=h.x,n.y=h.y,n.w=h.w??n.w,n.h=h.h??n.h,a=!0)}else n._targetOpacity=We(n.style),n.style={...n.style,opacity:0},a=!0;else if("heatcell"===n.type)if(h){l.add(r);const t={x:n.x,y:n.y,w:n.w,h:n.h};n._targetOpacity=We(n.style),h.x===t.x&&h.y===t.y&&h.w===t.w&&h.h===t.h||(n._targetX=t.x,n._targetY=t.y,n._targetW=t.w,n._targetH=t.h,n.x=h.x,n.y=h.y,n.w=h.w??n.w,n.h=h.h??n.h,a=!0)}else n._targetOpacity=We(n.style),n.style={...n.style||{},opacity:0},a=!0;else if("candlestick"===n.type)if(h&&null!=h.openY){l.add(r);const t={x:n.x,openY:n.openY,closeY:n.closeY,highY:n.highY,lowY:n.lowY};n._targetOpacity=We(n.style),(h.x!==t.x||h.openY!==t.openY||h.closeY!==t.closeY||h.highY!==t.highY||h.lowY!==t.lowY)&&(n._targetX=t.x,n._targetOpenY=t.openY,n._targetCloseY=t.closeY,n._targetHighY=t.highY,n._targetLowY=t.lowY,n.x=h.x,n.openY=h.openY,n.closeY=h.closeY??n.closeY,n.highY=h.highY??n.highY,n.lowY=h.lowY??n.lowY,a=!0)}else n._targetOpacity=We(n.style),n.style={...n.style||{},opacity:0},a=!0}for(const[t,e]of s)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:n,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 s=zt(t,i.activeTransition),n=Dt(s,"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=Ht(i?i.opacity??1:0,t._targetOpacity,n)}if(void 0===t._targetX)continue;if(!e)continue;const i=o.get(e);if(!i)continue;t.x=Ht(i.x,t._targetX,n),t.y=Ht(i.y,t._targetY,n),void 0!==t._targetR&&void 0!==i.r&&(t.r=Ht(i.r,t._targetR,n))}else if("glyph"===t.type){if(void 0!==t._targetOpacity){const i=e?o.get(e):void 0;t.style.opacity=Ht(i?i.opacity??1:0,t._targetOpacity,n)}if(void 0===t._targetX)continue;if(!e)continue;const i=o.get(e);if(!i)continue;t.x=Ht(i.x,t._targetX,n),t.y=Ht(i.y,t._targetY,n),void 0!==t._targetR&&void 0!==i.r&&(t.size=Ht(i.r,t._targetR,n))}else if("rect"===t.type){if(void 0!==t._targetOpacity){const i=e?o.get(e):void 0;t.style.opacity=Ht(i?i.opacity??1:0,t._targetOpacity,n)}if(void 0===t._targetX)continue;if(!e)continue;const i=o.get(e);if(!i)continue;t.x=Ht(i.x,t._targetX,n),t.y=Ht(i.y,t._targetY,n),void 0!==i.w&&(t.w=Ht(i.w,t._targetW,n)),void 0!==i.h&&(t.h=Ht(i.h,t._targetH,n))}else if("heatcell"===t.type){if(void 0!==t._targetOpacity){const i=e?o.get(e):void 0;t.style={...t.style||{},opacity:Ht(i?i.opacity??1:0,t._targetOpacity,n)}}if(void 0===t._targetX)continue;if(!e)continue;const i=o.get(e);if(!i)continue;t.x=Ht(i.x,t._targetX,n),t.y=Ht(i.y,t._targetY,n),void 0!==i.w&&(t.w=Ht(i.w,t._targetW,n)),void 0!==i.h&&(t.h=Ht(i.h,t._targetH,n))}else if("candlestick"===t.type){if(void 0!==t._targetOpacity){const i=e?o.get(e):void 0;t.style={...t.style||{},opacity:Ht(i?i.opacity??1:0,t._targetOpacity,n)}}if(void 0===t._targetX)continue;if(!e)continue;const i=o.get(e);if(!i)continue;t.x=Ht(i.x,t._targetX,n),void 0!==i.openY&&(t.openY=Ht(i.openY,t._targetOpenY,n)),void 0!==i.closeY&&(t.closeY=Ht(i.closeY,t._targetCloseY,n)),void 0!==i.highY&&(t.highY=Ht(i.highY,t._targetHighY,n)),void 0!==i.lowY&&(t.lowY=Ht(i.lowY,t._targetLowY,n))}else if("line"===t.type){void 0!==t._targetOpacity&&(t.style={...t.style,opacity:Ht(t._startOpacity??0,t._targetOpacity,n)}),void 0!==t._introClipFraction&&(t._introClipFraction=n);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]=Ht(e[o][0],i[o][0],n),t.path[o][1]=Ht(e[o][1],i[o][1],n)}else if("area"===t.type){void 0!==t._targetOpacity&&(t.style={...t.style,opacity:Ht(t._startOpacity??0,t._targetOpacity,n)}),void 0!==t._introClipFraction&&(t._introClipFraction=n);const e=t._prevTopPath,i=t._prevBottomPath,o=t._targetTopPath,s=t._targetBottomPath;if(e&&o&&e.length===t.topPath.length)for(let i=0;t.topPath.length>i;i++)t.topPath[i][0]=Ht(e[i][0],o[i][0],n),t.topPath[i][1]=Ht(e[i][1],o[i][1],n);if(i&&s&&i.length===t.bottomPath.length)for(let e=0;t.bottomPath.length>e;e++)t.bottomPath[e][0]=Ht(i[e][0],s[e][0],n),t.bottomPath[e][1]=Ht(i[e][1],s[e][1],n)}}if(s>=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,k(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 s;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)}s=Array.from(i.entries()).map(([t,e])=>({key:t,data:e}))}else s=[{key:"_default",data:t}];return{result:s,cache:{version:i,group:e,data:t,result:s}}}(t,this.getGroup,this._ingestVersion,this._groupDataCache);return this._groupDataCache=i,e}resolveColorMap(t){const{map:e,cache:i}=function(t,e,i,o,s){if(s&&s.version===o)return{map:s.map,cache:s};const n=new Set;if(e)for(const i of t){const t=e(i);t&&n.add(t)}const r=Array.from(n).sort(),a=r.join("\0");if(s&&s.key===a){const t={...s,version:o};return{map:t.map,cache:t}}const l=Array.isArray(i.colorScheme)?i.colorScheme:i.themeCategorical||Ct,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 s=t.lineStyle;if("function"==typeof s){const t=s(i||{},e);if(t&&!t.stroke&&e){const i=o(e);if(i)return{...t,stroke:i}}return t}const n=t.themeSemantic?.primary;return s&&"object"==typeof s?{stroke:s.stroke||n||"#007bff",strokeWidth:s.strokeWidth||2,strokeDasharray:s.strokeDasharray,fill:s.fill,fillOpacity:s.fillOpacity,opacity:s.opacity}:{stroke:o(e)||n||"#007bff",strokeWidth:2}}(this.config,t,e,t=>this.resolveGroupColor(t))}resolveAreaStyle(t,e){return function(t,e,i,o){if(t.areaStyle){const s=t.areaStyle(i||{});if(s&&!s.fill&&e){const t=o(e);if(t)return{...s,fill:t,stroke:s.stroke||t}}return s}const s=t.lineStyle;if("function"==typeof s){const t=s(i||{},e);if(t&&!t.fill&&e){const i=o(e);if(i)return{...t,fill:i,stroke:t.stroke||i}}return t}const n=t.themeSemantic?.primary;if(s&&"object"==typeof s)return{fill:s.fill||s.stroke||n||"#4e79a7",fillOpacity:s.fillOpacity??.7,stroke:s.stroke||n||"#4e79a7",strokeWidth:s.strokeWidth||2};const r=o(e)||n||"#4e79a7";return{fill:r,fillOpacity:.7,stroke:r,strokeWidth:2}}(this.config,t,e,t=>this.resolveGroupColor(t))}resolveGroupColor(e){const{color:i,groupColorCounter:o}=function(t){const{group:e,colorMapCache:i,groupColorMap:o,groupColorMapCap:s,config:n}=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(n.colorScheme)&&n.colorScheme.length>0?n.colorScheme:null)||(Array.isArray(n.themeCategorical)&&n.themeCategorical.length>0?n.themeCategorical:null)||Ct;if(0===l.length)return{color:null,groupColorCounter:r};const c=l[r%l.length];if(r++,o.set(e,c),o.size>s){const t=o.keys().next().value;void 0!==t&&o.delete(t)}return{color:c,groupColorCounter:r}}({group:e,colorMapCache:this._colorMapCache,groupColorMap:this._groupColorMap,groupColorCounter:this._groupColorCounter,groupColorMapCap:t.GROUP_COLOR_MAP_CAP,config:this.config});return this._groupColorCounter=o,i}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=A(t),i=this.getPointId,o=t=>e.has(i(t));P(this.buffer,this.timestampBuffer,o);const s=this.buffer.remove(o);if(0===s.length)return this.updateResults.recordNoop("remove"),s;for(const t of s)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",s.length),s}update(t,e){if(!this.getPointId)throw Error("update() requires pointIdAccessor to be configured");const i=A(t),o=this.getPointId,s=new Set;this.buffer.forEach((t,e)=>{i.has(o(t))&&s.add(e)});const n=this.buffer.update(t=>i.has(o(t)),e);if(0===n.length)return this.updateResults.recordNoop("update"),n;for(const t of n)this.xExtent.evict(this.getX(t)),this.evictDatumYExtent(t);return this.buffer.forEach((t,e)=>{s.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",n.length),n}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??{},s=i(o,e);o.style=s?{...t,...s}: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,s=!1;Object.assign(this.config,t),"pulse"in t&&this.syncPulseTimestampBuffer();const n="chartType"in t&&t.chartType!==e.chartType||"runtimeMode"in t&&t.runtimeMode!==e.runtimeMode;if(n||"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=n||!dt(t&&this.config.timeAccessor||this.config.xAccessor,t&&e.timeAccessor||e.xAccessor),l=n||!dt(i,r);(a||l)&&(t?(this.getX=ft(this.config.timeAccessor||this.config.xAccessor,"time"),this.getY=ft(this.config.valueAccessor||this.config.yAccessor,"value")):(this.getX=ft(this.config.xAccessor,"x"),this.getY=ft(this.config.yAccessor,"y")),l&&this.resolvedRibbons.some(t=>"bounds"===t.kind)&&(this.resolvedRibbons=Ie(this.config)),o=!0,s=!0)}if("groupAccessor"in t&&!dt(t.groupAccessor,e.groupAccessor)&&(this.getGroup=null!=this.config.groupAccessor?yt(this.config.groupAccessor):void 0,o=!0),"categoryAccessor"in t&&!dt(t.categoryAccessor,e.categoryAccessor)&&(this.getCategory=null!=this.config.categoryAccessor?yt(this.config.categoryAccessor):void 0,o=!0),"sizeAccessor"in t&&!dt(t.sizeAccessor,e.sizeAccessor)&&(this.getSize=this.config.sizeAccessor?ft(this.config.sizeAccessor,"size"):void 0,o=!0),"symbolAccessor"in t&&!dt(t.symbolAccessor,e.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?yt(this.config.symbolAccessor):void 0,o=!0),"colorAccessor"in t&&!dt(t.colorAccessor,e.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?yt(this.config.colorAccessor):void 0,o=!0),"y0Accessor"in t&&!dt(t.y0Accessor,e.y0Accessor)&&(this.getY0=this.config.y0Accessor?ft(this.config.y0Accessor,"y0"):void 0,o=!0,s=!0),("boundsAccessor"in t&&!dt(t.boundsAccessor,e.boundsAccessor)||"band"in t&&t.band!==e.band||"boundsStyle"in t&&t.boundsStyle!==e.boundsStyle)&&(this.resolvedRibbons=Ie(this.config),o=!0,s=!0),"pointIdAccessor"in t&&!dt(t.pointIdAccessor,e.pointIdAccessor)&&(this.getPointId=null!=this.config.pointIdAccessor?yt(this.config.pointIdAccessor):void 0,o=!0),"candlestick"===this.config.chartType&&(n||"openAccessor"in t&&!dt(t.openAccessor,e.openAccessor)||"closeAccessor"in t&&!dt(t.closeAccessor,e.closeAccessor)||"highAccessor"in t&&!dt(t.highAccessor,e.highAccessor)||"lowAccessor"in t&&!dt(t.lowAccessor,e.lowAccessor))){const t=null!=this.config.openAccessor,e=null!=this.config.closeAccessor;this.getOpen=t?ft(this.config.openAccessor,"open"):void 0,this.getHigh=ft(this.config.highAccessor,"high"),this.getLow=ft(this.config.lowAccessor,"low"),this.getClose=e?ft(this.config.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!t&&!e,o=!0,s=!0}if("accessorRevision"in t&&t.accessorRevision!==e.accessorRevision&&(o=!0,s=!0),!o){const i=Object.keys(t).filter(t=>!t.endsWith("Accessor")&&"timeAccessor"!==t&&"valueAccessor"!==t);for(const s of i)if(t[s]!==e[s]){o=!0;break}}o&&(s&&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 hi=ci;H(hi);import{line as ui}from"d3-shape";var gi=new WeakMap;function di(t,e){const i=ee(e);if(!i)return t;const o=gi.get(t);if(o)return o;const s=function(t,e,i=8){if(!e||2>t.length)return t.map(([t,e])=>[t,e]);const o=[];let s=null;const n={moveTo(t,e){s=[t,e],o.push([t,e])},lineTo(t,e){s=[t,e],o.push([t,e])},bezierCurveTo(t,e,n,r,a,l){if(!s)return s=[a,l],void o.push([a,l]);const[c,h]=s;for(let s=1;i>=s;s++){const u=s/i,g=1-u;o.push([g*g*g*c+3*g*g*u*t+3*g*u*u*n+u*u*u*a,g*g*g*h+3*g*g*u*e+3*g*u*u*r+u*u*u*l])}s=[a,l]},closePath(){},arc(){},rect(){},arcTo(){},quadraticCurveTo(t,e,i,n){s=[i,n],o.push([i,n])}};return ui().x(t=>t[0]).y(t=>t[1]).curve(e).context(n)(t),o}(t,i);return gi.set(t,s),s}function fi(t,e,i,o=30,s,n=0){let r=null;if(s){const t=Q(s,e,i,o,n);t&&(r={node:t.node,datum:t.node.datum,x:t.node.x,y:t.node.y,distance:t.distance})}for(const n of t){let t=null;switch(n.type){case"point":if(s)break;t=yi(n,e,i,o);break;case"symbol":t=mi(n,e,i,o);break;case"glyph":t=xi(n,e,i,o);break;case"line":t=vi(n,e,i,o);break;case"rect":if(null==n.datum)break;t=ki(n,e,i);break;case"heatcell":t=wi(n,e,i);break;case"area":if(!1===n.interactive)break;t=Ci(n,e,i);break;case"candlestick":t=Ai(n,e,i)}t&&o>t.distance&&(r&&t.distance>=r.distance||(r=t))}return r}function pi(t,e,i){if(0===t.length)return null;if(t[0][0]>e||e>t[t.length-1][0])return null;const o=_i(t,e);if(0>o)return null;if(Math.abs(t[o][0]-e)>i)return null;let s=o,n=o;o>0&&t[o][0]>=e?(s=o-1,n=o):t.length-1>o&&(s=o,n=o+1);const[r,a]=t[s],[l,c]=t[n];return l===r?a:a+Math.max(0,Math.min(1,(e-r)/(l-r)))*(c-a)}function yi(t,e,i,o=30){const s=e-t.x,n=i-t.y,r=Math.sqrt(s*s+n*n);return r>J(t.r,o)?null:{node:t,datum:t.datum,x:t.x,y:t.y,distance:r}}function mi(t,e,i,o=30){const s=e-t.x,n=i-t.y,r=Math.sqrt(s*s+n*n);return r>J(se(t.size),o)?null:{node:t,datum:t.datum,x:t.x,y:t.y,distance:r}}function xi(t,e,i,o=30){if(null==t.datum)return null;const s=fe(t.glyph,t.size),n=t.x+s.centerDx,r=t.y+s.centerDy,a=e-n,l=i-r,c=Math.sqrt(a*a+l*l);return c>J(s.radius,o)?null:{node:t,datum:t.datum,x:n,y:r,distance:c}}function vi(t,e,i,o=30){if(0===t.path.length)return null;const s=_i(t.path,e);if(0>s)return null;const[n,r]=t.path[s];let a;if(t.path.length>1){let o=1/0;const n=Math.max(0,s-1),r=Math.min(t.path.length-2,s);for(let s=n;r>=s;s++){const[n,r]=t.path[s],[a,l]=t.path[s+1],c=bi(e,i,n,r,a,l);o>c&&(o=c)}a=o}else{const t=e-n,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[s]?t.datum[s]:t.datum,x:n,y:r,distance:a}}function bi(t,e,i,o,s,n){const r=s-i,a=n-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 ki(t,e,i){const o=tt(e,i,t);return o.hit?{node:t,datum:t.datum,x:o.cx,y:o.cy,distance:0}:null}function wi(t,e,i){const o=tt(e,i,t);return o.hit?{node:t,datum:t.datum,x:o.cx,y:o.cy,distance:0}:null}function Ai(t,e,i){const o=t.bodyWidth/2,s=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=s+Math.max(Math.max(t.openY,t.closeY)-s,1)/2,n=e-t.x,r=i-o;return{node:t,datum:t.datum,x:t.x,y:o,distance:Math.sqrt(n*n+r*r)}}return null}function Ci(t,e,i){if(0===t.topPath.length)return null;const o=_i(t.topPath,e);if(0>o)return null;const[s,n]=t.topPath[o],r=e-s,a=i-n,l=Math.sqrt(r*r+a*a);return{node:t,datum:Array.isArray(t.datum)&&t.datum[o]?t.datum[o]:t.datum,x:s,y:n,distance:l}}function _i(t,e){if(0===t.length)return-1;let i=0,o=t.length-1;for(;o>i;){const s=i+o>>1;e>t[s][0]?i=s+1:o=s}return i>0&&Math.abs(t[i][0]-e)>=Math.abs(t[i-1][0]-e)?i-1:i}import{useMemo as Si,useRef as Mi,useEffect as Pi}from"react";import{useMemo as Yi}from"react";import{bin as Ri}from"d3-array";import{jsx as Ti,jsxs as Ni}from"react/jsx-runtime";function Wi(t){return"string"==typeof t?{type:t}:t}function Oi({orient:t,config:e,values:i,scale:o,size:s,length:n}){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=Yi(()=>{if(0===i.length)return null;const e=o.domain(),l=s-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)],s=e[Math.floor(.5*i)],n=e[Math.floor(.75*i)],r=n-o;return{q1:o,median:s,q3:n,whiskerLow:Math.max(e[0],o-1.5*r),whiskerHigh:Math.min(e[i-1],n+1.5*r)}}(i);if(!e)return null;const{q1:s,median:n,q3:c,whiskerLow:h,whiskerHigh:u}=e,g=Math.min(.5*l,20),d=(l-g)/2+4;if(a){const e=o(s),i=o(c),a=o(n),l=o(h),f=o(u),p="top"===t?-1:1,y=0;return Ni("g",{"data-testid":"marginal-boxplot-"+t,children:[Ti("line",{x1:l,y1:y+p*(d+g/2),x2:f,y2:y+p*(d+g/2),stroke:r.fill,strokeWidth:r.strokeWidth}),Ti("line",{x1:l,y1:y+p*d,x2:l,y2:y+p*(d+g),stroke:r.fill,strokeWidth:r.strokeWidth}),Ti("line",{x1:f,y1:y+p*d,x2:f,y2:y+p*(d+g),stroke:r.fill,strokeWidth:r.strokeWidth}),Ti("rect",{x:Math.min(e,i),y:"top"===t?y-d-g:y+d,width:Math.abs(i-e),height:g,fill:r.fill,fillOpacity:r.fillOpacity,stroke:"none"===r.stroke?r.fill:r.stroke,strokeWidth:r.strokeWidth}),Ti("line",{x1:a,y1:"top"===t?y-d-g:y+d,x2:a,y2:"top"===t?y-d:y+d+g,stroke:r.fill,strokeWidth:2})]})}{const e=o(s),i=o(c),a=o(n),l=o(h),f=o(u),p="left"===t?-1:1,y=0;return Ni("g",{"data-testid":"marginal-boxplot-"+t,children:[Ti("line",{x1:y+p*(d+g/2),y1:l,x2:y+p*(d+g/2),y2:f,stroke:r.fill,strokeWidth:r.strokeWidth}),Ti("line",{x1:y+p*d,y1:l,x2:y+p*(d+g),y2:l,stroke:r.fill,strokeWidth:r.strokeWidth}),Ti("line",{x1:y+p*d,y1:f,x2:y+p*(d+g),y2:f,stroke:r.fill,strokeWidth:r.strokeWidth}),Ti("rect",{x:"left"===t?y-d-g:y+d,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}),Ti("line",{x1:"left"===t?y-d-g:y+d,y1:a,x2:"left"===t?y-d:y+d+g,y2:a,stroke:r.fill,strokeWidth:2})]})}}const c=Ri().domain(e).thresholds(r.bins)(i);if(0===c.length)return null;const h=ge(c.map(t=>t.length));if(0===h)return null;if("histogram"===r.type)return Ti("g",{"data-testid":"marginal-histogram-"+t,children:c.map((e,i)=>{if(null==e.x0||null==e.x1)return null;const s=e.length/h*l;if(a){const n=o(e.x0),a=o(e.x1)-o(e.x0);return Ti("rect",{x:n,y:"top"===t?-4-s:4,width:Math.max(a,.5),height:s,fill:r.fill,fillOpacity:r.fillOpacity,stroke:r.stroke,strokeWidth:r.strokeWidth},i)}{const n=o(e.x0),a=o(e.x1)-o(e.x0);return Ti("rect",{x:"left"===t?-4-s:4,y:Math.min(n,n+a),width:s,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 s of c){if(null==s.x0||null==s.x1)continue;const n=s.length/h*(l/2),r=o((s.x0+s.x1)/2);i.push(a?`${r},${"top"===t?-(e-n):e-n}`:`${"left"===t?-(e-n):e-n},${r}`)}for(let s=c.length-1;s>=0;s--){const n=c[s];if(null==n.x0||null==n.x1)continue;const r=n.length/h*(l/2),u=o((n.x0+n.x1)/2);i.push(a?`${u},${"top"===t?-(e+r):e+r}`:`${"left"===t?-(e+r):e+r},${u}`)}return Ti("g",{"data-testid":"marginal-violin-"+t,children:Ti("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,s=null!=c[0].x0?o(c[0].x0):0;e.push(`M${s},${i}`);for(const i of c){if(null==i.x0||null==i.x1)continue;const s=i.length/h*l,n=o((i.x0+i.x1)/2);e.push(`L${n},${"top"===t?-s-4:s+4}`)}const r=null!=c[c.length-1].x1?o(c[c.length-1].x1):n;e.push(`L${r},${i}`),e.push("Z")}else{const i=0,s=null!=c[0].x0?o(c[0].x0):0;e.push(`M${i},${s}`);for(const i of c){if(null==i.x0||null==i.x1)continue;const s=i.length/h*l,n=o((i.x0+i.x1)/2);e.push(`L${"left"===t?-s-4:s+4},${n}`)}const r=null!=c[c.length-1].x1?o(c[c.length-1].x1):n;e.push(`L${i},${r}`),e.push("Z")}return Ti("g",{"data-testid":"marginal-ridgeline-"+t,children:Ti("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,s,n,t,a,4]);return l?Ti("g",{className:"marginal-"+t,"data-testid":"marginal-"+t,children:l}):null}function Di(t,e,i){if("edges"===t){if(e)return"start";if(i)return"end"}return"middle"}function zi(t,e,i){if("edges"===t){if(e)return"hanging";if(i)return"auto"}return"middle"}function Li(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 Bi(t){if(t)return"dashed"===t?"6,4":"dotted"===t?"2,4":t}function Ei(t,e,i){if("left"===t||"right"===t){const o="left"===t?i:0,s="left"===t?-1:1,n=Math.ceil(e/8);let r="M0,"+o;for(let t=0;n>t;t++){const i=8*(t+1);r+=`L${Math.min(8*t+4,e)},${o+4*s}`,r+=`L${Math.min(i,e)},${o}`}return r}const o="bottom"===t?0:e,s="bottom"===t?1:-1,n=Math.ceil(i/8);let r=`M${o},0`;for(let t=0;n>t;t++){const e=8*(t+1);r+=`L${o+4*s},${Math.min(8*t+4,i)}`,r+=`L${o},${Math.min(e,i)}`}return r}import{Fragment as Fi,jsx as Ii,jsxs as Xi}from"react/jsx-runtime";function $i(t){const{width:e,height:i,totalWidth:o,totalHeight:s,margin:n,scales:r,showAxes:a,axes:l,showGrid:c,xFormat:h,yFormat:u,axisExtent:g}=t,d=Si(()=>{if(!r)return[];const t=l?.find(t=>"bottom"===t.orient),i=t?.tickFormat||h||Vi,o=Math.max(2,Math.floor(e/70)),s=t?.ticks??5,n="exact"===g?Math.max(2,s):Math.min(s,o),a=t?.tickValues??w(r.x,n,g),c=a.map(t=>t.valueOf()),u=a.map((t,e)=>({value:t,pixel:r.x(t),label:i(t,e,c)})),d=u.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);return Gi(u,Math.max(55,d+8))},[r,l,h,e,g]),f=Si(()=>{if(!r)return[];const t=l?.find(t=>"left"===t.orient),e=t?.tickFormat||u||Vi,o=Math.max(2,Math.floor(i/30)),s=t?.ticks??5,n="exact"===g?Math.max(2,s):Math.min(s,o);return Gi((t?.tickValues??w(r.y,n,g)).map(t=>({value:t,pixel:r.y(t),label:e(t)})),22)},[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=>"left"===t.orient),v=y&&(!m||!1!==m.baseline),b=y&&(!x||!1!==x.baseline),k=m?.jaggedBase||!1,A=x?.jaggedBase||!1,C="var(--semiotic-border, #ccc)";return Ii("svg",{width:o,height:s,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:Xi("g",{transform:`translate(${n.left},${n.top})`,children:[p&&(()=>{const t=Bi(l?.find(t=>"bottom"===t.orient)?.gridStyle),o=Bi(l?.find(t=>"left"===t.orient)?.gridStyle),s=!1!==l?.find(t=>"bottom"===t.orient)?.grid,n=!1!==l?.find(t=>"left"===t.orient)?.grid;return Xi("g",{className:"stream-grid",children:[s&&d.map((e,o)=>Ii("line",{x1:e.pixel,y1:0,x2:e.pixel,y2:i,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1,strokeDasharray:t},"xgrid-"+o)),n&&f.map((t,i)=>Ii("line",{x1:0,y1:t.pixel,x2:e,y2:t.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1,strokeDasharray:o},"ygrid-"+i))]})})(),v&&!k&&Ii("line",{x1:0,y1:i,x2:e,y2:i,stroke:C,strokeWidth:1}),k&&Ii("path",{d:Ei("bottom",e,i),fill:"none",stroke:C,strokeWidth:1}),b&&!A&&Ii("line",{x1:0,y1:0,x2:0,y2:i,stroke:C,strokeWidth:1}),A&&Ii("path",{d:Ei("left",e,i),fill:"none",stroke:C,strokeWidth:1})]})})}function Vi(t,e,i){return t instanceof Date?`${t.toLocaleString("en",{month:"short"})} ${t.getDate()}`:"number"==typeof t?Math.round(100*t)/100+"":t+""}function Gi(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}function Hi(t){const{width:e,height:i,totalWidth:o,totalHeight:s,margin:n,scales:r,showAxes:a,axes:l,xLabel:c,yLabel:h,yLabelRight:u,xFormat:g,yFormat:d,axisExtent:f,showGrid:p,title:y,legend:m,legendHoverBehavior:x,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:k,legendPosition:A="right",legendLayout:C,foregroundGraphics:_,marginalGraphics:S,xValues:M,yValues:P,annotations:Y,onAnnotationActivate:R,onObservation:T,chartId:N,chartType:W,autoPlaceAnnotations:O,svgAnnotationRules:D,xAccessor:z,yAccessor:L,annotationData:B,pointNodes:E,curve:F,underlayRendered:I,canvasObscuresUnderlay:X=!0,linkedCrosshairName:$,linkedCrosshairSourceId:V,children:G}=t,H=re({onAnnotationActivate:R,onObservation:T,chartId:N,chartType:W}),j=ie(C),q=m&&"left"===A&&j>0?j:n.left,U=m&&"right"===A&&j>0?j:n.right,K=Si(()=>{if(!a||!r)return[];const t=l?.find(t=>"bottom"===t.orient),i=t?.tickFormat||g||Vi,o=Math.max(2,Math.floor(e/70)),s=t?.ticks??5,n="exact"===f?Math.max(2,s):Math.min(s,o),c=t?.tickValues??w(r.x,n,f),h=c.map(t=>t.valueOf()),u=c.map((t,e)=>({value:t,pixel:r.x(t),label:i(t,e,h)})),d=u.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),p=t?.autoRotate?Math.max(20,Math.min(d+8,55)):Math.max(55,d+8);let y=Gi(u,p);if(y.length>1&&(y=y.filter((t,e)=>0===e||t.label+""!=y[e-1].label+"")),t?.includeMax&&y.length>0&&"exact"!==f&&!t?.tickValues){const t=r.x.domain()[1],e=r.x(t),o=y[y.length-1].pixel;if(Math.abs(e-o)>1){const s=i(t,y.length,h);p>e-o&&y.length>1&&(y=y.slice(0,-1)),y.push({value:t,pixel:e,label:s})}}return y},[a,r,l,g,e,f]),Q=Si(()=>{const t=l?.find(t=>"bottom"===t.orient);if(!t?.autoRotate||1>=K.length)return!1;const i=e/Math.max(K.length-1,1);return K.reduce((t,e)=>Math.max(t,"string"==typeof e.label?6.5*e.label.length:60),0)+8>i},[l,K,e]),J=Si(()=>{if(!a||!r)return[];const t=l?.find(t=>"left"===t.orient),e=t?.tickFormat||d||Vi,o=Math.max(2,Math.floor(i/30)),s=t?.ticks??5,n="exact"===f?Math.max(2,s):Math.min(s,o);let c=Gi((t?.tickValues??w(r.y,n,f)).map(t=>({value:t,pixel:r.y(t),label:e(t)})),22);if(c.length>1&&(c=c.filter((t,e)=>0===e||t.label+""!=c[e-1].label+"")),t?.includeMax&&c.length>0&&"exact"!==f&&!t?.tickValues){const t=r.y.domain()[1],i=r.y(t),o=c[c.length-1].pixel;if(Math.abs(i-o)>1){const s=e(t);22>Math.abs(i-o)&&c.length>1&&(c=c.slice(0,-1)),c.push({value:t,pixel:i,label:s})}}return c},[a,r,l,d,i,f]),Z=Si(()=>{if(!a||!r)return[];const t=l?.find(t=>"right"===t.orient);if(!t)return[];const e=t.tickFormat||d||Vi,o=Math.max(2,Math.floor(i/30)),s=t.ticks??5;return Gi((t.tickValues??w(r.y,"exact"===f?Math.max(2,s):Math.min(s,o),f)).map(t=>({value:t,pixel:r.y(t),label:e(t)})),22)},[a,r,l,d,i,f]),tt=Mi(new Map),it=Mi(Y?.length??0),ot=Y?.length??0;it.current!==ot&&(it.current=ot,tt.current=new Map);const st=Si(()=>{if(!Y||0===Y.length)return null;const t=mt(Y),o=Lt("xy",H),s={scales:r?{x:r.x,y:r.y,time:r.x,value:r.y}:null,timeAxis:"x",xAccessor:z,yAccessor:L,width:e,height:i,data:B,frameType:"xy",pointNodes:E,curve:F,stickyPositionCache:tt.current},n=O?Rt({annotations:t,context:s,..."object"==typeof O?O:{}}):t;return Qt(n,o,D,s)},[Y,O,D,e,i,z,L,B,r,E,F,H]),nt=ae($);return Pi(()=>{if(!nt?.locked||!$)return;const t=t=>{"Escape"===t.key&&ne($)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[nt?.locked,$]),a||y||m||_||S||st&&st.length>0||p||G||nt?Xi("svg",{role:"img",width:o,height:s,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[Ii("title",{children:"string"==typeof y?y:"XY Chart"}),Ii("desc",{children:"string"==typeof y?y+" (XY data visualization)":"XY data visualization"}),Xi("g",{transform:`translate(${n.left},${n.top})`,children:[p&&r&&(!I||X)&&(()=>{const t=Bi(l?.find(t=>"bottom"===t.orient)?.gridStyle),o=Bi(l?.find(t=>"left"===t.orient)?.gridStyle),s=!1!==l?.find(t=>"bottom"===t.orient)?.grid,n=!1!==l?.find(t=>"left"===t.orient)?.grid;return Xi("g",{className:"stream-grid",children:[s&&K.map((e,o)=>Ii("line",{x1:e.pixel,y1:0,x2:e.pixel,y2:i,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1,strokeDasharray:t},"xgrid-"+o)),n&&J.map((t,i)=>Ii("line",{x1:0,y1:t.pixel,x2:e,y2:t.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1,strokeDasharray:o},"ygrid-"+i))]})})(),a&&r&&(()=>{const t=l?.find(t=>"left"===t.orient),o=l?.find(t=>"bottom"===t.orient),s=!t||!1!==t.baseline,n=!o||!1!==o.baseline,r=t?.jaggedBase||!1,a=o?.jaggedBase||!1,g=o?.landmarkTicks,d=t?.landmarkTicks,f="var(--semiotic-border, #ccc)",p="var(--semiotic-text-secondary, var(--semiotic-text, #666))",y="var(--semiotic-text, #333)",m=Q,x=m?12:18,v=i+(m?58:40),b={fontSize:"var(--semiotic-tick-font-size, 12px)"},k={fontSize:"calc(var(--semiotic-tick-font-size, 12px) + 1px)"},w={fontSize:"var(--semiotic-axis-label-font-size, 12px)"},A=o?.tickAnchor,C=t?.tickAnchor,_=Li(K),S=Li(J);return Xi("g",{className:"stream-axes",style:{fontFamily:"var(--semiotic-font-family, sans-serif)"},children:[Xi("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[(!I||X)&&n&&!a&&Ii("line",{x1:0,y1:i,x2:e,y2:i,stroke:f,strokeWidth:1}),(!I||X)&&a&&Ii("path",{d:Ei("bottom",e,i),fill:"none",stroke:f,strokeWidth:1}),K.map((t,e)=>{const o=!!g&&("function"==typeof g?g(t.value,e):et(t.value,e>0?K[e-1].value:void 0));return Xi("g",{transform:`translate(${t.pixel},${i})`,children:[Ii("line",{y2:5,stroke:f,strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?Ii("text",{y:x,textAnchor:m?"end":Di(A,t.pixel===_.min,t.pixel===_.max),fontWeight:o?600:400,fill:p,fontSize:o?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...o?k:b},transform:m?"rotate(-45)":void 0,children:t.label}):Ii("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:Ii("div",{style:{textAlign:"center",userSelect:"none",...b},children:t.label})})]},"xtick-"+e)}),c&&Ii("text",{x:e/2,y:v,textAnchor:"middle",fill:y,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...w},children:c})]}),Xi("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[(!I||X)&&s&&!r&&Ii("line",{x1:0,y1:0,x2:0,y2:i,stroke:f,strokeWidth:1}),(!I||X)&&r&&Ii("path",{d:Ei("left",e,i),fill:"none",stroke:f,strokeWidth:1}),J.map((t,e)=>{const i=!!d&&("function"==typeof d?d(t.value,e):et(t.value,e>0?J[e-1].value:void 0));return Xi("g",{transform:`translate(0,${t.pixel})`,children:[Ii("line",{x2:-5,stroke:f,strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?Ii("text",{x:-8,textAnchor:"end",dominantBaseline:zi(C,t.pixel===S.min,t.pixel===S.max),fontWeight:i?600:400,fill:p,fontSize:i?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...i?k:b},children:t.label}):Ii("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:Ii("div",{style:{textAlign:"right",userSelect:"none",...b},children:t.label})})]},"ytick-"+e)}),(()=>{const e=t?.label||h;return e?Ii("text",{x:15-q,y:i/2,textAnchor:"middle",fill:y,transform:`rotate(-90, ${15-q}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...w},children:e}):null})()]}),(()=>{const t=l?.find(t=>"right"===t.orient);if(!t||0===Z.length)return null;const o=!1!==t.baseline,s=t.landmarkTicks,n=t.label||u,r=t.tickAnchor,a=Li(Z);return Xi("g",{className:"semiotic-axis semiotic-axis-right","data-orient":"right",children:[o&&Ii("line",{x1:e,y1:0,x2:e,y2:i,stroke:f,strokeWidth:1}),Z.map((t,i)=>{const o=!!s&&("function"==typeof s?s(t.value,i):et(t.value,i>0?Z[i-1].value:void 0));return Xi("g",{transform:`translate(${e},${t.pixel})`,children:[Ii("line",{x2:5,stroke:f,strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?Ii("text",{x:8,textAnchor:"start",dominantBaseline:zi(r,t.pixel===a.min,t.pixel===a.max),fontWeight:o?600:400,fill:p,fontSize:o?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...o?k:b},children:t.label}):Ii("foreignObject",{x:8,y:-12,width:60,height:24,style:{overflow:"visible"},children:Ii("div",{style:{textAlign:"left",userSelect:"none",...b},children:t.label})})]},"ytick-r-"+i)}),n&&Ii("text",{x:e+U-15,y:i/2,textAnchor:"middle",fill:y,transform:`rotate(90, ${e+U-15}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...w},children:n})]})})()]})})(),st,S&&r&&M&&P&&Xi(Fi,{children:[S.top&&Ii("g",{transform:"translate(0, 0)",children:Ii(Oi,{orient:"top",config:Wi(S.top),values:M,scale:r.x,size:n.top,length:e})}),S.bottom&&Ii("g",{transform:`translate(0, ${i})`,children:Ii(Oi,{orient:"bottom",config:Wi(S.bottom),values:M,scale:r.x,size:n.bottom,length:e})}),S.left&&Ii("g",{transform:"translate(0, 0)",children:Ii(Oi,{orient:"left",config:Wi(S.left),values:P,scale:r.y,size:n.left,length:i})}),S.right&&Ii("g",{transform:`translate(${e}, 0)`,children:Ii(Oi,{orient:"right",config:Wi(S.right),values:P,scale:r.y,size:n.right,length:i})})]}),_,nt&&nt.sourceId!==V&&r?.x&&(()=>{const t=r.x(nt.xValue);if(null==t||0>t||t>e)return null;const o=nt.locked;return Ii("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"})})(),G]}),y&&"string"==typeof y?Ii("text",{x:o/2,y:Pt,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontSize:14,className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)"},children:y}):y?Ii("foreignObject",{x:0,y:0,width:o,height:n.top,children:y}):null,Jt({legend:m,totalWidth:o,totalHeight:s,margin:n,legendPosition:A,title:y,legendLayout:C,axisChrome:{hasAxis:!!a,hasAxisLabel:!!c,rotatedTicks:Q},legendHoverBehavior:x,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:k})]}):null}var ji={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 qi(t,e){const i=t.trim();if(/^#[0-9a-f]{3}$/i.test(i)){const t=i[1],o=i[2],s=i[3];return`#${t}${t}${o}${o}${s}${s}${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 Ui=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ki=3156e7;function Qi(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")}`}:Ki>e?t=>{const e=new Date(t);return`${Ui[e.getUTCMonth()]} ${e.getUTCDate()}`}:5*Ki>e?t=>{const e=new Date(t);return`${Ui[e.getUTCMonth()]} ${e.getUTCFullYear()}`}:t=>new Date(t).getUTCFullYear()+""}function Ji(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:se(i.size)});else if("glyph"===i.type){const t=fe(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 Zi,line as to}from"d3-shape";function eo(t,e){const i=ee(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=Zi().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 io(t,e){const i=ee(e.curve);if(t.beginPath(),i)to().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 oo=(t,e,i,o)=>{const s=e.filter(t=>"area"===t.type);for(const e of s){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 s=e._introClipFraction;void 0!==s&&1>s&&(t.save(),t.beginPath(),t.rect(0,0,o.width*s,o.height),t.clip());const n=te(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=n;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();if(e.style.stroke&&"none"!==e.style.stroke){t.strokeStyle=Zt(t,e.style.stroke)||e.style.stroke,t.lineWidth=e.style.strokeWidth||2,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(eo(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 s=Nt(t,e.fillGradient,"string"==typeof n?n:"#4e79a7",0,i,0,o);t.fillStyle=s||n,t.globalAlpha=c}else t.globalAlpha=(e.style.fillOpacity??.7)*c,t.fillStyle=n;if(t.fill(),e._pulseIntensity&&e._pulseIntensity>0&&(eo(t,e),ot(t,e)),e.style.stroke&&"none"!==e.style.stroke){t.globalAlpha=c;const i=Zt(t,e.style.stroke)||e.style.stroke,o=a||l||!e.strokeGradient||2>e.topPath.length?null:Nt(t,e.strokeGradient,i,e.topPath[0][0],0,e.topPath[e.topPath.length-1][0],0);if(t.lineWidth=e.style.strokeWidth||2,t.setLineDash([]),l){let o=1/0,s=-1/0;for(const[t]of e.topPath)o=Math.min(o,t),s=Math.max(s,t);const n=t.lineWidth;for(const r of e.strokeColorBands){t.save(),t.beginPath(),t.rect(o-n,r.y,s-o+2*n,r.height),t.clip();const a=r.color??i;t.strokeStyle=Zt(t,a)||a,io(t,e),t.stroke(),t.restore()}}else if(a){const o=Wt(e.topPath,e.rawValues,e.colorThresholds,i);for(const e of o){t.beginPath(),t.strokeStyle=Zt(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,io(t,e),t.stroke()}void 0!==s&&1>s&&t.restore(),i&&t.restore(),t.globalAlpha=1}};function so(t){const[e,i,o]=function(t){if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),6===e.length)return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}const e=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return e?[+e[1],+e[2],+e[3]]:[128,128,128]}(t);return.299*e+.587*i+.114*o>128?"#000":"#fff"}function no(t){return Number.isInteger(t)?t+"":100>Math.abs(t)?1>Math.abs(t)?t.toPrecision(3):t.toFixed(1):t.toFixed(0)}var ro=(t,e,i,o)=>{const s=e.filter(t=>"heatcell"===t.type);t.save();try{for(const e of s){const i=e.style;null!=i?.opacity&&(t.globalAlpha=i.opacity),t.fillStyle=e.fill,t.fillRect(e.x,e.y,e.w,e.h);const o=Math.max(0,i?.strokeWidth??1);if(o>0&&(t.strokeStyle=Zt(t,i?.stroke??"var(--semiotic-surface, #fff)"),t.lineWidth=o,t.strokeRect(e.x,e.y,e.w,e.h)),st(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):no(e.value),o=Math.max(10,Math.min(16,.3*Math.min(e.w,e.h))),s=e.x+e.w/2,n=e.y+e.h/2;t.fillStyle=so(e.fill),t.font=o+"px sans-serif",t.textAlign="center",t.textBaseline="middle",t.fillText(i,s,n)}}}finally{t.restore()}},ao=(t,e,i,o)=>{for(const i of e){if("candlestick"!==i.type)continue;const e=i;t.save();const s=(e._decayOpacity??1)*(e.style?.opacity??1);1!==s&&(t.globalAlpha=s);const n=Zt(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=n,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=n,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),s=e.isUp?e.upColor:e.downColor,n=Zt(t,s)||s;t.fillStyle=n,t.fillRect(e.x-e.bodyWidth/2,i,e.bodyWidth,Math.max(o,1)),t.strokeStyle=n,t.lineWidth=1,t.strokeRect(e.x-e.bodyWidth/2,i,e.bodyWidth,Math.max(o,1))}r&&l(),t.restore()}},lo={line:[oo,t,O],area:[oo,O],stackedarea:[oo,O],scatter:[O,$],bubble:[O,$],heatmap:[ro],bar:[r],swarm:[O],waterfall:[(t,e,i,o)=>{r(t,e,i,o);const s=e.filter(t=>"rect"===t.type);if(2>s.length)return;const n=s[0].datum,a=n?._connectorStroke;if(a){t.save(),t.strokeStyle=Zt(t,a)||a,t.lineWidth=n?._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:[ao],mixed:[oo,t,O],custom:[oo,r,ro,t,O,$,Z,ao]};import{jsx as co,jsxs as ho}from"react/jsx-runtime";function uo(t){return null==t?"":"number"==typeof t?Number.isInteger(t)?t+"":t.toFixed(2):t instanceof Date?t.toLocaleString():t+""}function go({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=oe(e);if(null!=t.title||t.entries.length>0)return ho("div",{className:"semiotic-tooltip",style:Bt,children:[null!=t.title&&co("div",{style:{fontWeight:600,marginBottom:t.entries.length?2:0},children:t.title+""}),t.entries.map(t=>ho("div",{style:{opacity:.7,fontSize:11},children:[t.key,":"," ",co("span",{style:{fontWeight:600},children:uo(t.value)})]},t.key))]})}return ho("div",{className:"semiotic-tooltip",style:Bt,children:[co("div",{style:{fontWeight:600,marginBottom:2},children:uo(i)}),co("div",{style:{opacity:.7,fontSize:11},children:uo(o)})]})}go.ownsChrome=!0;import{jsx as fo,jsxs as po}from"react/jsx-runtime";var yo={top:20,right:20,bottom:30,left:40},mo=ji;function xo(t){if(t)return"x"===t.dimension?"pan-y":"y"===t.dimension?"pan-x":"none"}var vo=Se(_e(function(t,i){const{chartType:o,runtimeMode:n,data:r,chunkThreshold:a,chunkSize:c,xAccessor:h,yAccessor:u,accessorRevision:g,colorAccessor:d,sizeAccessor:f,symbolAccessor:p,symbolMap:y,groupAccessor:k,lineDataAccessor:w,curve:A,normalize:C,baseline:_,stackOrder:S,binSize:M,valueAccessor:P,arrowOfTime:Y="right",windowMode:T="sliding",windowSize:N=200,timeAccessor:W,xExtent:O,yExtent:D,extentPadding:$=.1,scalePadding:G,sizeRange:H,size:j=[500,300],responsiveWidth:U,responsiveHeight:K,margin:Q,className:J,background:Z,renderMode:tt,lineStyle:et,pointStyle:ot,areaStyle:st,barStyle:ut,waterfallStyle:dt,swarmStyle:ft,barColors:pt,colorScheme:yt,boundsAccessor:mt,boundsStyle:At,y0Accessor:Ct,band:Pt,gradientFill:Yt,lineGradient:Rt,semanticLineStops:Nt,areaGroups:Wt,openAccessor:Dt,highAccessor:zt,lowAccessor:Lt,closeAccessor:Bt,candlestickStyle:$t,showAxes:Ht=!0,axes:jt,xLabel:qt,yLabel:Qt,yLabelRight:Jt,xFormat:Zt,yFormat:te,axisExtent:ee,tickFormatTime:ie,tickFormatValue:oe,hoverAnnotation:se,tooltipContent:ne,customHoverBehavior:re,customClickBehavior:ae,onObservation:ge,annotationObservationCallback:fe,chartId:_e,enableHover:Se,hoverRadius:Me=30,tooltipMode:Pe,annotations:Ye,onAnnotationActivate:Re,autoPlaceAnnotations:Ne,svgAnnotationRules:We,showGrid:Oe,legend:De,legendHoverBehavior:ze,legendClickBehavior:Le,legendHighlightedCategory:Be,legendIsolatedCategories:Ee,legendPosition:Fe,legendLayout:Ie,legendCategoryAccessor:Xe,onCategoriesChange:$e,backgroundGraphics:Ve,foregroundGraphics:Ge,canvasPreRenderers:He,svgPreRenderers:je,title:qe,categoryAccessor:Ue,brush:Ke,onBrush:Qe,decay:Je,pulse:Ze,transition:ti,animate:ei,staleness:ii,frameScheduler:oi,clock:si,random:ni,seed:ri,paused:ai=!1,suspendWhenHidden:li=!0,heatmapAggregation:ci,heatmapXBins:ui,heatmapYBins:gi,showValues:yi,heatmapValueFormat:mi,marginalGraphics:xi,pointIdAccessor:vi,xScaleType:bi,yScaleType:ki,accessibleTable:wi=!0,description:Ai,summary:Ci,linkedCrosshairName:Si,linkedCrosshairSourceId:Mi,customLayout:Pi,onLayoutError:Yi,layoutConfig:Ri,layoutSelection:Ti}=t,{customHoverBehavior:Ni,customClickBehavior:Wi,hasClickBehavior:Oi}=B({customHoverBehavior:re,customClickBehavior:ae,onObservation:ge,chartId:_e,chartType:"StreamXYFrame"}),Di=Ce().replace(/:/g,""),zi=xe(!1),Li=xe({w:-1,h:-1}),Bi=xe(!1),Ei=le({sizeProp:j,responsiveWidth:U,responsiveHeight:K,userMargin:Q,marginDefault:yo,title:qe,legend:De,legendPosition:Fe,animate:ei,transitionProp:ti,frameScheduler:oi,clock:si,random:ni,seed:ri,paused:ai,suspendWhenHidden:li,themeDirtyRef:zi}),Fi=pe(),Ii=ye(),{reducedMotionRef:Xi,responsiveRef:Vi,size:Gi,currentTheme:Ui,transition:Ki,introEnabled:Zi,tableId:to,rafRef:eo,renderFnRef:io,scheduleRender:oo,frameRuntime:so}=Ei;let no=Ei.margin;if(xi){const t=60,e={...Ei.margin};xi.top&&t>e.top&&(e.top=t),xi.bottom&&t>e.bottom&&(e.bottom=t),xi.left&&t>e.left&&(e.left=t),xi.right&&t>e.right&&(e.right=t),no=e}const ro=Gi[0]-no.left-no.right,ao=Gi[1]-no.top-no.bottom,co=ke(()=>Et(r),[r]),ho=se??Se,[uo,vo]=ve(0),bo=xe(0),[ko,wo]=ve(null),Ao=b(Ge,Gi,no,ko),Co=b(Ve,Gi,no,ko),_o=xe(null),So=xe(null),Mo=xe(void 0),[Po,Yo]=ve(null),Ro=xe(mo.primary),To=xe(function(){let t=-1,e=ji;return{resolve(i){if(!i)return ji;const o=Ft();return o===t||(e=function(t){if(!t)return ji;const e=getComputedStyle(t),i=e.getPropertyValue("--semiotic-border").trim(),o=e.getPropertyValue("--semiotic-text-secondary").trim(),s=e.getPropertyValue("--semiotic-bg").trim(),n=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=s||e.getPropertyValue("--surface-0").trim();return r||a||i||n?{axisStroke:l||ji.axisStroke,tickText:r||ji.tickText,crosshair:r?qi(r,"66"):ji.crosshair,hoverFill:c?qi(c,"4D"):ji.hoverFill,hoverStroke:r?qi(r,"99"):ji.hoverStroke,pointRing:c||ji.pointRing,primary:n||ji.primary,background:c||ji.background}:ji}(i),t=o),e},invalidate(){t=-1}}}()),No=xe(!1),Wo=he("StreamXYFrame"),[Oo,Do]=ve(!1),[zo,Lo]=ve([]),[Bo,Eo]=ve([]),Fo="streaming"===n||["bar","swarm","waterfall"].includes(o),Io=ke(()=>({chartType:o,runtimeMode:Fo?"streaming":"bounded",windowSize:N,windowMode:T,arrowOfTime:Fo?Y:"right",extentPadding:$,scalePadding:G,axisExtent:ee,xAccessor:h,yAccessor:u,accessorRevision:g,timeAccessor:Fo?W:void 0,valueAccessor:P,colorAccessor:d,sizeAccessor:f,symbolAccessor:p,symbolMap:y,groupAccessor:k||(w?"_lineGroup":void 0),categoryAccessor:Ue,lineDataAccessor:w,xScaleType:bi,yScaleType:ki,xExtent:O,yExtent:D,sizeRange:H,binSize:M,normalize:C,baseline:_,stackOrder:S,boundsAccessor:mt,boundsStyle:At,y0Accessor:Ct,band:Pt,gradientFill:x(Yt),areaGroups:Wt?new Set(Wt):void 0,lineGradient:m(Rt),semanticLineStops:Nt,openAccessor:Dt,highAccessor:zt,lowAccessor:Lt,closeAccessor:Bt,candlestickStyle:$t,lineStyle:et,pointStyle:ot,areaStyle:st,swarmStyle:ft,waterfallStyle:dt,colorScheme:yt,barColors:pt,barStyle:ut,annotations:Ye,decay:Je,pulse:Ze,transition:Ki,introAnimation:Zi,staleness:ii,clock:so.now,heatmapAggregation:ci,heatmapXBins:ui,heatmapYBins:gi,showValues:yi,heatmapValueFormat:mi,pointIdAccessor:vi,curve:A,themeCategorical:Ui?.colors?.categorical,themeSemantic:de(Ui),themeSequential:Ui?.colors?.sequential,themeDiverging:Ui?.colors?.diverging,customLayout:Pi,onLayoutError:Yi,layoutConfig:Ri,layoutMargin:no}),[o,Fo,N,T,Y,$,G,ee,h,u,g,W,P,d,f,p,y,k,w,Ue,bi,ki,O,D,H,M,C,_,S,mt,At,Ct,Pt,Yt,Wt,Rt,Nt,Dt,zt,Lt,Bt,$t,et,ot,st,ft,dt,yt,pt,ut,Ye,Je,Ze,Ki,Zi,ii,so.now,ci,ui,gi,yi,mi,vi,A,Ui,Pi,Yi,Ri,no]),Xo=ct(Io),$o=xe(null);$o.current||($o.current=new hi(Xo));const Vo=L($o,Xe,$e,t=>t.getData());at($o,Xo,zi,oo),lt($o,Ti,zi,oo);const Go=xe(null);Go.current||(Go.current=new s(t=>{const e=$o.current;e&&e.ingest(t)&&(zi.current=!0,oo())},{chunkThreshold:a,chunkSize:c})),be(()=>{Go.current?.updateChunkOptions({chunkThreshold:a,chunkSize:c})},[a,c]);const Ho=we(t=>{Go.current?.push(t)},[]),jo=we(t=>{Go.current?.pushMany(t)},[]),qo=we(()=>{Go.current?.clear(),$o.current?.clear(),zi.current=!0,oo()},[oo]);Ae(i,()=>({push:Ho,pushMany:jo,remove:t=>{Go.current?.flush();const e=$o.current?.remove(t)??[];return e.length>0&&(_o.current&&e.some(t=>t===_o.current?.data)&&(_o.current=null,Yo(null)),zi.current=!0,oo()),e},update:(t,e)=>{Go.current?.flush();const i=$o.current?.update(t,e)??[];return i.length>0&&(zi.current=!0,oo()),i},clear:qo,getData:()=>(Go.current?.flush(),$o.current?.getData()??[]),getScales:()=>$o.current?.scales??null,getExtents:()=>$o.current?.getExtents()??null,getCustomLayout:()=>$o.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>$o.current?.lastCustomLayoutFailure??null}),[Ho,jo,qo,oo]),be(()=>{if(r){if(w&&co.length>0&&"object"==typeof co[0]&&null!==co[0]){const t="string"==typeof w?w:"coordinates";if(Array.isArray(co[0][t])){const e=[];for(const i of co){const o=i[t];if(Array.isArray(o)){const t=i.label||i.id||i.key;if(null!=t)for(const i of o)e.push({...i,_lineGroup:t});else for(const t of o)e.push(t)}}return void Go.current?.setBoundedData(e)}}Go.current?.setBoundedData(co)}},[r,co,w]);const{canvasRef:Uo,interactionCanvasRef:Ko}=ce(Ei,{storeRef:$o,dirtyRef:zi,hydrated:Fi,wasHydratingFromSSR:Ii,cleanup:()=>Go.current?.clear(),canvasPaintDependencies:[o,ro,ao,Ht,Z,Ve,et,tt,He,oo]}),{hoverHandlerRef:Qo,hoverLeaveRef:Jo,onPointerMove:Zo,onPointerLeave:ts}=Ei;Qo.current=t=>{if(!ho)return;const e=Uo.current;if(!e)return;const i=e.getBoundingClientRect(),s=t.clientX-i.left-no.left,n=t.clientY-i.top-no.top;if(0>s||s>ro||0>n||n>ao)return void(_o.current&&(_o.current=null,So.current=null,Yo(null),Ni?.(null),oo()));const r=$o.current;if(!r||0===r.scene.length)return;const a=Xt(Me,t.pointerType),l=fi(r.scene,s,n,a,r.quadtree,r.maxPointRadius),c="multi"===Pe,u=()=>{_o.current&&(_o.current=null,So.current=null,Yo(null),Ni&&Ni(null),oo())};if(!l&&!c)return void u();const g=c||!l?s:l.x,d=c||!l?n:l.y,f=l?.datum?R(l.datum,r.resolvedRibbons):{},p=r.scales?.x?.invert,y="function"==typeof p?p(g):void 0;let m=Tt(f,g,d,null!=y?{xValue:y,xPx:g}:void 0);if(c&&r.scene.length>0&&r.scales){const t=function(t,e,i=30){const o=[];for(const s of t)if("line"===s.type){const t=s;if(2>t.path.length)continue;const n=pi(di(t.path,t.curve),e,i);if(null===n)continue;const r=_i(t.path,e);o.push({node:s,datum:Array.isArray(t.datum)&&t.datum[r]?t.datum[r]:t.datum,x:t.path[r][0],y:n,group:t.group,color:t.style.stroke})}else if("area"===s.type){const t=s;if(!1===t.interactive)continue;if(2>t.topPath.length)continue;const n=di(t.topPath,t.curve),r=di(t.bottomPath,t.curve),a=pi(n,e,i);if(null===a)continue;const l=pi(r,e,i),c=_i(t.topPath,e);o.push({node:s,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,ro));if(t.length>0){const e=r.scales.y.invert,i=Ro.current,s=p?p(g):g;if(l)m.xValue=s,m.xPx=g;else{const t={xValue:s};"string"==typeof h&&(t[h]=s),m=Tt(t,g,d,{xValue:s,xPx:g})}m.allSeries=t.map(t=>{const s=e?e(t.y):t.y,n=null!=t.y0?e?e(t.y0):t.y0:void 0;return{group:t.group||"",value:"stackedarea"===o&&null!=n?s-n:s,valuePx:t.y,color:t.color||i,datum:R(t.datum,r.resolvedRibbons)}})}}l||m.allSeries?.length?(_o.current=m,So.current=l?.node??null,Yo(m),Ni?.(m),oo()):u()},Jo.current=()=>{_o.current&&(_o.current=null,So.current=null,Yo(null),Ni?.(null),oo())};const es=xe(()=>{});es.current=t=>{if(Vt(t.target))return;if(!Wi)return;const e=Uo.current;if(!e)return;const i=e.getBoundingClientRect(),o=t.clientX-i.left-no.left,s=t.clientY-i.top-no.top;if(0>o||o>ro||0>s||s>ao)return void Wi(null);const n=$o.current;if(!n||0===n.scene.length)return void Wi(null);const r=Xt(Me,Mo.current),a=fi(n.scene,o,s,r,n.quadtree,n.maxPointRadius);if(!a)return void Wi(null);const l=a.datum||{},c=n.scales?.x?.invert,h="function"==typeof c?c(a.x):void 0;Wi(Tt(l,a.x,a.y,null!=h?{xValue:h,xPx:a.x}:void 0),{type:"activate",inputType:Ut(Mo.current)})};const is=we(t=>es.current(t),[]),{kbFocusIndexRef:os,focusedNavPointRef:ss,onKeyDown:ns}=E({storeRef:$o,hoverRef:_o,hoveredNodeRef:So,setHoverPoint:Yo,customHoverBehavior:Ni,customClickBehavior:Wi,scheduleRender:oo}),rs=we(t=>{Mo.current=t.pointerType,os.current=-1,ss.current=null,Zo(t)},[ss,os,Zo]),as=we(t=>{Mo.current="mouse",os.current=-1,ss.current=null,Zo({clientX:t.clientX,clientY:t.clientY,pointerType:"mouse"})},[ss,os,Zo]),ls=we(t=>{Mo.current=t.pointerType},[]);io.current=()=>{if(eo.current=null,!so.isActive)return;const t=Uo.current,i=Ko.current;if(!t||!i)return;const s=$o.current;if(!s)return;const n=so.now(),r=s.advanceTransition(Xi.current?n+1e6:n),a=!Xi.current&&r,l=Li.current.w!==ro||Li.current.h!==ao,c=zi.current||r||l,g=s.consumeStylePaintPending();let d=!1;const f=s.getLastUpdateResult(),p=Wo.current.beforeCompute(f,a);!c||a&&!l||(s.computeScene({width:ro,height:ao}),Li.current={w:ro,h:ao},d=!0,Vo()),Wo.current.afterCompute(p,d,l);const y=z(s,n,d,Bi),m=It(),x=To.current.resolve(t);Ro.current=x.primary;const v=rt(ii,s.lastIngestTime>0?n-s.lastIngestTime:0),b=ii&&v.isStale;if(c||g||y.changed){const e=Kt(t,Gi,no,m);if(e){if(e.clearRect(-no.left,-no.top,Gi[0],Gi[1]),ii&&1>v.alpha&&(e.globalAlpha=v.alpha),I(e,{background:Z,hasBackgroundGraphics:!!Ve,themeBackground:x.background,x:-no.left,y:-no.top,width:Gi[0],height:Gi[1]}),e.save(),"function"==typeof e.rect&&(e.beginPath(),e.rect(0,0,ro,ao),e.clip()),He&&s.scales)for(const t of He)e.save(),t(e,s.scene,s.scales,{width:ro,height:ao}),e.restore();const t=Pi?lo.custom:lo[o];it({context:e,nodes:s.scene,renderMode:tt,pixelRatio:m,paintBuiltIn:i=>{if(t&&s.scales)for(const o of t)o(e,i,s.scales,{width:ro,height:ao})}}),e.restore(),ii&&1>v.alpha&&(e.globalAlpha=1)}}const k=!!(ho&&_o.current&&s.scales),w=!!(So.current&&Array.isArray(se)&&se.some(t=>t&&"object"==typeof t&&"highlight"===t.type)),A=k||w;if(F(A,No.current)){const t=Kt(i,Gi,no,m);if(t&&(t.clearRect(-no.left,-no.top,Gi[0],Gi[1]),k&&_o.current&&function(t,i,o,s,n,r,a){if(!1===n.crosshair)return;const l=i.allSeries,c=l&&l.length>0,h=i.xPx??i.x;t.save();const u="object"==typeof n.crosshair?n.crosshair:{};if(t.strokeStyle=u.stroke||a.crosshair,t.lineWidth=u.strokeWidth||1,t.setLineDash(u.strokeDasharray?u.strokeDasharray.split(/[\s,]+/).map(Number):[4,4]),t.beginPath(),t.moveTo(c?h:i.x,0),t.lineTo(c?h:i.x,s),t.stroke(),c||(t.beginPath(),t.moveTo(0,i.y),t.lineTo(o,i.y),t.stroke()),t.restore(),c){t.lineWidth=2,t.strokeStyle=a.pointRing;for(const e of l)null!=e.valuePx&&(t.beginPath(),t.arc(h,e.valuePx,4,0,2*Math.PI),t.fillStyle=e.color||a.primary,t.fill(),t.stroke())}else{const o=n.pointColor||e(r)||a.primary;t.beginPath(),t.arc(i.x,i.y,4,0,2*Math.PI),t.fillStyle=o,t.fill(),t.strokeStyle=a.pointRing,t.lineWidth=2,t.stroke()}}(t,_o.current,ro,ao,"object"==typeof ho?ho:{},So.current,x),w&&So.current&&Array.isArray(se))){const e=se.find(t=>t&&"object"==typeof t&&"highlight"===t.type);e&&function(t,e,i,o,s){if(!i)return;const n="group"in i?i.group:void 0;if(void 0!==n)for(const i of e){if("line"!==i.type)continue;if(i.group!==n)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||s.primary,t.lineWidth=e.strokeWidth||(i.style.strokeWidth||2)+2,t.globalAlpha=e.opacity??1,t.stroke(),t.restore()}}(t,s.scene,So.current,e,x)}No.current=A}c&&t&&t.setAttribute("aria-label",Ot(s.scene,o+" chart"));const C=zi.current;if(zi.current=C&&a&&!d,C&&s.scales){const t=t=>"object"==typeof t&&null!==t&&"function"==typeof t.valueOf?t.valueOf():t;if((!ko||t(ko.x.domain()[0])!==t(s.scales.x.domain()[0])||t(ko.x.domain()[1])!==t(s.scales.x.domain()[1])||t(ko.y.domain()[0])!==t(s.scales.y.domain()[0])||t(ko.y.domain()[1])!==t(s.scales.y.domain()[1])||ko.x.range()[0]!==s.scales.x.range()[0]||ko.x.range()[1]!==s.scales.x.range()[1]||ko.y.range()[0]!==s.scales.y.range()[0]||ko.y.range()[1]!==s.scales.y.range()[1])&&wo(s.scales),xi){const t=s.getData(),e="function"==typeof h?h:t=>t[h||"x"],i="function"==typeof u?u:t=>t[u||"y"];Lo(t.map(t=>e(t)).filter(t=>"number"==typeof t&&isFinite(t))),Eo(t.map(t=>i(t)).filter(t=>"number"==typeof t&&isFinite(t)))}}!((Ye&&Ye.length>0||Pi)&&(d||a))||!d&&33>n-bo.current||(vo(t=>t+1),bo.current=n),ii?.showBadge&&Do(!!b),(a||null!=s.activeTransition||y.pending)&&oo()},ht(ii,$o,zi,oo,Oo,Do);const cs=ke(()=>{if(Zt||ie)return;const t=$o.current;return t?.xIsDate&&ko?Qi(ko.x.domain()):void 0},[Zt,ie,ko]),hs=Zt||ie||cs,us=ho&&Po?ne?ne(Po):fo(go,{hover:Po}):null,gs=us?fo(kt,{x:Po.x,y:Po.y,containerWidth:ro,containerHeight:ao,margin:no,className:"stream-frame-tooltip",children:us}):null,ds=ss.current,fs=fo(wt,{active:os.current>=0,hoverPoint:Po,margin:no,size:Gi,shape:ds?.shape,width:ds?.w,height:ds?.h}),ps=v(h,W,"__semiotic_resolvedX","__semiotic_resolvedTime"),ys=v(u,P,"__semiotic_resolvedY","__semiotic_resolvedValue"),ms=ps.key,xs=ys.key,vs=l(ps,ys,Ye&&Ye.length>0||!1);if(Gt||!Fi&&Ii){const t=$o.current;t&&r&&(t.ingest({inserts:co,bounded:!0}),t.computeScene({width:ro,height:ao}));const e=t?.scene??[],i=t?.scales??null,o=b(Ge,Gi,no,i),s=b(Ve,Gi,no,i),n=hs||(()=>{if(t?.xIsDate&&i)return Qi(i.x.domain())})();return po("div",{ref:Vi,className:"stream-xy-frame"+(J?" "+J:""),role:"img","aria-label":Ai||("string"==typeof qe?qe:"XY chart"),style:{position:"relative",width:U?"100%":Gi[0],height:K?"100%":Gi[1]},children:[fo(St,{summary:Ci}),po("svg",{xmlns:"http://www.w3.org/2000/svg",width:Gi[0],height:Gi[1],style:{position:"absolute",left:0,top:0},children:[fo("g",{transform:`translate(${no.left},${no.top})`,children:s}),po("g",{transform:`translate(${no.left},${no.top})`,children:[Z&&fo("rect",{x:0,y:0,width:ro,height:ao,fill:Z}),je&&i&&je.map((t,o)=>fo(me.Fragment,{children:t(e,i,{width:ro,height:ao})},"svgpre-"+o)),e.map((t,e)=>nt({node:t,index:e,renderMode:tt,fallback:()=>ue(t,e,Di)})).filter(Boolean)]})]}),fo(Hi,{width:ro,height:ao,totalWidth:Gi[0],totalHeight:Gi[1],margin:no,scales:i,showAxes:Ht,axes:jt,xLabel:qt,yLabel:Qt,yLabelRight:Jt,xFormat:n,yFormat:te||oe,axisExtent:ee,showGrid:Oe,title:qe,legend:De,legendHoverBehavior:ze,legendClickBehavior:Le,legendHighlightedCategory:Be,legendIsolatedCategories:Ee,legendPosition:Fe,legendLayout:Ie,foregroundGraphics:q(o,gt($o.current?.customLayoutOverlays,Ti??null)),marginalGraphics:xi,xValues:[],yValues:[],annotations:Ye,onAnnotationActivate:Re,onObservation:fe??ge,chartId:_e,chartType:"StreamXYFrame",autoPlaceAnnotations:Ne,svgAnnotationRules:We,annotationFrame:0,xAccessor:ms,yAccessor:xs,annotationData:vs($o.current?.getData()),pointNodes:Ji($o.current?.scene),curve:"string"==typeof A?A:void 0,linkedCrosshairName:Si,linkedCrosshairSourceId:Mi})]})}return po("div",{ref:Vi,className:"stream-xy-frame"+(J?" "+J:""),role:"group","aria-label":Ai||("string"==typeof qe?qe:"XY chart"),tabIndex:0,style:{position:"relative",width:U?"100%":Gi[0],height:K?"100%":Gi[1],overflow:"visible",touchAction:xo(Ke)},onKeyDown:ns,children:["production"!==process.env.NODE_ENV&&$o.current&&fo(_t,{store:$o.current,diagnostics:Wo.current}),wi&&fo(Mt,{tableId:to}),wi&&fo(xt,{scene:$o.current?.scene??[],chartType:o+" chart",tableId:to,chartTitle:"string"==typeof qe?qe:void 0}),fo(St,{summary:Ci}),fo(vt,{hoverPoint:Po}),po("div",{role:"img","aria-label":Ai||("string"==typeof qe?qe:"XY chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:ho?rs:void 0,onMouseMove:ho?as:void 0,onPointerLeave:ho?ts:void 0,onMouseLeave:ho?ts:void 0,onPointerDown:ho||Oi?ls:void 0,onClick:Oi?is:void 0,children:[fo(bt,{size:Gi,margin:no,children:Co}),fo($i,{width:ro,height:ao,totalWidth:Gi[0],totalHeight:Gi[1],margin:no,scales:ko,showAxes:Ht,axes:jt,showGrid:Oe,xFormat:hs,yFormat:te||oe,axisExtent:ee}),fo("canvas",{ref:Uo,"aria-label":Ot($o.current?.scene??[],o+" chart"),style:{position:"absolute",left:0,top:0}}),fo("canvas",{ref:Ko,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),fo(Hi,{width:ro,height:ao,totalWidth:Gi[0],totalHeight:Gi[1],margin:no,scales:ko,showAxes:Ht,axes:jt,xLabel:qt,yLabel:Qt,yLabelRight:Jt,xFormat:hs,yFormat:te||oe,axisExtent:ee,showGrid:Oe,title:qe,legend:De,legendHoverBehavior:ze,legendClickBehavior:Le,legendHighlightedCategory:Be,legendIsolatedCategories:Ee,legendPosition:Fe,legendLayout:Ie,foregroundGraphics:q(Ao,gt($o.current?.customLayoutOverlays,Ti??null)),marginalGraphics:xi,xValues:zo,yValues:Bo,annotations:Ye,onAnnotationActivate:Re,onObservation:fe??ge,chartId:_e,chartType:"StreamXYFrame",autoPlaceAnnotations:Ne,svgAnnotationRules:We,annotationFrame:uo,xAccessor:ms,yAccessor:xs,annotationData:vs($o.current?.getData()),pointNodes:Ji($o.current?.scene),curve:"string"==typeof A?A:void 0,underlayRendered:!0,canvasObscuresUnderlay:!!X({background:Z,hasBackgroundGraphics:!!Ve,themeBackground:Ui?.colors.background}),linkedCrosshairName:Si,linkedCrosshairSourceId:Mi}),(Ke||Qe)&&fo(Te,{width:ro,height:ao,totalWidth:Gi[0],totalHeight:Gi[1],margin:no,dimension:Ke?.dimension??"xy",scales:ko,onBrush:Qe??(()=>{}),binSize:M,snap:Ke?.snap,binBoundaries:Ke?.binBoundaries??("bar"===o?$o.current?.getBinBoundaries():void 0),snapDuring:Ke?.snapDuring,streaming:"streaming"===n}),ii?.showBadge&&fo(V,{isStale:Oo,position:ii.badgePosition}),fs,gs]})]})}));vo.displayName="StreamXYFrame";var bo=vo;export{bo as StreamXYFrame_default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resolveCSSColor as t}from"./chunk-chunk-IY7RYD4S.module.min.js";import{createStore as e}from"./chunk-chunk-HADHLMY5.module.min.js";var i=class{constructor(t){if(this._capacity=t,this.head=0,this._size=0,1>t)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(t)}push(t){let e;return this._size===this._capacity?e=this.buffer[this.head]:this._size++,this.buffer[this.head]=t,this.head=(this.head+1)%this._capacity,e}pushMany(t){const e=[];for(const i of t){const t=this.push(i);void 0!==t&&e.push(t)}return e}get(t){if(t>=0&&this._size>t)return this.buffer[(this.head-this._size+t+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let t=0;return{next:()=>this._size>t?{done:!1,value:this.get(t++)}:{done:!0,value:void 0}}}forEach(t){const e=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;this._size>i;i++)t(this.buffer[(e+i)%this._capacity],i)}toArray(){const t=Array(this._size),e=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;this._size>i;i++)t[i]=this.buffer[(e+i)%this._capacity];return t}resize(t){if(1>t)throw Error("RingBuffer capacity must be at least 1");const e=this.toArray();let i=0,n=[];e.length>t&&(i=e.length-t,n=e.slice(0,i)),this._capacity=t,this.buffer=Array(t),this.head=0,this._size=0;for(let t=i;e.length>t;t++)this.push(e[t]);return n}update(t,e){const i=[],n=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;this._size>r;r++){const a=(n+r)%this._capacity,o=this.buffer[a];if(t(o)){let t;t="object"!=typeof o||null===o?o:Array.isArray(o)?[...o]:{...o},i.push(t),this.buffer[a]=e(o)}}return i}remove(t){const e=[],i=[];if(this.forEach(n=>{t(n)?i.push(n):e.push(n)}),0===i.length)return i;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const t of e)this.push(t);return i}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},n=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(t){Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}evict(t){t!==this._min&&t!==this._max||(this._dirty=!0)}recalculate(t,e){this._min=1/0,this._max=-1/0;for(const i of t){const t=e?e(i):i;Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}};function r(t,e,i){return i.x>t||t>i.x+i.w||i.y>e||e>i.y+i.h?{hit:!1,cx:0,cy:0}:{hit:!0,cx:i.x+i.w/2,cy:i.y+i.h/2}}function a(t,e=30){return Math.max((t??4)+5,12,e)}function o(t){return t instanceof Date?t:"number"==typeof t&&t>1e9?new Date(t):null}function s(t,e){const i=o(t);if(!i)return!1;const n=o(e);return!n||i.getFullYear()!==n.getFullYear()||i.getMonth()!==n.getMonth()}function l(t){let e=t%(2*Math.PI);return 0>e&&(e+=2*Math.PI),e}function c(t){return{type:"hatch",background:t.background,stroke:t.stroke,lineWidth:t.lineWidth,spacing:t.spacing,angle:t.angle}}var u=null;function h(t={},e){const{background:i="transparent",stroke:n="#000",lineWidth:r=1.5,spacing:a=6,angle:o=45}=t,s={background:i,stroke:n,lineWidth:r,spacing:a,angle:o},l=Math.max(8,Math.ceil(2*a));let h;try{h=function(t){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(t,t):(u||(u=document.createElement("canvas")),u.width=t,u.height=t,u)}(l)}catch{return c(s)}const f=h.getContext("2d");if(!f)return c(s);i&&"transparent"!==i?(f.fillStyle=i,f.fillRect(0,0,l,l)):f.clearRect(0,0,l,l),f.strokeStyle=n,f.lineWidth=r,f.lineCap="square";const p=o*Math.PI/180;if(45===o||-45===o){const t=o>0?1:-1;for(let e=-l;2*l>=e;e+=a)f.beginPath(),f.moveTo(e,0),f.lineTo(e+t*l,l),f.stroke()}else{f.save(),f.translate(l/2,l/2),f.rotate(p);const t=2*l;for(let e=-t;t>=e;e+=a)f.beginPath(),f.moveTo(-t,e),f.lineTo(t,e),f.stroke();f.restore()}return(e||f).createPattern(h,"repeat")}import{jsx as f,jsxs as p}from"react/jsx-runtime";function d(t){return"object"==typeof t&&null!==t&&"hatch"===t.type}function y(t){return["hatch",t.background??"transparent",t.stroke??"#000",t.lineWidth??1.5,t.spacing??6,t.angle??45,t.lineOpacity??1].join("|")}function m(t,e){let i=2166136261;const n=y(e);for(let t=0;n.length>t;t++)i^=n.charCodeAt(t),i=Math.imul(i,16777619);return`${t}-hatch-${(i>>>0).toString(36)}`}var b=new Map;function g(e,i){const n=e.background??"transparent",r=e.stroke??"#000",a="transparent"===n||"none"===n?n:t(i,n)||n,o=t(i,r)||r||"#000",s="undefined"!=typeof window&&window.devicePixelRatio||1,l=`${y(e)}|${a}|${o}@${s}`,c=b.get(l);if(void 0!==c)return c;const u=h({background:a,stroke:o,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle},i),f=d(u)?null:u;return b.set(l,f),f}function v(t,e){const{background:i="transparent",stroke:n="#000",lineWidth:r=1.5,spacing:a=6,angle:o=45,lineOpacity:s=1}=t,l=Math.max(8,Math.ceil(2*a));return p("pattern",{id:e,width:l,height:l,patternUnits:"userSpaceOnUse",patternTransform:0!==o?`rotate(${o})`:void 0,children:[i&&"transparent"!==i&&f("rect",{width:l,height:l,fill:i}),f("line",{x1:0,y1:0,x2:0,y2:l,stroke:n,strokeWidth:r,strokeOpacity:s}),f("line",{x1:a,y1:0,x2:a,y2:l,stroke:n,strokeWidth:r,strokeOpacity:s})]},e)}function x(t,e,i="#4e79a7"){if(d(t)){const i=m(e,t);return{fill:`url(#${i})`,def:v(t,i)}}return t&&"string"==typeof t?{fill:t}:{fill:i}}function _(t,e){return"touch"===e?Math.max(t,24):t}function k(t){return Array.isArray(t)?t[0]:t}function w(t,e,i,n){return{data:k(t),x:e,y:i,__semioticHoverData:!0,...n}}var A=["name","label","title"],N=["type","kind","category","group","class","status","role","shape"],z=["value","amount","total","count","weight","score"],S=new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]);function O(t,e){for(const i of e){const e=t.find(t=>t.lower===i);if(e)return e}}function W(t,e={}){if(!t||"object"!=typeof t)return{entries:[]};const i=e.maxEntries??6,n=!1!==e.skipPositional,r=[];for(const[e,i]of Object.entries(t)){if(e.startsWith("_"))continue;if("data"===e)continue;if(n&&S.has(e.toLowerCase()))continue;if(null==i)continue;const t=typeof i;("string"===t||"number"===t||"boolean"===t||i instanceof Date)&&r.push({key:e,lower:e.toLowerCase(),value:i})}if(0===r.length)return{entries:[]};let a=r.findIndex(t=>A.includes(t.lower));const o=a>=0;0>a&&(a=r.findIndex(t=>"id"===t.lower)),0>a&&(a=r.findIndex(t=>"string"==typeof t.value));const s=0>a?void 0:r[a];let l=r.filter((t,e)=>e!==a);o&&(l=l.filter(t=>"id"!==t.lower));const c=O(l,N),u=O(l,z),h=new Set(N),f=new Set(z),p=[];c&&p.push({key:c.key,value:c.value}),u&&p.push({key:u.key,value:u.value});for(const t of l){if(p.length>=i)break;t!==c&&t!==u&&(h.has(t.lower)||f.has(t.lower)||p.push({key:t.key,value:t.value}))}return{titleKey:s?.key,title:s?.value,entries:p}}import{jsx as j,jsxs as M}from"react/jsx-runtime";var I={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};function C(t,e){return"function"==typeof e?e(t):t[e]}function E(t,e){if(e)return e(t);if(null==t)return"";if("number"==typeof t){if(!Number.isFinite(t))return t+"";const e=Number.isInteger(t)?t:parseFloat(t.toPrecision(6));return Math.abs(e)>9999?e.toLocaleString():e+""}return t instanceof Date?t.toLocaleDateString():"object"==typeof t&&null!==t?void 0!==t.id?t.id+"":void 0!==t.name?t.name+"":JSON.stringify(t):t+""}function D(t={}){const{fields:e,title:i,format:n,style:r={},className:a=""}=t;return t=>{if(!t||"object"!=typeof t)return null;let o;const s=[];if(i){const e=C(t,i);o=E(e,n)}if(e&&e.length>0)e.forEach(e=>{let i,r,a;"string"==typeof e?(i=e,r=e,a=n):(i=e.label,r=e.accessor||e.key||"",a=e.format||n);const o=C(t,r);s.push({label:i,value:E(o,a)})});else if(!i){const e=["value","y","name","id","label"];for(const i of e)if(void 0!==t[i]){o=E(t[i],n);break}if(!o){const e=Object.keys(t).filter(t=>!t.startsWith("_"));e.length>0&&(o=E(t[e[0]],n))}}const l={...I,...r};return M("div",{className:("semiotic-tooltip "+a).trim(),style:l,children:[o&&j("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:o}),s.map((t,e)=>M("div",{style:{marginTop:0===e&&o?"4px":0},children:[t.label&&M("span",{children:[t.label,": "]}),t.value]},e))]})}}function R(){return t=>{const e=t.allSeries;if(!e||0===e.length)return j("div",{className:"semiotic-tooltip",style:I,children:j("div",{children:E(t.data?.value??t.data?.y)})});const i=t.xValue??t.data?.time??t.data?.x;return M("div",{className:"semiotic-tooltip",style:I,children:[null!=i&&j("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:E(i)}),e.map((t,e)=>M("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[j("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:t.color,flexShrink:0}}),j("span",{style:{flex:1,fontSize:"0.85em"},children:t.group}),j("span",{style:{fontWeight:500,fontSize:"0.85em"},children:E(t.value)})]},e))]})}}function T(t){if(!0!==t){if("function"==typeof t){const e=t;return t=>{const i=!0===t?.__semioticHoverData||t&&void 0!==t.data&&"number"==typeof t.x&&"number"==typeof t.y&&t&&("node"===t.type||"edge"===t.type||void 0!==t.nodeOrEdge||void 0!==t.allSeries||void 0!==t.stats||void 0!==t.__chartType);let n=k(i?t.data??{}:t);if(!n)return null;if(("node"===t?.nodeOrEdge&&"number"==typeof n?.x0&&"number"==typeof n?.x1||"edge"===t?.nodeOrEdge&&"number"==typeof n?.sankeyWidth)&&n.data&&"object"==typeof n.data&&(n=n.data),!n)return null;if(i&&(void 0!==t.allSeries||void 0!==t.xValue)){const e={...n};void 0!==t.allSeries&&void 0===e.allSeries&&(e.allSeries=t.allSeries),void 0!==t.xValue&&void 0===e.xValue&&(e.xValue=t.xValue),n=e}const r=e(n);return null==r?null:j("div",{className:"semiotic-tooltip",style:I,children:r})}}return!1!==t&&void 0!==t&&("object"==typeof t&&null!==t&&("fields"in t||"title"in t)?D(t):"multi"===t?("undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip — prefer charts that set tooltipMode (LineChart, AreaChart, StackedAreaChart, DifferenceChart). Rendering MultiLineTooltip content as a fallback.'),function(t={}){const{fields:e=[],title:i,format:n,style:r={},className:a="",showLabels:o=!0,separator:s=": "}=t;return t=>{if(!t||"object"!=typeof t)return null;const l=[];if(i){const e=C(t,i);l.push({value:E(e,n)})}if(e&&Array.isArray(e)&&e.length>0)e.forEach(e=>{let i,r,a;"string"==typeof e?(i=e,r=e,a=n):(i=e.label,r=e.accessor||e.key||"",a=e.format||n);const s=E(C(t,r),a);l.push({label:o?i:void 0,value:s})});else{const e=W(t,{skipPositional:!1});null!=e.title&&l.push({label:void 0,value:E(e.title,n),bold:!0}),e.entries.forEach(t=>{l.push({label:o?t.key:void 0,value:E(t.value,n)})})}const c={...I,...r};return Array.isArray(l)&&0!==l.length?j("div",{className:("semiotic-tooltip semiotic-tooltip-multiline "+a).trim(),style:c,children:l.map((t,e)=>M("div",{style:{marginBottom:l.length-1>e?"4px":0,fontWeight:t.bold?"bold":void 0},children:[t.label&&M("strong",{children:[t.label,s]}),t.value]},e))}):null}}()):D())}}function P(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}function F(t,e){const{when:i}=t,n=e.width,r=e.height,a=function(t){if("number"==typeof t.height&&t.height>0)return t.width/t.height}(e),o=function(t){if("number"==typeof t.height&&t.height>0)return t.height>t.width?"portrait":"landscape"}(e);return!("number"==typeof i.minWidth&&i.minWidth>n||"number"==typeof i.maxWidth&&n>i.maxWidth||"number"==typeof i.minHeight&&("number"!=typeof r||i.minHeight>r)||"number"==typeof i.maxHeight&&("number"!=typeof r||r>i.maxHeight)||"number"==typeof i.minAspectRatio&&("number"!=typeof a||i.minAspectRatio>a)||"number"==typeof i.maxAspectRatio&&("number"!=typeof a||a>i.maxAspectRatio)||i.orientation&&o!==i.orientation)}function $(t,e,i=t.responsiveRules){if(!Array.isArray(i)||0===i.length)return{props:t,matches:[]};const n=i.map((t,e)=>({rule:t,index:e})).filter(t=>F(t.rule,e)).sort((t,e)=>("number"==typeof t.rule.priority?t.rule.priority:t.index)-("number"==typeof e.rule.priority?e.rule.priority:e.index));return{props:n.reduce((t,e)=>function(t,e){const i={...t,...e};for(const n of["margin","frameProps","mobileSemantics","style"])P(t[n])&&P(e[n])&&(i[n]={...t[n],...e[n]});return"string"==typeof t.className&&"string"==typeof e.className&&(i.className=`${t.className} ${e.className}`),i}(t,e.rule.transform),t),matches:n}}var H=/^\d{4}-\d{1,2}$/;function L(t){const e=t.trim();if(!e||!Number.isNaN(Number(e)))return NaN;const i=H.test(e)?e+"-01":e;if(i===e&&10>e.length)return NaN;const n=Date.parse(i);return Number.isFinite(n)?n:NaN}function V(t){return t instanceof Date?t.getTime():"string"==typeof t?L(t):+t}import*as B from"react";var[Y,U]=e(t=>({observations:[],maxObservations:100,version:0,pushObservation(e){t(t=>{const i=t.observations;return i.push(e),i.length>t.maxObservations&&i.shift(),{version:t.version+1}})},clearObservations(){t(()=>({observations:[],version:0}))}}));function q(t){const e=U(t=>t.pushObservation),i=B.useCallback(i=>{t.onObservation?.(i),e?.(i)},[t,e]);return B.useMemo(()=>({...t,onObservation:i}),[i,t])}function J(t){const e=t.provenance,i=t.id??t.stableId??e?.stableId;return null==i||""===i?void 0:i+""}function K(t,e={}){const i=J(t);return{"data-semiotic-annotation-widget":"",...i?{"data-semiotic-annotation-id":i}:{},onClickCapture(n){const r=function(t){const e=t.nativeEvent;return"touch"===e.pointerType?"touch":0===e.detail?"keyboard":"pointer"}(n);e.onAnnotationActivate?.({annotation:t,annotationId:i,chartId:e.chartId,inputType:r}),i&&e.onObservation&&e.onObservation({type:"annotation-activate",annotationId:i,inputType:r,timestamp:Date.now(),chartType:e.chartType??"unknown",chartId:e.chartId})}}}function G(t){return t instanceof Element&&null!=t.closest("[data-semiotic-annotation-widget]")}function Q(t){const e={};if(null==t||"object"!=typeof t)return e;for(const[i,n]of Object.entries(t))i.startsWith("_")||null!=n&&""!==n&&("number"==typeof n?Number.isFinite(n)&&(e[i]=n):"string"==typeof n?e[i]=n:"boolean"==typeof n?e[i]=n+"":n instanceof Date&&(e[i]=n.toISOString().slice(0,10)));return e}function X(t){return t&&"object"==typeof t?t:{}}function Z(t){return X(t.accessibility).tableFields??t.accessibleDatum??t.datum}function tt(t){const e=[];if(!Array.isArray(t))return e;const i=t.some(t=>t&&("line"===t.type||"area"===t.type));for(const n of t)if(n&&"object"==typeof n&&null!==n.datum)try{switch(n.type){case"point":if(i)break;e.push({label:"Point",values:Q(Z(n))});break;case"line":case"area":{const t=Z(n),i=Array.isArray(t)?t:[],r="line"===n.type?"Line point":"Area point";for(const t of i)e.push({label:r,values:Q(t)});break}case"rect":{const t=Z(n),i=null!=t&&"object"==typeof t?t:{},r=i.category??n.group??"",a=i.value??i.__aggregateValue??i.total,o=Q(i);null==o.category&&""!==r&&(o.category=r+""),null==o.value&&null!=a&&(o.value="number"==typeof a||"string"==typeof a?a:a+""),e.push({label:"Bar",values:o});break}case"heatcell":{const t=Q(Z(n));null==t.value&&"number"==typeof n.value&&Number.isFinite(n.value)&&(t.value=n.value),e.push({label:"Cell",values:t});break}case"wedge":{const t=Z(n),i=Q(t);if(null==i.category){const e=X(t),n=e.category??e.label;null!=n&&(i.category=n+"")}e.push({label:"Wedge",values:i});break}case"circle":e.push({label:"Node",values:Q(Z(n))});break;case"arc":e.push({label:"Arc",values:Q(Z(n))});break;case"candlestick":e.push({label:"Candlestick",values:Q(Z(n))});break;case"geoarea":{const t=X(Z(n)),i=Q(t);if(null==i.name){const e=X(t.properties).name??t.name;null!=e&&(i.name=e+"")}e.push({label:"Region",values:i});break}}}catch{}return e}export{i as RingBuffer,n as IncrementalExtent,L as parseDateLikeString,V as coerceDateLikeValue,r as hitTestRect,a as getHitRadius,s as isTimeLandmark,l as normalizeAngle,h as createHatchPattern,d as isHatchFill,y as hatchFillKey,m as hatchFillId,g as resolveHatchCanvasPattern,v as hatchPatternDef,x as resolveSvgFill,U as useObservationSelector,q as useAnnotationActivationOptions,J as annotationStableId,K as annotationActivationProps,G as isAnnotationActivationTarget,tt as extractAllRows,_ as getPointerHitRadius,w as buildHoverData,W as smartTooltipEntries,I as defaultTooltipStyle,R as MultiPointTooltip,T as normalizeTooltip,F as responsiveRuleMatches,$ as resolveResponsiveRules};
|