semiotic 3.13.2 → 3.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -46
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/dist/mcp-server.js +4 -4
- package/ai/reference.md +23 -12
- package/ai/schema.json +258 -96
- package/ai/surface-manifest.json +1 -1
- package/ai/task-packets/compare-category-totals.json +5 -5
- package/ai/task-packets/compare-category-totals.md +2 -2
- package/ai/task-packets/correct-published-chart.json +5 -5
- package/ai/task-packets/correct-published-chart.md +2 -2
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +5 -5
- package/ai/task-packets/update-live-chart.md +2 -2
- package/dist/c-2YFVDRU4.min.js +1 -0
- package/dist/c-4OVDIXAR.min.js +1 -0
- package/dist/c-57IIWW46.min.js +1 -0
- package/dist/c-62UTMRQE.min.js +1 -0
- package/dist/c-6QV6F3U7.min.js +1 -0
- package/dist/c-7S46KBYD.min.js +2 -0
- package/dist/c-AJSS332Z.min.js +2 -0
- package/dist/c-B3X2IJRQ.min.js +1 -0
- package/dist/c-BLLDBVFK.min.js +38 -0
- package/dist/c-C7TT4J7K.min.js +1 -0
- package/dist/{c-ZMB3VTD4.min.js → c-CJ5GA7DM.min.js} +1 -1
- package/dist/c-D7YDFHLY.min.js +1 -0
- package/dist/{c-BR2TOCUN.min.js → c-DMDFJQU4.min.js} +1 -1
- package/dist/{c-JDU4Y4IW.min.js → c-FRVHZIGR.min.js} +1 -1
- package/dist/{c-MSZ3ZDAP.min.js → c-HAZCVHI7.min.js} +1 -1
- package/dist/c-HN5U72U7.min.js +1 -0
- package/dist/c-JA5F7ITS.min.js +1 -0
- package/dist/{c-ISHYKYII.min.js → c-JVZRD4GL.min.js} +1 -1
- package/dist/{c-OOR2LN4A.min.js → c-KJGJEOSV.min.js} +1 -1
- package/dist/c-M2TPZE7P.min.js +1 -0
- package/dist/c-OA6RJZ7S.min.js +1 -0
- package/dist/c-OBBSIOYU.min.js +1 -0
- package/dist/{c-SQQZPFVY.min.js → c-QPHM7AWW.min.js} +1 -1
- package/dist/{c-HOMJ3C6B.min.js → c-QSEAAHEU.min.js} +1 -1
- package/dist/c-RQWI623R.min.js +1 -0
- package/dist/{c-WFSEQ2XG.min.js → c-RWFADOKS.min.js} +1 -1
- package/dist/{c-SDGGMIYI.min.js → c-TJGC5JEM.min.js} +1 -1
- package/dist/{c-H5THWQI4.min.js → c-TOXWQRXS.min.js} +3 -3
- package/dist/c-VBDWHTC7.min.js +1 -0
- package/dist/c-VBIPDCE7.min.js +1 -0
- package/dist/c-WTNRBWZZ.min.js +51 -0
- package/dist/{c-3GIPT46Z.min.js → c-XG4LL2VI.min.js} +1 -1
- package/dist/c-XPNBS3W2.min.js +1 -0
- package/dist/c-XT3G3YWU.min.js +1 -0
- package/dist/c-ZP6O6UHV.min.js +1 -0
- package/dist/c-ZVL7ULNH.min.js +1 -0
- package/dist/components/ChartErrorBoundary.d.ts +5 -1
- package/dist/components/ai/intentWeights.d.ts +22 -0
- package/dist/components/ai/streamSchema.d.ts +98 -0
- package/dist/components/ai/streamingTypes.d.ts +27 -4
- package/dist/components/ai/suggestCharts.d.ts +10 -2
- package/dist/components/ai/suggestStreamCharts.d.ts +60 -13
- package/dist/components/ai/suggestStreamDashboard.d.ts +9 -1
- package/dist/components/charts/network/processSankey/frameMargins.d.ts +1 -1
- package/dist/components/charts/network/processSankey/labelPlacement.d.ts +1 -1
- package/dist/components/charts/physics/physicsHocUtils.d.ts +1 -1
- package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +7 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +9 -2
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +13 -1
- package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +7 -1
- package/dist/components/charts/realtime/TemporalHistogram.capability.d.ts +5 -3
- package/dist/components/charts/realtime/aggregate.d.ts +11 -12
- package/dist/components/charts/realtime/defaultRealtimeTooltip.d.ts +9 -0
- package/dist/components/charts/realtime/eventTime.d.ts +7 -1
- package/dist/components/charts/realtime/useRealtimeLineIngestion.d.ts +13 -0
- package/dist/components/charts/shared/ChartError.d.ts +4 -6
- package/dist/components/charts/shared/GaugeReadout.d.ts +39 -4
- package/dist/components/charts/shared/axisExtent.d.ts +2 -1
- package/dist/components/charts/shared/chartMode.d.ts +2 -2
- package/dist/components/charts/shared/gaugeLayout.d.ts +69 -0
- package/dist/components/charts/shared/types.d.ts +3 -0
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useStreamStatus.d.ts +2 -2
- package/dist/components/charts/shared/withChartErrorBoundary.d.ts +14 -0
- package/dist/components/charts/xy/Scatterplot.streamCapability.d.ts +2 -0
- package/dist/components/charts/xy/WaterfallChart.d.ts +2 -0
- package/dist/components/charts/xy/WaterfallIndex.d.ts +12 -0
- package/dist/components/charts/xy/lineGapStrategy.d.ts +15 -3
- package/dist/components/legendGeometry.d.ts +148 -0
- package/dist/components/legendLayout.d.ts +20 -38
- package/dist/components/realtime/ReorderBuffer.d.ts +14 -0
- package/dist/components/realtime/SlidingExtent.d.ts +18 -0
- package/dist/components/realtime/WindowAccumulator.d.ts +5 -1
- package/dist/components/realtime/renderers/types.d.ts +1 -0
- package/dist/components/realtime/renderers/waterfallRenderer.d.ts +1 -1
- package/dist/components/recipes/compositional/edgeRouting.d.ts +9 -0
- package/dist/components/recipes/compositional/metrics.d.ts +2 -2
- package/dist/components/recipes/compositional/projection.d.ts +3 -1
- package/dist/components/recipes/compositional/routing.d.ts +3 -1
- package/dist/components/recipes/compositional/testFixtures.d.ts +4 -0
- package/dist/components/recipes/compositional/topology.d.ts +2 -0
- package/dist/components/recipes/compositional/types.d.ts +10 -1
- package/dist/components/recipes/compositional/useCompositionalInterfaces.d.ts +20 -0
- package/dist/components/semiotic-ai-core.d.ts +3 -2
- package/dist/components/semiotic-ai-stream.d.ts +3 -2
- package/dist/components/semiotic-recipes-react.d.ts +2 -0
- package/dist/components/semiotic-utils-core.d.ts +2 -0
- package/dist/components/server/serverChartConfigHeatmap.d.ts +13 -0
- package/dist/components/server/staticLegend.d.ts +5 -0
- package/dist/components/server/staticLegendText.d.ts +13 -0
- package/dist/components/server/staticSVGChrome.d.ts +2 -2
- package/dist/components/stream/DataSourceAdapter.d.ts +15 -62
- package/dist/components/stream/FrameRuntime.d.ts +3 -0
- package/dist/components/stream/GeoPipelineStore.d.ts +2 -0
- package/dist/components/stream/IngestActivity.d.ts +9 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +3 -1
- package/dist/components/stream/OrdinalPipelineStore.d.ts +5 -2
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
- package/dist/components/stream/PipelineStore.d.ts +8 -3
- package/dist/components/stream/accessibleDataRows.d.ts +1 -0
- package/dist/components/stream/axisTickUtils.d.ts +25 -5
- package/dist/components/stream/frameDefaultMargins.d.ts +26 -4
- package/dist/components/stream/frameKeyboardNavigation.d.ts +8 -1
- package/dist/components/stream/geoTypes.d.ts +2 -0
- package/dist/components/stream/graphKeyboardNavigation.d.ts +4 -2
- package/dist/components/stream/hitTestUtils.d.ts +7 -0
- package/dist/components/stream/keyboardNav.d.ts +3 -1
- package/dist/components/stream/navigationGraph.d.ts +10 -3
- package/dist/components/stream/networkFrameKeyboardNavigation.d.ts +2 -0
- package/dist/components/stream/networkNavGroups.d.ts +3 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +1 -0
- package/dist/components/stream/networkSceneTypes.d.ts +10 -0
- package/dist/components/stream/networkSpatialNavigation.d.ts +3 -0
- package/dist/components/stream/networkTypes.d.ts +2 -0
- package/dist/components/stream/ordinalAxisTicks.d.ts +27 -0
- package/dist/components/stream/ordinalSceneBuilders/pieScene.d.ts +10 -0
- package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -0
- package/dist/components/stream/ordinalTypes.d.ts +11 -2
- package/dist/components/stream/pipelineBufferUtils.d.ts +9 -0
- package/dist/components/stream/pipelineConfig.d.ts +7 -0
- package/dist/components/stream/pipelineDomainResolution.d.ts +3 -2
- package/dist/components/stream/roundScaleDomain.d.ts +9 -0
- package/dist/components/stream/stalenessBands.d.ts +1 -1
- package/dist/components/stream/svgOverlayUtils.d.ts +12 -0
- package/dist/components/stream/types.d.ts +10 -2
- package/dist/components/stream/useFrame.d.ts +7 -4
- package/dist/components/stream/useOrdinalFrameHandle.d.ts +4 -14
- package/dist/components/stream/useStalenessCheck.d.ts +5 -3
- package/dist/components/stream/useStreamingDataHandle.d.ts +24 -0
- package/dist/components/stream/useXYFrameHandle.d.ts +4 -14
- package/dist/components/stream/xyDateTicks.d.ts +33 -4
- package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
- package/dist/components/stream/xyPlugins/registry.d.ts +7 -0
- package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +11 -2
- package/dist/components/stream/xySceneBuilders/types.d.ts +4 -0
- package/dist/components/types/legendTypes.d.ts +12 -1
- package/dist/geo.min.js +155 -152
- package/dist/geo.module.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -1
- package/dist/semiotic-ai-core.d.ts +3 -2
- package/dist/semiotic-ai-core.min.js +5 -5
- package/dist/semiotic-ai-core.module.min.js +4 -4
- package/dist/semiotic-ai.module.min.js +2 -2
- package/dist/semiotic-artifact.min.js +6 -6
- package/dist/semiotic-artifact.module.min.js +5 -5
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-atlas.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1022 -1018
- package/dist/semiotic-client-compositional.module.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +101 -101
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-react.d.ts +2 -0
- package/dist/semiotic-recipes-react.min.js +8 -8
- package/dist/semiotic-server-edge-node.module.min.js +3 -3
- package/dist/semiotic-server-edge.min.js +399 -394
- package/dist/semiotic-server-edge.module.min.js +3 -3
- package/dist/semiotic-server-node.min.js +399 -394
- package/dist/semiotic-utils-core.d.ts +2 -0
- package/dist/semiotic-utils-core.min.js +11 -11
- package/dist/semiotic-utils-core.module.min.js +3 -3
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +399 -394
- package/dist/server.module.min.js +3 -3
- package/dist/xy.module.min.js +1 -1
- package/package.json +11 -11
- package/dist/c-27SDQN3J.min.js +0 -1
- package/dist/c-2N7IU2NY.min.js +0 -1
- package/dist/c-4EUQNA7N.min.js +0 -2
- package/dist/c-5EPR4KFB.min.js +0 -1
- package/dist/c-5KZ3NO6X.min.js +0 -1
- package/dist/c-7UN2WUMI.min.js +0 -1
- package/dist/c-BRBTXINY.min.js +0 -1
- package/dist/c-C3Z7ZRAA.min.js +0 -1
- package/dist/c-C4WRRUZ5.min.js +0 -1
- package/dist/c-CXDAWBOW.min.js +0 -1
- package/dist/c-DJ6DT5BL.min.js +0 -51
- package/dist/c-DNBFFE3P.min.js +0 -1
- package/dist/c-HR5AH3MA.min.js +0 -1
- package/dist/c-HTL37JCD.min.js +0 -1
- package/dist/c-JS2D7A2P.min.js +0 -1
- package/dist/c-L6OT4OVA.min.js +0 -1
- package/dist/c-NB2UEX5C.min.js +0 -1
- package/dist/c-OU7A3IUL.min.js +0 -1
- package/dist/c-PNLTF6YG.min.js +0 -37
- package/dist/c-QVKOXC3S.min.js +0 -1
- package/dist/c-SIQVOV6A.min.js +0 -1
- package/dist/c-TBMFC5CR.min.js +0 -1
- package/dist/c-XF5ILLBG.min.js +0 -1
- package/dist/c-YQHGEETR.min.js +0 -2
package/dist/c-CXDAWBOW.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,b as t}from"./c-DEWMXCOF.min.js";import{c as r,b as n,d as i}from"./c-6X7RO4GU.min.js";import{a as s}from"./c-WC7UNQPQ.min.js";import{a as o}from"./c-TSMTCW2K.min.js";import{b as a,c as l}from"./c-PTFHNN34.min.js";import{a as d}from"./c-FBV4S363.min.js";import{a as c}from"./c-V4XMSLC3.min.js";import{b as u}from"./c-DHNROAXY.min.js";import{c as h}from"./c-LDGV6TDQ.min.js";import{b as y}from"./c-2N7IU2NY.min.js";import{a as g,e as p,f,d as m,M as v,K as b,N as x,L as w,G as k,s as _,v as C,t as S,u as E,g as R,D as N,x as T,C as A,o as I,l as M,k as D,n as P,z as L,B as W,i as O,O as F,q as B,r as z}from"./c-NB2UEX5C.min.js";import{a as j,c as Y,b as $}from"./c-TX53234M.min.js";import{a as H,c as X}from"./c-363Q2L4Z.min.js";import{a as V,b as G}from"./c-O7SPJAUO.min.js";import{k as Q,l as q,b as K,aK as U,ao as Z,aA as J,aT as ee,ak as te,Z as re,W as ne,X as ie,V as se,F as oe,aY as ae,E as le,Q as de,K as ce,J as ue,I as he,U as ye,A as ge,as as pe,ap as fe,az as me,at as ve,ay as be,av as xe,aF as we,aE as ke,aW as _e,aX as Ce,af as Se,ai as Ee,ae as Re,aC as Ne,al as Te,am as Ae,an as Ie,m as Me,n as De,aG as Pe,ag as Le,G as We,aU as Oe,aj as Fe,o as Be,bb as ze,aH as je}from"./c-L6OT4OVA.min.js";import{a as Ye}from"./c-WUAFPLTD.min.js";import{c as $e}from"./c-SIQVOV6A.min.js";import{a as He,m as Xe}from"./c-WPL6PGP3.min.js";import{i as Ve,k as Ge,c as Qe,q as qe,u as Ke,v as Ue,w as Ze}from"./c-JDI7HKEM.min.js";import{a as Je,i as et,b as tt}from"./c-ELGOCAEY.min.js";import{h as rt,r as nt}from"./c-7UN2WUMI.min.js";import{q as it,C as st,x as ot,D as at,h as lt}from"./c-HTL37JCD.min.js";import{d as dt,e as ct,c as ut,b as ht}from"./c-YCBCZFOC.min.js";import*as yt from"react";import{useRef as gt,useCallback as pt,useSyncExternalStore as ft,useLayoutEffect as mt,useId as vt,useState as bt,useReducer as xt,useEffect as wt,memo as kt,forwardRef as _t,useMemo as Ct,useImperativeHandle as St}from"react";import{jsx as Et,Fragment as Rt,jsxs as Nt}from"react/jsx-runtime";import{quadtree as Tt}from"d3-quadtree";import{interpolateNumber as At}from"d3-interpolate";import{arc as It}from"d3-shape";var Mt={type:"flat",matrix:[1,0,0,1,0,0],lift:0,scale:1,bounds:null,project:(e,t)=>[e,t],unproject:(e,t)=>[e,t],depth:(e,t)=>t,groundTransform:"matrix(1 0 0 1 0 0)",billboardTransform:(e,t)=>`translate(${e},${t})`},Dt=/*#__PURE__*/Symbol.for("semiotic.networkPerspectiveContext");function Pt(){let e=globalThis;return e[Dt]??(e[Dt]=yt.createContext(Mt))}function Lt(){return yt.useContext(Pt())}function Wt(e,t,r){return t&&null!=e&&!1!==e?Et(Ot,{frame:t,mode:r,children:e}):e}function Ot({frame:e,mode:t,children:r}){if(!e)return Et(Rt,{children:r});let n=Pt();return Et(n.Provider,{value:e,children:"ground"===t?Et("g",{transform:e.groundTransform,children:r}):r})}function Ft(e,t,r){return"function"==typeof t?t(e):e[t??r]}function Bt(e,t){let r=Ft(e,t.edgeIdAccessor,"id");if("string"!=typeof r||!r)throw new Error("IDENTITY_EDGE_ID: edgeIdentity=id requires nonempty string edge IDs.");return JSON.stringify(["id",r])}function zt(e){let t=null==e?NaN:Number(e);return Number.isFinite(t)?t:1}function jt(e,t){return null!=e?String(e):("production"!==process.env.NODE_ENV&&console.warn(`[Semiotic] Missing network ${t} ID; skipping this datum.`),null)}function Yt(e,t){let r=jt(Ft(e,t.sourceAccessor,"source"),"source"),n=jt(Ft(e,t.targetAccessor,"target"),"target");if(null===r||null===n){if("id"===t.edgeIdentity)throw new Error("ENDPOINT_OWNER: explicit-ID edges require both owners.");return null}return{source:r,target:n,value:zt(Ft(e,t.valueAccessor,"value")),data:e}}function $t(e,t,r){if("id"!==r.edgeIdentity)return;let n=Yt(t,r),i="string"==typeof e.source?e.source:e.source.id,s="string"==typeof e.target?e.target:e.target.id;if(Bt(t,r)!==e._edgeKey||!n||n.source!==i||n.target!==s)throw new Error("IDENTITY_EDGE_UPDATE: update cannot change edge ID or owners; remove and reinsert the edge.")}var Ht=/*#__PURE__*/new Set(["tree","cluster","treemap","circlepack","partition","orbit"]),Xt=/*#__PURE__*/new Set(["sankey","tree","cluster","treemap","circlepack","partition"]),Vt=class{constructor(e){this.capacity=e,this.particles=new Array(e),this._freeIndices=new Array(e);for(let t=0;t<e;t++)this.particles[t]={t:0,offset:0,edgeIndex:0,active:!1,x:0,y:0},this._freeIndices[t]=e-1-t}spawn(e,t=Math.random){let r=this._freeIndices.pop();if(void 0===r)return null;let n=this.particles[r];return n.active=!0,n.t=0,n.offset=t()-.5,n.edgeIndex=e,n.x=0,n.y=0,n}step(e,t,r,n){for(let i=0;i<this.capacity;i++){let s=this.particles[i];if(!s.active)continue;let o=r[s.edgeIndex];if(!o||!o.bezier){s.active=!1,this._freeIndices.push(i);continue}let a=n?n[s.edgeIndex]??1:1,l=o.bezier.circular?.3:1;s.t+=e*t*a*l,s.t>=1?(s.active=!1,this._freeIndices.push(i)):Gt(o.bezier,s.t,s.offset,s)}}countForEdge(e){let t=0;for(let r=0;r<this.capacity;r++)this.particles[r].active&&this.particles[r].edgeIndex===e&&t++;return t}clear(){for(let e=0;e<this.capacity;e++)this.particles[e].active=!1;this._freeIndices.length=0;for(let e=this.capacity-1;e>=0;e--)this._freeIndices.push(e)}resize(e){if(e<=this.capacity)return;let t=this.particles;this.particles=new Array(e);for(let r=0;r<e;r++)r<t.length?this.particles[r]=t[r]:(this.particles[r]={t:0,offset:0,edgeIndex:0,active:!1,x:0,y:0},this._freeIndices.push(r));this.capacity=e}};function Gt(e,t,r,n){if(e.circular&&e.segments)return void function(e,t,r,n,i){let s=e.length,o=t*s,a=Math.min(Math.floor(o),s-1),l=o-a,[d,c,u,h]=e[a];Qt(d,c,u,h,l,i);let y=h.x-d.x,g=h.y-d.y,p=Math.sqrt(y*y+g*g);if(p>.001){let e=-g/p,t=y/p;i.x+=e*r*n*2,i.y+=t*r*n*2}}(e.segments,t,r,e.halfWidth,n);if(!e.points)return n.x=0,void(n.y=0);let[i,s,o,a]=e.points;Qt(i,s,o,a,t,n);let l=a.x-i.x,d=a.y-i.y,c=Math.sqrt(l*l+d*d);if(c>.001){let t=-d/c,i=l/c;n.x+=t*r*e.halfWidth*2,n.y+=i*r*e.halfWidth*2}}function Qt(e,t,r,n,i,s){let o=1-i,a=o*o,l=a*o,d=i*i,c=d*i;s.x=l*e.x+3*a*i*t.x+3*o*d*r.x+c*n.x,s.y=l*e.y+3*a*i*t.y+3*o*d*r.y+c*n.y}var qt=/*#__PURE__*/new Set(["sankey","force","chord","tree","cluster","treemap","circlepack","partition","orbit"]);function Kt(e){return qt.has(e)}var Ut=!1;function Zt(t){e(t)||!Q&&Kt(t)||"production"===process.env.NODE_ENV||Ut||(Ut=!0,console.warn(`[semiotic] StreamNetworkFrame: no layout plugin registered for "${t}". Import the matching chart HOC (which registers its plugin), or call registerBuiltInNetworkLayouts() from "semiotic/network".`))}function Jt(e){return{id:e,x0:0,x1:0,y0:0,y1:0,__hasPosition:!1,x:0,y:0,width:0,height:0,value:0,data:{id:e},createdByFrame:!0}}function er(e){if(!e||"object"!=typeof e)return!1;let t=e;if("boolean"!=typeof t.circular||"number"!=typeof t.halfWidth||!Number.isFinite(t.halfWidth))return!1;if(t.circular){if(!Array.isArray(t.segments)||0===t.segments.length)return!1;for(let e of t.segments)if(!tr(e))return!1;return!0}return tr(t.points)}function tr(e){if(!Array.isArray(e)||4!==e.length)return!1;for(let t of e){if(!t||"object"!=typeof t)return!1;let e=t;if("number"!=typeof e.x||!Number.isFinite(e.x)||"number"!=typeof e.y||!Number.isFinite(e.y))return!1}return!0}var rr="rgba(34, 197, 94, 0.7)",nr=2e3,ir={weightChange:.1,newEdge:.5,newNode:1,threshold:3,transitionDuration:500},sr={radius:3,opacity:.7,speedMultiplier:1,maxPerEdge:50,spawnRate:.1},or=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],ar=["scene-style","data-paint","accessibility","evidence"],lr=(e,t)=>({retainedData:e,invalidations:t}),dr=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],cr=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],ur=["scene-geometry","data-paint","overlay","accessibility","evidence"],hr=["scene-style","data-paint","accessibility","evidence"],yr=["scene-geometry","data-paint","overlay","accessibility","evidence"],gr=[],pr={chartType:/*#__PURE__*/lr("rebuild",dr),nodeIDAccessor:/*#__PURE__*/lr("rebuild",dr),sourceAccessor:/*#__PURE__*/lr("rebuild",dr),targetAccessor:/*#__PURE__*/lr("rebuild",dr),valueAccessor:/*#__PURE__*/lr("rebuild",dr),edgeIdentity:/*#__PURE__*/lr("rebuild",dr),edgeIdAccessor:/*#__PURE__*/lr("rebuild",dr),childrenAccessor:/*#__PURE__*/lr("rebuild",dr),hierarchySum:/*#__PURE__*/lr("rebuild",dr),orientation:/*#__PURE__*/lr("preserve",cr),nodeAlign:/*#__PURE__*/lr("preserve",cr),nodePaddingRatio:/*#__PURE__*/lr("preserve",cr),nodeWidth:/*#__PURE__*/lr("preserve",cr),edgeSort:/*#__PURE__*/lr("preserve",cr),iterations:/*#__PURE__*/lr("preserve",cr),forceStrength:/*#__PURE__*/lr("preserve",cr),padAngle:/*#__PURE__*/lr("preserve",cr),groupWidth:/*#__PURE__*/lr("preserve",cr),sortGroups:/*#__PURE__*/lr("preserve",cr),treeOrientation:/*#__PURE__*/lr("preserve",cr),edgeType:/*#__PURE__*/lr("preserve",cr),padding:/*#__PURE__*/lr("preserve",cr),paddingTop:/*#__PURE__*/lr("preserve",cr),orbitMode:/*#__PURE__*/lr("preserve",cr),orbitSize:/*#__PURE__*/lr("preserve",cr),orbitSpeed:/*#__PURE__*/lr("preserve",cr),orbitRevolution:/*#__PURE__*/lr("preserve",cr),orbitRevolutionStyle:/*#__PURE__*/lr("preserve",cr),orbitEccentricity:/*#__PURE__*/lr("preserve",cr),orbitShowRings:/*#__PURE__*/lr("preserve",cr),orbitAnimated:/*#__PURE__*/lr("preserve",cr),customNetworkLayout:/*#__PURE__*/lr("preserve",cr),layoutConfig:/*#__PURE__*/lr("preserve",cr),perspective:/*#__PURE__*/lr("preserve",ur),nodeSize:/*#__PURE__*/lr("preserve",ur),nodeSizeRange:/*#__PURE__*/lr("preserve",ur),colorByDepth:/*#__PURE__*/lr("preserve",ur),nodeLabel:/*#__PURE__*/lr("preserve",yr),showLabels:/*#__PURE__*/lr("preserve",yr),labelMode:/*#__PURE__*/lr("preserve",yr),nodeStyle:/*#__PURE__*/lr("preserve",hr),edgeStyle:/*#__PURE__*/lr("preserve",hr),colorBy:/*#__PURE__*/lr("preserve",hr),colorScheme:/*#__PURE__*/lr("preserve",hr),themeCategorical:/*#__PURE__*/lr("preserve",hr),themeSequential:/*#__PURE__*/lr("preserve",hr),themeSelectionOpacity:/*#__PURE__*/lr("preserve",hr),themeSemantic:/*#__PURE__*/lr("preserve",hr),edgeColorBy:/*#__PURE__*/lr("preserve",hr),edgeOpacity:/*#__PURE__*/lr("preserve",hr),showParticles:/*#__PURE__*/lr("preserve",hr),particleStyle:/*#__PURE__*/lr("preserve",hr),decay:/*#__PURE__*/lr("preserve",hr),pulse:/*#__PURE__*/lr("preserve",hr),thresholds:/*#__PURE__*/lr("preserve",hr),staleness:/*#__PURE__*/lr("preserve",hr),layoutSelection:/*#__PURE__*/lr("preserve",hr),clock:/*#__PURE__*/lr("preserve",gr),random:/*#__PURE__*/lr("preserve",gr),seed:/*#__PURE__*/lr("preserve",gr),tensionConfig:/*#__PURE__*/lr("preserve",gr),transition:/*#__PURE__*/lr("preserve",gr),introAnimation:/*#__PURE__*/lr("preserve",gr),onLayoutError:/*#__PURE__*/lr("preserve",gr),__skipForceSimulation:/*#__PURE__*/lr("preserve",gr),__hierarchyRoot:/*#__PURE__*/lr("preserve",gr),__orbitState:/*#__PURE__*/lr("preserve",gr),__previousPositions:/*#__PURE__*/lr("preserve",gr)},fr=/*#__PURE__*/lr("preserve",cr),mr=class{constructor(){this.tracker=new q}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},or)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},ar):this.recordNoop("restyle")}recordConfig(e,t){let r=function(e,t){let r="preserve",n=new Set;for(let i of e){let e="force"!==t||"nodeSize"!==i&&"nodeSizeRange"!==i?Object.prototype.hasOwnProperty.call(pr,i)?pr[i]:fr:lr("preserve",cr);"rebuild"===e.retainedData&&(r="rebuild");for(let t of e.invalidations)n.add(t)}return{retainedData:r,invalidations:n}}(e,t);return this.tracker.record({kind:"config",keys:e},r.invalidations)}};function vr(e){return e._edgeKey?.startsWith('["id",')?e._edgeKey:`${"string"==typeof e.source?e.source:e.source.id}\0${"string"==typeof e.target?e.target:e.target.id}`}function br(e){return{y0:e.y0,y1:e.y1,sankeyWidth:e.sankeyWidth,circularPathData:e.circular&&e.circularPathData?{...e.circularPathData}:void 0}}function xr(e,t=br(e)){e._prevY0=t.y0,e._prevY1=t.y1,e._prevSankeyWidth=t.sankeyWidth,e._prevCircularPathData=t.circularPathData,e._introFromZero=!1}function wr(e){e._targetY0=e.y0,e._targetY1=e.y1,e._targetSankeyWidth=e.sankeyWidth,e._targetCircularPathData=br(e).circularPathData;let t=e._targetCircularPathData,r=e._prevCircularPathData;t&&(!r||Math.sign(r.verticalFullExtent-r.sourceY)!==Math.sign(t.verticalFullExtent-t.sourceY))&&(e._prevSankeyWidth||(e._prevY0=kr(e.source,e.y0),e._prevY1=kr(e.target,e.y1)),e._prevCircularPathData={...t},e._prevSankeyWidth=0,e._introFromZero=!0)}function kr(e,t){if("string"==typeof e||void 0===e._prevY0||void 0===e._prevX0||0===e._prevX0&&0===e._prevX1)return t;let r=e.y1>e.y0?(t-e.y0)/(e.y1-e.y0):.5;return dt(e._prevY0,e._prevY1,r)}function _r(e,t){if(void 0===e._targetY0||void 0===e._prevY0||void 0===e._prevSankeyWidth||!(e._prevSankeyWidth>0||e._introFromZero))return;e.y0=dt(e._prevY0,e._targetY0,t),e.y1=dt(e._prevY1,e._targetY1,t),e.sankeyWidth=dt(e._prevSankeyWidth,e._targetSankeyWidth,t);let r=e._targetCircularPathData,n=e._prevCircularPathData;if(!r||!n)return;let i={...r};for(let e of Object.keys(r))i[e]=dt(n[e]??r[e],r[e],t);if("string"!=typeof e.source){let t=e.source.x1-i.sourceX;i.sourceX=e.source.x1,i.rightInnerExtent+=t,i.rightFullExtent+=t,i.sourceWidth=e.source.x1-e.source.x0}if("string"!=typeof e.target){let t=e.target.x0-i.targetX;i.targetX=e.target.x0,i.leftInnerExtent+=t,i.leftFullExtent+=t}i.sourceY=e.y0,i.targetY=e.y1,e.circularPathData=i,e._circularWidth=e.sankeyWidth}function Cr(e){void 0!==e._targetY0&&(e.y0=e._targetY0,e.y1=e._targetY1,e.sankeyWidth=e._targetSankeyWidth,e._targetCircularPathData&&(e.circularPathData={...e._targetCircularPathData},e._circularWidth=e.sankeyWidth)),e._introFromZero=void 0}function Sr(e){let t="string"==typeof e?{type:e}:e;return t&&"flat"!==t.type?t:null}var Er=class{constructor(e){this.restyle=e,this.key=null,this.pending=null}reuse(e,t,r,n,i){let s=function(e,t,r,n){return{geometry:[r,n,...t,e.customNetworkLayout,e.layoutConfig,e.perspective],colors:{semantic:e.themeSemantic,sequential:e.themeSequential,selectionOpacity:e.themeSelectionOpacity,categorical:e.themeCategorical,colorScheme:e.colorScheme},selection:[e.layoutSelection?.isActive??!1,e.layoutSelection?.predicate,null!=e.layoutSelection]}}(e,t,r,n),o=null!==this.key&&it(this.key.selection,s.selection);return this.key&&it(this.key.geometry,s.geometry)&&it(this.key.colors,s.colors)&&(i||o)?(o||this.restyle(e.layoutSelection??null),this.key=s,!0):(this.key=null,this.pending=s,!1)}commit(){this.key=this.pending,this.pending=null}clear(){this.key=null,this.pending=null}};function Rr(e){e.customLayoutBackgrounds=null,e.customLayoutOverlays=null,e.customLayoutHtmlMarks=[],e.lastCustomLayoutResult=null}function Nr(e,t){let r=new WeakMap;for(let t of e)r.set(t,t.style);for(let e of t)r.set(e,e.style);return r}var Tr=class{constructor(){this.frame=null,this.underlay=[],this.edgeLift=0,this.onExtrasReady=null,this.needsRebuild=!1,this.internal=null,this.builds=0,this.warnedFlatDecorations=!1}warnFlatDecorations(e){if("production"===process.env.NODE_ENV||this.warnedFlatDecorations||e.perspective)return;let t=e=>Array.isArray(e)?e.some(t):null!=e&&!1!==e&&""!==e;!t(e.backgrounds)&&!t(e.overlays)||(this.warnedFlatDecorations=!0,console.warn('[semiotic] customNetworkLayout backgrounds/overlays stay flat. Use perspective: "ground", or NetworkPerspectiveGround/Billboard with perspective: "manual".'))}label(e){let t=this.frame?.type;return t&&"flat"!==t?`${e} (${t} perspective)`:e}get transitioning(){return null!=this.internal?.tween}advance(e,t=!1){let r=null!=this.internal?.tween&&(a()?.advance(this,e,t)??!1);return r&&(this.needsRebuild=!0),r}extrasReady(){this.needsRebuild=!0,this.onExtrasReady?.()}reset(){this.frame=null,this.underlay=[],this.edgeLift=0,this.projectParticle=void 0,this.internal=null,this.builds=0,this.needsRebuild=!1}project(e,t,r){this.needsRebuild=!1;let n=0===this.builds++;if(!(e.perspective&&"flat"!==e.perspective||this.internal))return null;let i=a();return i?i.project(this,e,t,r,n):(l().then(()=>this.extrasReady(),()=>{}),null)}},Ar=class extends f{constructor(e){super(),this.nodes=new Map,this.edges=new Map,this.tension=0,this.layoutVersion=0,this.sceneNodes=[],this.sceneEdges=[],this.labels=[],this.customLayoutBackgrounds=null,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this.customLayoutHtmlMarks=[],this._customLayoutDiagnosticsWarned=new Set,this._customLayoutCache=new Er(e=>this.restyleScene(e)),this.perspective=new Tr,this._rawCustomResult=null,this.customLayoutRevision=0,this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._nodeQuadtree=null,this._maxNodeRadius=0,this._sceneNodesRevision=0,this._nodeQuadtreeRevision=-1,this._nodesArrCache=null,this._edgesArrCache=null,this._arrCacheVersion=-1,this.particlePool=null,this.incidentEdges=null,this.updateResults=new mr,this.transition=null,this._hasRenderedOnce=!1,this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,this.lastIngestTime=0,this.nodeTimestamps=new Map,this.edgeTimestamps=new Map,this._decaySortedNodes=null,this._decayAgeMap=null,this.addedNodes=new Set,this.removedNodes=new Set,this.addedEdges=new Set,this.removedEdges=new Set,this.lastTopologyChangeTime=0,this.previousNodeIds=new Set,this.previousEdgeKeys=new Set,this._networkDecayCache=null,this._lastPositionSnapshot=null,this.config={...e},this.tensionConfig={...ir,...e.tensionConfig},e.showParticles&&("sankey"===e.chartType||e.customNetworkLayout)&&(this.particlePool=new Vt(2e3))}get customLayoutRun(){return this._rawCustomResult}edgeIncidence(){if(this.incidentEdges)return this.incidentEdges;let e=new Map;for(let[t,r]of this.edges){let n="string"==typeof r.source?r.source:r.source.id,i="string"==typeof r.target?r.target:r.target.id;for(let r of[n,i])e.has(r)||e.set(r,new Set),e.get(r).add(t)}return this.incidentEdges=e,e}deleteIndexedEdge(e){let t=this.edges.get(e);if(!t)return;let r="string"==typeof t.source?t.source:t.source.id,n="string"==typeof t.target?t.target:t.target.id;this.incidentEdges?.get(r)?.delete(e),this.incidentEdges?.get(n)?.delete(e),this.edges.delete(e),this.edgeTimestamps.delete(e)}currentTime(){return this.config.clock?.()??ct()}updateConfig(e){this.applyConfig(e)}hasEdgeIdentityChange(e){return r=e,((t=this.config).edgeIdentity??"pair")!==(r.edgeIdentity??"pair")||"id"===r.edgeIdentity&&t.edgeIdAccessor!==r.edgeIdAccessor;var t,r}applyConfig(e,r=!1){let n=this.config,i={...n,...e};if(!r&&this.edges.size&&"id"===n.edgeIdentity&&"id"!==i.edgeIdentity)throw new Error("IDENTITY_EDGE_MODE: clear or replace retained edges before switching to pair identity.");if(!r&&"id"===i.edgeIdentity&&("id"!==n.edgeIdentity||n.edgeIdAccessor!==i.edgeIdAccessor)){let e=function(e,t){let r=new Set;return[...e].map(([e,n])=>{let i=Bt(n.data??{},t);if(r.has(i))throw new Error("IDENTITY_DUPLICATE_EDGE: cannot adopt an accessor that repeats existing IDs.");return r.add(i),{previous:e,key:i,edge:n}})}(this.edges,i),t=new Map;for(let{previous:r,key:n}of e){let e=this.edgeTimestamps.get(r);void 0!==e&&t.set(n,e)}this.edges.clear();for(let{key:t,edge:r}of e)r._edgeKey=t,this.edges.set(t,r);this.edgeTimestamps=t,this.incidentEdges=null,this._arrCacheVersion=-1}t(n,i),n.__hierarchyRoot&&(i.__hierarchyRoot=n.__hierarchyRoot),void 0===e.layoutSelection&&null!=n.layoutSelection&&(i.layoutSelection=n.layoutSelection);let s=[...new Set([...Object.keys(n),...Object.keys(i)])].filter(e=>n[e]!==i[e]);this.config=i,this.tensionConfig={...ir,...i.tensionConfig},i.showParticles&&("sankey"===i.chartType||i.customNetworkLayout)&&!this.particlePool&&(this.particlePool=new Vt(2e3)),this.updateResults.recordConfig(s,i.chartType)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}ingestHierarchy(e,t,r){r&&this.applyConfig(r,!0),this._boundedPrevSnapshot=new Map;for(let[e,t]of this.nodes)(0!==t.x0||0!==t.x1||0!==t.y0||0!==t.y1)&&this._boundedPrevSnapshot.set(e,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});this.nodes.clear(),this.incidentEdges=null,this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null,this.config.__hierarchyRoot=e,this.runLayout(t),this._boundedPrevSnapshot=null,this.updateResults.recordData("replace",1)}ingestBounded(e,t,r,n){let i=function(e,t,r){let n=new Map;for(let t of e){let e=jt(Ft(t,r.nodeIDAccessor,"id"),"node");null!==e&&(n.has(e)&&"production"!==process.env.NODE_ENV&&console.warn(`[Semiotic] Duplicate network node ID "${e}"; using the last datum.`),n.set(e,t))}let i=[],s=new Set;return t.forEach((e,t)=>{let o="id"===r.edgeIdentity?Bt(e,r):void 0;if(o&&s.has(o))throw new Error("IDENTITY_DUPLICATE_EDGE: repeated edge ID in bounded graph.");o&&s.add(o);let a=Yt(e,r);if(a){for(let e of[a.source,a.target])n.has(e)||n.set(e,{id:e});i.push({...a,_edgeKey:o??`${a.source}\0${a.target}\0${t}`})}}),{nodes:n,edges:i}}(e,t,{...this.config,...n?.config});n?.config&&this.applyConfig(n.config,!0),this._boundedPrevSnapshot=new Map;for(let[e,t]of this.nodes)(0!==t.x0||0!==t.x1||0!==t.y0||0!==t.y1)&&this._boundedPrevSnapshot.set(e,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});this._boundedEdgeSnapshot=function(e){let t=new Map;for(let r of e){let e=vr(r),n=t.get(e)??[];n.push(br(r)),t.set(e,n)}return t}(this.edges.values()),this.nodes.clear(),this.incidentEdges=null,this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null,this._arrCacheVersion=-1;for(let[e,t]of i.nodes){let r=Jt(e);r.data=t,"force"===this.config.chartType&&!this.config.customNetworkLayout&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&(r.x=t.x,r.y=t.y,r.__hasPosition=!0),this.nodes.set(e,r)}for(let e of i.edges){let t=e.data,r={...e,y0:0,y1:0,sankeyWidth:0};t&&"object"==typeof t&&er(t.bezier)&&(r.bezier=t.bezier),this.edges.set(e._edgeKey,r)}n?.deferLayout||this.runLayout(r),this.updateResults.recordData("replace",e.length+t.length)}ingestBoundedWithResult(e,t,r,n){return this.ingestBounded(e,t,r,n),this.updateResults.last}applyForceLayoutPositions(e,t){for(let[t,r]of Object.entries(e)){let e=this.nodes.get(t);e&&(e.x=r.x,e.y=r.y,e.__hasPosition=!0)}this.config.__skipForceSimulation=!0;try{this.runLayout(t)}finally{this.config.__skipForceSimulation=void 0}}edgeKey(e,t){return`${e}\0${t}`}ingestEdge(e){let t=Yt(e,this.config);if(!t)return this.updateResults.recordNoop("ingest"),!1;let{source:r,target:n,value:i}=t,s="id"===this.config.edgeIdentity?Bt(e,this.config):this.edgeKey(r,n),o=this.edges.get(s);o&&$t(o,e,this.config);let a=0===this.nodes.size,l=!1,d=this.currentTime();this.lastIngestTime=d,this._decaySortedNodes=null,this._networkDecayCache=null,this.nodes.has(r)||(this.nodes.set(r,Jt(r)),this.nodeTimestamps.set(r,d),this.tension+=this.tensionConfig.newNode,l=!0),this.nodes.has(n)||(this.nodes.set(n,Jt(n)),this.nodeTimestamps.set(n,d),this.tension+=this.tensionConfig.newNode,l=!0);let c=!1;o?(o.value="id"===this.config.edgeIdentity?i:o.value+i,o.data="id"===this.config.edgeIdentity?e:{...o.data,...e},this.edgeTimestamps.set(s,d),this.tension+=this.tensionConfig.weightChange,c=!0):(this.incidentEdges=null,this.edges.set(s,{...t,y0:0,y1:0,sankeyWidth:0,_edgeKey:s}),this.edgeTimestamps.set(s,d),this.tension+=this.tensionConfig.newEdge,l=!0);let u=a||l||c||this.tension>=this.tensionConfig.threshold;return l&&(this._arrCacheVersion=-1),this.updateResults.recordData("ingest",1),u}ingestEdgeWithResult(e){return this.ingestEdge(e),this.updateResults.last}runLayout(t){if(this.config.customNetworkLayout)return this.recordTopologyDiff(),void this.layoutVersion++;let r=e(this.config.chartType);if(!r)return void Zt(this.config.chartType);let n=Array.from(this.nodes.values()),i=Array.from(this.edges.values());if(0===n.length&&!r.hierarchical)return;if(this.prepareForRelayout(),r.supportsStreaming&&!r.hierarchical&&(this.config.__previousPositions=this._lastPositionSnapshot??void 0),r.computeLayout(n,i,this.config,t),this.config.__previousPositions=void 0,r.hierarchical&&n.length>0){this.nodes.clear(),this.incidentEdges=null,this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null;for(let e of n)this.nodes.set(e.id,e);for(let e=0;e<i.length;e++){let t=i[e],r="string"==typeof t.source?t.source:t.source.id,n="string"==typeof t.target?t.target:t.target.id,s=t._edgeKey||`${r}\0${n}\0${e}`;t._edgeKey=s,this.edges.set(s,t)}let e=this._boundedPrevSnapshot;if(e&&e.size>0)for(let t of this.nodes.values()){let r=e.get(t.id);r&&(t._prevX0=r.x0,t._prevX1=r.x1,t._prevY0=r.y0,t._prevY1=r.y1)}this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,n=Array.from(this.nodes.values())}this.finalizeLayout();let s=new Map;for(let e of this.nodes.values())Number.isFinite(e.x)&&Number.isFinite(e.y)&&s.set(e.id,{x:e.x,y:e.y});this._lastPositionSnapshot=s,this.saveTargetPositions();let o=n.some(e=>void 0!==e._prevX0&&(0!==e._prevX0||0!==e._prevX1||0!==e._prevY0||0!==e._prevY1)),a=this.config.transition?.duration??this.tensionConfig.transitionDuration,l=Xt.has(this.config.chartType);if(!this._hasRenderedOnce&&this.config.introAnimation&&l&&n.length>0&&a>0){let e="sankey"===this.config.chartType&&"vertical"===this.config.orientation,r=t[e?1:0]/2,n=t[e?0:1]/2;for(let e of this.nodes.values())e._prevX0=r,e._prevX1=r,e._prevY0=n,e._prevY1=n;for(let e of this.edges.values())e._prevY0=n,e._prevY1=n,e._prevSankeyWidth=0,e._introFromZero=!0;this.restorePreviousPositions(),this.transition={startTime:this.currentTime(),duration:a}}else o&&a>0&&(this.restorePreviousPositions(),this.transition={startTime:this.currentTime(),duration:a});this._hasRenderedOnce=!0,this.recordTopologyDiff(),this.layoutVersion++}recordTopologyDiff(){let e=new Set(this.nodes.keys()),t=new Set(this.edges.keys());this.addedNodes=new Set,this.removedNodes=new Set,this.addedEdges=new Set,this.removedEdges=new Set;for(let t of e)this.previousNodeIds.has(t)||this.addedNodes.add(t);for(let t of this.previousNodeIds)e.has(t)||this.removedNodes.add(t);for(let e of t)this.previousEdgeKeys.has(e)||this.addedEdges.add(e);for(let e of this.previousEdgeKeys)t.has(e)||this.removedEdges.add(e);(this.addedNodes.size>0||this.removedNodes.size>0||this.addedEdges.size>0||this.removedEdges.size>0)&&(this.lastTopologyChangeTime=this.currentTime()),this.previousNodeIds=e,this.previousEdgeKeys=t}restyleScene(e){let t=function({nodes:e,edges:t,restyle:r,restyleEdge:n,baseStyles:i,selection:s}){let o=!(!r&&!n);if(r)for(let t of e){let e=i.get(t)??t.style,n=r(t,s);t.style=n?{...e,...n}:e}if(n)for(let e of t){let t=i.get(e)??e.style,r=n(e,s);e.style=r?{...t,...r}:t}return o}({nodes:this.sceneNodes,edges:this.sceneEdges,restyle:this._customRestyle,restyleEdge:this._customRestyleEdge,baseStyles:this._baseStyles,selection:e});this.markStylePaintPending(),this.updateResults.recordRestyle(t)}buildScene(t){if(this.config.customNetworkLayout){if(this._customLayoutCache.reuse(this.config,t,this.getUpdateSnapshot().revisions.data,this.layoutVersion,this.hasCustomRestyle))return void(this.perspective.needsRebuild&&this._rawCustomResult&&(this.commitCustomScene(this._rawCustomResult,t),this._sceneNodesRevision++,this.hasCustomRestyle&&(this._baseStyles=Nr(this.sceneNodes,this.sceneEdges),this.restyleScene(this.config.layoutSelection??null))));let e=function({config:e,customLayout:t,size:r,nodes:n,edges:i,previousResult:s,revision:o}){let a=V(e.colorScheme,e.themeCategorical,He),l={nodes:n,edges:i,dimensions:{width:r[0],height:r[1],plot:{x:0,y:0,width:r[0],height:r[1]}},theme:{semantic:e.themeSemantic??{},sequential:e.themeSequential,selectionOpacity:e.themeSelectionOpacity,categorical:[...a]},resolveColor:G(a,e.colorScheme),config:e.layoutConfig??{},selection:e.layoutSelection??null,perspective:Sr(e.perspective)};return p({family:"network",logLabel:"customNetworkLayout",revision:o,hasPreviousResult:null!==s,onLayoutError:e.onLayoutError,run:()=>t(l)})}({config:this.config,customLayout:this.config.customNetworkLayout,size:t,nodes:Array.from(this.nodes.values()),edges:Array.from(this.edges.values()),previousResult:this.lastCustomLayoutResult,revision:this.layoutVersion});if("failure"===e.kind)return this.lastCustomLayoutFailure=e.diagnostic,void(e.preservedLastGoodScene||(this.sceneNodes=[],this.sceneEdges=[],this.labels=[],this.perspective.underlay=[],Rr(this),this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._sceneNodesRevision++));let r=e.result;return this._customLayoutCache.commit(),this._rawCustomResult=r,this.commitCustomScene(r,t),this.customLayoutRevision++,this.lastCustomLayoutFailure=null,this._sceneNodesRevision++,this._customRestyle=r.restyle,this._customRestyleEdge=r.restyleEdge,this.hasCustomRestyle=!(!r.restyle&&!r.restyleEdge),this.hasCustomRestyle&&(this._baseStyles=Nr(this.sceneNodes,this.sceneEdges),this.restyleScene(this.config.layoutSelection??null)),void m({label:"customNetworkLayout",nodes:this.sceneNodes,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned})}this._customLayoutCache.clear(),this._rawCustomResult=null,this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,Rr(this),this.lastCustomLayoutFailure=null;let r=e(this.config.chartType);if(!r)return Zt(this.config.chartType),void this._sceneNodesRevision++;let n=r.hierarchical?Array.from(this.nodes.values()):this.nodesArray,i=r.hierarchical?Array.from(this.edges.values()):this.edgesArray,s=r.buildScene(n,i,this.config,t),o=this.perspective.project(this.config,t,s);this.sceneNodes=o?.sceneNodes??s.sceneNodes,this.sceneEdges=o?.sceneEdges??s.sceneEdges,this.labels=o?.labels??s.labels,this._sceneNodesRevision++}commitCustomScene(e,t){let r=this.perspective.project(this.config,t,{sceneNodes:e.sceneNodes??[],sceneEdges:e.sceneEdges??[],labels:e.labels??[],htmlMarks:e.htmlMarks,bounds:e.perspectiveBounds});r&&this.perspective.warnFlatDecorations(e);let n=r?{...e,sceneNodes:r.sceneNodes,sceneEdges:r.sceneEdges,labels:r.labels,htmlMarks:e.htmlMarks?r.htmlMarks:void 0}:e;this.sceneNodes=n.sceneNodes??[],this.sceneEdges=n.sceneEdges??[],this.labels=n.labels??[],function(e,t){e.customLayoutBackgrounds=t.backgrounds??null,e.customLayoutOverlays=t.overlays??null,e.customLayoutHtmlMarks=t.htmlMarks??[],e.lastCustomLayoutResult=t}(this,n)}advancePerspectiveTransition(e,t=!1){return this.perspective.advance(e,t)}rebuildNodeQuadtree(){let e=0,t=0,r=!1;for(let n of this.sceneNodes)"circle"===n.type&&n.datum&&(e++,n.r>t&&(t=n.r),n.pathD&&!n._perspectiveToken&&(r=!0));if(this._maxNodeRadius=t,r||e<=500)return void(this._nodeQuadtree=null);let n=[];for(let e of this.sceneNodes)"circle"===e.type&&e.datum&&n.push(e);this._nodeQuadtree=Tt().x(e=>e.cx).y(e=>e.cy).addAll(n)}get nodeQuadtree(){return this._nodeQuadtreeRevision!==this._sceneNodesRevision&&(this.rebuildNodeQuadtree(),this._nodeQuadtreeRevision=this._sceneNodesRevision),this._nodeQuadtree}get maxNodeRadius(){return this.nodeQuadtree,this._maxNodeRadius}_ensureArrays(){this._arrCacheVersion===this.layoutVersion&&this._nodesArrCache&&this._edgesArrCache||(this._nodesArrCache=Array.from(this.nodes.values()),this._edgesArrCache=Array.from(this.edges.values()),this._arrCacheVersion=this.layoutVersion)}get nodesArray(){return this._ensureArrays(),this._nodesArrCache??[]}get edgesArray(){return this._ensureArrays(),this._edgesArrCache??[]}get isAnimating(){return!(!e(this.config.chartType)?.supportsAnimation||!1===this.config.orbitAnimated)}tickAnimation(t,r){let n=e(this.config.chartType);if(!n?.tick)return!1;let i=n.hierarchical?Array.from(this.nodes.values()):this.nodesArray,s=n.hierarchical?Array.from(this.edges.values()):this.edgesArray;return n.tick(i,s,this.config,t,r)}cancelIntroAnimation(){this.transition&&this.snapToTargets(),this.transition=null;for(let e of this.nodes.values())e._prevX0=void 0,e._prevX1=void 0,e._prevY0=void 0,e._prevY1=void 0;for(let e of this.edges.values())e._prevY0=void 0,e._prevY1=void 0,e._prevSankeyWidth=void 0,e._prevCircularPathData=void 0,e._introFromZero=!1}advanceTransition(e){if(!this.transition)return!1;let t=ut(e,this.transition),r=ht(t,this.config.transition?.easing);for(let e of this.nodes.values())void 0!==e._targetX0&&void 0!==e._prevX0&&(0!==e._prevX0||0!==e._prevX1)&&(e.x0=dt(e._prevX0,e._targetX0,r),e.x1=dt(e._prevX1,e._targetX1,r),e.y0=dt(e._prevY0,e._targetY0,r),e.y1=dt(e._prevY1,e._targetY1,r));for(let e of this.edges.values())_r(e,r);return this.rebuildAllBeziers(),!(t>=1&&(this.snapToTargets(),this.transition=null,1))}prepareForRelayout(){let e=this._boundedPrevSnapshot;for(let t of this.nodes.values()){let r=e?.get(t.id);r&&0===t.x0&&0===t.x1&&0===t.y0&&0===t.y1?(t._prevX0=r.x0,t._prevX1=r.x1,t._prevY0=r.y0,t._prevY1=r.y1):(t._prevX0=t.x0,t._prevX1=t.x1,t._prevY0=t.y0,t._prevY1=t.y1)}(function(e,t){for(let r of e){let e=t?.get(vr(r))?.shift();xr(r,0===r.sankeyWidth?e:void 0)}})(this.edges.values(),this._boundedEdgeSnapshot),this.nodes.size>0&&(this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null)}finalizeLayout(){let e="vertical"===this.config.orientation?"down":"right";for(let e of this.nodes.values())"treemap"===this.config.chartType||"partition"===this.config.chartType||0!==e.x0||0!==e.x1||0!==e.y0||0!==e.y1?(e.width=e.x1-e.x0,e.height=e.y1-e.y0,e.x=e.x0+e.width/2,e.y=e.y0+e.height/2):(e.x0=e.x-5,e.x1=e.x+5,e.y0=e.y-5,e.y1=e.y+5,e.width=10,e.height=10);for(let t of this.edges.values())t.direction=e,this.updateEdgeBezier(t);this.tension=0}saveTargetPositions(){for(let e of this.nodes.values())e._targetX0=e.x0,e._targetX1=e.x1,e._targetY0=e.y0,e._targetY1=e.y1;for(let e of this.edges.values())wr(e)}restorePreviousPositions(){for(let e of this.nodes.values())void 0!==e._prevX0&&(0!==e._prevX0||0!==e._prevX1)&&(e.x0=e._prevX0,e.x1=e._prevX1,e.y0=e._prevY0,e.y1=e._prevY1);for(let e of this.edges.values())_r(e,0);this.rebuildAllBeziers()}snapToTargets(){for(let e of this.nodes.values())void 0!==e._targetX0&&(e.x0=e._targetX0,e.x1=e._targetX1,e.y0=e._targetY0,e.y1=e._targetY1);for(let e of this.edges.values())Cr(e);this.rebuildAllBeziers()}updateEdgeBezier(e){!function(e,t,r=.5){let n="string"==typeof e.source?t.get(e.source):e.source,i="string"==typeof e.target?t.get(e.target):e.target;!n||!i||(e.circular&&e.circularPathData?e.bezier=function(e){let t,r=(e._circularWidth||e.sankeyWidth||1)/2,n=e.circularPathData;if(!n)throw new Error("buildCircularBezier requires circularPathData");if(e._circularStub){let e=Math.max(15,Math.min(40,.33*(n.rightFullExtent-n.sourceX))),t=Math.max(15,Math.min(40,.33*(n.targetX-n.leftFullExtent)));return{circular:!0,segments:[[{x:n.sourceX,y:n.sourceY},{x:n.sourceX+.33*e,y:n.sourceY},{x:n.sourceX+.66*e,y:n.sourceY},{x:n.sourceX+e,y:n.sourceY}],[{x:n.targetX-t,y:n.targetY},{x:n.targetX-.66*t,y:n.targetY},{x:n.targetX-.33*t,y:n.targetY},{x:n.targetX,y:n.targetY}]],halfWidth:r}}t="down"===e.direction?[{x:n.sourceY,y:n.sourceX},{x:n.sourceY,y:n.rightFullExtent},{x:n.verticalFullExtent,y:n.rightFullExtent},{x:n.verticalFullExtent,y:n.leftFullExtent},{x:n.targetY,y:n.leftFullExtent},{x:n.targetY,y:n.targetX}]:[{x:n.sourceX,y:n.sourceY},{x:n.rightFullExtent,y:n.sourceY},{x:n.rightFullExtent,y:n.verticalFullExtent},{x:n.leftFullExtent,y:n.verticalFullExtent},{x:n.leftFullExtent,y:n.targetY},{x:n.targetX,y:n.targetY}];let i=[];for(let e=0;e<t.length-1;e++){let r=t[e],n=t[e+1],s=n.x-r.x,o=n.y-r.y;i.push([r,{x:r.x+s/3,y:r.y+o/3},{x:r.x+2*s/3,y:r.y+2*o/3},n])}return{circular:!0,segments:i,halfWidth:r}}(e):e.bezier=function(e,t,r,n=.5){let i=(e.sankeyWidth||1)/2;if("down"===e.direction){let s=t.x1,o=r.x0,a=At(s,o);return{circular:!1,points:[{x:e.y0,y:s},{x:e.y0,y:a(n)},{x:e.y1,y:a(1-n)},{x:e.y1,y:o}],halfWidth:i}}let s=t.x1,o=r.x0,a=At(s,o);return{circular:!1,points:[{x:s,y:e.y0},{x:a(n),y:e.y0},{x:a(1-n),y:e.y1},{x:o,y:e.y1}],halfWidth:i}}(e,n,i,r))}(e,this.nodes,.5)}rebuildAllBeziers(){for(let e of this.nodes.values())e.width=e.x1-e.x0,e.height=e.y1-e.y0,e.x=e.x0+e.width/2,e.y=e.y0+e.height/2;for(let e of this.edges.values())this.updateEdgeBezier(e)}applyPulse(e){!function(e){let t=e.pulse;if(!t)return;let r=t.duration??500,n=t.color??"rgba(255,255,255,0.6)",i=t.glowRadius??4,{now:s}=e;for(let t of e.sceneNodes){let o=t.id;if(!o)continue;let a=e.nodeTimestamps.get(o);if(!a)continue;let l=s-a;if(l>=r)continue;let d=1-l/r;t._pulseIntensity=d,t._pulseColor=n,t._pulseGlowRadius=i}for(let t of e.sceneEdges){let i=t.datum;if(!i)continue;let o="object"==typeof i.source?i.source?.id:i.source,a="object"==typeof i.target?i.target?.id:i.target;if(!o||!a)continue;let l=`${o}\0${a}`,d=e.edgeTimestamps.get(l);if(!d)continue;let c=s-d;if(c>=r)continue;let u=1-c/r;t._pulseIntensity=u,t._pulseColor=n}}({sceneNodes:this.sceneNodes,sceneEdges:this.sceneEdges,nodeTimestamps:this.nodeTimestamps,edgeTimestamps:this.edgeTimestamps,pulse:this.config.pulse,now:e})}applyDecay(){this._networkDecayCache||(this._networkDecayCache={sortedNodes:null,ageMap:null}),this._decaySortedNodes||(this._networkDecayCache.sortedNodes=null,this._networkDecayCache.ageMap=null),function(e){let t=e.decay;if(!t)return;let r=e.nodeTimestamps.size;if(r<=1)return;if(!e.cache.sortedNodes){e.cache.sortedNodes=Array.from(e.nodeTimestamps.entries()).sort((e,t)=>e[1]-t[1]);let t=new Map;for(let r=0;r<e.cache.sortedNodes.length;r++)t.set(e.cache.sortedNodes[r][0],r);e.cache.ageMap=t}let n=e.cache.ageMap;for(let i of e.sceneNodes){let e=i.id;if(!e)continue;let s=n.get(e);if(void 0===s)continue;let o=g(t,s,r),a=i.style?.opacity??1;i.style={...i.style,opacity:a*o}}}({sceneNodes:this.sceneNodes,nodeTimestamps:this.nodeTimestamps,decay:this.config.decay,cache:this._networkDecayCache}),this._decaySortedNodes=this._networkDecayCache.sortedNodes,this._decayAgeMap=this._networkDecayCache.ageMap}applyTopologyDiff(e){!function(e){for(let t of e.sceneNodes)t._pulseColor===rr&&(t._pulseIntensity=0,t._pulseColor=void 0,t._pulseGlowRadius=void 0);if(0===e.addedNodes.size)return;let t=e.now-e.lastTopologyChangeTime;if(t>=nr)return;let r=1-t/nr;for(let t of e.sceneNodes){let n=t.id;!n||!e.addedNodes.has(n)||(t._pulseIntensity=Math.max(t._pulseIntensity??0,r),t._pulseColor=rr,t._pulseGlowRadius=8)}}({sceneNodes:this.sceneNodes,addedNodes:this.addedNodes,lastTopologyChangeTime:this.lastTopologyChangeTime,now:e})}get hasActiveTopologyDiff(){return function(e,t,r=(typeof performance<"u"?performance.now():Date.now())){return 0!==e.size&&r-t<nr}(this.addedNodes,this.lastTopologyChangeTime)}applyThresholds(e){!function(e){let t=e.thresholds;if(!t)return;let r=t.warningColor??"#f59e0b",n=t.criticalColor??"#ef4444",i=!1!==t.pulse;for(let s of e.sceneNodes){let o=s.id;if(!o)continue;let a=e.nodes.get(o);if(!a)continue;let l=t.metric(a),d=null;void 0!==t.critical&&l>=t.critical?d=n:void 0!==t.warning&&l>=t.warning&&(d=r),d&&(s.style={...s.style,fill:d},i&&(s._pulseIntensity=.6+.4*Math.sin(e.now/300),s._pulseColor=d,s._pulseGlowRadius=6))}}({sceneNodes:this.sceneNodes,nodes:this.nodes,thresholds:this.config.thresholds,now:e})}get hasActiveThresholds(){return function(e,t){if(!t)return!1;for(let r of e){let e=t.metric(r);if(void 0!==t.warning&&e>=t.warning||void 0!==t.critical&&e>=t.critical)return!0}return!1}(this.nodes.values(),this.config.thresholds)}get hasActivePulses(){return function(e){let t=e.pulse;if(!t||0===e.lastIngestTime)return!1;let r=e.now??(typeof performance<"u"?performance.now():Date.now()),n=t.duration??500;return r-e.lastIngestTime<n}({pulse:this.config.pulse,lastIngestTime:this.lastIngestTime})}getLayoutData(){return{nodes:Array.from(this.nodes.values()),edges:Array.from(this.edges.values())}}updateNode(e,t){let r=this.nodes.get(e);if(!r)return this.updateResults.recordNoop("update"),null;let n=r.data?{...r.data}:{};return r.data=t(r.data??{}),this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",1),n}updateEdge(e,t,r){return this.replaceEdgeData([...this.edges.values()].filter(r=>{let n="string"==typeof r.source?r.source:r.source.id,i="string"==typeof r.target?r.target:r.target.id;return n===e&&i===t}),r)}replaceEdgeData(e,t){let r=[],n=[];for(let r of e){let e=t({...r.data});$t(r,e,this.config),n.push({edge:r,data:e})}for(let{edge:e,data:t}of n){let n=Ft(e.data??{},this.config.valueAccessor,"value");r.push({...e.data}),e.data=t;let i=Ft(t,this.config.valueAccessor,"value");Object.is(n,i)||(e.value=zt(i))}return r.length>0?(this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",r.length)):this.updateResults.recordNoop("update"),r}updateEdgeById(e,t){if("id"!==this.config.edgeIdentity)throw new Error("updateEdgeById requires edgeIdentity=id.");let r=this.edges.get(JSON.stringify(["id",e]));return this.replaceEdgeData(r?[r]:[],t)[0]??null}removeNode(e){if(!this.nodes.has(e))return this.updateResults.recordNoop("remove"),!1;this.nodes.delete(e),this.nodeTimestamps.delete(e);for(let t of this.edgeIncidence().get(e)??[])this.deleteIndexedEdge(t);return this.incidentEdges?.delete(e),this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",1),!0}removeEdge(e,t){let r=[];if(void 0===t){let t=this.config.edgeIdAccessor??("id"===this.config.edgeIdentity?"id":void 0);if(!t)throw new Error("removeEdge(edgeId) requires edgeIdAccessor to be configured. Use removeEdge(sourceId, targetId) instead.");let n="function"==typeof t?t:e=>e?.[t];for(let[t,i]of this.edges)i.data&&n(i.data)===e&&r.push(t)}else for(let[n,i]of this.edges){let s="string"==typeof i.source?i.source:i.source.id,o="string"==typeof i.target?i.target:i.target.id;s===e&&o===t&&r.push(n)}for(let e of r)this.deleteIndexedEdge(e);return r.length>0?(this.layoutVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",r.length)):this.updateResults.recordNoop("remove"),r.length>0}clear(){this._customLayoutCache.clear(),this._rawCustomResult=null,this.perspective.underlay=[],this.nodes.clear(),this.incidentEdges=null,this.edges.clear(),this._decaySortedNodes=null,this._networkDecayCache=null,this._decayAgeMap=null,this._nodeQuadtree=null,this._nodesArrCache=null,this._edgesArrCache=null,this._sceneNodesRevision++,this.tension=0,this.layoutVersion++,this.sceneNodes=[],this.sceneEdges=[],this.labels=[],Rr(this),this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this._customRestyleEdge=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.transition=null,this._hasRenderedOnce=!1,this.lastIngestTime=0,this._lastPositionSnapshot=null,this.nodeTimestamps.clear(),this.edgeTimestamps.clear(),this.previousNodeIds=new Set,this.previousEdgeKeys=new Set,this.addedNodes=new Set,this.removedNodes=new Set,this.addedEdges=new Set,this.removedEdges=new Set,this.lastTopologyChangeTime=0,this._boundedPrevSnapshot=null,this._boundedEdgeSnapshot=null,this.particlePool&&this.particlePool.clear(),this.updateResults.recordData("clear")}};function Ir(e,t,r,n,i){return{id:t,className:"stream-network-frame"+(e.className?` ${e.className}`:""),role:"group","aria-busy":n||void 0,"aria-label":e.description||("string"==typeof e.title?e.title:"Network chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:e.responsiveWidth?"100%":r[0],height:e.responsiveHeight?"100%":r[1],overflow:e.viewTransform?"clip":i}}}function Mr(e){return $e(e.datum||{},e.x,e.y,{nodeOrEdge:"node"})}var Dr=/^(value|amount|total|count|weight|score)$/i,Pr=/*#__PURE__*/st(function({data:e}){if("edge"===e.nodeOrEdge){let t=e.data;if(!t)return null;let r="object"==typeof t.source?t.source.id:t.source,n="object"==typeof t.target?t.target.id:t.target,i=t.__chordEdges;return i&&i.length>1?Nt("div",{className:"semiotic-tooltip",style:ot,children:[Nt("div",{style:{fontWeight:600},children:["Connections: ",i.length]}),i.map((e,t)=>Nt("div",{style:{marginTop:4,opacity:.8},children:["object"==typeof e.source?e.source.id:e.source," → ","object"==typeof e.target?e.target.id:e.target,": ",e.value.toLocaleString()]},e._edgeKey??t))]}):Nt("div",{className:"semiotic-tooltip",style:ot,children:[Nt("div",{style:{fontWeight:600},children:[r," → ",n]}),null!=t.value&&Nt("div",{style:{marginTop:4,opacity:.8},children:["Value:"," ","number"==typeof t.value?t.value.toLocaleString():String(t.value)]})]})}let t=e.data;if(!t)return null;let r=t.__hierarchyNode;if(r){let e=[],n=r;for(;n;){let r=n.data?.name??n.data?.id??t.id;null!=r&&e.unshift(String(r)),n=n.parent}e.length>1&&e.shift();let i=e.length-1;return Nt("div",{className:"semiotic-tooltip",style:ot,children:[Et("div",{children:e.map((e,t)=>Nt("span",{children:[t>0&&Et("span",{style:{margin:"0 3px",opacity:.5},children:" → "}),t===i?Et("strong",{children:e}):Et("span",{style:{opacity:.7},children:e})]},t))}),null!=t.value&&t.value>0&&Et("div",{style:{marginTop:4,opacity:.8},children:"number"==typeof t.value?t.value.toLocaleString():String(t.value)})]})}let n=(t.sourceLinks?.length||0)+(t.targetLinks?.length||0),i=(t.sourceLinks||[]).reduce((e,t)=>e+(t.value||0),0)+(t.targetLinks||[]).reduce((e,t)=>e+(t.value||0),0),s=t.data??t,o=U(s),a=null!=o.title?String(o.title):t.id,l=o.entries.some(e=>Dr.test(e.key));return Nt("div",{className:"semiotic-tooltip",style:ot,children:[Et("div",{style:{fontWeight:600},children:a}),o.entries.map(e=>Nt("div",{style:{marginTop:4,opacity:.8},children:[e.key,": ",k(e.value)]},e.key)),!l&&null!=t.value&&t.value>0&&Nt("div",{style:{marginTop:4,opacity:.8},children:["Total:"," ","number"==typeof t.value?t.value.toLocaleString():String(t.value)]}),n>0&&Nt("div",{style:{marginTop:4,opacity:.8},children:["Connections: ",n,i!==n&&` (weighted: ${i.toLocaleString()})`]})]})});function Lr(e){return e?._semioticCamera}function Wr(e,t=!1){return Lr(e)?.transformRef(t)}var Or={x:0,y:0,k:1};function Fr(e){return e&&Number.isFinite(e.k)&&e.k>0&&Number.isFinite(e.x)&&Number.isFinite(e.y)?e:Or}function Br(e,t){return{...e,x:e.x*t.k+t.x,y:e.y*t.k+t.y}}function zr(e,t){return{x:(e.x-t.x)/t.k,y:(e.y-t.y)/t.k,width:e.width/t.k,height:e.height/t.k}}function jr({view:e,width:t,height:r,children:n}){if(!e)return n;let{x:i,y:s,k:o}=Fr(e);return Et("svg",{role:"presentation",width:t,height:r,overflow:"hidden","data-network-view":"",children:Et("g",{ref:Wr(e),transform:`translate(${i},${s}) scale(${o})`,children:n})})}var Yr=()=>()=>{};function $r(e,t=!0){let r=t?Lr(e):void 0,n=r?.getSnapshot??(()=>Fr(e));return ft(r?.subscribe??Yr,n,n)}function Hr(e,t=e.getSnapshot){return yt.useSyncExternalStore(e.subscribe,t,e.getServerSnapshot)}function Xr({hoverStore:e,kbFocusIndexRef:t,store:r}){let n=Hr(e,()=>t.current>=0?e.getSnapshot():null);return Et(Z,{hoverPoint:n,scene:"edge"===n?.nodeOrEdge?r.sceneEdges:r.sceneNodes})}function Vr({viewTransform:e,hoverStore:t,kbFocusIndexRef:r,focusedNavPointRef:n,enableHover:i,tooltipContent:s,margin:o,size:a,adjustedWidth:l,adjustedHeight:d}){let c=Hr(t),u=r.current>=0,h=n.current,y=$r(e,!!c),g=c?Br(c,y):null;return Nt(Rt,{children:[Et(J,{active:u,hoverPoint:g,margin:o,size:a,shape:h?.shape,width:null==h?.w?void 0:h.w*y.k,height:null==h?.h?void 0:h.h*y.k}),i&&Et(ee,{contentOwnsChrome:at(s),x:g?.x??0,y:g?.y??0,containerWidth:l,containerHeight:d,margin:o,className:"stream-network-tooltip",zIndex:2,children:null==c?null:s?s(c):Et(Pr,{data:c})})]})}function Gr(){let e=null,t=new Set;return{getSnapshot:()=>e,getServerSnapshot:()=>null,subscribe:e=>(t.add(e),()=>{t.delete(e)}),set(r){let n="function"==typeof r?r(e):r;e!==n&&(e=n,t.forEach(e=>e()))}}}function Qr(e,t,r="slab-face"){let n=e.style.fill;return(e.style.opacity??1)<=0||(e.style.fillOpacity??1)<=0||"string"==typeof n&&/^\s*(none|transparent)\s*$|^rgba\(.*,\s*0(\.0+)?\s*\)$|^#[\da-f]{3}0$|^#[\da-f]{6}00$/i.test(n)?null:e.faces?.map((n,i)=>Et("path",{"data-perspective-part":r,"data-perspective-face":i,d:n.pathD,fill:"string"==typeof e.style.fill?o(e.style.fill,n.shade):t,fillOpacity:e.style.fillOpacity,opacity:e.style.opacity},`face-${i}`))}function qr(e,t){switch(e.type){case"circle":case"rect":case"arc":{let r,n=e,i=`net-${n.type}-${t}`,s=`${i}-hatch`,o=Ve(n.style.fill)?Ge(n.style.fill,s):void 0,a={fill:o?`url(#${s})`:ie(n.style.fill),...ne(n.style)},l="circle"===n.type&&n._perspectiveToken;if(n.pathD)r=Et("path",{"data-perspective-part":l?"token-top":"slab-top",d:n.pathD,...a});else if("circle"===n.type)r=Et("circle",{cx:n.cx,cy:n.cy,r:n.r,...a});else if("rect"===n.type)r=Et("rect",{x:n.x,y:n.y,width:n.w,height:n.h,...a});else{let e=It().innerRadius(n.innerR).outerRadius(n.outerR).startAngle(n.startAngle+Math.PI/2).endAngle(n.endAngle+Math.PI/2)(se)||"";r=Et("path",{d:e,transform:`translate(${n.cx},${n.cy})`,...a})}return Nt(yt.Fragment,{children:[o&&Et("defs",{children:o}),n.pathD&&Qr(n,a.fill,l?"token-rim":"slab-face"),r]},i)}case"symbol":{let r=e,n=Je(r.symbolType,r.size,r.path),i=r.rotation?`translate(${r.cx},${r.cy}) rotate(${180*r.rotation/Math.PI})`:`translate(${r.cx},${r.cy})`,s=Et("path",{"data-perspective-part":r._perspectiveToken?"token-top":void 0,d:n,transform:i,fill:r.style.fill?ie(r.style.fill):"none",...ne(r.style)},`net-symbol-${t}`);return r.faces?.length?Nt(yt.Fragment,{children:[Qr(r,r.style.fill?ie(r.style.fill):void 0,"token-rim"),s]},`net-symbol-${t}`):s}case"glyph":{let r=e;return re(r,r.cx,r.cy,`net-glyph-${r.id??t}`)}default:return null}}function Kr(e,t){return te(function(e,t){switch(e.type){case"line":{let r=e;return Et("line",{"data-perspective-part":r._perspectivePart,x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,stroke:r.style.stroke||"#999",strokeOpacity:r.style.strokeOpacity,strokeWidth:r.style.strokeWidth??1,strokeDasharray:r.style.strokeDasharray,strokeLinecap:r.style.strokeLinecap,opacity:r.style.opacity},`net-edge-${t}`)}case"bezier":{let r=e,n=`net-bezier-${t}-hatch`,i=Ve(r.style.fill)?Ge(r.style.fill,n):void 0;return Nt(yt.Fragment,{children:[i&&Et("defs",{children:i}),Et("path",{d:r.pathD,"data-perspective-part":r._perspectivePart,fill:i?`url(#${n})`:ie(r.style.fill,"#999"),fillOpacity:r.style.fillOpacity??.5,stroke:r.style.stroke||"none",strokeOpacity:.5*(r.style.strokeOpacity??1),strokeWidth:r.style.strokeWidth,strokeDasharray:r.style.strokeDasharray,strokeLinecap:r.style.strokeLinecap,opacity:r.style.opacity})]},`net-edge-${t}`)}case"ribbon":{let r=e,n=`net-ribbon-${t}-hatch`,i=Ve(r.style.fill)?Ge(r.style.fill,n):void 0;return Nt(yt.Fragment,{children:[i&&Et("defs",{children:i}),Et("path",{d:r.pathD,"data-perspective-part":r._perspectivePart,fill:i?`url(#${n})`:ie(r.style.fill,"#999"),fillOpacity:r.style.fillOpacity??.5,stroke:r.style.stroke||"none",strokeOpacity:.3*(r.style.strokeOpacity??1),strokeWidth:r.style.strokeWidth,strokeDasharray:r.style.strokeDasharray,strokeLinecap:r.style.strokeLinecap,opacity:r.style.opacity})]},`net-edge-${t}`)}case"curved":{let r=e;return Et("path",{d:r.pathD,"data-perspective-part":r._perspectivePart,fill:ie(r.style.fill,"none"),fillOpacity:r.style.fill&&"none"!==r.style.fill?r.style.fillOpacity??.1:void 0,stroke:r.style.stroke||"#999",strokeOpacity:r.style.strokeOpacity,strokeWidth:r.style.strokeWidth??1,strokeDasharray:r.style.strokeDasharray,strokeLinecap:r.style.strokeLinecap,opacity:r.style.opacity},`net-edge-${t}`)}default:return null}}(e,t),e,`network-edge-cursor-${t}`)}function Ur(e){let t=e.id??e.datum?.id??e.datum?.data?.id??e.datum?.data?.name;return null==t?void 0:String(t)}function Zr(e){if("glyph"===e.type&&e.glyph&&"number"==typeof e.size){let t=e.cx??e.x,r=e.cy??e.y;if("number"!=typeof t||"number"!=typeof r)return null;let n=et(e.glyph,e.size);return{x:t+n.centerDx,y:r+n.centerDy,r:Math.max(1,n.radius)}}let t=e.cx??(null!=e.x&&null!=e.w?e.x+e.w/2:e.x),r=e.cy??(null!=e.y&&null!=e.h?e.y+e.h/2:e.y);return"number"!=typeof t||"number"!=typeof r?null:{x:t,y:r,r:"number"==typeof e.r?Math.max(1,e.r):"number"==typeof e.outerR?Math.max(1,e.outerR):"number"==typeof e.size?Math.max(1,tt(e.size)):Math.max(1,e.w??0,e.h??0)/2}}function Jr({annotations:e,sceneNodes:t,viewTransform:r,margin:n,width:i,height:s,activation:o}){let a=$r(r,e?.some(e=>"widget"===e.type)??!1);return e?.filter(e=>"widget"===e.type&&(null!=e.pointId||null!=e.nodeId)&&t).map((e,l)=>{let d=!0===e._annotationDeferred,c=e.pointId??e.nodeId,u=t.find(e=>e.id===c||e.datum?.id===c||e.datum?.data?.id===c||e.datum?.data?.name===c),h=u&&Zr(u);if(!h)return null;let y=Br(h,a);if(r&&(y.x<0||y.y<0||y.x>i||y.y>s))return null;let g=n.left+y.x,p=n.top+y.y,f=e.dx??0,m=e.dy??-16,v=e.width??32,b=e.height??32,x=e.content??Et("span",{style:{fontSize:18,cursor:"default"},children:"ℹ️"});return Et("div",{...oe(e,o),className:d?"annotation-deferred":void 0,"data-annotation-disclosure":d?"deferred":void 0,style:{position:"absolute",left:g+f-v/2,top:p+m-b/2,width:v,height:b,display:"flex",alignItems:"center",justifyContent:"center",zIndex:5},children:x},`widget-${l}`)})??null}var en=/*#__PURE__*/ae(function(e){let{width:t,height:r,totalWidth:n,totalHeight:i,margin:s,labels:o,title:a,description:l,idPrefix:d,decorative:c=!1,legend:u,legendHoverBehavior:h,legendClickBehavior:y,legendHighlightedCategory:g,legendIsolatedCategories:p,legendPosition:f="right",legendLayout:m,foregroundGraphics:v,sceneNodes:b,annotations:x,onAnnotationActivate:w,onObservation:k,chartId:R,chartType:N,autoPlaceAnnotations:T,svgAnnotationRules:A,annotationFrame:I}=e,M=le({onAnnotationActivate:w,onObservation:k,chartId:R,chartType:N}),D=yt.useMemo(()=>{let e=function(e){if(!e)return;let t=[];for(let r of e){let e=Zr(r);e&&t.push({pointId:Ur(r),...e})}return t}(b)??[];return{scales:null,width:t,height:r,frameType:"network",pointNodes:e,sceneNodes:b}},[r,b,t]),P=yt.useMemo(()=>{if(!x)return x;let e=_(x);return T?de({annotations:e,context:D,..."object"==typeof T?T:{}}):e},[x,T,D]),L=yt.useMemo(()=>ce("network"),[]),W=P?ue(P.filter(e=>"widget"!==e.type),L,A,D):null,O=!0===P?.some(e=>"widget"===e.type&&!0===e._annotationDeferred),F=vt(),{titleId:B,descId:z,labelledBy:j}=C(d||R||F);return Nt(Rt,{children:[O&&Et("style",{children:he},"annotation-widget-disclosure-style"),Nt("svg",{"data-semiotic-overlay":"",role:c?"presentation":"img","aria-labelledby":c?void 0:j,width:n,height:i,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[!c&&Nt(Rt,{children:[Et("title",{id:B,children:S(a,"Network Chart")}),Et("desc",{id:z,children:E(a,l,{familyPhrase:"network data visualization",fallback:"Network data visualization"})})]}),Et("g",{transform:`translate(${s.left},${s.top})`,children:Nt(jr,{view:e.viewTransform,width:t,height:r,children:[o.map((e,t)=>function(e,t,r="middle",n="auto"){return Et("text",{x:e.x,y:e.y,textAnchor:e.anchor||r,dominantBaseline:e.baseline||n,fontSize:e.fontSize||11,fontWeight:e.fontWeight,fill:e.fill||"var(--semiotic-text, #333)",stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:e.paintOrder,transform:e.rotate?`rotate(${Math.round(180*e.rotate/Math.PI*100)/100} ${e.x} ${e.y})`:void 0,style:{pointerEvents:"none"},children:e.text},`net-label-${t}`)}(e,t,"start","middle")),W,v]})}),Et(ye,{title:a,totalWidth:n,marginTop:s.top}),ge({legend:u,totalWidth:n,totalHeight:i,margin:s,legendPosition:f,title:a,legendLayout:m,legendHoverBehavior:h,legendClickBehavior:y,legendHighlightedCategory:g,legendIsolatedCategories:p})]}),Et(Jr,{annotations:P,sceneNodes:b,viewTransform:e.viewTransform,margin:s,width:t,height:r,activation:M})]})},"NetworkSVGOverlay");function tn(e){return e&&{...e,sceneNodes:e.sceneNodes?.map(e=>({...e})),htmlMarks:e.htmlMarks?.map(e=>({...e}))}}function rn(e){let t=e.getBoundingClientRect();return{x:t.left+e.clientLeft,y:t.top+e.clientTop,width:e.clientWidth,height:e.clientHeight}}function nn(e,t){let r=Math.max(e.x,t.x),n=Math.max(e.y,t.y);return{x:r,y:n,width:Math.max(0,Math.min(e.x+e.width,t.x+t.width)-r),height:Math.max(0,Math.min(e.y+e.height,t.y+t.height)-n)}}function sn(e,t){return e.width>0&&e.height>0&&t.x+t.width>=e.x&&t.x<=e.x+e.width&&t.y+t.height>=e.y&&t.y<=e.y+e.height}var on=[],an=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]),ln={position:"absolute",top:0,left:0,pointerEvents:"none"},dn=/*#__PURE__*/yt.memo(function({marks:e}){return Et(Rt,{children:e.map(e=>Et("div",{className:"semiotic-network-html-mark","data-mark-id":e.id,style:{position:"absolute",transform:`translate(${e.x}px, ${e.y}px)`,width:e.width,height:e.height,pointerEvents:"none"},children:e.content},e.id))})},(e,t)=>e.marks.length===t.marks.length&&e.marks.every((e,r)=>{let n=t.marks[r];return e.id===n.id&&e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height&&e.content===n.content}));function cn({marks:e,margin:t,selection:r=null,width:n,height:i,viewTransform:s,viewport:o,htmlMarkCulling:a,onViewportChange:l}){let d=yt.useRef(null),[c,u]=yt.useState(null),h=function({containerRef:e,marks:t,width:r,height:n,margin:i,focusedId:s,viewTransform:o,viewport:a,htmlMarkCulling:l,onViewportChange:d}){let c=t??on,[u,h]=bt(null),y=gt(null);mt(()=>{y.current?.schedule()},[c,r,n,i.left,i.top]),mt(()=>{let t=e.current,r=t?o?t.closest(".stream-network-frame"):function(e,t){if(void 0!==t?.scrollContainer)return t.scrollContainer;if(t?.scrollContainerRef)return t.scrollContainerRef.current;let r=e.ownerDocument.defaultView;for(let t=e.parentElement;t&&r;t=t.parentElement){let e=r.getComputedStyle(t);if(/(auto|scroll|overlay)/.test(`${e.overflow} ${e.overflowX} ${e.overflowY}`))return t}return null}(t,a):null,n=t&&r?function(e,t){let r=e.ownerDocument.defaultView,n=new Map;for(let i of[e.parentElement,t.parentElement])for(let e=i;e;e=e.parentElement){if(e===t||n.has(e))continue;let i=r.getComputedStyle(e),s=/(auto|scroll|overlay|hidden|clip)/.test(i.overflowX||i.overflow),o=/(auto|scroll|overlay|hidden|clip)/.test(i.overflowY||i.overflow);(s||o)&&n.set(e,{element:e,x:s,y:o})}return[...n.values()]}(t,r):[],i=y.current;if(i?.layer!==t||i?.root!==r||i.clips.length!==n.length||!n.every((e,t)=>it(e,i.clips[t])))if(i?.dispose(),y.current=null,t&&r){let e=t.ownerDocument.defaultView,i=null,s=()=>{i=null;let e=function(e,t,r){let n=rn(t);if(n.width<=0||n.height<=0)return null;let i=e.ownerDocument.defaultView,s=nn(n,{x:0,y:0,width:i.innerWidth,height:i.innerHeight});for(let e of r){let t=rn(e.element);s=nn(s,{x:e.x?t.x:s.x,y:e.y?t.y:s.y,width:e.x?t.width:s.width,height:e.y?t.height:s.height})}let o=e.getBoundingClientRect();return{...s,x:s.x-o.left,y:s.y-o.top}}(t,r,n);h(t=>it(t,e)?t:e)},o=()=>{null===i&&(i=e.requestAnimationFrame(s))};t.ownerDocument.addEventListener("scroll",o,{passive:!0,capture:!0}),e.addEventListener("resize",o,{passive:!0});let a=new ResizeObserver(o),l=new Set([r,t.parentElement,...n.map(e=>e.element)]);for(let e of l)a.observe(e);let d=()=>{null!==i&&e.cancelAnimationFrame(i),a.disconnect(),t.ownerDocument.removeEventListener("scroll",o,!0),e.removeEventListener("resize",o)};y.current={layer:t,root:r,clips:n,schedule:o,dispose:d},s()}else null!==u&&h(null)}),mt(()=>()=>{y.current?.dispose(),y.current=null},[]);let g=Number.isFinite(l?.overscan)&&l.overscan>=0?l.overscan:400,p=pt(()=>{let e=null!=r&&null!=n?{x:0,y:0,width:r,height:n}:null,t=u&&e?nn(u,e):u,a=o?t??e:u,d=o&&(t??e)?zr(t??e,Fr(o)):t,h=a?{x:a.x-g,y:a.y-g,width:a.width+2*g,height:a.height+2*g}:null,y=o&&h?zr(h,Fr(o)):h&&e?nn(h,e):h,p=new Set(l?.pinnedIds);null!==s&&p.add(s);let f=!1!==l?.enabled&&y?c.filter(e=>p.has(e.id)||sn(y,e)):c,m={...e?{plotRect:{...e,x:i.left,y:i.top}}:{},visibleRect:d,renderRect:y,visibleMarkIds:d?c.filter(e=>sn(d,e)).map(e=>e.id):null,mountedMarkIds:f.map(e=>e.id)};return{mounted:f,snapshot:m}},[c,u,r,n,g,l?.enabled,l?.pinnedIds,s,o,i.left,i.top]),f=p(),[,m]=xt(e=>e+1,0),v=gt(void 0),b=pt(e=>{d?it(v.current,e)||(v.current=e,d(e)):v.current=void 0},[d]);return wt(()=>{let e=p();an(e.mounted,f.mounted)&&b(e.snapshot)},[p,b,f.mounted]),mt(()=>Lr(o)?.subscribe(()=>{let e=p();an(e.mounted,f.mounted)?b(e.snapshot):m()},!0),[p,b,f.mounted,o]),f.mounted}({containerRef:d,marks:e,width:n,height:i,focusedId:c,viewTransform:s,viewport:o,htmlMarkCulling:a,onViewportChange:l,margin:t});if(yt.useLayoutEffect(()=>{if(null===c||e?.some(e=>e.id===c))return;let t=d.current,r=t?.ownerDocument;r?.activeElement===r?.body&&t?.closest(".stream-network-frame")?.focus({preventScroll:!0}),u(null)},[e,c]),!(e&&0!==e.length||l||null!==c))return null;let y=Fr(s),g=Et("div",{className:"semiotic-network-html-marks",ref:d,onFocusCapture:e=>{let t=e.target.closest("[data-mark-id]");t&&e.currentTarget.contains(t)&&u(t.dataset.markId??null)},onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||u(null)},style:{...ln,transform:`translate(${t.left}px, ${t.top}px)`,...s?{width:n,height:i,overflow:"clip"}:{}},children:Et("div",{ref:Wr(s,!0),style:{transformOrigin:"0 0",transform:`translate(${y.x}px, ${y.y}px) scale(${y.k})`},children:Et(dn,{marks:h.map(e=>({...e}))})})});return Et(H,{value:r,children:g})}var un=/*#__PURE__*/yt.lazy(()=>import("./c-3GIPT46Z.min.js"));function hn(e){let{nodes:t,edges:r,chartTitle:n,chartType:i,tableId:s}=e,o=pe(),{nodeCount:a,edgeCount:l}=function(e,t){let r=0,n=0;for(let t of e)t&&"object"==typeof t&&null!==t.datum&&r++;for(let e of t){if(!e||"object"!=typeof e)continue;let t=e.datum,r=t&&"object"==typeof t&&!Array.isArray(t)&&"__chordEdges"in t?t.__chordEdges:void 0;n+=Array.isArray(r)?r.length:1}return{nodeCount:r,edgeCount:n}}(t,r);return a||l?Et(fe,{interaction:o,tableId:s,regionLabel:`Data summary for ${n||i}`,countLabel:`${nt(a,"node")}, ${nt(l,"edge")}`,className:rt,children:o.isExpanded&&Et(yt.Suspense,{fallback:Et("div",{role:"status",children:"Loading data summary…"}),children:Et(un,{...e,revealRows:o.revealRows})})}):s?Et("span",{id:s,tabIndex:-1,style:Ye}):null}function yn(e){return Nt(Rt,{children:[Et(me,{tableId:e.tableId}),Et(hn,{...e})]})}function gn(e,t,r,n){let{accessibleTable:i=!0,summary:s,title:o}=e;return Nt(Rt,{children:[i&&Et(ve,{accessibleTable:i,children:Et(yn,{sceneRevision:n,nodes:t.sceneNodes,edges:t.sceneEdges,chartType:"Network chart",tableId:r,chartTitle:"string"==typeof o?o:void 0})}),Et(be,{summary:s})]})}function pn(e){return e._cachedPath2D&&e._cachedPath2DSource===e.pathD||(e._cachedPath2D=new Path2D(e.pathD),e._cachedPath2DSource=e.pathD),e._cachedPath2D}function fn(e,t){let r="source-over"===e.globalCompositeOperation;for(let n of t){if(r&&(0===n.style.opacity||0===n.style.strokeOpacity)&&(!n.style.fill||"none"===n.style.fill||0===(n.style.fillOpacity??("curved"===n.type?.1:n.style.opacity)))&&(!("_pulseIntensity"in n)||!n._pulseIntensity))continue;if("line"===n.type){if("none"===n.style.stroke||(n.style.strokeWidth??1)<=0)continue}else if(!n.pathD)continue;let t=e.globalAlpha;if(e.save(),n.style.strokeDasharray&&e.setLineDash(n.style.strokeDasharray.split(/[\s,]+/).map(Number)),n.style.strokeLinecap&&(e.lineCap=n.style.strokeLinecap),"line"===n.type)e.beginPath(),e.moveTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),mn(e,n,t),j(n)&&(e.setLineDash([]),e.strokeStyle=n._pulseColor||"rgba(255,255,255,0.6)",e.lineWidth=(n.style.strokeWidth??1)+3*n._pulseIntensity,e.globalAlpha=t*n._pulseIntensity*.4,e.stroke());else{let r=pn(n);"curved"===n.type&&mn(e,n,t,r),vn(e,n,t,r),"curved"!==n.type&&(mn(e,n,t,r),j(n)&&(e.fillStyle=n._pulseColor||"rgba(255,255,255,0.6)",e.globalAlpha=t*n._pulseIntensity*("bezier"===n.type?.2:.25),e.fill(r)))}e.restore()}}function mn(e,t,r,n){let i="bezier"===t.type||"ribbon"===t.type,s=t.style.strokeWidth??(i?.5:1);if(s<=0||"none"===t.style.stroke||i&&!t.style.stroke)return;let o=t.style.stroke||"#999";e.strokeStyle=Qe(e,o)||o,e.lineWidth=s;let a="bezier"===t.type?.5:"ribbon"===t.type?.3:1;e.globalAlpha=r*(t.style.opacity??1)*(t.style.strokeOpacity??1)*a,n?e.stroke(n):e.stroke()}function vn(e,t,r,n){if(!t.style.fill||"none"===t.style.fill)return;let i="bezier"===t.type?t._gradient:void 0;if(i){let r=e.createLinearGradient(i.x0,i.y0??0,i.x1,i.y1??0),n="string"==typeof t.style.fill?t.style.fill:"#999",s=Qe(e,n)||n;r.addColorStop(0,1===i.from?s:"transparent"),r.addColorStop(1,1===i.to?s:"transparent"),e.fillStyle=r}else e.fillStyle=qe(e,t.style.fill,"#007bff");e.globalAlpha=r*(t.style.opacity??1)*(t.style.fillOpacity??("curved"===t.type?.1:.5)),e.fill(n)}var bn=null;function xn(e){if(typeof Path2D>"u"||!e)return null;bn||(bn=new Map);let t=bn.get(e);return t||(t=new Path2D(e),bn.size>2048&&bn.clear(),bn.set(e,t)),t}function wn(e,t,r,n){if(!r?.length||!t.fill)return;let i=e.globalAlpha,s=i*(t.opacity??1)*(t.fillOpacity??1);if(!(s>0))return;let a=qe(e,t.fill,n),l=a;if("string"!=typeof a||!/^\s*(none|transparent)\s*$/i.test(a)&&(e.fillStyle=a,l=e.fillStyle,!/^rgba\(.*,\s*0(\.0+)?\s*\)$/.test(l))){e.globalAlpha=s;for(let t of r){let r=xn(t.pathD);r&&(e.fillStyle="string"==typeof l?o(l,t.shade):l,e.fill(r))}e.globalAlpha=i}}function kn(e,t,r){let n="source-over"===e.globalCompositeOperation;for(let i of t){if(i.type!==r)continue;let t=i;if("circle"===t.type&&t.r<=0||"rect"===t.type&&(t.w<=0||t.h<=0))continue;let s="arc"===t.type?void 0:t._pulseIntensity;if(n&&Ke(t.style,s))continue;e.save();let o=t.pathD?xn(t.pathD):null;o?wn(e,t.style,t.faces,"#007bff"):"circle"===t.type?(e.beginPath(),e.arc(t.cx,t.cy,t.r,0,2*Math.PI)):"arc"===t.type&&(e.beginPath(),e.arc(t.cx,t.cy,t.outerR,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerR,t.endAngle,t.startAngle,!0),e.closePath()),Ue(e,t.style,"#007bff",()=>{o?e.fill(o):"rect"===t.type?e.fillRect(t.x,t.y,t.w,t.h):e.fill()}),Ze(e,t.style,()=>{o?e.stroke(o):"rect"===t.type?e.strokeRect(t.x,t.y,t.w,t.h):e.stroke()}),"circle"===t.type?Y(e,t,e.globalAlpha):"rect"===t.type&&$(e,t,e.globalAlpha,o),e.restore()}}function _n(e,t){if(!t.some(e=>"symbol"===e.type&&e.faces))return void u(e,t);let r=e.globalAlpha;for(let n of t)"symbol"===n.type&&(n.faces&&(wn(e,n.style,n.faces,"#007bff"),e.globalAlpha=r),u(e,[n]))}function Cn(e){return xe(e.sceneNodes.length,e.sceneEdges.length,e.perspective.label("Network chart"))}var Sn=2*Math.PI,En=e=>(e%Sn+Sn)%Sn;function Rn(e,t){let r=1-t;return r**3*e[0]+3*r*r*t*e[1]+3*r*t*t*e[2]+t**3*e[3]}function Nn(e,t){let r=e.map(e=>e[0]),n=e.map(e=>e[1]);t(r[0],n[0]),t(r[3],n[3]);for(let e of[r,n]){let i=-e[0]+3*e[1]-3*e[2]+e[3],s=2*(e[0]-2*e[1]+e[2]),o=e[1]-e[0],a=Math.abs(i)<1e-12?0===s?[]:[-o/s]:s*s-4*i*o<0?[]:[(-s+Math.sqrt(s*s-4*i*o))/(2*i),(-s-Math.sqrt(s*s-4*i*o))/(2*i)];for(let e of a)e>0&&e<1&&t(Rn(r,e),Rn(n,e))}}function Tn(e,t,r,n){let[i,s]=r.map(Math.abs);if(n(...e),n(...t),0===i||0===s||e[0]===t[0]&&e[1]===t[1])return;let o=r[2]*Math.PI/180,a=Math.cos(o),l=Math.sin(o),d=(e[0]-t[0])/2,c=(e[1]-t[1])/2,u=a*d+l*c,h=-l*d+a*c,y=Math.hypot(u/i,h/s);y>1&&(i*=y,s*=y);let g=(u/i)**2+(h/s)**2,p=(r[3]===r[4]?-1:1)*Math.sqrt(Math.max(0,(1-g)/g)),f=p*i*h/s,m=-p*s*u/i,v=a*f-l*m+(e[0]+t[0])/2,b=l*f+a*m+(e[1]+t[1])/2,x=Math.atan2((h-m)/s,(u-f)/i),w=Math.atan2((-h-m)/s,(-u-f)/i),k=r[4]?En(w-x):-En(x-w),_=Math.atan2(-s*l,i*a),C=Math.atan2(s*a,i*l);for(let e of[_,_+Math.PI,C,C+Math.PI])En(k>=0?e-x:x-e)<=Math.abs(k)+1e-12&&n(v+i*a*Math.cos(e)-s*l*Math.sin(e),b+i*l*Math.cos(e)+s*a*Math.sin(e))}function An(e){let t=0,r="",n="",i=[0,0],s=[0,0],o=[0,0],a=1/0,l=1/0,d=-1/0,c=-1/0,u=(e,t)=>{a=Math.min(a,e),l=Math.min(l,t),d=Math.max(d,e),c=Math.max(c,t)},h=()=>{for(;t<e.length&&/[\s,]/.test(e[t]);)t++},y=(r=!1)=>{h();let n=r?/^[01]/.exec(e.slice(t)):/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/.exec(e.slice(t));return n?(t+=n[0].length,Number(n[0])):NaN};for(;t<e.length&&(h(),t!==e.length);){/[a-z]/i.test(e[t])&&(r=e[t++]);let a=r.toUpperCase(),l=r!==a;if(!n&&"M"!==a)return null;if("Z"===a){u(...i),u(...s),i=[...s],n="Z",r="";continue}let d={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7}[a];if(!d)return null;let c=Array.from({length:d},(e,t)=>y("A"===a&&(3===t||4===t)));if(!c.every(Number.isFinite))return null;let h=e=>[c[e]+(l?i[0]:0),c[e+1]+(l?i[1]:0)],g="H"===a?[c[0]+(l?i[0]:0),i[1]]:"V"===a?[i[0],c[0]+(l?i[1]:0)]:h(d-2),p=[2*i[0]-o[0],2*i[1]-o[1]];if("C"===a||"S"===a){let e="C"===a?h(0):/[CS]/.test(n)?p:i;o=h(d-4),Nn([i,e,o,g],u)}else"Q"===a||"T"===a?(o="Q"===a?h(0):/[QT]/.test(n)?p:i,Nn([i,[i[0]+2*(o[0]-i[0])/3,i[1]+2*(o[1]-i[1])/3],[g[0]+2*(o[0]-g[0])/3,g[1]+2*(o[1]-g[1])/3],g],u)):"A"===a?Tn(i,g,c,u):"M"!==a&&(u(...i),u(...g));i=g,"M"===a&&(s=[...g],r=l?"l":"L"),n=a}return[a,l,d,c].every(Number.isFinite)?{x:a,y:l,w:d-a,h:c-l}:null}var In=/*#__PURE__*/new WeakMap;function Mn(e){let t=In.get(e);return(!t||t.source!==e.pathD)&&(t={source:e.pathD,box:An(e.pathD)},In.set(e,t)),t.box}function Dn(e){if(1===e.length)return e[0];let t={x0:1/0,y0:1/0,x1:-1/0,y1:-1/0,radius:0,order:-1};for(let r of e)t.x0=Math.min(t.x0,r.x0),t.y0=Math.min(t.y0,r.y0),t.x1=Math.max(t.x1,r.x1),t.y1=Math.max(t.y1,r.y1),t.radius=Math.max(t.radius,r.radius),t.order=Math.max(t.order,r.order);if(e.length<=8)t.children=e.sort((e,t)=>t.order-e.order);else{let r=t.x1-t.x0>=t.y1-t.y0;e.sort((e,t)=>r?e.x0+e.x1-(t.x0+t.x1):e.y0+e.y1-(t.y0+t.y1));let n=e.length>>1;t.children=[Dn(e.slice(0,n)),Dn(e.slice(n))].sort((e,t)=>t.order-e.order)}return t}function Pn(e,t,r,n,i){let s=null,o=-1,a=e=>{if(e.order<=o)return;let l=10*Math.max(n,e.radius)+1e-7;if(!(t<e.x0-l||t>e.x1+l||r<e.y0-l||r>e.y1+l))if(e.children)e.children.forEach(a);else{let t=i(e.order);t&&(s=t,o=e.order)}};return a(e),s}function Ln(e){let t=e.style.strokeWidth??1;return Number.isFinite(t)?Math.max(0,t/2):1/0}var Wn=/*#__PURE__*/new WeakMap;function On(e){return[e,null!=e.datum&&!1!==e.interactive,e.style.strokeWidth,!!e.style.fill&&"none"!==e.style.fill,..."line"===e.type?[e.x1,e.y1,e.x2,e.y2]:[e.pathD]]}function Fn(e){let t=e.map(On),r=Wn.get(e);if(r&&r.signatures.length===t.length&&t.every((e,t)=>e.length===r.signatures[t].length&&e.every((e,n)=>2===n||Object.is(e,r.signatures[t][n])))){if(t.some((e,t)=>!Object.is(e[2],r.signatures[t][2]))){let t=r=>(r.radius=r.children?Math.max(0,...r.children.map(t)):Ln(e[r.order]),r.radius);t(r.index.root)}return r.signatures=t,r.index}let n=[];e.forEach((e,t)=>{if(null==e.datum||!1===e.interactive)return;let r="line"===e.type?{x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),w:Math.abs(e.x2-e.x1),h:Math.abs(e.y2-e.y1)}:Mn(e),i=Ln(e);for(let s of function(e,t){if(!t||t.w<256||t.h<256||"line"===e.type||e.style.fill&&"none"!==e.style.fill)return null;let r=e.pathD.match(/[a-zA-Z]|[-+]?(?:\d*\.?\d+)(?:[eE][-+]?\d+)?/g);if(!r||10!==r.length||"M"!==r[0]||"C"!==r[3])return null;let n=[1,4,6,8].map(e=>[Number(r[e]),Number(r[e+1])]),i=[],s=(e,t)=>{let r=e.map(e=>e[0]),n=e.map(e=>e[1]),o=Math.min(...r),a=Math.min(...n),l=Math.max(...r)-o,d=Math.max(...n)-a;if(!t||l<4||d<4)return void i.push({x:o,y:a,w:l,h:d});let c=[e[0]],u=[e[3]];for(;e.length>1;)e=e.slice(1).map((t,r)=>[(t[0]+e[r][0])/2,(t[1]+e[r][1])/2]),c.push(e[0]),u.unshift(e[e.length-1]);s(c,t-1),s(u,t-1)};return s(n,2),i}(e,r)??[r])n.push({x0:s?.x??-1/0,y0:s?.y??-1/0,x1:s?s.x+s.w:1/0,y1:s?s.y+s.h:1/0,radius:i,order:t})});let i={edges:e,root:Dn(n)};return Wn.set(e,{index:i,signatures:t}),i}function Bn(e){if(!e.length||e.some(e=>"rect"!==e.type||![e.x,e.y,e.w,e.h,e.x+e.w,e.y+e.h].every(e=>Number.isFinite(e)&&Math.abs(e)<=Number.MAX_SAFE_INTEGER)))return;let t=e;return{nodes:e,root:Dn(t.map((e,t)=>({x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h,radius:0,order:t}))),paintOrder:t.some(e=>!!e._hitPath)}}function zn(e,t){return(e.depth??-1)>(t?.depth??-1)}function jn(e,t,r,n){let i=r<=e.r,s=n<=t.r;if(i!==s)return i;if(i&&s){let r=t.r-e.r;if(r&&Math.hypot(e.cx-t.cx,e.cy-t.cy)<=Math.abs(r)+1e-6)return r>0}return r<n||r===n&&zn(e,t)}var Yn={rect:0,circle:1,arc:2,symbol:3,glyph:4};function $n(e,t){let r=e.w*e.h,n=t.w*t.h;return r<n||r===n&&zn(e,t)}function Hn(e,t,r,n,i=0){return{type:e,mark:t,datum:t.datum,x:r,y:n,distance:i}}function Xn(e,t,r,n,i){if(!e.datum)return null;switch(e.type){case"circle":return e.pathD&&!e._perspectiveToken?Gn(e,t,r,e.cx,e.cy):Vn(e,t,r,e.cx,e.cy,e.r,n,i);case"rect":{let n=function(e,t,r){let n=D(t,r,e);return n.hit?Hn("node",e,n.cx,n.cy):null}(e,t,r);if(!n||!e._hitPath)return n;let i=e._hitPath,[s,o,a,l]=i.transform,d=Kn(i),c=qn();if(!d||!c||0===a||0===l)return null;let u=(t-s)/a,h=(r-o)/l;if(i.fill&&c.isPointInPath(d,u,h))return n;if(i.strokeWidth>0){let e=c.lineWidth;c.lineWidth=i.strokeWidth;let t=c.isPointInStroke(d,u,h);if(c.lineWidth=e,t)return n}return null}case"arc":return function(e,t,r,n){if(e.pathD)return Gn(e,t,r,t,r);let i=t-e.cx,s=r-e.cy,o=Math.sqrt(i*i+s*s),a=2/n;if(o<e.innerR-a||o>e.outerR+a)return null;let l=P(Math.atan2(s,i)),d=P(e.startAngle),c=P(e.endAngle);if(d<=c?l>=d&&l<=c:l>=d||l<=c){let t=(e.startAngle+e.endAngle)/2,r=(e.innerR+e.outerR)/2;return Hn("node",e,e.cx+r*Math.cos(t),e.cy+r*Math.sin(t))}return null}(e,t,r,i);case"symbol":return Vn(e,t,r,e.cx,e.cy,tt(e.size),n,i);case"glyph":{let s=et(e.glyph,e.size);return Vn(e,t,r,e.cx+s.centerDx,e.cy+s.centerDy,s.radius,n,i)}default:return null}}function Vn(e,t,r,n,i,s,o,a){let l=t-n,d=r-i,c=Math.sqrt(l*l+d*d);return c<=M(s,o,a)?Hn("node",e,n,i,c):null}function Gn(e,t,r,n,i){let s=Kn(e),o=qn();return s&&o&&o.isPointInPath(s,t,r)?Hn("node",e,n,i):null}var Qn=null;function qn(){if(!Qn){let e=document.createElement("canvas");e.width=e.height=1,Qn=e.getContext("2d")}return Qn}function Kn(e){if(e._cachedPath2D&&e._cachedPath2DSource===e.pathD)return e._cachedPath2D;try{return e._cachedPath2D=new Path2D(e.pathD),e._cachedPath2DSource=e.pathD,e._cachedPath2D}catch{return null}}function Un(e){let{clientX:t,clientY:r,canvasRect:n,margin:i,adjustedWidth:s,adjustedHeight:o,sceneNodes:a,sceneEdges:l,nodeQuadtree:d,maxNodeRadius:c,hitRadius:u=12,includeEdges:h=!0}=e,y=t-n.left-i.left,g=r-n.top-i.top;if(y<0||y>s||g<0||g>o)return{kind:"miss-outside"};let p=Fr(e.viewTransform),f=function(e,t,r,n,i=12,s,o=0,a=!0,l=1,d,c){let u=null,h=c?.nodes===e?c:void 0,y=h?h.paintOrder:e.some(e=>"rect"===e.type&&e._hitPath);if(y&&(s=null),s){let e=I(s,r,n,i,o,e=>e.cx,e=>e.cy,e=>e.r,jn,l);e&&(u=Hn("node",e.node,e.node.cx,e.node.cy,e.distance))}for(let t of h?function(e,t,r){let n=[];return Pn(e.root,t,r,0,e=>(n.push(e),null)),n.sort((e,t)=>e-t).map(t=>e.nodes[t])}(h,r,n):e){if(s&&"circle"===t.type)continue;let e=Xn(t,r,n,i,l);if(!e)continue;if(!u||y){u=e;continue}let o=u.mark;(t.type!==o.type?Yn[t.type]>Yn[o.type]:"rect"===t.type?$n(t,o):"circle"===t.type?jn(t,o,e.distance,u.distance):e.distance<u.distance)&&(u=e)}if(u)return u;if(!a)return null;let g=5/l,p=null,f=-1,m=e=>{let i=t[e];if(null!=i.datum&&!1!==i.interactive){let t=function(e,t,r,n){switch(e.type){case"bezier":case"ribbon":case"curved":return function(e,t,r,n){if(!e.pathD)return null;if(function(e,t,r,n){let i=Mn(e);return!!i&&(t<i.x-n||t>i.x+i.w+n||r<i.y-n||r>i.y+i.h+n)}(e,t,r,10*Math.max(n,(e.style.strokeWidth??1)/2)+1e-7))return null;let i=Kn(e),s=qn();if(!i||!s)return null;try{if(e.style.fill&&"none"!==e.style.fill&&s.isPointInPath(i,t,r))return Hn("edge",e,t,r);if("none"===e.style.stroke||(e.style.strokeWidth??1)<=0)return null;let o=e.style.strokeWidth??1,a=Math.max(2*n,o),l=s.lineWidth;try{if(s.lineWidth=a,!s.isPointInStroke(i,t,r))return null;for(let n=0;n<4;n++){let l=o+(a-o)*n/4;if(s.lineWidth=l,s.isPointInStroke(i,t,r))return Hn("edge",e,t,r,(l-o)/2)}return Hn("edge",e,t,r,(a-o)/2)}finally{s.lineWidth=l}}catch{}return null}(e,t,r,n);case"line":return function(e,t,r,n){if("none"===e.style.stroke||(e.style.strokeWidth??1)<=0)return null;n=Math.max(n,(e.style.strokeWidth??1)/2);let i=e.x2-e.x1,s=e.y2-e.y1,o=i*i+s*s;if(0===o)return null;let a=((t-e.x1)*i+(r-e.y1)*s)/o;a=Math.max(0,Math.min(1,a));let l=e.x1+a*i,d=e.y1+a*s,c=Math.sqrt((t-l)**2+(r-d)**2);return c<=n?Hn("edge",e,l,d,Math.max(0,c-(e.style.strokeWidth??1)/2)):null}(e,t,r,n);default:return null}}(i,r,n,g);if(t&&(!p||t.distance<p.distance||t.distance===p.distance&&e>f)&&(p=t,f=e),0===t?.distance)return t}return null};if(d?.edges===t)!function(e,t,r,n){let i=new Set;Pn(e.root,t,r,n,t=>i.has(t)?null:(i.add(t),((e,t)=>m(t))(e.edges[t],t)))}(d,r,n,g);else for(let e=t.length-1;e>=0&&!m(e);e--);return p}(a,l,(y-p.x)/p.k,(g-p.y)/p.k,u/p.k,d,c,h,p.k,e.edgeIndex,e.rectIndex);if(!f)return{kind:"miss"};let m=f.datum||{};return{kind:"hit",hover:$e(m,f.x,f.y,{nodeOrEdge:f.type}),mark:f.mark}}var Zn="StreamNetworkFrame";function Jn(e,t,r){return e.nodes=Se(t),e.edges=Se(r),e.nodes||e.edges}var ei=/*#__PURE__*/new WeakMap;function ti(e){let t=e.lastCustomLayoutResult;if(!t)return void ei.delete(e);let r=e.getUpdateSnapshot().revisions;ei.set(e,{hits:{edgeIndex:!1===t.edgeHitTesting?void 0:Fn(e.sceneEdges),rectIndex:Bn(e.sceneNodes)},nodes:e.sceneNodes,edges:e.sceneEdges,geometry:r.sceneGeometry,style:r.sceneStyle})}function ri(e){let t=ei.get(e);if(!t)return;let r=e.getUpdateSnapshot().revisions;return t.geometry===r.sceneGeometry&&t.style===r.sceneStyle&&t.nodes===e.sceneNodes&&t.edges===e.sceneEdges?t.hits:void 0}var ni=[800,600],ii=/*#__PURE__*/ae(/*#__PURE__*/kt(/*#__PURE__*/_t(function(t,o){let{chartType:a,nodes:l,edges:g,data:p,initialEdges:f,nodeIDAccessor:m="id",sourceAccessor:k="source",targetAccessor:_="target",valueAccessor:C="value",edgeIdAccessor:S,edgeIdentity:E,childrenAccessor:I,hierarchySum:M,orientation:D="horizontal",nodeAlign:P="justify",nodePaddingRatio:j=.05,nodeWidth:Y=15,iterations:$=300,forceStrength:H=.1,layoutExecution:V="auto",layoutLoadingContent:G,onLayoutStateChange:q,padAngle:U=.01,groupWidth:Z=20,sortGroups:J,edgeSort:ee,treeOrientation:re="vertical",edgeType:ne="curve",padding:ie,paddingTop:se,tensionConfig:oe,showParticles:ae=!1,particleStyle:le,renderMode:de,perspective:ce,nodeStyle:ue,edgeStyle:he,colorBy:ye,colorScheme:ge="category10",edgeColorBy:pe="source",edgeOpacity:fe=.5,colorByDepth:me=!1,nodeSize:ve=8,nodeSizeRange:be=[5,20],nodeLabel:xe,showLabels:Se=!0,labelMode:Ye,size:$e=ni,responsiveWidth:He,responsiveHeight:Ve,margin:Ge,background:qe,maxDevicePixelRatio:Ke,enableHover:Ue=!0,tooltipContent:Ze,customHoverBehavior:Je,customClickBehavior:et,onObservation:tt,annotationObservationCallback:rt,chartId:nt,onTopologyChange:it,annotations:st,onAnnotationActivate:ot,autoPlaceAnnotations:at,svgAnnotationRules:dt,legend:ct,legendPosition:ut,legendLayout:ht,legendHoverBehavior:ft,legendClickBehavior:vt,legendHighlightedCategory:xt,legendIsolatedCategories:kt,legendCategoryAccessor:_t,onCategoriesChange:Tt,title:At,foregroundGraphics:It,backgroundGraphics:Mt,decay:Dt,pulse:Pt,transition:Lt,animate:Ot,staleness:Ft,frameScheduler:Bt,clock:zt,random:jt,seed:Yt,paused:$t=!1,suspendWhenHidden:Xt=!0,thresholds:Vt,description:Gt,orbitMode:Qt,orbitSize:qt,orbitSpeed:Ut,orbitRevolution:Zt,orbitRevolutionStyle:Jt,orbitEccentricity:er,orbitShowRings:tr,orbitAnimated:rr,customNetworkLayout:nr,onLayoutError:or,layoutConfig:ar,layoutSelection:lr}=t,dr=y(a),cr=gt(!0),ur=Ne({sizeProp:$e,responsiveWidth:He,responsiveHeight:Ve,userMargin:Ge,marginDefault:dr,title:At,legend:ct,legendPosition:ut,legendLayout:ht,legendMarginReserved:t.__legendMarginReservedFor===ct,animate:Ot,transitionProp:Lt,frameScheduler:Bt,clock:zt,random:jt,seed:Yt,paused:$t,suspendWhenHidden:Xt,themeDirtyRef:cr}),{reducedMotionRef:hr,responsiveRef:yr,size:gr,margin:pr,adjustedWidth:fr,adjustedHeight:mr,transition:vr,introEnabled:br,tableId:xr,rafRef:wr,renderFnRef:kr,scheduleRender:_r,frameRuntime:Cr,currentTheme:Sr}=ur,{resolvedForeground:Er,resolvedBackground:Rr,themeBackground:Nr,surfaceBackground:Tr}=L({foregroundGraphics:It,backgroundGraphics:Mt,size:gr,margin:pr,scales:null,background:qe,themeBackgroundColor:Sr.colors.background}),Dr=Te(),Pr=Ae(),Wr=`${xr}-frame`,[Or,Br]=bt(()=>!Q&&Pr?document.getElementById(Wr)?.innerHTML??0:0),zr="string"==typeof Or?Or:null,Yr=Ht.has(a),$r=Yr?p||(Array.isArray(g)?void 0:g):void 0,Hr=null!=l||null!=g,Qr=!1===Ot,Ur=Ct(()=>({...ir,...oe,...Qr?{transitionDuration:0}:{}}),[oe,Qr]),Zr=Ct(()=>({...sr,...le}),[le]),Jr=function(e){let t=yt.useRef(null),r=s(e);return(!t.current||t.current.key!==r)&&(t.current={key:r,value:e}),t.current.value}(ce),rn=Ct(()=>function(e){let{currentTheme:t,...r}=e;return{...r,themeCategorical:t?.colors?.categorical,themeSequential:t?.colors?.sequential,themeSelectionOpacity:t?.colors?.selectionOpacity,themeSemantic:lt(t)}}({chartType:a,clock:Cr.now,random:jt,seed:Yt,nodeIDAccessor:m,sourceAccessor:k,targetAccessor:_,valueAccessor:C,edgeIdAccessor:S,edgeIdentity:E,childrenAccessor:I,hierarchySum:M,orientation:D,nodeAlign:P,nodePaddingRatio:j,nodeWidth:Y,iterations:$,forceStrength:H,padAngle:U,groupWidth:Z,sortGroups:J,edgeSort:ee,treeOrientation:re,edgeType:ne,padding:ie,paddingTop:se,tensionConfig:Ur,showParticles:ae,particleStyle:Zr,nodeStyle:ue,edgeStyle:he,nodeLabel:xe,showLabels:Se,labelMode:Ye,colorBy:ye,colorScheme:ge,edgeColorBy:pe,edgeOpacity:fe,colorByDepth:me,nodeSize:ve,nodeSizeRange:be,decay:Dt,pulse:Pt,transition:vr,introAnimation:br,staleness:Ft,thresholds:Vt,orbitMode:Qt,orbitSize:qt,orbitSpeed:Ut,orbitRevolution:Zt,orbitRevolutionStyle:Jt,orbitEccentricity:er,orbitShowRings:tr,orbitAnimated:rr,customNetworkLayout:nr,onLayoutError:or,layoutConfig:ar,perspective:Jr,currentTheme:Sr}),[Jr,a,Cr.now,jt,Yt,m,k,_,C,S,E,I,M,D,P,j,Y,$,H,U,Z,J,ee,re,ne,ie,se,Ur,ae,Zr,ue,he,xe,Se,Ye,ye,ge,pe,fe,me,ve,be,Dt,Pt,vr,br,Ft,Vt,Qt,qt,Ut,Zt,Jt,er,tr,rr,nr,or,ar,Sr]),nn=Ie(rn),sn=Ie({chartType:a,nodeIDAccessor:m,sourceAccessor:k,targetAccessor:_,valueAccessor:C,edgeIdAccessor:S,edgeIdentity:E,childrenAccessor:I,hierarchySum:M,orientation:D,nodeAlign:P,nodePaddingRatio:j,nodeWidth:Y,iterations:$,forceStrength:H,nodeSize:"force"===a?ve:void 0,nodeSizeRange:"force"===a?be:void 0,padAngle:U,groupWidth:Z,sortGroups:J,edgeSort:ee,treeOrientation:re,edgeType:ne,padding:ie,paddingTop:se,random:jt,seed:Yt,tensionConfig:Ur,customNetworkLayout:nr,orbitMode:Qt,orbitSize:qt,orbitEccentricity:er}),on=gt(0),an=gt(0),ln=gt(!1),dn=gt(null);dn.current||(dn.current=new Ar(nn));let un=Q||!Dr&&Pr||null!==zr,hn=un&&null===zr?function(e,{nodes:t,edges:r,hierarchy:n},i){let s=new Ar(e);return n?s.ingestHierarchy(n,i):s.ingestBounded(K(t),K(r),i),s.cancelIntroAnimation(),s.buildScene(i),s}(nn,{nodes:l,edges:Array.isArray(g)?g:void 0,hierarchy:$r},[fr,mr]):null,yn=W(dn,_t,Tt,e=>Array.from(e.nodes.values()).map(e=>e.data?{id:e.id,...e.data}:e)),pn=Me("StreamNetworkFrame"),mn=pt((e,t,r=!1)=>De(pn.current,e,()=>e.buildScene(t),r),[pn]),[vn]=bt(Gr),bn=vn.set,[xn,wn]=bt(0),[Sn,En]=bt(!1),[Rn,Nn]=bt(!1),Tn=gt(0),An=gt(null),In=gt(q);In.current=q;let Mn=pt((e,t="ready")=>{Br(e.layoutVersion),Nn(!1),In.current?.(t)},[]),Dn=gt(nn);Dn.current=nn;let Pn=gt(null),{customHoverBehavior:Ln,customClickBehavior:Wn}=function({customHoverBehavior:e,customClickBehavior:t,onObservation:r,chartId:n}){return{customHoverBehavior:pt((t,i)=>{e?.(t,i),_e({onObservation:r,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:Zn,chartId:n,context:i})},[e,r,n]),customClickBehavior:pt((e,i)=>{t?.(e,i),Ce({onObservation:r,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:Zn,chartId:n,context:i})},[t,r,n])}}({customHoverBehavior:Je,customClickBehavior:et,onObservation:tt,chartId:nt}),{hoverHandlerRef:On,hoverLeaveRef:Fn,onPointerMove:Bn,onPointerLeave:zn,pointerStateRef:jn}=ur,{kbFocusIndexRef:Yn,focusedNavPointRef:$n,neighborIndexRef:Hn,onKeyDown:Xn,refreshKeyboardFocus:Vn}=function(e){let{storeRef:t}=e,r=gt({get scene(){return t.current?.sceneNodes??[]},get version(){return t.current?.layoutVersion??-1}}),n=pt((e,r,n,i)=>v(e,b(r,n),r,t.current?.sceneEdges??[],i),[t]);return x({...e,storeRef:r,extractPoints:w,toHover:Mr,nextConnected:n})}({storeRef:dn,hoverRef:Pn,setHoverPoint:bn,customHoverBehavior:Ln,customClickBehavior:Wn,scheduleRender:_r,clearPointerHover:zn}),Gn=gt({nodes:!1,edges:!1}),Qn=gt(new Map),qn=gt(0),Kn=gt(ge);Kn.current=ge;let ei=pt(e=>function(e){let{node:t,colorBy:r,colorScheme:n,nodeColorMap:i,colorIndexRef:s}=e;if("function"==typeof r)return String(r(t));if("string"==typeof r&&t.data){let e=t.data[r];if(void 0!==e){if(!i.has(String(e))){let t=Array.isArray(n)?n:Xe;i.set(String(e),t[s.current++%t.length])}return i.get(String(e))}}if(i.has(t.id))return i.get(t.id);let o=Array.isArray(n)?n:Xe,a=r?o[s.current++%o.length]:o[0];return i.set(t.id,a),a}({node:e,colorBy:ye,colorScheme:ge,nodeColorMap:Qn.current,colorIndexRef:qn}),[ye,ge]),ii=pt(e=>{qn.current=function(e){let{sceneNodes:t,nodes:r,nodeColorMap:n,colorScheme:i}=e;for(let e of t)e.id&&"string"==typeof e.style?.fill&&n.set(e.id,e.style.fill);let s=Array.isArray(i)?i:Xe,o=Array.from(r);for(let e=0;e<o.length;e++){let t=o[e];n.has(t.id)||n.set(t.id,s[e%s.length])}return o.length}({sceneNodes:e.sceneNodes,nodes:e.nodes.values(),nodeColorMap:Qn.current,colorScheme:Kn.current})},[]),si=gt(null),oi=pt((e,t)=>{mn(e,t),ti(e),Vn(),si.current=t,yn(),ii(e),Jn(Gn.current,e.sceneNodes,e.sceneEdges),cr.current=!1,e.markStylePaintPending()},[mn,yn,ii,Vn]),ai=pt(()=>{dn.current?.markStylePaintPending()},[]),{canvasRef:li,resolutionDirtyRef:di}=Pe(ur,{hydrated:Dr&&null===zr,wasHydratingFromSSR:Pr,storeRef:dn,dirtyRef:cr,skipInitialCanvasPaintInvalidation:!0,canvasPaintInvalidator:ai,maxDevicePixelRatio:Ke,canvasPaintDependencies:[a,fr,mr,qe,Mt,de,_r]}),ci=(fi=Sr,fi?.colors?.border||fi?.colors?.secondary||fi?.colors?.primary||"#999"),ui=pt(e=>function(e,t){return e?"object"==typeof e?e:t?.get(e)??null:null}(e,dn.current?.nodes),[]),hi=pt(e=>function(e){let{edge:t,edgeColorBy:r,getNodeColor:n,resolveEndpoint:i,fallback:s}=e;if("function"==typeof r)return r(t);let o=i(t.source),a=i(t.target);return"target"===r&&a?n(a):o?n(o):s}({edge:e,edgeColorBy:pe,getNodeColor:ei,resolveEndpoint:ui,fallback:ci}),[pe,ei,ci,ui]),yi=pt(e=>function(e){let{edge:t,particleStyleColor:r,particleColorBy:n,hasExplicitParticleColorBy:i,getEdgeColor:s,getNodeColor:o,resolveEndpoint:a,fallback:l}=e;if("function"==typeof r){let e=a(t.source);return e?r(t,e):l}if(!i)return s(t);let d=n,c=a(t.source),u=a(t.target);return"target"===d&&u?o(u):c?o(c):l}({edge:e,particleStyleColor:Zr.color,particleColorBy:Zr.colorBy,hasExplicitParticleColorBy:!!le?.colorBy,getEdgeColor:hi,getNodeColor:ei,resolveEndpoint:ui,fallback:ci}),[le?.colorBy,Zr.color,Zr.colorBy,ei,hi,ci,ui]),gi=function(e,t,r,n,i){return("sankey"===e||t)&&r||n||i}(a,!!nr,ae,!!Pt,dn.current?.isAnimating??!1),pi=gt(void 0);var fi;wt(()=>{let e=dn.current;e&&((Hr||Yr&&$r)&&e.hasEdgeIdentityChange(nn)?pi.current=nn:(e.updateConfig(nn),pi.current=void 0),cr.current=!0,_r())},[nn,Hr,Yr,$r,_r]),function(e,t){yt.useEffect(()=>{if(e)return e.perspective.onExtrasReady=t,()=>{e.perspective.onExtrasReady=null}},[e,t])}(dn.current,pt(()=>{cr.current=!0,_r()},[_r])),O(dn,lr,cr,_r);let mi=pt(()=>{let e=dn.current;if(!e)return;let t=++Tn.current;An.current?.abort(),An.current=null;let s=[fr,mr],o=(t,r=!1)=>{if(oi(e,s),Mn(e,t),it){let{nodes:t,edges:r}=e.getLayoutData();it(t,r)}r&&_r()};if("force"===a&&!nr&&!jt&&r()&&n(V,e.nodes.size,e.edges.size,$)){let r=new AbortController;An.current=r;let n=e.getLayoutData(),a=i(n.nodes,n.edges,Dn.current,s,e._lastPositionSnapshot);return Nn(!0),In.current?.("pending"),import("./c-G3SM44T7.min.js").then(({runForceLayoutWorker:e})=>e(a,r.signal)).then(({positions:n})=>{r.signal.aborted||t!==Tn.current||(An.current=null,e.applyForceLayoutPositions(n,s),o("ready",!0))}).catch(n=>{r.signal.aborted||t!==Tn.current||"AbortError"===n.name||(An.current=null,e.runLayout(s),o("error",!0))}),r}e.runLayout(s),o("ready")},[fr,mr,oi,Mn,it,_r,a,nr,jt,V,$]),vi=gt(mi);vi.current=mi,function(t,r,n){let i=gt(n);i.current=n,wt(()=>{if(!r&&Kt(t)&&!e(t))return d(()=>import("./c-C4WRRUZ5.min.js").then(e=>{e.registerBuiltInNetworkLayouts()}),()=>i.current(),`StreamNetworkFrame layout "${t}"`)},[t,r])}(a,!!nr,()=>{vi.current(),_r()}),wt(()=>()=>{++Tn.current,An.current?.abort()},[]);let bi=gt(!1),xi=pt((e=!1)=>!(!e&&!bi.current||(bi.current=!1,mi(),0)),[mi]),wi=pt(()=>xi(!1),[xi]),ki=pt(e=>{let t=dn.current;if(!t)return!1;let r=!1,n=bi.current;for(let i of e)null==i||"object"!=typeof i||(r=!0,t.ingestEdge(i)&&(n=!0));let i=xi(n);return r||i},[xi]),_i=pt(e=>{if(null==e||"object"!=typeof e)return;let t=dn.current;if(t){if(t.ingestEdge(e)&&(bi.current=!0),An.current&&(++Tn.current,An.current.abort(),An.current=null,bi.current=!0),!Cr.isActive)return void wi();_r()}},[wi,Cr,_r]),Ci=pt(e=>{ki(e)&&_r()},[ki,_r]);wt(()=>Cr.subscribe(()=>{Cr.isActive||wi()}),[wi,Cr]);let Si=pt(()=>{bi.current=!1,++Tn.current,An.current?.abort(),An.current=null,Nn(!1),In.current?.("ready"),dn.current?.clear(),yn(),Qn.current.clear(),qn.current=0,Br(dn.current?.layoutVersion??0),bn(null),Pn.current=null,Yn.current=-1,$n.current=null,Hn.current=-1,cr.current=!0,_r()},[yn,_r,Yn,$n,Hn,bn]),Ei=pt(()=>{dn.current&&(xi(!0),_r())},[xi,_r]),Ri=pt(e=>{let t=dn.current;if(!t)return[];let r=[];for(let n of e){let e=t.nodes.get(n);e&&(r.push({...e.data??{},id:n}),t.removeNode(n),Qn.current.delete(n))}if(r.length&&Pn.current){let e=new Set(r.map(e=>e.id)),t=Pn.current,n=t.data,i=e=>e&&"object"==typeof e?e.id:e;("node"===t.nodeOrEdge?e.has("function"==typeof m?m(n??{}):n?.[m]):e.has(i(n?.source))||e.has(i(n?.target)))&&(Pn.current=null,bn(null))}return xi(r.length>0)&&_r(),r},[xi,_r,m,bn]),Ni=pt((e,t)=>{let r=[];try{for(let n of e){let e=dn.current?.updateNode(n,t);null!=e&&r.push({...e,id:n})}}finally{xi(r.length>0)&&_r()}return r},[xi,_r]);St(o,()=>({push:_i,pushMany:Ci,removeNode:e=>Ri([e]).length>0,removeNodes:Ri,updateNodes:Ni,removeEdge:(e,t)=>{let r=dn.current?.removeEdge(e,t)??!1;if(r&&Pn.current&&"edge"===Pn.current.nodeOrEdge){let r,n=Pn.current.data,i="object"==typeof n?.source?n.source.id:n?.source,s="object"==typeof n?.target?n.target.id:n?.target;r=void 0!==t?i===e&&s===t:!S&&"id"!==E||!n||("function"==typeof S?S:e=>e?.[S??"id"])(n.data??n)===e,r&&(Pn.current=null,bn(null))}return xi(r)&&_r(),r},updateNode:(e,t)=>{let r=dn.current?.updateNode(e,t)??null;return xi(null!==r)&&_r(),r},updateEdge:(e,t,r)=>{let n=dn.current?.updateEdge(e,t,r)??[];return xi(n.length>0)&&_r(),n},updateEdgeById:(e,t)=>{let r=dn.current?.updateEdgeById(e,t)??null;return xi(null!==r)&&_r(),r},clear:Si,getTopology:()=>(wi(),dn.current?.getLayoutData()??{nodes:[],edges:[]}),getCustomLayout:()=>(wi(),dn.current?.lastCustomLayoutResult??null),getLayoutFailure:()=>(wi(),dn.current?.lastCustomLayoutFailure??null),getTopologyDiff:()=>{wi();let e=dn.current;return e?{addedNodes:Array.from(e.addedNodes),removedNodes:Array.from(e.removedNodes),addedEdges:Array.from(e.addedEdges),removedEdges:Array.from(e.removedEdges)}:{addedNodes:[],removedNodes:[],addedEdges:[],removedEdges:[]}},relayout:Ei,getTension:()=>(wi(),dn.current?.tension??0)}),[_i,Ci,Si,Ei,wi,xi,Ri,Ni,_r,S,E,bn]),wt(()=>{let e=dn.current;if(!e)return;++Tn.current,An.current?.abort(),An.current=null;let t=pi.current;if(Yr&&$r)bi.current=!1,e.ingestHierarchy($r,[fr,mr],t),pi.current=void 0,oi(e,[fr,mr]),Mn(e),_r();else{let i=K(l),s=Array.isArray(g)?K(g):[];if(Hr&&(bi.current=!1),0===i.length&&0===s.length){if(Hr&&(e.nodes.size>0||e.edges.size>0)&&Si(),t&&(e.updateConfig(t),pi.current=void 0),"force"===a&&!Hr&&e.nodes.size>0){bi.current=!1;let e=vi.current();return()=>e?.abort()}return void Mn(e)}let o=[fr,mr];if("force"===a&&!nr&&r()&&!jt&&n(V,i.length,s.length,$)){e.ingestBounded(i,s,o,{deferLayout:!0,config:t}),pi.current=void 0;let r=vi.current();return()=>r?.abort()}e.ingestBounded(i,s,o,{config:t}),pi.current=void 0,oi(e,o),Mn(e),_r()}},[l,g,Hr,$r,Yr,fr,mr,sn,V,$,a,nr,jt,_r,Si,oi,Mn]);let Ti=yt.useRef(!1);wt(()=>{Ti.current||f&&f.length>0&&(Ti.current=!0,Ci(f))},[f,Ci]),wt(()=>{let e=dn.current;if(!e||An.current)return;let t=si.current,r=null!==t&&(t[0]!==fr||t[1]!==mr);!cr.current&&!r||(r&&e.runLayout([fr,mr]),oi(e,[fr,mr]),Br(e=>"number"==typeof e?e+1:0),_r())},[Sr,fr,mr,oi,_r]);let Ai=()=>!nr||(dn.current?.hasCustomRestyle??!1);On.current=e=>{let r=Ai(),n=li.current;if(!n)return;let i=dn.current;if(!i)return void Le(n);let s=Un({viewTransform:t.viewTransform,clientX:e.clientX,clientY:e.clientY,canvasRect:n.getBoundingClientRect(),margin:pr,adjustedWidth:fr,adjustedHeight:mr,sceneNodes:i.sceneNodes,sceneEdges:i.sceneEdges,...ri(i),nodeQuadtree:i.nodeQuadtree,maxNodeRadius:i.maxNodeRadius,includeEdges:!1!==i.lastCustomLayoutResult?.edgeHitTesting&&(Ue||Gn.current.edges)});if(Le(n,"hit"===s.kind?Re(s.mark):void 0),Ue){if("hit"!==s.kind)return void(Pn.current&&(Pn.current=null,bn(null),Ln?.(null),r&&_r()));Pn.current=s.hover,bn(s.hover),Ln?.(s.hover),r&&_r()}},Fn.current=()=>{if(Le(li.current),Pn.current){let e=Ai();Pn.current=null,bn(null),Ln?.(null),e&&_r()}};let Ii=gt(()=>{});Ii.current=e=>{if(ur.flushPointerMove(),We(e.target)||!et&&!tt)return;let r=li.current;if(!r)return;let n=dn.current;if(!n)return;let i=Un({viewTransform:t.viewTransform,clientX:e.clientX,clientY:e.clientY,canvasRect:r.getBoundingClientRect(),margin:pr,adjustedWidth:fr,adjustedHeight:mr,sceneNodes:n.sceneNodes,sceneEdges:n.sceneEdges,...ri(n),nodeQuadtree:n.nodeQuadtree,maxNodeRadius:n.maxNodeRadius,includeEdges:!1!==n.lastCustomLayoutResult?.edgeHitTesting});"hit"===i.kind?Wn(i.hover,{type:"activate",inputType:Oe(e.nativeEvent.pointerType)}):"miss"===i.kind&&Wn(null)};let Mi=pt(e=>Ii.current(e),[]),Di=pt(e=>{F(jn,e,Ue,Gn.current.nodes||Gn.current.edges,li.current,"mouse")&&(Yn.current=-1,$n.current=null,Bn(e))},[li,Ue,Bn,jn,Yn,$n]),Pi=gt(null),Li=pt(e=>{(e.target===li.current||e.target===Pi.current)&&Di(e)},[li,Di]),Wi=pt(e=>{Pi.current?.removeEventListener("mousemove",Li),Pi.current=e,e?.addEventListener("mousemove",Li)},[Li]),Oi=function(e,t,r,n){let i=gt(!1),s=gt(!1);return mt(()=>{let o=()=>{n.current<0&&r.current?.(),i.current=!0;try{t.current?.()}finally{i.current=!1}};return(e||s.current)&&o(),s.current=!!e,Lr(e)?.subscribe(o)},[e,t,r,n]),i}(t.viewTransform,kr,Fn,Yn),Fi=function(e,t){let r=t?.lastCustomLayoutResult?t.customLayoutRevision:null,n=t?.lastCustomLayoutResult??null,i=gt(null);return i.current??(i.current={store:t,run:r,result:tn(n),output:n}),mt(()=>{let s=i.current,o=s.store!==t||s.run!==r;(o||s.output!==n)&&(i.current={store:t,run:r,result:tn(n),output:n}),o&&Lr(e)?.layoutCommitted?.(n,s.result)}),pt(e=>e!==i.current.store||(e.lastCustomLayoutResult?e.customLayoutRevision:null)!==i.current.run,[])}(t.viewTransform,dn.current);if(kr.current=()=>{if(Oi.current||(wr.current=null,wi()),!Cr.isActive&&!Oi.current||An.current&&!Oi.current)return;let e=li.current;if(!e)return;let r=dn.current;r&&function(e){let{canvas:t,store:r,sceneRevisionDiagnostics:n,size:i,margin:s,adjustedWidth:o,adjustedHeight:a,background:l,themeBackground:d,maxDevicePixelRatio:y,renderMode:g,hasBackgroundGraphics:p=!1,dirtyRef:f,resolutionDirtyRef:m,lastFrameTimeRef:v,now:b,random:x,reducedMotion:w,showParticles:k,isContinuous:_,animate:C,decay:S,pulse:E,thresholds:R,staleness:N,particleStyle:I,getParticleColor:M,pendingAnnotationFrameRef:D,lastAnnotationFrameTimeRef:P,setAnnotationFrame:L,scheduleNextFrame:W,syncColorMap:O,onSceneOrStyleChange:F}=e,B=t.getContext("2d");if(!B)return;let z=v.current?Math.min((b-v.current)/1e3,.1):.016;e.cameraOnly||(v.current=b);let j=!e.cameraOnly&&null!=r.transition,Y=!e.cameraOnly&&r.advanceTransition(w?b+1e6:b),$=!w&&Y,H=j&&!Y,X=!w&&!e.cameraOnly&&r.tickAnimation([o,a],z),V=!e.cameraOnly&&r.advancePerspectiveTransition(b,w),G=!e.cameraOnly&&f.current,Q=!e.cameraOnly&&n?.beforeCompute(r.getLastUpdateResult(),$),q=j||G||X||V;q&&(r.buildScene([o,a]),t.setAttribute("aria-label",Cn(r)),G&&O?.()),Q&&n?.afterCompute(Q,q,!0);let K=k&&!w&&!!r.particlePool,U=!!S||!!E||!!R||!1!==C&&r.hasActiveTopologyDiff||r.hasActivePulses||r.hasActiveThresholds,Z=r.consumeStylePaintPending();(q||Z||e.cameraOnly)&&F?.({inventoryChanged:G||Z,geometryChanged:q});let J=c({dirtyOrRebuilt:q,transitioning:$,animationTicked:X,continuous:K||_,liveEncoding:U,forced:Z||!0===m?.current||e.cameraOnly});m&&(m.current=!1);let ee=N?.threshold??5e3,te=!!N&&r.lastIngestTime>0&&b-r.lastIngestTime>ee;if(J){let n=we(y,i);if(!ke(t,i,s,n))return;if(B.clearRect(-s.left,-s.top,i[0],i[1]),T(B,{background:l,themeBackground:d,hasBackgroundGraphics:p,x:-s.left,y:-s.top,width:i[0],height:i[1]}),B.save(),e.viewTransform){let t=Fr(e.viewTransform);B.beginPath(),B.rect(0,0,o,a),B.clip(),B.translate(t.x,t.y),B.scale(t.k,t.k)}if(e.cameraOnly||(S&&r.applyDecay(),E&&r.applyPulse(b),R&&r.applyThresholds(b),!1!==C&&r.applyTopologyDiff(b)),te&&(B.globalAlpha=N?.dimOpacity??.5),r.perspective.underlay.length&&fn(B,r.perspective.underlay),A({context:B,nodes:r.sceneEdges,renderMode:g,pixelRatio:n,paintBuiltIn:e=>fn(B,e)}),A({context:B,nodes:r.sceneNodes,renderMode:g,pixelRatio:n,paintBuiltIn:e=>{let t=e;r.perspective.frame?function(e,t){let r=0;for(let n=1;n<=t.length;n++){if(n<t.length&&t[n].type===t[r].type)continue;let i=t[r].type,s=0===r&&n===t.length?t:t.slice(r,n);"symbol"===i?_n(e,s):"glyph"===i?h(e,s):("circle"===i||"rect"===i||"arc"===i)&&kn(e,s,i),r=n}}(B,t):(function(e,t){kn(e,t,"rect")}(B,t),function(e,t){kn(e,t,"circle")}(B,t),function(e,t){kn(e,t,"arc")}(B,t),u(B,t),h(B,t))}}),K&&!te){let t=r.edgesArray;if(t.length>0){e.cameraOnly||function(e,t,r,n,i=Math.random){let s=n.spawnRate??sr.spawnRate,o=n.maxPerEdge??sr.maxPerEdge;for(let n=0;n<t.length;n++){let a=t[n];if(!a.bezier||e.countForEdge(n)>=o)continue;let l=a.bezier.circular?.3:1,d=a.value*s*r*l,c=Math.floor(d),u=d-c,h=c;i()<u&&h++;for(let t=0;t<h&&!(e.countForEdge(n)>=o);t++)e.spawn(n,i)}}(r.particlePool,t,z,I,x);let n,i=.5*(I.speedMultiplier??1);if(I.proportionalSpeed){let e=t.reduce((e,t)=>Math.max(e,t.value||1),1);n=t.map(t=>.3+(t.value||1)/e*1.7)}e.cameraOnly||r.particlePool.step(z,i,t,n),function(e,t,r,n,i,s){let o=n.radius??sr.radius,a=n.opacity??sr.opacity,l=e.globalAlpha;e.globalAlpha=l*a;for(let a=0;a<t.particles.length;a++){let l=t.particles[a];if(!l.active)continue;let d,c=r[l.edgeIndex];if(c){if(d="string"==typeof n.color&&"inherit"!==n.color?n.color:i(c),e.fillStyle=Qe(e,d)||d,e.beginPath(),s){let[t,r]=s(l.x,l.y,c,l.t);e.arc(t,r,o,0,2*Math.PI)}else e.arc(l.x,l.y,o,0,2*Math.PI);e.fill()}}e.globalAlpha=l}(B,r.particlePool,t,I,M,r.perspective.projectParticle)}}te&&(B.globalAlpha=1),B.restore()}if(e.cameraOnly)return;f.current=!1;let re=G||!!e.layoutCommitPending,ne=q||re||D.current;ne&&(re||H||b-P.current>=33)?(L(e=>e+1),P.current=b,D.current=!1):D.current=!!ne,(_||$||null!=r.transition||r.perspective.transitioning||X||r.hasActivePulses||r.hasActiveThresholds||!1!==C&&r.hasActiveTopologyDiff||D.current)&&W()}({canvas:e,store:r,sceneRevisionDiagnostics:pn.current,size:gr,margin:pr,adjustedWidth:fr,adjustedHeight:mr,background:qe,themeBackground:Nr,maxDevicePixelRatio:Ke,renderMode:de,viewTransform:t.viewTransform,cameraOnly:Oi.current,layoutCommitPending:Fi(r),hasBackgroundGraphics:!(!Mt&&!r.customLayoutBackgrounds),dirtyRef:cr,resolutionDirtyRef:di,lastFrameTimeRef:on,now:Cr.now(),random:Cr.random,reducedMotion:!!hr.current,showParticles:ae,isContinuous:gi,animate:Ot,decay:Dt,pulse:Pt,thresholds:Vt,staleness:Ft,particleStyle:Zr,getParticleColor:yi,pendingAnnotationFrameRef:ln,lastAnnotationFrameTimeRef:an,setAnnotationFrame:wn,scheduleNextFrame:()=>{_r()},syncColorMap:()=>ii(r),onSceneOrStyleChange:({inventoryChanged:n,geometryChanged:i})=>{var s;(n||i)&&ti(r),!1===r.lastCustomLayoutResult?.edgeHitTesting&&"edge"===Pn.current?.nodeOrEdge&&Fn.current(),(n||i)&&Vn(),n&&(Jn(Gn.current,r.sceneNodes,r.sceneEdges)||Le(e)),(Gn.current.nodes||Gn.current.edges)&&(n||i||Oi.current)&&(s={canvas:e,pointer:jn.current,store:r,margin:pr,viewTransform:t.viewTransform,width:fr,height:mr,geometryMoved:i,cursorInventory:Gn.current},Ee(s.canvas,s.pointer,e=>{let t=Un({clientX:e.clientX,clientY:e.clientY,canvasRect:s.canvas.getBoundingClientRect(),margin:s.margin,adjustedWidth:s.width,adjustedHeight:s.height,sceneNodes:s.store.sceneNodes,sceneEdges:s.store.sceneEdges,...ri(s.store),nodeQuadtree:s.geometryMoved?null:s.store.nodeQuadtree,maxNodeRadius:s.geometryMoved?0:s.store.maxNodeRadius,includeEdges:s.cursorInventory.edges&&!1!==s.store.lastCustomLayoutResult?.edgeHitTesting,viewTransform:s.viewTransform});return"hit"===t.kind?Re(t.mark):void 0}))}})},Fe(li),B(Ft,dn,cr,_r,Cr.now,Sn,En),un)return function({hydrationMarkup:e=null,layoutPending:t,tableId:r,props:n,store:i,responsiveRef:s,size:o,margin:a,adjustedWidth:l,adjustedHeight:d,surfaceBackground:c,resolvedBackground:u,resolvedForeground:h}){let{description:y,title:g,renderMode:p,legend:f,legendPosition:m,legendLayout:v,legendHoverBehavior:b,legendClickBehavior:x,legendHighlightedCategory:w,legendIsolatedCategories:k,layoutSelection:_,annotations:C,onAnnotationActivate:S,annotationObservationCallback:E,onObservation:T,chartId:A,autoPlaceAnnotations:I,svgAnnotationRules:M}=n,D=i.sceneNodes,P=i.sceneEdges,L=i.labels,W=i.perspective.frame,O=i.lastCustomLayoutResult?.perspective,F=i.perspective.underlay,B=Ir(n,`${r}-frame`,o,t);return Et("div",{...B,ref:s,dangerouslySetInnerHTML:null===e?void 0:{__html:e},children:null===e?Nt(Rt,{children:[gn(n,i,r),Nt("div",{role:i.customLayoutHtmlMarks?.length?"group":"img","aria-label":B["aria-label"],children:[Nt("svg",{role:"presentation",xmlns:"http://www.w3.org/2000/svg",width:o[0],height:o[1],style:{position:"absolute",left:0,top:0},children:[c?Et("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:o[0],height:o[1],fill:c}):null,Et("g",{transform:`translate(${a.left},${a.top})`,children:Et(jr,{view:n.viewTransform,width:l,height:d,children:R(u,Wt(i.customLayoutBackgrounds,W,O))})}),Et("g",{transform:`translate(${a.left},${a.top})`,children:Nt(jr,{view:n.viewTransform,width:l,height:d,children:[F.map((e,t)=>Kr(e,t+P.length+D.length)),P.map((e,t)=>N({node:e,index:t,renderMode:p,fallback:()=>Kr(e,t)})).filter(Boolean),D.map((e,t)=>N({node:e,index:t,renderMode:p,fallback:()=>function(e,t){return te(qr(e,t),e,`network-node-cursor-${t}`)}(e,t)})).filter(Boolean)]})})]}),Et(en,{decorative:!0,viewTransform:n.viewTransform,width:l,height:d,totalWidth:o[0],totalHeight:o[1],margin:a,labels:L,sceneNodes:D,title:g,description:y,legend:f,legendPosition:m,legendLayout:v,legendHoverBehavior:b,legendClickBehavior:x,legendHighlightedCategory:w,legendIsolatedCategories:k,foregroundGraphics:Wt(R(h,Wt(X(i.customLayoutOverlays,_??null),W,O)),W),annotations:C,onAnnotationActivate:S,onObservation:E??T,chartId:A,chartType:"StreamNetworkFrame",autoPlaceAnnotations:I,svgAnnotationRules:M,annotationFrame:0}),Et(cn,{viewTransform:n.viewTransform,marks:i.customLayoutHtmlMarks,margin:a,selection:_??null,width:l,height:d,viewport:n.viewport,htmlMarkCulling:n.htmlMarkCulling,onViewportChange:n.onViewportChange})]})]}):void 0})}({hydrationMarkup:zr,layoutPending:Rn,tableId:xr,props:t,store:hn??dn.current,responsiveRef:yr,size:gr,margin:pr,adjustedWidth:fr,adjustedHeight:mr,surfaceBackground:Tr,resolvedBackground:Rr,resolvedForeground:Er});let Bi=dn.current,zi=Ir(t,Wr,gr,Rn,"visible"),ji=Bi.perspective.frame,Yi=Bi.lastCustomLayoutResult?.perspective;return Nt("div",{...zi,ref:yr,tabIndex:0,onKeyDown:Xn,children:["production"!==process.env.NODE_ENV&&dn.current&&Et(Be,{store:dn.current,diagnostics:pn.current}),gn(t,Bi,xr,Rn?void 0:Bi.getUpdateSnapshot().revisions.accessibility),Et(Xr,{hoverStore:vn,kbFocusIndexRef:Yn,store:Bi}),Nt("div",{role:Bi.customLayoutHtmlMarks?.length?"group":"img","aria-label":zi["aria-label"],style:{position:"relative",width:"100%",height:"100%"},ref:Wi,onMouseLeave:zn,onClick:et||tt?Mi:void 0,children:[Nt("div",{style:{display:"contents"},onMouseMove:Di,children:[Rn&&!1!==G&&Et("div",{style:{position:"absolute",inset:0,zIndex:3,background:"var(--semiotic-bg, #fff)"},children:ze(!0,gr[0],gr[1],G)}),Et(je,{size:gr,margin:pr,backdropFill:Tr??void 0,overflowVisible:!0,children:Et(jr,{view:t.viewTransform,width:fr,height:mr,children:R(Rr,Wt(Bi.customLayoutBackgrounds,ji,Yi))})})]}),Et("canvas",{"aria-hidden":"true",ref:li,"aria-label":Cn(Bi),style:{position:"absolute",top:0,left:0}}),Nt("div",{style:{display:"contents"},onMouseMove:Di,children:[Et(en,{decorative:!0,viewTransform:t.viewTransform,width:fr,height:mr,totalWidth:gr[0],totalHeight:gr[1],margin:pr,labels:Bi.labels,sceneNodes:Bi.sceneNodes,title:At,description:Gt,legend:ct,legendPosition:ut,legendLayout:ht,legendHoverBehavior:ft,legendClickBehavior:vt,legendHighlightedCategory:xt,legendIsolatedCategories:kt,foregroundGraphics:Wt(R(Er,Wt(X(Bi.customLayoutOverlays,lr??null),ji,Yi)),ji),annotations:st,onAnnotationActivate:ot,onObservation:rt??tt,chartId:nt,chartType:"StreamNetworkFrame",autoPlaceAnnotations:at,svgAnnotationRules:dt,annotationFrame:xn}),Et(cn,{viewTransform:t.viewTransform,marks:Bi.customLayoutHtmlMarks,margin:pr,selection:lr??null,width:fr,height:mr,viewport:t.viewport,htmlMarkCulling:t.htmlMarkCulling,onViewportChange:t.onViewportChange}),Et(Vr,{viewTransform:t.viewTransform,hoverStore:vn,kbFocusIndexRef:Yn,focusedNavPointRef:$n,enableHover:Ue,tooltipContent:Ze,adjustedWidth:fr,adjustedHeight:mr,margin:pr,size:gr}),Ft?.showBadge&&Et(z,{isStale:Sn,position:Ft.badgePosition,state:Ft.state,settling:Ft.settling})]})]})]})})),"StreamNetworkFrame"),si=ii;export{Lt as a,si as b};
|
package/dist/c-DJ6DT5BL.min.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import{a as O}from"./c-BWJQSSAD.min.js";import{a as E}from"./c-LBXDHQZG.min.js";import{a as z,b as G,c as $,d as j}from"./c-5EPR4KFB.min.js";import{a as V}from"./c-GNTXRXRN.min.js";import{c as X,a as Y}from"./c-MSZ3ZDAP.min.js";import{e as Q}from"./c-YSMCBJOI.min.js";import{c as U,b as K,a as q}from"./c-BR2TOCUN.min.js";import{a as J}from"./c-WFSEQ2XG.min.js";import{b as Z,a as ee,d as te,c as oe,h as ie,g as ae}from"./c-JS2D7A2P.min.js";import{e as re}from"./c-5NAU4JAY.min.js";import{b as ne,g as le,f as se,e as ce,c as he,d as de}from"./c-BRBTXINY.min.js";import{e as me,l as ue,m as pe,j as ye}from"./c-AMQAAW7G.min.js";import{k as ge,m as fe,i as be,j as xe,l as ve}from"./c-ZYMXDR42.min.js";import{I as Ae,F as we,Q as Se,R as ke,P as Ce,S as Le,H as Re}from"./c-NB2UEX5C.min.js";import{b as _e}from"./c-363Q2L4Z.min.js";import{aY as He,bI as Ie,b as Fe,v as Pe,bc as Be,bK as De,aZ as Me,a_ as Te,r as Ne,aP as We,aN as Oe,aS as Ee,aO as ze,x as Ge,bO as $e,bB as je,aR as Ve,bP as Xe,bb as Ye,ba as Qe,bC as Ue,bG as Ke,bH as qe,bz as Je,by as Ze,bg as et,bj as tt,bn as ot,bE as it,at,az as rt,ay as nt,aT as lt,ax as st,bv as ct,bo as ht,bJ as dt}from"./c-L6OT4OVA.min.js";import{e as mt,f as ut}from"./c-OU7A3IUL.min.js";import{u as pt,b as yt,o as gt,v as ft,s as bt,r as xt,n as vt,d as At,m as wt}from"./c-WPL6PGP3.min.js";import{c as St}from"./c-JDI7HKEM.min.js";import{A as kt,D as Ct,C as Lt,H as Rt,x as _t,G as Ht,w as It}from"./c-HTL37JCD.min.js";import{a as Ft,c as Pt}from"./c-GRTKU3C7.min.js";import*as Bt from"react";import{useRef as Dt,useState as Mt,useCallback as Tt,useMemo as Nt,forwardRef as Wt,useImperativeHandle as Ot,useEffect as Et}from"react";import{jsx as zt,Fragment as Gt,jsxs as $t}from"react/jsx-runtime";import{scaleSequential as jt}from"d3-scale";function Vt(e){let{accessor:t,data:o,isPushMode:i}=e,a=Dt(null),[r,n]=Mt(0),l=Tt(e=>{if(!i||!t)return;let o=!1;for(let i of e){let e="function"==typeof t?t(i):i[t];if(null==e)continue;let r="number"==typeof e?e:Number(e);Number.isFinite(r)&&(a.current?(r<a.current[0]&&(a.current[0]=r,o=!0),r>a.current[1]&&(a.current[1]=r,o=!0)):(a.current=[r,r],o=!0))}o&&n(e=>e+1)},[i,t]),s=Tt(()=>{i&&(a.current=null,n(e=>e+1))},[i]);return{domain:Nt(()=>{if(i)return a.current??void 0;if(!t||0===o.length)return;let e="function"==typeof t?t:e=>e[t],r=1/0,n=-1/0;for(let t of o){let o=e(t);if(null==o)continue;let i="number"==typeof o?o:Number(o);Number.isFinite(i)&&(i<r&&(r=i),i>n&&(n=i))}return Number.isFinite(r)&&Number.isFinite(n)?[r,n]:void 0},[o,t,i,r]),trackPushed:l,reset:s}}function Xt(e,t){return yt(1===t?.5:e/(t-1))}function Yt(e){return e instanceof Date?`date:${e.getTime()}`:`${typeof e}:${String(e)}`}function Qt(e,t){let o=t=>e[Math.max(0,Math.min(e.length-1,Math.round(Number(t))))],i=e.every(e=>"number"==typeof e||e instanceof Date),a=t?void 0:Ut(e);return(r,n,l)=>{if(0===e.length)return"";let s=o(r);return t?t(s,n,l&&i?l.map(e=>Number(o(e).valueOf())):void 0):s instanceof Date&&a?a(s):String(s)}}function Ut(e){let t=e.filter(e=>e instanceof Date&&Number.isFinite(e.valueOf()));if(0===t.length)return;let o=t.every(e=>e.valueOf()%864e5==0),i=o&&t.every(e=>1===e.getUTCDate());if(i&&t.every(e=>0===e.getUTCMonth()))return e=>String(e.getUTCFullYear());if(i)return e=>`${he(e).split(" ")[0]} ${e.getUTCFullYear()}`;let a=t.map(e=>e.valueOf()),r=Ft(a);if(o){let e=new Date(r[0]).getUTCFullYear()===new Date(r[1]).getUTCFullYear();return t=>e?he(t):`${he(t)}, ${t.getUTCFullYear()}`}return de(r)}function Kt(e,t,o){return"function"==typeof e?e(t,o):t[e]}function qt(e,t){if(!e?.length)return;let o=new Map(t.map((e,t)=>[Yt(e),t]));return e.map(e=>{let t={...e},i=i=>{if(!(i in e))return;let a=o.get(Yt(e[i]));void 0!==a&&(t[i]=a)};return i("x"),i("x0"),i("x1"),"string"==typeof e.type&&("x-threshold"===e.type||"x"===e.type)&&i("value"),t})}function Jt(e){let t="number"==typeof e?e:"string"==typeof e&&""!==e.trim()?Number(e):NaN;return Number.isFinite(t)?Math.max(0,Math.floor(t)):void 0}function Zt(e){return"string"==typeof e&&""!==e.trim()?e:void 0}function eo(e){let{seriesOrder:t,overallOrder:o,highlightTop:i,color:a,colorScheme:r,neutralColor:n,themeCategorical:l,themeNeutral:s}=e;if(null==i&&null==a)return r;let c="string"==typeof r?[...gt(r,l)]:r,h=null==i?o.length:Math.max(0,Math.floor(i)),d=new Set(o.slice(0,h)),m= new Map,u={};for(let e of t)Object.defineProperty(u,e,{configurable:!0,enumerable:!0,writable:!0,value:a??(d.has(e)?ft(void 0,l,c,e,m):n??s??"#b8bec8")});return u}function to(e,t={}){let o=t.xAccessor??"x",a=t.yAccessor??"y",r=t.lineBy??"series",n=t.rankDirection??"descending",l=[],s= new Map,c= new Map,h=[],d= new Map,m=1/0,u=-1/0;e.forEach((e,t)=>{let i=Kt(o,e,t),n=Yt(i),p=s.get(n);null==p&&(p=l.length,s.set(n,p),l.push(i),c.set(p,[]));let y=String(Kt(r,e,t));d.has(y)||(d.set(y,h.length),h.push(y));let g=Number(Kt(a,e,t));Number.isFinite(g)&&(m=Math.min(m,g),u=Math.max(u,g),c.get(p)?.push({datum:e,inputIndex:t,series:y,value:g}))});let p=[],y= new Map,g= new Map;for(let e=0;e<l.length;e++){let t=c.get(e)??[];t.sort((e,t)=>("descending"===n?t.value-e.value:e.value-t.value)||(d.get(e.series)??0)-(d.get(t.series)??0)),t.forEach((t,o)=>{let i=o+1;p.push({datum:t.datum,xIndex:e,xValue:l[e],series:t.series,value:t.value,rank:i}),y.set(t.series,(y.get(t.series)??0)+i),g.set(t.series,(g.get(t.series)??0)+1)})}let f=h.length+1,b=[...h].sort((e,t)=>{let o=g.get(e)??0,i=g.get(t)??0;return((y.get(e)??0)+(l.length-o)*f)/Math.max(1,l.length)-((y.get(t)??0)+(l.length-i)*f)/Math.max(1,l.length)||(d.get(e)??0)-(d.get(t)??0)}),x=null==t.highlightTop?b.length:Math.max(0,Math.floor(t.highlightTop)),v=new Set(b.slice(0,x));return{data:p.map(e=>{let t=v.has(e.series);return{...e.datum,x:e.xIndex,y:e.rank,__bumpRaw:e.datum,__bumpSeries:e.series,__bumpColorGroup:t?e.series:i,__bumpValue:e.value,__bumpRank:e.rank,__bumpXValue:e.xValue,__bumpHighlighted:t}}),xValues:l,seriesOrder:h,overallOrder:b,valueExtent:m===1/0?[0,0]:[m,u]}}function oo({tooltip:e,xValues:t,xFormat:o,yFormat:i}){let a=Nt(()=>Qt(t,o),[o,t]),r=Tt(e=>i?i(e):e.toLocaleString(),[i]),n=Oe(e),l=Nt(()=>n?void 0:Ee(e),[n,e]),s=Tt(t=>{let o=t?.data??t;return o&&!1!==e?l?l({...t,data:o.__bumpRaw,__semioticHoverData:!0}): $t(kt,{children:[
|
|
2
|
-
zt("div",{style:{fontWeight:700},children:o.__bumpSeries}),
|
|
3
|
-
$t("div",{children:[a(o.x)," · Rank ",o.__bumpRank]}),
|
|
4
|
-
$t("div",{children:["Value: ",r(o.__bumpValue)]})]}):null},[r,a,l,e]),c=Tt(t=>{let o=(Array.isArray(t.allSeries)?t.allSeries:[]).map(e=>{let t=e.datum;return{...e,value:t?.__bumpValue??e.value,rank:t?.__bumpRank,datum:t?.__bumpRaw??e.datum}}),i=t?.data??t,n={...i?.__bumpRaw??{},xValue:i?.__bumpXValue??t.xValue,allSeries:o};if(ze(e)&&"function"==typeof e.content)return e.content(n);let l=t.xValue??i?.x;
|
|
5
|
-
return $t(kt,{children:[null!=l&& zt("div",{style:{fontWeight:700,marginBottom:4},children:a(l)}),o.map((e,t)=> $t("div",{style:{display:"flex",alignItems:"center",gap:6},children:[
|
|
6
|
-
zt("span",{style:{width:8,height:8,borderRadius:"50%",background:e.color,flexShrink:0}}),
|
|
7
|
-
zt("span",{style:{flex:1},children:e.group}),
|
|
8
|
-
$t("span",{children:[null!=e.rank?`Rank ${e.rank} · `:"",r(e.value)]})]},`${e.group}-${t}`))]})},[r,a,e]);return{tooltip:Nt(()=>{if(!1===e)return!1;let t=n?c:s,o=(n?ze(e)&&Ct(e.content):Ct(l))?Lt(t):t;return n?{mode:"multi",content:o,chrome:ze(e)?e.chrome:void 0}:o},[n,c,l,s,e]),formatX:a}}function io(e,t,o,i,a){let r=1-a;return r*r*r*e+3*r*r*a*t+3*r*a*a*o+a*a*a*i}function ao(e,t,o,i,a){let r=1-a;return 3*r*r*(t-e)+6*r*a*(o-t)+3*a*a*(i-o)}function ro(e,t,o,i,a){let r=[],n=(e.x+t.x)/2;for(let l=0;l<=a;l++){let s,c,h,d,m=l/a;"linear"===i?(s=e.x+(t.x-e.x)*m,c=e.y+(t.y-e.y)*m,h=t.x-e.x,d=t.y-e.y):(s=io(e.x,n,n,t.x,m),c=io(e.y,e.y,t.y,t.y,m),h=ao(e.x,n,n,t.x,m),d=ao(e.y,e.y,t.y,t.y,m)),r.push({x:s,y:c,dx:h,dy:d,radius:e.radius+(t.radius-e.radius)*m,datumIndex:m<.5?o:o+1})}return r}function no(e,t){let o=e.length-1,i=Math.sign(e[o][0]-e[t][0])||1,a=i*e[o][0],r=i*e[t][0];for(let n=t+1;n<o;n++){let t=Math.max(r,Math.min(a,i*e[n][0]));e[n][0]=i*t,r=t}for(let i=t;i<o;i++){let t=i;for(;t<o&&e[t+1][0]===e[i][0];)t++;for(let o=i+1;o<t;o++)e[o][1]=e[i][1]+(e[t][1]-e[i][1])*(o-i)/(t-i);i=t}let n=1e-6*(a-i*e[t][0])/(o-t);r=i*e[t][0];for(let l=t+1;l<o;l++){let t=Math.max(r+n,Math.min(i*e[l][0],a-(o-l)*n));e[l][0]=i*t,r=t}}function lo(e,t={}){let o=[],i=[],a=[];if(e.length<2)return{topPath:o,bottomPath:i,datumIndices:a};let r=t.curve??"smooth",n=Math.max(2,Math.floor(t.samplesPerSegment??12));for(let t=0;t<e.length-1;t++){let l=Math.max(0,o.length-1),s=ro(e[t],e[t+1],t,r,n);for(let e=0===t?0:1;e<s.length;e++){let t=s[e],r=Math.hypot(t.dx,t.dy)||1,n=-t.dy/r,l=t.dx/r,c=Math.max(0,t.radius);o.push([t.x+n*c,t.y+l*c]),i.push([t.x-n*c,t.y-l*c]),a.push(t.datumIndex)}no(o,l),no(i,l)}return{topPath:o,bottomPath:i,datumIndices:a}}function so(e,t){let o=0;for(let t of e)o+=(t.codePointAt(0)??0)>=11904?c:h.find(([e])=>e.test(t))?.[1]??(t.toLowerCase()!==t?d:m);return o*t*u}function co(e){let t=e.fontSize??12,o=!0===e.showLabels?"end":e.showLabels,i="end"===o||"both"===o||"auto"===o,c="start"===o||"both"===o,h=e.labels.reduce((e,o)=>Math.max(e,so(o,t)),0),d=Math.round(e.width*(e.maxSideFraction??.38)),m=so(String(Math.max(1,e.rankCount)),t),u=e.showAxes?r+m+s:r,p=e.showAxes&&e.yLabel?l:0,y={start:u+n+p,end:r+n},g=e.legendSide?Ge({legendGroups:[{label:"",styleFn:()=>({}),items:e.labels.map(e=>({label:e}))}]},{sideGutter:0}):0,f=so("MMM",t),b=(t,o)=>Math.min(o+h,e.legendSide===t?Math.max(o+f,d-g):d),x={start:c?b("left",y.start):0,end:i?b("right",y.end):0},v=!1===e.showLabels?24:110;return{margin:{...a,right:Math.max(v,x.end),left:Math.max(a.left,x.start)},startLabelOffset:u,chrome:y,room:x,labelWidth:h,fontSize:t,hasStart:c,hasEnd:i}}function ho(e,t){let o={start:t.hasStart?Math.max(0,Math.min(e.left,t.room.start)-t.chrome.start):0,end:t.hasEnd?Math.max(0,Math.min(e.right,t.room.end)-t.chrome.end):0};return{budget:o,sideGutter:{...t.hasStart&&{left:t.chrome.start+Math.min(o.start,t.labelWidth)},...t.hasEnd&&{right:t.chrome.end+Math.min(o.end,t.labelWidth)}}}}function mo(e,t,o){if(so(e,o)<=t)return{text:e,truncated:!1};let i=Array.from(e),a=i.length-1;for(;a>0&&so(`${i.slice(0,a).join("")}…`,o)>t;)a--;return{text:`${i.slice(0,a).join("").trimEnd()}…`,truncated:!0}}function uo(e,t,o,i){let a=Math.max(1,Math.floor(t/18)),r="auto"===o?Number.isFinite(i)&&(i??0)>=0?Math.min(a,Math.floor(i)):a:1/0,n=e.map((e,t)=>({candidate:e,index:t})).sort((e,t)=>{let o=e.candidate.priority??0;return(t.candidate.priority??0)-o||Number(t.candidate.highlighted)-Number(e.candidate.highlighted)||e.candidate.rank-t.candidate.rank||e.index-t.index}),l=[];for(let{candidate:e}of n){if(l.length>=r)break;l.some(t=>t.side===e.side&&Math.abs(t.y-e.y)<14)||l.push(e)}return new Set(l.map(e=>e.id))}function po({datum:e,x:t,y:o,side:i,color:a,highlighted:r,labelStyle:n,offset:l,budget:s,fontSize:c}){let h=_e(),d=h.isActive&&!h.predicate(e),m="function"==typeof n?n(e.__bumpRaw):n,u=null==s?{text:e.__bumpSeries,truncated:!1}:mo(e.__bumpSeries,s,c);
|
|
9
|
-
return $t("text",{className:"semiotic-bump-label",x:t+("end"===i?l:-l),y:o,dy:"0.35em",textAnchor:"end"===i?"start":"end",fill:a,fillOpacity:d?.16:1,fontWeight:r?650:450,fontSize:12,style:{pointerEvents:"none",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-axis-label-font-size, 12px)",...m},children:[u.truncated&& zt("title",{children:e.__bumpSeries}),u.text]})}function yo(e){let t=Array.isArray(e.datum)?e.datum[0]:e.datum;return t&&"object"==typeof t&&"__bumpSeries"in t?t:void 0}function go(e,t,o){let[i,a]=t,[r,n]=o;return a===i?(r+n)/2:r+(n-r)*Math.max(0,Math.min(1,(e-i)/(a-i)))}function fo(e){let t=e.__bumpXValue instanceof Date?e.__bumpXValue.getTime():Number(e.__bumpXValue);return{value:e.__bumpValue,x:Number.isFinite(t)?t:void 0,y:e.__bumpValue,category:e.__bumpSeries}}function bo(e){let t=e.config,o= new Map;for(let t of e.data){let e=o.get(t.__bumpSeries)??[];e.push(t),o.set(t.__bumpSeries,e)}let i=t.seriesOrder.filter(e=>o.has(e)).sort((e,i)=>(o.get(e)?.[0]?.__bumpHighlighted?1:0)-(o.get(i)?.[0]?.__bumpHighlighted?1:0)||t.seriesOrder.indexOf(e)-t.seriesOrder.indexOf(i)),a=[],r=[],n=[];for(let r of i){let i=(o.get(r)??[]).sort((e,t)=>e.x-t.x);if(i.length<2)continue;let l=i[0].__bumpHighlighted,s=(t.colorMap&&bt(t.colorMap,r))??e.resolveColor(i[0].__bumpSeries,i[0]),c=t.color??(l?s:t.neutralColor??e.theme.semantic.textSecondary??e.theme.semantic.border??s),h=i.map(o=>({x:e.scales.x(o.x),y:e.scales.y(o.y),radius:t.ribbon?go(o.__bumpValue,t.valueExtent,t.ribbonSizeRange)/2:Math.max(.5,t.lineWidth/2)})),d=lo(h,{curve:t.curve,samplesPerSegment:t.samplesPerSegment}),m={fill:c,fillOpacity:1,opacity:l?t.ribbon?t.ribbonOpacity:t.lineOpacity:Math.min(t.ribbon?t.ribbonOpacity:t.lineOpacity,.58)};t.styleRules?.length&&Object.assign(m,$e(i[0].__bumpRaw,t.styleRules,fo(i[0]))),t.areaStyle&&Object.assign(m,t.areaStyle(i[0].__bumpRaw)??{}),void 0!==t.stroke&&(m.stroke=t.stroke),void 0!==t.strokeWidth&&(m.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(m.opacity=t.opacity),a.push({type:"area",topPath:d.topPath,bottomPath:d.bottomPath,_hitArea:!0,style:m,datum:d.datumIndices.map(e=>i[e]),accessibleDatum:i.map(e=>e.__bumpRaw),accessibility:{label:`${r} ranking trajectory`,tableFields:i.map(e=>e.__bumpRaw)},group:r,interactive:!0}),t.showPoints&&i.forEach((e,o)=>{let i={fill:c,stroke:"none",opacity:l?1:.75};t.styleRules?.length&&Object.assign(i,$e(e.__bumpRaw,t.styleRules,fo(e))),t.pointStyle&&Object.assign(i,t.pointStyle(e.__bumpRaw)??{}),void 0!==t.stroke&&(i.stroke=t.stroke),void 0!==t.strokeWidth&&(i.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(i.opacity=t.opacity),a.push({type:"point",x:h[o].x,y:h[o].y,r:i.r??t.pointRadius,style:i,datum:e,accessibleDatum:e.__bumpRaw,accessibility:{label:`${r}, rank ${e.__bumpRank}, value ${e.__bumpValue}`},pointId:`${r}:${e.x}`})});let u=!0===t.showLabels?"end":t.showLabels,p=(e,o,i)=>{let a=null==t.labelPriorityAccessor?void 0:"function"==typeof t.labelPriorityAccessor?t.labelPriorityAccessor(e.__bumpRaw):Number(e.__bumpRaw[t.labelPriorityAccessor]);n.push({id:`${r}\0${i}`,datum:e,x:h[o].x,y:h[o].y,side:i,rank:e.__bumpRank,highlighted:l,priority:Number.isFinite(a)?a:void 0,color:"string"==typeof m.fill?m.fill:c})};("start"===u||"both"===u)&&p(i[0],0,"start"),("end"===u||"both"===u||"auto"===u)&&p(i.at(-1),i.length-1,"end")}let l=!0===t.showLabels?"end":t.showLabels,s=uo(n,e.dimensions.plot.height,"auto"!==l||"auto",t.maxLabels);for(let e of n)s.has(e.id)&&r.push(
|
|
10
|
-
zt(po,{datum:e.datum,x:e.x,y:e.y,side:e.side,color:e.color,highlighted:e.highlighted,labelStyle:t.labelStyle,offset:"end"===e.side?8:t.startLabelOffset??8,budget:t.labelBudget?.[e.side],fontSize:t.labelFontSize??12},e.id));return{nodes:a,overlays:r.length? zt("g",{className:"semiotic-bump-labels",children:r}):void 0,restyle:(e,t)=>{let o=yo(e);if(t?.isActive&&o&&!t.predicate(o))return{opacity:.14}}}}function xo({data:e,safeData:t,areaBy:o,lineDataAccessor:i}){if(null==e)return[];let a,r=void 0!==t[0]?.[i];if(!r&&!o)return t;if(r)a=t;else{let e=t.reduce((e,t)=>{let a="function"==typeof o?o(t):t[o],r=String(a);if(!e[r]){let t={[i]:[]};"string"==typeof o&&(t[o]=a),e[r]=t}return e[r][i].push(t),e},{});a=Object.values(e)}return a.flatMap(e=>{let t=Array.isArray(e[i])?e[i]:[];return"string"==typeof o?t.map(t=>({...t,[o]:t[o]??e[o]})):t})}function vo(e){let{safeData:t,data:o,areaBy:i,lineDataAccessor:a,colorBy:r,colorScale:n,color:l,stroke:s,strokeWidth:c,opacity:h,effectiveSelectionHook:d,resolvedSelection:m,areaOpacity:u,showLine:p,lineWidth:y,showPoints:g,pointRadius:f,xAccessor:b,yAccessor:x,xLabel:v,yLabel:A,xFormat:w,yFormat:S,groupField:k,styleRules:C,ruleContext:L}=e,R=Nt(()=>xo({data:o,safeData:t,areaBy:i,lineDataAccessor:a}),[o,t,i,a]),_=Nt(()=>e=>{let t={};if(r){if(n){let o=xt(e,r,n);t.fill=o,p?(t.stroke=o,t.strokeWidth=y):t.stroke="none"}}else{let e=l||vt;t.fill=e,p?(t.stroke=e,t.strokeWidth=y):t.stroke="none"}return t.fillOpacity=u,C&&C.length>0&&Object.assign(t,$e(e,C,L?L(e):{value:void 0})),t},[r,n,l,u,p,y,C,L]),H=Nt(()=>Le(_,{stroke:s,strokeWidth:c,opacity:h}),[_,s,c,h]),I=Nt(()=>ut(H,d??null,m),[H,d,m]),F=Nt(()=>{if(g)return e=>{let t={r:f,fillOpacity:1};return r?n&&(t.fill=xt(e.parentLine||e,r,n)):t.fill=l||vt,t}},[g,f,r,n,l]);return{flattenedData:R,lineStyle:I,pointStyle:F,defaultTooltipContent:Nt(()=>Ae([{label:v||we(b),accessor:b,role:"x",format:w},{label:A||we(x),accessor:x,role:"y",format:S},...k?[{label:we(k),accessor:k,role:"group"}]:[],...Re(e.band,S)]),[b,x,v,A,k,w,S,e.band])}}function Ao(e,t,o,i){if(!e.length)return[];let a=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[],n=0,l=null,s=null,c=[],h=(e,t)=>e>t?"A":t>e?"B":null,d=e=>`seg-${n}-${e}`,m=e=>r.push(e),u=(e,t)=>{m({__x:e.x,__y:e.y,__y0:e.y,__diffSegment:d(t),__diffWinner:t,__valA:e.y,__valB:e.y,__sourceDatum:e.datum})};for(let e=0;e<a.length;e++){let r=a[e],p=t(r),y=o(r),g=i(r);if(!Number.isFinite(p)||!Number.isFinite(y)||!Number.isFinite(g))continue;let f=h(y,g);if(null!==f){if(null==l){l=f;for(let e of c)u(e,l);c=[],m({__x:p,__y:y>=g?y:g,__y0:y>=g?g:y,__diffSegment:d(l),__diffWinner:l,__valA:y,__valB:g,__sourceDatum:r}),s={x:p,a:y,b:g,w:f};continue}if(s&&s.w!==f){let e,t;if(c.length>0)e=c[0].x,t=c[0].y;else{let o=y-s.a-(g-s.b);if(0!==o){let i=(s.b-s.a)/o,a=Math.max(0,Math.min(1,i));e=s.x+a*(p-s.x),t=s.a+a*(y-s.a)}else e=s.x,t=s.a}m({__x:e,__y:t,__y0:t,__diffSegment:d(l),__diffWinner:l,__valA:t,__valB:t}),n++,l=f,m({__x:e,__y:t,__y0:t,__diffSegment:d(l),__diffWinner:l,__valA:t,__valB:t});for(let e=1;e<c.length;e++)u(c[e],l)}else for(let e of c)u(e,l);c=[],m({__x:p,__y:y>=g?y:g,__y0:y>=g?g:y,__diffSegment:d(l),__diffWinner:l,__valA:y,__valB:g,__sourceDatum:r}),s={x:p,a:y,b:g,w:f}}else c.push({x:p,y:y,datum:r})}for(let e of c)u(e,l??"A");return r}function wo(e){if("A"===e.__diffWinner||"B"===e.__diffWinner)return e.__diffWinner;let t=String(e.__diffSegment??"");return"line-A"===t||t.endsWith("-A")?"A":"B"}function So(e,t){return Xe(e,t,e=>{let t=Number(e.__x),o=Number(e.__y);return{value:Number.isFinite(o)?o:void 0,x:Number.isFinite(t)?t:void 0,y:Number.isFinite(o)?o:void 0,category:wo(e)}},e=>e.__sourceDatum?{...e.__sourceDatum,...e}:e)}function ko(e){let{seriesAColor:t,seriesBColor:o,areaOpacity:i,styleRules:a}=e;return So(e=>({fill:"A"===wo(e)?t:o,stroke:"none",fillOpacity:i}),a)}function Co(e){let{seriesAColor:t,seriesBColor:o,lineWidth:i,styleRules:a}=e;return So(e=>({stroke:"A"===wo(e)?t:o,strokeWidth:i,fill:"none"}),a)}function Lo(e){let{seriesAColor:t,seriesBColor:o,pointRadius:i,styleRules:a}=e;return So(e=>({fill:"A"===wo(e)?t:o,r:i}),a)}function Ro(e){if(null==e)return NaN;if("number"==typeof e)return e;if(e instanceof Date)return e.getTime();if("string"==typeof e){if(""===e.trim())return NaN;let t=+e;return Number.isFinite(t)?t:NaN}return NaN}function _o(e,t,o,i){if(!e.length)return[];let a=e.filter(e=>Number.isFinite(t(e))).sort((e,o)=>t(e)-t(o)),r=[];for(let e of a){let a=t(e),n=o(e),l=i(e);Number.isFinite(n)&&r.push({__x:a,__y:n,__diffSegment:"line-A",__diffWinner:"A",__sourceDatum:e}),Number.isFinite(l)&&r.push({__x:a,__y:l,__diffSegment:"line-B",__diffWinner:"B",__sourceDatum:e})}return r}function Ho(e){let[t,o]=Bt.useState(()=>w);return Bt.useEffect(()=>{if(t)return;let e=!1;return(w?Promise.resolve(w):(S||(S=import("./c-HPT33CWH.min.js").then(e=>w=e.ScatterplotMatrixBrushOverlay).catch(e=>{throw S=null,e})),S)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t? zt(t,{...e}):null}function Io({data:e,xField:t,yField:o,fieldLabels:i,cellSize:a,pointRadius:r,pointOpacity:n,styleRules:l,colorBy:s,colorScale:c,brushSelectionName:h,hoverSelectionName:d,unselectedOpacity:m,showGrid:u,maxDevicePixelRatio:p,mobileInteraction:y,mode:g,onPointHover:f,onPointClick:b}){me(Z);let x=Dt(null),v=et({name:h,clientId:`splom-${t}-${o}`,fields:[t,o]}),A=tt({name:h,xField:t,yField:o}),w=et({name:d,clientId:C,fields:[k]}),S=w.selectPoints,R=Tt(e=>{e?A.brushInteraction.during(e):A.brushInteraction.end(null)},[A.brushInteraction]),_=Tt(e=>{if(!e)return void f?.(null);let t=e.data,o=t?.[k];void 0!==o&&(S({[k]:[o]}),f?.(t,e.x+L.left,e.y+L.top))},[S,f]),H=Tt(e=>{if(!e)return void b?.(null);let t=e.data;t&&b?.(t,e.x+L.left,e.y+L.top)},[b]),I=Nt(()=>De(t,o),[t,o]),F=Nt(()=>Xe(e=>({opacity:n,r:r,fill:s?xt(e,s,c):vt}),l,I),[n,r,s,c,l,I]),P=Tt(e=>{let t={...F(e)};return"hover"===g?w.isActive&&w.predicate(e)?(t.opacity=1,t.r=2.5*r,t.stroke="#333",t.strokeWidth=1.5):w.isActive&&(t.opacity=.6*("number"==typeof t.opacity?t.opacity:n)):v.isActive&&!v.predicate(e)&&(t.opacity=m),t},[F,g,w,v,m,r,n]);
|
|
11
|
-
return $t("div",{style:{position:"relative",width:a,height:a},children:[
|
|
12
|
-
zt(se,{ref:x,chartType:"scatter",data:e,size:[a,a],xAccessor:t,yAccessor:o,pointStyle:P,margin:L,showAxes:!1,maxDevicePixelRatio:p,enableHover:"hover"===g,accessibleTable:!1,description:`${bt(i,t)??t} versus ${bt(i,o)??o} scatterplot`,...Se({forceHoverBehavior:"hover"===g,forceClickBehavior:!!b,mobileInteraction:y,customHoverBehavior:_,customClickBehavior:H}),tooltipContent:"hover"===g?()=>null:void 0}),"brush"===g&& zt(Ho,{frameRef:x,cellSize:a,onBrush:R})]})}function Fo({data:e,field:t,label:o,cellSize:i,bins:a,colorBy:r,colorScale:n,brushSelectionName:l,hoverSelectionName:s,unselectedOpacity:c,mode:h}){let d=et({name:l,clientId:`splom-diag-${t}`,fields:[t]}),m=et({name:s,clientId:`splom-diag-${t}-hover`,fields:[k]}),u="hover"===h?m:d,p=u.isActive,y=u.predicate,g=Nt(()=>{let o="string"==typeof r?r:null,n=[],l= new Set;for(let i of e){let e=i[t];if(null!=e&&!isNaN(e)&&n.push(Number(e)),o){let e=i[o];null!=e&&l.add(String(e))}}if(0===n.length)return{bars:[],selectedBars:[],categoryBars:[],selectedCategoryBars:[],max:0,categories:[]};let[s,c]=Ft(n),h=(c-s)/a||1,d=Array.from(l),m=new Map(d.map((e,t)=>[e,t])),u=new Array(a).fill(0),g=new Array(a).fill(0),f=Array.from({length:a},()=>new Array(d.length).fill(0)),b=Array.from({length:a},()=>new Array(d.length).fill(0));for(let i of e){let e=i[t];if(null==e||isNaN(e))continue;let r=Math.min(Math.floor((e-s)/h),a-1);if(u[r]++,(!p||y(i))&&g[r]++,o){let e=m.get(String(i[o]));void 0!==e&&(f[r][e]++,(!p||y(i))&&b[r][e]++)}}let x=Pt(u,1),v=f.map((e,t)=>{let o=0;return e.map((e,r)=>{let n=e/x*(i-24),l={x:t/a*i,w:i/a-1,h:n,y0:o,category:d[r]};return o+=n,l})}),A=b.map((e,t)=>{let o=0;return e.map((e,r)=>{let n=e/x*(i-24),l={x:t/a*i,w:i/a-1,h:n,y0:o,category:d[r]};return o+=n,l})});return{bars:u.map((e,t)=>({x:t/a*i,w:i/a-1,h:e/x*(i-24),count:e})),selectedBars:g.map((e,t)=>({x:t/a*i,w:i/a-1,h:e/x*(i-24),count:e})),categoryBars:v,selectedCategoryBars:A,max:x,categories:d}},[e,t,a,i,p,y,r]);
|
|
13
|
-
return $t("svg",{width:i,height:i,style:{overflow:"hidden"},children:[
|
|
14
|
-
zt("text",{x:i/2,y:14,textAnchor:"middle",fontSize:11,fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)",children:o}),g.categories.length>0?g.categoryBars.map((e,t)=>e.map((e,o)=> zt("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:n?n(e.category):vt,opacity:p?.3:.6},`bg-${t}-${o}`))):g.bars.map((e,t)=> zt("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:vt,opacity:p?.3:.6},`bg-${t}`)),p&&(g.categories.length>0?g.selectedCategoryBars.map((e,t)=>e.map((e,o)=> zt("rect",{x:e.x,y:i-e.y0-e.h,width:Math.max(e.w,1),height:e.h,fill:n?n(e.category):vt,opacity:.7},`sel-${t}-${o}`))):g.selectedBars.map((e,t)=> zt("rect",{x:e.x,y:i-e.h,width:Math.max(e.w,1),height:e.h,fill:vt,opacity:.7},`sel-${t}`)))]})}function Po({label:e,cellSize:t}){
|
|
15
|
-
return zt("svg",{width:t,height:t,children: zt("text",{x:t/2,y:t/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:12,fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)",children:e})})}function Bo(e){let{data:t,fields:o,fieldLabels:i={},colorBy:a,colorScheme:r,cellSize:n=A.cellSize,cellGap:l=A.cellGap,pointRadius:s=2,pointOpacity:c=.5,diagonal:h="histogram",histogramBins:d=20,brushMode:m="crossfilter",hoverMode:u=!0,unselectedOpacity:p=.1,showGrid:y=!1,maxDevicePixelRatio:g,tooltip:f,showLegend:b,idAccessor:x,styleRules:v,width:w,height:S,className:C,title:L,description:R,summary:_,accessibleTable:H=!0,onObservation:I,onClick:F,chartId:P}=e,B="splom",D="splom-hover",M=ot(e.mobileInteraction,{mode:e.mode,width:w??o.length*n,mobileSemantics:e.mobileSemantics}),T=u?"hover":m?"brush":"hover",N=Ht(e=>e.clearSelection),[W,O]=Mt(null),E=Tt(()=>{N(D),O(null)},[N,D]),z=Nt(()=>(t||[]).map((e,t)=>void 0!==e[k]?e:{...e,[k]:t}),[t]),G=it(z,a,r),$=`${Bt.useId().replace(/:/g,"")}-data-table`,j=Nt(()=>(t||[]).map(e=>({type:"point",datum:e})),[t]),V=Nt(()=>Ee(f),[f]),X=(o.length,A.labelWidth),Y=Tt((e,t,o,i)=>[X+l+e*(n+l)+(o??0),t*(n+l)+(i??0)],[X,n,l]),Q=void 0!==b?b:!!a,U=Nt(()=>{if(!Q||!a)return null;let e="string"==typeof a?a:null;return e?Array.from(new Set(z.map(t=>t[e]).filter(e=>null!=e))).map(e=>({label:String(e),color:G?G(String(e)):vt})):null},[Q,a,z,G]),K=Nt(()=>({display:"grid",gridTemplateColumns:`${X}px ${o.map(()=>`${n}px`).join(" ")}`,gridTemplateRows:`${o.map(()=>`${n}px`).join(" ")} ${X}px`,gap:`${l}px`,width:"fit-content"}),[o,n,l,X]);
|
|
16
|
-
return $t("div",{className:C,style:{position:"relative",color:"var(--semiotic-text, #333)",fontFamily:"var(--semiotic-font-family, sans-serif)"},role:"group","aria-label":R||L||`Scatterplot matrix comparing ${o.length} fields`,children:[L&& zt("div",{className:"semiotic-chart-title",style:{fontWeight:600,marginBottom:8},children:L}),H&& zt(at,{accessibleTable:H,children: zt(rt,{tableId:$})}),
|
|
17
|
-
zt(nt,{summary:_}),U&& zt("div",{style:{display:"flex",gap:12,marginBottom:8,flexWrap:"wrap"},children:U.map(e=> $t("div",{style:{display:"flex",alignItems:"center",gap:4},children:[
|
|
18
|
-
zt("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",backgroundColor:e.color}}),
|
|
19
|
-
zt("span",{style:{fontSize:11},children:e.label})]},e.label))}),
|
|
20
|
-
$t("div",{style:{position:"relative",width:"fit-content"},children:[
|
|
21
|
-
$t("div",{style:K,onMouseLeave:"hover"===T?E:void 0,children:[o.map((e,t)=> $t(Bt.Fragment,{children:[
|
|
22
|
-
zt("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",writingMode:"vertical-rl",transform:"rotate(180deg)",fontSize:11,fontWeight:"bold",color:"var(--semiotic-text, #333)"},children:bt(i,e)??e}),o.map((o,r)=>t===r?"label"===h? zt(Po,{label:bt(i,e)??e,cellSize:n},`diag-${e}`): zt(Fo,{data:z,field:e,label:bt(i,e)??e,cellSize:n,bins:d,colorBy:a,colorScale:G,brushSelectionName:B,hoverSelectionName:D,unselectedOpacity:p,mode:T},`diag-${e}`): zt(Io,{data:z,xField:o,yField:e,fieldLabels:i,cellSize:n,pointRadius:s,pointOpacity:c,styleRules:v,colorBy:a,colorScale:G,brushSelectionName:B,hoverSelectionName:D,unselectedOpacity:p,showGrid:y,maxDevicePixelRatio:g,mobileInteraction:M,mode:T,onPointHover:"hover"===T?(i,a,n)=>{if(i){if(O({datum:i,xField:o,yField:e,colIndex:r,rowIndex:t,px:a??0,py:n??0}),I){let[e,o]=Y(r,t,a,n);I({type:"hover",datum:i,x:e,y:o,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:P})}}else O(null),I&&I({type:"hover-end",timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:P})}:void 0,onPointClick:F||I?(e,o,i)=>{if(!e)return;let[a,n]=Y(r,t,o,i);F&&F(e,{x:a,y:n}),I&&I({type:"click",datum:e,x:a,y:n,timestamp:Date.now(),chartType:"ScatterplotMatrix",chartId:P})}:void 0},`cell-${e}-${o}`))]},`row-${e}`)),
|
|
23
|
-
zt("div",{})," ",o.map(e=> zt("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:"bold",color:"#333"},children:bt(i,e)??e},`col-label-${e}`))]}),W&&"hover"===T&&!1!==f&&(()=>{let e=W.datum,t=bt(i,W.xField)??W.xField,r=bt(i,W.yField)??W.yField,s=a?"function"==typeof a?a(e):e[a]:null,c=x?"function"==typeof x?x(e):e[x]:`Row ${e[k]}`,h=X+l+W.colIndex*(n+l),d=W.rowIndex*(n+l),m=h+W.px,u=d+W.py,p={...e};delete p[k];let y="function"==typeof V,g=y?V(p):null,f= $t(kt,{style:{color:"var(--semiotic-tooltip-text, #333)",background:"var(--semiotic-tooltip-bg, rgba(255,255,255,0.95))",border:"1px solid var(--semiotic-border, #ddd)",borderRadius:3,padding:"4px 8px",fontSize:11,lineHeight:1.4,whiteSpace:"nowrap",boxShadow:"none"},children:[
|
|
24
|
-
zt("div",{style:{fontWeight:"bold",marginBottom:2},children:String(c)}),
|
|
25
|
-
$t("div",{children:[t,": ",null!=e[W.xField]?Number(e[W.xField]).toFixed(1):"–"]}),
|
|
26
|
-
$t("div",{children:[r,": ",null!=e[W.yField]?Number(e[W.yField]).toFixed(1):"–"]}),null!=s&& $t("div",{style:{opacity:.8},children:["string"==typeof a?a:"group",": ",String(s)]})]}),b=y?g:f;return It(b)? zt(lt,{contentOwnsChrome:Ct(V),x:m,y:u,containerWidth:X+o.length*n+o.length*l,containerHeight:o.length*n+X+o.length*l,margin:{top:0,right:0,bottom:0,left:0},className:"scatterplot-matrix-tooltip",zIndex:10,children:b}):null})()]}),H&& zt(at,{accessibleTable:H,children: zt(st,{scene:j,chartType:"scatterplot matrix",tableId:$,chartTitle:L})})]})}function Do(e){let[t,o]=Bt.useState(()=>_);return Bt.useEffect(()=>{if(t)return;let e=!1;return(_?Promise.resolve(_):(H||(H=import("./c-E3G25LFD.min.js").then(e=>_=e.MinimapBrush).catch(e=>{throw H=null,e})),H)).then(t=>{e||o(()=>t)}).catch(()=>{}),()=>{e=!0}},[t]),t? zt(t,{...e}):null}function Mo(e){let t=To(e);return(e.height||I)+(e.margin?.top??t.top)+(e.margin?.bottom??t.bottom)}function To(e){let t=e.handles&&"object"==typeof e.handles?e.handles:e.handles?{}:null,o="number"==typeof t?.size&&Number.isFinite(t.size)?t.size:12;return{top:t?.move?Math.ceil(O(o)/2)+2:0,bottom:e.showExtentLabels?34:20}}function No(e,t){return{label:t?.label??e.label,color:t?.color??e.color,opacity:t?.opacity??e.opacity}}function Wo(e,t,o){let i=gt(t,o,wt),a=t&&"object"==typeof t&&!Array.isArray(t)?t:null;return e.map((e,t)=>{if("string"==typeof e.color&&e.color.length>0)return e.color;let o=e.label||`Series ${t+1}`,r=a?.[o];return"string"==typeof r&&r.length>0?r:i[t%i.length]})}function Oo(e,t){let o=dt(e),i=t.map((e,t)=>({label:e.label||`Series ${t+1}`,readY:dt(e.yAccessor)}));return(e,t)=>{let a=String(e[M]??t??""),r=(i.find(e=>e.label===a)??i[0])?.readY(e);return{value:r,x:o(e),y:r,category:a||void 0}}}function Eo(e,t){let o=1/0,i=-1/0,a="function"==typeof t?t:e=>e[t];for(let t of e){let e=a(t);null!=e&&isFinite(e)&&(e<o&&(o=e),e>i&&(i=e))}if(!isFinite(o)||!isFinite(i))return[0,1];if(o===i){let e=0===o?1:.1*Math.abs(o);return[o-e,i+e]}return[o,i]}function zo(e,t){let o=t[1]-t[0];return 0===o?.5:(e-t[0])/o}function Go(e,t){return t[0]+e*(t[1]-t[0])}var e=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){ne(E),me(Z);let o=Dt(null),i=Ie(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",xScaleType:d,yScaleType:m,colorBy:u,colorScheme:p,styleRules:y,sizeBy:g,sizeRange:f=[3,15],symbolBy:b,symbolMap:x,pointRadius:v=5,pointOpacity:A=.8,tooltip:w,marginalGraphics:S,pointIdAccessor:k,annotations:C,regression:L,forecast:R,anomaly:_,xExtent:H,yExtent:I,pulse:F,decay:P,staleness:B,frameProps:D={},selection:M,linkedHover:T,linkedBrush:N,brush:W,onBrush:O,onObservation:$,onClick:j,hoverHighlight:X,chartId:Y,loading:q,loadingContent:J,emptyContent:ee,legendInteraction:te,legendPosition:oe,color:ie,stroke:ae,strokeWidth:re,opacity:ce}=e,{width:he,height:de,enableHover:ue,showGrid:pe,showLegend:ye,title:ge,description:fe,summary:be,accessibleTable:xe,xLabel:ve,yLabel:Le}=i,Re=Nt(()=>Fe(a),[a]),_e=void 0===a,{domain:He,trackPushed:Ne,reset:We}=Vt({accessor:g,data:Re,isPushMode:_e}),Oe=Tt(e=>{Ne([e]),o.current?.push(e)},[Ne]),Ee=Tt(e=>{Ne(e),o.current?.pushMany(e)},[Ne]);U(t,{variant:"xy",frameRef:o,overrides:{push:Oe,pushMany:Ee,clear:()=>{We(),o.current?.clear()}}});let ze=K({responsive:e,data:Re,rawData:a,colorBy:u,colorScheme:p,legendInteraction:te,legendPosition:oe,frameLegend:D,selection:M,linkedHover:T,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:$,onClick:j,hoverHighlight:X,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"Scatterplot",chartId:Y,showLegend:ye,userMargin:r,marginDefaults:i.marginDefaults,loading:q,loadingContent:J,emptyContent:ee,width:he,height:de,hasTitle:!!ge,axisChrome:Pe(D,{showAxes:i.showAxes,xLabel:ve,yLabel:Le})}),{brushStreamProps:Ge}=le({brush:W,onBrush:O,linkedBrush:N,xAccessor:c,yAccessor:h,defaultDimension:"xy"});Be("Scatterplot",Re,"xAccessor",c),Be("Scatterplot",Re,"yAccessor",h);let $e=Nt(()=>g?He??[0,1]:void 0,[g,He]),je=Nt(()=>g?e=>pt(e,g,f,$e):void 0,[g,f,$e]),Ve=Nt(()=>De(c,h),[c,h]),Xe=z({colorBy:u,colorScale:ze.colorScale,color:ie,pointRadius:v,fillOpacity:A,radiusFn:je,stroke:ae,strokeWidth:re,opacity:ce,styleRules:y,ruleContext:Ve,effectiveSelectionHook:ze.effectiveSelectionHook,resolvedSelection:ze.resolvedSelection}),{effectiveData:Ye,statisticalAnnotations:Qe,hasForecast:Ue,xAccessorKey:Ke,yAccessorKey:qe}=G({data:Re,xAccessor:c,yAccessor:h,forecast:R,anomaly:_}),Je=Ue?Ke:c,Ze=Ue?qe:h,et=Nt(()=>Ae([{label:ve||we(c),accessor:Je,role:"x",format:l},{label:Le||we(h),accessor:Ze,role:"y",format:s},...u?[{label:we(u),accessor:u,role:"color"}]:[],...g?[{label:we(g),accessor:g,role:"size"}]:[]]),[c,h,Je,Ze,ve,Le,u,g,l,s]),tt=Nt(()=>{let e=V(L),t=C||[];return e||0!==Qe.length?[...e?[e]:[],...t,...Qe]:C},[L,C,Qe]);if(ze.earlyReturn)return ze.earlyReturn;let ot=Q({componentName:"Scatterplot",data:a,accessors:{xAccessor:c,yAccessor:h}});if(ot) return zt(Me,{componentName:"Scatterplot",message:ot,width:he,height:de});let it={chartType:"scatter",...null!=a&&{data:Ye},xAccessor:Je,yAccessor:Ze,xScaleType:d,yScaleType:m,colorAccessor:u||void 0,sizeAccessor:g||void 0,...b&&{symbolAccessor:b},...x&&{symbolMap:x},sizeRange:f,pointStyle:Xe,colorScheme:p,size:[he,de],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ze.margin,showAxes:i.showAxes,xLabel:ve,yLabel:Le,xFormat:l,yFormat:s,enableHover:ue,showGrid:pe,...ze.legendBehaviorProps,...Ce({title:ge,description:fe,summary:be,accessibleTable:xe,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...ke({tooltip:w,defaultTooltipContent:et}),...Se({linkedHover:T,selection:M,onObservation:$,onClick:j,hoverHighlight:X,hoverRadius:e.hoverRadius,mobileInteraction:ze.mobileInteraction,customHoverBehavior:ze.customHoverBehavior,customClickBehavior:ze.customClickBehavior}),...S&&{marginalGraphics:S},...k&&{pointIdAccessor:k},...F&&{pulse:F},...P&&{decay:P},...B&&{staleness:B},...tt&&tt.length>0&&{annotations:tt},...H&&{xExtent:H},...I&&{yExtent:I},...Ge,...ze.crosshairProps,...D};
|
|
27
|
-
return zt(Te,{componentName:"Scatterplot",width:he,height:de,children: zt(se,{ref:o,...it})})}),"Scatterplot"),t=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){me(Z);let o=Dt(null);U(t,{variant:"xy",frameRef:o});let i=Ie(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",orderAccessor:d,orderLabel:m,styleRules:u,pointRadius:p=4,tooltip:y,pointIdAccessor:g,annotations:f,regression:b,forecast:x,anomaly:v,xExtent:A,yExtent:w,pulse:S,decay:k,staleness:C,frameProps:L={},selection:R,linkedHover:_,onObservation:H,onClick:I,hoverHighlight:F,chartId:P,loading:B,loadingContent:D,emptyContent:M,legendInteraction:T,stroke:N,strokeWidth:W,opacity:O}=e,{width:E,height:$,enableHover:j,showGrid:X,title:Y,description:q,summary:J,accessibleTable:ee,xLabel:te,yLabel:oe}=i,{safeData:ie,orderMap:ae}=Nt(()=>{let e=a||[],t="function"==typeof c?c:e=>e[c],o="function"==typeof h?h:e=>e[h],i=e;if(d&&e.length>0){let t="function"==typeof d?d:e=>e[d];i=[...e].sort((e,o)=>{let i=t(e),a=t(o);return(i instanceof Date?i.getTime():+i)-(a instanceof Date?a.getTime():+a)})}let r= new WeakMap,n=0;for(let e of i){let i=t(e),a=o(e);null!=i&&null!=a&&isFinite(i)&&isFinite(a)&&n++}let l=0;for(let e of i){let i=t(e),a=o(e);null!=i&&null!=a&&isFinite(i)&&isFinite(a)&&r.set(e,{idx:l++,total:n})}return{safeData:i,orderMap:r}},[a,d,c,h]);Be("ConnectedScatterplot",ie,"xAccessor",c),Be("ConnectedScatterplot",ie,"yAccessor",h);let re=K({responsive:e,data:ie,rawData:a,colorBy:void 0,colorScheme:void 0,legendInteraction:T,selection:R,linkedHover:_,fallbackFields:[],unwrapData:!1,onObservation:H,onClick:I,hoverHighlight:F,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"ConnectedScatterplot",chartId:P,showLegend:void 0,userMargin:r,marginDefaults:i.marginDefaults,loading:B,loadingContent:D,emptyContent:M,width:E,height:$,hasTitle:!!Y,axisChrome:Pe(L,{showAxes:i.showAxes,xLabel:te,yLabel:oe})}),ne=re.resolvedSelection?.unselectedOpacity??mt,le=Nt(()=>(e,t)=>{let o=t.filter(e=>"point"===e.type);if(o.length<2)return;let i=re.effectiveSelectionHook?.isActive,a=re.effectiveSelectionHook?.predicate,r=o.length<100,n=o.length;e.lineCap="round";for(let t=0;t<n-1;t++){let l=o[t],s=o[t+1],c=Xt(t,n),h=!i||!a||a(l.datum??l)||a(s.datum??s),d=i?h?1:ne:1;r&&(e.beginPath(),e.moveTo(l.x,l.y),e.lineTo(s.x,s.y),e.strokeStyle="white",e.lineWidth=p+2,e.globalAlpha=.5*d,e.stroke()),e.beginPath(),e.moveTo(l.x,l.y),e.lineTo(s.x,s.y),e.strokeStyle=c,e.lineWidth=p,e.globalAlpha=d,e.stroke()}e.globalAlpha=1},[p,re.effectiveSelectionHook,ne]),ce=Nt(()=>[le],[le]),he=Nt(()=>(e,t,o)=>{let i=e.filter(e=>"point"===e.type);if(i.length<2)return null;let a=i.length,r=a<100,n=[];for(let e=0;e<a-1;e++){let t=i[e],o=i[e+1],l=Xt(e,a),s="number"==typeof t.style?.opacity?t.style.opacity:1,c="number"==typeof o.style?.opacity?o.style.opacity:1,h=Math.min(s,c);r&&n.push(
|
|
28
|
-
zt("line",{x1:t.x,y1:t.y,x2:o.x,y2:o.y,stroke:"white",strokeWidth:p+2,strokeLinecap:"round",opacity:.5*h},`halo-${e}`)),n.push(
|
|
29
|
-
zt("line",{x1:t.x,y1:t.y,x2:o.x,y2:o.y,stroke:l,strokeWidth:p,strokeLinecap:"round",opacity:h},`seg-${e}`))}
|
|
30
|
-
return zt(Gt,{children:n})},[p]),de=Nt(()=>[he],[he]),ue=Nt(()=>e=>{let t=ae.get(e),o=t?.idx??0,i=t?.total??1;return{fill:i>0?Xt(o,i):"#6366f1",stroke:"white",strokeWidth:1,r:p,fillOpacity:1}},[p,ae]),pe=Nt(()=>De(c,h),[c,h]),ye=z({colorScale:void 0,baseStyleExtras:ue,stroke:N,strokeWidth:W,opacity:O,styleRules:u,ruleContext:pe,effectiveSelectionHook:re.effectiveSelectionHook,resolvedSelection:re.resolvedSelection}),ge=m||("string"==typeof d?d:"Order"),{effectiveData:fe,statisticalAnnotations:be,hasForecast:xe,xAccessorKey:ve,yAccessorKey:Le}=G({data:ie,xAccessor:c,yAccessor:h,forecast:x,anomaly:v}),Re=xe?ve:c,_e=xe?Le:h,He=Nt(()=>Ae([{label:te||we(c),accessor:Re,role:"x",format:l},{label:oe||we(h),accessor:_e,role:"y",format:s},...d?[{label:ge,accessor:d,role:"group"}]:[]]),[c,h,Re,_e,te,oe,d,ge,l,s]),Fe=Q({componentName:"ConnectedScatterplot",data:a,accessors:{xAccessor:c,yAccessor:h}});if(re.earlyReturn)return re.earlyReturn;let Ne=V(b),We=f||[],Oe=Ne||be.length>0?[...Ne?[Ne]:[],...We,...be]:f,Ee={chartType:"scatter",...null!=a&&{data:fe},xAccessor:Re,yAccessor:_e,pointStyle:ye,size:[E,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:re.margin,showAxes:i.showAxes,xLabel:te,yLabel:oe,xFormat:l,yFormat:s,enableHover:j,showGrid:X,...Ce({title:Y,description:q,summary:J,accessibleTable:ee,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...ke({tooltip:y,defaultTooltipContent:He}),...Se({linkedHover:_,selection:R,onObservation:H,onClick:I,hoverHighlight:F,hoverRadius:e.hoverRadius,mobileInteraction:re.mobileInteraction,customHoverBehavior:re.customHoverBehavior,customClickBehavior:re.customClickBehavior}),...g&&{pointIdAccessor:g},...S&&{pulse:S},...k&&{decay:k},...C&&{staleness:C},canvasPreRenderers:ce,svgPreRenderers:de,...Oe&&Oe.length>0&&{annotations:Oe},...A&&{xExtent:A},...w&&{yExtent:w},...re.crosshairProps,...L};return Fe? zt(Me,{componentName:"ConnectedScatterplot",message:Fe,width:E,height:$}): zt(Te,{componentName:"ConnectedScatterplot",width:E,height:$,children: zt(se,{ref:o,...Ee})})}),"ConnectedScatterplot"),o=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){me(re);let{data:o,layout:i,layoutConfig:a,onLayoutError:r,xExtent:n,yExtent:l,showAxes:s=!1,margin:c,className:h,annotations:d,onObservation:m,onClick:u,selection:p,linkedHover:y,hoverHighlight:g,chartId:f,loading:b,loadingContent:x,emptyContent:v,colorBy:A,colorScheme:w,legend:S,legendInteraction:k,legendPosition:C,frameProps:L={}}=e,{legend:R,..._}=L,H=Nt(()=>Ne(R,S),[R,S]),{frameRef:I,resolved:F,safeData:P,setup:B,earlyReturn:D}=X({responsive:e,imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"XYCustomChart",unwrapData:!1,data:o,colorBy:A,colorScheme:w,legend:H,legendInteraction:k,legendPosition:C,frameLegend:_,selection:p,linkedHover:y,hoverHighlight:g,onObservation:m,onClick:u,chartId:f,loading:b,loadingContent:x,emptyContent:v,margin:c,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules,xLabel:e.xLabel,yLabel:e.yLabel}),M=B.effectiveSelectionHook,T=Nt(()=>M?.isActive?{isActive:!0,predicate:M.predicate}:null,[M?.isActive,M?.predicate]),N=Nt(()=>We({tooltip:e.tooltip,defaultTooltipContent:e=> zt(ce,{hover:e})}),[e.tooltip]);if(D)return D;let{width:W,height:O,enableHover:E,showGrid:z,title:G,description:$,summary:j,accessibleTable:V,xLabel:Y,yLabel:Q}=F,U={chartType:"custom",...null!=o&&{data:P},customLayout:i,layoutConfig:a,onLayoutError:r,...T&&{layoutSelection:T},xExtent:n,yExtent:l,colorAccessor:A,colorScheme:w,size:[W,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:B.margin,showAxes:s,xLabel:Y,yLabel:Q,enableHover:E,showGrid:z,...B.legendBehaviorProps,...Ce({title:G,description:$,summary:j,accessibleTable:V,className:h,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N,...Se({linkedHover:y,selection:p,onObservation:m,onClick:u,hoverRadius:e.hoverRadius,hoverHighlight:g,mobileInteraction:B.mobileInteraction,customHoverBehavior:B.customHoverBehavior,customClickBehavior:B.customClickBehavior}),...d&&d.length>0&&{annotations:d},...B.crosshairProps,..._};
|
|
31
|
-
return zt(Te,{componentName:"XYCustomChart",width:W,height:O,children: zt(se,{ref:I,...U})})}),"XYCustomChart"),i="Other",a={top:20,bottom:48,left:48},r=8,n=4,l=24,s=6,c=1.1,h=[[/[mwMW@%…]/,.95],[/[ijlI'.,|\s]/,.28],[/[frt():;/[\]{}*`!\\-]/,.39]],d=.75,m=.62,u=1.05,p=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){let i=je(),a=Rt(),{data:r,xAccessor:n,yAccessor:l,lineBy:s,rankDirection:c="descending",ribbon:h=!1,curve:d="smooth",ribbonSizeRange:m=[4,28],samplesPerSegment:u=12,lineWidth:p=3,highlightTop:y,neutralColor:g,styleRules:f,labelStyle:b,colorScheme:x,ribbonOpacity:v=.82,lineOpacity:A=.9,showPoints:w=!1,pointRadius:S=3,showLabels:k=!0,labelPriorityAccessor:C,maxLabels:L,showGrid:R=!0,showLegend:_=!1,enableHover:H=!0,hoverHighlight:I=!0,tooltip:F,frameProps:P={},xFormat:B,yFormat:D,onClick:M}=e,T=Jt(y),N=Zt(g),W=Zt(e.color),O=Ie(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,responsiveRules:e.responsiveRules}),E=Nt(()=>to(r,{xAccessor:n,yAccessor:l,lineBy:s,rankDirection:c,highlightTop:T}),[r,n,l,s,c,T]),{axes:z,areaStyle:G,pointStyle:$,margin:j,...V}=P,X="object"==typeof b&&"number"==typeof b?.fontSize?b.fontSize:12,Q=e.legendPosition??"right",U=!_||"left"!==Q&&"right"!==Q?void 0:Q,K=Nt(()=>co({labels:E.seriesOrder,showLabels:k,width:O.width,showAxes:O.showAxes,rankCount:E.seriesOrder.length,yLabel:e.yLabel??"Rank",fontSize:X,legendSide:U}),[E.seriesOrder,k,O.width,O.showAxes,e.yLabel,X,U]),q=e.margin??j,J=Nt(()=>({...K.margin,...Y(q)}),[K,q]),Z=Nt(()=>ho(J,K),[J,K]),ee=U?Z.sideGutter[U]:void 0,te=Nt(()=>eo({seriesOrder:E.seriesOrder,overallOrder:E.overallOrder,highlightTop:T,color:W,colorScheme:x,neutralColor:N,themeCategorical:i,themeNeutral:a.colors.textSecondary}),[E.seriesOrder,E.overallOrder,T,W,x,N,i,a.colors.textSecondary]),oe=Nt(()=>({ribbon:h,curve:d,samplesPerSegment:u,ribbonSizeRange:m,valueExtent:E.valueExtent,seriesOrder:E.seriesOrder,lineWidth:p,ribbonOpacity:v,lineOpacity:A,neutralColor:N,color:W,colorMap:te&&"object"==typeof te&&!Array.isArray(te)?te:void 0,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,styleRules:f,areaStyle:G,pointStyle:$,labelStyle:b,showPoints:w,pointRadius:S,showLabels:k,labelPriorityAccessor:C,maxLabels:L,startLabelOffset:K.startLabelOffset,labelBudget:Z.budget,labelFontSize:X}),[h,d,u,m,E.valueExtent,E.seriesOrder,p,v,A,N,te,W,e.stroke,e.strokeWidth,e.opacity,f,G,$,b,w,S,k,C,L,K.startLabelOffset,Z.budget,X]),{tooltip:ie,formatX:ae}=oo({tooltip:F,xValues:E.xValues,xFormat:B,yFormat:D}),re=Nt(()=>{if(M)return(e,t)=>{M(e.__bumpRaw??e,t)}},[M]),ne=Math.max(1,E.seriesOrder.length),le=E.xValues.map((e,t)=>t),se=Array.from({length:ne},(e,t)=>t+1),ce=z??[{orient:"left",tickValues:se,tickFormat:e=>String(e),label:e.yLabel??"Rank",baseline:!1},{orient:"bottom",tickValues:le,tickFormat:ae,label:e.xLabel,tickAnchor:"edges"}],he=Nt(()=>qt(e.annotations,E.xValues),[e.annotations,E.xValues]);
|
|
32
|
-
return zt(o,{ref:t,data:E.data,layout:bo,layoutConfig:oe,xExtent:[0,Math.max(1,E.xValues.length-1)],yExtent:[ne+.5,.5],showAxes:O.showAxes,showGrid:R,showLegend:_,enableHover:H,hoverHighlight:I,colorBy:"__bumpSeries",colorScheme:te,tooltip:ie,onClick:re,hoverRadius:e.hoverRadius,width:e.width,height:e.height,responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,responsiveRules:e.responsiveRules,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,mode:e.mode,margin:J,className:e.className,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,selection:e.selection,linkedHover:e.linkedHover,legend:e.legend,legendInteraction:e.legendInteraction,legendPosition:e.legendPosition,onObservation:e.onObservation,chartId:e.chartId,loading:e.loading,loadingContent:e.loadingContent,emptyContent:e.emptyContent,animate:e.animate,autoPlaceAnnotations:e.autoPlaceAnnotations,annotations:he,xLabel:e.xLabel,yLabel:e.yLabel??"Rank",frameProps:{axes:ce,axisExtent:"exact",...V,...null!=ee&&null==V.legendLayout?.sideGutter&&{legendLayout:{...V.legendLayout,sideGutter:ee}}}})}),"BumpChart"),y=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){me(ue);let o=Dt(null);U(t,{variant:"xy",frameRef:o});let i=Ie(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",areaBy:d,y0Accessor:m,gradientFill:u=!1,semanticGradient:p,semanticLine:y=!0,lineDataAccessor:g="coordinates",colorBy:f,colorScheme:b,styleRules:x,curve:v="monotoneX",areaOpacity:A=.7,lineGradient:w,showLine:S=!0,lineWidth:k=2,showPoints:C=!1,pointRadius:L=3,tooltip:R,annotations:_,forecast:H,anomaly:I,band:F,xExtent:P,yExtent:B,frameProps:D={},selection:M,linkedHover:T,onObservation:N,onClick:W,hoverHighlight:O,chartId:E,loading:z,loadingContent:$,emptyContent:j,legendInteraction:V,legendPosition:X,color:Y,stroke:q,strokeWidth:J,opacity:Z}=e,{width:ee,height:te,enableHover:oe,showGrid:ie,showLegend:ae,title:re,description:ne,summary:le,accessibleTable:ce,xLabel:he,yLabel:de}=i,pe=Nt(()=>Fe(a),[a]),ye=f||d,Ae=Nt(()=>ge(p),[p]),ke=Nt(()=>Ae?.stops.length?fe(Ae):be(u),[Ae,u]),Le=Nt(()=>xe(w),[w]),Re=Nt(()=>y?ve(Ae):void 0,[Ae,y]);Be("AreaChart",pe,"xAccessor",c),Be("AreaChart",pe,"yAccessor",h);let _e=K({responsive:e,data:pe,rawData:a,colorBy:ye,colorScheme:b,legendInteraction:V,legendPosition:X,frameLegend:D,selection:M,linkedHover:T,fallbackFields:ye?["string"==typeof ye?ye:""]:[],unwrapData:!1,onObservation:N,onClick:W,hoverHighlight:O,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"AreaChart",chartId:E,showLegend:ae,userMargin:r,marginDefaults:i.marginDefaults,loading:z,loadingContent:$,emptyContent:j,width:ee,height:te,hasTitle:!!re,axisChrome:Pe(D,{showAxes:i.showAxes,xLabel:he,yLabel:de})}),{effectiveData:He,statisticalAnnotations:Ne,hasForecast:Oe,xAccessorKey:Ee,yAccessorKey:ze}=G({data:pe,xAccessor:c,yAccessor:h,forecast:H,anomaly:I,groupBy:d}),Ge=Oe?Ee:c,$e=Oe?ze:h,je=Nt(()=>De(c,h),[c,h]),{flattenedData:Xe,lineStyle:Ye,pointStyle:Qe,defaultTooltipContent:Ue}=vo({safeData:He,data:a,areaBy:d,lineDataAccessor:g,colorBy:ye,colorScale:_e.colorScale,color:Y,stroke:q,strokeWidth:J,opacity:Z,effectiveSelectionHook:_e.effectiveSelectionHook,resolvedSelection:_e.resolvedSelection,areaOpacity:A,showLine:S,lineWidth:k,showPoints:C,pointRadius:L,xAccessor:Ge,yAccessor:$e,xLabel:he||we(c),yLabel:de||we(h),xFormat:l,yFormat:s,groupField:d||f,band:F,styleRules:x,ruleContext:je}),Ke=Q({componentName:"AreaChart",data:a,accessors:{xAccessor:c,yAccessor:h}}),qe={chartType:"area",...null!=a&&{data:Xe},xAccessor:Ge,yAccessor:$e,groupAccessor:d||void 0,...m&&{y0Accessor:m},...F&&{band:F},...ke&&{gradientFill:ke},...Le&&{lineGradient:Le},...Re&&{semanticLineStops:Re},curve:v,lineStyle:Ye,...C&&Qe&&{pointStyle:Qe},size:[ee,te],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:_e.margin,showAxes:i.showAxes,xLabel:he,yLabel:de,xFormat:l,yFormat:s,enableHover:oe,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:ie,..._e.legendBehaviorProps,...Ce({title:re,description:ne,summary:le,accessibleTable:ce,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...We({tooltip:R,defaultTooltipContent:Ue,multiDefaultContent:Ve({xFormat:l,yFormat:s})}),...Se({linkedHover:T,selection:M,onObservation:N,onClick:W,hoverHighlight:O,hoverRadius:e.hoverRadius,mobileInteraction:_e.mobileInteraction,customHoverBehavior:_e.customHoverBehavior,customClickBehavior:_e.customClickBehavior}),...(_&&_.length>0||Ne.length>0)&&{annotations:[..._||[],...Ne]},...P&&{xExtent:P},...B&&{yExtent:B},..._e.crosshairProps,...D};return _e.earlyReturn?_e.earlyReturn:Ke? zt(Me,{componentName:"AreaChart",message:Ke,width:ee,height:te}): zt(Te,{componentName:"AreaChart",width:ee,height:te,children: zt(se,{ref:o,...qe})})}),"AreaChart"),g=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){me(pe);let o=Dt(null),i=Ie(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",seriesAAccessor:h="a",seriesBAccessor:d="b",seriesALabel:m="A",seriesBLabel:u="B",seriesAColor:p="var(--semiotic-danger, #dc2626)",seriesBColor:y="var(--semiotic-info, #2563eb)",showLines:g=!0,lineWidth:f=1.5,showPoints:b=!1,pointRadius:x=3,curve:v="linear",areaOpacity:A=.6,gradientFill:w,styleRules:S,tooltip:k,annotations:C,xExtent:L,yExtent:R,frameProps:_={},selection:H,linkedHover:I,onObservation:F,onClick:P,hoverHighlight:B,chartId:D,loading:M,loadingContent:T,emptyContent:N,legendInteraction:W,legendPosition:O,pointIdAccessor:E,windowSize:z}=e,{width:G,height:$,enableHover:j,showGrid:V,showLegend:X,title:Y,description:Q,summary:U,accessibleTable:q,xLabel:J,yLabel:Z}=i,ee=Nt(()=>"function"==typeof c?e=>Ro(c(e)):e=>Ro(e[c]),[c]),te=Nt(()=>"function"==typeof h?e=>Ro(h(e)):e=>Ro(e[h]),[h]),oe=Nt(()=>"function"==typeof d?e=>Ro(d(e)):e=>Ro(e[d]),[d]),[ie,ae]=Mt([]),re=Dt([]),ne=null==a,le=Nt(()=>Fe(ne?ie:a),[ne,ie,a]),ce=Nt(()=>Ao(le,ee,te,oe),[le,ee,te,oe]),he=Nt(()=>g?_o(le,ee,te,oe):[],[g,le,ee,te,oe]),de=Nt(()=>[...ce,...he],[ce,he]),ue=Nt(()=>{let e= new Set;for(let t of ce)e.add(t.__diffSegment);return Array.from(e)},[ce]);Ot(t,()=>{let e=e=>{let t=z&&e.length>z?e.slice(e.length-z):e;re.current=t,ae(t)},t=E?"function"==typeof E?E:e=>e[E]:null;return{push:t=>e([...re.current,t]),pushMany:t=>e([...re.current,...t]),remove:o=>{if(!t)return[];let i=Array.isArray(o)?o:[o],a=[],r=[];for(let e of re.current)i.includes(t(e))?a.push(e):r.push(e);return e(r),a},update:(o,i)=>{if(!t)return[];let a=Array.isArray(o)?o:[o],r=[],n=re.current.map(e=>{if(a.includes(t(e))){let t=i(e);return r.push(t),t}return e});return e(n),r},clear:()=>e([]),getData:()=>ne?re.current:le,getScales:()=>o.current?.getScales()??null}},[ne,le,E,z]);let ye=Nt(()=>!1===X?void 0:{legendGroups:[{label:"",type:"fill",styleFn:e=>({fill:e.color||"currentColor"}),items:[{label:m,color:p},{label:u,color:y}]}]},[X,m,u,p,y]),ge=Object.hasOwn(_,"legend")?_:{..._,legend:ye},fe=K({responsive:e,data:le,rawData:a,colorBy:"__diffWinner",colorScheme:[p,y],legendInteraction:W,legendPosition:O,frameLegend:ge,selection:H,linkedHover:I,fallbackFields:["__diffWinner"],unwrapData:!1,onObservation:F,onClick:P,hoverHighlight:B,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DifferenceChart",chartId:D,showLegend:X,userMargin:r,marginDefaults:i.marginDefaults,loading:M,loadingContent:T,emptyContent:N,width:G,height:$,hasTitle:!!Y,axisChrome:Pe(_,{showAxes:i.showAxes,xLabel:J,yLabel:Z})}),xe=Nt(()=>ko({seriesAColor:p,seriesBColor:y,areaOpacity:A,styleRules:S}),[p,y,A,S]),ve=Nt(()=>Co({seriesAColor:p,seriesBColor:y,lineWidth:f,styleRules:S}),[p,y,f,S]),Ae=Nt(()=>Lo({seriesAColor:p,seriesBColor:y,pointRadius:x,styleRules:S}),[p,y,x,S]),[we,ke,Le]=Nt(()=>[xe,ve,Ae].map(e=>ut(e,fe.effectiveSelectionHook,fe.resolvedSelection)),[xe,ve,Ae,fe.effectiveSelectionHook,fe.resolvedSelection]),Re=Tt(e=>{let t=e.data,o=e.allSeries,i=e.xValue??t?.__x,a=t?.__valA,r=t?.__valB;if(o&&o.length>0){let e=o.find(e=>"line-A"===e.group),t=o.find(e=>"line-B"===e.group);null!=e?.value&&Number.isFinite(e.value)&&(a=e.value),null!=t?.value&&Number.isFinite(t.value)&&(r=t.value)}if(null!=i&&(null==a||null==r)){let e=le.find(e=>ee(e)===i);e&&(null==a&&(a=te(e)),null==r&&(r=oe(e)))}let n=e=>null!=e&&Number.isFinite(e)?(Math.round(100*e)/100).toString():"—",s=l&&null!=i?l(i):null!=i?String(i):"";
|
|
33
|
-
return $t("div",{className:"semiotic-tooltip",style:_t,children:[s&& zt("div",{style:{fontWeight:600,marginBottom:4},children:s}),
|
|
34
|
-
$t("div",{style:{display:"flex",alignItems:"center",gap:6},children:[
|
|
35
|
-
zt("span",{style:{width:10,height:10,background:p,display:"inline-block",borderRadius:2}}),
|
|
36
|
-
$t("span",{children:[m,": ",n(a)]})]}),
|
|
37
|
-
$t("div",{style:{display:"flex",alignItems:"center",gap:6},children:[
|
|
38
|
-
zt("span",{style:{width:10,height:10,background:y,display:"inline-block",borderRadius:2}}),
|
|
39
|
-
$t("span",{children:[u,": ",n(r)]})]}),null!=a&&null!=r&&Number.isFinite(a)&&Number.isFinite(r)&& $t("div",{style:{marginTop:4,opacity:.7},children:["Δ = ",n(a-r)]})]})},[le,ee,te,oe,l,p,y,m,u]),{tooltipContent:_e,tooltipMode:He}=Nt(()=>We({tooltip:k,defaultTooltipContent:Re,multiDefaultContent:Re}),[k,Re]),Be=Nt(()=>be(w,{stops:[{offset:0,opacity:.85},{offset:1,opacity:.15}]}),[w]);if(fe.earlyReturn)return fe.earlyReturn;let De={chartType:"mixed",data:de,xAccessor:"__x",yAccessor:"__y",y0Accessor:"__y0",groupAccessor:"__diffSegment",areaGroups:ue,curve:v,areaStyle:we,lineStyle:ke,...b&&{pointStyle:Le},size:[G,$],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:fe.margin,showAxes:i.showAxes,xLabel:J,yLabel:Z,xFormat:l,yFormat:s,enableHover:j,showGrid:V,...Be&&{gradientFill:Be},...fe.legendBehaviorProps,...Ce({title:Y,description:Q,summary:U,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),tooltipContent:_e,..."multi"===He&&{tooltipMode:"multi"},...Se({linkedHover:I,selection:H,onObservation:F,onClick:P,hoverHighlight:B,hoverRadius:e.hoverRadius,mobileInteraction:fe.mobileInteraction,customHoverBehavior:fe.customHoverBehavior,customClickBehavior:fe.customClickBehavior}),...C&&C.length>0&&{annotations:C},...L&&{xExtent:L},...R&&{yExtent:R},...fe.crosshairProps,..._};
|
|
40
|
-
return zt(Te,{componentName:"DifferenceChart",width:G,height:$,children: zt(se,{ref:o,...De})})}),"DifferenceChart"),f=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){me(ee);let o=Dt(null),i=Ie(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",areaBy:d,lineDataAccessor:m="coordinates",colorBy:u,colorScheme:p,styleRules:y,curve:g="monotoneX",areaOpacity:f=.7,showLine:b=!0,lineWidth:x=2,showPoints:v=!1,pointRadius:A=3,normalize:w=!1,baseline:S="zero",stackOrder:k,tooltip:C,annotations:L,xExtent:R,yExtent:_,frameProps:H={},selection:I,linkedHover:F,onObservation:P,onClick:B,hoverHighlight:D,chartId:M,loading:T,loadingContent:N,emptyContent:W,legendInteraction:O,legendPosition:E,color:z,stroke:G,strokeWidth:$,opacity:j}=e,{width:V,height:X,enableHover:Y,showGrid:q,showLegend:J,title:Z,description:te,summary:oe,accessibleTable:ie,xLabel:ae,yLabel:re}=i,ne=Nt(()=>Fe(a),[a]),le=u||d;U(t,{variant:"xy",frameRef:o});let ce=K({responsive:e,data:ne,rawData:a,colorBy:le,colorScheme:p,legendInteraction:O,legendPosition:E,frameLegend:H,selection:I,linkedHover:F,fallbackFields:le?["string"==typeof le?le:""]:[],unwrapData:!1,onObservation:P,onClick:B,hoverHighlight:D,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"StackedAreaChart",chartId:M,showLegend:J,userMargin:r,marginDefaults:i.marginDefaults,loading:T,loadingContent:N,emptyContent:W,width:V,height:X,hasTitle:!!Z,axisChrome:Pe(H,{showAxes:i.showAxes,xLabel:ae,yLabel:re})}),he=Nt(()=>De(c,h),[c,h]),{flattenedData:de,lineStyle:ue,pointStyle:pe,defaultTooltipContent:ye}=vo({safeData:ne,data:a,areaBy:d,lineDataAccessor:m,colorBy:le,colorScale:ce.colorScale,color:z,stroke:G,strokeWidth:$,opacity:j,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection,areaOpacity:f,showLine:b,lineWidth:x,showPoints:v,pointRadius:A,xAccessor:c,yAccessor:h,xLabel:ae,yLabel:re,xFormat:l,yFormat:s,groupField:d||u,styleRules:y,ruleContext:he}),ge=Q({componentName:"StackedAreaChart",data:a,accessors:{xAccessor:c,yAccessor:h}}),fe={chartType:"stackedarea",...null!=a&&{data:de},xAccessor:c,yAccessor:h,groupAccessor:d||void 0,curve:g,normalize:w,baseline:w?"zero":S,stackOrder:k,lineStyle:ue,...v&&pe&&{pointStyle:pe},size:[V,X],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ce.margin,showAxes:i.showAxes,xLabel:ae,yLabel:re,xFormat:l,yFormat:s,enableHover:Y,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:q,...ce.legendBehaviorProps,...Ce({title:Z,description:te,summary:oe,accessibleTable:ie,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...We({tooltip:C,defaultTooltipContent:ye,multiDefaultContent:Ve({xFormat:l,yFormat:s})}),...Se({linkedHover:F,selection:I,onObservation:P,onClick:B,hoverHighlight:D,hoverRadius:e.hoverRadius,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...L&&L.length>0&&{annotations:L},...R&&{xExtent:R},..._&&{yExtent:_},...ce.crosshairProps,...H};return ce.earlyReturn?ce.earlyReturn:ge? zt(Me,{componentName:"StackedAreaChart",message:ge,width:V,height:X}): zt(Te,{componentName:"StackedAreaChart",width:V,height:X,children: zt(se,{ref:o,...fe})})}),"StackedAreaChart"),b=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){me(te);let o=Dt(null);U(t,{variant:"xy",frameRef:o});let i=Ie(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:void 0,enableHover:e.enableHover,showLegend:void 0,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xAccessor:l="x",yAccessor:s="y",valueAccessor:c="value",xFormat:h,yFormat:d,colorScheme:m,customColorScale:u,showValues:p=!1,valueFormat:y,cellBorderColor:g="#fff",cellBorderWidth:f=1,tooltip:b,annotations:x,heatmapAggregation:v,heatmapXBins:A,heatmapYBins:w,styleRules:S,xExtent:k,yExtent:C,frameProps:L={},selection:R,linkedHover:_,onObservation:H,onClick:I,hoverHighlight:F,chartId:P,loading:B,loadingContent:D,emptyContent:M,showLegend:T,legendPosition:N,legend:W,legendInteraction:O,stroke:E,strokeWidth:z,opacity:G}=e,{width:$,height:j,enableHover:V,title:X,description:Y,summary:K,accessibleTable:Z,xLabel:ee,yLabel:oe}=i,ie=Ye(B,$,j,D,e),ae=ie?null:Qe(a,$,j,M,e),re=Nt(()=>Fe(a),[a]),ne=Ue(),le=m??ne??"blues",ce=("string"==typeof L.colorScheme?L.colorScheme:void 0)??le,he="function"==typeof L.heatmapColorScale?L.heatmapColorScale:"custom"===ce&&"function"==typeof u?u:void 0,de=T??!1,ue=N??"right",{activeSelectionHook:pe,customHoverBehavior:ye,customClickBehavior:ge,crosshairSourceId:fe}=Ke({selection:R,linkedHover:_,fallbackFields:[],onObservation:H,onClick:I,chartType:"Heatmap",chartId:P,hoverHighlight:F,colorByField:void 0,mobileInteraction:i.mobileInteraction}),be=q(R),xe=qe(_,fe);Je(O,void 0,[]);let ve=Nt(()=>"function"==typeof c?e=>c(e):e=>e[c],[c]),Le=Nt(()=>{let e=re.map(ve);return Ft(e)},[re,ve]),Re=Nt(()=>{if(he)return he;let e=At(ce);return jt(e).domain(Le)},[ce,he,Le]),_e=Nt(()=>{let e=Number.isFinite(f)?Math.max(0,f):1;return()=>({stroke:g,strokeWidth:e})},[g,f]),He=Nt(()=>J(l,s,c),[l,s,c]),Be=Nt(()=>Xe(_e,S,He),[_e,S,He]),De=Nt(()=>ut(Be,pe,be),[pe,Be,be]),Ne=Nt(()=>Ae([{label:ee||we(l),accessor:l,role:"x",format:h},{label:oe||we(s),accessor:s,role:"y",format:d},{label:we(c),accessor:c,role:"value",format:y}]),[l,s,ee,oe,c,h,d,y]),We=Q({componentName:"Heatmap",data:a,accessors:{xAccessor:l,yAccessor:s,valueAccessor:c}}),Oe=Nt(()=>de?{gradient:{colorFn:e=>Re(e),domain:Le,label:"string"==typeof c?c:"value",format:y},legendDistance:W?.legendDistance}:void 0,[de,Re,Le,c,y,W?.legendDistance]),{margin:Ee,legend:ze,legendPosition:Ge,legendMarginReserved:$e}=Ze({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:ue,userMargin:r,defaults:i.marginDefaults,additionalLegend:Oe,chartWidth:$,chartHeight:j,legendLayout:L.legendLayout,frameLegend:L,hasTitle:!!X,axisChrome:Pe(L,{showAxes:i.showAxes,xLabel:ee,yLabel:oe})}),je={chartType:"heatmap",...null!=a&&{data:re},xAccessor:l,yAccessor:s,valueAccessor:c,colorScheme:"custom"!==ce?ce:void 0,...he&&{heatmapColorScale:he},areaStyle:De,showValues:p,heatmapValueFormat:y,size:[$,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Ee,showAxes:i.showAxes,xLabel:ee,yLabel:oe,xFormat:h,yFormat:d,enableHover:V,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...ze&&{legend:ze,legendPosition:Ge},...$e&&{__legendMarginReservedFor:ze},...Ce({title:X,description:Y,summary:K,accessibleTable:Z,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...ke({tooltip:b,defaultTooltipContent:Ne}),...Se({linkedHover:_,selection:R,onObservation:H,onClick:I,hoverHighlight:F,hoverRadius:e.hoverRadius,mobileInteraction:i.mobileInteraction,customHoverBehavior:ye,customClickBehavior:ge}),...x&&x.length>0&&{annotations:x},...v&&{heatmapAggregation:v},...null!=A&&{heatmapXBins:A},...null!=w&&{heatmapYBins:w},...k&&{xExtent:k},...C&&{yExtent:C},...xe,...L};return ie||ae||(We? zt(Me,{componentName:"Heatmap",message:We,width:$,height:j}): zt(Te,{componentName:"Heatmap",width:$,height:j,children: zt(se,{ref:o,...je})}))}),"Heatmap"),x=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){ne(E),me(oe);let o=Dt(null),i=Ie(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",sizeBy:d,sizeRange:m=[5,40],colorBy:u,colorScheme:p,styleRules:y,bubbleOpacity:g=.6,bubbleStrokeWidth:f=1,bubbleStrokeColor:b="white",tooltip:x,marginalGraphics:v,pointIdAccessor:A,annotations:w,regression:S,xExtent:k,yExtent:C,pulse:L,decay:R,staleness:_,frameProps:H={},selection:I,linkedHover:F,linkedBrush:P,brush:B,onBrush:D,onObservation:M,onClick:T,hoverHighlight:N,chartId:W,loading:O,loadingContent:G,emptyContent:$,legendInteraction:j,legendPosition:X,color:Y,stroke:q,strokeWidth:J,opacity:Z}=e,{width:ee,height:te,enableHover:ie,showGrid:ae,showLegend:re,title:ce,description:he,summary:de,accessibleTable:ue,xLabel:pe,yLabel:ye}=i,ge=Nt(()=>Fe(a),[a]),fe=void 0===a,be=K({responsive:e,data:ge,rawData:a,colorBy:u,colorScheme:p,legendInteraction:j,legendPosition:X,frameLegend:H,selection:I,linkedHover:F,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:M,onClick:T,hoverHighlight:N,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"BubbleChart",chartId:W,showLegend:re,userMargin:r,marginDefaults:i.marginDefaults,loading:O,loadingContent:G,emptyContent:$,width:ee,height:te,hasTitle:!!ce,axisChrome:Pe(H,{showAxes:i.showAxes,xLabel:pe,yLabel:ye})}),{domain:xe,trackPushed:ve,reset:Le}=Vt({accessor:d,data:ge,isPushMode:fe}),Re=Tt(e=>{ve([e]),o.current?.push(e)},[ve]),_e=Tt(e=>{ve(e),o.current?.pushMany(e)},[ve]);U(t,{variant:"xy",frameRef:o,overrides:{push:Re,pushMany:_e,clear:()=>{Le(),o.current?.clear()}}});let{brushStreamProps:He}=le({brush:B,onBrush:D,linkedBrush:P,xAccessor:c,yAccessor:h,defaultDimension:"xy"}),Be=Nt(()=>({stroke:b,strokeWidth:f}),[b,f]),Ne=Nt(()=>xe??[0,1],[xe]),We=Tt(e=>pt(e,d,m,Ne),[d,m,Ne]),Oe=Nt(()=>De(c,h),[c,h]),Ee=z({colorBy:u,colorScale:be.colorScale,color:Y,fillOpacity:g,radiusFn:We,baseStyleExtras:Be,stroke:q,strokeWidth:J,opacity:Z,styleRules:y,ruleContext:Oe,effectiveSelectionHook:be.effectiveSelectionHook,resolvedSelection:be.resolvedSelection}),ze=Nt(()=>Ae([{label:pe||we(c),accessor:c,role:"x",format:l},{label:ye||we(h),accessor:h,role:"y",format:s},{label:we(d),accessor:d,role:"size"},...u?[{label:we(u),accessor:u,role:"color"}]:[]]),[c,h,pe,ye,d,u,l,s]);if(be.earlyReturn)return be.earlyReturn;let Ge=Q({componentName:"BubbleChart",data:a,accessors:{xAccessor:c,yAccessor:h},requiredProps:{sizeBy:d}});if(Ge) return zt(Me,{componentName:"BubbleChart",message:Ge,width:ee,height:te});let $e=V(S),je=$e?[$e,...w||[]]:w,Ve={chartType:"bubble",...null!=a&&{data:ge},xAccessor:c,yAccessor:h,colorAccessor:u||void 0,sizeAccessor:d,sizeRange:m,pointStyle:Ee,colorScheme:p,size:[ee,te],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:be.margin,showAxes:i.showAxes,xLabel:pe,yLabel:ye,xFormat:l,yFormat:s,enableHover:ie,showGrid:ae,...be.legendBehaviorProps,...Ce({title:ce,description:he,summary:de,accessibleTable:ue,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...ke({tooltip:x,defaultTooltipContent:ze}),...Se({linkedHover:F,selection:I,onObservation:M,onClick:T,hoverHighlight:N,hoverRadius:e.hoverRadius,mobileInteraction:be.mobileInteraction,customHoverBehavior:be.customHoverBehavior,customClickBehavior:be.customClickBehavior}),...v&&{marginalGraphics:v},...A&&{pointIdAccessor:A},...L&&{pulse:L},...R&&{decay:R},..._&&{staleness:_},...je&&je.length>0&&{annotations:je},...k&&{xExtent:k},...C&&{yExtent:C},...be.crosshairProps,...He,...H};
|
|
41
|
-
return zt(Te,{componentName:"BubbleChart",width:ee,height:te,children: zt(se,{ref:o,...Ve})})}),"BubbleChart"),v={width:800,height:400},A={cellSize:150,cellGap:4,labelWidth:40},w=null,S=null,k="__splomIdx",C="splom-hover-source",L={top:4,bottom:4,left:4,right:4},R=/*#__PURE__*/He(function(e){let{brushMode:t="crossfilter",hoverMode:o=!0}=e,i={};return!o&&t&&(i.splom={resolution:t}),o&&(i["splom-hover"]={resolution:"union"}), zt(ct,{selections:i,children: zt(Bo,{...e})})},"ScatterplotMatrix"),_=null,H=null,I=60,F=/*#__PURE__*/He(function(e){$();let t=ht(void 0,{}),{data:o,width:i=t.width,height:a=t.height,margin:r,className:n,title:l,description:s,summary:c,xLabel:h,yLabel:d,xFormat:m,yFormat:u,xAccessor:p="x",yAccessor:y="y",lineBy:g,lineDataAccessor:f="coordinates",colorBy:b,colorScheme:x,curve:v="linear",lineWidth:A=2,styleRules:w,fillArea:S=!1,areaOpacity:k=.3,showPoints:C=!1,pointRadius:L=3,enableHover:R=!0,showAxes:_=!0,showGrid:H=!1,showLegend:F,legendPosition:P,tooltip:B,minimap:D={},renderBefore:M=!1,onBrush:T,onBrushEnd:N,onObservation:W,chartId:O,brushExtent:E,yExtent:z,frameProps:G={},loading:V,loadingContent:X,emptyContent:Y}=e,U=a+Mo(D),K=Ye(V,i,U,X,e),q=K?null:Qe(o,i,U,Y,e),J=Nt(()=>Fe(o),[o]),[Z,ee]=Mt(null),te=E??Z,oe=Dt(null),[ie,ae]=Mt(null),re=void 0!==J[0]?.[f],ne=Nt(()=>{if(re)return J;if(g){let e=J.reduce((e,t)=>{let o="function"==typeof g?g(t):t[g];if(!e[o]){let t={[f]:[]};"string"==typeof g&&(t[g]=o),e[o]=t}return e[o][f].push(t),e},{});return Object.values(e)}return[{[f]:J}]},[J,g,f,re]),le=Nt(()=>re||g?ne.flatMap(e=>{let t=e[f]||[];return g&&"string"==typeof g?t.map(t=>({...t,[g]:e[g]})):t}):J,[ne,f,re,g,J]),ce=it(J,b,x),he=Nt(()=>De(p,y),[p,y]),de=j({lineWidth:A,colorBy:b,colorScale:ce,fillArea:S,areaOpacity:k,styleRules:w,ruleContext:he}),me=Nt(()=>{if(D.lineStyle)return D.lineStyle},[D.lineStyle]),ue=j({lineWidth:1,colorBy:b,colorScale:ce,styleRules:w,ruleContext:he}),pe=me??ue,ye=Nt(()=>C?Xe(e=>{let t={r:L,fillOpacity:1};return t.fill=b?xt(e.parentLine||e,b,ce):vt,t},w,he,e=>e.parentLine||e):void 0,[C,L,b,ce,w,he]),{legend:ge,margin:fe,legendPosition:be,legendMarginReserved:xe}=Ze({data:ne,colorBy:b,colorScale:ce,showLegend:F,legendPosition:P,userMargin:r,chartWidth:i,chartHeight:a,frameLegend:G,hasTitle:!!l,axisChrome:Pe(G,{showAxes:_,xLabel:h,yLabel:d})}),ve=D.height||I,Se=To(D),ke=Nt(()=>({top:D.margin?.top??Se.top,bottom:D.margin?.bottom??Se.bottom,left:D.margin?.left??fe.left,right:D.margin?.right??fe.right}),[D.margin,Se.top,Se.bottom,fe]),Ce=D.brushDirection||"x",Le=Math.max(0,i-ke.left-ke.right),Re=z?.[0],_e=z?.[1];Et(()=>{let e=0,t=!1,o=0,i=()=>{if(t)return;let a=oe.current?.getScales?.(),r=(e,t)=>Math.abs(Math.max(...e)-Math.min(...e)-t)<.5;a&&(o>=60||r(a.x.range(),Le)&&r(a.y.range(),ve))?ae(a):(o++,e=requestAnimationFrame(i))};return e=requestAnimationFrame(i),()=>{t=!0,e&&cancelAnimationFrame(e)}},[o,Le,ve,ke.top,ke.bottom,Re,_e]);let He=Tt(e=>{if(E||ee(e),T?.(e),!W)return;if(!e)return void W({type:"brush-end",timestamp:Date.now(),chartType:"MinimapChart",chartId:O});let t=ie?.["x"===Ce?"y":"x"].domain().map(Number)??[e[0],e[1]];W({type:"brush",extent:"x"===Ce?{x:e,y:t}:{x:t,y:e},timestamp:Date.now(),chartType:"MinimapChart",chartId:O})},[E,T,W,O,ie,Ce]),Ie=Nt(()=>Ae([{label:h||we(p),accessor:p,role:"x",format:m},{label:d||we(y),accessor:y,role:"y",format:u}]),[p,y,h,d,m,u]),Be=Q({componentName:"MinimapChart",data:o,accessors:{xAccessor:p,yAccessor:y}}),Ne=S?"area":"line",Oe={chartType:Ne,data:le,xAccessor:p,yAccessor:y,groupAccessor:g||void 0,curve:v,lineStyle:de,...C&&{pointStyle:ye},size:[i,a],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:fe,showAxes:_,xLabel:h,yLabel:d,xFormat:m,yFormat:u,enableHover:R,showGrid:H,...ge&&{legend:ge,legendPosition:be},...xe&&{__legendMarginReservedFor:ge},...l&&{title:l},...s&&{description:s},...c&&{summary:c},...void 0!==e.accessibleTable&&{accessibleTable:e.accessibleTable},...void 0!==e.animate&&{animate:e.animate},...void 0!==e.hoverRadius&&{hoverRadius:e.hoverRadius},...We({tooltip:B,defaultTooltipContent:Ie}),...te&&"x"===Ce&&{xExtent:te},...z&&{yExtent:z},...te&&"y"===Ce&&{yExtent:te},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...G},Ee={chartType:Ne,data:le,xAccessor:p,yAccessor:y,groupAccessor:g||void 0,curve:v,lineStyle:pe,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},size:[i,ve+ke.top+ke.bottom],margin:ke,showAxes:D.showAxes??!1,background:D.background,enableHover:!1,accessibleTable:!1,description:`${s||l||"Chart"} overview minimap`,animate:!1,...z&&{yExtent:z}},ze=!!D.handles||!!D.showExtentLabels||!!D.renderHandle,Ge= $t("div",{style:{position:"relative",width:i,overflow:ze?"visible":"hidden"},children:[
|
|
42
|
-
zt(se,{ref:oe,...Ee}),
|
|
43
|
-
zt(Do,{config:D,scales:ie,margin:ke,plotWidth:Le,plotHeight:ve,brushDirection:Ce,extent:te,axisFormat:"x"===Ce?m:u,onBrush:He,onBrushEnd:N,onObservation:W,chartId:O})]},"minimap"),$e= zt("div",{style:{overflow:"hidden"},children: zt(se,{...Oe})},"main");return K||q||(Be? zt(Me,{componentName:"MinimapChart",message:Be,width:i,height:U}): zt(Te,{componentName:"MinimapChart",width:i,height:a,children: $t("div",{className:"minimap-chart"+(n?` ${n}`:""),role:"group","aria-label":s||l||"Chart with overview minimap",children:[M?Ge:$e,M?$e:Ge]})}))},"MinimapChart"),P={topLeft:{label:"Low / High",color:"#E9C46A",opacity:.08},topRight:{label:"High / High",color:"#2A9D8F",opacity:.08},bottomLeft:{label:"Low / Low",color:"#E76F51",opacity:.08},bottomRight:{label:"High / Low",color:"#86BBD8",opacity:.08}},B=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){me(Z);let o=Dt(null);U(t,{variant:"xy",frameRef:o});let i=Ie(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",xCenter:d,yCenter:m,quadrants:u,centerlineStyle:p={},showQuadrantLabels:y=!0,quadrantLabelSize:g=12,colorBy:f,colorScheme:b,styleRules:x,sizeBy:v,sizeRange:A=[3,15],pointRadius:w=5,pointOpacity:S=.8,tooltip:k,pointIdAccessor:C,annotations:L,frameProps:R={},selection:_,linkedHover:H,onObservation:I,onClick:F,hoverHighlight:B,chartId:D,loading:M,loadingContent:T,emptyContent:N,legendInteraction:W,legendPosition:O,color:E,stroke:G,strokeWidth:$,opacity:j}=e,{width:V,height:X,enableHover:Y,showGrid:q,showLegend:J,title:ee,description:te,summary:oe,accessibleTable:ie,xLabel:ae,yLabel:re}=i,ne=Nt(()=>({topLeft:No(P.topLeft,u?.topLeft),topRight:No(P.topRight,u?.topRight),bottomLeft:No(P.bottomLeft,u?.bottomLeft),bottomRight:No(P.bottomRight,u?.bottomRight)}),[u]),le=Nt(()=>Fe(a),[a]),ce=K({responsive:e,data:le,rawData:a,colorBy:f,colorScheme:b,legendInteraction:W,legendPosition:O,frameLegend:R,selection:_,linkedHover:H,fallbackFields:"string"==typeof f?[f]:[],unwrapData:!1,onObservation:I,onClick:F,hoverHighlight:B,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"QuadrantChart",chartId:D,showLegend:J,userMargin:r,marginDefaults:i.marginDefaults,loading:M,loadingContent:T,emptyContent:N,width:V,height:X,hasTitle:!!ee,axisChrome:Pe(R,{showAxes:i.showAxes,xLabel:ae,yLabel:re})});Be("QuadrantChart",le,"xAccessor",c),Be("QuadrantChart",le,"yAccessor",h);let he=Nt(()=>{if(!le.length)return;let e="function"==typeof c?c:e=>+e[c],t="function"==typeof h?h:e=>+e[h],o=1/0,i=-1/0,a=1/0,r=-1/0;for(let n of le){let l=e(n),s=t(n);isFinite(l)&&(l<o&&(o=l),l>i&&(i=l)),isFinite(s)&&(s<a&&(a=s),s>r&&(r=s))}if(null!=d&&isFinite(d)&&(d<o&&(o=d),d>i&&(i=d)),null!=m&&isFinite(m)&&(m<a&&(a=m),m>r&&(r=m)),o===1/0)return;let n=.1*(i-o)||1,l=.1*(r-a)||1;return{xExtent:[o-n,i+n],yExtent:[a-l,r+l]}},[le,c,h,d,m]),de=Nt(()=>{if(!v||0===le.length)return;let e=le.map(e=>"function"==typeof v?v(e):e[v]).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0!==e.length?Ft(e):void 0},[le,v]),ue=Nt(()=>"function"==typeof c?c:e=>+e[c],[c]),pe=Nt(()=>"function"==typeof h?h:e=>+e[h],[h]),ye=Nt(()=>e=>{let t=ue(e),o=pe(e),i=null!=d?t>=d:void 0,a=null!=m?o>=m:void 0;return void 0===a||void 0===i?E||vt:a&&i?ne.topRight.color:a&&!i?ne.topLeft.color:!a&&i?ne.bottomRight.color:ne.bottomLeft.color},[ue,pe,d,m,ne,E]),ge=Nt(()=>v?e=>pt(e,v,A,de):void 0,[v,A,de]),fe=Nt(()=>De(c,h),[c,h]),be=z({colorBy:f,colorScale:ce.colorScale,color:E,pointRadius:w,fillOpacity:S,radiusFn:ge,fallbackFill:ye,stroke:G,strokeWidth:$,opacity:j,styleRules:x,ruleContext:fe,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection}),xe=Nt(()=>{if(!le.length)return;let e= new Set;"string"==typeof c&&e.add(c),"string"==typeof h&&e.add(h),"string"==typeof f&&e.add(f),"string"==typeof v&&e.add(v);let t=le[0];for(let o of Object.keys(t))if(!o.startsWith("_")&&!e.has(o)&&"string"==typeof t[o])return o},[le,c,h,f,v]),ve=Nt(()=>Ae([...xe?[{label:xe,accessor:xe,role:"title"}]:[],{label:ae||we(c),accessor:c,role:"x",format:l},{label:re||we(h),accessor:h,role:"y",format:s},...f?[{label:we(f),accessor:f,role:"color"}]:[],...v?[{label:we(v),accessor:v,role:"size"}]:[]]),[xe,c,h,ae,re,f,v,l,s]),ke=Q({componentName:"QuadrantChart",data:a,accessors:{xAccessor:c,yAccessor:h}}),Ce=Nt(()=>{let e={stroke:p.stroke||"#999",strokeWidth:p.strokeWidth??1,dashArray:p.strokeDasharray||[]};return[(t,o,i,a)=>{if(!i?.x||!i?.y)return;let r=a.width,n=a.height,l=null!=d?i.x(d):r/2,s=null!=m?i.y(m):n/2;if(null!=d&&!isFinite(l)||null!=m&&!isFinite(s))return;let c=Math.max(0,Math.min(r,l)),h=Math.max(0,Math.min(n,s)),u=[{config:ne.topLeft,x:0,y:0,w:c,h:h},{config:ne.topRight,x:c,y:0,w:r-c,h:h},{config:ne.bottomLeft,x:0,y:h,w:c,h:n-h},{config:ne.bottomRight,x:c,y:h,w:r-c,h:n-h}];for(let e of u)e.w<=0||e.h<=0||(t.fillStyle=e.config.color,t.globalAlpha=e.config.opacity??.08,t.fillRect(e.x,e.y,e.w,e.h));t.globalAlpha=1,t.strokeStyle=e.stroke,t.lineWidth=e.strokeWidth,e.dashArray.length>0&&t.setLineDash(e.dashArray),t.beginPath(),t.moveTo(c,0),t.lineTo(c,n),t.stroke(),t.beginPath(),t.moveTo(0,h),t.lineTo(r,h),t.stroke(),t.setLineDash([])}]},[d,m,ne,p]),Le=Nt(()=>y?[...Ce,(e,t,o,i)=>{if(!o?.x||!o?.y)return;let a=i.width,r=i.height,n=null!=d?o.x(d):a/2,l=null!=m?o.y(m):r/2;if(null!=d&&!isFinite(n)||null!=m&&!isFinite(l))return;Math.max(0,Math.min(a,n)),Math.max(0,Math.min(r,l));let s=St(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif";e.font=`600 ${g}px ${s}`,e.globalAlpha=.5,e.fillStyle=ne.topLeft.color,e.textAlign="left",e.textBaseline="top",e.fillText(ne.topLeft.label,8,8),e.fillStyle=ne.topRight.color,e.textAlign="right",e.textBaseline="top",e.fillText(ne.topRight.label,a-8,8),e.fillStyle=ne.bottomLeft.color,e.textAlign="left",e.textBaseline="bottom",e.fillText(ne.bottomLeft.label,8,r-8),e.fillStyle=ne.bottomRight.color,e.textAlign="right",e.textBaseline="bottom",e.fillText(ne.bottomRight.label,a-8,r-8),e.globalAlpha=1}]:Ce,[Ce,y,g,ne,d,m]),Re=Nt(()=>{let e=R.canvasPreRenderers||[];return[...Le,...e]},[Le,R.canvasPreRenderers]),_e=Nt(()=>{let e={stroke:p.stroke||"#999",strokeWidth:p.strokeWidth??1,dashArray:p.strokeDasharray?Array.isArray(p.strokeDasharray)?p.strokeDasharray.join(","):p.strokeDasharray:void 0};return[(t,o,i)=>{if(!o?.x||!o?.y)return null;let a=i.width,r=i.height,n=null!=d?o.x(d):a/2,l=null!=m?o.y(m):r/2;if(null!=d&&!isFinite(n)||null!=m&&!isFinite(l))return null;let s=Math.max(0,Math.min(a,n)),c=Math.max(0,Math.min(r,l)),h=[{config:ne.topLeft,x:0,y:0,w:s,h:c},{config:ne.topRight,x:s,y:0,w:a-s,h:c},{config:ne.bottomLeft,x:0,y:c,w:s,h:r-c},{config:ne.bottomRight,x:s,y:c,w:a-s,h:r-c}];
|
|
44
|
-
return $t(Gt,{children:[h.map((e,t)=>e.w>0&&e.h>0? zt("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:e.config.color,opacity:e.config.opacity??.08},`qf-${t}`):null),
|
|
45
|
-
zt("line",{x1:s,y1:0,x2:s,y2:r,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),
|
|
46
|
-
zt("line",{x1:0,y1:c,x2:a,y2:c,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.dashArray}),y&& $t(Gt,{children:[
|
|
47
|
-
zt("text",{x:8,y:8+g,fill:ne.topLeft.color,fontWeight:600,fontSize:g,opacity:.5,children:ne.topLeft.label}),
|
|
48
|
-
zt("text",{x:a-8,y:8+g,fill:ne.topRight.color,fontWeight:600,fontSize:g,opacity:.5,textAnchor:"end",children:ne.topRight.label}),
|
|
49
|
-
zt("text",{x:8,y:r-8,fill:ne.bottomLeft.color,fontWeight:600,fontSize:g,opacity:.5,children:ne.bottomLeft.label}),
|
|
50
|
-
zt("text",{x:a-8,y:r-8,fill:ne.bottomRight.color,fontWeight:600,fontSize:g,opacity:.5,textAnchor:"end",children:ne.bottomRight.label})]})]})}]},[d,m,ne,p,y,g]);if(ce.earlyReturn)return ce.earlyReturn;let He={chartType:"scatter",...null!=a&&{data:le},xAccessor:c,yAccessor:h,colorAccessor:f||void 0,sizeAccessor:v||void 0,sizeRange:A,pointStyle:be,colorScheme:b,size:[V,X],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:ce.margin,showAxes:i.showAxes,xLabel:ae,yLabel:re,xFormat:l,yFormat:s,enableHover:Y,showGrid:q,...he&&{xExtent:he.xExtent,yExtent:he.yExtent},...ce.legendBehaviorProps,...ee&&{title:ee},...te&&{description:te},...oe&&{summary:oe},...void 0!==ie&&{accessibleTable:ie},...n&&{className:n},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===k?()=>null:!0===k||void 0===k?ve:Ee(k)||ve,...Se({linkedHover:H,selection:_,onObservation:I,onClick:F,hoverHighlight:B,hoverRadius:e.hoverRadius,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...C&&{pointIdAccessor:C},...L&&L.length>0&&{annotations:L},canvasPreRenderers:Re,...ce.crosshairProps,...R,...Re.length>0&&{canvasPreRenderers:Re},svgPreRenderers:_e};return ke? zt(Me,{componentName:"QuadrantChart",message:ke,width:V,height:X}): zt(Te,{componentName:"QuadrantChart",width:V,height:X,children: zt(se,{ref:o,...He})})}),"QuadrantChart"),D="__ma_unitized",M="__ma_series",T=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){me(ye);let o=Dt(null),i=Dt([]),a=Dt(e.series);a.current=e.series,Ot(t,()=>{let e=()=>(a.current??[]).filter(e=>null!=e&&"object"==typeof e);return{push:t=>{if(!o.current)return;let a=e(),r=t;for(let e=0;e<a.length&&e<2;e++){let t=a[e],n=t.extent||i.current[e];if(!n)continue;let l=("function"==typeof t.yAccessor?t.yAccessor:e=>e[t.yAccessor])(r);null==l||!isFinite(l)||o.current.push({...r,[D]:zo(l,n),[M]:t.label||`Series ${e+1}`})}},pushMany:t=>{if(!o.current)return;let a=e(),r=[];for(let e of t)for(let t=0;t<a.length&&t<2;t++){let o=a[t],n=o.extent||i.current[t];if(!n)continue;let l=("function"==typeof o.yAccessor?o.yAccessor:e=>e[o.yAccessor])(e);null==l||!isFinite(l)||r.push({...e,[D]:zo(l,n),[M]:o.label||`Series ${t+1}`})}o.current.pushMany(r)},remove:e=>o.current?.remove(e)??[],update:(e,t)=>o.current?.update(e,t)??[],clear:()=>o.current?.clear(),getData:()=>o.current?.getData()??[],getScales:()=>o.current?.getScales()??null}},[]);let r=Ie(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,xLabel:e.xLabel,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},v),{data:n,margin:l,className:s,xFormat:c,xAccessor:h="x",series:d,colorScheme:m,curve:u="monotoneX",lineWidth:p=2,styleRules:y,tooltip:g,annotations:f,frameProps:b={},selection:x,linkedHover:A,onObservation:w,onClick:S,hoverHighlight:k,chartId:C,loading:L,loadingContent:R,emptyContent:_,legendInteraction:H,legendPosition:I,stroke:F,strokeWidth:P,opacity:B}=e,{width:T,height:N,enableHover:W,showGrid:O,showLegend:E=!0,title:z,description:G,summary:$,accessibleTable:V,xLabel:X}=r,Y=Nt(()=>Fe(n),[n]),U=Nt(()=>Fe(d),[d]),q=U,J=2===U.length,Z=Nt(()=>J?{...b.legendLayout,sideGutter:b.legendLayout?.sideGutter??70}:b.legendLayout,[b.legendLayout,J]);"production"!==process.env.NODE_ENV&&!J&&console.warn(`[MultiAxisLineChart] Expected exactly 2 series for dual-axis mode, got ${U.length}. Rendering as a standard multi-line chart.`);let ee=Ye(L,T,N,R,e),te=ee?null:Qe(n,T,N,_,e),oe=je(),ie=Nt(()=>Wo(q,m,oe),[q,m,oe]),ae=Nt(()=>U.map((e,t)=>e.label||`Series ${t+1}`),[U]),{unitizedData:re,extents:ne}=Nt(()=>{if(0===Y.length){let e=U.map(e=>e.extent||null).filter(Boolean);return e.length===U.length&&(i.current=e),{unitizedData:[],extents:e.length===U.length?e:[]}}let e=U.map(e=>e.extent||Eo(Y,e.yAccessor));if(i.current=e,!J){let t=[];for(let e of Y)for(let o=0;o<U.length;o++){let i=U[o],a=("function"==typeof i.yAccessor?i.yAccessor:e=>e[i.yAccessor])(e);null!=a&&t.push({...e,[D]:a,[M]:ae[o]})}return{unitizedData:t,extents:e}}let t=[];for(let o of Y)for(let i=0;i<2;i++){let a=U[i],r=("function"==typeof a.yAccessor?a.yAccessor:e=>e[a.yAccessor])(o);null!=r&&t.push({...o,[D]:zo(r,e[i]),[M]:ae[i]})}return{unitizedData:t,extents:e}},[Y,U,J,ae]),le=Nt(()=>{if(!J||ne.length<2)return;let e=e=>t=>{let o=Go(t,ne[e]),i=U[e]?.format;return"function"==typeof i?i(o):Number.isInteger(o)?String(o):o.toFixed(1)},t=e(0),o=e(1);return[{orient:"left",label:ae[0],tickFormat:t},{orient:"right",label:ae[1],tickFormat:o},{orient:"bottom"}]},[J,ne,U,ae]),ce=Nt(()=>re.length>0?re:ae.map(e=>({[M]:e})),[re,ae]),he=K({responsive:e,data:ce,rawData:n,colorBy:M,colorScheme:ie,legendInteraction:H,legendPosition:I,frameLegend:{...b,legendLayout:Z},selection:x,linkedHover:A,fallbackFields:[M],unwrapData:!1,onObservation:w,onClick:S,hoverHighlight:k,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"MultiAxisLineChart",chartId:C,showLegend:E,legendLayout:Z,userMargin:l,marginDefaults:J?{...r.marginDefaults,left:70,right:70}:r.marginDefaults,loading:L,loadingContent:R,emptyContent:_,width:T,height:N,hasTitle:!!z,axisChrome:Pe(b,{showAxes:r.showAxes,xLabel:X,yLabel:ae[0],yLabelRight:ae[1],axes:le})}),de=Nt(()=>{let e= new Map;return ae.forEach((t,o)=>e.set(t,ie[o])),e},[ae,ie]),ue=Tt(e=>de.get(e[M])||ie[0],[de,ie]),pe=Nt(()=>Oo(h,U),[h,U]),ge=j({lineWidth:p,resolveStroke:ue,stroke:F,strokeWidth:P,opacity:B,effectiveSelectionHook:he.effectiveSelectionHook,resolvedSelection:he.resolvedSelection,styleRules:y,ruleContext:pe}),fe=Nt(()=>e=>{let t=e.data||e,o=t[M],i=ae.indexOf(o),a=t[D],r=J&&i>=0&&ne[i]?Go(a,ne[i]):a,n=i>=0&&U[i]?.format?U[i].format:e=>Number.isInteger(e)?String(e):e.toFixed(2),l="function"==typeof h?h(t):t[h];return Bt.createElement("div",{style:{padding:"6px 10px",fontFamily:"var(--semiotic-font-family, sans-serif)",fontSize:"var(--semiotic-tooltip-font-size, 13px)"}},Bt.createElement("div",{style:{fontWeight:600,marginBottom:4,color:ie[i]||"inherit"}},o),Bt.createElement("div",null,`${"string"==typeof h?h:"x"}: `,c?c(l):String(l)),Bt.createElement("div",null,`${o}: ${n(r)}`))},[ae,ie,ne,J,U,h,c]),be=Tt(e=>{let t=(Array.isArray(e.allSeries)?e.allSeries:[]).map(e=>{let t=ae.indexOf(e.group),o=J&&t>=0&&ne[t]?Go(e.value,ne[t]):e.value,i=e.datum;return i&&(i={...i},delete i[D],delete i[M]),{...e,value:o,datum:i}}),o=e.data&&"object"==typeof e.data&&!Array.isArray(e.data)?{...e.data}:e.data;o&&"object"==typeof o&&!Array.isArray(o)&&(delete o[D],delete o[M]);let i={...e,data:o,allSeries:t};return delete i[D],delete i[M],i},[ne,J,ae]),xe=Nt(()=>Ve({xFormat:c,yFormat:(e,t)=>U[ae.indexOf(t??"")]?.format?.(e)}),[c,U,ae]),ve=Tt(e=>xe(be(e)),[xe,be]),Ae=Nt(()=>{if(!ze(g)||"function"!=typeof g.content)return g;let e=e=>g.content(be(e));return{mode:"multi",content:Ct(g.content)?Lt(e):e}},[be,g]),we=Nt(()=>We({tooltip:Ae,defaultTooltipContent:fe,multiDefaultContent:ve}),[fe,ve,Ae]);if(he.earlyReturn)return he.earlyReturn;let ke=Q({componentName:"MultiAxisLineChart",data:n,accessors:{xAccessor:h}}),Ce=J?[0,1]:void 0,Le={chartType:"line",...null!=n&&{data:re},xAccessor:h,yAccessor:D,groupAccessor:M,lineStyle:ge,colorScheme:ie,size:[T,N],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,...void 0!==e.maxDevicePixelRatio&&{maxDevicePixelRatio:e.maxDevicePixelRatio},margin:he.margin,showAxes:r.showAxes,...le&&{axes:le},xLabel:X,...J?{}:{yLabel:ae[0]},xFormat:c,...J&&Ce&&{yExtent:Ce},enableHover:W,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},showGrid:O,curve:u,...he.legendBehaviorProps,...z&&{title:z},...G&&{description:G},...$&&{summary:$},...void 0!==V&&{accessibleTable:V},...s&&{className:s},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...we,...f&&{annotations:f},...Se({linkedHover:A,selection:x,onObservation:w,onClick:S,hoverHighlight:k,hoverRadius:e.hoverRadius,mobileInteraction:he.mobileInteraction,customHoverBehavior:he.customHoverBehavior,customClickBehavior:he.customClickBehavior}),...he.crosshairProps,...b,...Z&&{legendLayout:Z}};return ee||te||(ke? zt(Me,{componentName:"MultiAxisLineChart",message:ke,width:T,height:N}): zt(Te,{componentName:"MultiAxisLineChart",width:T,height:N,children: zt(se,{ref:o,...Le})}))}),"MultiAxisLineChart"),N=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){me(ie);let o=Dt(null);U(t,{variant:"xy",frameRef:o});let i=Ie(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,xLabel:e.xLabel,yLabel:e.yLabel,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",highAccessor:h="high",lowAccessor:d="low",openAccessor:m,closeAccessor:u,candlestickStyle:p,styleRules:y,tooltip:g,annotations:f,xExtent:b,yExtent:x,frameProps:v={},selection:A,linkedHover:w,onObservation:S,onClick:k,chartId:C,loading:L,loadingContent:R,emptyContent:_}=e,{width:H,height:I,enableHover:F,showGrid:P,title:B,description:D,summary:M,accessibleTable:T,xLabel:N,yLabel:W}=i,O=Nt(()=>Fe(a),[a]),E=Nt(()=>{let e=i.marginDefaults;return"sparkline"===i.mode?{...e,top:0,bottom:0}:e},[i.marginDefaults,i.mode]),z=K({responsive:e,data:O,rawData:a,colorBy:void 0,colorScheme:void 0,legendInteraction:void 0,selection:A,linkedHover:w,fallbackFields:[],onObservation:S,onClick:k,chartType:"CandlestickChart",chartId:C,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,showLegend:!1,userMargin:r,marginDefaults:E,loading:L,loadingContent:R,emptyContent:_,width:H,height:I}),{activeSelectionHook:G,resolvedSelection:$,customHoverBehavior:j,customClickBehavior:V,margin:X}=z,Y=null==m||null==u;Be("CandlestickChart",O,"xAccessor",c),Be("CandlestickChart",O,"highAccessor",h),Be("CandlestickChart",O,"lowAccessor",d),Y||(Be("CandlestickChart",O,"openAccessor",m),Be("CandlestickChart",O,"closeAccessor",u));let q=Nt(()=>De(c,Y?h:u),[c,h,u,Y]),J=Nt(()=>ut(Xe(void 0,y,q),G,$),[y,q,G,$]),Z=Nt(()=>{let e=[{label:N||we(c),accessor:c,role:"x",format:l}];return Y?(e.push({label:"High",accessor:h,role:"y",format:s}),e.push({label:"Low",accessor:d,format:s})):(e.push({label:"Open",accessor:m,format:s}),e.push({label:"High",accessor:h,format:s}),e.push({label:"Low",accessor:d,format:s}),e.push({label:"Close",accessor:u,format:s})),Ae(e)},[c,N,l,s,h,d,m,u,Y]),ee=Q({componentName:"CandlestickChart",data:a,accessors:{xAccessor:c,highAccessor:h,lowAccessor:d,...!Y&&{openAccessor:m,closeAccessor:u}}}),te=Math.max(2,Math.min(12,Math.round(H/40))),oe=H<=200?.02:.1,ae={chartType:"candlestick",...null!=a&&{data:O},xAccessor:c,yAccessor:h,highAccessor:h,lowAccessor:d,...!Y&&{openAccessor:m,closeAccessor:u},...p&&{candlestickStyle:p},...(G||y?.length)&&{pointStyle:J},scalePadding:te,extentPadding:oe,size:[H,I],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:X,showAxes:i.showAxes,xLabel:N,yLabel:W,xFormat:l,yFormat:s,enableHover:F,showGrid:P,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...Ce({title:B,description:D,summary:M,accessibleTable:T,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...ke({tooltip:g,defaultTooltipContent:Z}),...Se({linkedHover:w,selection:A,onObservation:S,onClick:k,hoverRadius:e.hoverRadius,mobileInteraction:i.mobileInteraction,customHoverBehavior:j,customClickBehavior:V}),...f&&f.length>0&&{annotations:f},...b&&{xExtent:b},...x&&{yExtent:x},...z.crosshairProps,...v};return z.earlyReturn?z.earlyReturn:ee? zt(Me,{componentName:"CandlestickChart",message:ee,width:H,height:I}): zt(Te,{componentName:"CandlestickChart",width:H,height:I,children: zt(se,{ref:o,...ae})})}),"CandlestickChart"),W=/*#__PURE__*/He(/*#__PURE__*/Wt(function(e,t){me(ae);let o=Dt(null);U(t,{variant:"xy",frameRef:o});let i=Ie(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:a,margin:r,className:n,xFormat:l,yFormat:s,xAccessor:c="x",yAccessor:h="y",pointIdAccessor:d,xScaleType:m,positiveColor:u,negativeColor:p,connectorStroke:y,connectorWidth:g,gap:f,styleRules:b,tooltip:x,annotations:v,xExtent:A,yExtent:w,frameProps:S={},selection:k,linkedHover:C,onObservation:L,onClick:R,hoverHighlight:_,chartId:H,loading:I,loadingContent:F,emptyContent:P,legendInteraction:B,legendPosition:D}=e,{areaStyle:M,...T}=S,{width:N,height:W,enableHover:O,showGrid:E,showLegend:z,title:G,description:$,summary:j,accessibleTable:V,xLabel:X,yLabel:Y}=i,q=Nt(()=>Fe(a),[a]),J=Dt({next:0,indexOf: new WeakMap,idOf: new Map,labels: new Map}),{plotData:Z,plotXAccessor:ee,plotXFormat:te,usesIndex:oe}=Nt(()=>{let e="function"==typeof c?c:e=>e[c],t=d?"function"==typeof d?d:e=>e[d]:void 0,o=e=>"number"==typeof e&&Number.isFinite(e)||e instanceof Date,i=(e,t)=>{let o=e??t;return l?l(o):String(o)};if(null!=a&&!q.some((t,i)=>!o(e(t,i))))return{plotData:q,plotXAccessor:c,plotXFormat:l,usesIndex:!1};if(null!=a){let t=q.map((t,o)=>e(t,o));return{plotData:q.map((e,t)=>({...e,__waterfallX:t})),plotXAccessor:"__waterfallX",plotXFormat:e=>i(t[Number(e)],e),usesIndex:!0}}let r=J.current,n=(e,t,o,i)=>{e&&"object"==typeof e&&(r.indexOf.set(e,t),!Object.isFrozen(e)&&!Object.isSealed(e)&&(e.__waterfallX=t)),o&&r.idOf.set(o,t),r.labels.set(t,i)};return{plotData:q,plotXAccessor:(i,a)=>{let l=e(i,a);if(o(l))return l;let s=t?String(t(i,a)??""):"",c=i&&"object"==typeof i?i.__waterfallX:void 0,h="number"==typeof c&&Number.isFinite(c)?c:(i&&"object"==typeof i?r.indexOf.get(i):void 0)??(s?r.idOf.get(s):void 0);if("number"==typeof h)return n(i,h,s,l),h;let d="number"==typeof a?a:r.next;return r.next=Math.max(r.next,d+1),n(i,d,s,l),d},plotXFormat:e=>i(r.labels.get(Number(e)),e),usesIndex:!0}},[a,q,c,l,d]),ie=Nt(()=>{if(oe&&null!=a)return[{orient:"bottom",tickValues:Z.map((e,t)=>t)}]},[a,Z,oe]),re=K({responsive:e,data:Z,rawData:a,colorBy:void 0,colorScheme:void 0,legendInteraction:B,legendPosition:D,frameLegend:S,selection:k,linkedHover:C,fallbackFields:["string"==typeof c?c:"x"],unwrapData:!1,onObservation:L,onClick:R,hoverHighlight:_,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"WaterfallChart",chartId:H,showLegend:z,userMargin:r,marginDefaults:i.marginDefaults,loading:I,loadingContent:F,emptyContent:P,width:N,height:W,hasTitle:!!G,axisChrome:Pe(S,{showAxes:i.showAxes,xLabel:X,yLabel:Y,axes:S.axes??ie})}),ne=Nt(()=>({positiveColor:u,negativeColor:p,connectorStroke:y,connectorWidth:g,gap:f,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity}),[u,p,y,g,f,e.stroke,e.strokeWidth,e.opacity]),le=Nt(()=>De(c,h),[c,h]),ce=Nt(()=>Xe(void 0,b,le),[b,le]),he=Nt(()=>ut(e=>{let t=ce(e);if(!M)return t;let o="function"==typeof M?M(e):M;return o?{...t,...o}:t},re.effectiveSelectionHook,re.resolvedSelection),[ce,M,re.effectiveSelectionHook,re.resolvedSelection]),de=Nt(()=>Ae([{label:X||we(c),accessor:c,role:"x",format:l},{label:Y||"Change",accessor:h,role:"y",format:s}]),[c,h,X,Y,l,s]);if(re.earlyReturn)return re.earlyReturn;let ue=Q({componentName:"WaterfallChart",data:a,accessors:{xAccessor:c,yAccessor:h}});if(ue) return zt(Me,{componentName:"WaterfallChart",message:ue,width:N,height:W});let pe={chartType:"waterfall",...null!=a&&{data:Z},xAccessor:ee,yAccessor:h,xScaleType:null!=a&&oe?"linear":m,waterfallStyle:ne,areaStyle:he,size:[N,W],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:re.margin,showAxes:i.showAxes,xLabel:X,yLabel:Y,xFormat:te,yFormat:s,enableHover:O,showGrid:E,...ie&&{axes:ie},...re.legendBehaviorProps,...Ce({title:G,description:$,summary:j,accessibleTable:V,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...ke({tooltip:x,defaultTooltipContent:de}),...Se({linkedHover:C,selection:k,onObservation:L,onClick:R,hoverHighlight:_,hoverRadius:e.hoverRadius,mobileInteraction:re.mobileInteraction,customHoverBehavior:re.customHoverBehavior,customClickBehavior:re.customClickBehavior}),...d&&{pointIdAccessor:d},...v&&v.length>0&&{annotations:v},...A&&{xExtent:A},...w&&{yExtent:w},...T};
|
|
51
|
-
return zt(Te,{componentName:"WaterfallChart",width:N,height:W,children: zt(se,{ref:o,...pe})})}),"WaterfallChart");export{e as a,t as b,o as c,Yt as d,to as e,p as f,y as g,g as h,f as i,b as j,x as k,R as l,F as m,P as n,B as o,T as p,N as q,W as r};
|
package/dist/c-DNBFFE3P.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as registerBuiltInXYPlugins}from"./c-HR5AH3MA.min.js";import"./c-JS2D7A2P.min.js";import"./c-5NAU4JAY.min.js";
|
package/dist/c-HR5AH3MA.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function s(){t(e),t(j),t(a),t(p),t(m),t(o),t(i),t(r),t(A),t(c),t(f),t(n)}import{a,b as m,c as o,d as i,e as r,f as A,g as c,h as f}from"./c-JS2D7A2P.min.js";import{e as n}from"./c-5NAU4JAY.min.js";import{e as t,j as e,l as j,m as p}from"./c-AMQAAW7G.min.js";export{s as a};
|