semiotic 3.8.1 → 3.8.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/CLAUDE.md +3 -1
- package/README.md +54 -52
- package/ai/behaviorContracts.cjs +9 -0
- package/ai/dist/mcp-server.js +142 -13
- package/ai/schema.json +616 -42
- package/ai/surface-manifest.json +1 -1
- package/ai/system-prompt.md +5 -2
- package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +2 -0
- package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +1 -0
- package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +2 -0
- package/dist/chunk-chunk-255KDHW5.module.min.js +1 -0
- package/dist/chunk-chunk-2CCFBTQC.module.min.js +2 -0
- package/dist/chunk-chunk-2CXCXRB4.module.min.js +1 -0
- package/dist/chunk-chunk-2JGJ5GUG.module.min.js +2 -0
- package/dist/chunk-chunk-2RXP3FS3.module.min.js +1 -0
- package/dist/chunk-chunk-2WVCH4PL.module.min.js +1 -0
- package/dist/chunk-chunk-4TMZXLCR.module.min.js +1 -0
- package/dist/chunk-chunk-5APBQXZA.module.min.js +1 -0
- package/dist/chunk-chunk-5RKXZQ2P.module.min.js +1 -0
- package/dist/chunk-chunk-5UKL5W76.module.min.js +2 -0
- package/dist/chunk-chunk-6HSGDMTA.module.min.js +2 -0
- package/dist/chunk-chunk-7FW6EGLP.module.min.js +2 -0
- package/dist/chunk-chunk-7OEOSCBP.module.min.js +1 -0
- package/dist/chunk-chunk-A63CTACR.module.min.js +2 -0
- package/dist/chunk-chunk-ANYDWOZF.module.min.js +1 -0
- package/dist/chunk-chunk-AZJUDQRM.module.min.js +2 -0
- package/dist/chunk-chunk-B6V35LMY.module.min.js +2 -0
- package/dist/chunk-chunk-BOSVL645.module.min.js +2 -0
- package/dist/chunk-chunk-CA3YDW6F.module.min.js +1 -0
- package/dist/chunk-chunk-CP3EN6KZ.module.min.js +1 -0
- package/dist/chunk-chunk-DSNGDNJY.module.min.js +1 -0
- package/dist/chunk-chunk-EMO5NUGE.module.min.js +2 -0
- package/dist/chunk-chunk-F25UA5HT.module.min.js +1 -0
- package/dist/chunk-chunk-FRIO6MCV.module.min.js +1 -0
- package/dist/chunk-chunk-FYY2ACNJ.module.min.js +2 -0
- package/dist/chunk-chunk-G7WFWHAD.module.min.js +2 -0
- package/dist/chunk-chunk-GMQ5AYTD.module.min.js +1 -0
- package/dist/chunk-chunk-GWSWSPXN.module.min.js +1 -0
- package/dist/chunk-chunk-I6C3KR5H.module.min.js +2 -0
- package/dist/chunk-chunk-IP2UE74X.module.min.js +1 -0
- package/dist/chunk-chunk-J3ELI22J.module.min.js +1 -0
- package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
- package/dist/chunk-chunk-J3XWETBJ.module.min.js +2 -0
- package/dist/chunk-chunk-J5RL6GXU.module.min.js +2 -0
- package/dist/chunk-chunk-JCG72SGW.module.min.js +2 -0
- package/dist/{semiotic-ai-chunk-OG7BQUUW.module.min.js → chunk-chunk-JJ2OOIET.module.min.js} +0 -1
- package/dist/chunk-chunk-JNCHKRIR.module.min.js +2 -0
- package/dist/chunk-chunk-KTWEBFMX.module.min.js +2 -0
- package/dist/chunk-chunk-L3H6DQCR.module.min.js +2 -0
- package/dist/chunk-chunk-M337NY6L.module.min.js +1 -0
- package/dist/chunk-chunk-M7VYYHCE.module.min.js +2 -0
- package/dist/chunk-chunk-MC35ILYP.module.min.js +2 -0
- package/dist/chunk-chunk-N72SWNBV.module.min.js +1 -0
- package/dist/chunk-chunk-OBQRFTIL.module.min.js +2 -0
- package/dist/chunk-chunk-OQTLSTGI.module.min.js +2 -0
- package/dist/chunk-chunk-Q2YADC2V.module.min.js +2 -0
- package/dist/chunk-chunk-QRIBHZYW.module.min.js +1 -0
- package/dist/chunk-chunk-QSQVBIJA.module.min.js +1 -0
- package/dist/chunk-chunk-RCF52Z42.module.min.js +2 -0
- package/dist/chunk-chunk-ROP4HI7H.module.min.js +2 -0
- package/dist/chunk-chunk-RZH7VZYS.module.min.js +2 -0
- package/dist/chunk-chunk-SA3D43RA.module.min.js +2 -0
- package/dist/chunk-chunk-SANERMIZ.module.min.js +2 -0
- package/dist/chunk-chunk-SIRIJ3DY.module.min.js +1 -0
- package/dist/chunk-chunk-SV4XAZ3Q.module.min.js +1 -0
- package/dist/chunk-chunk-U66USBWU.module.min.js +1 -0
- package/dist/chunk-chunk-UHSZEB74.module.min.js +1 -0
- package/dist/chunk-chunk-VVCA3DB7.module.min.js +1 -0
- package/dist/chunk-chunk-WCX6U47H.module.min.js +2 -0
- package/dist/chunk-chunk-XEVJDUTH.module.min.js +1 -0
- package/dist/chunk-chunk-XQYVEKEJ.module.min.js +2 -0
- package/dist/chunk-chunk-Y6AXCRVO.module.min.js +1 -0
- package/dist/chunk-chunk-YCQYG6J5.module.min.js +2 -0
- package/dist/chunk-chunk-YHNZCPOZ.module.min.js +2 -0
- package/dist/chunk-chunk-YWZB3KPI.module.min.js +2 -0
- package/dist/chunk-chunk-ZCNBUZPL.module.min.js +2 -0
- package/dist/chunk-statisticalOverlays-6MVAK5RW.module.min.js +2 -0
- package/dist/components/charts/custom/XYCustomChart.d.ts +3 -0
- package/dist/components/charts/physics/PhysicalFlowChart.d.ts +7 -0
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -6
- package/dist/components/charts/realtime/temporalHistogramConfig.d.ts +11 -0
- package/dist/components/charts/shared/areaSeriesData.d.ts +15 -0
- package/dist/components/charts/shared/auditAccessibilityText.d.ts +13 -0
- package/dist/components/charts/shared/chartMode.d.ts +67 -0
- package/dist/components/charts/shared/colorUtils.d.ts +8 -0
- package/dist/components/charts/shared/geoStyleDefaults.d.ts +3 -0
- package/dist/components/charts/shared/hooks.d.ts +13 -80
- package/dist/components/charts/shared/useChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useCustomChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useXYLineStyle.d.ts +3 -2
- package/dist/components/charts/shared/xyLineStyle.d.ts +21 -0
- package/dist/components/charts/xy/LineChart.d.ts +3 -0
- package/dist/components/legendLayout.d.ts +31 -0
- package/dist/components/server/serverChartConfigShared.d.ts +29 -0
- package/dist/components/server/serverChartConfigs.d.ts +2 -13
- package/dist/components/server/serverChartConfigsXY.d.ts +3 -0
- package/dist/components/server/serverGaugeOverlay.d.ts +28 -0
- package/dist/components/server/staticLegend.d.ts +7 -1
- package/dist/components/server/staticSVGChrome.d.ts +60 -2
- package/dist/components/stream/GeoPipelineStore.d.ts +2 -0
- package/dist/components/stream/GeoSVGOverlay.d.ts +2 -0
- package/dist/components/stream/OrdinalBrushOverlay.d.ts +1 -2
- package/dist/components/stream/OrdinalBrushOverlayLazy.d.ts +9 -0
- package/dist/components/stream/SceneToSVG.d.ts +8 -6
- package/dist/components/stream/SceneToSVGGeo.d.ts +10 -0
- package/dist/components/stream/SceneToSVGNetwork.d.ts +12 -0
- package/dist/components/stream/XYBrushOverlayLazy.d.ts +17 -0
- package/dist/components/stream/canvasBackground.d.ts +7 -0
- package/dist/components/stream/networkTypes.d.ts +2 -4
- package/dist/components/stream/renderBackend.d.ts +14 -0
- package/dist/components/stream/sceneToSVGShared.d.ts +51 -0
- package/dist/components/types/legendTypes.d.ts +16 -3
- package/dist/controls.min.js +1 -1
- package/dist/controls.module.min.js +1 -1
- package/dist/geo.min.js +1 -1
- package/dist/geo.module.min.js +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.min.js +1 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.min.js +1 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/rough.min.js +1 -1
- package/dist/rough.module.min.js +1 -1
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental.min.js +1 -1
- package/dist/semiotic-experimental.module.min.js +1 -1
- package/dist/semiotic-realtime-core.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-react.min.js +1 -1
- package/dist/semiotic-recipes-react.module.min.js +1 -1
- package/dist/semiotic-recipes.min.js +1 -1
- package/dist/semiotic-recipes.module.min.js +1 -1
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes-react.min.js +1 -1
- package/dist/semiotic-themes-react.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic-utils-react.min.js +1 -1
- package/dist/semiotic-utils-react.module.min.js +1 -1
- package/dist/semiotic-utils.min.js +1 -1
- package/dist/semiotic-utils.module.min.js +1 -1
- package/dist/semiotic-value.min.js +1 -1
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +4 -4
- package/dist/semiotic-ai-statisticalOverlays-CY4WKR4A.module.min.js +0 -2
- package/dist/semiotic-chunk-3FSVZ46U.module.min.js +0 -2
- package/dist/semiotic-statisticalOverlays-UOMSFKVJ.module.min.js +0 -2
- package/dist/xy-chunk-IWD6IB6V.module.min.js +0 -2
- package/dist/xy-statisticalOverlays-7RWG6LJT.module.min.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{commonJsWorkerModuleUrl as e}from"./chunk-chunk-SV4XAZ3Q.module.min.js";import{resolveNodeSizeFn as r}from"./chunk-chunk-5APBQXZA.module.min.js";import*as t from"react";import{jsx as n}from"react/jsx-runtime";var o={isActive:!1,predicate:()=>!0},i=t.createContext(null);function s({value:e,children:r}){return n(i.Provider,{value:e,children:r})}function a(){return t.useContext(i)??o}function u(e,r){return null!=e?n(s,{value:r,children:e}):e}function c(e,r,t,n,o=4e4){return"sync"!==e&&("worker"===e||n*(r+t)>=o)}function d(){return"undefined"!=typeof window&&"undefined"!=typeof Worker}function l(e,t,n,o,i){const s=r(n.nodeSize,n.nodeSizeRange,e);return{kind:"frame",nodes:e.map(e=>{const r=i?.get(e.id);return{id:e.id,x:0!==e.x||0!==e.y?e.x:r?.x??0,y:0!==e.x||0!==e.y?e.y:r?.y??0,x0:0,x1:0,y0:0,y1:0,width:0,height:0,value:e.value,__forceRadius:s(e)}}),edges:t.map(e=>{const r="string"==typeof e.source?e.source:e.source.id,t="string"==typeof e.target?e.target:e.target.id,n=e.data?.weight,o="number"==typeof n&&Number.isFinite(n)?n:e.value;return{source:r,target:t,value:e.value,y0:0,y1:0,sankeyWidth:0,weight:o}}),config:{chartType:"force",iterations:n.iterations,forceStrength:n.forceStrength,seed:n.seed},size:o}}function m(){if("undefined"!=typeof DOMException)return new DOMException("Force layout aborted","AbortError");const e=Error("Force layout aborted");return e.name="AbortError",e}var h=class{constructor(r=function(){const r="string"==typeof import.meta.url&&import.meta.url?new URL("./forceLayoutWorker.js",import.meta.url):e("forceLayoutWorker.js");return new Worker(r,{type:"module",name:"semiotic-force-layout"})}()){this.nextRequestId=1,this.pending=new Map,this.dead=!1,this.worker=r,this.worker.onmessage=e=>{const r=e.data,t=r.requestId,n=null!=t?this.pending.get(t):this.pending.values().next().value;if(n){if(null!=t?this.pending.delete(t):this.pending.clear(),n.cleanup(),r.error){const e=Error(r.error.message);return e.name=r.error.name??"Error",r.error.stack&&(e.stack=r.error.stack),void n.reject(e)}n.resolve({positions:r.positions??{}})}},this.worker.onerror=e=>{this.rejectAll(Error(e.message||"Force layout worker failed")),this.terminate()}}get isDead(){return this.dead}request(e,r){if(this.dead)return Promise.reject(Error("Force layout worker session is closed"));if(r?.aborted)return Promise.reject(m());const t=this.nextRequestId;this.nextRequestId+=1;const n={requestId:t,request:e};return new Promise((e,o)=>{const i=()=>{this.pending.delete(t),r?.removeEventListener("abort",i),o(m())},s=()=>r?.removeEventListener("abort",i);this.pending.set(t,{cleanup:s,reject:o,resolve:e}),r?.addEventListener("abort",i,{once:!0});try{this.worker.postMessage(n)}catch(e){this.pending.delete(t),s(),o(e instanceof Error?e:Error(e+""))}})}terminate(){this.dead||(this.dead=!0,this.rejectAll(Error("Force layout worker terminated")),this.worker.terminate())}rejectAll(e){for(const r of this.pending.values())r.cleanup(),r.reject(e);this.pending.clear()}},f=null;function p(e,r){return d()?r?.aborted?Promise.reject(m()):(f&&!f.isDead||(f=new h),f).request(e,r):Promise.reject(Error("Web Workers are unavailable"))}export{s as CustomLayoutSelectionProvider,a as useCustomLayoutSelection,u as wrapWithCustomLayoutSelection,c as shouldUseForceWorker,d as canUseForceWorker,l as createFrameForceWorkerRequest,p as runForceLayoutWorker};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{bandFromAge as t,defaultTooltipStyle as e,normalizeTooltip as n,opacityFromAge as r,resolveCanvasFill as o}from"./chunk-chunk-6HSGDMTA.module.min.js";import{drawGlyphParts as a,glyphFractionClipRect as s,glyphHitGeometry as l,glyphPlacement as i}from"./chunk-chunk-KTWEBFMX.module.min.js";import{jsx as c,jsxs as u}from"react/jsx-runtime";function f(t){return"string"==typeof t?t:"value"}function h(t){return null==t?"–":"number"==typeof t?Math.abs(t)>9999?t.toLocaleString():t+"":t instanceof Date?t.toLocaleDateString():t+""}function d(t,e){if(!e)return h(t);try{const n=e(t);return null==n?h(t):n}catch{return h(t)}}function p(t,e){return"function"==typeof e?e(t):t[e]}function y(t,e){if(!t)return[];const n=[];return(Array.isArray(t)?t:[t]).forEach((t,r)=>{const o="string"==typeof t?.y0Accessor?t.y0Accessor:"low",a="string"==typeof t?.y1Accessor?t.y1Accessor:"high";n.push({label:o,accessor:t=>t.bands?.[r]?.y0??(0===r?t.band?.y0:void 0),format:e}),n.push({label:a,accessor:t=>t.bands?.[r]?.y1??(0===r?t.band?.y1:void 0),format:e})}),n}function g(t){const n=t.find(t=>"title"===t.role),r=t.filter(t=>"title"!==t.role);return t=>{const o=t.data;if(!o)return null;const a=n?d(p(o,n.accessor),n.format):null;return u("div",{className:"semiotic-tooltip",style:e,children:[null!=a&&c("div",{style:{fontWeight:"bold",marginBottom:r.length>0?4:0},children:a}),r.map((t,e)=>{const n=d(p(o,t.accessor),t.format);return u("div",{style:e>0?{marginTop:2}:void 0,children:[u("span",{style:{opacity:.7},children:[t.label,": "]}),c("span",{children:n})]},e)})]})}}function m({categoryAccessor:t,valueAccessor:n,groupAccessor:r,groupLabel:o,pieData:a=!1,valueFormat:s}){return l=>{const i=a?l.data?.[0]||l.data||l:l.data||l,y=p(i,t),g=p(i,n),m=r?p(i,r):void 0;return u("div",{className:"semiotic-tooltip",style:e,children:[c("div",{style:{fontWeight:"bold"},children:h(y)}),c("div",{style:{marginTop:4},children:d(g,s)}),null!=m&&u("div",{style:{marginTop:2,opacity:.8},children:[o||f(r),": ",h(m)]})]})}}import*as x from"react";function b(...t){const e=t.filter(t=>null!=t);return 0===e.length?null:1===e.length?e[0]:x.createElement(x.Fragment,null,...e)}import{useEffect as v,useRef as w}from"react";function A(t,e,n,r){v(()=>{t.current?.updateConfig(e),n.current=!0,r()},[e,r,t,n])}function _(t,e,n,r){const o=w(null);v(()=>{const a=t.current;if(!a)return;const s=e??null;o.current!==s&&(o.current=s,a.setLayoutSelection(s),a.hasCustomRestyle?a.restyleScene(s):n.current=!0,r())},[e,r,t,n])}var M={fresh:1,aging:.7,stale:.45,expired:.25},k={alpha:1,band:"fresh",isStale:!1};function I(e,n){if(!e||0>=n)return k;const r=null!=e.threshold&&e.threshold>0?e.threshold:5e3,o=e.graded;if(o){const e="object"==typeof o?o:{},a=t(n,r,e.thresholds);return{alpha:{...M,...e.opacities??{}}[a],band:a,isStale:"fresh"!==a}}return n>r?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:k}import{useEffect as S,useRef as O}from"react";function D(t,e,n,r,o,a){const s=O("fresh");S(()=>{if(!t)return;const l=setInterval(()=>{const l=e.current;if(!l||0===l.lastIngestTime)return;const i="undefined"!=typeof performance?performance.now():Date.now(),c=I(t,i-l.lastIngestTime);c.band===s.current&&c.isStale===o||(s.current=c.band,c.isStale!==o&&a(c.isStale),n.current=!0,r())},1e3);return()=>clearInterval(l)},[t,o,r,e,a,n])}import{jsx as R}from"react/jsx-runtime";function E({isStale:t,position:e}){return R("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===e?{top:4,left:4}:"bottom-left"===e?{bottom:4,left:4}:"bottom-right"===e?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:t?"#dc3545":"#28a745",color:"white"},children:t?"STALE":"LIVE"})}import{useRef as P}from"react";function j(t){const e=P(t);return function(t,e){if(Object.is(t,e))return!0;if(Array.isArray(t)&&Array.isArray(e))return L(t,e);if(!T(t)||!T(e))return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(e,r))return!1;const n=t[r],o=e[r];if(!Object.is(n,o))if(Array.isArray(n)&&Array.isArray(o)){if(!L(n,o))return!1}else{if(!T(n)||!T(o))return!1;if(!C(n,o))return!1}}return!0}(e.current,t)||(e.current=t),e.current}function C(t,e){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(e,r))return!1;if(!Object.is(t[r],e[r]))return!1}return!0}function L(t,e){if(t.length!==e.length)return!1;for(let n=0;t.length>n;n++)if(!Object.is(t[n],e[n]))return!1;return!0}function T(t){if(null===t||"object"!=typeof t)return!1;if(Array.isArray(t))return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function z(t,e,n,r,l){if(0>=e.size)return;const c=e.glyph;if(!c||!c.parts?.length)return;const u=i(c,e.size);if(0>=u.scale)return;const f=(e.style.opacity??1)*(e._decayOpacity??1);if(0>=f)return;const h=e=>{const n=o(t,e,e);return"string"==typeof n?n:e},d=e.color??("string"==typeof e.style.fill?e.style.fill:void 0);t.save(),t.translate(n,r),e.rotation&&t.rotate(e.rotation),t.translate(u.offsetX,u.offsetY),t.scale(u.scale,u.scale),t.globalAlpha=l*f*(e.style.fillOpacity??1);const p=s(c,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal");p&&e.ghostColor&&a(t,c,d,e.accent,e.ghostColor,h),p&&(t.beginPath(),t.rect(p.x,p.y,p.width,p.height),t.clip()),a(t,c,d,e.accent,void 0,h),t.restore()}var H=(t,e)=>{const n=t.globalAlpha;for(const r of e)"glyph"===r.type&&z(t,r,r.x,r.y,n);t.globalAlpha=n};function G(t,e){const n=t.globalAlpha;for(const r of e)"glyph"===r.type&&z(t,r,r.cx,r.cy,n);t.globalAlpha=n}var $=new Set;function N(t,e){const n="function"==typeof t?t(e.datum??null,e):t;return(r=n)&&"object"==typeof r&&"string"==typeof r.id&&"function"==typeof r.cacheKey&&"function"==typeof r.drawCanvas&&"function"==typeof r.renderStaticSVG?n:void 0;var r}function U(t,e){if("undefined"!=typeof process&&"production"===process.env?.NODE_ENV)return;const n=`${t}:${e}`;$.has(n)||($.add(n),console.warn(`[Semiotic] Render backend "${t}" does not support scene node "${e}"; using the built-in renderer.`))}function W(t){const{context:e,nodes:n,renderMode:r,pixelRatio:o,paintBuiltIn:a}=t;if(!r||"sketchy"===r)return void a(n);let s=[];const l=()=>{s.length&&(a(s),s=[])};for(const t of n){const n=N(r,t);if(!n){s.push(t);continue}let i;l(),e.save();try{i=n.drawCanvas({context:e,node:t,style:t.style??{},pixelRatio:o})}finally{e.restore()}i||(U(n.id,t.type??"unknown"),a([t]))}l()}function B(t){const{node:e,index:n,renderMode:r,fallback:o}=t,a=N(r,e);if(!a)return o();const s=a.renderStaticSVG({node:e,style:e.style??{},key:`${a.id}-${n}`});return null!=s?s:(U(a.id,e.type??"unknown"),o())}function F(t){const e=new Map;for(const n of t){const t=n.group??"_default";let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}for(const t of e.values()){t.sort((t,e)=>t.x-e.x||t.y-e.y);for(let e=0;t.length>e;e++)t[e]._groupIndex=e}const n=Array.from(e.keys()).sort((t,n)=>{const r=e.get(t),o=e.get(n);return(r.length>0?r[0].y:0)-(o.length>0?o[0].y:0)}),r=Array.from(e.values()).flat();r.sort((t,e)=>t.x-e.x||t.y-e.y);const o=new Map;for(let t=0;r.length>t;t++){r[t]._flatIndex=t;const e=r[t].datum?.id;null!=e&&o.set(e+"",t)}return{flat:r,groups:n,byGroup:e,idToIdx:o}}function V(t,e){if(0===t.flat.length)return{flatIndex:-1,group:"_default",indexInGroup:-1};const n=Math.max(0,Math.min(e,t.flat.length-1)),r=t.flat[n];return{flatIndex:n,group:r.group??"_default",indexInGroup:r._groupIndex??0}}function Y(t,e,n){const{group:r,indexInGroup:o}=e,a=n.byGroup.get(r);switch(t){case"ArrowRight":return a.length-1>o?a[o+1]._flatIndex:e.flatIndex;case"ArrowLeft":return o>0?a[o-1]._flatIndex:e.flatIndex;case"ArrowDown":{const t=n.groups.indexOf(r);return n.groups.length-1>t?K(n,n.groups[t+1],a[o]):e.flatIndex}case"ArrowUp":{const t=n.groups.indexOf(r);return t>0?K(n,n.groups[t-1],a[o]):e.flatIndex}case"PageDown":return Math.min(e.flatIndex+Math.max(1,Math.floor(.1*n.flat.length)),n.flat.length-1);case"PageUp":return Math.max(e.flatIndex-Math.max(1,Math.floor(.1*n.flat.length)),0);case"Home":return 0;case"End":return n.flat.length-1;case"Escape":return-1;default:return null}}function K(t,e,n){const r=t.byGroup.get(e);let o=0,a=Math.abs(r[0].x-n.x);for(let t=1;r.length>t;t++){const e=Math.abs(r[t].x-n.x);a>e&&(a=e,o=t)}return r[o]._flatIndex}function X(t){const e=[];for(const n of t)switch(n.type){case"point":e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"});break;case"symbol":if(0>=n.size)break;e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"});break;case"glyph":{if(0>=n.size||null==n.datum)break;const t=l(n.glyph,n.size);e.push({x:n.x+t.centerDx,y:n.y+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight,group:"_default"});break}case"line":{const t=n,r=Array.isArray(t.datum)?t.datum:[],o=t.group??"_default";for(let n=0;t.path.length>n&&r.length>n;n++)e.push({x:t.path[n][0],y:t.path[n][1],datum:r[n],shape:"circle",group:o});break}case"area":{const t=n,r=Array.isArray(t.datum)?t.datum:[],o=t.group??"_default";for(let n=0;t.topPath.length>n&&r.length>n;n++)e.push({x:t.topPath[n][0],y:t.topPath[n][1],datum:r[n],shape:"circle",group:o});break}case"rect":e.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:n.group??"_default"});break;case"heatcell":e.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:"_default"})}return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function q(t){const e=[];for(const n of t)if("rect"===n.type&&null!=n.x){if(null==n.datum)continue;e.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:n.group??n.datum?.category??""})}else if("point"===n.type)e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"});else if("symbol"===n.type){if(0>=n.size)continue;e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle",group:"_default"})}else if("glyph"===n.type){if(0>=n.size||null==n.datum)continue;const t=l(n.glyph,n.size);e.push({x:n.x+t.centerDx,y:n.y+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight,group:"_default"})}else if("wedge"===n.type&&null!=n.cx){if(null===n.datum)continue;const t=((n.startAngle||0)+(n.endAngle||0))/2,r=((n.innerRadius||0)+(n.outerRadius||50))/2;e.push({x:n.cx+Math.cos(t)*r,y:n.cy+Math.sin(t)*r,datum:n.datum,shape:"wedge",group:"_default"})}return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function J(t){const e=[];for(const n of t)if("circle"===n.type&&null!=n.cx){if(0>=n.r)continue;e.push({x:n.cx,y:n.cy,datum:n.datum,shape:"circle",group:n.datum?.id??"_default"})}else if("rect"===n.type&&null!=n.x){if(0>=n.w||0>=n.h)continue;e.push({x:n.x+n.w/2,y:n.y+n.h/2,datum:n.datum,shape:"rect",w:n.w,h:n.h,group:n.datum?.id??"_default"})}else if("arc"===n.type&&null!=n.cx)e.push({x:n.cx,y:n.cy,datum:n.datum,shape:"circle",group:n.datum?.id??"_default"});else if("symbol"===n.type&&null!=n.cx){if(0>=n.size)continue;e.push({x:n.cx,y:n.cy,datum:n.datum,shape:"circle",group:n.datum?.id??"_default"})}else if("glyph"===n.type&&null!=n.cx){if(0>=n.size||null==n.datum)continue;const t=l(n.glyph,n.size);e.push({x:n.cx+t.centerDx,y:n.cy+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight,group:n.datum?.id??"_default"})}return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function Q(t,e,n,r,o){const a=n.flat[e.flatIndex];if(!a)return Y(t,e,n);const s=a.datum?.id;switch(t){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":{const r=function(t,e,n){let r=null,o=1/0;for(let a=0;t.flat.length>a;a++){const s=t.flat[a];if(s===e)continue;const l=s.x-e.x,i=s.y-e.y;let c=!1;switch(n){case"right":c=l>0&&Math.abs(l)>=Math.abs(i);break;case"left":c=0>l&&Math.abs(l)>=Math.abs(i);break;case"down":c=i>0&&Math.abs(i)>=Math.abs(l);break;case"up":c=0>i&&Math.abs(i)>=Math.abs(l)}if(!c)continue;const u=l*l+i*i;o>u&&(o=u,r=a)}return r}(n,a,"ArrowRight"===t?"right":"ArrowLeft"===t?"left":"ArrowDown"===t?"down":"up")??e.flatIndex;return r!==e.flatIndex&&(o.current=-1),r}case"Enter":{if(null==s)return e.flatIndex;const t=function(t,e){const n=t+"",r=[];for(const t of e){const e=t.datum??t,o=Z(e.source),a=Z(e.target),s=null!=o,l=null!=a;s&&o+""===n&&l?r.push(a+""):l&&a+""===n&&s&&r.push(o+"")}return r}(s,r);if(0===t.length)return e.flatIndex;const a=n.idToIdx.get(t[(o.current+1)%t.length])??-1;return 0>a?e.flatIndex:(o.current=-1,a)}default:{const r=Y(t,e,n);return null!==r&&r!==e.flatIndex&&(o.current=-1),r}}}function Z(t){return"object"==typeof t&&null!==t&&"id"in t?t.id:t}function tt(t){const e=[];for(const n of t)if("point"===n.type&&null!=n.x)e.push({x:n.x,y:n.y,datum:n.datum,shape:"circle"});else if("glyph"===n.type){if(0>=n.size||null==n.datum)continue;const t=l(n.glyph,n.size);e.push({x:n.x+t.centerDx,y:n.y+t.centerDy,datum:n.datum,shape:"rect",w:2*t.halfWidth,h:2*t.halfHeight})}else"geoarea"===n.type&&n.centroid&&!1!==n.interactive&&e.push({x:n.centroid[0],y:n.centroid[1],datum:n.datum,shape:"geoarea",pathData:n.pathData});return e.sort((t,e)=>t.x-e.x||t.y-e.y),e}function et(t,e,n){switch(t){case"ArrowRight":case"ArrowDown":return n-1>e?e+1:e;case"ArrowLeft":case"ArrowUp":return e>0?e-1:e;case"PageDown":return Math.min(e+Math.max(1,Math.floor(.1*n)),n-1);case"PageUp":return Math.max(e-Math.max(1,Math.floor(.1*n)),0);case"Home":return 0;case"End":return n-1;case"Escape":return-1;default:return null}}function nt(t){return{data:t.datum||{},x:t.x,y:t.y,__semioticHoverData:!0}}function rt(t){const{title:e,description:n,summary:r,accessibleTable:o,className:a,animate:s,axisExtent:l,autoPlaceAnnotations:i}=t,c={};return e&&(c.title=e),n&&(c.description=n),r&&(c.summary=r),void 0!==o&&(c.accessibleTable=o),a&&(c.className=a),null!=s&&(c.animate=s),void 0!==l&&(c.axisExtent=l),void 0!==i&&(c.autoPlaceAnnotations=i),c}function ot(t){const{linkedHover:e,selection:n,onObservation:r,onClick:o,hoverRadius:a,hoverHighlight:s,forceHoverBehavior:l,forceClickBehavior:i,mobileInteraction:c,customHoverBehavior:u,customClickBehavior:f,linkedHoverInClickPredicate:h=!0}=t,d={};r&&(d.annotationObservationCallback=r);const p=c?.enabled?Math.max(a??30,Math.ceil((c.targetSize||44)/2),24):a;return(l||e||r||o||s)&&(d.customHoverBehavior=u),f&&(i||(h?r||o||e:r||o)||c?.enabled&&(c.tapToSelect||c.tapToLockTooltip)&&(e||s||n))&&(d.customClickBehavior=f),null!=p&&(d.hoverRadius=p),d}function at(t){const{tooltip:e,defaultTooltipContent:r}=t;return{tooltipContent:!1===e?()=>null:n(e)||r}}function st(t,e,n){if(1>=n)return 1;const o=n-1;return r({age:o-e,extent:o,type:t.type,halfLife:t.halfLife??n/2,threshold:t.stepThreshold??.5*n,minOpacity:t.minOpacity??.1})}function lt(t){const e=new Map;for(let n=0;t.length>n;n++)e.set(t[n],n);return e}function it(t,e,n,r=lt(n)){const o=n.length;if(o>1)for(const n of e){if("line"===n.type){const e=Array.isArray(n.datum)?n.datum:[];if(2>e.length)continue;const a=Array(e.length);let s=!1;for(let n=0;e.length>n;n++){const l=r.get(e[n]);null!=l?(a[n]=st(t,l,o),1>a[n]&&(s=!0)):a[n]=1}s&&(n._decayOpacities=a);continue}if("area"===n.type){const e=Array.isArray(n.datum)?n.datum:[],a=n.topPath?n.topPath.length:e.length;if(2>a)continue;if(e.length===a){const s=Array(a);let l=!1;for(let n=0;e.length>n;n++){const a=r.get(e[n]);null!=a?(s[n]=st(t,a,o),1>s[n]&&(l=!0)):s[n]=1}l&&(n._decayOpacities=s)}else{let s=1;for(const n of e){const e=r.get(n);if(null!=e){const n=st(t,e,o);s>n&&(s=n)}}if(1>s){const t=Array(a);t.fill(s),n._decayOpacities=t}}continue}const e=r.get(n.datum);if(null==e)continue;const a=st(t,e,o);"heatcell"===n.type?n.style={opacity:a}:"candlestick"===n.type?n._decayOpacity=a:n.style={...n.style,opacity:(n.style?.opacity??1)*a}}}function ct(t){if("production"===process.env.NODE_ENV)return;const{label:e,nodes:n,overlays:r,warned:o}=t;ut(r)&&0===n.length&&ft(o,"overlay-only",`[semiotic] ${e} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),n.length>0&&n.every(t=>null==t.datum)&&ft(o,"null-datums",`[semiotic] ${e} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}function ut(t){return null!=t&&!1!==t&&""!==t&&(!Array.isArray(t)||t.some(ut))}function ft(t,e,n){t.has(e)||(t.add(e),console.warn(n))}function ht(t,e,n,r){const o=function(t){if(t instanceof Error)return{name:t.name||"Error",message:t.message||"Custom layout threw."};if("string"==typeof t)return{name:"Error",message:t};if(null==t)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:t+""}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}(e),a="network"===t?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:t,source:a,message:`Semiotic ${t} ${a} failed: ${o.message}`,error:o,recovery:n?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:n,affectedRevision:r}}var dt=new WeakMap;function pt(){return this.updateResults.last}function yt(){return this.updateResults.last}function gt(t){return this.updateResults.subscribe(t)}function mt(t){this.config.layoutSelection=t}function xt(){dt.set(this,!0)}function bt(){const t=!0===dt.get(this);return dt.delete(this),t}function vt(t){Object.assign(t.prototype,{getLastUpdateResult:pt,getUpdateSnapshot:yt,subscribeUpdateResult:gt,setLayoutSelection:mt,markStylePaintPending:xt,consumeStylePaintPending:bt})}function wt(t,e,n){return n.x>t||t>n.x+n.w||n.y>e||e>n.y+n.h?{hit:!1,cx:0,cy:0}:{hit:!0,cx:n.x+n.w/2,cy:n.y+n.h/2}}function At(t,e=30){return Math.max((t??4)+5,12,e)}function _t(t){return t instanceof Date?t:"number"==typeof t&&t>1e9?new Date(t):null}function Mt(t,e){const n=_t(t);if(!n)return!1;const r=_t(e);return!r||n.getFullYear()!==r.getFullYear()||n.getMonth()!==r.getMonth()}function kt(t){let e=t%(2*Math.PI);return 0>e&&(e+=2*Math.PI),e}function It(t,e,n,r,o,a=t=>t.x,s=t=>t.y,l=t=>t.r){const i=Math.max(r,o+5,12),c=e-i,u=e+i,f=n-i,h=n+i;let d=null,p=1/0;return t.visit((t,o,i,y,g)=>{if(o>u||c>y||i>h||f>g)return!0;if(!t.length){let o=t;do{const t=o.data,i=a(t)-e,c=s(t)-n,u=Math.sqrt(i*i+c*c);At(l(t),r)>=u&&p>u&&(d=t,p=u),o=o.next}while(o)}return!1}),d?{node:d,distance:p}:null}function St(t){return!(!t._pulseIntensity||0>=t._pulseIntensity)}function Ot(t,e,n=.3){St(e)&&(t.globalAlpha=e._pulseIntensity*n,t.fillStyle=e._pulseColor||"rgba(255,255,255,0.6)",t.fillRect(e.x,e.y,e.w,e.h))}function Dt(t,e,n=.6){if(!St(e))return;const r=e.r+(e._pulseGlowRadius??4)*e._pulseIntensity,o=e.cx??e.x??0,a=e.cy??e.y??0;t.beginPath(),t.arc(o,a,r,0,2*Math.PI),t.strokeStyle=e._pulseColor||"rgba(255,255,255,0.6)",t.lineWidth=2*e._pulseIntensity,t.globalAlpha=e._pulseIntensity*n,t.stroke()}function Rt(t,e,n,r=.35){St(e)&&(t.globalAlpha=e._pulseIntensity*r,t.fillStyle=e._pulseColor||"rgba(255,255,255,0.6)",n?t.fill(n):t.fill())}export{st as computeDecayOpacity,lt as buildDatumIndexMap,it as applyDecay,ct as warnCustomLayoutDiagnostics,ht as createCustomLayoutFailureDiagnostic,vt as attachUpdateResultStore,b as composeOverlays,A as useConfigSync,_ as useLayoutSelectionSync,wt as hitTestRect,At as getHitRadius,Mt as isTimeLandmark,kt as normalizeAngle,It as findHitPointInQuadtree,I as resolveStaleness,D as useStalenessCheck,E as StalenessBadge,j as useStableShallow,Ot as renderRectPulse,Dt as renderCirclePulse,Rt as renderPathPulse,H as glyphCanvasRenderer,G as networkGlyphRenderer,W as paintSceneWithBackend,B as renderSceneWithBackend,f as accessorName,h as formatVal,y as bandTooltipFields,g as buildDefaultTooltip,m as buildOrdinalTooltip,F as buildNavGraph,V as resolvePosition,Y as nextGraphIndex,X as extractXYNavPoints,q as extractOrdinalNavPoints,J as extractNetworkNavPoints,Q as nextNetworkIndex,tt as extractGeoNavPoints,et as nextIndex,nt as navPointToHover,rt as buildBaseMetadataProps,ot as buildCustomBehaviorProps,at as buildTooltipProps};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getMinMax as t}from"./chunk-chunk-JJ2OOIET.module.min.js";function a(t=240){const a=360-t,n=180+a/2,h=n*Math.PI/180;return{sweepRad:t*Math.PI/180,gapDeg:a,startAngleDeg:n,startAngleRad:h,offsetRad:-Math.PI/2+h}}function n(t,a,n,h,s){const e=n-a||1;return s+(Math.max(a,Math.min(n,t))-a)/e*h}function h(n=240){const{sweepRad:h,offsetRad:s}=a(n),e=[[Math.cos(s),Math.sin(s)],[Math.cos(s+h),Math.sin(s+h)],[0,0]];for(let t=0;2*Math.PI>t;t+=Math.PI/2)((t-s)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>h+.001||e.push([Math.cos(t),Math.sin(t)]);const o=e.map(t=>t[0]),M=e.map(t=>t[1]),[c,i]=t(o),[m,r]=t(M);return{minX:c,maxX:i,minY:m,maxY:r,width:i-c,height:r-m,cx:(c+i)/2,cy:(m+r)/2}}export{a as sweepToAngles,n as valueToAngle,h as computeArcBoundingBox};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{renderRectPulse as t}from"./chunk-chunk-A63CTACR.module.min.js";import{buildLinearFillGradient as e,clampCornerRadii as n,filterSparseArray as s,hasAnyCornerRadius as i,resolveCSSColor as o,resolveCanvasFill as r,symbolPathString as l}from"./chunk-chunk-6HSGDMTA.module.min.js";var h=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(t){Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}evict(t){t!==this._min&&t!==this._max||(this._dirty=!0)}recalculate(t,e){this._min=1/0,this._max=-1/0;for(const n of t){const t=e?e(n):n;Number.isFinite(t)&&(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},u=class{constructor(t,e){this.lastBoundedData=null,this.chunkTimer=0,this.pushBuffer=[],this.flushScheduled=!1,this.callback=t,this.chunkThreshold=e?.chunkThreshold??5e3,this.chunkSize=e?.chunkSize??5e3}updateChunkOptions(t){null!=t.chunkThreshold&&(this.chunkThreshold=t.chunkThreshold),null!=t.chunkSize&&(this.chunkSize=t.chunkSize)}clearLastData(){this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0)}setBoundedData(t){if(t=s(t),this.lastBoundedData===t)return;if(this.lastBoundedData=t,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.chunkThreshold>=t.length)return void this.callback({inserts:t,bounded:!0});this.callback({inserts:t.slice(0,this.chunkSize),bounded:!0,totalSize:t.length});let e=this.chunkSize;const n=()=>{if(e>=t.length)return void(this.chunkTimer=0);if(t!==this.lastBoundedData)return void(this.chunkTimer=0);const s=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,s),bounded:!1}),e=s,this.chunkTimer=t.length>e?requestAnimationFrame(n):0};this.chunkTimer=requestAnimationFrame(n)}setReplacementData(t){if(t=s(t),this.lastBoundedData=t,this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.pushBuffer=[],this.flushScheduled=!1,this.chunkThreshold>=t.length)return void this.callback({inserts:t,bounded:!0,preserveCategoryOrder:!0});this.callback({inserts:t.slice(0,this.chunkSize),bounded:!0,preserveCategoryOrder:!0,totalSize:t.length});let e=this.chunkSize;const n=()=>{if(e>=t.length)return void(this.chunkTimer=0);if(t!==this.lastBoundedData)return void(this.chunkTimer=0);const s=Math.min(e+this.chunkSize,t.length);this.callback({inserts:t.slice(e,s),bounded:!1}),e=s,this.chunkTimer=t.length>e?requestAnimationFrame(n):0};this.chunkTimer=requestAnimationFrame(n)}flushPushBuffer(){if(this.flushScheduled=!1,0===this.pushBuffer.length)return;const t=this.pushBuffer;this.pushBuffer=[],this.callback({inserts:t,bounded:!1})}scheduleFlush(){this.flushScheduled||(this.flushScheduled=!0,queueMicrotask(()=>this.flushPushBuffer()))}push(t){null!=t&&"object"==typeof t&&(this.pushBuffer.push(t),this.scheduleFlush())}pushMany(t){if(0===t.length)return;let e=0;for(let n=0;t.length>n;n++){const s=t[n];null!=s&&"object"==typeof s&&(this.pushBuffer.push(s),e++)}0!==e&&this.scheduleFlush()}flush(){this.flushPushBuffer()}clear(){this.chunkTimer&&(cancelAnimationFrame(this.chunkTimer),this.chunkTimer=0),this.lastBoundedData=null,this.pushBuffer=[],this.flushScheduled=!1}};function c(t,e){return t===e}function a(t,e){if("function"==typeof t)return e=>+t(e);const n=t||e;return t=>+t[n]}function f(t,e){if("function"==typeof t)return t;const n=t||e;return t=>t[n]}function y(t,e){return"function"==typeof t?t:t?e=>e[t]+"":e?t=>t[e]+"":void 0}function d(t,e,n,s){return"function"==typeof t?t({size:e,margin:n,scales:s}):t}function m(t,e,n,s){return"string"==typeof t?{key:t,fn:null}:"function"==typeof t?{key:n,fn:t}:"string"==typeof e?{key:e,fn:null}:"function"==typeof e?{key:s,fn:e}:{key:void 0,fn:null}}function p(t,e,n){return s=>{if(!s||!n||!t.fn&&!e.fn)return s;let i=!1;const o=s.map(n=>{const s=t.fn&&t.key&&!(t.key in n),o=e.fn&&e.key&&!(e.key in n);if(!s&&!o)return n;i=!0;const r={...n};return s&&(r[t.key]=t.fn(n)),o&&(r[e.key]=e.fn(n)),r});return i?o:s}}function k(t){return new Set(Array.isArray(t)?t:[t])}function g(t,e,n){return"exact"===n?function(t,e){const n=t.domain(),s=n[0],i=n[n.length-1],o=s instanceof Date,r=s instanceof Date?s.getTime():s,l=i instanceof Date?i.getTime():i;if(2>e||r===l)return o?[new Date(r),new Date(l)]:[r,l];const h=(l-r)/(e-1),u=Array(e);for(let t=0;e>t;t++){const n=t===e-1?l:r+t*h;u[t]=o?new Date(n):n}return u}(t,e):t.ticks(e)}var T=new Map;function x(t){try{if(t.path)return new Path2D(t.path);const e=`${t.symbolType??"circle"}:${Math.round(t.size)}`;let n=T.get(e);return n||(n=new Path2D(l(t.symbolType,t.size)),T.size>256&&T.clear(),T.set(e,n)),n}catch{return null}}var b=(t,e)=>{const n=t.globalAlpha;for(const s of e){if("symbol"!==s.type)continue;const e=s;if(0>=e.size)continue;const i=x(e);if(!i)continue;t.save(),t.translate(e.x,e.y),e.rotation&&t.rotate(e.rotation);const o=(e.style.opacity??1)*(e._decayOpacity??1);e.style.fill&&(t.globalAlpha=n*o*(e.style.fillOpacity??1),t.fillStyle=r(t,e.style.fill,"#4e79a7"),t.fill(i)),e.style.stroke&&"none"!==e.style.stroke&&(t.globalAlpha=n*o,t.strokeStyle=r(t,e.style.stroke,e.style.stroke),t.lineWidth=e.style.strokeWidth??1,t.stroke(i)),t.restore()}t.globalAlpha=n};function w(t,e){const{x:s,y:i,w:o,h:r}=e,{tl:l,tr:h,br:u,bl:c}=n(e);t.beginPath(),t.moveTo(s+l,i),t.lineTo(s+o-h,i),h>0&&t.arcTo(s+o,i,s+o,i+h,h),t.lineTo(s+o,i+r-u),u>0&&t.arcTo(s+o,i+r,s+o-u,i+r,u),t.lineTo(s+c,i+r),c>0&&t.arcTo(s,i+r,s,i+r-c,c),t.lineTo(s,i+l),l>0&&t.arcTo(s,i,s+l,i,l),t.closePath()}function v(t){switch(t.roundedEdge){case"bottom":return{x0:t.x,y0:t.y+t.h,x1:t.x,y1:t.y};case"right":return{x0:t.x+t.w,y0:t.y,x1:t.x,y1:t.y};case"left":return{x0:t.x,y0:t.y,x1:t.x+t.w,y1:t.y};default:return{x0:t.x,y0:t.y,x1:t.x,y1:t.y+t.h}}}var S=(n,s,l,h)=>{const u=s.filter(t=>"rect"===t.type);for(const s of u){if(null!=s.style.opacity&&(n.globalAlpha=s.style.opacity),s.style.icon)F(n,s);else if(s.cornerRadii&&i(s.cornerRadii)){const t=r(n,s.style.fill,o(n,"var(--semiotic-primary, #007bff)")),i=v(s),l=s.fillGradient&&"string"==typeof t?e(n,s.fillGradient,t,i.x0,i.y0,i.x1,i.y1):null;n.fillStyle=l||t,w(n,s),n.fill(),s.style.stroke&&"none"!==s.style.stroke&&(n.strokeStyle=o(n,s.style.stroke)||s.style.stroke,n.lineWidth=s.style.strokeWidth||1,n.stroke())}else if(s.roundedTop&&s.roundedTop>0){const t=r(n,s.style.fill,o(n,"var(--semiotic-primary, #007bff)")),i=v(s),l=s.fillGradient&&"string"==typeof t?e(n,s.fillGradient,t,i.x0,i.y0,i.x1,i.y1):null;n.fillStyle=l||t;const h=Math.min(s.roundedTop,s.w/2,s.h/2);n.beginPath();const{x:u,y:c,w:a,h:f}=s;switch(s.roundedEdge){case"right":n.moveTo(u,c),n.lineTo(u+a-h,c),n.arcTo(u+a,c,u+a,c+h,h),n.lineTo(u+a,c+f-h),n.arcTo(u+a,c+f,u+a-h,c+f,h),n.lineTo(u,c+f);break;case"left":n.moveTo(u+a,c),n.lineTo(u+h,c),n.arcTo(u,c,u,c+h,h),n.lineTo(u,c+f-h),n.arcTo(u,c+f,u+h,c+f,h),n.lineTo(u+a,c+f);break;case"bottom":n.moveTo(u,c),n.lineTo(u+a,c),n.lineTo(u+a,c+f-h),n.arcTo(u+a,c+f,u+a-h,c+f,h),n.lineTo(u+h,c+f),n.arcTo(u,c+f,u,c+f-h,h);break;default:n.moveTo(u,c+f),n.lineTo(u,c+h),n.arcTo(u,c,u+h,c,h),n.lineTo(u+a-h,c),n.arcTo(u+a,c,u+a,c+h,h),n.lineTo(u+a,c+f)}n.closePath(),n.fill(),s.style.stroke&&"none"!==s.style.stroke&&(n.strokeStyle=o(n,s.style.stroke)||s.style.stroke,n.lineWidth=s.style.strokeWidth||1,n.stroke())}else{const t=r(n,s.style.fill,o(n,"var(--semiotic-primary, #007bff)")),i=v(s),l=s.fillGradient&&"string"==typeof t?e(n,s.fillGradient,t,i.x0,i.y0,i.x1,i.y1):null;n.fillStyle=l||t,n.fillRect(s.x,s.y,s.w,s.h),s.style.stroke&&"none"!==s.style.stroke&&(n.strokeStyle=o(n,s.style.stroke)||s.style.stroke,n.lineWidth=s.style.strokeWidth||1,n.strokeRect(s.x,s.y,s.w,s.h))}t(n,s),n.globalAlpha=1}};function F(t,e){const n=e.style.icon,s=e.style.iconPadding||2,i=Math.min(e.w,e.h)-s;if(0>=i)return;const o=e.h>e.w;if(t.save(),t.beginPath(),t.rect(e.x,e.y,e.w,e.h),t.clip(),o){const o=i+s,r=e.x+(e.w-i)/2;for(let s=e.y+e.h-i;s>=e.y-i;s-=o)t.drawImage(n,r,s,i,i)}else{const o=i+s,r=e.y+(e.h-i)/2;for(let s=e.x;e.x+e.w>s;s+=o)t.drawImage(n,s,r,i,i)}t.restore()}function A(t,e,n,s,i,o){const r=[];for(const i of t){const t=n(i),o=s(i);Number.isFinite(t)&&Number.isFinite(o)&&r.push({px:e.x(t),py:e.y(o),rawY:o,d:i})}r.sort((t,e)=>t.px-e.px);const l=Array(r.length),h=Array(r.length),u=Array(r.length);for(let t=0;r.length>t;t++){const e=r[t];l[t]=[e.px,e.py],h[t]=e.rawY,u[t]=e.d}return{type:"line",path:l,rawValues:h,style:i,datum:u,group:o}}function _(t,e,n,s,i,o,r,l){const h=[];for(const o of t){const t=n(o),r=s(o);if(!Number.isFinite(t)||!Number.isFinite(r))continue;const u=e.x(t),c=l?l(o):i;h.push({px:u,topY:e.y(r),botY:e.y(c)})}h.sort((t,e)=>t.px-e.px);const u=Array(h.length),c=Array(h.length);for(let t=0;h.length>t;t++){const e=h[t];u[t]=[e.px,e.topY],c[t]=[e.px,e.botY]}return{type:"area",topPath:u,bottomPath:c,style:o,datum:t,group:r}}function B(t,e,n,s){const i=new Map;if("silhouette"===s)for(const s of t){let t=0;for(const i of e)t+=n(i,s)||0;i.set(s,-t/2)}else if("wiggle"===s){t.length>0&&i.set(t[0],0);for(let s=1;t.length>s;s++){const o=t[s-1],r=t[s];let l=0,h=0,u=0;for(const t of e){const e=n(t,r)||0;l+=(2*u+e)*(e-(n(t,o)||0)),h+=e,u+=e}const c=i.get(o)??0;i.set(r,c-(h>0?l/(2*h):0))}if(t.length>0){let s=0;for(const o of t){let t=0;for(const s of e)t+=n(s,o)||0;s+=(i.get(o)??0)+t/2}const o=s/t.length;for(const e of t)i.set(e,(i.get(e)??0)-o)}}else for(const e of t)i.set(e,0);return i}function z(t,e,n){let s=0,i=0;for(const o of t){let t=0,r=0;for(const s of e){const e=n(s,o)||0;0>e?r+=e:t+=e}s>r&&(s=r),t>i&&(i=t)}return[s,i]}function D(t,e,n,s,i,o,r,l="zero"){const h=new Set;for(const e of t)for(const t of e.data){const e=n(t);Number.isFinite(e)&&h.add(e)}const u=Array.from(h).sort((t,e)=>t-e),c=new Map;for(const e of t){const t=new Map;for(const i of e.data){const e=n(i),o=s(i);Number.isFinite(e)&&Number.isFinite(o)&&t.set(e,(t.get(e)||0)+o)}c.set(e.key,t)}let a;if(o){a=new Map;for(const e of u){let n=0;for(const s of t)n+=c.get(s.key)?.get(e)||0;a.set(e,n||1)}}const f=B(u,t.map(t=>t.key),(t,e)=>c.get(t)?.get(e)||0,l),y="diverging"===l&&!o,d=[],m=new Map,p=new Map,k=new Map,g=new Map;for(const t of u)p.set(t,f.get(t)??0),k.set(t,0),g.set(t,0);for(const n of t){const t=c.get(n.key),s=new Map;let l=[],h=[];const f=()=>{if(l.length>=2){const t={type:"area",topPath:l,bottomPath:h,style:i(n.key,n.data[0]),datum:n.data,group:n.key};r&&(t.curve=r),d.push(t)}l=[],h=[]};for(const n of u){const i=t.has(n);let r,u,c=i?t.get(n):0;if(o&&i&&(c/=a.get(n)),!i||!Number.isFinite(c)||0===c){f();continue}y?c>0?(r=k.get(n),u=r+c,k.set(n,u)):(r=g.get(n),u=r+c,g.set(n,u)):(r=p.get(n),u=r+c,p.set(n,u));const d=e.x(n);h.push([d,e.y(r)]),l.push([d,e.y(u)]),s.set(n,u)}f(),m.set(n.key,s)}return{nodes:d,stackedTops:m}}function M(t,e,n,s,i,o,r){const l=n(t),h=s(t);if(!Number.isFinite(l)||!Number.isFinite(h))return null;const u={type:"point",x:e.x(l),y:e.y(h),r:i,style:o,datum:t};return void 0!==r&&(u.pointId=r),u}function P(t,e,n,s,i,o,r,l){const h=n(t),u=s(t);if(!Number.isFinite(h)||!Number.isFinite(u))return null;const c={type:"symbol",x:e.x(h),y:e.y(u),size:i,symbolType:o,style:r,datum:t};return void 0!==l&&(c.pointId=l),c}function N(t,e,n,s,i,o,r){return{type:"rect",x:t,y:e,w:n,h:s,style:i,datum:o,group:r}}function W(t,e,n,s,i,o,r){const l={type:"heatcell",x:t,y:e,w:n,h:s,fill:i,datum:o};return r?.showValues&&(l.showValues=!0,l.value=r.value,r.valueFormat&&(l.valueFormat=r.valueFormat)),l}export{u as DataSourceAdapter,h as IncrementalExtent,c as accessorsEquivalent,a as resolveAccessor,f as resolveRawAccessor,y as resolveStringAccessor,k as toIdSet,A as buildLineNode,_ as buildAreaNode,B as computeStackOffsets,z as computeDivergingStackExtent,D as buildStackedAreaNodes,M as buildPointNode,P as buildSymbolNode,N as buildRectNode,W as buildHeatcellNode,g as ticksForMode,d as resolveFrameGraphics,m as resolveAnnotationAccessor,p as buildEnrichAnnotationData,b as symbolCanvasRenderer,S as barCanvasRenderer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{buildRegressionAnnotation as e}from"./chunk-chunk-YCQYG6J5.module.min.js";import{validateArrayData as t}from"./chunk-chunk-JCG72SGW.module.min.js";import{mergeShapeStyle as o,useChartSetup as i,useCustomChartSetup as r,useFrameImperativeHandle as n}from"./chunk-chunk-I6C3KR5H.module.min.js";import{DataSourceAdapter as s,IncrementalExtent as a,accessorsEquivalent as l,barCanvasRenderer as c,buildEnrichAnnotationData as h,buildRectNode as u,resolveAccessor as d,resolveAnnotationAccessor as g,resolveFrameGraphics as m,resolveStringAccessor as p,symbolCanvasRenderer as f,ticksForMode as y,toIdSet as v}from"./chunk-chunk-AZJUDQRM.module.min.js";import{RingBuffer as b,compactTimestampBufferForRemoval as x,computePulseIntensity as w,createTimestampBufferForData as A,ensureRingBufferCapacity as k,hasActivePulses as S,pointCanvasRenderer as _,pushWithTimestamp as C,refreshIdlePulse as P,setPulseState as R,useLegendCategoryEmission as M,useOrdinalKeyboardNavigation as L,useSemanticFrameInteractions as I}from"./chunk-chunk-M7VYYHCE.module.min.js";import{StalenessBadge as T,attachUpdateResultStore as H,buildBaseMetadataProps as B,buildCustomBehaviorProps as O,buildDatumIndexMap as F,buildOrdinalTooltip as E,buildTooltipProps as N,composeOverlays as D,computeDecayOpacity as W,createCustomLayoutFailureDiagnostic as j,findHitPointInQuadtree as z,getHitRadius as G,glyphCanvasRenderer as V,hitTestRect as $,normalizeAngle as q,paintSceneWithBackend as X,renderPathPulse as Y,renderSceneWithBackend as Q,useConfigSync as K,useLayoutSelectionSync as Z,useStableShallow as U,useStalenessCheck as J,warnCustomLayoutDiagnostics as ee}from"./chunk-chunk-A63CTACR.module.min.js";import{wrapWithCustomLayoutSelection as te}from"./chunk-chunk-5UKL5W76.module.min.js";import{makeRuleValueResolver as oe,resolveStyleRules as ie}from"./chunk-chunk-EMO5NUGE.module.min.js";import{buildResolveColor as re,resolveCustomLayoutPalette as ne}from"./chunk-chunk-SANERMIZ.module.min.js";import{AccessibleDataTable as se,AriaLiveTooltip as ae,CanvasFrameBackground as le,FlippingTooltip as ce,FocusRing as he,STREAMING_PALETTE as ue,SYMBOL_SEQUENCE as de,SceneRevisionDiagnosticsObserver as ge,ScreenReaderSummary as me,SkipToTableLink as pe,TITLE_BASELINE as fe,UpdateResultTracker as ye,annotationLayout as ve,annularSectorPath as be,buildGaugeGradientGeometry as xe,buildHoverData as we,coerceCanvasFill as Ae,computeCanvasAriaLabel as ke,computeEasing as Se,computeRawProgress as _e,createColorScale as Ce,createDefaultAnnotationRules as Pe,createHatchPattern as Re,createLegend as Me,defaultTooltipStyle as Le,filterSparseArray as Ie,getColor as Te,getDevicePixelRatio as He,getSize as Be,interpolateBrBG as Oe,interpolatePRGn as Fe,interpolatePiYG as Ee,interpolateRdBu as Ne,interpolateRdYlBu as De,interpolateRdYlGn as We,interpolateSpectral as je,isAnnotationActivationTarget as ze,isServerEnvironment as Ge,lerp as Ve,normalizeLinkedBrush as $e,normalizeTooltip as qe,now as Xe,observationInputType as Ye,ordinalSceneNodeToSVG as Qe,parseCanvasColor as Ke,renderAnnotationPass as Ze,renderLegendFromConfig as Ue,resolveCSSColor as Je,resolveCanvasFill as et,resolveDefaultFill as tt,smartTooltipEntries as ot,symbolRadius as it,useAnnotationActivationOptions as rt,useBrushSelection as nt,useCategoryColors as st,useChartMode as at,useFrame as lt,useFrameCanvasHost as ct,useLinkedChartCategories as ht,useSceneRevisionDiagnostics as ut,useSortedData as dt,useThemeCategorical as gt,useThemeDiverging as mt,wrapStyleWithSelection as pt}from"./chunk-chunk-6HSGDMTA.module.min.js";import{getMax as ft,getMinMax as yt}from"./chunk-chunk-JJ2OOIET.module.min.js";import{resolveThemeSemanticColors as vt}from"./chunk-chunk-WCX6U47H.module.min.js";import{glyphHitGeometry as bt}from"./chunk-chunk-KTWEBFMX.module.min.js";import{ChartError as xt,SafeRender as wt,useHydration as At,useWasHydratingFromSSR as kt,warnMissingField as St}from"./chunk-chunk-ZCNBUZPL.module.min.js";import{useRef as _t,useState as Ct,useEffect as Pt,useMemo as Rt,useCallback as Mt,useImperativeHandle as Lt,forwardRef as It,memo as Tt}from"react";import{scaleBand as Ht,scaleLinear as Bt}from"d3-scale";var Ot=class{constructor(){this.colorSchemeMap=new Map,this.colorSchemeIndex=0}resetColors(){this.colorSchemeMap.clear(),this.colorSchemeIndex=0}resolvePieceStyle(e,t,o){if(t&&"function"==typeof e.pieceStyle){const i=e.pieceStyle(t,o);return i&&!i.fill&&o?{...i,fill:this.getColorFromScheme(e,o)}:i}return e.pieceStyle&&"object"==typeof e.pieceStyle?e.pieceStyle:e.barColors&&o?{fill:e.barColors[o]||"#007bff"}:{fill:o?this.getColorFromScheme(e,o):"#007bff"}}resolveSummaryStyle(e,t,o){return t&&"function"==typeof e.summaryStyle?e.summaryStyle(t,o):e.summaryStyle&&"object"==typeof e.summaryStyle?e.summaryStyle:{fill:"#007bff",fillOpacity:.6,stroke:"#007bff",strokeWidth:1}}getColorFromScheme(e,t){const o=this.colorSchemeMap.get(t);if(o)return o;const i=Array.isArray(e.colorScheme)?e.colorScheme:e.themeCategorical||ue,r=i[this.colorSchemeIndex%i.length];return this.colorSchemeIndex++,this.colorSchemeMap.set(t,r),r}};function Ft(e){const t=e.getSymbol;if(!t)return null;const o=e.config.symbolMap,i=new Map;let r=0;return e=>{const n=t(e)+"",s=o?.[n];if(s)return s;let a=i.get(n);return a||(a=de[r%de.length],r++,i.set(n,a)),a}}function Et(e,t,o,i,r,n,s){e.push(t?{type:"symbol",x:i,y:r,size:Math.PI*n*n,symbolType:t(o),style:s,datum:o}:{type:"point",x:i,y:r,r:n,style:s,datum:o})}function Nt(e,t){const{columns:o,config:i,resolvePieceStyle:r}=e,n=[],s=Math.min(t.width,t.height)/2-4,a="donut"===i.chartType?i.innerRadius||60:0,l=-Math.PI/2+(i.startAngle||0)*Math.PI/180,c=null!=i.sweepAngle?i.sweepAngle*Math.PI/180:2*Math.PI,h=null!=i.sweepAngle&&360>i.sweepAngle,u=Object.values(o),d=u.some(e=>{const t=e.pieceData[0];return t&&("number"==typeof t._pct||"number"==typeof t._pctStart||null!=t._roundedEnds)}),g=h&&!d&&u.length>1&&(i.cornerRadius??0)>0;for(let e=0;u.length>e;e++){const t=u[e],o=t.pieceData[0],h="number"==typeof o?._pctStart?o._pctStart:t.pctStart,d=l+h*c,m=l+(h+("number"==typeof o?._pct?o._pct:t.pct))*c,p=r(t.pieceData[0],t.name),f=0===e,y=e===u.length-1,v={type:"wedge",cx:0,cy:0,innerRadius:a,outerRadius:s,startAngle:d,endAngle:m,...i.cornerRadius&&{cornerRadius:i.cornerRadius},style:p,datum:o?._nonInteractive?null:t.pieceData,category:t.name};o?._roundedEnds?v.roundedEnds=o._roundedEnds:g&&(v.roundedEnds={start:f,end:y}),o?._gradientBand&&(v._gradientBand=o._gradientBand),n.push(v)}return n}import{quantile as Dt}from"d3-array";function Wt(e){const t=e.length,o=e[0],i=e[t-1];return{n:t,min:o,q1:Dt(e,.25)??o,median:Dt(e,.5)??(o+i)/2,q3:Dt(e,.75)??i,max:i,mean:e.reduce((e,t)=>e+t,0)/t}}import{scaleLinear as jt}from"d3-scale";var zt={bar:function(e,t){const{scales:o,columns:i,config:r,getR:n,getStack:s,resolvePieceStyle:a}=e,{r:l,projection:c}=o,h=[],d="vertical"===c,g="horizontal"===c,m=r.normalize,p=[];if(s){const e=new Set;for(const t of Object.values(i))for(const o of t.pieceData){const t=s(o);e.has(t)||(e.add(t),p.push(t))}}else p.push("_default");for(const e of Object.values(i)){const t=new Map;for(const o of e.pieceData){const e=s?s(o):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const i=t.get(e);i.total+=n(o),i.pieces.push(o)}let o=0;if(m)for(const e of t.values())o+=Math.abs(e.total);let i=0,r=0;for(const n of p){const c=t.get(n);if(!c)continue;let p=c.total;m&&o>0&&(p/=o);const f=a(c.pieces[0],s?n:e.name),y={...c.pieces[0],__aggregateValue:c.total,__pieceCount:c.pieces.length,category:e.name};if(d){const t=l(0>p?r:i+p),o=0>p?l(r+p)-l(r):l(i)-l(i+p);h.push(u(e.x,t,e.width,Math.abs(o),f,y,n)),0>p?r+=p:i+=p}else if(g){const t=l(0>p?r+p:i),o=0>p?l(r)-l(r+p):l(i+p)-l(i);h.push(u(t,e.x,Math.abs(o),e.width,f,y,n)),0>p?r+=p:i+=p}}}const f="vertical"===c,y=r.roundedTop&&r.roundedTop>0?Math.max(0,r.roundedTop):0;for(const e of h){if("rect"!==e.type)continue;const t=e.datum?.__aggregateValue??0;e.roundedEdge=f?0>t?"bottom":"top":0>t?"left":"right",r.gradientFill&&(e.fillGradient=r.gradientFill)}if(y>0){const e=new Map;for(const t of h){if("rect"!==t.type)continue;const o=t.datum?.category||"";e.has(o)||e.set(o,[]),e.get(o).push(t)}for(const t of e.values()){if(0===t.length)continue;const e=t.filter(e=>(e.datum?.__aggregateValue??0)>=0),o=t.filter(e=>0>(e.datum?.__aggregateValue??0));e.length>0&&(e.reduce(f?(e,t)=>t.y>e.y?e:t:(e,t)=>e.x+e.w>t.x+t.w?e:t).roundedTop=y),o.length>0&&(o.reduce(f?(e,t)=>e.y+e.h>t.y+t.h?e:t:(e,t)=>t.x>e.x?e:t).roundedTop=y)}}return h},clusterbar:function(e,t){const{scales:o,columns:i,config:r,getR:n,getGroup:s,resolvePieceStyle:a}=e,{r:l,projection:c}=o,h=[],d="vertical"===c,g=[],m=new Set;for(const e of Object.values(i))for(const t of e.pieceData){const e=s?s(t):"_default";m.has(e)||(m.add(e),g.push(e))}const p=g.length||1;for(const e of Object.values(i)){const t=e.width/p,o=.2*t,i=t-o,r=new Map;for(const t of e.pieceData){const e=s?s(t):"_default";r.has(e)||r.set(e,[]),r.get(e).push(t)}for(let s=0;g.length>s;s++){const c=r.get(g[s])||[];for(const r of c){const c=n(r),m=a(r,g[s]);if(d){const n=e.x+s*t+o/2,a=l(0),d=l(c);h.push(u(n,Math.min(a,d),i,Math.abs(a-d),m,r,g[s]))}else{const n=e.x+s*t+o/2,a=l(0),d=l(c);h.push(u(Math.min(a,d),n,Math.abs(d-a),i,m,r,g[s]))}}}}const f=r.roundedTop&&r.roundedTop>0?Math.max(0,r.roundedTop):0;for(const e of h){if("rect"!==e.type)continue;if(null==e.datum)continue;const t=n(e.datum);f>0&&(e.roundedTop=f),e.roundedEdge=d?0>t?"bottom":"top":0>t?"left":"right",r.gradientFill&&(e.fillGradient=r.gradientFill)}return h},point:function(e,t){const{scales:o,columns:i,getR:r,multiScales:n,resolvePieceStyle:s}=e,{r:a,projection:l}=o,c=[],h="vertical"===l,u="radial"===l,d=n.length>0,g=Ft(e),m=2*Math.PI,p=-Math.PI/2;for(const e of Object.values(i))for(const t of e.pieceData){const o=t.__rIndex??0,i=t.__rValue??r(t),l=d&&n[o]||a,f=s(t,e.name),y=f.r||5;let v,b;if(u){const t=p+(e.pctStart+e.pct/2)*m,o=l(i);v=Math.cos(t)*o,b=Math.sin(t)*o}else h?(v=e.middle,b=l(i)):(v=l(i),b=e.middle);Et(c,g,t,v,b,y,f)}return c},swarm:function(e,t){const{scales:o,columns:i,getR:r,resolvePieceStyle:n}=e,{r:s,projection:a}=o,l=[],c="vertical"===a,h=Ft(e);for(const e of Object.values(i)){const t=e.width/2;for(let o=0;e.pieceData.length>o;o++){const i=e.pieceData[o],a=r(i),u=n(i,e.name),d=u.r||4,g=(7919*o%100/100-.5)*t*.8;Et(l,h,i,c?e.middle+g:s(a),c?s(a):e.middle+g,d,u)}}return l},pie:Nt,donut:Nt,boxplot:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a,projection:l}=o,c=[],h="vertical"===l,u=!1!==r.showOutliers;for(const t of Object.values(i)){const o=t.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(0===o.length)continue;const i=o[0],r=o[o.length-1],l=Dt(o,.25)??i,d=Dt(o,.5)??(i+r)/2,g=Dt(o,.75)??r,m=g-l,p=l-1.5*m,f=g+1.5*m,y=o.find(e=>e>=p)??i,v=[...o].reverse().find(e=>f>=e)??r,b=s(t.pieceData[0],t.name),x=[];if(u)for(const e of t.pieceData){const o=n(e);if(p>o||o>f){const i=h?t.middle:a(o),r=h?a(o):t.middle;x.push({px:i,py:r,value:o,datum:e})}}if(c.push({type:"boxplot",x:h?t.middle:0,y:h?0:t.middle,projection:h?"vertical":"horizontal",columnWidth:.6*t.width,minPos:a(y),q1Pos:a(l),medianPos:a(d),q3Pos:a(g),maxPos:a(v),stats:{n:o.length,min:y,q1:l,median:d,q3:g,max:v,mean:o.reduce((e,t)=>e+t,0)/o.length},style:b,datum:t.pieceData,category:t.name,outliers:x}),u)for(const t of x)c.push({type:"point",x:t.px,y:t.py,r:3,style:{fill:b.fill||e.config.themeSemantic?.secondary||"#999",opacity:.6},datum:t.datum})}return c},violin:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a,projection:l}=o,c=[],h="vertical"===l,u=r.bins||20,d=!1!==r.showIQR;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;const o=t[0],i=t[t.length-1],r=(i-o)/u||1,l=Array(u).fill(0);for(const e of t)l[Math.min(Math.floor((e-o)/r),u-1)]++;const g=ft(l,1),m=e.width/2*.9;let p;if(h){p=`M ${e.middle} ${a(o)}`;for(let t=0;u>t;t++){const i=a(o+(t+.5)*r);p+=` L ${e.middle+l[t]/g*m} ${i}`}p+=` L ${e.middle} ${a(i)}`;for(let t=u-1;t>=0;t--){const i=a(o+(t+.5)*r);p+=` L ${e.middle-l[t]/g*m} ${i}`}p+=" Z"}else{p=`M ${a(o)} ${e.middle}`;for(let t=0;u>t;t++)p+=` L ${a(o+(t+.5)*r)} ${e.middle-l[t]/g*m}`;p+=` L ${a(i)} ${e.middle}`;for(let t=u-1;t>=0;t--)p+=` L ${a(o+(t+.5)*r)} ${e.middle+l[t]/g*m}`;p+=" Z"}const f=s(e.pieceData[0],e.name);let y;if(d&&t.length>=4){const r=Dt(t,.25)??o,n=Dt(t,.5)??(o+i)/2,s=Dt(t,.75)??i;y={q1Pos:a(r),medianPos:a(n),q3Pos:a(s),centerPos:e.middle,isVertical:h}}const v=h?{x:e.x,y:Math.min(a(i),a(o)),width:e.width,height:Math.abs(a(i)-a(o))}:{x:Math.min(a(o),a(i)),y:e.x,width:Math.abs(a(i)-a(o)),height:e.width};c.push({type:"violin",pathString:p,translateX:0,translateY:0,bounds:v,iqrLine:y,stats:Wt(t),style:f,datum:e.pieceData,category:e.name})}return c},histogram:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a}=o,l=[],c=r.bins||25,h=r.normalize,d=a.domain?.(),g=d?+d[0]:void 0,m=d?+d[1]:void 0;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e));if(0===t.length)continue;const[o,i]=yt(t),r=null!=g&&isFinite(g)?g:o,d=null!=m&&isFinite(m)?m:i,p=(d-r)/c||1,f=Array(c).fill(0);for(const e of t)r>e||e>d||f[Math.min(Math.floor((e-r)/p),c-1)]++;const y=t.length,v=ft(f,1),b=s(e.pieceData[0],e.name);for(let t=0;c>t;t++){if(0===f[t])continue;const o=(h?f[t]/y:f[t]/v)*e.width*.9,i=a(r+t*p),n=a(r+(t+1)*p);l.push(u(Math.min(i,n),e.x+e.width-o,Math.abs(n-i),o,b,{bin:t,count:f[t],range:[r+t*p,r+(t+1)*p],category:e.name},e.name))}}return l},ridgeline:function(e,t){const{scales:o,columns:i,config:r,getR:n,resolveSummaryStyle:s}=e,{r:a,projection:l}=o,c=[],h=r.bins||20,u="horizontal"===l,d=r.amplitude||1.5;for(const e of Object.values(i)){const t=e.pieceData.map(e=>n(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(2>t.length)continue;const o=t[0],i=t[t.length-1],r=(i-o)/h||1,l=Array(h).fill(0);for(const e of t)o>e||e>i||l[Math.min(Math.floor((e-o)/r),h-1)]++;const g=ft(l,1),m=s(e.pieceData[0],e.name),p=e.width*d;let f;if(u){const t=e.x+e.width;f=`M ${a(o)} ${t}`;for(let e=0;h>e;e++)f+=` L ${a(o+(e+.5)*r)} ${t-l[e]/g*p}`;f+=` L ${a(i)} ${t} Z`}else{const t=e.x;f=`M ${t} ${a(o)}`;for(let e=0;h>e;e++){const i=a(o+(e+.5)*r);f+=` L ${t+l[e]/g*p} ${i}`}f+=` L ${t} ${a(i)} Z`}const y=u?{x:Math.min(a(o),a(i)),y:e.x,width:Math.abs(a(i)-a(o)),height:e.width}:{x:e.x,y:Math.min(a(i),a(o)),width:e.width,height:Math.abs(a(i)-a(o))};c.push({type:"violin",pathString:f,translateX:0,translateY:0,bounds:y,stats:Wt(t),style:{...m,fillOpacity:m.fillOpacity??.5},datum:e.pieceData,category:e.name})}return c},timeline:function(e,t){const{scales:o,columns:i,getRawRange:r,resolvePieceStyle:n}=e,{r:s,projection:a}=o,l=[],c="horizontal"===a;for(const e of Object.values(i))for(const t of e.pieceData){const o=r(t);if(!o)continue;const[i,a]=o,h=n(t,e.name);if(c){const o=s(Math.min(i,a)),r=s(Math.max(i,a));l.push(u(o,e.x,r-o,e.width,h,t,e.name))}else{const o=s(Math.max(i,a)),r=s(Math.min(i,a));l.push(u(e.x,o,e.width,r-o,h,t,e.name))}}return l},funnel:function(e,t){const{columns:o,getR:i,getStack:r,resolvePieceStyle:n}=e,s=[],a=t.width/2,l=!1!==e.config.showLabels,c=e.scales.o.domain().map(e=>o[e]).filter(Boolean);if(0===c.length)return s;const h=[],d=new Set;for(const e of c)for(const t of e.pieceData){const e=r?r(t):"_default";d.has(e)||(d.add(e),h.push(e))}const g=h.length>1&&"_default"!==h[0],m=[];let p=0;for(const e of c){const t=new Map;let o=0;for(const n of e.pieceData){const e=r?r(n):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const s=t.get(e),a=i(n);s.total+=a,s.pieces.push(n),o+=a}m.push({col:e,groups:t,stepTotal:o}),g||o>p&&(p=o)}if(g)for(const e of m){let t=0,o=0;for(let i=0;h.length>i;i++){const r=e.groups.get(h[i]);r&&(i%2==0?t+=r.total:o+=r.total)}const i=Math.max(t,o);i>p&&(p=i)}if(0===p)return s;const f=new Map;for(const e of h){const t=m[0].groups.get(e);f.set(e,t?.total??0)}const y=m[0].stepTotal,v=g?.95*a:.9*t.width,b=jt().domain([0,p]).range([0,v]),x=e.config.connectorOpacity??.3;let w=new Map;for(let t=0;m.length>t;t++){const o=m[t],i=o.col,r=0===t,c=i.width,d=.55*c,p=i.x+(c-d)/2,v=new Map;if(g){let e=0;for(const t of h){const i=o.groups.get(t);i&&(e+=b(i.total))}let t=a,c=a;for(let g=0;h.length>g;g++){const m=h[g],y=o.groups.get(m);if(!y)continue;const x=b(y.total),w=g%2==0,A=w?t:c-x;w?t+=x:c-=x;const k=n(y.pieces[0],m),S=f.get(m)??y.total,_={...y.pieces[0],__funnelValue:y.total,__funnelPercent:S>0?y.total/S*100:0,__funnelStep:i.name,__funnelIsFirstStep:r,__aggregateValue:y.total,__pieceCount:y.pieces.length,category:m};l&&(0===g&&(_.__funnelStepLabel=i.name,_.__funnelStepLabelX=a,_.__funnelStepLabelY=p,_.__funnelRowWidth=e),_.__funnelValueLabelX=A+x/2,_.__funnelValueLabelY=p,_.__funnelBarW=x),s.push(u(A,p,x,d,k,_,m)),v.set(m,{x:A,y:p,w:x,h:d})}}else{const e=o.stepTotal,t=b(e),c=a-t/2,g=h[0],m="_default"!==g,f=o.groups.get(g)?.pieces[0]??i.pieceData[0],x=m?g:i.name,w=n(f,x),A=y>0?e/y*100:0,k={...f,__funnelValue:e,__funnelPercent:A,__funnelStep:i.name,__funnelIsFirstStep:r,category:m?g:i.name};l&&(k.__funnelStepLabel=i.name,k.__funnelStepLabelX=a,k.__funnelStepLabelY=p,k.__funnelRowWidth=t,k.__funnelValueLabelX=a,k.__funnelValueLabelY=p,k.__funnelBarW=t),s.push(u(c,p,t,d,w,k,x)),v.set(g,{x:c,y:p,w:t,h:d})}if(t>0&&w.size>0){const t=g?h:[h[0]];for(const r of t){const t=w.get(r),a=v.get(r);if(!t||!a)continue;const l=(()=>{const e=o.groups.get(r);return n(e?e.pieces[0]:i.pieceData[0],"_default"===r?i.name:r)})(),c={type:"trapezoid",points:[[t.x,t.y+t.h],[t.x+t.w,t.y+t.h],[a.x+a.w,a.y],[a.x,a.y]],style:{fill:l.fill||e.config.themeSemantic?.secondary||"#999",opacity:x},datum:o.groups.get(r)?.pieces[0]??i.pieceData[0],category:"_default"===r?i.name:r};s.push(c)}}w=v}return s},"bar-funnel":function(e,t){const{columns:o,getR:i,getStack:r,resolvePieceStyle:n,scales:s}=e,a=[],l=s.o.domain().map(e=>o[e]).filter(Boolean);if(0===l.length)return a;const c=[],h=new Set;for(const e of l)for(const t of e.pieceData){const e=r?r(t):"_default";h.has(e)||(h.add(e),c.push(e))}const d=c.length>1&&"_default"!==c[0],g=[];for(const e of l){const t=new Map;let o=0;for(const n of e.pieceData){const e=r?r(n):"_default";t.has(e)||t.set(e,{total:0,pieces:[]});const s=t.get(e),a=i(n);s.total+=a,s.pieces.push(n),o+=a}g.push({col:e,groups:t,stepTotal:o})}const m=new Map;for(const e of c){const t=g[0]?.groups.get(e);m.set(e,t?.total??0)}const p=s.r,f=d?c.length:1,y=d?.15:0;for(let e=0;g.length>e;e++){const t=g[e],o=t.col,i=0===e,r=e>0?g[e-1]:null,s=o.width/f,l=s*y,h=s-l;for(let e=0;c.length>e;e++){const g=c[e],f=t.groups.get(g);if(!f)continue;const y=f.total,v=m.get(g)??y,b=v>0?y/v*100:0,x=r?.groups.get(g),w=i?0:Math.max(0,(x?.total??y)-y),A=o.x+e*s+l/2,k=p(y),S=p(0)-k,_=n(f.pieces[0],d?g:o.name),C={...f.pieces[0],__barFunnelValue:y,__barFunnelPercent:b,__barFunnelIsFirstStep:i,__barFunnelIsDropoff:!1,__barFunnelStep:o.name,__barFunnelDropoffValue:w,__barFunnelCategory:"_default"===g?void 0:g,category:d?g:o.name,__barFunnelLabelX:A+h/2,__barFunnelLabelY:p(y+w)};if(a.push(u(A,k,h,S,_,C,d?g:o.name)),w>0){const e=p(y+w),t=k-e,i={..._},r={...f.pieces[0],__barFunnelValue:w,__barFunnelPercent:v>0?w/v*100:0,__barFunnelIsFirstStep:!1,__barFunnelIsDropoff:!0,__barFunnelStep:o.name,__barFunnelCategory:"_default"===g?void 0:g,category:d?g:o.name};a.push(u(A,e,h,t,i,r,d?g:o.name))}}}return a},swimlane:function(e,t){const{scales:o,columns:i,getR:r,getStack:n,resolvePieceStyle:s}=e,{r:a,projection:l}=o,c=[],h="horizontal"===l,d=e.config.gradientFill,g=h?"left":"bottom",m=e.config.trackFill;if(m){const e="string"==typeof m?m:m.color,t="string"==typeof m?1:m.opacity??1,[o,r]=a.range(),n=Math.min(o,r),s=Math.abs(r-o);for(const o of Object.values(i)){const i={fill:e,opacity:t},r=h?u(n,o.x,s,o.width,i,null,"__track__"):u(o.x,n,o.width,s,i,null,"__track__");c.push(r)}}const p=e.config.roundedTop&&e.config.roundedTop>0?Math.max(0,e.config.roundedTop):0;for(const e of Object.values(i)){let t=0;const o=c.length;for(const o of e.pieceData){const i=Math.abs(r(o));if(0===i)continue;const l=n?n(o):e.name,m=s(o,l);let p;if(h){const r=a(t),n=a(t+i);p=u(r,e.x,n-r,e.width,m,o,l)}else{const r=a(t+i),n=a(t);p=u(e.x,r,e.width,n-r,m,o,l)}d&&(p.fillGradient=d,p.roundedEdge=g),c.push(p),t+=i}if(p>0&&c.length>o){const e=c.slice(o),t=e[0],i=e[e.length-1];1===e.length?t.cornerRadii={tl:p,tr:p,br:p,bl:p}:h?(t.cornerRadii={tl:p,bl:p},i.cornerRadii={tr:p,br:p}):(t.cornerRadii={bl:p,br:p},i.cornerRadii={tl:p,tr:p})}}return c}},Gt=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Vt=["scene-style","data-paint","accessibility","evidence"],$t=(e,t)=>({retainedData:e,invalidations:t}),qt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Xt=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Yt=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Qt=["scene-geometry","data-paint","accessibility","evidence"],Kt=["scene-style","data-paint","accessibility","evidence"],Zt=[],Ut={chartType:$t("rebuild",qt),runtimeMode:$t("rebuild",qt),categoryAccessor:$t("rebuild",qt),valueAccessor:$t("rebuild",qt),oAccessor:$t("rebuild",qt),rAccessor:$t("rebuild",qt),stackBy:$t("rebuild",qt),groupBy:$t("rebuild",qt),timeAccessor:$t("rebuild",qt),accessorRevision:$t("rebuild",qt),colorAccessor:$t("rebuild",Kt),symbolAccessor:$t("rebuild",Qt),connectorAccessor:$t("rebuild",Qt),dataIdAccessor:$t("rebuild",Qt),projection:$t("preserve",Xt),extentPadding:$t("preserve",Xt),axisExtent:$t("preserve",Xt),rExtent:$t("preserve",Xt),oExtent:$t("preserve",Xt),multiAxis:$t("preserve",Xt),normalize:$t("preserve",Xt),bins:$t("preserve",Xt),oSort:$t("preserve",Yt),barPadding:$t("preserve",Yt),roundedTop:$t("preserve",Yt),baselinePadding:$t("preserve",Yt),innerRadius:$t("preserve",Yt),cornerRadius:$t("preserve",Yt),startAngle:$t("preserve",Yt),sweepAngle:$t("preserve",Yt),trackFill:$t("preserve",Yt),showOutliers:$t("preserve",Yt),showIQR:$t("preserve",Yt),amplitude:$t("preserve",Yt),connectorOpacity:$t("preserve",Yt),showLabels:$t("preserve",Yt),dynamicColumnWidth:$t("rebuild",Yt),customLayout:$t("preserve",Yt),layoutConfig:$t("preserve",Yt),layoutMargin:$t("preserve",Yt),symbolMap:$t("preserve",Qt),pieceStyle:$t("preserve",Kt),summaryStyle:$t("preserve",Kt),connectorStyle:$t("preserve",Kt),gradientFill:$t("preserve",Kt),colorScheme:$t("preserve",Kt),themeCategorical:$t("preserve",Kt),themeSemantic:$t("preserve",Kt),themeSequential:$t("preserve",Kt),themeDiverging:$t("preserve",Kt),barColors:$t("preserve",Kt),decay:$t("preserve",Kt),pulse:$t("preserve",Kt),staleness:$t("preserve",Kt),layoutSelection:$t("preserve",Kt),windowSize:$t("preserve",Zt),windowMode:$t("preserve",Zt),clock:$t("preserve",Zt),transition:$t("preserve",Zt),introAnimation:$t("preserve",Zt),onLayoutError:$t("preserve",Zt)},Jt=$t("preserve",Yt),eo=class{constructor(){this.tracker=new ye}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}},Gt)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Vt):this.recordNoop("restyle")}recordConfig(e){const t=function(e){let t="preserve";const o=new Set;for(const i of e){const e=Ut[i]??Jt;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)o.add(t)}return{retainedData:t,invalidations:o}}(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}};import{quadtree as to}from"d3-quadtree";var oo=class{constructor(e){this.rExtent=new a,this.rExtents=[],this.windowSizeWarned=!1,this.updateResults=new eo,this.rAccessors=[],this.categories=new Set,this._hasStreamingData=!1,this.styleResolver=new Ot,this.timestampBuffer=null,this.activeTransition=null,this.prevPositionMap=new Map,this.exitNodes=[],this.lastIngestTime=0,this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.version=0,this._dataVersion=0,this._bufferArrayCache=null,this._pointQuadtree=null,this._maxPointRadius=0,this._datumIndexCache=null,this._categoryIndexCache=null,this._hasRenderedOnce=!1,this.config=e,this.buffer=new b(e.windowSize),this.getO=p(e.categoryAccessor||e.oAccessor,"category");const t=e.valueAccessor||e.rAccessor;Array.isArray(t)?(this.rAccessors=t.map(e=>d(e,"value")),this.getR=this.rAccessors[0],this.rExtents=t.map(()=>new a)):(this.getR=d(t,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent]),this.getStack=p(e.stackBy),this.getGroup=p(e.groupBy),this.getColor=p(e.colorAccessor),this.getSymbol=p(e.symbolAccessor),this.getConnector=p(e.connectorAccessor),this.getDataId=p(e.dataIdAccessor),e.pulse&&(this.timestampBuffer=new b(e.windowSize))}syncPulseTimestampBuffer(){var e,t,o,i;this.timestampBuffer=(e=!!this.config.pulse,t=this.buffer,o=this.timestampBuffer,i=this.currentTime(),e?null!=o&&o.capacity===t.capacity&&o.size===t.size?o:A(t,i):null)}currentTime(){return this.config.clock?.()??Xe()}ingest(e){const t=this.currentTime();if(this.lastIngestTime=t,this._dataVersion++,e.bounded){this.buffer.clear(),this.rExtent.clear();for(const e of this.rExtents)e.clear();e.preserveCategoryOrder?this._hasStreamingData=!0:this.categories.clear(),this.timestampBuffer&&this.timestampBuffer.clear(),k(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(const o of e.inserts)C(this.buffer,o,this.timestampBuffer,t),this.categories.add(this.getO(o)),this.pushValueExtent(o)}else{this._hasStreamingData=!0;for(const o of e.inserts){const e=C(this.buffer,o,this.timestampBuffer,t);this.categories.add(this.getO(o)),this.pushValueExtent(o),null!=e&&this.evictValueExtent(e)}}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}pushValueExtent(e){if("timeline"===this.config.chartType){const t=this.getRawRange(e);t&&(this.rExtent.push(t[0]),this.rExtent.push(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].push(this.rAccessors[t](e));this.rExtent.push(this.getR(e))}else this.rExtent.push(this.getR(e))}evictValueExtent(e){if("timeline"===this.config.chartType){const t=this.getRawRange(e);t&&(this.rExtent.evict(t[0]),this.rExtent.evict(t[1]))}else if(this.rAccessors.length>1){for(let t=0;this.rAccessors.length>t;t++)this.rExtents[t].evict(this.rAccessors[t](e));this.rExtent.evict(this.getR(e))}else this.rExtent.evict(this.getR(e))}getRawRange(e){const t=this.config.valueAccessor||this.config.rAccessor;if(!t)return null;const o="function"==typeof t?t(e):e[t];return Array.isArray(o)&&o.length>=2?[+o[0],+o[1]]:null}computeScene(e){const{config:t,buffer:o}=this,i=this.scales,r=this.multiScales,n=this.columns;if(0===o.size)return this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,void this.version++;this.rExtent.dirty&&this.rExtent.recalculate(o,this.getR);const s=this.getBufferArray(),a=t.projection||"vertical",l=t.oExtent||this.resolveCategories(s),c=this.computeValueDomain(s,l),h="horizontal"===a,u="radial"===a,d=Math.min(.9,Math.max(0,null!=t.barPadding?t.barPadding/("vertical"===a?e.width:e.height):.1));let g,m;if(u){g=Ht().domain(l).range([0,1]).padding(0);const o=Math.min(e.width,e.height)/2,i=t.innerRadius||0;m=Bt().domain(c).range([i,o])}else h?(g=Ht().domain(l).range([0,e.height]).padding(d),m=Bt().domain(c).range([0,e.width])):(g=Ht().domain(l).range([0,e.width]).padding(d),m=Bt().domain(c).range([e.height,0]));this.scales={o:g,r:m,projection:a},this.multiScales=this.rAccessors.length>1&&t.multiAxis?this.rAccessors.map((i,r)=>{const n=this.rExtents[r];n.dirty&&n.recalculate(o,i);let[s,a]=n.extent;s===1/0&&(s=0,a=1);const l=a-s,c=l>0?l*(t.extentPadding??.05):1;return s-=c,a+=c,s>0&&(s=0),h?Bt().domain([s,a]).range([0,e.width]):Bt().domain([s,a]).range([e.height,0])}):[];let p=s;this.rAccessors.length>1&&(p=s.flatMap(e=>this.rAccessors.map((t,o)=>({...e,__rIndex:o,__rValue:t(e),__rName:this.resolveRAccessorName(o)})))),this.columns=this.buildColumns(p,l,g,a,e),this._customLayoutFailedThisBuild=!1;const f=this.buildSceneNodes(p,e);this._customLayoutFailedThisBuild?!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=i,this.multiScales=r,this.columns=n):(this.scene=[],this.rebuildPointQuadtree()):(this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=f,this.rebuildPointQuadtree(),this.config.decay&&this.applyDecay(this.scene,s),this.config.pulse&&this.applyPulse(this.scene,s),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&this.prevPositionMap.size>0&&this.startTransition(),this.version++)}resolveRAccessorName(e){const t=this.config.valueAccessor||this.config.rAccessor,o=Array.isArray(t)?t[e]:t;return"string"==typeof o?o:"value"+e}resolveCategories(e){const t=this.config.oSort,o="streaming"===this.config.runtimeMode||this._hasStreamingData,i="auto"===t?void 0:t;let r=null;if(o){r=new Set;for(const t of e)r.add(this.getO(t))}const n=r?Array.from(this.categories).filter(e=>r.has(e)):Array.from(this.categories);if(o&&void 0===i){const e=Math.max(50,3*r.size);if(this.categories.size>e){let t=this.categories.size-e;for(const e of this.categories){if(0>=t)break;r.has(e)||(this.categories.delete(e),t--)}}return n}if(!1===i)return n;if("function"==typeof i)return n.sort(i);const s=new Map;for(const t of e){const e=this.getO(t);s.set(e,(s.get(e)||0)+Math.abs(this.getR(t)))}return n.sort("asc"===i?(e,t)=>(s.get(e)||0)-(s.get(t)||0):(e,t)=>(s.get(t)||0)-(s.get(e)||0))}computeValueDomain(e,t){return function(e){const{data:t,chartType:o,projection:i,normalize:r,rExtent:n,extentPadding:s=.05,baselinePadding:a,axisExtent:l,getO:c,getR:h,getStack:u,rawRExtent:d}=e,g=s;if("radial"===i&&("pie"===o||"donut"===o))return[0,1];let m=0,p=0;if("bar"===o&&u&&r)m=0,p=1;else if("bar"===o&&u){const e=new Map,o=new Map;for(const i of t){const t=c(i),r=h(i);0>r?o.set(t,(o.get(t)||0)+r):e.set(t,(e.get(t)||0)+r)}for(const t of e.values())t>p&&(p=t);for(const e of o.values())m>e&&(m=e)}else if("bar"===o){const e=new Map;for(const o of t){const t=c(o),i=h(o);e.set(t,(e.get(t)||0)+i)}for(const t of e.values())t>p&&(p=t),m>t&&(m=t)}else if("swimlane"===o){const e=new Map;for(const o of t){const t=c(o),i=Math.abs(h(o));e.set(t,(e.get(t)||0)+i)}for(const t of e.values())t>p&&(p=t)}else if("clusterbar"===o||"bar-funnel"===o)for(const e of t){const t=h(e);t>p&&(p=t),m>t&&(m=t)}else{const e=d[0],t=d[1];e!==1/0&&(m=e),t!==-1/0&&(p=t)}n&&(null!=n[0]&&(m=n[0]),null!=n[1]&&(p=n[1]));const f="bar"===o||"clusterbar"===o||"bar-funnel"===o||"swimlane"===o;if(f&&null==n?.[0]&&null==n?.[1]&&(m>0&&(m=0),0>p&&(p=0)),"bar-funnel"!==o&&"exact"!==l){const e=p-m,t=e>0?e*g:1,i=f&&!a&&0===m,r=f&&!a&&0===p||"swimlane"===o;null!=n?.[0]||i||(m-=t),null!=n?.[1]||r||(p+=t)}return[m,p]}({data:e,chartType:this.config.chartType,projection:this.config.projection,normalize:this.config.normalize,rExtent:this.config.rExtent,extentPadding:this.config.extentPadding,baselinePadding:this.config.baselinePadding,axisExtent:this.config.axisExtent,getO:this.getO,getR:this.getR,getStack:this.getStack,rawRExtent:this.rExtent.extent})}buildColumns(e,t,o,i,r){return function(e){const{data:t,oExtent:o,oScale:i,projection:r,layout:n,dynamicColumnWidth:s,getO:a,getR:l}=e,c={},h=new Map;for(const e of t){const t=a(e);h.has(t)||h.set(t,[]),h.get(t).push(e)}let u=0;if("radial"===r)for(const e of t)u+=Math.abs(l(e));let d=null;if(s&&"radial"!==r){d=new Map;let e=0;for(const t of o){const o=h.get(t)||[];let i;i="string"==typeof s?o.reduce((e,t)=>e+(Number(t[s])||0),0):s(o),d.set(t,i),e+=i}const t=("horizontal"===r?n.height:n.width)-i.padding()*i.step()*o.length;if(e>0)for(const[o,i]of d)d.set(o,i/e*t)}let g=0,m=0;for(const e of o){const t=h.get(e)||[],o=t.reduce((e,t)=>e+Math.abs(l(t)),0),r=u>0?o/u:0;let n,s;d?(n=m,s=d.get(e)||i.bandwidth(),m+=s+i.padding()*i.step()):(n=i(e)??0,s=i.bandwidth()),c[e]={name:e,x:n,y:0,width:s,middle:n+s/2,padding:i.padding()*i.step(),pieceData:t,pct:r,pctStart:g},g+=r}return c}({data:e,oExtent:t,oScale:o,projection:i,layout:r,dynamicColumnWidth:this.config.dynamicColumnWidth,getO:this.getO,getR:this.getR})}getSceneContext(){return{scales:this.scales,columns:this.columns,config:this.config,getR:this.getR,getStack:this.getStack,getGroup:this.getGroup,getColor:this.getColor,getSymbol:this.getSymbol,getConnector:this.getConnector,getO:this.getO,multiScales:this.multiScales,rAccessors:this.rAccessors,resolvePieceStyle:(e,t)=>this.styleResolver.resolvePieceStyle(this.config,e,t),resolveSummaryStyle:(e,t)=>this.styleResolver.resolveSummaryStyle(this.config,e,t),getRawRange:e=>this.getRawRange(e)}}buildSceneNodes(e,t){if(!this.scales)return[];if(this.config.customLayout){const o=this.buildLayoutContext(e,t);let i;try{i=this.config.customLayout(o)}catch(e){const t=null!==this.lastCustomLayoutResult,o=j("ordinal",e,t,this.version);this.lastCustomLayoutFailure=o,this._customLayoutFailedThisBuild=!0,"production"!==process.env.NODE_ENV&&console.error("[semiotic] ordinal customLayout threw:",e);try{this.config.onLayoutError?.(o)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return t?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[])}this.customLayoutOverlays=i.overlays??null,this.lastCustomLayoutResult=i,this.lastCustomLayoutFailure=null;const r=i.nodes??[];if(this._customRestyle=i.restyle,this.hasCustomRestyle=!!i.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(const e of r)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(r,this.config.layoutSelection??null)}return ee({label:"ordinal customLayout",nodes:r,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),r}this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1;const o=this.getSceneContext(),i=zt[this.config.chartType];let r=i?i(o,t):[];if(this.getConnector&&this.scales){const e=function(e,t){const{scales:o,config:i,getConnector:r,getO:n}=e;if(!r||!o)return[];const s=[],{projection:a}=o,l=new Map;for(const e of t){if("point"!==e.type&&"rect"!==e.type)continue;const t=e.datum;if(!t)continue;const o=r(t);if(!o)continue;let i,s;"point"===e.type?(i=e.x,s=e.y):(i=e.x+e.w/2,s=e.y+("vertical"===a?0:e.h/2)),l.has(o)||l.set(o,[]),l.get(o).push({x:i,y:s,datum:t,category:n(t)})}const c=o.o.domain(),h=i.connectorStyle;for(const[t,o]of l)if(o.length>=2){o.sort((e,t)=>c.indexOf(e.category)-c.indexOf(t.category));for(let i=0;o.length-1>i;i++){const r=o[i],n=o[i+1],a="function"==typeof h?h(r.datum):h||{stroke:e.config.themeSemantic?.border||e.config.themeSemantic?.secondary||"#999",strokeWidth:1,opacity:.5};s.push({type:"connector",x1:r.x,y1:r.y,x2:n.x,y2:n.y,style:a,datum:r.datum,group:t})}}return s}(o,r);r=[...e,...r]}return r}buildLayoutContext(e,t){const o=this.config,i=o.layoutMargin??{top:0,right:0,bottom:0,left:0},r=ne(o.colorScheme,o.themeCategorical,ue),n=this.scales;return{data:e,scales:{o:n.o,r:n.r,projection:n.projection},dimensions:{width:t.width,height:t.height,margin:i,plot:"radial"===n.projection?{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height}:{x:0,y:0,width:t.width,height:t.height}},theme:{semantic:o.themeSemantic??{},categorical:[...r]},resolveColor:re(r,o.colorScheme),config:o.layoutConfig??{},selection:o.layoutSelection??null}}computeDecayOpacity(e,t){const o=this.config.decay;return o&&t>1?W(o,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._dataVersion)return this._datumIndexCache.map;const t=F(e);return this._datumIndexCache={version:this._dataVersion,map:t},t}getCategoryIndexMap(e){if(this._categoryIndexCache&&this._categoryIndexCache.version===this._dataVersion)return this._categoryIndexCache.map;const t=function(e,t){const o="function"==typeof t,i=o?null:t||"category",r=new Map;for(let n=0;e.length>n;n++){const s=e[n],a=o?t(s):s[i],l=r.get(a);l?l.push(n):r.set(a,[n])}return r}(e,this.config.categoryAccessor||this.config.oAccessor);return this._categoryIndexCache={version:this._dataVersion,map:t},t}rebuildPointQuadtree(){const e=function(e){let t=0,o=0;for(const i of e)"point"===i.type&&(t++,i.r>o&&(o=i.r));if(500>=t)return{quadtree:null,maxRadius:o};const i=Array(t);let r=0;for(const t of e)"point"===t.type&&(i[r++]=t);return{maxRadius:o,quadtree:to().x(e=>e.x).y(e=>e.y).addAll(i)}}(this.scene);this._pointQuadtree=e.quadtree,this._maxPointRadius=e.maxRadius}get pointQuadtree(){return this._pointQuadtree}get maxPointRadius(){return this._maxPointRadius}applyDecay(e,t){if(!this.config.decay)return;const o=t.length;if(1>=o)return;const i=this.getDatumIndexMap(t);for(const t of e){if("connector"===t.type||"violin"===t.type||"boxplot"===t.type||"wedge"===t.type)continue;if(!t.datum)continue;const e=i.get(t.datum);if(null==e)continue;const r=this.computeDecayOpacity(e,o);t.style={...t.style,opacity:(t.style?.opacity??1)*r}}}applyPulse(e,t,o=this.currentTime()){return!(!this.config.pulse||!this.timestampBuffer)&&function(e,t,o,i,r,n){const s=e.color??"rgba(255,255,255,0.6)",a=e.glowRadius??4;let l=!1;for(const c of t){if("connector"===c.type||"violin"===c.type||"boxplot"===c.type)continue;if("wedge"===c.type){const t=c.category;if(!t)continue;let i=0;for(const s of r(t)??[]){const t=o.get(s);null!=t&&(i=Math.max(i,w(e,t,n)))}l=R(c,i,s)||l;continue}if(null==c.datum)continue;const t=i.get(c.datum);if(null==t)continue;const h=o.get(t),u=null==h?0:w(e,h,n);l=R(c,u,s,a)||l}return l}(this.config.pulse,e,this.timestampBuffer,this.getDatumIndexMap(t),e=>this.getCategoryIndexMap(t).get(e),o)}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&S(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}synthesizeIntroPositions(){this.prevPositionMap.clear();const e=new Map,t=this.scales?.r(0)??0,o="horizontal"!==this.scales?.projection;let i;for(let r=0;this.scene.length>r;r++){const n=this.scene[r],s=this.getNodeKey(n,e);s&&("rect"===n.type?this.prevPositionMap.set(s,o?{x:n.x,y:t,w:n.w,h:0,opacity:n.style.opacity??1}:{x:t,y:n.y,w:0,h:n.h,opacity:n.style.opacity??1}):"point"===n.type?this.prevPositionMap.set(s,{x:n.x,y:n.y,r:0,opacity:0}):"wedge"===n.type&&(void 0===i&&(i=n.startAngle),this.prevPositionMap.set(s,{x:n.cx,y:n.cy,startAngle:i,endAngle:i,innerRadius:n.innerRadius,outerRadius:n.outerRadius,opacity:0})))}}getNodeKey(e,t){if("point"===e.type){const o=`p:${e.datum?this.getO(e.datum):""}:${e.datum?this.getR(e.datum):0}`,i=t.get(o)||0;return t.set(o,i+1),`${o}:${i}`}return"rect"===e.type?`r:${e.group||""}:${e.datum?.category??""}`:"wedge"===e.type?"w:"+(e.category??""):null}snapshotPositions(){this.prevPositionMap.clear();const e=new Map;for(let t=0;this.scene.length>t;t++){const o=this.scene[t],i=this.getNodeKey(o,e);i&&("point"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,r:o.r,opacity:o.style.opacity}):"rect"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,w:o.w,h:o.h,opacity:o.style.opacity}):"wedge"===o.type&&this.prevPositionMap.set(i,{x:o.cx,y:o.cy,startAngle:o.startAngle,endAngle:o.endAngle,innerRadius:o.innerRadius,outerRadius:o.outerRadius,opacity:o.style.opacity??1}))}}startTransition(){if(!this.config.transition||0===this.prevPositionMap.size)return;const e=this.config.transition.duration??300;if(this.exitNodes.length>0){const e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}let t=!1;const o=new Set,i=new Map;for(let e=0;this.scene.length>e;e++){const r=this.scene[e],n=this.getNodeKey(r,i);if(!n)continue;r._transitionKey=n;const s=this.prevPositionMap.get(n);if("point"===r.type)s?(o.add(n),r._targetOpacity=r.style.opacity??1,(s.x!==r.x||s.y!==r.y||void 0!==s.r&&s.r!==r.r)&&(r._targetX=r.x,r._targetY=r.y,r._targetR=r.r,r.x=s.x,r.y=s.y,void 0!==s.r&&(r.r=s.r),t=!0)):(r._targetOpacity=r.style.opacity??1,r._targetR=r.r,r.r=0,r.style={...r.style,opacity:0},t=!0);else if("rect"===r.type)s?(o.add(n),r._targetOpacity=r.style.opacity??1,s.x===r.x&&s.y===r.y&&s.w===r.w&&s.h===r.h||(r._targetX=r.x,r._targetY=r.y,r._targetW=r.w,r._targetH=r.h,r.x=s.x,r.y=s.y,r.w=s.w??r.w,r.h=s.h??r.h,t=!0)):(r._targetOpacity=r.style.opacity??1,r.style={...r.style,opacity:0},t=!0);else if("wedge"===r.type)if(s)o.add(n),r._targetOpacity=r.style.opacity??1,s.startAngle===r.startAngle&&s.endAngle===r.endAngle||(r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle,r.startAngle=s.startAngle,r.endAngle=s.endAngle,t=!0);else{r._targetOpacity=r.style.opacity??1,r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle;const e=r.startAngle;r.startAngle=e,r.endAngle=e,r.style={...r.style,opacity:0},this.prevPositionMap.set(n,{x:r.cx,y:r.cy,startAngle:e,endAngle:e,innerRadius:r.innerRadius,outerRadius:r.outerRadius,opacity:0}),t=!0}}this.exitNodes=[];for(const[e,i]of this.prevPositionMap)if(!o.has(e)){if(e.startsWith("p:"))this.exitNodes.push({type:"point",x:i.x,y:i.y,r:i.r??3,style:{opacity:i.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))this.exitNodes.push({type:"rect",x:i.x,y:i.y,w:i.w??0,h:i.h??0,style:{opacity:i.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("w:")){const t=((i.startAngle??0)+(i.endAngle??0))/2,o={type:"wedge",cx:i.x,cy:i.y,innerRadius:i.innerRadius??0,outerRadius:i.outerRadius??100,startAngle:i.startAngle??0,endAngle:i.endAngle??0,style:{opacity:i.opacity??1},datum:null,category:e.slice(2),_targetStartAngle:t,_targetEndAngle:t,_targetOpacity:0,_transitionKey:e};this.exitNodes.push(o)}t=!0}this.exitNodes.length>0&&(this.scene=[...this.scene,...this.exitNodes]),t&&(this.activeTransition={startTime:this.currentTime(),duration:e})}advanceTransition(e){if(!this.activeTransition)return!1;const t=_e(e,this.activeTransition),o=Se(t,"linear"===this.config.transition?.easing?"linear":"ease-out-cubic");for(const e of this.scene){const t=e._transitionKey;if(t)if("point"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style.opacity=Ve(i?i.opacity??1:0,e._targetOpacity,o)}const i=this.prevPositionMap.get(t);void 0!==e._targetX&&i&&(e.x=Ve(i.x,e._targetX,o),e.y=Ve(i.y,e._targetY,o)),void 0!==e._targetR&&void 0!==i?.r&&(e.r=Ve(i.r,e._targetR,o))}else if("rect"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style.opacity=Ve(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX)continue;const i=this.prevPositionMap.get(t);if(!i)continue;e.x=Ve(i.x,e._targetX,o),e.y=Ve(i.y,e._targetY,o),void 0!==i.w&&(e.w=Ve(i.w,e._targetW,o),e.h=Ve(i.h,e._targetH,o))}else if("wedge"===e.type){if(void 0!==e._targetOpacity){const i=this.prevPositionMap.get(t);e.style={...e.style,opacity:Ve(i?i.opacity??1:0,e._targetOpacity,o)}}if(void 0!==e._targetStartAngle&&void 0!==e._targetEndAngle){const i=this.prevPositionMap.get(t);i&&void 0!==i.startAngle&&(e.startAngle=Ve(i.startAngle,e._targetStartAngle,o),e.endAngle=Ve(i.endAngle,e._targetEndAngle,o))}}}if(t>=1){for(const e of this.scene)if(void 0!==e._targetOpacity&&(e.style={...e.style||{},opacity:0===e._targetOpacity?0:e._targetOpacity},e._targetOpacity=void 0),"point"===e.type){if(void 0===e._targetX&&void 0===e._targetR)continue;void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY),void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("rect"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0);if(this.exitNodes.length>0){const e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}return this.activeTransition=null,!1}return!0}cancelIntroAnimation(){this.prevPositionMap.clear(),this.activeTransition=null}getBufferArray(){return this._bufferArrayCache?.version!==this._dataVersion&&(this._bufferArrayCache={version:this._dataVersion,data:this.buffer.toArray()}),this._bufferArrayCache.data}getData(){return this.buffer.toArray()}remove(e){if(!this.getDataId)throw Error("remove() requires dataIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();const t=v(e),o=this.getDataId,i=e=>t.has(o(e));x(this.buffer,this.timestampBuffer,i);const r=this.buffer.remove(i);if(0===r.length)return this.updateResults.recordNoop("remove"),r;for(const e of r)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach(e=>this.categories.add(this.getO(e))),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",r.length),r}update(e,t){if(!this.getDataId)throw Error("update() requires dataIdAccessor to be configured");const o=v(e),i=this.getDataId,r=new Set;this.buffer.forEach((e,t)=>{o.has(i(e))&&r.add(t)});const n=this.buffer.update(e=>o.has(i(e)),t);if(0===n.length)return this.updateResults.recordNoop("update"),n;for(const e of n)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach((e,t)=>{this.categories.add(this.getO(e)),r.has(t)&&this.pushValueExtent(e)}),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",n.length),n}clear(){this.buffer.clear(),this.rExtent.clear(),this.categories.clear(),this._hasStreamingData=!1,this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this.scales=null,this.scene=[],this.columns={},this.multiScales=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._pointQuadtree=null,this._maxPointRadius=0,this.styleResolver.resetColors(),this._dataVersion++,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getOAccessor(){return this.getO}getRAccessor(){return this.getR}applyCustomRestyle(e,t){const o=this._customRestyle;if(o)for(const i of e){const e=this._baseStyles.get(i)??i.style??{},r=o(i,t);i.style=r?{...e,...r}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}rebuildAccessorDerivedState(){this.categories.clear(),this.rExtent.clear();for(const e of this.rExtents)e.clear();this._categoryIndexCache=null,this.buffer.forEach(e=>{this.categories.add(this.getO(e)),this.pushValueExtent(e)})}updateConfig(e){const t={...this.config},o=Object.keys(e).filter(o=>e[o]!==t[o]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in e&&e.windowSize!==t.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${t.windowSize} → ${e.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in e&&e.colorScheme!==t.colorScheme||"themeCategorical"in e&&e.themeCategorical!==t.themeCategorical||"colorAccessor"in e&&!l(e.colorAccessor,t.colorAccessor))&&this.styleResolver.resetColors(),("categoryAccessor"in e&&!l(e.categoryAccessor,t.categoryAccessor)||"oAccessor"in e&&!l(e.oAccessor,t.oAccessor))&&(this._categoryIndexCache=null),Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let i=!1;("categoryAccessor"in e||"oAccessor"in e)&&(l(this.config.categoryAccessor||this.config.oAccessor,t.categoryAccessor||t.oAccessor)||(this.getO=p(this.config.categoryAccessor||this.config.oAccessor,"category"),i=!0));let r=!1;if("valueAccessor"in e||"rAccessor"in e){const e=this.config.valueAccessor||this.config.rAccessor,o=t.valueAccessor||t.rAccessor,i=Array.isArray(e)?e:[e],n=Array.isArray(o)?o:[o];if(r=i.length!==n.length||i.some((e,t)=>!l(e,n[t])),r){const e=this.config.valueAccessor||this.config.rAccessor;Array.isArray(e)?(this.rAccessors=e.map(e=>d(e,"value")),this.getR=this.rAccessors[0],this.rExtents=e.map(()=>new a)):(this.getR=d(e,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent])}}"stackBy"in e&&!l(e.stackBy,t.stackBy)&&(this.getStack=null!=this.config.stackBy?p(this.config.stackBy):void 0),"groupBy"in e&&!l(e.groupBy,t.groupBy)&&(this.getGroup=null!=this.config.groupBy?p(this.config.groupBy):void 0),"colorAccessor"in e&&!l(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?p(this.config.colorAccessor):void 0),"symbolAccessor"in e&&!l(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?p(this.config.symbolAccessor):void 0),"connectorAccessor"in e&&!l(e.connectorAccessor,t.connectorAccessor)&&(this.getConnector=null!=this.config.connectorAccessor?p(this.config.connectorAccessor):void 0),(i||r||"accessorRevision"in e&&e.accessorRevision!==t.accessorRevision)&&this.rebuildAccessorDerivedState(),this.updateResults.recordConfig(o)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};function io(e,t,o,i=30,r,n=0){let s=null;if(r){const e=z(r,t,o,i,n);e&&(s={datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(const n of e){let e=null;switch(n.type){case"rect":if(null==n.datum)break;e=ro(n,t,o);break;case"point":if(r)break;e=no(n,t,o,i);break;case"symbol":e=so(n,t,o,i);break;case"glyph":e=ao(n,t,o,i);break;case"wedge":if(null===n.datum)break;e=lo(n,t,o);break;case"boxplot":e=co(n,t,o);break;case"violin":e=ho(n,t,o)}e&&i>e.distance&&(s&&e.distance>=s.distance||(s=e))}return s}function ro(e,t,o){const i=$(t,o,e);return i.hit?{datum:e.datum,x:i.cx,y:e.y,distance:0,category:e.group}:null}function no(e,t,o,i=30){const r=t-e.x,n=o-e.y,s=Math.sqrt(r*r+n*n);return s>G(e.r,i)?null:{datum:e.datum,x:e.x,y:e.y,distance:s}}function so(e,t,o,i=30){const r=t-e.x,n=o-e.y,s=Math.sqrt(r*r+n*n);return s>G(it(e.size),i)?null:{datum:e.datum,x:e.x,y:e.y,distance:s}}function ao(e,t,o,i=30){if(null==e.datum)return null;const r=bt(e.glyph,e.size),n=e.x+r.centerDx,s=e.y+r.centerDy,a=t-n,l=o-s,c=Math.sqrt(a*a+l*l);return c>G(r.radius,i)?null:{datum:e.datum,x:n,y:s,distance:c}}function lo(e,t,o){const i=t-e.cx,r=o-e.cy,n=Math.sqrt(i*i+r*r);if(e.innerRadius>n||n>e.outerRadius)return null;const s=q(Math.atan2(r,i)),a=q(e.startAngle),l=q(e.endAngle);if(!(a>l?s>=a||l>=s:s>=a&&l>=s))return null;const c=(e.startAngle+e.endAngle)/2,h=(e.innerRadius+e.outerRadius)/2;return{datum:e.datum,x:e.cx+Math.cos(c)*h,y:e.cy+Math.sin(c)*h,distance:0,category:e.category}}function co(e,t,o){const i=e.columnWidth/2;if("vertical"===e.projection){if(!(e.x-i>t||t>e.x+i||Math.min(e.minPos,e.maxPos)>o||o>Math.max(e.minPos,e.maxPos)))return{datum:e.datum,x:e.x,y:e.medianPos,distance:0,category:e.category,stats:e.stats}}else{const r=e.y-i,n=e.y+i;if(!(Math.min(e.minPos,e.maxPos)>t||t>Math.max(e.minPos,e.maxPos)||r>o||o>n))return{datum:e.datum,x:e.medianPos,y:e.y,distance:0,category:e.category,stats:e.stats}}return null}function ho(e,t,o){if(!e.bounds)return null;const{x:i,y:r,width:n,height:s}=e.bounds;return i>t||t>i+n||r>o||o>r+s?null:{datum:e.datum,x:i+n/2,y:r+s/2,distance:0,category:e.category,stats:e.stats}}H(oo);import{useMemo as uo,useRef as go}from"react";import{Fragment as mo,jsx as po,jsxs as fo}from"react/jsx-runtime";function yo(e){const{width:t,height:o,totalWidth:i,totalHeight:r,margin:n,scales:s,showAxes:a,showGrid:l,rFormat:c}=e,{rTickValues:h,axisExtent:u}=e,d="radial"===s?.projection,g="horizontal"===s?.projection,m=uo(()=>!s||d?[]:(h||y(s.r,5,u)).map(e=>({value:e,pixel:s.r(e),label:(c||vo)(e)})),[s,c,d,h,u]),p=l&&s&&!d,f=a&&s&&!d;return p||f?po("svg",{width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:fo("g",{transform:`translate(${n.left},${n.top})`,children:[p&&po("g",{className:"ordinal-grid",children:m.map((e,i)=>po("line",{x1:g?e.pixel:0,y1:g?0:e.pixel,x2:g?e.pixel:t,y2:g?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),f&&po(mo,{children:fo(mo,g?{children:[po("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),po("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]}:{children:[po("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),po("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]})})]})}):null}function vo(e){return Math.round(100*e)/100+""}function bo(e){const{width:t,height:o,totalWidth:i,totalHeight:r,margin:n,scales:s,showAxes:a,showCategoryTicks:l,oLabel:c,rLabel:h,oFormat:u,rFormat:d,showGrid:g,title:m,legend:p,legendHoverBehavior:f,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:x,legendPosition:w="right",legendLayout:A,foregroundGraphics:k,annotations:S,onAnnotationActivate:_,onObservation:C,chartId:P,chartType:R,autoPlaceAnnotations:M,svgAnnotationRules:L,xAccessor:I,yAccessor:T,annotationData:H,underlayRendered:B,canvasObscuresUnderlay:O=!0,children:F}=e,E=rt({onAnnotationActivate:_,onObservation:C,chartId:P,chartType:R}),N="radial"===s?.projection,D="horizontal"===s?.projection,W=!1!==l,j=!B||O,z=uo(()=>{if(!a||!W||!s||N)return[];const e=s.o.bandwidth(),t=s.o.domain().map((t,o)=>({value:t,pixel:(s.o(t)??0)+e/2,label:u?u(t,o):t}));if(2>=t.length)return t;const o=Math.abs(t[1].pixel-t[0].pixel)||e,i=t.map(e=>{return t=e.label,D?"string"==typeof t||"number"==typeof t?16:24:"string"==typeof t||"number"==typeof t?6.5*(t+"").length:60;var t}),r=D?0:6;if(i.every((e,t)=>0===t||o>=(i[t-1]+e)/2+r))return t;const n=Math.max(...i)+r,l=Math.max(1,Math.ceil(n/o));return 1===l?t:t.filter((e,t)=>t%l===0)},[a,W,s,u,N,D]),G=e.rTickValues,V=e.tickLabelEdgeAlign,$=e.axisExtent,q=uo(()=>a&&s&&!N?(G||y(s.r,5,$)).map(e=>({value:e,pixel:s.r(e),label:(d||vo)(e)})):[],[a,s,d,N,G,$]),X=go(new Map),Y=go(S?.length??0),Q=S?.length??0;Y.current!==Q&&(Y.current=Q,X.current=new Map);const K=uo(()=>{if(!S||0===S.length)return null;const e=Pe("ordinal",E),i="horizontal"===s?.projection,r=s?.o?e=>(s.o(e)??0)+s.o.bandwidth()/2:null,n={scales:s?{x:i?s.r:r||s.r,y:i&&r||s.r,time:s.r,value:s.r,o:s.o}:null,timeAxis:"x",xAccessor:I,yAccessor:T,width:t,height:o,data:H,frameType:"ordinal",projection:i?"horizontal":"vertical",stickyPositionCache:X.current},a=M?ve({annotations:S,context:n,..."object"==typeof M?M:{}}):S;return Ze(a,e,L,n)},[S,M,L,t,o,s,I,T,H,E]);return a||m||p||k||K&&K.length>0||g||F?fo("svg",{role:"img",width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[po("title",{children:"string"==typeof m?m:"Ordinal Chart"}),po("desc",{children:"string"==typeof m?m+" (ordinal data visualization)":"Ordinal data visualization"}),fo("g",{transform:`translate(${n.left},${n.top})`,children:[g&&s&&!N&&j&&po("g",{className:"ordinal-grid",children:q.map((e,i)=>po("line",{x1:D?e.pixel:0,y1:D?0:e.pixel,x2:D?e.pixel:t,y2:D?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},"grid-"+i))}),a&&s&&!N&&(()=>{const e={fontSize:"var(--semiotic-tick-font-size, 12px)"},i={fontSize:"var(--semiotic-axis-label-font-size, 12px)"};return po("g",{className:"ordinal-axes",children:fo(mo,D?{children:[fo("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[j&&po("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),z.map((t,o)=>fo("g",{transform:`translate(0,${t.pixel})`,children:[po("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?po("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):po("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:po("div",{style:{textAlign:"right",userSelect:"none",...e},children:t.label})})]},"cat-"+o)),c&&po("text",{x:15-n.left,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-n.left}, ${o/2})`,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),fo("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[j&&po("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),j&&s?.r&&(()=>{const e=s.r(0);return e>1&&t-1>e?po("line",{x1:e,y1:0,x2:e,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1,strokeDasharray:"4,4"}):null})(),q.map((t,i)=>{const r=V?0===i?"start":i===q.length-1?"end":"middle":"middle";return fo("g",{transform:`translate(${t.pixel},${o})`,children:[po("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),po("text",{y:18,textAnchor:r,fill:"var(--semiotic-text-secondary, #666)",className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+i)}),h&&po("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]}:{children:[fo("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[j&&(()=>{const e=s?.r?s.r(0):o,i=0>e||e>o?o:e;return po("line",{x1:0,y1:i,x2:t,y2:i,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})})(),z.map((t,i)=>fo("g",{transform:`translate(${t.pixel},${o})`,children:[po("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?po("text",{y:18,textAnchor:"middle",fill:"var(--semiotic-text-secondary, #666)",className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):po("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:po("div",{style:{textAlign:"center",userSelect:"none",...e},children:t.label})})]},"cat-"+i)),c&&po("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",className:"semiotic-axis-label",style:{userSelect:"none",...i},children:c})]}),fo("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[j&&po("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),q.map((t,o)=>fo("g",{transform:`translate(0,${t.pixel})`,children:[po("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),po("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},"val-"+o)),h&&po("text",{x:15-n.left,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-n.left}, ${o/2})`,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]})]})})})(),K,k,F]}),m&&"string"==typeof m?po("text",{x:i/2,y:fe,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)"},children:m}):m?po("foreignObject",{x:0,y:0,width:i,height:n.top,children:m}):null,Ue({legend:p,totalWidth:i,totalHeight:r,margin:n,legendPosition:w,title:m,legendLayout:A,legendHoverBehavior:f,legendClickBehavior:v,legendHighlightedCategory:b,legendIsolatedCategories:x})]}):null}import*as xo from"react";import{jsx as wo}from"react/jsx-runtime";var Ao=null,ko=null;function So(e){const[t,o]=xo.useState(()=>Ao);return xo.useEffect(()=>{if(t)return;let e=!1;return(Ao?Promise.resolve(Ao):(ko||(ko=import("./chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js").then(e=>Ao=e.OrdinalBrushOverlay)),ko)).then(t=>{e||o(()=>t)}),()=>{e=!0}},[t]),t?wo(t,{...e}):null}import{arc as _o}from"d3-shape";function Co(e,t){const o=t._gradientBand.colors;if(0===o.length)return;const{clipPath:i,slices:r}=xe({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds?.start??!0,roundEnd:t.roundedEnds?.end??!0,colors:o}),n=new Path2D(i);e.save(),e.translate(t.cx,t.cy),e.clip(n);for(const t of r)e.fillStyle=Je(e,t.color)||t.color||"#007bff",e.fill(new Path2D(t.d));e.restore(),t.style.stroke&&"none"!==t.style.stroke&&(e.save(),e.translate(t.cx,t.cy),e.strokeStyle=Je(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke(n),e.restore())}function Po(e,t){e.beginPath(),t.innerRadius>0?(e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerRadius,t.endAngle,t.startAngle,!0)):(e.moveTo(t.cx,t.cy),e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle)),e.closePath()}function Ro(e,t){const o={innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle+Math.PI/2,endAngle:t.endAngle+Math.PI/2},i=_o().cornerRadius(t.cornerRadius)(o);if(!i)return;e.save(),e.translate(t.cx,t.cy);const r=new Path2D(i);e.fill(r),t.style.stroke&&"none"!==t.style.stroke&&e.stroke(r),e.restore()}var Mo=(e,t,o,i)=>{const r=t.filter(e=>"wedge"===e.type);for(const t of r)if(e.globalAlpha=(t.style.fillOpacity??1)*(t.style.opacity??1),t._gradientBand&&t._gradientBand.colors.length>0)Co(e,t),t._pulseIntensity&&t._pulseIntensity>0&&(Po(e,t),Y(e,t)),e.globalAlpha=1;else{if(e.fillStyle=et(e,t.style.fill,"#007bff"),t.roundedEnds){t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=Je(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1);const o=be({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds.start,roundEnd:t.roundedEnds.end});e.save(),e.translate(t.cx,t.cy);const i=new Path2D(o);e.fill(i),t.style.stroke&&"none"!==t.style.stroke&&e.stroke(i),e.restore()}else t.cornerRadius?(t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=Je(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1),Ro(e,t)):(Po(e,t),e.fill(),t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=Je(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke()));t._pulseIntensity&&t._pulseIntensity>0&&(Po(e,t),Y(e,t)),e.globalAlpha=1}},Lo=(e,t,o,i)=>{const r=t.filter(e=>"boxplot"===e.type);for(const t of r){const o=t.columnWidth/2,i="vertical"===t.projection,r=Je(e,"var(--semiotic-primary, #007bff)"),n=Je(e,"var(--semiotic-text, #333)"),s=et(e,t.style.fill,r),a=t.style.stroke,l="string"==typeof a?Je(e,a)||a:n,c=t.style.strokeWidth||1,h=t.style.fillOpacity??t.style.opacity??.6;if(e.save(),e.strokeStyle=l,e.lineWidth=c,e.beginPath(),i?(e.moveTo(t.x,t.minPos),e.lineTo(t.x,t.maxPos)):(e.moveTo(t.minPos,t.y),e.lineTo(t.maxPos,t.y)),e.stroke(),e.beginPath(),i?(e.moveTo(t.x-.4*o,t.minPos),e.lineTo(t.x+.4*o,t.minPos),e.moveTo(t.x-.4*o,t.maxPos),e.lineTo(t.x+.4*o,t.maxPos)):(e.moveTo(t.minPos,t.y-.4*o),e.lineTo(t.minPos,t.y+.4*o),e.moveTo(t.maxPos,t.y-.4*o),e.lineTo(t.maxPos,t.y+.4*o)),e.stroke(),e.globalAlpha=h,e.fillStyle=s,i){const i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(t.x-o,i,t.columnWidth,r),e.globalAlpha=1,e.strokeRect(t.x-o,i,t.columnWidth,r)}else{const i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(i,t.y-o,r,t.columnWidth),e.globalAlpha=1,e.strokeRect(i,t.y-o,r,t.columnWidth)}e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),i?(e.moveTo(t.x-o,t.medianPos),e.lineTo(t.x+o,t.medianPos)):(e.moveTo(t.medianPos,t.y-o),e.lineTo(t.medianPos,t.y+o)),e.stroke(),e.restore()}},Io=(e,t,o,i)=>{const r=t.filter(e=>"violin"===e.type);for(const t of r){e.save(),(t.translateX||t.translateY)&&e.translate(t.translateX,t.translateY);const o=new Path2D(t.pathString);if(e.globalAlpha=t.style.fillOpacity??t.style.opacity??.6,e.fillStyle=et(e,t.style.fill,"#007bff"),e.fill(o),e.globalAlpha=1,t.style.stroke&&"none"!==t.style.stroke&&(e.strokeStyle=Je(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke(o)),t.iqrLine){e.strokeStyle="#333",e.lineWidth=2,e.globalAlpha=.8;const o=t.iqrLine.centerPos,i=!1!==t.iqrLine.isVertical;e.beginPath(),i?(e.moveTo(o,t.iqrLine.q1Pos),e.lineTo(o,t.iqrLine.q3Pos)):(e.moveTo(t.iqrLine.q1Pos,o),e.lineTo(t.iqrLine.q3Pos,o)),e.stroke(),e.beginPath(),i?e.arc(o,t.iqrLine.medianPos,3,0,2*Math.PI):e.arc(t.iqrLine.medianPos,o,3,0,2*Math.PI),e.fillStyle="#fff",e.fill(),e.strokeStyle="#333",e.lineWidth=1,e.stroke(),e.globalAlpha=1}e.restore()}},To=(e,t,o,i)=>{const r=t.filter(e=>"connector"===e.type);if(0===r.length)return;const n=new Map;for(const e of r){const t=e.group||"_default";n.has(t)||n.set(t,[]),n.get(t).push(e)}for(const[,t]of n){if(0===t.length)continue;const o=t[0].style;if(o.fill&&"none"!==o.fill){e.beginPath(),e.moveTo(t[0].x1,t[0].y1);for(const o of t)e.lineTo(o.x2,o.y2);e.closePath(),e.globalAlpha=o.fillOpacity??o.opacity??.3,e.fillStyle=Ae(e,o.fill)??"#999",e.fill(),e.globalAlpha=1}for(const o of t)e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.strokeStyle=Je(e,o.style.stroke)||et(e,o.style.fill,"")||Je(e,"var(--semiotic-border, #999)"),e.lineWidth=o.style.strokeWidth||1,e.globalAlpha=o.style.opacity??.5,e.stroke(),e.globalAlpha=1}},Ho=(e,t,o,i)=>{const r=t.filter(e=>"trapezoid"===e.type);for(const t of r){const o=t.points;if(o.length>=4){e.globalAlpha=t.style?.opacity??1,e.beginPath(),e.moveTo(o[0][0],o[0][1]);for(let t=1;o.length>t;t++)e.lineTo(o[t][0],o[t][1]);e.closePath(),e.fillStyle=Ae(e,t.style?.fill)||"#999",e.fill(),t.style?.stroke&&(e.strokeStyle=Je(e,t.style.stroke)||t.style.stroke,e.lineWidth=t.style.strokeWidth||1,e.stroke()),e.globalAlpha=1}}};function Bo(e){return 1e6>e?1e4>e?1e3>e?e+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function Oo(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}var Fo=new Map;function Eo(e,t){const o=`${e}@${"undefined"!=typeof window&&window.devicePixelRatio||1}`,i=Fo.get(o);if(void 0!==i)return i;const r=Re({background:e,stroke:"rgba(255,255,255,0.5)",lineWidth:1.5,spacing:6,angle:45},t);return Fo.set(o,r),r}function No(e,t,o,i,r,n){e.moveTo(t+n,o),e.lineTo(t+i-n,o),e.quadraticCurveTo(t+i,o,t+i,o+n),e.lineTo(t+i,o+r-n),e.quadraticCurveTo(t+i,o+r,t+i-n,o+r),e.lineTo(t+n,o+r),e.quadraticCurveTo(t,o+r,t,o+r-n),e.lineTo(t,o+n),e.quadraticCurveTo(t,o,t+n,o),e.closePath()}function Do(e){return 1e6>e?1e4>e?1e3>e?Math.round(e)+"":(e/1e3).toFixed(1)+"K":(e/1e3).toFixed(0)+"K":(e/1e6).toFixed(1)+"M"}function Wo(e){return.05>Math.abs(e-Math.round(e))?Math.round(e)+"%":e.toFixed(1)+"%"}function jo(e){return"rect"===e.type||"point"===e.type||"symbol"===e.type||"glyph"===e.type}function zo(e){return(t,o,i,r)=>{e(t,o.filter(jo),{x:i.r,y:i.r},r)}}var Go=zo(c),Vo=zo(_),$o=zo(f),qo=zo(V),Xo=e=>[To,...e],Yo={bar:Xo([Go]),clusterbar:Xo([Go]),point:Xo([Vo,$o]),swarm:Xo([Vo,$o]),pie:[Mo],donut:[Mo],boxplot:Xo([Lo,Vo]),violin:Xo([Io]),histogram:Xo([Go]),ridgeline:Xo([Io]),timeline:Xo([Go]),funnel:[Go,Ho,(e,t,o,i)=>{const r=t.filter(e=>"rect"===e.type&&null!=e.datum);if(0!==r.length&&r.some(e=>null!=e.datum?.__funnelStepLabel||null!=e.datum?.__funnelValueLabelX)){e.textBaseline="top",e.lineJoin="round",e.textAlign="center",e.font="bold 14px sans-serif";for(const t of r){const o=t.datum;if(!o)continue;if(!o.__funnelStepLabel)continue;const i=o.__funnelStepLabel;if(e.measureText(i).width+16>(o.__funnelRowWidth??o.__funnelBarW??0))continue;const r=o.__funnelStepLabelX,n=o.__funnelStepLabelY+3;e.strokeStyle="rgba(0,0,0,0.6)",e.lineWidth=3,e.strokeText(i,r,n),e.fillStyle="#fff",e.fillText(i,r,n)}e.font="bold 13px sans-serif";for(const t of r){const o=t.datum;if(!o)continue;if(null==o.__funnelValueLabelX)continue;const i=o.__funnelBarW??0;if(60>i)continue;const r=o.__funnelValue;if(null==r||0===r)continue;const n=o.__funnelPercent,s=!0===o.__funnelIsFirstStep;let a;if(a=s?Bo(r):null!=n?`${Bo(r)} (${Oo(n)})`:Bo(r),e.measureText(a).width+16>i){if(s||null==n)continue;if(a=Bo(r),e.measureText(a).width+16>i)continue}const l=o.__funnelValueLabelX,c=(o.__funnelValueLabelY??t.y)+14+5;e.textAlign="center",e.strokeStyle="rgba(0,0,0,0.5)",e.lineWidth=3,e.strokeText(a,l,c),e.fillStyle="#fff",e.fillText(a,l,c)}e.lineWidth=1,e.lineJoin="miter"}}],"bar-funnel":[Go,(e,t,o,i)=>{const r=t.filter(e=>"rect"===e.type&&!0===e.datum?.__barFunnelIsDropoff);for(const t of r){const o=("string"==typeof t.style.fill?t.style.fill:null)||Je(e,"var(--semiotic-border, #999)"),i=Eo(o,e);e.globalAlpha=t.style.opacity??1,e.beginPath(),e.rect(t.x,t.y,t.w,t.h),i?e.fillStyle=i:(e.fillStyle=o,e.globalAlpha=.4*(t.style.opacity??1)),e.fill(),e.globalAlpha=1}},(e,t,o,i)=>{const r=t.filter(e=>"rect"===e.type&&!0!==e.datum?.__barFunnelIsDropoff&&null!=e.datum?.__barFunnelLabelX);if(0===r.length)return;const n=function(e,t){const[o,i,r]=Ke(e,t);return(.2126*o+.7152*i+.0722*r)/255>.6}(e,Je(e,"var(--semiotic-text, #333)")),s=n?"#1f2937":"#ffffff",a=n?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.12)",l=n?"#f3f4f6":"#1a1a1a",c=l;for(const t of r){const o=t.datum;if(!o)continue;const i=o.__barFunnelValue;if(null==i)continue;if(25>t.w)continue;const r=o.__barFunnelPercent,n=!(!0===o.__barFunnelIsFirstStep)&&null!=r,h=n?Wo(r):"",u=Do(i);e.font="bold 13px sans-serif";const d=n?e.measureText(h).width:0;e.font="11px sans-serif";const g=e.measureText(u).width,m=Math.max(d,g)+12,p=n?32:17,f=o.__barFunnelLabelX,y=f-m/2,v=o.__barFunnelLabelY-p-4;e.save(),e.shadowColor="rgba(0,0,0,0.15)",e.shadowBlur=4,e.shadowOffsetY=1,e.fillStyle=s,e.beginPath(),No(e,y,v,m,p,4),e.fill(),e.restore(),e.strokeStyle=a,e.lineWidth=.5,e.beginPath(),No(e,y,v,m,p,4),e.stroke(),e.textAlign="center",e.textBaseline="top",n?(e.font="bold 13px sans-serif",e.fillStyle=l,e.fillText(h,f,v+3),e.font="11px sans-serif",e.fillStyle=c,e.fillText(u,f,v+3+13+2)):(e.font="bold 11px sans-serif",e.fillStyle=l,e.fillText(u,f,v+3))}e.lineWidth=1}],swimlane:Xo([Go]),custom:Xo([Go,Vo,$o,qo,Mo,Lo,Io,Ho])};import{jsx as Qo,jsxs as Ko}from"react/jsx-runtime";function Zo(e){const t=ot(e,{skipPositional:!1});return null==t.title&&0===t.entries.length?null:Ko("div",{className:"semiotic-tooltip",style:Le,children:[null!=t.title&&Qo("div",{style:{fontWeight:"bold"},children:t.title+""}),t.entries.map(e=>Ko("div",{children:[Ko("span",{style:{opacity:.7},children:[e.key,":"]})," ","number"==typeof e.value?e.value.toLocaleString():e.value+""]},e.key))]})}function Uo({hover:e}){const t=e.data||{},o=e.stats,i=e.category;if(Array.isArray(t)){const e=i||t[0]?.category||"";if(o)return Ko("div",{className:"semiotic-tooltip",style:Le,children:[e&&Qo("div",{style:{fontWeight:"bold"},children:e+""}),Ko("div",{children:["n = ",o.n]}),Ko("div",{children:["Min: ",o.min.toLocaleString()]}),Ko("div",{children:["Q1: ",o.q1.toLocaleString()]}),Ko("div",{children:["Median: ",o.median.toLocaleString()]}),Ko("div",{children:["Q3: ",o.q3.toLocaleString()]}),Ko("div",{children:["Max: ",o.max.toLocaleString()]}),Ko("div",{style:{opacity:.8},children:["Mean: ",o.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});const r=t.length;return Ko("div",{className:"semiotic-tooltip",style:Le,children:[e&&Qo("div",{style:{fontWeight:"bold"},children:e+""}),Ko("div",{children:[r," items"]})]})}if(null!=t.bin&&null!=t.count){const e=t.range||[];return Ko("div",{className:"semiotic-tooltip",style:Le,children:[t.category&&Qo("div",{style:{fontWeight:"bold"},children:t.category+""}),Ko("div",{children:["Count: ",t.count]}),2===e.length&&Ko("div",{style:{opacity:.8},children:[Number(e[0]).toFixed(1)," – ",Number(e[1]).toFixed(1)]})]})}const r=e.__oAccessor,n=e.__rAccessor,s=e.__chartType;if("swarm"===s||"point"===s)return Zo(t);const a=(r&&null!=t[r]?t[r]:null)||t.category||t.name||t.group||t.__rName||"",l=t.__aggregateValue??(n&&null!=t[n]?t[n]:null)??t.value??t.__rValue??t.pct??"";return a||""!==l?Ko("div",{className:"semiotic-tooltip",style:Le,children:[a&&Qo("div",{style:{fontWeight:"bold"},children:a+""}),""!==l&&Qo("div",{children:"number"==typeof l?l.toLocaleString():l+""})]}):Zo(t)}Uo.ownsChrome=!0;import{jsx as Jo,jsxs as ei}from"react/jsx-runtime";var ti={top:50,right:40,bottom:60,left:70},oi=Tt(It(function(e,t){const{chartType:o,runtimeMode:i,data:r,oAccessor:n="category",rAccessor:a="value",colorAccessor:l,symbolAccessor:c,symbolMap:u,stackBy:d,groupBy:p,multiAxis:f,timeAccessor:y,valueAccessor:v,categoryAccessor:b,accessorRevision:x,projection:w="vertical",size:A=[600,400],responsiveWidth:k,responsiveHeight:S,margin:_,barPadding:C,roundedTop:R,gradientFill:H,trackFill:B,baselinePadding:O,innerRadius:F,cornerRadius:E,normalize:N,startAngle:W,sweepAngle:j,dynamicColumnWidth:z,bins:G,showOutliers:V,showIQR:$,amplitude:q,connectorOpacity:Y,showLabels:ee,connectorAccessor:oe,connectorStyle:ie,dataIdAccessor:re,rExtent:ne,oExtent:ue,extentPadding:de=.05,oSort:fe,windowMode:ye="sliding",windowSize:ve=200,pieceStyle:be,summaryStyle:xe,renderMode:Ae,colorScheme:Se,barColors:_e,showAxes:Ce=!0,showCategoryTicks:Pe,categoryLabel:Re,valueLabel:Me,categoryFormat:Le,valueFormat:Te,oLabel:Be,rLabel:Oe,oFormat:Fe,rFormat:Ee,rTickValues:Ne,tickLabelEdgeAlign:De,axisExtent:We,enableHover:je=!0,hoverAnnotation:Ve,tooltipContent:$e,customHoverBehavior:qe,customClickBehavior:Xe,onObservation:Ke,annotationObservationCallback:Ze,chartId:Ue,annotations:Je,onAnnotationActivate:et,autoPlaceAnnotations:tt,svgAnnotationRules:ot,showGrid:it=!1,legend:rt,legendHoverBehavior:nt,legendClickBehavior:st,legendHighlightedCategory:at,legendIsolatedCategories:ht,legendPosition:dt,legendLayout:gt,legendCategoryAccessor:mt,onCategoriesChange:pt,backgroundGraphics:ft,foregroundGraphics:yt,title:bt,className:xt,background:wt,centerContent:St,decay:It,pulse:Tt,transition:Ht,animate:Bt,staleness:Ot,frameScheduler:Ft,clock:Et,random:Nt,seed:Dt,paused:Wt=!1,suspendWhenHidden:jt=!0,brush:zt,onBrush:Gt,accessibleTable:Vt=!0,description:$t,summary:qt,customLayout:Xt,onLayoutError:Yt,layoutConfig:Qt,layoutSelection:Kt}=e,{customHoverBehavior:Zt,customClickBehavior:Ut,hasClickBehavior:Jt}=I({customHoverBehavior:qe,customClickBehavior:Xe,onObservation:Ke,chartId:Ue,chartType:"StreamOrdinalFrame"}),eo=b??n,to=v??a,ro=_t(!0),no=lt({sizeProp:A,responsiveWidth:k,responsiveHeight:S,userMargin:_,marginDefault:ti,title:bt,legend:rt,legendPosition:dt,animate:Bt,transitionProp:Ht,frameScheduler:Ft,clock:Et,random:Nt,seed:Dt,paused:Wt,suspendWhenHidden:jt,themeDirtyRef:ro}),{reducedMotionRef:so,responsiveRef:ao,size:lo,margin:co,adjustedWidth:ho,adjustedHeight:uo,currentTheme:go,transition:mo,introEnabled:po,tableId:fo,rafRef:vo,renderFnRef:xo,scheduleRender:wo,frameRuntime:Ao}=no,ko=At(),_o=kt(),Co=Rt(()=>Ie(r),[r]),Po=Re??Be,Ro=Me??Oe,Mo=Le??Fe,Lo=Te??Ee,Io=_t(null),[To,Ho]=Ct(null),[Bo,Oo]=Ct(null),Fo=m(yt,lo,co,Bo),Eo=m(ft,lo,co,Bo),No=ft||"transparent"===wt?null:Jo("rect",{className:"semiotic-canvas-background","data-semiotic-layer":"canvas-background",x:-co.left,y:-co.top,width:lo[0],height:lo[1],fill:wt||"var(--semiotic-bg, transparent)"}),[Do,Wo]=Ct(0),jo=_t(0),[zo,Go]=Ct(!1),Vo=_t({w:-1,h:-1}),$o=_t(!1),qo=ut("StreamOrdinalFrame"),Xo=je||Ve,Qo="streaming"===i,Ko=Rt(()=>({chartType:o,runtimeMode:Qo?"streaming":"bounded",windowSize:ve,windowMode:ye,extentPadding:de,projection:w,oAccessor:Qo?void 0:eo,rAccessor:Qo?void 0:to,accessorRevision:x,colorAccessor:l,symbolAccessor:c,symbolMap:u,stackBy:d,groupBy:p,multiAxis:f,timeAccessor:Qo?y:void 0,valueAccessor:Qo?v||("string"==typeof to||"function"==typeof to?to:void 0):void 0,categoryAccessor:Qo?eo:void 0,rExtent:ne,oExtent:ue,axisExtent:We,barPadding:C,roundedTop:R,gradientFill:H,trackFill:B,baselinePadding:O,innerRadius:F,cornerRadius:E,normalize:N,startAngle:W,sweepAngle:j,dynamicColumnWidth:z,bins:G,showOutliers:V,showIQR:$,amplitude:q,connectorOpacity:Y,showLabels:ee,connectorAccessor:oe,connectorStyle:ie,dataIdAccessor:re,oSort:fe,pieceStyle:be,summaryStyle:xe,colorScheme:Se,themeCategorical:go?.colors?.categorical,themeSemantic:vt(go),themeSequential:go?.colors?.sequential,themeDiverging:go?.colors?.diverging,barColors:_e,decay:It,pulse:Tt,transition:mo,introAnimation:po,staleness:Ot,clock:Ao.now,customLayout:Xt,onLayoutError:Yt,layoutConfig:Qt,layoutMargin:co}),[o,Qo,ve,ye,de,w,eo,to,x,l,c,u,d,p,f,y,v,ne,ue,We,C,R,H,B,O,F,E,N,W,j,z,G,V,$,q,Y,ee,oe,ie,re,fe,be,xe,Se,go,_e,It,Tt,mo,po,Ot,Ao.now,Xt,Yt,Qt,co]),Zo=U(Ko),oi=_t(null);oi.current||(oi.current=new oo(Zo));const ii=M(oi,mt,pt,e=>e.getData());K(oi,Zo,ro,wo),Z(oi,Kt,ro,wo);const ri=_t(null);ri.current||(ri.current=new s(e=>{const t=oi.current;t&&t.ingest(e)&&(ro.current=!0,wo())}));const ni=Mt(e=>{ri.current?.push(e)},[]),si=Mt(e=>{ri.current?.pushMany(e)},[]),ai=Mt(()=>{ri.current?.clear(),oi.current?.clear(),ro.current=!0,wo()},[wo]),li=Mt(e=>{ri.current?.clearLastData(),ri.current?.setReplacementData(e)},[]);Lt(t,()=>({push:ni,pushMany:si,replace:li,remove:e=>{ri.current?.flush();const t=oi.current?.remove(e)??[];if(t.length>0){const e=Io.current?.data;!!Io.current&&t.some(Array.isArray(e)?t=>e.includes(t):t=>t===e)&&(Io.current=null,Ho(null)),ro.current=!0,wo()}return t},update:(e,t)=>{ri.current?.flush();const o=oi.current?.update(e,t)??[];return o.length>0&&(ro.current=!0,wo()),o},clear:ai,getData:()=>(ri.current?.flush(),oi.current?.getData()??[]),getScales:()=>oi.current?.scales??null,getCustomLayout:()=>oi.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>oi.current?.lastCustomLayoutFailure??null}),[ni,si,li,ai,wo]),Pt(()=>{r&&ri.current?.setBoundedData(Co)},[r,Co]);const{canvasRef:ci}=ct(no,{storeRef:oi,dirtyRef:ro,hydrated:ko,wasHydratingFromSSR:_o,cleanup:()=>ri.current?.clear(),canvasPaintDependencies:[o,ho,uo,Ce,wt,ft,Ae,wo]}),{hoverHandlerRef:hi,hoverLeaveRef:ui,onPointerMove:di,onPointerLeave:gi}=no;hi.current=e=>{if(!Xo)return;const t=ci.current;if(!t)return;const i=t.getBoundingClientRect(),r=e.clientX-i.left-co.left,n=e.clientY-i.top-co.top;if(0>r||r>ho||0>n||n>uo)return void(Io.current&&(Io.current=null,Ho(null),Zt&&Zt(null),wo()));const s=oi.current;if(!s||0===s.scene.length)return;const a="radial"===w,l=io(s.scene,a?r-ho/2:r,a?n-uo/2:n,30,s.pointQuadtree,s.maxPointRadius);if(!l)return void(Io.current&&(Io.current=null,Ho(null),Zt&&Zt(null),wo()));const c=we(l.datum||{},l.x,l.y,{...l.stats&&{stats:l.stats},...l.category&&{category:l.category},__oAccessor:"string"==typeof eo?eo:void 0,__rAccessor:"string"==typeof to?to:void 0,__chartType:o});Io.current=c,Ho(c),Zt&&(Zt(c),ro.current=!0),wo()},ui.current=()=>{Io.current&&(Io.current=null,Ho(null),Zt&&(Zt(null),ro.current=!0),wo())};const mi=Mt(e=>{if(ze(e.target))return;if(!Ut)return;const t=ci.current;if(!t)return Ut(null),ro.current=!0,void wo();const i=t.getBoundingClientRect(),r=e.clientX-i.left-co.left,n=e.clientY-i.top-co.top;if(0>r||r>ho||0>n||n>uo)return Ut(null),ro.current=!0,void wo();const s=oi.current;if(!s||0===s.scene.length)return Ut(null),ro.current=!0,void wo();const a="radial"===w,l=io(s.scene,a?r-ho/2:r,a?n-uo/2:n,30,s.pointQuadtree,s.maxPointRadius);if(!l)return Ut(null),ro.current=!0,void wo();Ut(we(l.datum||{},l.x,l.y,{...l.stats&&{stats:l.stats},...l.category&&{category:l.category},__oAccessor:"string"==typeof eo?eo:void 0,__rAccessor:"string"==typeof to?to:void 0,__chartType:o}),{type:"activate",inputType:Ye(e.nativeEvent.pointerType)}),ro.current=!0,wo()},[Ut,ci,co.left,co.top,ho,uo,w,eo,to,o,wo]),{kbFocusIndexRef:pi,focusedNavPointRef:fi,onKeyDown:yi}=L({storeRef:oi,hoverRef:Io,setHoverPoint:Ho,customHoverBehavior:Zt,customClickBehavior:Ut,scheduleRender:wo,chartType:o,oAccessor:eo,rAccessor:to}),vi=Mt(e=>{pi.current=-1,fi.current=null,di(e)},[fi,pi,di]);xo.current=()=>{if(vo.current=null,!Ao.isActive)return;const e=ci.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const i=oi.current;if(!i)return;const r=Ao.now(),n=i.advanceTransition(so.current?r+1e6:r),s=!so.current&&n,a=Vo.current.w!==ho||Vo.current.h!==uo,l=ro.current;let c=!1;const h=qo.current.beforeCompute(i.getLastUpdateResult(),s);!l&&!a||s&&!a||(i.computeScene({width:ho,height:uo}),Vo.current={w:ho,h:uo},c=!0,ii()),qo.current.afterCompute(h,c,a),ro.current=l&&s&&!c;const u=P(i,r,c,$o);(c||s)&&e.setAttribute("aria-label",ke(i.scene,o+" chart"));const d=He(),g=lo[0]*d,m=lo[1]*d;e.width===g&&e.height===m||(e.width=g,e.height=m,e.style.width=lo[0]+"px",e.style.height=lo[1]+"px"),t.setTransform(d,0,0,d,0,0),t.clearRect(0,0,lo[0],lo[1]);const p=Ot&&i.lastIngestTime>0&&r-i.lastIngestTime>(Ot?.threshold??5e3);p&&(t.globalAlpha=Ot?.dimOpacity??.5);const f="radial"===w;t.save(),t.beginPath(),t.rect(co.left,co.top,ho,uo),t.clip(),f?(t.save(),t.translate(co.left+ho/2,co.top+uo/2)):t.translate(co.left,co.top);const y=Xt?Yo.custom:Yo[o]||[],v={width:ho,height:uo},b=i.scales;b&&X({context:t,nodes:i.scene,renderMode:Ae,pixelRatio:d,paintBuiltIn:e=>{for(const o of y)o(t,e,b,v)}}),f&&t.restore(),t.restore(),p&&(t.globalAlpha=1),c&&i.scales?(Oo(i.scales),Wo(e=>e+1),jo.current=r):s&&i.scales&&r-jo.current>=33&&(Wo(e=>e+1),jo.current=r),Ot?.showBadge&&Go(!!p),(s||null!=i.activeTransition||u.pending)&&wo()},J(Ot,oi,ro,wo,zo,Go);const bi=Xo&&To?$e?$e(To):Jo(Uo,{hover:To}):null,xi="radial"===w,wi=bi?Jo(ce,{x:To?xi?To.x+ho/2:To.x:0,y:To?xi?To.y+uo/2:To.y:0,containerWidth:ho,containerHeight:uo,margin:co,className:"stream-ordinal-tooltip",children:bi}):null,Ai="horizontal"===w?eo:to,ki=g("horizontal"===w?to:eo,void 0,"__semiotic_resolvedO",""),Si=g(Ai,void 0,"__semiotic_resolvedR",""),_i=ki.key,Ci=Si.key,Pi=h(ki,Si,Je&&Je.length>0||!1);if(Ge||!ko&&_o){const e=oi.current;e&&r&&(e.ingest({inserts:Co,bounded:!0}),e.computeScene({width:ho,height:uo}));const t=e?.scene??[],o=e?.scales??null,i=m(yt,lo,co,o),n=m(ft,lo,co,o),s="radial"===w,a=s?co.left+ho/2:co.left,l=s?co.top+uo/2:co.top;return ei("div",{ref:ao,className:"stream-ordinal-frame"+(xt?" "+xt:""),role:"img","aria-label":$t||("string"==typeof bt?bt:"Ordinal chart"),style:{position:"relative",width:k?"100%":lo[0],height:S?"100%":lo[1]},children:[Jo(me,{summary:qt}),ei("svg",{xmlns:"http://www.w3.org/2000/svg",width:lo[0],height:lo[1],style:{position:"absolute",left:0,top:0},children:[n&&Jo("g",{transform:`translate(${co.left},${co.top})`,children:n}),ei("g",{transform:`translate(${a},${l})`,children:[wt&&Jo("rect",{x:0,y:0,width:ho,height:uo,fill:wt}),t.map((e,t)=>Q({node:e,index:t,renderMode:Ae,fallback:()=>Qe(e,t,fo)})).filter(Boolean)]})]}),Jo(bo,{width:ho,height:uo,totalWidth:lo[0],totalHeight:lo[1],margin:co,scales:o,showAxes:Ce,showCategoryTicks:Pe,oLabel:Po,rLabel:Ro,oFormat:Mo,rFormat:Lo,rTickValues:Ne,tickLabelEdgeAlign:De,axisExtent:We,showGrid:it,title:bt,legend:rt,legendHoverBehavior:nt,legendClickBehavior:st,legendHighlightedCategory:at,legendIsolatedCategories:ht,legendPosition:dt,legendLayout:gt,foregroundGraphics:D(i,te(oi.current?.customLayoutOverlays,Kt??null)),annotations:Je,onAnnotationActivate:et,onObservation:Ze??Ke,chartId:Ue,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:tt,svgAnnotationRules:ot,annotationFrame:0,xAccessor:_i,yAccessor:Ci,annotationData:Pi(e?.getData())}),St&&"radial"===w&&Jo("div",{style:{position:"absolute",left:co.left+ho/2,top:co.top+uo/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:St})]})}return ei("div",{ref:ao,className:"stream-ordinal-frame"+(xt?" "+xt:""),role:"group","aria-label":$t||("string"==typeof bt?bt:"Ordinal chart"),tabIndex:0,style:{position:"relative",width:k?"100%":lo[0],height:S?"100%":lo[1],overflow:"visible"},onKeyDown:yi,children:["production"!==process.env.NODE_ENV&&oi.current&&Jo(ge,{store:oi.current,diagnostics:qo.current}),Vt&&Jo(pe,{tableId:fo}),Vt&&Jo(se,{scene:oi.current?.scene??[],chartType:o+" chart",tableId:fo,chartTitle:"string"==typeof bt?bt:void 0}),Jo(me,{summary:qt}),Jo(ae,{hoverPoint:To}),ei("div",{role:"img","aria-label":$t||("string"==typeof bt?bt:"Ordinal chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:Xo?vi:void 0,onMouseLeave:Xo?gi:void 0,onClick:Jt?mi:void 0,children:[ei(le,{size:lo,margin:co,children:[No,Eo]}),Jo(yo,{width:ho,height:uo,totalWidth:lo[0],totalHeight:lo[1],margin:co,scales:Bo,showAxes:Ce,showGrid:it,rFormat:Lo,rTickValues:Ne,axisExtent:We}),Jo("canvas",{ref:ci,"aria-label":ke(oi.current?.scene??[],o+" chart"),style:{position:"absolute",top:0,left:0,width:lo[0],height:lo[1]}}),Jo(bo,{width:ho,height:uo,totalWidth:lo[0],totalHeight:lo[1],margin:co,scales:Bo,showAxes:Ce,showCategoryTicks:Pe,oLabel:Po,rLabel:Ro,oFormat:Mo,rFormat:Lo,rTickValues:Ne,axisExtent:We,showGrid:it,title:bt,legend:rt,legendHoverBehavior:nt,legendClickBehavior:st,legendHighlightedCategory:at,legendIsolatedCategories:ht,legendPosition:dt,legendLayout:gt,foregroundGraphics:D(Fo,te(oi.current?.customLayoutOverlays,Kt??null)),annotations:Je,onAnnotationActivate:et,onObservation:Ze??Ke,chartId:Ue,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:tt,svgAnnotationRules:ot,annotationFrame:Do,xAccessor:_i,yAccessor:Ci,annotationData:Pi(oi.current?.getData()),underlayRendered:!0,canvasObscuresUnderlay:!1}),(zt||Gt)&&"radial"!==w&&Jo(So,{width:ho,height:uo,totalWidth:lo[0],totalHeight:lo[1],margin:co,scales:Bo,onBrush:Gt||(()=>{})}),St&&"radial"===w&&Jo("div",{style:{position:"absolute",left:co.left+ho/2,top:co.top+uo/2,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:St}),Ot?.showBadge&&Jo(T,{isStale:zo,position:Ot.badgePosition}),Jo(he,{active:pi.current>=0,hoverPoint:To,margin:co,size:lo,shape:fi.current?.shape,width:fi.current?.w,height:fi.current?.h}),wi]})]})}));oi.displayName="StreamOrdinalFrame";var ii=oi;import{forwardRef as ri,useMemo as ni}from"react";import{jsx as si}from"react/jsx-runtime";var ai=ri(function(e,t){const{data:o,layout:i,layoutConfig:n,onLayoutError:s,categoryAccessor:a="category",valueAccessor:l="value",oExtent:c,rExtent:h,projection:u="vertical",margin:d,className:g,colorBy:m,colorScheme:p,showAxes:f=!1,annotations:y,onObservation:v,onClick:b,selection:x,linkedHover:w,chartId:A,loading:k,loadingContent:S,emptyContent:_,frameProps:C={}}=e,{frameRef:P,resolved:R,safeData:M,setup:L,earlyReturn:I}=r({imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"OrdinalCustomChart",unwrapData:!0,data:o,colorBy:m,colorScheme:p,selection:x,linkedHover:w,onObservation:v,onClick:b,chartId:A,loading:k,loadingContent:S,emptyContent:_,margin:d,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),T=L.effectiveSelectionHook,H=ni(()=>T?.isActive?{isActive:!0,predicate:T.predicate}:null,[T?.isActive,T?.predicate]);if(I)return I;const{width:F,height:E,enableHover:N,showGrid:D,title:W,description:j,summary:z,accessibleTable:G}=R,V={chartType:"custom",...null!=o&&{data:M},customLayout:i,layoutConfig:n,onLayoutError:s,...H&&{layoutSelection:H},oAccessor:a,rAccessor:l,oExtent:c,rExtent:h,projection:u,colorAccessor:m,colorScheme:p,size:[F,E],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:L.margin,enableHover:N,showAxes:f,showGrid:D,annotations:y,...B({title:W,description:j,summary:z,accessibleTable:G,className:g,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...O({linkedHover:w,selection:x,onObservation:v,onClick:b,hoverHighlight:!1,mobileInteraction:L.mobileInteraction,customHoverBehavior:L.customHoverBehavior,customClickBehavior:L.customClickBehavior}),...C};return si(wt,{componentName:"OrdinalCustomChart",width:F,height:E,children:si(ii,{ref:P,...V})})});ai.displayName="OrdinalCustomChart";import{useMemo as li,forwardRef as ci,useRef as hi}from"react";import{useImperativeHandle as ui}from"react";function di({ref:e,frameRef:t,setup:o}){return ui(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,o)=>t.current?.update(e,o)??[],clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t]),{effectiveLegendProps:o.legendBehaviorProps,effectiveMargin:o.margin}}import{useMemo as gi}from"react";function mi(e){const{colorBy:t,colorScale:i,color:r,themeCategorical:n,colorScheme:s,categoryIndexMap:a,userPieceStyle:l,stroke:c,strokeWidth:h,opacity:u,effectiveSelectionHook:d,resolvedSelection:g,cycleByCategory:m=!1,baseStyleExtras:p,linkStrokeToFill:f=!1,styleRules:y,resolveRuleValue:v}=e,b=gi(()=>(e,o)=>{const l="function"==typeof p?p(e,o):p,c=l?{...l}:{};if(void 0===c.fill)if(t){if(!i)return c;c.fill=Te(e,t,i)}else c.fill=tt(r,n,s,m?o:void 0,a);if(y&&y.length>0){const t=ie(e,y,{value:v?v(e):void 0,category:o});Object.assign(c,t)}return f&&void 0===c.stroke&&void 0!==c.fill&&(c.stroke=c.fill),c},[t,i,r,n,s,a,m,p,f,y,v]),x=gi(()=>o(l?"function"==typeof l?(e,t)=>({...b(e,t),...l(e,t)||{}}):(e,t)=>({...b(e,t),...l}):b,{stroke:c,strokeWidth:h,opacity:u}),[b,l,c,h,u]);return gi(()=>pt(x,d??null,g),[x,d,g])}import{jsx as pi}from"react/jsx-runtime";var fi=ci(function(o,r){const n=at(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,description:o.description,accessibleTable:o.accessibleTable,summary:o.summary,categoryLabel:o.categoryLabel,valueLabel:o.valueLabel,showCategoryTicks:o.showCategoryTicks,orientation:o.orientation,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),s=hi(null),{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:g,colorBy:m,colorScheme:p,sort:f=!1,barPadding:y=40,roundedTop:v,gradientFill:b=!1,styleRules:x,baselinePadding:w=!1,tooltip:A,annotations:k,regression:S,valueExtent:_,frameProps:C={},selection:P,linkedHover:R,onObservation:M,onClick:L,hoverHighlight:I,chartId:T,loading:H,loadingContent:F,emptyContent:D,legendInteraction:W,legendPosition:j,color:z,stroke:G,strokeWidth:V,opacity:$,showCategoryTicks:q,categoryFormat:X,dataIdAccessor:Y}=o,{width:Q,height:K,enableHover:Z,showGrid:U,showLegend:J,title:ee,description:te,summary:ie,accessibleTable:re,categoryLabel:ne,valueLabel:se}=n,ae=li(()=>Ie(a),[a]),le=i({data:ae,rawData:a,colorBy:m,colorScheme:p,legendInteraction:W,legendPosition:j,selection:P,linkedHover:R,fallbackFields:m?["string"==typeof m?m:""]:[],unwrapData:!0,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"BarChart",chartId:T,showLegend:J,userMargin:l,marginDefaults:n.marginDefaults,loading:H,loadingContent:F,emptyContent:D,width:Q,height:K}),{effectiveLegendProps:ce,effectiveMargin:he}=di({ref:r,frameRef:s,setup:le});St("BarChart",ae,"categoryAccessor",h),St("BarChart",ae,"valueAccessor",u);const ue=dt(ae,f,u),de=gt(),ge=li(()=>new Map,[]),me=li(()=>oe(u),[u]),pe=mi({colorBy:m,colorScale:le.colorScale,color:z,themeCategorical:de,colorScheme:p,categoryIndexMap:ge,userPieceStyle:C?.pieceStyle,stroke:G,strokeWidth:V,opacity:$,styleRules:x,resolveRuleValue:me,effectiveSelectionHook:le.effectiveSelectionHook,resolvedSelection:le.resolvedSelection}),fe=li(()=>E({categoryAccessor:h,valueAccessor:u,groupAccessor:m&&m!==h?m:void 0,groupLabel:"string"==typeof m?m:"group",valueFormat:g}),[h,u,m,g]);if(le.earlyReturn)return le.earlyReturn;const ye=t({componentName:"BarChart",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(ye)return pi(xt,{componentName:"BarChart",message:ye,width:Q,height:K});const ve=e(S),be=ve?[ve,...k||[]]:k,xe={chartType:"bar",...null!=a&&{data:ue},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:pe,size:[Q,K],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:he,barPadding:y,...null!=v&&{roundedTop:v},...b&&{gradientFill:!0===b?{topOpacity:.8,bottomOpacity:.05}:b},...Y&&{dataIdAccessor:Y},baselinePadding:w,enableHover:Z,showAxes:n.showAxes,oLabel:ne,rLabel:se,rFormat:g,...X&&{oFormat:X},showGrid:U,showCategoryTicks:q,oSort:f,...ce,...B({title:ee,description:te,summary:ie,accessibleTable:re,className:c,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...N({tooltip:A,defaultTooltipContent:fe}),...O({linkedHover:R,selection:P,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:le.mobileInteraction,customHoverBehavior:le.customHoverBehavior,customClickBehavior:le.customClickBehavior}),...be&&be.length>0&&{annotations:be},..._&&{rExtent:_},...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};return pi(wt,{componentName:"BarChart",width:Q,height:K,children:pi(ii,{ref:s,...xe})})});fi.displayName="BarChart";import{useMemo as yi,forwardRef as vi,useRef as bi}from"react";import{jsx as xi}from"react/jsx-runtime";var wi=vi(function(e,o){const r=at(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=bi(null),{data:s,margin:a,className:l,categoryAccessor:c="category",stackBy:h,valueAccessor:u="value",orientation:d="vertical",valueFormat:g,colorBy:m,colorScheme:p,normalize:f=!1,sort:y=!1,barPadding:v=40,roundedTop:b,styleRules:x,baselinePadding:w=!1,tooltip:A,annotations:k,valueExtent:S,frameProps:_={},selection:C,linkedHover:P,onObservation:R,onClick:M,hoverHighlight:L,chartId:I,loading:T,loadingContent:H,emptyContent:F,legendInteraction:D,legendPosition:W,color:j,stroke:z,strokeWidth:G,opacity:V,categoryFormat:$}=e,{width:q,height:X,enableHover:Y,showGrid:Q,showLegend:K,title:Z,description:U,summary:J,accessibleTable:ee,categoryLabel:te,valueLabel:ie}=r,re=yi(()=>Ie(s),[s]),ne=m||h,se=i({data:re,rawData:s,colorBy:ne,colorScheme:p,legendInteraction:D,legendPosition:W,selection:C,linkedHover:P,fallbackFields:ne?["string"==typeof ne?ne:""]:[],unwrapData:!0,onObservation:R,onClick:M,hoverHighlight:L,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"StackedBarChart",chartId:I,showLegend:K,userMargin:a,marginDefaults:r.marginDefaults,loading:T,loadingContent:H,emptyContent:F,width:q,height:X}),ae=gt(),le=yi(()=>new Map,[]),ce=yi(()=>oe(u),[u]),he=mi({colorBy:ne,colorScale:se.colorScale,color:j,themeCategorical:ae,colorScheme:p,categoryIndexMap:le,userPieceStyle:_?.pieceStyle,stroke:z,strokeWidth:G,opacity:V,styleRules:x,resolveRuleValue:ce,effectiveSelectionHook:se.effectiveSelectionHook,resolvedSelection:se.resolvedSelection}),ue=yi(()=>E({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:g}),[h,c,u,g]),de=t({componentName:"StackedBarChart",data:s,accessors:{categoryAccessor:c,valueAccessor:u},requiredProps:{stackBy:h}}),{effectiveLegendProps:ge,effectiveMargin:me}=di({ref:o,frameRef:n,setup:se});if(se.earlyReturn)return se.earlyReturn;const pe={chartType:"bar",...null!=s&&{data:re},oAccessor:c,rAccessor:u,stackBy:h,normalize:f,oSort:y,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:he,size:[q,X],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:me,barPadding:v,...null!=b&&{roundedTop:b},baselinePadding:w,enableHover:Y,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:te,rLabel:ie,rFormat:g,...$&&{oFormat:$},showGrid:Q,...ge,...B({title:Z,description:U,summary:J,accessibleTable:ee,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:A,defaultTooltipContent:ue}),...O({linkedHover:P,selection:C,onObservation:R,onClick:M,hoverHighlight:L,mobileInteraction:se.mobileInteraction,customHoverBehavior:se.customHoverBehavior,customClickBehavior:se.customClickBehavior}),...k&&k.length>0&&{annotations:k},...S&&{rExtent:S},...Object.fromEntries(Object.entries(_).filter(([e])=>"pieceStyle"!==e))};return de?xi(xt,{componentName:"StackedBarChart",message:de,width:q,height:X}):xi(wt,{componentName:"StackedBarChart",width:q,height:X,children:xi(ii,{ref:n,...pe})})});wi.displayName="StackedBarChart";import*as Ai from"react";import{useMemo as ki,useCallback as Si,forwardRef as _i,useRef as Ci,useImperativeHandle as Pi}from"react";import{useRef as Ri,useState as Mi,useCallback as Li,useMemo as Ii}from"react";import{useMemo as Ti,useCallback as Hi,useRef as Bi}from"react";var Oi={RdBu:Ne,PiYG:Ee,PRGn:Fe,BrBG:Oe,RdYlBu:De,RdYlGn:We,Spectral:je},Fi="__likert_neutral_neg",Ei="__likert_neutral_pos";function Ni(e,t){if("function"==typeof e)return e;const o=e||t;return e=>e[o]}function Di(e,t,o,i,r,n){const s=new Map,a=new Set(t);for(const l of e){const e=o(l);s.has(e)||s.set(e,new Map);const c=s.get(e);if(i){const e=i(l);if(null==e||!Number.isFinite(e))continue;if(!Number.isInteger(e)){"production"!==process.env.NODE_ENV&&console.warn("[LikertChart] Ignoring non-integer Likert score:",e);continue}const o=e-1;if(0>o||o>=t.length)continue;const r=t[o];c.set(r,(c.get(r)||0)+1)}else if(r&&n){const e=r(l),t=n(l);if(!a.has(e))continue;c.set(e,(c.get(e)||0)+(Number.isFinite(t)?t:0))}}const l=[];for(const[e,o]of s){let i=0;for(const e of t)i+=o.get(e)||0;if(0!==i)for(let r=0;t.length>r;r++){const n=t[r],s=o.get(n)||0;l.push({__likertCategory:e,__likertLevel:n,__likertLevelLabel:n,__likertCount:s,__likertPct:s/i*100,__likertLevelIndex:r})}}return l}function Wi(e,t){const o=t.length,i=o%2!=0,r=Math.floor(o/2),n=[];for(const t of e){const e=t.__likertLevelIndex;if(i&&e===r){const e=t.__likertPct/2;n.push({...t,__likertLevel:Fi,__likertPct:-e}),n.push({...t,__likertLevel:Ei,__likertPct:e})}else n.push(r>e?{...t,__likertPct:-t.__likertPct}:t)}return n}function ji(e,t){const o=t.length,i=o%2!=0,r=Math.floor(o/2),n=new Map;for(const t of e){const e=n.get(t.__likertCategory)||[];e.push(t),n.set(t.__likertCategory,e)}const s=[];for(const[,e]of n){const t=new Map;let n,a;for(const o of e)o.__likertLevel===Fi?n=o:o.__likertLevel===Ei?a=o:t.set(o.__likertLevelIndex,o);i&&n&&s.push(n);for(let e=r-1;e>=0;e--){const o=t.get(e);o&&s.push(o)}i&&a&&s.push(a);for(let e=i?r+1:r;o>e;e++){const o=t.get(e);o&&s.push(o)}}return s}var zi=["Very Low","Low","Neutral","High","Very High"];import{jsx as Gi}from"react/jsx-runtime";var Vi=new Map,$i=_i(function(e,o){const r=at(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=Ci(null),{data:s,margin:a,className:l,categoryAccessor:c="question",valueAccessor:h,levelAccessor:u,countAccessor:d="count",levels:g=zi,orientation:m="horizontal",colorScheme:p,barPadding:f=20,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:A,onObservation:k,onClick:S,hoverHighlight:_,chartId:C,valueFormat:P,loading:R,loadingContent:M,emptyContent:L,legendInteraction:I,legendPosition:T,categoryFormat:H,stroke:B,strokeWidth:F,opacity:E}=e,{width:N,height:D,enableHover:W,showGrid:j,showLegend:z,title:G,description:V,summary:$,accessibleTable:q,categoryLabel:X,valueLabel:Y}=r,Q="horizontal"===m,K=void 0===s,Z=!u,U=mt(),J=ki(()=>p&&Array.isArray(p)&&p.length>=g.length?p:function(e,t){if(0>=e)return[];if(t){const o=Oi[t];if(o){if(1===e)return[o(.5)];const t=[];for(let i=0;e>i;i++)t.push(o(i/(e-1)));return t}}const o=["#da1e28","#ff8389","#ffb3b8"],i=["#a6c8ff","#4589ff","#0043ce"],r="#a8a8a8";if(1===e)return[r];const n=e%2!=0,s=Math.floor(e/2),a=[];for(let e=0;s>e;e++)a.push(o[Math.min(Math.floor(e*o.length/s),o.length-1)]);n&&a.push(r);for(let e=0;s>e;e++)a.push(i[Math.min(Math.floor(e*i.length/s),i.length-1)]);return a}(g.length,U),[p,g.length,U]),ee=ki(()=>{const e=new Map;for(let t=0;g.length>t;t++)e.set(g[t],J[t]||"#888");return e},[g,J]),{processedData:te,reAggregate:oe,accumulatorRef:ie}=function({data:e,levels:t,categoryAccessor:o,valueAccessor:i,levelAccessor:r,countAccessor:n,isDiverging:s,frameRef:a}){const l=!r,c=Ti(()=>Ni(o,"question"),[o]),h=Ti(()=>l?Ni(i,"score"):null,[l,i]),u=Ti(()=>l?null:Ni(r,"level"),[l,r]),d=Ti(()=>l?null:Ni(n,"count"),[l,n]),g=Bi([]);return{processedData:Ti(()=>{const o=e||[];if(0===o.length)return[];let i=Di(o,t,c,h,u,d);return s&&(i=Wi(i,t),i=ji(i,t)),i},[e,t,c,h,u,d,s]),reAggregate:Hi(e=>{let o=Di(e,t,c,h,u,d);s&&(o=Wi(o,t),o=ji(o,t)),a.current?.replace(o)},[t,c,h,u,d,s,a]),accumulatorRef:g}}({data:s,levels:g,categoryAccessor:c,valueAccessor:h,levelAccessor:u,countAccessor:d,isDiverging:Q,frameRef:n}),re="__likertLevelLabel",ne=function({isPushMode:e,colorBy:t,colorScheme:o,showLegend:i,legendPosition:r="right"}){const n=Ri(new Set),s=Ri([]),[a,l]=Mi(0),c=st(),h=gt(),u=Li(e=>{if(!t)return null;const o="function"==typeof t?t(e):e[t];return null!=o?o+"":null},[t]),d=Li(o=>{if(!e||!t)return;let i=!1;for(const e of o){if(!e||"object"!=typeof e)continue;const t=u(e);null==t||n.current.has(t)||(n.current.add(t),s.current.push(t),i=!0)}i&&l(e=>e+1)},[e,t,u]),g=Li(o=>{if(!e||!t)return;const i=Array.from(new Set(o.map(String))),r=s.current;r.length===i.length&&r.every((e,t)=>e===i[t])||(n.current=new Set(i),s.current=i,l(e=>e+1))},[e,t]),m=Li(e=>t=>{d([t]),e(t)},[d]),p=Li(e=>t=>{d(t),e(t)},[d]),f=Li(()=>{n.current=new Set,s.current=[],l(e=>e+1)},[]);ht(e&&t?s.current:[]);const y=Ii(()=>{if(!e||!t||!1===i)return;const r=s.current;if(0===r.length)return;const n=Array.isArray(o)&&o.length>0||"string"==typeof o&&o.length>0?o:h&&h.length>0?h:ue,a="string"==typeof t?t:"__streamCat",l=r.map(e=>({[a]:e})),u=Ce(l,a,n);return Me({data:l,colorBy:a,colorScale:e=>c?.[e]||u(e)||"#999",getColor:Te})},[e,t,i,o,c,h,a]),v=Ii(()=>{if(y)return"right"===r?{right:110}:"left"===r?{left:110}:"top"===r?{top:50}:"bottom"===r?{bottom:80}:{right:110}},[y,r]);return{wrapPush:m,wrapPushMany:p,resetCategories:f,categories:s.current,categoryDomainProps:e&&t?{legendCategoryAccessor:t,onCategoriesChange:g}:{},streamingLegend:y,streamingMarginAdjust:v}}({isPushMode:K,colorBy:re,colorScheme:J,showLegend:z,legendPosition:T}),{wrapPush:se,wrapPushMany:ae}=ne,le=Si(e=>se(e=>{ie.current.push(e),oe(ie.current)})(e),[se,oe,ie]),ce=Si(e=>ae(e=>{ie.current.push(...e),oe(ie.current)})(e),[ae,oe,ie]);Pi(o,()=>({push:le,pushMany:ce,remove:e=>n.current?.remove(e)??[],update:(e,t)=>n.current?.update(e,t)??[],clear:()=>{ie.current=[],ne.resetCategories(),n.current?.clear()},getData:()=>n.current?.getData()??[],getScales:()=>n.current?.getScales()??null}),[le,ce,ie,ne]);const he=i({data:te,rawData:s,colorBy:re,colorScheme:J,legendInteraction:I,legendPosition:T,selection:w,linkedHover:A,fallbackFields:["__likertLevelLabel"],unwrapData:!0,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"LikertChart",chartId:C,showLegend:z,userMargin:a,marginDefaults:r.marginDefaults,loading:R,loadingContent:M,emptyContent:L,width:N,height:D}),de=ki(()=>{const e=g.length;return e%2!=0&&ee.get(g[Math.floor(e/2)])||"#888"},[g,ee]),ge=mi({colorBy:void 0,colorScale:void 0,color:void 0,themeCategorical:void 0,colorScheme:void 0,categoryIndexMap:Vi,userPieceStyle:x?.pieceStyle,stroke:B,strokeWidth:F,opacity:E,effectiveSelectionHook:he.effectiveSelectionHook,resolvedSelection:he.resolvedSelection,baseStyleExtras:e=>{const t=e.__likertLevelLabel||e.data?.__likertLevelLabel,o=e.__likertLevel||e.data?.__likertLevel;if(o===Fi||o===Ei)return{fill:de};const i=t||o;return i&&ee.has(i)?{fill:ee.get(i)}:{fill:"#888"}}}),me=ki(()=>{const e=g.length;return e%2!=0?g[Math.floor(e/2)]:""},[g]),pe=ki(()=>e=>{const t=e.data||e,o=t.__likertLevel||"Unknown",i=o===Fi||o===Ei?me:o,r=t.__likertCategory||"",n=Math.abs(t.__likertPct||0),s=o===Fi||o===Ei?2*n:n,a=t.__likertCount||0;return Ai.createElement("div",{className:"semiotic-tooltip",style:Le},Ai.createElement("div",{style:{fontWeight:"bold"}},r),Ai.createElement("div",{style:{marginTop:4}},`${i}: ${s.toFixed(1)}% (n=${a})`))},[me]),fe=ki(()=>{if(!g||2>g.length)return"LikertChart requires `levels` with at least 2 entries.";if(h&&u)return"LikertChart: provide either `valueAccessor` (raw responses) or `levelAccessor` + `countAccessor` (pre-aggregated), not both.";if(u&&!d)return"LikertChart: pre-aggregated mode requires both `levelAccessor` and `countAccessor`.";if(void 0!==s&&0===s.length)return null;const e={categoryAccessor:c};return Z?h&&(e.valueAccessor=h):(u&&(e.levelAccessor=u),d&&(e.countAccessor=d)),t({componentName:"LikertChart",data:s,accessors:e,requiredProps:{levels:g}})},[s,c,h,u,d,g,Z]),ye=ki(()=>[{styleFn:e=>({fill:ee.get(e.label)||"#888"}),items:g.map(e=>({label:e})),label:""}],[g,ee]),ve=ki(()=>!1!==z?{...he.legendBehaviorProps,legend:{legendGroups:ye},legendPosition:T||he.legendPosition||"bottom"}:he.legendBehaviorProps,[he.legendBehaviorProps,he.legendPosition,T,z,ye]),be=ki(()=>{const e={...he.margin};if(K&&!1!==z){const t=T||"bottom";"bottom"===t&&80>e.bottom?e.bottom=80:"top"===t&&50>e.top?e.top=50:"right"===t&&110>e.right?e.right=110:"left"===t&&110>e.left&&(e.left=110)}else if(ne.streamingMarginAdjust)for(const[t,o]of Object.entries(ne.streamingMarginAdjust))o>e[t]&&(e[t]=o);return Q&&100>e.left&&(e.left=100),e},[he.margin,ne.streamingMarginAdjust,Q,K,z,T]),xe=ki(()=>P||(Q?e=>Math.abs(Number(e)).toFixed(0)+"%":e=>Number(e).toFixed(0)+"%"),[Q,P]);if(he.earlyReturn)return he.earlyReturn;const we={chartType:"bar",...null!=s&&{data:te},oAccessor:"__likertCategory",rAccessor:"__likertPct",stackBy:"__likertLevel",normalize:!1,projection:Q?"horizontal":"vertical",pieceStyle:ge,size:[N,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:be,barPadding:f,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:X,rLabel:Y||(Q?void 0:"Percentage"),rFormat:xe,...H&&{oFormat:H},showGrid:j,...ve,...G&&{title:G},...V&&{description:V},...$&&{summary:$},...void 0!==q&&{accessibleTable:q},...l&&{className:l},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===y?()=>null:!0===y?pe:qe(y)||pe,...O({linkedHover:A,selection:w,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:he.mobileInteraction,customHoverBehavior:he.customHoverBehavior,customClickBehavior:he.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return fe?Gi(xt,{componentName:"LikertChart",message:fe,width:N,height:D}):Gi(wt,{componentName:"LikertChart",width:N,height:D,children:Gi(ii,{ref:n,...we})})});$i.displayName="LikertChart";import{useMemo as qi,forwardRef as Xi,useRef as Yi}from"react";import{useCallback as Qi,useRef as Ki}from"react";function Zi({brushProp:e,onBrushProp:t,linkedBrush:o,valueAccessor:i}){const r=$e("string"==typeof o?o:o?{name:o.name,xField:o.rField}:void 0),n="string"==typeof i?i:"value",s=nt({name:r?.name||"__unused_ordinal_brush__",xField:r?.xField||n}),a=Ki(s.brushInteraction);a.current=s.brushInteraction;const l=Qi(e=>{if(r){a.current.end(e?e.r:null)}t?.(e)},[t,r]),c=!!(e||o||t);return{hasBrush:c,handleBrush:l,brushStreamProps:c?{brush:{dimension:"r"},onBrush:l}:{}}}import{jsx as Ui}from"react/jsx-runtime";var Ji=Xi(function(e,o){const r=at(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=Yi(null);n(o,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:g,colorBy:m,colorScheme:p,sizeBy:f,sizeRange:y=[3,8],symbolBy:v,symbolMap:b,pointRadius:x=4,pointOpacity:w=.7,categoryPadding:A=20,tooltip:k,annotations:S,valueExtent:_,brush:C,onBrush:P,linkedBrush:R,frameProps:M={},selection:L,linkedHover:I,onObservation:T,onClick:H,hoverHighlight:F,chartId:D,loading:W,loadingContent:j,emptyContent:z,legendInteraction:G,legendPosition:V,color:$,stroke:q,strokeWidth:X,opacity:Y,showCategoryTicks:Q,categoryFormat:K}=e,{width:Z,height:U,enableHover:J,showGrid:ee,showLegend:te,title:oe,description:ie,summary:re,accessibleTable:ne,categoryLabel:se,valueLabel:ae}=r,le=qi(()=>Ie(a),[a]),ce=i({data:le,rawData:a,colorBy:m,colorScheme:p,legendInteraction:G,legendPosition:V,selection:L,linkedHover:I,fallbackFields:m?["string"==typeof m?m:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:T,onClick:H,hoverHighlight:F,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"SwarmPlot",chartId:D,showLegend:te,userMargin:l,marginDefaults:r.marginDefaults,loading:W,loadingContent:j,emptyContent:z,width:Z,height:U}),he=Zi({brushProp:C,onBrushProp:P,linkedBrush:R,valueAccessor:u}),ue=qi(()=>{if(!f)return;const e=le.map(e=>"function"==typeof f?f(e):e[f]);return yt(e)},[le,f]),de=gt(),ge=qi(()=>new Map,[]),me=mi({colorBy:m,colorScale:ce.colorScale,color:$,themeCategorical:de,colorScheme:p,categoryIndexMap:ge,userPieceStyle:M?.pieceStyle,stroke:q,strokeWidth:X,opacity:Y,effectiveSelectionHook:ce.effectiveSelectionHook,resolvedSelection:ce.resolvedSelection,baseStyleExtras:e=>({fillOpacity:w,r:f?Be(e,f,y,ue):x})}),pe=qi(()=>E({categoryAccessor:h,valueAccessor:u,groupAccessor:m||void 0,valueFormat:g}),[h,u,m,g]);if(ce.earlyReturn)return ce.earlyReturn;const fe=t({componentName:"SwarmPlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(fe)return Ui(xt,{componentName:"SwarmPlot",message:fe,width:Z,height:U});const ye={chartType:"swarm",...null!=a&&{data:le},oAccessor:h,rAccessor:u,...v&&{symbolAccessor:v},...b&&{symbolMap:b},projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:me,size:[Z,U],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ce.margin,barPadding:A,enableHover:J,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:se,rLabel:ae,rFormat:g,...K&&{oFormat:K},showGrid:ee,showCategoryTicks:Q,...ce.legendBehaviorProps,...B({title:oe,description:ie,summary:re,accessibleTable:ne,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:k,defaultTooltipContent:pe}),...O({linkedHover:I,selection:L,onObservation:T,onClick:H,hoverHighlight:F,mobileInteraction:ce.mobileInteraction,customHoverBehavior:ce.customHoverBehavior,customClickBehavior:ce.customClickBehavior}),...S&&S.length>0&&{annotations:S},..._&&{rExtent:_},...he.brushStreamProps,...Object.fromEntries(Object.entries(M).filter(([e])=>"pieceStyle"!==e))};return Ui(wt,{componentName:"SwarmPlot",width:Z,height:U,children:Ui(ii,{ref:s,...ye})})});Ji.displayName="SwarmPlot";import{useMemo as er,forwardRef as tr,useRef as or}from"react";import{jsx as ir,jsxs as rr}from"react/jsx-runtime";function nr(e){return t=>{const o=t.category||t.data&&t.data[0]?.category||"",i=t.stats||(t.data||t).stats;if(i&&null!=i.median)return rr("div",{className:"semiotic-tooltip",style:Le,children:[o&&ir("div",{style:{fontWeight:"bold"},children:o+""}),null!=i.n&&rr("div",{children:["n = ",i.n]}),null!=i.min&&rr("div",{children:["Min: ",i.min.toLocaleString()]}),null!=i.q1&&rr("div",{children:["Q1: ",i.q1.toLocaleString()]}),rr("div",{children:["Median: ",i.median.toLocaleString()]}),null!=i.q3&&rr("div",{children:["Q3: ",i.q3.toLocaleString()]}),null!=i.max&&rr("div",{children:["Max: ",i.max.toLocaleString()]}),null!=i.mean&&rr("div",{style:{opacity:.8},children:["Mean: ",i.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});if(e?.valueAccessor){const i=e.valueAccessor,r=(Array.isArray(t.data)?t.data:[]).map(e=>Number("function"==typeof i?i(e):e[i])).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t),n=r.length,s=n>0?n%2!=0?r[Math.floor(n/2)]:(r[n/2-1]+r[n/2])/2:null;return rr("div",{className:"semiotic-tooltip",style:Le,children:[o&&ir("div",{style:{fontWeight:"bold"},children:o+""}),n>0&&rr("div",{children:["n = ",n]}),null!=s&&rr("div",{children:["Median: ",s.toLocaleString()]})]})}return ir("div",{className:"semiotic-tooltip",style:Le,children:ir("div",{style:{fontWeight:"bold"},children:o+""})})}}import{jsx as sr}from"react/jsx-runtime";var ar=tr(function(e,o){const r=at(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=or(null);n(o,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",valueFormat:g,colorBy:m,colorScheme:p,showOutliers:f=!0,outlierRadius:y=3,categoryPadding:v=20,tooltip:b,annotations:x,valueExtent:w,frameProps:A={},selection:k,linkedHover:S,onObservation:_,onClick:C,hoverHighlight:P,chartId:R,loading:M,loadingContent:L,emptyContent:I,legendInteraction:T,legendPosition:H,color:F,stroke:E,strokeWidth:D,opacity:W,showCategoryTicks:j,categoryFormat:z}=e,{width:G,height:V,enableHover:$,showGrid:q,showLegend:X,title:Y,description:Q,summary:K,accessibleTable:Z,categoryLabel:U,valueLabel:J}=r,ee=er(()=>Ie(a),[a]),te=i({data:ee,rawData:a,colorBy:m,colorScheme:p,legendInteraction:T,legendPosition:H,selection:k,linkedHover:S,fallbackFields:m?["string"==typeof m?m:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"BoxPlot",chartId:R,showLegend:X,userMargin:l,marginDefaults:r.marginDefaults,loading:M,loadingContent:L,emptyContent:I,width:G,height:V}),oe=gt(),ie=er(()=>new Map,[]),re=mi({colorBy:m,colorScale:te.colorScale,color:F,themeCategorical:oe,colorScheme:p,categoryIndexMap:ie,userPieceStyle:void 0,stroke:E,strokeWidth:D,opacity:W,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0}),ne=er(()=>nr(),[]);if(te.earlyReturn)return te.earlyReturn;const se=t({componentName:"BoxPlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(se)return sr(xt,{componentName:"BoxPlot",message:se,width:G,height:V});const ae={chartType:"boxplot",...null!=a&&{data:ee},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:re,showOutliers:f,size:[G,V],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,barPadding:v,enableHover:$,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:U,rLabel:J,rFormat:g,...z&&{oFormat:z},showGrid:q,showCategoryTicks:j,...te.legendBehaviorProps,...B({title:Y,description:Q,summary:K,accessibleTable:Z,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:b,defaultTooltipContent:ne}),...O({linkedHover:S,selection:k,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...x&&x.length>0&&{annotations:x},...w&&{rExtent:w},...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return sr(wt,{componentName:"BoxPlot",width:G,height:V,children:sr(ii,{ref:s,...ae})})});ar.displayName="BoxPlot";import{useMemo as lr,forwardRef as cr,useRef as hr}from"react";import{jsx as ur,jsxs as dr}from"react/jsx-runtime";var gr=e=>{const t=e?.category;return null==t?"All":t+""},mr=cr(function(e,o){const r=at(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:"horizontal",mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=hr(null);n(o,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h=gr,valueAccessor:u="value",bins:d=25,relative:g=!1,valueFormat:m,colorBy:p,colorScheme:f,categoryPadding:y=20,tooltip:v,annotations:b,valueExtent:x,brush:w,onBrush:A,linkedBrush:k,frameProps:S={},selection:_,linkedHover:C,onObservation:P,onClick:R,hoverHighlight:M,chartId:L,loading:I,loadingContent:T,emptyContent:H,legendInteraction:F,legendPosition:E,color:D,stroke:W,strokeWidth:j,opacity:z,showCategoryTicks:G,categoryFormat:V}=e,{width:$,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=r,oe=lr(()=>Ie(a),[a]),ie=i({data:oe,rawData:a,colorBy:p,colorScheme:f,legendInteraction:F,legendPosition:E,selection:_,linkedHover:C,fallbackFields:p?["string"==typeof p?p:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"Histogram",chartId:L,showLegend:Q,userMargin:l,marginDefaults:r.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:$,height:q}),re=Zi({brushProp:w,onBrushProp:A,linkedBrush:k,valueAccessor:u}),ne=lr(()=>{if(0===oe.length)return;const e="function"==typeof u?u:e=>e[u];let t=1/0,o=-1/0;for(const i of oe){const r=e(i);null!=r&&isFinite(r)&&(t>r&&(t=r),r>o&&(o=r))}return t>o?void 0:[t,o]},[oe,u]),se=gt(),ae=lr(()=>new Map,[]),le=mi({colorBy:p,colorScale:ie.colorScale,color:D,themeCategorical:se,colorScheme:f,categoryIndexMap:ae,userPieceStyle:void 0,stroke:W,strokeWidth:j,opacity:z,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0}),ce=lr(()=>e=>{const t=e.data||e,o=t.category||e.category||"",i=t.count,r=t.range;return dr("div",{className:"semiotic-tooltip",style:Le,children:[o&&ur("div",{style:{fontWeight:"bold"},children:o+""}),null!=i&&dr("div",{children:["Count: ",i]}),r&&2===r.length&&dr("div",{style:{opacity:.8},children:[Number(r[0]).toFixed(1)," – ",Number(r[1]).toFixed(1)]})]})},[]);if(ie.earlyReturn)return ie.earlyReturn;const he=t({componentName:"Histogram",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(he)return ur(xt,{componentName:"Histogram",message:he,width:$,height:q});const ue={chartType:"histogram",...null!=a&&{data:oe},oAccessor:h,rAccessor:u,projection:"horizontal",summaryStyle:le,bins:d,normalize:g,...x?{rExtent:x}:ne&&{rExtent:ne},size:[$,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie.margin,barPadding:y,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:ee,rLabel:te,rFormat:m,...V&&{oFormat:V},showGrid:Y,showCategoryTicks:G,...ie.legendBehaviorProps,...B({title:K,description:Z,summary:U,accessibleTable:J,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:v,defaultTooltipContent:ce}),...O({linkedHover:C,selection:_,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...b&&b.length>0&&{annotations:b},...re.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return ur(wt,{componentName:"Histogram",width:$,height:q,children:ur(ii,{ref:s,...ue})})});mr.displayName="Histogram";import{useMemo as pr,forwardRef as fr,useRef as yr}from"react";import{jsx as vr}from"react/jsx-runtime";var br=fr(function(e,o){const r=at(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=yr(null);n(o,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="vertical",bins:g=25,curve:m="catmullRom",showIQR:p=!0,valueFormat:f,colorBy:y,colorScheme:v,categoryPadding:b=20,tooltip:x,annotations:w,valueExtent:A,brush:k,onBrush:S,linkedBrush:_,frameProps:C={},selection:P,linkedHover:R,onObservation:M,onClick:L,hoverHighlight:I,chartId:T,loading:H,loadingContent:F,emptyContent:E,legendInteraction:D,legendPosition:W,color:j,stroke:z,strokeWidth:G,opacity:V,showCategoryTicks:$,categoryFormat:q}=e,{width:X,height:Y,enableHover:Q,showGrid:K,showLegend:Z,title:U,description:J,summary:ee,accessibleTable:te,categoryLabel:oe,valueLabel:ie}=r,re=pr(()=>Ie(a),[a]),ne=i({data:re,rawData:a,colorBy:y,colorScheme:v,legendInteraction:D,legendPosition:W,selection:P,linkedHover:R,fallbackFields:y?["string"==typeof y?y:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"ViolinPlot",chartId:T,showLegend:Z,userMargin:l,marginDefaults:r.marginDefaults,loading:H,loadingContent:F,emptyContent:E,width:X,height:Y}),se=Zi({brushProp:k,onBrushProp:S,linkedBrush:_,valueAccessor:u}),ae=gt(),le=pr(()=>new Map,[]),ce=mi({colorBy:y,colorScale:ne.colorScale,color:j,themeCategorical:ae,colorScheme:v,categoryIndexMap:le,userPieceStyle:void 0,stroke:z,strokeWidth:G,opacity:V,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection,baseStyleExtras:{fillOpacity:.6},linkStrokeToFill:!0}),he=pr(()=>nr({valueAccessor:u}),[u]);if(ne.earlyReturn)return ne.earlyReturn;const ue=t({componentName:"ViolinPlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(ue)return vr(xt,{componentName:"ViolinPlot",message:ue,width:X,height:Y});const de={chartType:"violin",...null!=a&&{data:re},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:ce,bins:g,showIQR:p,size:[X,Y],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ne.margin,barPadding:b,enableHover:Q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:oe,rLabel:ie,rFormat:f,...q&&{oFormat:q},showGrid:K,showCategoryTicks:$,...ne.legendBehaviorProps,...B({title:U,description:J,summary:ee,accessibleTable:te,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:x,defaultTooltipContent:he}),...O({linkedHover:R,selection:P,onObservation:M,onClick:L,hoverHighlight:I,mobileInteraction:ne.mobileInteraction,customHoverBehavior:ne.customHoverBehavior,customClickBehavior:ne.customClickBehavior}),...w&&w.length>0&&{annotations:w},...A&&{rExtent:A},...se.brushStreamProps,...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};return vr(wt,{componentName:"ViolinPlot",width:X,height:Y,children:vr(ii,{ref:s,...de})})});br.displayName="ViolinPlot";import{useMemo as xr,forwardRef as wr,useRef as Ar}from"react";import{jsx as kr}from"react/jsx-runtime";var Sr=wr(function(e,o){const r=at(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=Ar(null);n(o,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,categoryAccessor:h="category",valueAccessor:u="value",orientation:d="horizontal",bins:g=20,amplitude:m=1.5,valueFormat:p,colorBy:f,colorScheme:y,categoryPadding:v=5,tooltip:b,annotations:x,valueExtent:w,frameProps:A={},selection:k,linkedHover:S,onObservation:_,onClick:C,hoverHighlight:P,chartId:R,loading:M,loadingContent:L,emptyContent:I,legendInteraction:T,legendPosition:H,color:F,stroke:E,strokeWidth:D,opacity:W,showCategoryTicks:j,categoryFormat:z}=e,{width:G,height:V,enableHover:$,showGrid:q,showLegend:X,title:Y,description:Q,summary:K,accessibleTable:Z,categoryLabel:U,valueLabel:J}=r,ee=xr(()=>Ie(a),[a]),te=i({data:ee,rawData:a,colorBy:f,colorScheme:y,legendInteraction:T,legendPosition:H,selection:k,linkedHover:S,fallbackFields:f?["string"==typeof f?f:""]:["string"==typeof h?h:""],unwrapData:!0,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"RidgelinePlot",chartId:R,showLegend:X,userMargin:l,marginDefaults:r.marginDefaults,loading:M,loadingContent:L,emptyContent:I,width:G,height:V}),oe=gt(),ie=xr(()=>new Map,[]),re=mi({colorBy:f,colorScale:te.colorScale,color:F,themeCategorical:oe,colorScheme:y,categoryIndexMap:ie,userPieceStyle:void 0,stroke:E,strokeWidth:D,opacity:W,effectiveSelectionHook:te.effectiveSelectionHook,resolvedSelection:te.resolvedSelection,baseStyleExtras:{fillOpacity:.5},linkStrokeToFill:!0}),ne=xr(()=>nr(),[]);if(te.earlyReturn)return te.earlyReturn;const se=t({componentName:"RidgelinePlot",data:a,accessors:{categoryAccessor:h,valueAccessor:u}});if(se)return kr(xt,{componentName:"RidgelinePlot",message:se,width:G,height:V});const ae={chartType:"ridgeline",...null!=a&&{data:ee},oAccessor:h,rAccessor:u,projection:"horizontal"===d?"horizontal":"vertical",summaryStyle:re,bins:g,size:[G,V],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:te.margin,barPadding:v,enableHover:$,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:U,rLabel:J,rFormat:p,...z&&{oFormat:z},showGrid:q,showCategoryTicks:j,oSort:!1,amplitude:m,...te.legendBehaviorProps,...B({title:Y,description:Q,summary:K,accessibleTable:Z,className:c,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:b,defaultTooltipContent:ne}),...O({linkedHover:S,selection:k,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:te.mobileInteraction,customHoverBehavior:te.customHoverBehavior,customClickBehavior:te.customClickBehavior}),...x&&x.length>0&&{annotations:x},...w&&{rExtent:w},...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return kr(wt,{componentName:"RidgelinePlot",width:G,height:V,children:kr(ii,{ref:s,...ae})})});Sr.displayName="RidgelinePlot";import{useMemo as _r,forwardRef as Cr,useRef as Pr}from"react";import{jsx as Rr,jsxs as Mr}from"react/jsx-runtime";var Lr=Cr(function(e,o){const r=at(e.mode,{width:e.width,height:e.height,showGrid:!1,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:!1,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),s=Pr(null);n(o,{variant:"xy",frameRef:s});const{data:a,margin:l,className:c,stepAccessor:h="step",valueAccessor:u="value",categoryAccessor:d,colorBy:g,colorScheme:m,orientation:p="horizontal",connectorOpacity:f=.3,showLabels:y=!0,tooltip:v,annotations:b,frameProps:x={},selection:w,linkedHover:A,onObservation:k,onClick:S,hoverHighlight:_,chartId:C,loading:P,loadingContent:R,emptyContent:M,legendInteraction:L,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:F,categoryFormat:E}=e,N="vertical"===p,{width:D,height:W,enableHover:j,showLegend:z,title:G,description:V,summary:$,accessibleTable:q}=r,X=N?{top:G?60:40,right:20,bottom:60,left:60}:{top:G?40:10,right:10,bottom:10,left:10},Y=_r(()=>Ie(a),[a]),Q=g||d,K=!Q,Z=i({data:Y,rawData:a,colorBy:Q,colorScheme:m,legendInteraction:L,legendPosition:I,selection:w,linkedHover:A,fallbackFields:Q?["string"==typeof Q?Q:""]:[],unwrapData:!0,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"FunnelChart",chartId:C,showLegend:z,userMargin:l,marginDefaults:X,loading:P,loadingContent:R,emptyContent:M,width:D,height:W});St("FunnelChart",Y,"stepAccessor",h),St("FunnelChart",Y,"valueAccessor",u);const U=gt(),J=_r(()=>new Map,[]),ee=_r(()=>{if(K)return T||(U?.[0]?U[0]:Array.isArray(m)&&m[0]?m[0]:"#4e79a7")},[K,T,U,m]),te=mi({colorBy:ee?void 0:Q,colorScale:Z.colorScale,color:ee??T,themeCategorical:U,colorScheme:m,categoryIndexMap:J,userPieceStyle:x?.pieceStyle,stroke:H,strokeWidth:B,opacity:F,effectiveSelectionHook:Z.effectiveSelectionHook,resolvedSelection:Z.resolvedSelection}),oe=_r(()=>e=>{const t=e?.data||e,o=t?.__funnelStep||t?.__barFunnelStep||t?.step||"",i=t?.__funnelValue??t?.__barFunnelValue??t?.value??"",r=t?.__funnelPercent??t?.__barFunnelPercent,n=t?.__funnelIsFirstStep??t?.__barFunnelIsFirstStep,s=t?.__barFunnelIsDropoff,a=t?.__barFunnelCategory??t?.category,l=null==r||n?"":` (${.05>Math.abs(r-Math.round(r))?Math.round(r)+"%":r.toFixed(1)+"%"})`;return Mr("div",{className:"semiotic-tooltip",style:Le,children:[o&&Rr("div",{style:{fontWeight:"bold"},children:o+""}),a&&a!==o&&Rr("div",{style:{marginTop:2,opacity:.8},children:a+""}),s&&Rr("div",{style:{marginTop:2,fontStyle:"italic",opacity:.7},children:"Dropoff"}),Mr("div",{style:{marginTop:4},children:[i+"",l]})]})},[]);if(Z.earlyReturn)return Z.earlyReturn;const ie=t({componentName:"FunnelChart",data:a,accessors:{stepAccessor:h,valueAccessor:u}});if(ie)return Rr(xt,{componentName:"FunnelChart",message:ie,width:D,height:W});const re={chartType:N?"bar-funnel":"funnel",...null!=a&&{data:Y},oAccessor:h,rAccessor:u,...d&&{stackBy:d},projection:N?"vertical":"horizontal",barPadding:N?40:0,pieceStyle:te,size:[D,W],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z.margin,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:N,showCategoryTicks:N,...E&&{oFormat:E},showGrid:N,...!N&&{connectorOpacity:f},showLabels:y,...Z.legendBehaviorProps,...G&&{title:G},...V&&{description:V},...$&&{summary:$},...void 0!==q&&{accessibleTable:q},...c&&{className:c},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===v?()=>null:!0===v||null==v?oe:qe(v)||oe,...O({linkedHover:A,selection:w,onObservation:k,onClick:S,hoverHighlight:_,mobileInteraction:Z.mobileInteraction,customHoverBehavior:Z.customHoverBehavior,customClickBehavior:Z.customClickBehavior}),...b&&b.length>0&&{annotations:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};return Rr(wt,{componentName:"FunnelChart",width:D,height:W,children:Rr(ii,{ref:s,...re})})});Lr.displayName="FunnelChart";import{useMemo as Ir,forwardRef as Tr,useRef as Hr}from"react";import{jsx as Br}from"react/jsx-runtime";var Or=Tr(function(o,r){const s=at(o.mode,{width:o.width,height:o.height,showGrid:o.showGrid??!0,enableHover:o.enableHover,showLegend:o.showLegend,title:o.title,description:o.description,accessibleTable:o.accessibleTable,summary:o.summary,categoryLabel:o.categoryLabel,valueLabel:o.valueLabel,showCategoryTicks:o.showCategoryTicks,orientation:o.orientation,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,responsiveRules:o.responsiveRules}),a=Hr(null);n(r,{variant:"xy",frameRef:a});const{data:l,margin:c,className:h,categoryAccessor:u="category",valueAccessor:d="value",orientation:g="horizontal",valueFormat:m,colorBy:p,colorScheme:f,sort:y="auto",dotRadius:v=5,categoryPadding:b=10,tooltip:x,annotations:w,regression:A,valueExtent:k,frameProps:S={},selection:_,linkedHover:C,onObservation:P,onClick:R,hoverHighlight:M,chartId:L,loading:I,loadingContent:T,emptyContent:H,legendInteraction:F,legendPosition:D,color:W,stroke:j,strokeWidth:z,opacity:G,categoryFormat:V}=o,{width:$,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=s,oe=Ir(()=>Ie(l),[l]),ie=i({data:oe,rawData:l,colorBy:p,colorScheme:f,legendInteraction:F,legendPosition:D,selection:_,linkedHover:C,fallbackFields:p?["string"==typeof p?p:""]:["string"==typeof u?u:""],unwrapData:!0,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:s.mobileInteraction,mobileSemantics:s.mobileSemantics,chartType:"DotPlot",chartId:L,showLegend:Q,userMargin:c,marginDefaults:s.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:$,height:q}),re=dt(oe,y,d),ne=gt(),se=Ir(()=>new Map,[]),ae=mi({colorBy:p,colorScale:ie.colorScale,color:W,themeCategorical:ne,colorScheme:f,categoryIndexMap:se,userPieceStyle:S?.pieceStyle,stroke:j,strokeWidth:z,opacity:G,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:{r:v,fillOpacity:.8}}),le=Ir(()=>E({categoryAccessor:u,valueAccessor:d,valueFormat:m}),[u,d,m]);if(ie.earlyReturn)return ie.earlyReturn;const ce=t({componentName:"DotPlot",data:l,accessors:{categoryAccessor:u,valueAccessor:d}});if(ce)return Br(xt,{componentName:"DotPlot",message:ce,width:$,height:q});const he=e(A),ue=he?[he,...w||[]]:w,de={chartType:"point",...null!=l&&{data:re},oAccessor:u,rAccessor:d,projection:"horizontal"===g?"horizontal":"vertical",pieceStyle:ae,size:[$,q],responsiveWidth:o.responsiveWidth,responsiveHeight:o.responsiveHeight,margin:ie.margin,barPadding:b,enableHover:X,...o.dataIdAccessor&&{dataIdAccessor:o.dataIdAccessor},showAxes:s.showAxes,oLabel:ee,rLabel:te,rFormat:m,...V&&{oFormat:V},showGrid:Y,oSort:y,...ie.legendBehaviorProps,...B({title:K,description:Z,summary:U,accessibleTable:J,className:h,animate:o.animate,axisExtent:o.axisExtent,autoPlaceAnnotations:o.autoPlaceAnnotations}),...N({tooltip:x,defaultTooltipContent:le}),...O({linkedHover:C,selection:_,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...ue&&ue.length>0&&{annotations:ue},...k&&{rExtent:k},...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return Br(wt,{componentName:"DotPlot",width:$,height:q,children:Br(ii,{ref:a,...de})})});Or.displayName="DotPlot";import{useMemo as Fr,forwardRef as Er,useRef as Nr}from"react";import{jsx as Dr}from"react/jsx-runtime";var Wr=Er(function(e,o){const r=at(e.mode,{width:e.width??400,height:e.height??400,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=Nr(null),{data:s,margin:a,className:l,categoryAccessor:c="category",valueAccessor:h="value",colorBy:u,colorScheme:d,startAngle:g=0,cornerRadius:m,tooltip:p,annotations:f,frameProps:y={},selection:v,linkedHover:b,onObservation:x,onClick:w,hoverHighlight:A,chartId:k,loading:S,loadingContent:_,emptyContent:C,legendInteraction:P,legendPosition:R,color:M,stroke:L,strokeWidth:I,opacity:T}=e,{width:H,height:F,enableHover:D,showLegend:W,title:j,description:z,summary:G,accessibleTable:V}=r,$=Fr(()=>Ie(s),[s]),q=u||c,X=i({data:$,rawData:s,colorBy:q,colorScheme:d,legendInteraction:P,legendPosition:R,selection:v,linkedHover:b,fallbackFields:q?["string"==typeof q?q:""]:[],unwrapData:!0,onObservation:x,onClick:w,hoverHighlight:A,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"PieChart",chartId:k,showLegend:W,userMargin:a,marginDefaults:r.marginDefaults,loading:S,loadingContent:_,emptyContent:C,width:H,height:F}),Y=gt(),Q=Fr(()=>new Map,[]),K=mi({colorBy:q,colorScale:X.colorScale,color:M,themeCategorical:Y,colorScheme:d,categoryIndexMap:Q,userPieceStyle:y?.pieceStyle,stroke:L,strokeWidth:I,opacity:T,effectiveSelectionHook:X.effectiveSelectionHook,resolvedSelection:X.resolvedSelection,cycleByCategory:!0}),Z=Fr(()=>E({categoryAccessor:c,valueAccessor:h,groupAccessor:u&&u!==c?u:void 0,groupLabel:"string"==typeof u?u:"group",pieData:!0}),[c,h,u]),U=t({componentName:"PieChart",data:s,accessors:{categoryAccessor:c,valueAccessor:h}}),{effectiveLegendProps:J,effectiveMargin:ee}=di({ref:o,frameRef:n,setup:X});if(X.earlyReturn)return X.earlyReturn;const te={chartType:"pie",...null!=s&&{data:$},oAccessor:c,rAccessor:h,projection:"radial",pieceStyle:K,startAngle:g,...null!=m&&{cornerRadius:m},size:[H,F],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee,enableHover:D,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...J,...B({title:j,description:z,summary:G,accessibleTable:V,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:p,defaultTooltipContent:Z}),...O({linkedHover:b,selection:v,onObservation:x,onClick:w,hoverHighlight:A,mobileInteraction:X.mobileInteraction,customHoverBehavior:X.customHoverBehavior,customClickBehavior:X.customClickBehavior}),...f&&f.length>0&&{annotations:f},...Object.fromEntries(Object.entries(y).filter(([e])=>"pieceStyle"!==e))};return U?Dr(xt,{componentName:"PieChart",message:U,width:H,height:F}):Dr(wt,{componentName:"PieChart",width:H,height:F,children:Dr(ii,{ref:n,...te})})});Wr.displayName="PieChart";import{useMemo as jr,forwardRef as zr,useRef as Gr}from"react";import{jsx as Vr}from"react/jsx-runtime";var $r=zr(function(e,o){const r=at(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,linkedHover:e.linkedHover,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:400,height:400}),n=Gr(null),{data:s,margin:a,className:l,categoryAccessor:c="category",valueAccessor:h="value",innerRadius:u,centerContent:d,colorBy:g,colorScheme:m,startAngle:p=0,cornerRadius:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:A,onClick:k,hoverHighlight:S,chartId:_,loading:C,loadingContent:P,emptyContent:R,legendInteraction:M,legendPosition:L,color:I,stroke:T,strokeWidth:H,opacity:F}=e,{width:D,height:W,enableHover:j,showLegend:z,title:G,description:V,summary:$,accessibleTable:q}=r,X=jr(()=>Ie(s),[s]),Y=g||c,Q=i({data:X,rawData:s,colorBy:Y,colorScheme:m,legendInteraction:M,legendPosition:L,selection:x,linkedHover:w,fallbackFields:Y?["string"==typeof Y?Y:""]:[],unwrapData:!0,onObservation:A,onClick:k,hoverHighlight:S,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"DonutChart",chartId:_,showLegend:z,userMargin:a,marginDefaults:r.marginDefaults,loading:C,loadingContent:P,emptyContent:R,width:D,height:W}),K=u??Math.max(2,.15*Math.min(D,W)),Z=gt(),U=jr(()=>new Map,[]),J=mi({colorBy:Y,colorScale:Q.colorScale,color:I,themeCategorical:Z,colorScheme:m,categoryIndexMap:U,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:F,effectiveSelectionHook:Q.effectiveSelectionHook,resolvedSelection:Q.resolvedSelection,cycleByCategory:!0}),ee=jr(()=>E({categoryAccessor:c,valueAccessor:h,groupAccessor:g&&g!==c?g:void 0,groupLabel:"string"==typeof g?g:"group",pieData:!0}),[c,h,g]),te=t({componentName:"DonutChart",data:s,accessors:{categoryAccessor:c,valueAccessor:h}}),{effectiveLegendProps:oe,effectiveMargin:ie}=di({ref:o,frameRef:n,setup:Q});if(Q.earlyReturn)return Q.earlyReturn;const re={chartType:"donut",...null!=s&&{data:X},oAccessor:c,rAccessor:h,projection:"radial",pieceStyle:J,innerRadius:K,startAngle:p,...null!=f&&{cornerRadius:f},centerContent:d,size:[D,W],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie,enableHover:j,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...oe,...B({title:G,description:V,summary:$,accessibleTable:q,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:y,defaultTooltipContent:ee}),...O({linkedHover:w,selection:x,onObservation:A,onClick:k,hoverHighlight:S,mobileInteraction:Q.mobileInteraction,customHoverBehavior:Q.customHoverBehavior,customClickBehavior:Q.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return te?Vr(xt,{componentName:"DonutChart",message:te,width:D,height:W}):Vr(wt,{componentName:"DonutChart",width:D,height:W,children:Vr(ii,{ref:n,...re})})});$r.displayName="DonutChart";import{useMemo as qr,forwardRef as Xr,useRef as Yr}from"react";function Qr(e=240){const t=360-e,o=180+t/2,i=o*Math.PI/180;return{sweepRad:e*Math.PI/180,gapDeg:t,startAngleDeg:o,startAngleRad:i,offsetRad:-Math.PI/2+i}}function Kr(e){return Math.max(0,Math.min(1,e))}function Zr(e){const t=e.trim();if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e.split("").map(e=>e+e).join("")),6===e.length&&/^[0-9a-f]{6}$/i.test(e))return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}const o=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);if(o){const e=[Number(o[1]),Number(o[2]),Number(o[3])];if(e.every(Number.isFinite))return e}return null}function Ur(e,t,o){const i=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0");return`#${i(e)}${i(t)}${i(o)}`}function Jr(e,t){const o=e.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:Kr(e.offset),color:e.color})).sort((e,t)=>e.offset-t.offset);if(0===o.length)return"#999999";if(1===o.length)return o[0].color;const i=Kr(t);if(o[0].offset>=i)return o[0].color;if(i>=o[o.length-1].offset)return o[o.length-1].color;for(let e=0;o.length-1>e;e++){const t=o[e],r=o[e+1];if(t.offset>i||i>r.offset)continue;const n=r.offset-t.offset,s=n>0?(i-t.offset)/n:0,a=Zr(t.color),l=Zr(r.color);if(!a||!l)return.5>s?t.color:r.color;const[c,h,u]=a,[d,g,m]=l;return Ur(c+(d-c)*s,h+(g-h)*s,u+(m-u)*s)}return o[o.length-1].color}function en(e,t,o){return null==o?`${e}-${t}`:`${e}-${t}-${o}`}import{jsx as tn,jsxs as on}from"react/jsx-runtime";var rn=Xr(function(e,t){const i=at(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:!1,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},{width:300,height:250}),r=Yr(null),n="context"===e.mode,{compactMode:s}=i,{value:a,min:l=0,max:c=100,thresholds:h,gradientFill:u,color:d,backgroundColor:g="var(--semiotic-grid, #e0e0e0)",arcWidth:m=.3,cornerRadius:p,showNeedle:f=!0,needleColor:y="var(--semiotic-text, #333)",centerContent:v,valueFormat:b,showScaleLabels:x=!s,sweep:w=240,fillZones:A=!0,tooltip:k,annotations:S,frameProps:_={},className:C,stroke:P,strokeWidth:R,opacity:M}=e,{width:L,height:I,title:T,description:H,summary:B,accessibleTable:O}=i,F=u&&"object"==typeof u?u:void 0,E=Math.max(l,Math.min(c,a)),N=c-l||1,D=(E-l)/N,{gaugeData:W,pieceStyle:j,gaugeAnnotations:z}=qr(()=>function(e){const{min:t,max:o,value:i,thresholds:r,fillColor:n,backgroundColor:s,fillZones:a,showScaleLabels:l,gradientFill:c,gradientSteps:h=240}=e,u=o-t||1,d=(Math.max(t,Math.min(o,i))-t)/u;let g=r&&r.length>0?[...r].sort((e,t)=>e.value-t.value):[{value:o,color:n||"#007bff"}];g=g.map(e=>({...e,value:Math.max(t,Math.min(o,e.value))})),o>g[g.length-1].value&&g.push({value:o,color:g[g.length-1].color});const m=!!c&&c.colorStops.length>=2,p=[],f=new Map,y=[];if(m){const e=a?d:1,t=en("bg",0);if(p.push({category:t,value:1,_zone:"Track",_isFill:!1,_pctStart:0,_pct:1,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0}),f.set(t,{fill:s,opacity:.4}),e>0){const t=Math.max(1,Math.floor(h)),o=Math.max(1,Math.min(t,Math.round(e*t))),i=[];for(let t=0;o>t;t++)i.push(Jr(c.colorStops,e*(t+.5)/o));const r=en("fill",0);p.push({category:r,value:e,_zone:"Gradient",_isFill:!0,_pctStart:0,_pct:e,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0,_gradientBand:{colors:i}}),f.set(r,{fill:i[0]||s})}}else{let e=t;for(let o=0;g.length>o;o++){const i=g[o],r=(i.value-e)/u,n=(e-t)/u,l=(i.value-t)/u,c=Math.max(0,(a?Math.min(d,l):l)-n),h=a?Math.max(0,r-c):0;if(c>0){const e=en("fill",o);p.push({category:e,value:c,_zone:i.label||"Zone "+(o+1),_isFill:!0}),f.set(e,{fill:i.color})}if(h>0){const e=en("bg",o);p.push({category:e,value:h,_zone:i.label||"Zone "+(o+1),_isFill:!1}),f.set(e,{fill:s,opacity:.4})}e=i.value}}if(l&&r&&r.length>0)for(const e of r)e.value>t&&o>e.value&&y.push({type:"gauge-label",value:e.value,label:e.label||e.value+""});return{gaugeData:p,pieceStyle:(e,t)=>f.get(t||e.category)||{fill:s},gaugeAnnotations:y}}({min:l,max:c,value:a,thresholds:h,fillColor:d,backgroundColor:g,fillZones:A,showScaleLabels:x,gradientFill:F}),[a,l,c,h,d,g,x,A,F]),G=qr(()=>o(j,{stroke:P,strokeWidth:R,opacity:M}),[j,P,R,M]),{sweepRad:V,startAngleDeg:$}=Qr(w),q=function(e=240){const{sweepRad:t,offsetRad:o}=Qr(e),i=[[Math.cos(o),Math.sin(o)],[Math.cos(o+t),Math.sin(o+t)],[0,0]];for(let e=0;2*Math.PI>e;e+=Math.PI/2)((e-o)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)>t+.001||i.push([Math.cos(e),Math.sin(e)]);const r=i.map(e=>e[0]),n=i.map(e=>e[1]),[s,a]=yt(r),[l,c]=yt(n);return{minX:s,maxX:a,minY:l,maxY:c,width:a-s,height:c-l,cx:(s+a)/2,cy:(l+c)/2}}(w),X=Math.min(10,Math.max(1,Math.min(L,I)/12)),Y=q.cx,Q=q.cy,K=Math.max(4,Math.min((L-2*X)/q.width,(I-2*X)/q.height)-2),Z=Math.max(0,Math.min(K-1.5,K*(1-m))),U=L/2-Y*K,J=I/2-Q*K,ee=2*(K+4),te=qr(()=>{if(s&&null==v)return null;if(null!=v)return"function"==typeof v?v(E,l,c):v;const e=b?b(E):Math.round(E)+"";return on("div",{style:{textAlign:"center",lineHeight:1.2},children:[tn("div",{style:{fontSize:Math.max(16,.3*K),fontWeight:700,color:"var(--semiotic-text, #333)"},children:e}),x&&on("div",{style:{fontSize:11,color:"var(--semiotic-text-secondary, #666)"},children:[l," – ",c]})]})},[v,E,l,c,b,x,K,s]),oe=qr(()=>n&&null==v?{type:"gauge-value",text:b?b(E):Math.round(E)+""}:null,[n,v,E,b]),ie=qr(()=>{if(!f)return null;const e=-Math.PI/2+$*Math.PI/180+D*V,t=Z>20?Z-8:K-1;return{type:"gauge-needle",tipX:Math.cos(e)*t,tipY:Math.sin(e)*t,color:y}},[f,$,D,V,Z,K,y]),re=qr(()=>(e,t,o)=>{if("gauge-needle"===e.type){const i=(o.width||L)/2,r=(o.height||I)/2,n=Math.max(1,K-Z),s=Math.max(1,Math.min(2.5,.4*n)),a=Math.max(1,Math.min(5,.6*n));return on("g",{transform:`translate(${i},${r})`,children:[tn("line",{x1:0,y1:0,x2:e.tipX,y2:e.tipY,stroke:e.color,strokeWidth:s,strokeLinecap:"round"}),tn("circle",{cx:0,cy:0,r:a,fill:e.color})]},"gauge-needle-"+t)}if("gauge-label"===e.type){const i=-Math.PI/2+$*Math.PI/180+(e.value-l)/N*V,r=(o.width||L)/2,n=(o.height||I)/2,s=Z-1,a=K+1,c=Math.cos(i)*s,h=Math.sin(i)*s,u=Math.cos(i)*a,d=Math.sin(i)*a,g=K+10,m=Math.cos(i)*g,p=Math.sin(i)*g,f=((i+Math.PI/2)/(2*Math.PI)*12+12)%12;let y,v;return f>=11||1>f?(y="middle",v="auto"):f>=1&&5>f?(y="start",v="middle"):f>=5&&7>f?(y="middle",v="hanging"):(y="end",v="middle"),on("g",{transform:`translate(${r},${n})`,children:[tn("line",{x1:c,y1:h,x2:u,y2:d,stroke:"var(--semiotic-border, #ccc)",strokeWidth:2,strokeLinecap:"round"}),tn("text",{x:m,y:p,textAnchor:y,dominantBaseline:v,fill:"var(--semiotic-text-secondary, #666)",style:{userSelect:"none",fontSize:"var(--semiotic-gauge-label-font-size, 10px)"},children:e.label})]},"gauge-label-"+t)}return"gauge-value"===e.type?tn("text",{x:(o.width||L)/2,y:(o.height||I)/2-.2*Z,textAnchor:"middle",dominantBaseline:"middle",fontSize:Math.max(12,Math.min(22,.28*K)),fontWeight:700,fill:"var(--semiotic-text, #333)",style:{userSelect:"none"},children:e.text},"gauge-value-"+t):null},[L,I,l,N,$,V,Z,K]),ne=qr(()=>{const e=[...z,...S||[]];return ie&&e.push(ie),oe&&e.push(oe),e},[z,S,ie,oe]),se=qr(()=>e=>{const t=e?.data?.[0]||e?.data||e,o=t?._zone||"",i=t?._isFill;return on("div",{className:"semiotic-tooltip",style:{padding:"6px 10px",background:"var(--semiotic-tooltip-bg, white)",borderRadius:"var(--semiotic-tooltip-radius, 6px)",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0,0,0,0.15))"},children:[tn("div",{style:{fontWeight:600},children:o}),tn("div",{style:{fontSize:"0.85em",color:"var(--semiotic-text-secondary, #666)"},children:i?"Current: "+Math.round(E):"Remaining"})]})},[E]);if(0===W.length)return tn(xt,{componentName:"GaugeChart",message:"No data to display",width:L,height:I});const ae={chartType:"donut",data:W,oAccessor:"category",rAccessor:"value",oSort:!1,projection:"radial",pieceStyle:G,innerRadius:Z,startAngle:$,sweepAngle:w,...null!=p&&{cornerRadius:p},centerContent:te,size:[L,I],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:{top:J-ee/2,bottom:I-J-ee/2,left:U-ee/2,right:L-U-ee/2},enableHover:i.enableHover,showAxes:!1,showCategoryTicks:!1,tooltipContent:!1===k?()=>null:qe(k)||se,svgAnnotationRules:re,...ne.length>0&&{annotations:ne},...T&&{title:T},...H&&{description:H},...B&&{summary:B},...void 0!==O&&{accessibleTable:O},...C&&{className:C},...null!=e.animate&&{animate:e.animate},..._};return tn(wt,{componentName:"GaugeChart",width:L,height:I,children:tn(ii,{ref:r,...ae})})});rn.displayName="GaugeChart";import{useMemo as nn,forwardRef as sn,useRef as an}from"react";import{jsx as ln}from"react/jsx-runtime";var cn=sn(function(e,o){const r=at(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=an(null),{data:s,margin:a,className:l,categoryAccessor:c="category",groupBy:h,valueAccessor:u="value",orientation:d="vertical",valueFormat:g,colorBy:m,colorScheme:p,sort:f=!1,barPadding:y=60,roundedTop:v,styleRules:b,baselinePadding:x=!1,tooltip:w,annotations:A,valueExtent:k,frameProps:S={},selection:_,linkedHover:C,onObservation:P,onClick:R,hoverHighlight:M,chartId:L,loading:I,loadingContent:T,emptyContent:H,legendInteraction:F,legendPosition:D,color:W,stroke:j,strokeWidth:z,opacity:G,categoryFormat:V}=e,{width:$,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=r,ie=nn(()=>Ie(s),[s]),re=m||h,ne=i({data:ie,rawData:s,colorBy:re,colorScheme:p,legendInteraction:F,legendPosition:D,selection:_,linkedHover:C,fallbackFields:re?["string"==typeof re?re:""]:[],unwrapData:!0,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"GroupedBarChart",chartId:L,showLegend:Q,userMargin:a,marginDefaults:r.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:$,height:q}),se=gt(),ae=nn(()=>new Map,[]),le=nn(()=>oe(u),[u]),ce=mi({colorBy:re,colorScale:ne.colorScale,color:W,themeCategorical:se,colorScheme:p,categoryIndexMap:ae,userPieceStyle:S.pieceStyle,stroke:j,strokeWidth:z,opacity:G,styleRules:b,resolveRuleValue:le,effectiveSelectionHook:ne.effectiveSelectionHook,resolvedSelection:ne.resolvedSelection}),he=nn(()=>E({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:g}),[h,c,u,g]),ue=t({componentName:"GroupedBarChart",data:s,accessors:{categoryAccessor:c,valueAccessor:u},requiredProps:{groupBy:h}}),{effectiveLegendProps:de,effectiveMargin:ge}=di({ref:o,frameRef:n,setup:ne});if(ne.earlyReturn)return ne.earlyReturn;const me={chartType:"clusterbar",...null!=s&&{data:ie},oAccessor:c,rAccessor:u,groupBy:h,oSort:f,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:ce,size:[$,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ge,barPadding:y,...null!=v&&{roundedTop:v},baselinePadding:x,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:ee,rLabel:te,rFormat:g,...V&&{oFormat:V},showGrid:Y,...de,...B({title:K,description:Z,summary:U,accessibleTable:J,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:w,defaultTooltipContent:he}),...O({linkedHover:C,selection:_,onObservation:P,onClick:R,hoverHighlight:M,mobileInteraction:ne.mobileInteraction,customHoverBehavior:ne.customHoverBehavior,customClickBehavior:ne.customClickBehavior}),...A&&A.length>0&&{annotations:A},...k&&{rExtent:k},...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return ue?ln(xt,{componentName:"GroupedBarChart",message:ue,width:$,height:q}):ln(wt,{componentName:"GroupedBarChart",width:$,height:q,children:ln(ii,{ref:n,...me})})});cn.displayName="GroupedBarChart";import{useMemo as hn,forwardRef as un,useRef as dn}from"react";import{jsx as gn}from"react/jsx-runtime";var mn=un(function(e,o){const r=at(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=dn(null),{data:s,margin:a,className:l,categoryAccessor:c="category",subcategoryAccessor:h,valueAccessor:u="value",orientation:d="horizontal",valueFormat:g,colorBy:m,colorScheme:p,barPadding:f,tooltip:y,annotations:v,brush:b,onBrush:x,linkedBrush:w,frameProps:A={},selection:k,linkedHover:S,onObservation:_,onClick:C,hoverHighlight:P,chartId:R,loading:M,loadingContent:L,emptyContent:I,legendInteraction:T,legendPosition:H,color:F,stroke:D,strokeWidth:W,opacity:j,categoryFormat:z,rTickValues:G,tickLabelEdgeAlign:V,showCategoryTicks:$,gradientFill:q,trackFill:X,roundedTop:Y,valueExtent:Q}=e,{width:K,height:Z,enableHover:U,showGrid:J,showLegend:ee,title:te,description:oe,summary:ie,accessibleTable:re,categoryLabel:ne,valueLabel:se}=r,ae=hn(()=>Ie(s),[s]),le=m||h,ce=hn(()=>{if(null!=f)return f;if("sparkline"!==e.mode)return 40;const t=new Set(ae.map(e=>"function"==typeof c?c(e):e[c])),o=Math.max(1,t.size);return o>1?Math.max(0,Math.min(1,(("horizontal"===d?Z:K)-2*o)/(o-1))):1},[f,e.mode,ae,c,d,K,Z]),he=i({data:ae,rawData:s,colorBy:le,colorScheme:p,legendInteraction:T,legendPosition:H,selection:k,linkedHover:S,fallbackFields:le?["string"==typeof le?le:""]:[],unwrapData:!0,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"SwimlaneChart",chartId:R,showLegend:ee,userMargin:a,marginDefaults:r.marginDefaults,loading:M,loadingContent:L,emptyContent:I,width:K,height:Z}),ue=Zi({brushProp:b,onBrushProp:x,linkedBrush:w,valueAccessor:u}),de=gt(),ge=hn(()=>new Map,[]),me=mi({colorBy:le,colorScale:he.colorScale,color:F,themeCategorical:de,colorScheme:p,categoryIndexMap:ge,userPieceStyle:A?.pieceStyle,stroke:D,strokeWidth:W,opacity:j,effectiveSelectionHook:he.effectiveSelectionHook,resolvedSelection:he.resolvedSelection,cycleByCategory:!0}),pe=hn(()=>E({categoryAccessor:h,valueAccessor:u,groupAccessor:c,valueFormat:g}),[h,c,u,g]),fe=t({componentName:"SwimlaneChart",data:s,accessors:{categoryAccessor:c,valueAccessor:u,subcategoryAccessor:h},requiredProps:{subcategoryAccessor:h}}),{effectiveLegendProps:ye,effectiveMargin:ve}=di({ref:o,frameRef:n,setup:he});if(he.earlyReturn)return he.earlyReturn;const be={chartType:"swimlane",...null!=s&&{data:ae},oAccessor:c,rAccessor:u,stackBy:h,projection:"horizontal"===d?"horizontal":"vertical",pieceStyle:me,size:[K,Z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ve,barPadding:ce,enableHover:U,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:r.showAxes,oLabel:!1===$?void 0:ne,rLabel:se,rFormat:g,...G&&{rTickValues:G},...null!=V&&{tickLabelEdgeAlign:V},...z&&{oFormat:z},...void 0!==$&&{showCategoryTicks:$},showGrid:J,...ye,...B({title:te,description:oe,summary:ie,accessibleTable:re,className:l,animate:e.animate,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...N({tooltip:y,defaultTooltipContent:pe}),...O({linkedHover:S,selection:k,onObservation:_,onClick:C,hoverHighlight:P,mobileInteraction:he.mobileInteraction,customHoverBehavior:he.customHoverBehavior,customClickBehavior:he.customClickBehavior}),...v&&v.length>0&&{annotations:v},...q&&{gradientFill:!0===q?{topOpacity:.8,bottomOpacity:.05}:q},...null!=X&&{trackFill:X},...null!=Y&&{roundedTop:Y},...Q&&{rExtent:Q},...ue.brushStreamProps,...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return fe?gn(xt,{componentName:"SwimlaneChart",message:fe,width:K,height:Z}):gn(wt,{componentName:"SwimlaneChart",width:K,height:Z,children:gn(ii,{ref:n,...be})})});mn.displayName="SwimlaneChart";export{ii as StreamOrdinalFrame_default,ai as OrdinalCustomChart,fi as BarChart,wi as StackedBarChart,$i as LikertChart,Ji as SwarmPlot,ar as BoxPlot,mr as Histogram,br as ViolinPlot,Sr as RidgelinePlot,Lr as FunnelChart,Or as DotPlot,Wr as PieChart,$r as DonutChart,rn as GaugeChart,cn as GroupedBarChart,mn as SwimlaneChart};
|