semiotic 3.10.2 → 3.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -27
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/behaviorContracts.cjs +1 -1
- package/ai/dist/mcp-server.js +1 -1
- package/ai/reference.md +4 -4
- package/ai/schema.json +1 -1
- package/ai/surface-manifest.json +1 -1
- package/ai/system-prompt.md +1 -1
- package/ai/task-packets/compare-category-totals.json +4 -4
- package/ai/task-packets/compare-category-totals.md +2 -2
- package/ai/task-packets/correct-published-chart.json +4 -4
- package/ai/task-packets/correct-published-chart.md +2 -2
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +4 -4
- package/ai/task-packets/update-live-chart.md +2 -2
- package/dist/{c-AKLBQMQF.min.js → c-43XNOQNQ.min.js} +50 -50
- package/dist/{c-PZ3NEGNG.min.js → c-5PIKBUMF.min.js} +1 -1
- package/dist/{c-FDUQDCBC.min.js → c-CO4NDAD6.min.js} +23 -23
- package/dist/c-FHNY57SO.min.js +209 -0
- package/dist/c-FMCUQ6JX.min.js +1 -0
- package/dist/{c-C4KIXUWU.min.js → c-GK263BF4.min.js} +1 -1
- package/dist/{c-TTKWXGAI.min.js → c-HNHKIMIV.min.js} +3 -3
- package/dist/c-IJCZGUG6.min.js +31 -0
- package/dist/{c-7LY46QUI.min.js → c-ISA6IJ6V.min.js} +7 -7
- package/dist/{c-4MD53L2J.min.js → c-JC76YAHB.min.js} +28 -28
- package/dist/{c-VXIYF7V2.min.js → c-JOPGDP6N.min.js} +1 -1
- package/dist/c-KXH7LFIL.min.js +26 -0
- package/dist/c-M43PK7K4.min.js +1 -0
- package/dist/{c-7ASK4WBF.min.js → c-PITYSOPK.min.js} +1 -1
- package/dist/{c-2TW5H5PD.min.js → c-QPO24R7Q.min.js} +1 -1
- package/dist/{c-KGROWFT2.min.js → c-SAP5KY6R.min.js} +2 -2
- package/dist/c-UMGHCBH5.min.js +114 -0
- package/dist/{c-6ZU3QVLB.min.js → c-VEMCBQZZ.min.js} +33 -33
- package/dist/{c-IPYGNVN6.min.js → c-WD2RL76M.min.js} +45 -45
- package/dist/{c-PQOZPM4G.min.js → c-YL7HJL5J.min.js} +1 -1
- package/dist/c-Z6GRGS53.min.js +1 -0
- package/dist/{c-SG2Y7EBY.min.js → c-ZVOFLE2P.min.js} +6 -6
- package/dist/components/CategoryColors.d.ts +7 -0
- package/dist/components/LinkedCharts.d.ts +2 -1
- package/dist/components/charts/shared/useChartSetup.d.ts +1 -1
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -1
- package/dist/components/data/transforms.d.ts +1 -0
- package/dist/geo.min.js +3 -3
- package/dist/geo.module.min.js +10 -10
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.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.module.min.js +7 -7
- package/dist/semiotic-artifact.min.js +1 -1
- package/dist/semiotic-artifact.module.min.js +1 -1
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +903 -902
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +2 -2
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +2 -2
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +65 -65
- package/dist/semiotic-server-edge.min.js +64 -64
- package/dist/semiotic-server-edge.module.min.js +80 -80
- package/dist/semiotic-server-node.min.js +64 -64
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic.module.min.js +10 -10
- package/dist/server.min.js +64 -64
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +5 -5
- package/dist/c-72CBVNYX.min.js +0 -209
- package/dist/c-F2GGJB2S.min.js +0 -31
- package/dist/c-G53AVC42.min.js +0 -113
- package/dist/c-HQ27AHMC.min.js +0 -1
- package/dist/c-IHWZ2C6D.min.js +0 -26
- package/dist/c-MOP2NGLH.min.js +0 -1
- package/dist/c-PKY4JFY5.min.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let t=L(e=>e.theme.colors.selectionOpacity);return C(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}function t(t){let{data:r,rawData:n,colorBy:L,colorScheme:C,legendInteraction:S,legendPosition:M,selection:F,linkedHover:B,fallbackFields:A,unwrapData:D=!1,onObservation:P,chartType:w,chartId:I,showLegend:R,legend:O,legendLayout:T,frameLegend:x,userMargin:j,marginDefaults:N,onClick:_,hoverHighlight:J,mobileInteraction:Y,mobileSemantics:G,loading:K,loadingContent:U,emptyContent:V,width:W,height:q,hasTitle:z,axisChrome:E}=t,Q=void 0===n,X=H(()=>g(r),[r]),[Z,$]=k([]),ee=b(e=>{$(t=>t.length===e.length&&t.every((t,r)=>t===e[r])?t:e)},[]),te="string"==typeof L?L:void 0,re=H(()=>m(Y,{width:W,mobileSemantics:G}),[Y,W,G]),{activeSelectionHook:ne,hoverSelectionHook:oe,customHoverBehavior:ae,customClickBehavior:le,crosshairSourceId:ie}=s({selection:F,linkedHover:B,fallbackFields:A,unwrapData:D,onObservation:P,chartType:w,chartId:I,onClick:_,hoverHighlight:J,colorByField:te,mobileInteraction:re}),ue=c(B,ie),se=u(X,L,C),ce=H(()=>o(X,L),[X,L]),ge=H(()=>Q&&Z.length>0?Z:ce,[Q,Z,ce]),de=l(S,L,ge),he=H(()=>oe||(de.legendSelectionHook?de.legendSelectionHook:ne),[oe,de.legendSelectionHook,ne]),ye=e(F),me=i(),pe=y(null!=C),fe=H(()=>{if(se&&(!Q||0===ge.length))return se;if(!L||0===ge.length)return;let e=Array.isArray(C)&&C.length>0||"string"==typeof C&&C.length>0?C:me&&me.length>0?me:p,t="__streamCat",r=ge.map(e=>({[t]:e})),n=v(r,t,e);return e=>(pe?f(pe,e):void 0)??(C&&"object"==typeof C&&!Array.isArray(C)?f(C,e):void 0)??n(e)??"#999"},[se,Q,L,ge,C,me,pe]),{legend:ve,margin:Le,legendPosition:Ce,legendLayout:be,legendMarginReserved:He}=a({data:X,colorBy:L,colorScale:fe,showLegend:R,legendPosition:M,userMargin:j,defaults:N,categories:ge,additionalLegend:O,chartWidth:W,chartHeight:q,legendLayout:T,frameLegend:x,hasTitle:z,axisChrome:E}),ke=H(()=>{let e={};return ve&&(e.legend=ve,e.legendPosition=Ce,He&&(e.__legendMarginReservedFor=ve),be&&(e.legendLayout=be)),S&&"none"!==S&&(e.legendHoverBehavior=de.onLegendHover,e.legendClickBehavior=de.onLegendClick,e.legendHighlightedCategory=de.highlightedCategory,e.legendIsolatedCategories=de.isolatedCategories),Q&&L&&(e.legendCategoryAccessor=L,e.onCategoriesChange=ee),e},[ve,Ce,be,He,S,de.onLegendHover,de.onLegendClick,de.highlightedCategory,de.isolatedCategories,Q,L,ee]),Se=Array.isArray(n)?g(n):n,Me=h(K,W,q,U),Fe=Me?null:d(Se,W,q,V);return{data:X,colorScale:fe,categoryColorScale:fe,allCategories:ge,legendState:de,effectiveSelectionHook:he,activeSelectionHook:ne,customHoverBehavior:ae,customClickBehavior:le,mobileInteraction:re,legend:ve,margin:Le,legendPosition:Ce,earlyReturn:Me||Fe||null,legendBehaviorProps:ke,crosshairProps:ue,resolvedSelection:ye}}function r(e,t){let{variant:r,frameRef:o,overrides:a}=t,l=M(a);l.current=a,S(e,()=>{let e=n(r,o);return new Proxy(e,{get(e,t,r){if("string"==typeof t){let e=l.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,r)},has:(e,t)=>!("string"!=typeof t||!l.current||!(t in l.current))||Reflect.has(e,t)})},[])}function n(e,t){if("xy"===e){let e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,r)=>e.current?.update(t,r)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){let e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{let r=Array.isArray(t)?t:[t],n=e.current?.getTopology()?.nodes??[],o=[];for(let t of r){let r=n.find(e=>e.id===t);r&&o.push({...r.data??{},id:t}),e.current?.removeNode(t)}return o},update:(t,r)=>(Array.isArray(t)?t:[t]).flatMap(t=>{let n=e.current?.updateNode(t,r);return n?[{...n,id:t}]:[]}),clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){let e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,r)=>{let n=e.current?.removePoint(t)??[];for(let t of n)e.current?.push(r(t));return n},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}let r=t;return{push:e=>r.current?.pushLine(e),pushMany:e=>r.current?.pushManyLines(e),remove:e=>r.current?.removeLine(e)??[],update:(e,t)=>{let n=r.current?.removeLine(e)??[];for(let e of n)r.current?.pushLine(t(e));return n},clear:()=>r.current?.clear(),getData:()=>r.current?.getLines()??[],getCustomLayout:()=>r.current?.getCustomLayout?.()??null,getLayoutFailure:()=>r.current?.getLayoutFailure?.()??null}}import{Bb as o,Cb as a,Db as l,Fb as i,Jb as u,Lb as s,Mb as c,b as g,bb as d,cb as h,eb as y,sb as m}from"./c-UMGHCBH5.min.js";import{p,s as f,t as v}from"./c-Y342FJ6K.min.js";import{h as L}from"./c-5NYONM6V.min.js";import{useMemo as C}from"react";import{useCallback as b,useMemo as H,useState as k}from"react";import{useImperativeHandle as S,useRef as M}from"react";export{e as a,t as b,r as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,r,u){let o=n(e),i=n(r),f=n(u);return e=>{let n="string"==typeof e.agg&&"number"==typeof e.count&&"number"==typeof e.xCenter&&"number"==typeof e.yCenter;return{value:n?t(e.value):f(e),x:n?t(e.xCenter):o(e),y:n?t(e.yCenter):i(e)}}}function t(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}import{
|
|
1
|
+
function e(e,r,u){let o=n(e),i=n(r),f=n(u);return e=>{let n="string"==typeof e.agg&&"number"==typeof e.count&&"number"==typeof e.xCenter&&"number"==typeof e.yCenter;return{value:n?t(e.value):f(e),x:n?t(e.xCenter):o(e),y:n?t(e.yCenter):i(e)}}}function t(e){return"number"==typeof e&&Number.isFinite(e)?e:void 0}import{Ob as n}from"./c-UMGHCBH5.min.js";export{e as a};
|
|
@@ -14,7 +14,7 @@ return Es("g",{className:"semiotic-axis semiotic-axis-right","data-orient":"righ
|
|
|
14
14
|
return Es("g",{transform:`translate(${t},${e.pixel})`,children:[
|
|
15
15
|
/* @__PURE__ */Ds("line",{x2:5,...c}),"string"==typeof e.label||"number"==typeof e.label?/* @__PURE__ */Ds("text",{x:8,textAnchor:"start",dominantBaseline:le(o,e.pixel===h.min,e.pixel===h.max),fontWeight:r?600:400,fill:A,fontSize:r?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...r?S:P},children:e.label}):/* @__PURE__ */Ds("foreignObject",{x:8,y:-12,width:60,height:24,style:{overflow:"visible"},children:/* @__PURE__ */Ds("div",{style:{textAlign:"left",userSelect:"none",...P},children:e.label})})]},"ytick-r-"+i)}),a&&/* @__PURE__ */Ds("text",{x:t+Z-15,y:i/2,textAnchor:"middle",fill:_,transform:`rotate(90, ${t+Z-15}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...M},children:a})]})})()]})})(),Ce,ke.node,S&&n&&M&&R&&/* @__PURE__ */Es(Ls,{children:[S.top&&/* @__PURE__ */Ds("g",{transform:"translate(0, 0)",children:/* @__PURE__ */Ds(fe,{orient:"top",config:at(S.top),values:M,scale:n.x,size:a.top,length:t})}),S.bottom&&/* @__PURE__ */Ds("g",{transform:`translate(0, ${i})`,children:/* @__PURE__ */Ds(fe,{orient:"bottom",config:at(S.bottom),values:M,scale:n.x,size:a.bottom,length:t})}),S.left&&/* @__PURE__ */Ds("g",{transform:"translate(0, 0)",children:/* @__PURE__ */Ds(fe,{orient:"left",config:at(S.left),values:R,scale:n.y,size:a.left,length:i})}),S.right&&/* @__PURE__ */Ds("g",{transform:`translate(${t}, 0)`,children:/* @__PURE__ */Ds(fe,{orient:"right",config:at(S.right),values:R,scale:n.y,size:a.right,length:i})})]}),P,Pe&&Pe.sourceId!==V&&n?.x&&(()=>{let e=n.x(Pe.xValue);if(null==e||0>e||e>t)return null;let r=Pe.locked;/* @__PURE__ */
|
|
16
16
|
return Ds("line",{x1:e,y1:0,x2:e,y2:i,stroke:r?"white":"var(--semiotic-text-secondary, rgba(0,0,0,0.25))",strokeWidth:r?1.5:1,strokeDasharray:r?"6,3":"4,4",pointerEvents:"none"})})(),H]}),
|
|
17
|
-
/* @__PURE__ */Ds(Mi,{title:f,totalWidth:r,marginTop:a.top}),ui({legend:v,totalWidth:r,totalHeight:s,margin:a,legendPosition:_,title:f,legendLayout:C,axisChrome:U,legendHoverBehavior:b,legendClickBehavior:w,legendHighlightedCategory:k,legendIsolatedCategories:A})]}):null}function Se(e,t,i,r,s){let[a,n]=Is([]),[o,l]=Is([]),c=null!=t,h=c?[t.top,t.bottom,t.left,t.right].join("|"):"",u=Os((t=e.current?.getData()??[])=>{let i=ye(t,r,s);n(i.xValues),l(i.yValues)},[e,r,s]);return Bs(()=>{if(!c)return n([]),void l([]);u()},[i,c,h,u]),{marginalXValues:a,marginalYValues:o,refreshMarginalValues:u}}function Me(e){if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length)return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}let t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return t?[+t[1],+t[2],+t[3]]:[128,128,128]}function Re(e,t){let i=e.fillGradient;if(!i||"object"!=typeof i)return null;let r=1/0;for(let[,t]of e.topPath)r=Math.min(r,t);let s=-1/0;for(let[,t]of e.bottomPath)s=Math.max(s,t);if(!Number.isFinite(r)||!Number.isFinite(s))return null;let a=Di(i.stops,Ri(e.style.fill));return a?/* @__PURE__ */$s("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:0,y1:r,x2:0,y2:s,children:a}):null}function Ye(e,t,i,r){if(!e||2>t.length)return null;let s=Di(e.stops,r);return s?/* @__PURE__ */$s("linearGradient",{id:i,gradientUnits:"userSpaceOnUse",x1:t[0][0],y1:0,x2:t[t.length-1][0],y2:0,children:s}):null}function Te(e,t,i,r=30){let s=Le(e,t,i,r);return"area"===e.type?s:
|
|
17
|
+
/* @__PURE__ */Ds(Mi,{title:f,totalWidth:r,marginTop:a.top}),ui({legend:v,totalWidth:r,totalHeight:s,margin:a,legendPosition:_,title:f,legendLayout:C,axisChrome:U,legendHoverBehavior:b,legendClickBehavior:w,legendHighlightedCategory:k,legendIsolatedCategories:A})]}):null}function Se(e,t,i,r,s){let[a,n]=Is([]),[o,l]=Is([]),c=null!=t,h=c?[t.top,t.bottom,t.left,t.right].join("|"):"",u=Os((t=e.current?.getData()??[])=>{let i=ye(t,r,s);n(i.xValues),l(i.yValues)},[e,r,s]);return Bs(()=>{if(!c)return n([]),void l([]);u()},[i,c,h,u]),{marginalXValues:a,marginalYValues:o,refreshMarginalValues:u}}function Me(e){if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length)return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}let t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return t?[+t[1],+t[2],+t[3]]:[128,128,128]}function Re(e,t){let i=e.fillGradient;if(!i||"object"!=typeof i)return null;let r=1/0;for(let[,t]of e.topPath)r=Math.min(r,t);let s=-1/0;for(let[,t]of e.bottomPath)s=Math.max(s,t);if(!Number.isFinite(r)||!Number.isFinite(s))return null;let a=Di(i.stops,Ri(e.style.fill));return a?/* @__PURE__ */$s("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:0,y1:r,x2:0,y2:s,children:a}):null}function Ye(e,t,i,r){if(!e||2>t.length)return null;let s=Di(e.stops,r);return s?/* @__PURE__ */$s("linearGradient",{id:i,gradientUnits:"userSpaceOnUse",x1:t[0][0],y1:0,x2:t[t.length-1][0],y2:0,children:s}):null}function Te(e,t,i,r=30){let s=Le(e,t,i,r);return"area"===e.type?s:Hi(s,e,"xy-cursor-"+t)}function Le(e,t,i,r=30){switch(e.type){case"line":{let r=e;if(0===r.path.length)return null;let s=kr(r.curve),a=s?Fs().x(([e])=>e).y(([,e])=>e).curve(s)(r.path)??"":"M"+r.path.map(([e,t])=>`${e},${t}`).join("L"),n=Ti(`${i?i+"-":""}line-${t}-stroke-gradient`),o=Ye(r.strokeGradient,r.path,n,r.style.stroke||"#4e79a7");/* @__PURE__ */
|
|
18
18
|
return Ws(Ns.Fragment,{children:[o&&/* @__PURE__ */$s("defs",{children:o}),
|
|
19
19
|
/* @__PURE__ */$s("path",{d:a,fill:"none",stroke:o?`url(#${n})`:r.style.stroke||"#4e79a7",strokeWidth:r.style.strokeWidth??2,strokeDasharray:r.style.strokeDasharray,opacity:r.style.opacity})]},"line-"+t)}case"area":{let s=e;if(0===s.topPath.length)return null;let a=kr(s.curve),n=!a||2>s.topPath.length||2>s.bottomPath.length?`M${s.topPath.map(([e,t])=>`${e},${t}`).join("L")}L${[...s.bottomPath].reverse().map(([e,t])=>`${e},${t}`).join("L")}Z`:zs().x(([e])=>e).y0((e,t)=>s.bottomPath[t][1]).y1(([,e])=>e).curve(a)(s.topPath)??"",o=`${i?i+"-":""}area-${t}-hatch`,l=br(s.style.fill)?wr(s.style.fill,o):void 0,c=Ti(`${i?i+"-":""}area-${t}-gradient`),h=Re(s,c),u=h?`url(#${c})`:l?`url(#${o})`:Ri(s.style.fill),d=h?void 0:s.style.fillOpacity??s.style.opacity??.7,p=a?Fs().x(([e])=>e).y(([,e])=>e).curve(a)(s.topPath)??"":"M"+s.topPath.map(([e,t])=>`${e},${t}`).join("L"),g=Ni(s),y=g&&r>=0?/* @__PURE__ */$s("path",{d:p,fill:"none",stroke:"transparent",strokeWidth:Math.max(1,2*r),strokeLinecap:"round",pointerEvents:"stroke",style:{cursor:g},"data-semiotic-mark-cursor":g,"data-semiotic-cursor-hit-target":"area-top-path","aria-hidden":"true"},`area-${t}-cursor-target`):null,f=Ti(`${i?i+"-":""}area-${t}-stroke-gradient`),m=!(!s.colorThresholds?.length||!s.rawValues||s.rawValues.length!==s.topPath.length),x=!!s.strokeColorBands?.length,v=m||x?null:Ye(s.strokeGradient,s.topPath,f,s.style.stroke||"#4e79a7"),b=s.style.strokeWidth??2,w=1/0,k=-1/0;for(let[e]of s.topPath)w>e&&(w=e),e>k&&(k=e);let A=x?s.strokeColorBands.map((e,r)=>Ti(`${i?i+"-":""}area-${t}-stroke-band-${r}`)):[],_=x?s.strokeColorBands.map((e,t)=>/* @__PURE__ */$s("clipPath",{id:A[t],children:/* @__PURE__ */$s("rect",{x:w-b,y:e.y,width:k-w+2*b,height:e.height})},A[t])):null,C=s.style.stroke&&"none"!==s.style.stroke?x?s.strokeColorBands.map((e,i)=>/* @__PURE__ */$s("path",{d:p,fill:"none",stroke:e.color??Ri(s.style.stroke),strokeWidth:b,opacity:(s.style.opacity??1)*(e.opacity??1),clipPath:`url(#${A[i]})`},`area-${t}-stroke-band-${i}`)):m?tt(s.topPath,s.rawValues,s.colorThresholds,Ri(s.style.stroke)).map((e,i)=>/* @__PURE__ */$s("path",{d:"M"+e.path.map(([e,t])=>`${e},${t}`).join("L"),fill:"none",stroke:e.color,strokeWidth:b,opacity:s.style.opacity},`area-${t}-threshold-${i}`)):/* @__PURE__ */$s("path",{d:p,fill:"none",stroke:v?`url(#${f})`:Ri(s.style.stroke),strokeWidth:b,opacity:s.style.opacity}):null;if(s.clipRect){let e=`${i?i+"-":""}area-clip-${t}`;/* @__PURE__ */
|
|
20
20
|
return Ws("g",{children:[
|
|
@@ -41,7 +41,7 @@ return Hs("div",{className:"semiotic-tooltip",style:dr,children:[null!=e.title&&
|
|
|
41
41
|
/* @__PURE__ */Vs("span",{style:{fontWeight:600},children:Fe(e.value)})]},e.key))]})}/* @__PURE__ */
|
|
42
42
|
return Hs("div",{className:"semiotic-tooltip",style:dr,children:[
|
|
43
43
|
/* @__PURE__ */Vs("div",{style:{fontWeight:600,marginBottom:2},children:Fe(i)}),
|
|
44
|
-
/* @__PURE__ */Vs("div",{style:{opacity:.7,fontSize:11},children:Fe(r)})]})}function We(e,t){if(!t||0===e.length||!e.some(e=>null!=e&&"object"==typeof e&&Array.isArray(e[t])))return e;let i=[];for(let r of e){if(null==r||"object"!=typeof r)continue;let e=r[t];if(!Array.isArray(e))continue;let s=r.label??r.id??r.key;for(let t of e)null==t||"object"!=typeof t||i.push(null==s?t:{...t,_lineGroup:s})}return i}function Xe(e){let{canvas:t,pointer:i,store:r,margin:s,width:a,height:n}=e;ji(t,i,i=>{let o=t.getBoundingClientRect(),l=i.clientX-o.left-s.left,c=i.clientY-o.top-s.top;if(0>l||l>a||0>c||c>n)return;let h=X(r.scene,l,c,wi(e.hoverRadius,i.pointerType),e.geometryMoved?null:r.quadtree,r.maxPointRadius);return Ni(h?.node)})}function je(e){if(e)return"x"===e.dimension?"pan-y":"y"===e.dimension?"pan-x":"none"}function Ve({brush:e,onBrush:t,linkedBrush:i,xAccessor:r,yAccessor:s,defaultDimension:a="xy"}){let n=Hi(i),o=!!e||!!n||!!t,l=n?.xField||("string"==typeof r?r:void 0),c=n?.yField||("string"==typeof s?s:void 0),h="y"!==a||n?.xField?l:void 0,u="x"!==a||n?.yField?c:void 0,d=Ki({name:n?.name||"__unused_brush__",xField:h,yField:u}),p=n?"xyBrush"===d.brushInteraction.brush?"xy":"xBrush"===d.brushInteraction.brush?"x":"y":a,g=ea(d.brushInteraction);g.current=d.brushInteraction;let y=Qs(e=>{let i=g.current;if(!e)return n&&i.end(null),void t?.(null);n&&i.end("xyBrush"===i.brush?[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:"xBrush"===i.brush?e.x:e.y),t?.(e)},[n,t]);return o?{brushStreamProps:{brush:{dimension:p},onBrush:y}}:{brushStreamProps:{}}}import{a as He,b as Ge}from"./c-VN557BQE.min.js";import{a as Ue,b as qe,c as Ke,d as Je,e as Ze,g as Qe}from"./c-MTX2AO5S.min.js";import{a as et}from"./c-7FKPPCGN.min.js";import{a as tt}from"./c-STHZWF3D.min.js";import{a as it,b as rt}from"./c-TVKZC4BY.min.js";import{a as st}from"./c-GYLOSK7M.min.js";import{a as at}from"./c-UUDAON4Z.min.js";import{a as nt,b as ot,c as lt,d as ct,f as ht,g as ut,h as dt,i as pt}from"./c-2TW5H5PD.min.js";import{c as gt,d as yt,j as ft,k as mt}from"./c-HK4OSLZA.min.js";import{a as xt,c as vt,e as bt,f as wt,g as kt,h as At,i as _t,j as Ct,k as Pt,l as St}from"./c-VXIYF7V2.min.js";import{e as Mt}from"./c-NATWERHZ.min.js";import{b as Rt}from"./c-BYJJ7EMG.min.js";import{a as Yt}from"./c-QXLDCATV.min.js";import{a as Tt,b as Lt,d as Dt}from"./c-U5XVLSHN.min.js";import{A as Et,D as Ot,E as Bt,F as It,W as Nt,a as zt,b as Ft,c as $t,d as Wt,e as Xt,f as jt,g as Vt,h as Ht,i as Gt,j as Ut,k as qt,l as Kt,m as Jt,o as Zt,p as Qt,q as ei,r as ti,s as ii,t as ri,u as si,v as ai,x as ni,y as oi,z as li}from"./c-KGROWFT2.min.js";import{c as ci}from"./c-CLLCX3PT.min.js";import{Ca as hi,D as ui,Fa as di,Ga as pi,H as gi,Ha as yi,Ia as fi,J as mi,Ja as xi,Ka as vi,L as bi,La as wi,M as ki,Ma as Ai,Na as _i,R as Ci,S as Pi,T as Si,U as Mi,W as Ri,Wa as Yi,X as Ti,Y as Li,Z as Di,aa as Ei,b as Oi,ba as Bi,c as Ii,ca as Ni,d as zi,da as Fi,e as $i,ea as Wi,f as Xi,ga as ji,ha as Vi,hb as Hi,ia as Gi,ja as Ui,ka as qi,nb as Ki,o as Ji,oa as Zi,p as Qi,q as er,qa as tr,ra as ir,s as rr,t as sr,ta as ar,u as nr,va as or,wa as lr,x as cr,xa as hr,y as ur,ya as dr}from"./c-G53AVC42.min.js";import{o as pr,p as gr,s as yr}from"./c-Y342FJ6K.min.js";import{b as fr,i as mr,k as xr,o as vr,r as br,t as wr,w as kr}from"./c-3BYZXCX3.min.js";import{e as Ar,h as _r}from"./c-5NYONM6V.min.js";import{e as Cr}from"./c-U6NLVFN4.min.js";import*as Pr from"react";import{forwardRef as Sr,memo as Mr,useCallback as Rr,useEffect as Yr,useId as Tr,useMemo as Lr,useRef as Dr,useState as Er}from"react";import*as Or from"react";import{jsx as Br}from"react/jsx-runtime";var Ir=null,Nr=null,zr=/* @__PURE__ */new Set;import{scaleLinear as Fr,scaleLog as $r,scaleSymlog as Wr,scaleTime as Xr}from"d3-scale";var jr=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Vr=["scene-style","data-paint","accessibility","evidence"],Hr=(e,t)=>({retainedData:e,invalidations:t}),Gr=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ur=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],qr=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Kr=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Jr=["scene-geometry","data-paint","accessibility","evidence"],Zr=["scene-style","data-paint","accessibility","evidence"],Qr=[],es={chartType:Hr("rebuild",Gr),runtimeMode:Hr("rebuild",Gr),xAccessor:Hr("rebuild",Gr),yAccessor:Hr("rebuild",Gr),timeAccessor:Hr("rebuild",Gr),valueAccessor:Hr("rebuild",Gr),y0Accessor:Hr("rebuild",Gr),boundsAccessor:Hr("rebuild",Gr),band:Hr("rebuild",Gr),openAccessor:Hr("rebuild",Gr),highAccessor:Hr("rebuild",Gr),lowAccessor:Hr("rebuild",Gr),closeAccessor:Hr("rebuild",Gr),candlestickRangeMode:Hr("rebuild",Gr),accessorRevision:Hr("rebuild",Gr),groupAccessor:Hr("rebuild",Ur),categoryAccessor:Hr("rebuild",Ur),lineDataAccessor:Hr("rebuild",Ur),colorAccessor:Hr("rebuild",Zr),sizeAccessor:Hr("rebuild",Jr),symbolAccessor:Hr("rebuild",Jr),pointIdAccessor:Hr("rebuild",Jr),xScaleType:Hr("preserve",qr),yScaleType:Hr("preserve",qr),xExtent:Hr("preserve",qr),invertY:Hr("preserve",qr),yExtent:Hr("preserve",qr),extentPadding:Hr("preserve",qr),scalePadding:Hr("preserve",qr),axisExtent:Hr("preserve",qr),yAxisExtent:Hr("preserve",qr),binSize:Hr("preserve",qr),normalize:Hr("preserve",qr),heatmapAggregation:Hr("preserve",qr),heatmapXBins:Hr("preserve",qr),heatmapYBins:Hr("preserve",qr),arrowOfTime:Hr("preserve",Kr),baseline:Hr("preserve",Kr),stackOrder:Hr("preserve",Kr),sizeRange:Hr("preserve",Kr),curve:Hr("preserve",Kr),areaGroups:Hr("preserve",Kr),customLayout:Hr("preserve",Kr),layoutConfig:Hr("preserve",Kr),layoutMargin:Hr("preserve",Kr),symbolMap:Hr("preserve",Jr),showValues:Hr("preserve",Jr),heatmapValueFormat:Hr("preserve",Jr),trackHoverRows:Hr("preserve",Jr),lineStyle:Hr("preserve",Zr),pointStyle:Hr("preserve",Zr),areaStyle:Hr("preserve",Zr),barStyle:Hr("preserve",Zr),swarmStyle:Hr("preserve",Zr),waterfallStyle:Hr("preserve",Zr),candlestickStyle:Hr("preserve",Zr),boundsStyle:Hr("preserve",Zr),gradientFill:Hr("preserve",Zr),lineGradient:Hr("preserve",Zr),semanticLineStops:Hr("preserve",Zr),colorScheme:Hr("preserve",Zr),themeCategorical:Hr("preserve",Zr),themeSemantic:Hr("preserve",Zr),themeSequential:Hr("preserve",Zr),themeDiverging:Hr("preserve",Zr),barColors:Hr("preserve",Zr),decay:Hr("preserve",Zr),pulse:Hr("preserve",Zr),staleness:Hr("preserve",Zr),layoutSelection:Hr("preserve",Zr),annotations:Hr("preserve",["overlay","accessibility","evidence"]),windowSize:Hr("preserve",Qr),windowMode:Hr("preserve",Qr),maxCapacity:Hr("preserve",Qr),clock:Hr("preserve",Qr),transition:Hr("preserve",Qr),introAnimation:Hr("preserve",Qr),onLayoutError:Hr("preserve",Qr)},ts=Hr("preserve",Kr),is=class{constructor(){this.tracker=new Qi}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}},jr)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Vr):this.recordNoop("restyle")}recordConfig(e,t=!1){let i=z(e);return this.tracker.record({kind:"config",keys:e},t?/* @__PURE__ */new Set([...i.invalidations,...Jr]):i.invalidations)}};import{quadtree as rs}from"d3-quadtree";var ss=class{constructor(){this.maxRadius=0,this.tree=null}get quadtree(){return this.tree}get maxPointRadius(){return this.maxRadius}clear(){this.tree=null,this.maxRadius=0}rebuild(e,t){if("scatter"!==e&&"bubble"!==e&&"custom"!==e)return void this.clear();let i=0,r=0;for(let e of t)"point"===e.type&&!1!==e.interactive&&(i++,e.r>r&&(r=e.r));if(this.maxRadius=r,500>=i)return void(this.tree=null);let s=Array(i),a=0;for(let e of t)"point"===e.type&&!1!==e.interactive&&(s[a++]=e);this.tree=rs().x(e=>e.x).y(e=>e.y).addAll(s)}},as=class e{constructor(e){if(this.xExtent=new ot,this.yExtent=new ot,this.growingCapacityWarned=!1,this.windowSizeWarned=!1,this.resolvedRibbons=[],this.timestampBuffer=null,this.activeTransition=null,this._hasRenderedOnce=!1,this.prevPositionMap=/* @__PURE__ */new Map,this.prevPathMap=/* @__PURE__ */new Map,this.exitNodes=[],this.lastIngestTime=0,this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=/* @__PURE__ */new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this._ingestVersion=0,this._datumIndexCache=null,this._bufferArrayCache=null,this._bufferDirty=!0,this.needsFullRebuild=!0,this.lastLayout=null,this.updateResults=new is,this.scales=null,this.scene=[],this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=/* @__PURE__ */new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this.xIsDate=!1,this.spatialIndex=new ss,this._lastBoundedInsertsRef=null,this.applyPulse=(e,t,i)=>!(!this.config.pulse||!this.timestampBuffer)&&vt(this.config.pulse,e,t,this.timestampBuffer,this.getDatumIndexMap(t),i),this.config=e,this.buffer=new xt(e.windowSize),this.growingCap=e.windowSize,["bar","swarm","waterfall"].includes(e.chartType)||"streaming"===e.runtimeMode?(this.getX=Lt(e.timeAccessor||e.xAccessor,"time"),this.getY=Lt(e.valueAccessor||e.yAccessor,"value")):(this.getX=Lt(e.xAccessor,"x"),this.getY=Lt(e.yAccessor,"y")),this.getGroup=Dt(e.groupAccessor),this.getCategory=Dt(e.categoryAccessor),this.getSize=e.sizeAccessor?Lt(e.sizeAccessor,"size"):void 0,this.getColor=Dt(e.colorAccessor),this.getSymbol=Dt(e.symbolAccessor),this.getY0=e.y0Accessor?Lt(e.y0Accessor,"y0"):void 0,this.resolvedRibbons=v(e),this.getPointId=Dt(e.pointIdAccessor),"candlestick"===e.chartType){let t=null!=e.openAccessor,i=null!=e.closeAccessor;this.getOpen=t?Lt(e.openAccessor,"open"):void 0,this.getHigh=Lt(e.highAccessor,"high"),this.getLow=Lt(e.lowAccessor,"low"),this.getClose=i?Lt(e.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!t&&!i}e.pulse&&(this.timestampBuffer=new xt(e.windowSize))}currentTime(){return this.config.clock?.()??Xi()}syncPulseTimestampBuffer(){this.config.pulse?null!=this.timestampBuffer&&this.timestampBuffer.capacity===this.buffer.capacity&&this.timestampBuffer.size===this.buffer.size||(this.timestampBuffer=kt(this.buffer,this.currentTime())):this.timestampBuffer=null}pushDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.push(this.getHigh(e)),void this.yExtent.push(this.getLow(e));this.yExtent.push(this.getY(e)),this.getY0&&this.yExtent.push(this.getY0(e));for(let t of this.resolvedRibbons){let i=t.getTop(e),r=t.getBottom(e);Number.isFinite(i)&&this.yExtent.push(i),Number.isFinite(r)&&this.yExtent.push(r)}}evictDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.evict(this.getHigh(e)),void this.yExtent.evict(this.getLow(e));this.yExtent.evict(this.getY(e)),this.getY0&&this.yExtent.evict(this.getY0(e));for(let t of this.resolvedRibbons){let i=t.getTop(e),r=t.getBottom(e);Number.isFinite(i)&&this.yExtent.evict(i),Number.isFinite(r)&&this.yExtent.evict(r)}}rebuildYExtent(){this.yExtent.clear();for(let e of this.buffer)this.pushDatumYExtent(e)}rebuildExtents(){this.xExtent.clear(),this.yExtent.clear();for(let e of this.buffer)this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e)}ingest(e){if(e.bounded&&this._lastBoundedInsertsRef===e.inserts)return this.updateResults.recordNoop("replace"),!1;let t=this.currentTime();if(this.lastIngestTime=t,this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,e.bounded){this._lastBoundedInsertsRef=e.inserts,this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this.timestampBuffer&&this.timestampBuffer.clear();let i=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode;if(this.getX=i?Lt(this.config.timeAccessor||this.config.xAccessor,"time"):Lt(this.config.xAccessor,"x"),this.xIsDate=!1,e.inserts.length>0){let t=e.inserts[0],i=this.config.xAccessor,r="function"==typeof i?i(t):t[i||"x"],s=r instanceof Date,a="string"==typeof r&&Number.isFinite(He(r));if(this.xIsDate=s||a,a){let e="string"==typeof i?i:void 0;this.getX=e?t=>Ge(t[e]):e=>Ge(i(e))}}wt(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(let i of e.inserts)At(this.buffer,i,this.timestampBuffer,t),this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i)}else for(let i of e.inserts){if("growing"===this.config.windowMode&&this.buffer.full){let e=this.config.maxCapacity??1e5;e>this.growingCap&&(this.growingCap=Math.min(2*this.growingCap,e),this.buffer.resize(this.growingCap),this.timestampBuffer&&this.timestampBuffer.resize(this.growingCap),"production"!==process.env.NODE_ENV&&!this.growingCapacityWarned&&this.growingCap>=5e4&&(this.growingCapacityWarned=!0,console.warn(`[Semiotic] Growing window buffer reached ${this.growingCap} points (cap ${e}). Large canvas scenes are expensive — prefer a sliding window, aggregation, or an explicit maxCapacity if this is intentional.`)))}let e=At(this.buffer,i,this.timestampBuffer,t);this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i),null!=e&&(this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e))}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}computeScene(e){let{config:t,buffer:i}=this,r=this.scales,s=this.lastLayout;if(!this.needsFullRebuild&&!t.customLayout&&this.lastLayout&&this.scene.length>0&&this.scales&&0>=(this.config.scalePadding??0)&&(this.lastLayout.width!==e.width||this.lastLayout.height!==e.height))return void this.remapScene(e);this.xExtent.dirty&&this.xExtent.recalculate(i,this.getX),this.yExtent.dirty&&this.rebuildYExtent();let a=this.getBufferArray(),n=this.xExtent.extent,o=this.yExtent.extent,l="waterfall"===t.chartType&&i.size>0?C(a,this.getX,n,t.xExtent,t.xScaleType):w(n,t.xExtent),c=w(o,t.yExtent),h=!(!(d=t.yExtent)||null==d[0]||null==d[1]),u="exact"===(t.yAxisExtent??t.axisExtent);var d;if("stackedarea"===t.chartType&&!h&&i.size>0){let e=k({config:t,groups:this.groupData(a),getX:this.getX,getY:this.getY,bufferSize:i.size,ingestVersion:this._ingestVersion,stackExtentCache:this._stackExtentCache});c=e.yDomain,this._stackExtentCache=e.stackExtentCache}else"bar"===t.chartType&&t.binSize&&!h&&i.size>0?c=A(i,this.getX,this.getY,t.binSize,this.getCategory,t.extentPadding,u):"waterfall"===t.chartType&&!h&&i.size>0?c=_(i,this.getY,t.extentPadding,u):!h&&c[0]!==1/0&&(c=P(c,a,this.resolvedRibbons),c=S(c,{exactMode:u,extentPadding:t.extentPadding,userMin:t.yExtent?.[0],userMax:t.yExtent?.[1],yScaleType:t.yScaleType,dataYDomain:o}));c=M(c,t.yExtent,!!h),({xDomain:l,yDomain:c}=R(l,c,t.xScaleType)),this.scales=T({config:t,layout:e,xDomain:l,yDomain:c}),this._customLayoutFailedThisBuild=!1;let p=this.buildSceneNodes(e,a);if(this._customLayoutFailedThisBuild)return!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=r,this.lastLayout=s):(this.scene=[],this.spatialIndex.rebuild(this.config.chartType,this.scene)),void(this.needsFullRebuild=!0);this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=p,this.config.decay&&this.applyDecay(this.scene,a),this.config.pulse&&this.applyPulse(this.scene,a,this.currentTime()),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&(this.prevPositionMap.size>0||this.prevPathMap.size>0)&&this.startTransition(),this.spatialIndex.rebuild(this.config.chartType,this.scene),this.needsFullRebuild=!1,this.lastLayout={width:e.width,height:e.height},this.version++}get quadtree(){return this.spatialIndex.quadtree}get maxPointRadius(){return this.spatialIndex.maxPointRadius}remapScene(e){let t=e.width/this.lastLayout.width,i=e.height/this.lastLayout.height;for(let e of this.scene)switch(e.type){case"line":for(let r of e.path)r[0]*=t,r[1]*=i;break;case"area":for(let r of e.topPath)r[0]*=t,r[1]*=i;for(let r of e.bottomPath)r[0]*=t,r[1]*=i;e.clipRect&&(e.clipRect={x:e.clipRect.x*t,y:e.clipRect.y*i,width:e.clipRect.width*t,height:e.clipRect.height*i}),e.strokeColorBands&&(e.strokeColorBands=e.strokeColorBands.map(e=>({...e,y:e.y*i,height:e.height*i})));break;case"point":case"glyph":e.x*=t,e.y*=i;break;case"rect":case"heatcell":e.x*=t,e.y*=i,e.w*=t,e.h*=i;break;case"candlestick":e.x*=t,e.openY*=i,e.closeY*=i,e.highY*=i,e.lowY*=i}let r=this.scales.x.domain(),s=this.scales.y.domain(),a=this.scales.x.range(),n=this.scales.y.range(),o=Y,l=Math.max(0,Math.min(this.config.scalePadding||0,Math.min(e.width,e.height)/2-1)),c=n[1]>n[0];this.scales={x:o(this.config.xScaleType,r,a[0]>a[1]?[e.width-l,l]:[l,e.width-l]),y:o(this.config.yScaleType,s,c?[l,e.height-l]:[e.height-l,l])},this.lastLayout={width:e.width,height:e.height},this.spatialIndex.rebuild(this.config.chartType,this.scene),this.version++}buildSceneNodes(e,t){let{config:i,scales:r}=this;if(!r)return[];if(i.customLayout){let s={data:t,scales:r,dimensions:{width:e.width,height:e.height,margin:i.layoutMargin??{top:0,right:0,bottom:0,left:0},plot:{x:0,y:0,width:e.width,height:e.height}},theme:{semantic:i.themeSemantic??{},categorical:i.themeCategorical??gr},resolveColor:(e,t)=>{let r=this.resolveGroupColor(e);if(r)return r;let s=this.resolveLineStyle(e,t);return s.stroke?s.stroke:"string"==typeof s.fill?s.fill:i.themeSemantic?.primary??"#4e79a7"},config:i.layoutConfig??{},selection:i.layoutSelection??null},a=Xt({family:"xy",logLabel:"customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:i.onLayoutError,run:()=>i.customLayout(s)});if("failure"===a.kind)return this.lastCustomLayoutFailure=a.diagnostic,this._customLayoutFailedThisBuild=!0,a.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,[]);let n=a.result;this.customLayoutOverlays=n.overlays??null,this.lastCustomLayoutResult=n,this.lastCustomLayoutFailure=null;let o=n.nodes??[];if(this._customRestyle=n.restyle,this.hasCustomRestyle=!!n.restyle,this.hasCustomRestyle){this._baseStyles=/* @__PURE__ */new WeakMap;for(let e of o)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(o,i.layoutSelection??null)}return Wt({label:"customLayout",nodes:o,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),o}if(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,0===t.length)return[];let s={scales:r,config:i,getX:this.getX,getY:this.getY,getY0:this.getY0,getSize:this.getSize,getColor:this.getColor,getSymbol:this.getSymbol,getGroup:this.getGroup,getCategory:this.getCategory,getPointId:this.getPointId,ribbons:this.resolvedRibbons,getOpen:this.getOpen,getHigh:this.getHigh,getLow:this.getLow,getClose:this.getClose,resolveLineStyle:(e,t)=>this.resolveLineStyle(e,t),resolveAreaStyle:(e,t)=>this.resolveAreaStyle(e,t),resolveBoundsStyle:(e,t)=>this.resolveBoundsStyle(e,t),resolveColorMap:e=>this.resolveColorMap(e),resolveGroupColor:e=>this.resolveGroupColor(e),groupData:e=>this.groupData(e),barCategoryCache:this._barCategoryCache},a=Ke(i.chartType);if(!a)return qe(n=i.chartType)||Ji&&(zr.has(n)||(zr.add(n),console.warn(`[semiotic] StreamXYFrame: no XY plugin registered for "${n}" during SSR. Import a chart HOC, or call registerBuiltInXYPlugins() from "semiotic/xy" or "semiotic/realtime/core" before render.`))),[];var n;let o=Ze(a(s,t,e));return"bar"===i.chartType&&(this._barCategoryCache=s.barCategoryCache??null,this._binBoundaries=o.binBoundaries),o.nodes}resolveBoundsStyle(e,t){return N(this.config,e,t,(e,t)=>this.resolveLineStyle(e,t))}computeDecayOpacity(e,t){let i=this.config.decay;return i&&t>1?zt(i,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._ingestVersion)return this._datumIndexCache.map;let t=Ft(e);return this._datumIndexCache={version:this._ingestVersion,map:t},t}applyDecay(e,t){this.config.decay&&$t(this.config.decay,e,t,this.getDatumIndexMap(t))}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&bt(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}get transitionContext(){return{runtimeMode:this.config.runtimeMode,getX:this.getX,getY:this.getY,getCategory:this.getCategory,getPointId:this.getPointId}}snapshotPositions(){y(this.transitionContext,this.scene,this.prevPositionMap,this.prevPathMap)}synthesizeIntroPositions(){this.prevPositionMap.clear(),this.prevPathMap.clear();let e=this.scales?.y(0)??0;for(let t=0;this.scene.length>t;t++){let i=this.scene[t],r=p(this.transitionContext,i,t);r&&("point"===i.type?this.prevPositionMap.set(r,{x:i.x,y:i.y,r:0,opacity:0}):"rect"===i.type?this.prevPositionMap.set(r,{x:i.x,y:e,w:i.w,h:0,opacity:i.style.opacity??1}):"heatcell"===i.type?this.prevPositionMap.set(r,{x:i.x,y:i.y,w:i.w,h:i.h,opacity:0}):"line"===i.type?(i._introClipFraction=0,this.prevPathMap.set(r,{path:i.path.map(e=>[e[0],e[1]]),pathIds:i.pathIds?.slice(),opacity:i.style.opacity})):"area"===i.type&&(i._introClipFraction=0,this.prevPathMap.set(r,{topPath:i.topPath.map(e=>[e[0],e[1]]),bottomPath:i.bottomPath.map(e=>[e[0],e[1]]),pathIds:i.pathIds?.slice(),opacity:i.style.opacity})))}}startTransition(){if(!this.config.transition)return;let e=f(this.transitionContext,this.config.transition,{scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},this.prevPositionMap,this.prevPathMap,this.currentTime());this.scene=e.scene,this.exitNodes=e.exitNodes,this.activeTransition=e.activeTransition}advanceTransition(e){if(!this.activeTransition||!this.config.transition)return!1;let t={scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},i=m(e,this.config.transition,t,this.prevPositionMap);return this.scene=t.scene,this.exitNodes=t.exitNodes,this.activeTransition=t.activeTransition,i}cancelIntroAnimation(){this.prevPositionMap.clear(),this.prevPathMap.clear(),this.activeTransition=null,ct(this.scene),this.exitNodes=[]}groupData(e){let{result:t,cache:i}=D(e,this.getGroup,this._ingestVersion,this._groupDataCache);return this._groupDataCache=i,t}resolveColorMap(e){let{map:t,cache:i}=E(e,this.getColor,this.config,this._ingestVersion,this._colorMapCache);return this._colorMapCache=i,t}resolveLineStyle(e,t){return B(this.config,e,t,e=>this.resolveGroupColor(e))}resolveAreaStyle(e,t){return I(this.config,e,t,e=>this.resolveGroupColor(e))}resolveGroupColor(t){let{color:i,groupColorCounter:r}=O({group:t,colorMapCache:this._colorMapCache,groupColorMap:this._groupColorMap,groupColorCounter:this._groupColorCounter,groupColorMapCap:e.GROUP_COLOR_MAP_CAP,config:this.config});return this._groupColorCounter=r,i}getBufferArray(){return(this._bufferDirty||!this._bufferArrayCache)&&(this._bufferArrayCache=this.buffer.toArray(),this._bufferDirty=!1),this._bufferArrayCache}getData(){return this.getBufferArray()}remove(e){if(!this.getPointId)throw Error("remove() requires pointIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();let t=lt(e),i=this.getPointId,r=e=>t.has(i(e));_t(this.buffer,this.timestampBuffer,r);let s=this.buffer.remove(r);if(0===s.length)return this.updateResults.recordNoop("remove"),s;for(let e of s)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",s.length),s}update(e,t){if(!this.getPointId)throw Error("update() requires pointIdAccessor to be configured");let i=lt(e),r=this.getPointId,s=/* @__PURE__ */new Set;this.buffer.forEach((e,t)=>{i.has(r(e))&&s.add(t)});let a=this.buffer.update(e=>i.has(r(e)),t);if(0===a.length)return this.updateResults.recordNoop("update"),a;for(let e of a)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.buffer.forEach((e,t)=>{s.has(t)&&(this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e))}),this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",a.length),a}getBinBoundaries(){return this._binBoundaries}getExtents(){return this.xExtent.min===1/0?null:{x:this.xExtent.extent,y:this.yExtent.extent}}clear(){this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.prevPathMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this._lastBoundedInsertsRef=null,this.needsFullRebuild=!0,this._bufferDirty=!0,this._bufferArrayCache=null,this._datumIndexCache=null,this.lastLayout=null,this.scales=null,this.scene=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this.spatialIndex.clear(),this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=/* @__PURE__ */new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getBuffer(){return this.buffer}getXAccessor(){return this.getX}getYAccessor(){return this.getY}getCategoryAccessor(){return this.getCategory}applyCustomRestyle(e,t){let i=this._customRestyle;if(i)for(let r of e){let e=this._baseStyles.get(r)??r.style??{},s=i(r,t);r.style=s?{...e,...s}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}updateConfig(e){let t={...this.config},i=Object.keys(e).filter(i=>e[i]!==t[i]);"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||"themeCategorical"in e||"colorAccessor"in e)&&(this._colorMapCache=null,this._groupColorMap=/* @__PURE__ */new Map,this._groupColorCounter=0),("barColors"in e||"colorScheme"in e)&&(this._barCategoryCache=null),("normalize"in e||"extentPadding"in e||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e||"boundsAccessor"in e||"band"in e||"y0Accessor"in e||"openAccessor"in e||"highAccessor"in e||"lowAccessor"in e||"closeAccessor"in e||"groupAccessor"in e||"categoryAccessor"in e||"chartType"in e||"runtimeMode"in e)&&(this._stackExtentCache=null);let r=!1,s=!1;Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let a="chartType"in e&&e.chartType!==t.chartType||"runtimeMode"in e&&e.runtimeMode!==t.runtimeMode;if(a||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e){let e=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode,i=e&&this.config.valueAccessor||this.config.yAccessor,n=e&&t.valueAccessor||t.yAccessor,o=a||!Tt(e&&this.config.timeAccessor||this.config.xAccessor,e&&t.timeAccessor||t.xAccessor),l=a||!Tt(i,n);(o||l)&&(e?(this.getX=Lt(this.config.timeAccessor||this.config.xAccessor,"time"),this.getY=Lt(this.config.valueAccessor||this.config.yAccessor,"value")):(this.getX=Lt(this.config.xAccessor,"x"),this.getY=Lt(this.config.yAccessor,"y")),l&&this.resolvedRibbons.some(e=>"bounds"===e.kind)&&(this.resolvedRibbons=v(this.config)),r=!0,s=!0)}if("groupAccessor"in e&&!Tt(e.groupAccessor,t.groupAccessor)&&(this.getGroup=null!=this.config.groupAccessor?Dt(this.config.groupAccessor):void 0,r=!0),"categoryAccessor"in e&&!Tt(e.categoryAccessor,t.categoryAccessor)&&(this.getCategory=null!=this.config.categoryAccessor?Dt(this.config.categoryAccessor):void 0,r=!0),"sizeAccessor"in e&&!Tt(e.sizeAccessor,t.sizeAccessor)&&(this.getSize=this.config.sizeAccessor?Lt(this.config.sizeAccessor,"size"):void 0,r=!0),"symbolAccessor"in e&&!Tt(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?Dt(this.config.symbolAccessor):void 0,r=!0),"colorAccessor"in e&&!Tt(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?Dt(this.config.colorAccessor):void 0,r=!0),"y0Accessor"in e&&!Tt(e.y0Accessor,t.y0Accessor)&&(this.getY0=this.config.y0Accessor?Lt(this.config.y0Accessor,"y0"):void 0,r=!0,s=!0),("boundsAccessor"in e&&!Tt(e.boundsAccessor,t.boundsAccessor)||"band"in e&&e.band!==t.band||"boundsStyle"in e&&e.boundsStyle!==t.boundsStyle)&&(this.resolvedRibbons=v(this.config),r=!0,s=!0),"pointIdAccessor"in e&&!Tt(e.pointIdAccessor,t.pointIdAccessor)&&(this.getPointId=null!=this.config.pointIdAccessor?Dt(this.config.pointIdAccessor):void 0,r=!0),"candlestick"===this.config.chartType&&(a||"openAccessor"in e&&!Tt(e.openAccessor,t.openAccessor)||"closeAccessor"in e&&!Tt(e.closeAccessor,t.closeAccessor)||"highAccessor"in e&&!Tt(e.highAccessor,t.highAccessor)||"lowAccessor"in e&&!Tt(e.lowAccessor,t.lowAccessor))){let e=null!=this.config.openAccessor,t=null!=this.config.closeAccessor;this.getOpen=e?Lt(this.config.openAccessor,"open"):void 0,this.getHigh=Lt(this.config.highAccessor,"high"),this.getLow=Lt(this.config.lowAccessor,"low"),this.getClose=t?Lt(this.config.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!e&&!t,r=!0,s=!0}if("accessorRevision"in e&&e.accessorRevision!==t.accessorRevision&&(r=!0,s=!0),!r){let i=Object.keys(e).filter(e=>!e.endsWith("Accessor")&&"timeAccessor"!==e&&"valueAccessor"!==e);for(let s of i)if(e[s]!==t[s]){r=!0;break}}r&&(s&&this.rebuildExtents(),this.needsFullRebuild=!0),this.updateResults.recordConfig(i,("bar"===this.config.chartType||"heatmap"===this.config.chartType)&&!this.config.trackHoverRows&&Cr(t.areaStyle)!==Cr(this.config.areaStyle))}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};as.GROUP_COLOR_MAP_CAP=1e3;var ns=as;jt(ns);import{useCallback as os,useImperativeHandle as ls}from"react";import{line as cs}from"d3-shape";var hs=/* @__PURE__ */new WeakMap;import*as us from"react";import{jsx as ds,jsxs as ps}from"react/jsx-runtime";import{useEffect as gs,useRef as ys,useState as fs}from"react";import{useEffect as ms,useState as xs}from"react";import{jsx as vs}from"react/jsx-runtime";import{useMemo as bs,useRef as ws,useEffect as ks,useId as As}from"react";import*as _s from"react";import{jsx as Cs}from"react/jsx-runtime";var Ps=null,Ss=null,Ms=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];import{useMemo as Rs}from"react";import{jsx as Ys,jsxs as Ts}from"react/jsx-runtime";import{Fragment as Ls,jsx as Ds,jsxs as Es}from"react/jsx-runtime";import{useCallback as Os,useEffect as Bs,useState as Is}from"react";import*as Ns from"react";import{area as zs,line as Fs}from"d3-shape";import{jsx as $s,jsxs as Ws}from"react/jsx-runtime";var Xs={axisStroke:"#ccc",tickText:"#666",crosshair:"rgba(0, 0, 0, 0.25)",hoverFill:"rgba(255, 255, 255, 0.3)",hoverStroke:"rgba(0, 0, 0, 0.4)",pointRing:"white",primary:"#007bff",background:""};import{useEffect as js}from"react";import{jsx as Vs,jsxs as Hs}from"react/jsx-runtime";$e.ownsChrome=!0;import{jsx as Gs,jsxs as Us}from"react/jsx-runtime";var qs=Yt,Ks=Xs,Js=Mr(Sr(function(t,i){let{chartType:r,runtimeMode:s,data:a,chunkThreshold:n,chunkSize:o,xAccessor:l,yAccessor:c,accessorRevision:h,colorAccessor:u,sizeAccessor:d,symbolAccessor:p,symbolMap:g,groupAccessor:y,lineDataAccessor:f,curve:m,normalize:x,baseline:v,stackOrder:b,binSize:w,valueAccessor:k,arrowOfTime:A="right",windowMode:_,capacityMode:C,windowSize:P,capacity:S,timeAccessor:M,xExtent:R,yExtent:Y,invertY:T,extentPadding:L=.1,scalePadding:D,sizeRange:E,size:O=[500,300],responsiveWidth:B,responsiveHeight:I,margin:N,className:z,background:$,maxDevicePixelRatio:W,renderMode:j,lineStyle:H,pointStyle:G,areaStyle:U,barStyle:q,waterfallStyle:K,swarmStyle:J,barColors:Z,colorScheme:Q,boundsAccessor:ee,boundsStyle:te,y0Accessor:ie,band:re,gradientFill:se,lineGradient:ae,semanticLineStops:ne,areaGroups:oe,openAccessor:le,highAccessor:ce,lowAccessor:he,closeAccessor:ue,candlestickStyle:de,showAxes:pe=!0,axes:ge,xLabel:fe,yLabel:me,yLabelRight:xe,xFormat:ve,yFormat:be,axisExtent:ke,tickFormatTime:Ae,tickFormatValue:_e,hoverAnnotation:Me,tooltipContent:Re,customHoverBehavior:Ye,customClickBehavior:Le,onObservation:De,annotationObservationCallback:Ee,chartId:Fe,enableHover:Ve,hoverRadius:He=30,tooltipMode:Ge,annotations:Ue,onAnnotationActivate:qe,autoPlaceAnnotations:Ke,svgAnnotationRules:Ze,showGrid:Qe,legend:et,legendHoverBehavior:tt,legendClickBehavior:it,legendHighlightedCategory:rt,legendIsolatedCategories:st,legendPosition:at,legendLayout:ot,legendCategoryAccessor:lt,onCategoriesChange:ct,backgroundGraphics:ht,foregroundGraphics:gt,canvasPreRenderers:yt,svgPreRenderers:xt,title:vt,categoryAccessor:bt,brush:wt,onBrush:kt,decay:At,pulse:_t,transition:Yt,animate:Tt,staleness:Lt,frameScheduler:Dt,clock:zt,random:Ft,seed:$t,paused:Wt=!1,suspendWhenHidden:Xt=!0,heatmapAggregation:jt,heatmapXBins:Ut,heatmapYBins:qt,showValues:Kt,heatmapValueFormat:Jt,heatmapColorScale:Zt,onColorDomainChange:ii,marginalGraphics:ri,pointIdAccessor:si,xScaleType:ai,yScaleType:ui,accessibleTable:gi=!0,description:bi,summary:ki,linkedCrosshairName:_i,linkedCrosshairSourceId:Ci,customLayout:Pi,onLayoutError:Si,layoutConfig:Mi,layoutSelection:Ri}=t,Ti=_??C??"sliding",Li=P??S??200,{customHoverBehavior:Di,customClickBehavior:Ei,hasClickBehavior:Bi}=Pt({customHoverBehavior:Ye,customClickBehavior:Le,onObservation:De,chartId:Fe,chartType:"StreamXYFrame"}),Ii=Tr().replace(/:/g,""),zi=Dr(!1),$i=Dr({w:-1,h:-1}),Xi=Dr(!1),ji=di({sizeProp:O,responsiveWidth:B,responsiveHeight:I,userMargin:N,marginDefault:qs,title:vt,legend:et,legendPosition:at,...pt(t,et),animate:Tt,transitionProp:Yt,frameScheduler:Dt,clock:zt,random:Ft,seed:$t,paused:Wt,suspendWhenHidden:Xt,themeDirtyRef:zi}),Hi=Ui(),Gi=qi(),{reducedMotionRef:Ki,responsiveRef:Qi,size:sr,currentTheme:nr,transition:cr,introEnabled:ur,tableId:dr,rafRef:pr,renderFnRef:gr,scheduleRender:yr,frameRuntime:fr}=ji;Yr(()=>xr(()=>{zi.current=!0,yr()}),[yr]);let mr=ji.margin;if(ri){let e={...ji.margin};ri.top&&60>e.top&&(e.top=60),ri.bottom&&60>e.bottom&&(e.bottom=60),ri.left&&60>e.left&&(e.left=60),ri.right&&60>e.right&&(e.right=60),mr=e}let vr=sr[0]-mr.left-mr.right,br=sr[1]-mr.top-mr.bottom,wr=(ge?.find(e=>"left"===e.orient)??ge?.find(e=>"right"===e.orient))?.extent??ke,kr=Lr(()=>Oi(a),[a]),_r=Me??Ve,[Cr,Sr]=Er(0),Mr=Dr(0),[Or,Br]=Er(null),Ir=Et(gt,sr,mr,Or),Nr=Et(ht,sr,mr,Or),zr=Dr(null),Fr=Dr(!1),$r=Dr(null),Wr=Dr(void 0),[Xr,jr]=Er(null),Vr=Dr(Ks.primary),Hr=Dr(Oe()),Gr=Dr(!1),Ur=er("StreamXYFrame"),[qr,Kr]=Er(!1),Jr="streaming"===s||["bar","swarm","waterfall"].includes(r),Zr=!!Di,Qr=Lr(()=>({chartType:r,runtimeMode:Jr?"streaming":"bounded",windowSize:Li,windowMode:Ti,arrowOfTime:Jr?A:"right",extentPadding:L,scalePadding:D,axisExtent:ke,yAxisExtent:wr,xAccessor:l,yAccessor:c,accessorRevision:h,timeAccessor:Jr?M:void 0,valueAccessor:k,colorAccessor:u,sizeAccessor:d,symbolAccessor:p,symbolMap:g,groupAccessor:y||(f?"_lineGroup":void 0),categoryAccessor:bt,lineDataAccessor:f,xScaleType:ai,yScaleType:ui,xExtent:R,yExtent:Y,invertY:T,sizeRange:E,binSize:w,normalize:x,baseline:v,stackOrder:b,boundsAccessor:ee,boundsStyle:te,y0Accessor:ie,band:re,gradientFill:ft(se),areaGroups:oe?new Set(oe):void 0,lineGradient:mt(ae),semanticLineStops:ne,openAccessor:le,highAccessor:ce,lowAccessor:he,closeAccessor:ue,candlestickStyle:de,lineStyle:H,trackHoverRows:Zr,pointStyle:G,areaStyle:U,swarmStyle:J,waterfallStyle:K,colorScheme:Q,barColors:Z,barStyle:q,annotations:Ue,decay:At,pulse:_t,transition:cr,introAnimation:ur,staleness:Lt,clock:fr.now,heatmapAggregation:jt,heatmapXBins:Ut,heatmapYBins:qt,showValues:Kt,heatmapValueFormat:Jt,heatmapColorScale:Zt,pointIdAccessor:si,curve:m,themeCategorical:nr?.colors?.categorical,themeSemantic:Ar(nr),themeSequential:nr?.colors?.sequential,themeDiverging:nr?.colors?.diverging,customLayout:Pi,onLayoutError:Si,layoutConfig:Mi,layoutMargin:mr}),[r,Jr,Li,Ti,A,L,D,ke,wr,l,c,h,M,k,u,d,p,g,y,f,bt,ai,ui,R,Y,T,E,w,x,v,b,ee,te,ie,re,se,oe,ae,ne,le,ce,he,ue,de,H,Zr,G,U,J,K,Q,Z,q,Ue,At,_t,cr,ur,Lt,fr.now,jt,Ut,qt,Kt,Jt,Zt,si,m,nr,Pi,Si,Mi,mr]),es=ni(Qr),ts=Dr(null);ts.current||(ts.current=new ns(es));let is=Ot(ts,lt,ct,e=>e.getData()),rs=Dr({onColorDomainChange:ii,chartType:r}),ss=Dr(void 0);rs.current={onColorDomainChange:ii,chartType:r};let as=Rr(()=>{let{onColorDomainChange:e,chartType:t}=rs.current;if(!e||"heatmap"!==t)return;let i=1/0,r=-1/0;for(let e of ts.current?.scene??[]){if("heatcell"!==e.type)continue;let t=Number(e.value??e.datum?.value);Number.isFinite(t)&&(i>t&&(i=t),t>r&&(r=t))}let s=Number.isFinite(i)&&Number.isFinite(r)?[i,r]:null,a=ss.current;null===a&&null===s||a&&s&&a[0]===s[0]&&a[1]===s[1]||(ss.current=s,e(s))},[]);Ie(r,Pi,zi,yr,ts),Ht(ts,es,zi,yr),Gt(ts,Ri,zi,yr);let os=Dr(null);os.current||(os.current=new nt(e=>{let t=ts.current;t&&t.ingest(e)&&(zi.current=!0,yr())},{chunkThreshold:n,chunkSize:o})),Yr(()=>{os.current?.updateChunkOptions({chunkThreshold:n,chunkSize:o})},[n,o]),F(i,{storeRef:ts,adapterRef:os,dirtyRef:zi,scheduleRender:yr,hoverRef:zr,setHoverPoint:jr}),Yr(()=>{a&&os.current?.setBoundedData(We(kr,f))},[a,kr,f]);let{marginalXValues:ls,marginalYValues:cs,refreshMarginalValues:hs}=Se(ts,ri,kr,l,c),{canvasRef:us,interactionCanvasRef:ds,resolutionDirtyRef:ps}=xi(ji,{storeRef:ts,dirtyRef:zi,hydrated:Hi,wasHydratingFromSSR:Gi,cleanup:()=>os.current?.clear(),maxDevicePixelRatio:W,canvasPaintDependencies:[r,vr,br,pe,$,ht,H,j,yt,yr]}),{hoverHandlerRef:gs,hoverLeaveRef:ys,onPointerMove:fs,onPointerLeave:ms,pointerStateRef:xs}=ji;gs.current=e=>{let t=us.current;if(!t)return;let i=t.getBoundingClientRect(),s=e.clientX-i.left-mr.left,a=e.clientY-i.top-mr.top;if(0>s||s>vr||0>a||a>br){if(Wi(t),!_r)return;return void(zr.current&&(zr.current=null,$r.current=null,jr(null),Di?.(null),yr()))}let n=ts.current;if(!n||0===n.scene.length)return void Wi(t);let o=wi(He,e.pointerType),c=X(n.scene,s,a,o,n.quadtree,n.maxPointRadius);if(Wi(t,Ni(c?.node)),!_r)return;let h="multi"===Ge,u=()=>{zr.current&&(zr.current=null,$r.current=null,jr(null),Di&&Di(null),yr())};if(!c&&!h)return void u();let d=h||!c?s:c.x,p=h||!c?a:c.y,g=c?.datum?Mt(c.datum,n.resolvedRibbons):{},y=n.scales?.x?.invert,f="function"==typeof y?y(d):void 0,m=Ai(g,d,p,null!=f?{xValue:f,xPx:d}:void 0);if(h&&n.scene.length>0&&n.scales){let e=V(n.scene,d,Math.max(o,vr));if(e.length>0){let t=n.scales.y.invert,i=Vr.current,s=y?y(d):d;if(c)m.xValue=s,m.xPx=d;else{let e={xValue:s};"string"==typeof l&&(e[l]=s),m=Ai(e,d,p,{xValue:s,xPx:d})}m.allSeries=e.map(e=>{let s=t?t(e.y):e.y,a=null!=e.y0?t?t(e.y0):e.y0:void 0;return{group:e.group||"",value:"stackedarea"===r&&null!=a?s-a:s,valuePx:e.y,color:e.color||i,datum:Mt(e.datum,n.resolvedRibbons)}})}}c||m.allSeries?.length?(zr.current=m,$r.current=c?.node??null,jr(m),Di?.(m),yr()):u()},ys.current=()=>{Wi(us.current),zr.current&&(zr.current=null,$r.current=null,jr(null),Di?.(null),yr())},Vi(us);let vs=Dr(()=>{});vs.current=e=>{if(mi(e.target)||!Ei)return;let t=us.current;if(!t)return;let i=t.getBoundingClientRect(),r=e.clientX-i.left-mr.left,s=e.clientY-i.top-mr.top;if(0>r||r>vr||0>s||s>br)return void Ei(null);let a=ts.current;if(!a||0===a.scene.length)return void Ei(null);let n=wi(He,Wr.current),o=X(a.scene,r,s,n,a.quadtree,a.maxPointRadius);if(!o)return void Ei(null);let l=o.datum||{},c=a.scales?.x?.invert,h="function"==typeof c?c(o.x):void 0;Ei(Ai(l,o.x,o.y,null!=h?{xValue:h,xPx:o.x}:void 0),{type:"activate",inputType:Yi(Wr.current)})};let bs=Rr(e=>vs.current(e),[]),{kbFocusIndexRef:ws,focusedNavPointRef:ks,onKeyDown:As}=St({storeRef:ts,hoverRef:zr,hoveredNodeRef:$r,setHoverPoint:jr,customHoverBehavior:Di,customClickBehavior:Ei,scheduleRender:yr}),_s=Rr(e=>{Nt(xs,e,!!_r,Fr.current,us.current)&&(Wr.current=e.pointerType,ws.current=-1,ks.current=null,fs(e))},[us,_r,ks,ws,fs,xs]),Cs=Rr(e=>{Nt(xs,e,!!_r,Fr.current,us.current,"mouse")&&(Wr.current="mouse",ws.current=-1,ks.current=null,fs({clientX:e.clientX,clientY:e.clientY,pointerType:"mouse"}))},[us,_r,ks,ws,fs,xs]),Ps=Rr(e=>{Wr.current=e.pointerType},[]);gr.current=()=>{if(pr.current=null,!fr.isActive)return;let e=us.current,t=ds.current;if(!e||!t)return;let i=ts.current;if(!i)return;let s=fr.now(),a=null!=i.activeTransition,n=i.advanceTransition(Ki.current?s+1e6:s),o=!Ki.current&&n,l=$i.current.w!==vr||$i.current.h!==br,c=ps.current,h=zi.current||a||l,u=a&&!n,d=i.consumeStylePaintPending(),p=!1,g=i.getLastUpdateResult(),y=Ur.current.beforeCompute(g,o);(zi.current||l)&&(!o||l)&&(i.computeScene({width:vr,height:br}),$i.current={w:vr,h:br},p=!0,is(),as()),(p||d)&&(Fr.current=Fi(i.scene),Fr.current||Wi(e)),Fr.current&&(a||p||d)&&Xe({canvas:e,pointer:xs.current,store:i,margin:mr,width:vr,height:br,hoverRadius:He,geometryMoved:a||p}),Ur.current.afterCompute(y,p,l);let f=Ct(i,s,p,Xi),m=fi(W,sr);pi(e,sr,m),pi(t,sr,m);let x=Hr.current.resolve(e);Vr.current=x.primary;let v=Qt(Lt,i.lastIngestTime>0?s-i.lastIngestTime:0),b=Lt&&v.isStale;if(h||d||f.changed||c){let t=yi(e,sr,mr,m);if(t){if(t.clearRect(-mr.left,-mr.top,sr[0],sr[1]),Lt&&1>v.alpha&&(t.globalAlpha=v.alpha),li(t,{background:$,hasBackgroundGraphics:!!ht,themeBackground:x.background,x:-mr.left,y:-mr.top,width:sr[0],height:sr[1]}),t.save(),"function"==typeof t.rect&&(t.beginPath(),t.rect(0,0,vr,br),t.clip()),yt&&i.scales)for(let e of yt)t.save(),e(t,i.scene,i.scales,{width:vr,height:br}),t.restore();let e=Je(r,!!Pi);Bt({context:t,nodes:i.scene,renderMode:j,pixelRatio:m,paintBuiltIn:r=>{if(e&&i.scales)for(let s of e)s(t,r,i.scales,{width:vr,height:br})}}),t.restore(),Lt&&1>v.alpha&&(t.globalAlpha=1)}}let w=!!(_r&&zr.current&&i.scales),k=!!($r.current&&Array.isArray(Me)&&Me.some(e=>e&&"object"==typeof e&&"highlight"===e.type)),A=w||k;if(Rt(A,Gr.current)){let e=yi(t,sr,mr,m);if(e&&(e.clearRect(-mr.left,-mr.top,sr[0],sr[1]),w&&zr.current&&Ne(e,zr.current,vr,br,"object"==typeof _r?_r:{},$r.current,x),k&&$r.current&&Array.isArray(Me))){let t=Me.find(e=>e&&"object"==typeof e&&"highlight"===e.type);t&&ze(e,i.scene,$r.current,t,x)}Gr.current=A}h&&e&&e.setAttribute("aria-label",ir(i.scene,r+" chart"));let _=zi.current;if(zi.current=_&&o&&!p,ps.current=!1,_&&i.scales){let e=e=>"object"==typeof e&&null!==e&&"function"==typeof e.valueOf?e.valueOf():e;(!Or||e(Or.x.domain()[0])!==e(i.scales.x.domain()[0])||e(Or.x.domain()[1])!==e(i.scales.x.domain()[1])||e(Or.y.domain()[0])!==e(i.scales.y.domain()[0])||e(Or.y.domain()[1])!==e(i.scales.y.domain()[1])||Or.x.range()[0]!==i.scales.x.range()[0]||Or.x.range()[1]!==i.scales.x.range()[1]||Or.y.range()[0]!==i.scales.y.range()[0]||Or.y.range()[1]!==i.scales.y.range()[1])&&Br(i.scales),ri&&hs(i.getData())}(Ue&&Ue.length>0||Pi)&&(p||a)&&(p||u||s-Mr.current>=33)&&(Sr(e=>e+1),Mr.current=s),Lt?.showBadge&&Kr(!!b),(o||null!=i.activeTransition||f.pending)&&yr()},ei(Lt,ts,zi,yr,fr.now,qr,Kr);let Ss=Lr(()=>{if(!ve&&!Ae&&ts.current?.xIsDate&&Or)return we(Or.x.domain())},[ve,Ae,Or]),Ms=ve||Ae||Ss,Rs=_r&&Xr?Re?Re(Xr):/* @__PURE__ */Gs($e,{hover:Xr}):null,Ys=Rs?/* @__PURE__ */Gs(hi,{x:Xr.x,y:Xr.y,containerWidth:vr,containerHeight:br,margin:mr,className:"stream-frame-tooltip",children:Rs}):null,Ts=ks.current,Ls=/* @__PURE__ */Gs(hr,{active:ws.current>=0,hoverPoint:Xr,margin:mr,size:sr,shape:Ts?.shape,width:Ts?.w,height:Ts?.h}),Ds=ut(l,M,"__semiotic_resolvedX","__semiotic_resolvedTime"),Es=ut(c,k,"__semiotic_resolvedY","__semiotic_resolvedValue"),Os=Ds.key,Bs=Es.key,Is=dt(Ds,Es,Ue&&Ue.length>0||!1);if(Ji||!Hi&&Gi){let e=ts.current;e&&a&&(e.ingest({inserts:We(kr,f),bounded:!0}),e.computeScene({width:vr,height:br}));let t=e?.scene??[],i=e?.scales??null,r=Et(gt,sr,mr,i),s=Et(ht,sr,mr,i),n=Ms||(()=>{if(e?.xIsDate&&i)return we(i.x.domain())})(),o=bi||("string"==typeof vt?vt:"XY chart"),h=ri&&e?ye(e.getData(),l,c):{xValues:[],yValues:[]};/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */Vs("div",{style:{opacity:.7,fontSize:11},children:Fe(r)})]})}function We(e,t){if(!t||0===e.length||!e.some(e=>null!=e&&"object"==typeof e&&Array.isArray(e[t])))return e;let i=[];for(let r of e){if(null==r||"object"!=typeof r)continue;let e=r[t];if(!Array.isArray(e))continue;let s=r.label??r.id??r.key;for(let t of e)null==t||"object"!=typeof t||i.push(null==s?t:{...t,_lineGroup:s})}return i}function Xe(e){let{canvas:t,pointer:i,store:r,margin:s,width:a,height:n}=e;ji(t,i,i=>{let o=t.getBoundingClientRect(),l=i.clientX-o.left-s.left,c=i.clientY-o.top-s.top;if(0>l||l>a||0>c||c>n)return;let h=X(r.scene,l,c,wi(e.hoverRadius,i.pointerType),e.geometryMoved?null:r.quadtree,r.maxPointRadius);return Ni(h?.node)})}function je(e){if(e)return"x"===e.dimension?"pan-y":"y"===e.dimension?"pan-x":"none"}function Ve({brush:e,onBrush:t,linkedBrush:i,xAccessor:r,yAccessor:s,defaultDimension:a="xy"}){let n=Gi(i),o=!!e||!!n||!!t,l=n?.xField||("string"==typeof r?r:void 0),c=n?.yField||("string"==typeof s?s:void 0),h="y"!==a||n?.xField?l:void 0,u="x"!==a||n?.yField?c:void 0,d=Zi({name:n?.name||"__unused_brush__",xField:h,yField:u}),p=n?"xyBrush"===d.brushInteraction.brush?"xy":"xBrush"===d.brushInteraction.brush?"x":"y":a,g=ea(d.brushInteraction);g.current=d.brushInteraction;let y=Qs(e=>{let i=g.current;if(!e)return n&&i.end(null),void t?.(null);n&&i.end("xyBrush"===i.brush?[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:"xBrush"===i.brush?e.x:e.y),t?.(e)},[n,t]);return o?{brushStreamProps:{brush:{dimension:p},onBrush:y}}:{brushStreamProps:{}}}import{a as He,b as Ge}from"./c-VN557BQE.min.js";import{a as Ue,b as qe,c as Ke,d as Je,e as Ze,g as Qe}from"./c-MTX2AO5S.min.js";import{a as et}from"./c-7FKPPCGN.min.js";import{a as tt}from"./c-STHZWF3D.min.js";import{a as it,b as rt}from"./c-TVKZC4BY.min.js";import{a as st}from"./c-GYLOSK7M.min.js";import{a as at}from"./c-UUDAON4Z.min.js";import{a as nt,b as ot,c as lt,d as ct,f as ht,g as ut,h as dt,i as pt}from"./c-QPO24R7Q.min.js";import{c as gt,d as yt,j as ft,k as mt}from"./c-HK4OSLZA.min.js";import{a as xt,c as vt,e as bt,f as wt,g as kt,h as At,i as _t,j as Ct,k as Pt,l as St}from"./c-JOPGDP6N.min.js";import{e as Mt}from"./c-NATWERHZ.min.js";import{b as Rt}from"./c-BYJJ7EMG.min.js";import{a as Yt}from"./c-QXLDCATV.min.js";import{a as Tt,b as Lt,d as Dt}from"./c-U5XVLSHN.min.js";import{A as Et,D as Ot,E as Bt,F as It,W as Nt,a as zt,b as Ft,c as $t,d as Wt,e as Xt,f as jt,g as Vt,h as Ht,i as Gt,j as Ut,k as qt,l as Kt,m as Jt,o as Zt,p as Qt,q as ei,r as ti,s as ii,t as ri,u as si,v as ai,x as ni,y as oi,z as li}from"./c-SAP5KY6R.min.js";import{c as ci}from"./c-CLLCX3PT.min.js";import{Ca as hi,D as ui,Fa as di,Ga as pi,H as gi,Ha as yi,Ia as fi,J as mi,Ja as xi,Ka as vi,L as bi,La as wi,M as ki,Ma as Ai,Na as _i,R as Ci,S as Pi,T as Si,U as Mi,W as Ri,Wa as Yi,X as Ti,Y as Li,Z as Di,aa as Ei,b as Oi,ba as Bi,c as Ii,ca as Ni,d as zi,da as Fi,e as $i,ea as Wi,f as Xi,ga as ji,ha as Vi,ia as Hi,ib as Gi,ja as Ui,ka as qi,o as Ki,oa as Ji,ob as Zi,p as Qi,q as er,qa as tr,ra as ir,s as rr,t as sr,ta as ar,u as nr,va as or,wa as lr,x as cr,xa as hr,y as ur,ya as dr}from"./c-UMGHCBH5.min.js";import{o as pr,p as gr,s as yr}from"./c-Y342FJ6K.min.js";import{b as fr,i as mr,k as xr,o as vr,r as br,t as wr,w as kr}from"./c-3BYZXCX3.min.js";import{e as Ar,h as _r}from"./c-5NYONM6V.min.js";import{e as Cr}from"./c-U6NLVFN4.min.js";import*as Pr from"react";import{forwardRef as Sr,memo as Mr,useCallback as Rr,useEffect as Yr,useId as Tr,useMemo as Lr,useRef as Dr,useState as Er}from"react";import*as Or from"react";import{jsx as Br}from"react/jsx-runtime";var Ir=null,Nr=null,zr=/* @__PURE__ */new Set;import{scaleLinear as Fr,scaleLog as $r,scaleSymlog as Wr,scaleTime as Xr}from"d3-scale";var jr=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Vr=["scene-style","data-paint","accessibility","evidence"],Hr=(e,t)=>({retainedData:e,invalidations:t}),Gr=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ur=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],qr=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Kr=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Jr=["scene-geometry","data-paint","accessibility","evidence"],Zr=["scene-style","data-paint","accessibility","evidence"],Qr=[],es={chartType:Hr("rebuild",Gr),runtimeMode:Hr("rebuild",Gr),xAccessor:Hr("rebuild",Gr),yAccessor:Hr("rebuild",Gr),timeAccessor:Hr("rebuild",Gr),valueAccessor:Hr("rebuild",Gr),y0Accessor:Hr("rebuild",Gr),boundsAccessor:Hr("rebuild",Gr),band:Hr("rebuild",Gr),openAccessor:Hr("rebuild",Gr),highAccessor:Hr("rebuild",Gr),lowAccessor:Hr("rebuild",Gr),closeAccessor:Hr("rebuild",Gr),candlestickRangeMode:Hr("rebuild",Gr),accessorRevision:Hr("rebuild",Gr),groupAccessor:Hr("rebuild",Ur),categoryAccessor:Hr("rebuild",Ur),lineDataAccessor:Hr("rebuild",Ur),colorAccessor:Hr("rebuild",Zr),sizeAccessor:Hr("rebuild",Jr),symbolAccessor:Hr("rebuild",Jr),pointIdAccessor:Hr("rebuild",Jr),xScaleType:Hr("preserve",qr),yScaleType:Hr("preserve",qr),xExtent:Hr("preserve",qr),invertY:Hr("preserve",qr),yExtent:Hr("preserve",qr),extentPadding:Hr("preserve",qr),scalePadding:Hr("preserve",qr),axisExtent:Hr("preserve",qr),yAxisExtent:Hr("preserve",qr),binSize:Hr("preserve",qr),normalize:Hr("preserve",qr),heatmapAggregation:Hr("preserve",qr),heatmapXBins:Hr("preserve",qr),heatmapYBins:Hr("preserve",qr),arrowOfTime:Hr("preserve",Kr),baseline:Hr("preserve",Kr),stackOrder:Hr("preserve",Kr),sizeRange:Hr("preserve",Kr),curve:Hr("preserve",Kr),areaGroups:Hr("preserve",Kr),customLayout:Hr("preserve",Kr),layoutConfig:Hr("preserve",Kr),layoutMargin:Hr("preserve",Kr),symbolMap:Hr("preserve",Jr),showValues:Hr("preserve",Jr),heatmapValueFormat:Hr("preserve",Jr),trackHoverRows:Hr("preserve",Jr),lineStyle:Hr("preserve",Zr),pointStyle:Hr("preserve",Zr),areaStyle:Hr("preserve",Zr),barStyle:Hr("preserve",Zr),swarmStyle:Hr("preserve",Zr),waterfallStyle:Hr("preserve",Zr),candlestickStyle:Hr("preserve",Zr),boundsStyle:Hr("preserve",Zr),gradientFill:Hr("preserve",Zr),lineGradient:Hr("preserve",Zr),semanticLineStops:Hr("preserve",Zr),colorScheme:Hr("preserve",Zr),themeCategorical:Hr("preserve",Zr),themeSemantic:Hr("preserve",Zr),themeSequential:Hr("preserve",Zr),themeDiverging:Hr("preserve",Zr),barColors:Hr("preserve",Zr),decay:Hr("preserve",Zr),pulse:Hr("preserve",Zr),staleness:Hr("preserve",Zr),layoutSelection:Hr("preserve",Zr),annotations:Hr("preserve",["overlay","accessibility","evidence"]),windowSize:Hr("preserve",Qr),windowMode:Hr("preserve",Qr),maxCapacity:Hr("preserve",Qr),clock:Hr("preserve",Qr),transition:Hr("preserve",Qr),introAnimation:Hr("preserve",Qr),onLayoutError:Hr("preserve",Qr)},ts=Hr("preserve",Kr),is=class{constructor(){this.tracker=new Qi}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}},jr)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Vr):this.recordNoop("restyle")}recordConfig(e,t=!1){let i=z(e);return this.tracker.record({kind:"config",keys:e},t?/* @__PURE__ */new Set([...i.invalidations,...Jr]):i.invalidations)}};import{quadtree as rs}from"d3-quadtree";var ss=class{constructor(){this.maxRadius=0,this.tree=null}get quadtree(){return this.tree}get maxPointRadius(){return this.maxRadius}clear(){this.tree=null,this.maxRadius=0}rebuild(e,t){if("scatter"!==e&&"bubble"!==e&&"custom"!==e)return void this.clear();let i=0,r=0;for(let e of t)"point"===e.type&&!1!==e.interactive&&(i++,e.r>r&&(r=e.r));if(this.maxRadius=r,500>=i)return void(this.tree=null);let s=Array(i),a=0;for(let e of t)"point"===e.type&&!1!==e.interactive&&(s[a++]=e);this.tree=rs().x(e=>e.x).y(e=>e.y).addAll(s)}},as=class e{constructor(e){if(this.xExtent=new ot,this.yExtent=new ot,this.growingCapacityWarned=!1,this.windowSizeWarned=!1,this.resolvedRibbons=[],this.timestampBuffer=null,this.activeTransition=null,this._hasRenderedOnce=!1,this.prevPositionMap=/* @__PURE__ */new Map,this.prevPathMap=/* @__PURE__ */new Map,this.exitNodes=[],this.lastIngestTime=0,this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=/* @__PURE__ */new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this._ingestVersion=0,this._datumIndexCache=null,this._bufferArrayCache=null,this._bufferDirty=!0,this.needsFullRebuild=!0,this.lastLayout=null,this.updateResults=new is,this.scales=null,this.scene=[],this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=/* @__PURE__ */new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this.xIsDate=!1,this.spatialIndex=new ss,this._lastBoundedInsertsRef=null,this.applyPulse=(e,t,i)=>!(!this.config.pulse||!this.timestampBuffer)&&vt(this.config.pulse,e,t,this.timestampBuffer,this.getDatumIndexMap(t),i),this.config=e,this.buffer=new xt(e.windowSize),this.growingCap=e.windowSize,["bar","swarm","waterfall"].includes(e.chartType)||"streaming"===e.runtimeMode?(this.getX=Lt(e.timeAccessor||e.xAccessor,"time"),this.getY=Lt(e.valueAccessor||e.yAccessor,"value")):(this.getX=Lt(e.xAccessor,"x"),this.getY=Lt(e.yAccessor,"y")),this.getGroup=Dt(e.groupAccessor),this.getCategory=Dt(e.categoryAccessor),this.getSize=e.sizeAccessor?Lt(e.sizeAccessor,"size"):void 0,this.getColor=Dt(e.colorAccessor),this.getSymbol=Dt(e.symbolAccessor),this.getY0=e.y0Accessor?Lt(e.y0Accessor,"y0"):void 0,this.resolvedRibbons=v(e),this.getPointId=Dt(e.pointIdAccessor),"candlestick"===e.chartType){let t=null!=e.openAccessor,i=null!=e.closeAccessor;this.getOpen=t?Lt(e.openAccessor,"open"):void 0,this.getHigh=Lt(e.highAccessor,"high"),this.getLow=Lt(e.lowAccessor,"low"),this.getClose=i?Lt(e.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!t&&!i}e.pulse&&(this.timestampBuffer=new xt(e.windowSize))}currentTime(){return this.config.clock?.()??Xi()}syncPulseTimestampBuffer(){this.config.pulse?null!=this.timestampBuffer&&this.timestampBuffer.capacity===this.buffer.capacity&&this.timestampBuffer.size===this.buffer.size||(this.timestampBuffer=kt(this.buffer,this.currentTime())):this.timestampBuffer=null}pushDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.push(this.getHigh(e)),void this.yExtent.push(this.getLow(e));this.yExtent.push(this.getY(e)),this.getY0&&this.yExtent.push(this.getY0(e));for(let t of this.resolvedRibbons){let i=t.getTop(e),r=t.getBottom(e);Number.isFinite(i)&&this.yExtent.push(i),Number.isFinite(r)&&this.yExtent.push(r)}}evictDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.evict(this.getHigh(e)),void this.yExtent.evict(this.getLow(e));this.yExtent.evict(this.getY(e)),this.getY0&&this.yExtent.evict(this.getY0(e));for(let t of this.resolvedRibbons){let i=t.getTop(e),r=t.getBottom(e);Number.isFinite(i)&&this.yExtent.evict(i),Number.isFinite(r)&&this.yExtent.evict(r)}}rebuildYExtent(){this.yExtent.clear();for(let e of this.buffer)this.pushDatumYExtent(e)}rebuildExtents(){this.xExtent.clear(),this.yExtent.clear();for(let e of this.buffer)this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e)}ingest(e){if(e.bounded&&this._lastBoundedInsertsRef===e.inserts)return this.updateResults.recordNoop("replace"),!1;let t=this.currentTime();if(this.lastIngestTime=t,this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,e.bounded){this._lastBoundedInsertsRef=e.inserts,this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this.timestampBuffer&&this.timestampBuffer.clear();let i=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode;if(this.getX=i?Lt(this.config.timeAccessor||this.config.xAccessor,"time"):Lt(this.config.xAccessor,"x"),this.xIsDate=!1,e.inserts.length>0){let t=e.inserts[0],i=this.config.xAccessor,r="function"==typeof i?i(t):t[i||"x"],s=r instanceof Date,a="string"==typeof r&&Number.isFinite(He(r));if(this.xIsDate=s||a,a){let e="string"==typeof i?i:void 0;this.getX=e?t=>Ge(t[e]):e=>Ge(i(e))}}wt(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(let i of e.inserts)At(this.buffer,i,this.timestampBuffer,t),this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i)}else for(let i of e.inserts){if("growing"===this.config.windowMode&&this.buffer.full){let e=this.config.maxCapacity??1e5;e>this.growingCap&&(this.growingCap=Math.min(2*this.growingCap,e),this.buffer.resize(this.growingCap),this.timestampBuffer&&this.timestampBuffer.resize(this.growingCap),"production"!==process.env.NODE_ENV&&!this.growingCapacityWarned&&this.growingCap>=5e4&&(this.growingCapacityWarned=!0,console.warn(`[Semiotic] Growing window buffer reached ${this.growingCap} points (cap ${e}). Large canvas scenes are expensive — prefer a sliding window, aggregation, or an explicit maxCapacity if this is intentional.`)))}let e=At(this.buffer,i,this.timestampBuffer,t);this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i),null!=e&&(this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e))}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}computeScene(e){let{config:t,buffer:i}=this,r=this.scales,s=this.lastLayout;if(!this.needsFullRebuild&&!t.customLayout&&this.lastLayout&&this.scene.length>0&&this.scales&&0>=(this.config.scalePadding??0)&&(this.lastLayout.width!==e.width||this.lastLayout.height!==e.height))return void this.remapScene(e);this.xExtent.dirty&&this.xExtent.recalculate(i,this.getX),this.yExtent.dirty&&this.rebuildYExtent();let a=this.getBufferArray(),n=this.xExtent.extent,o=this.yExtent.extent,l="waterfall"===t.chartType&&i.size>0?C(a,this.getX,n,t.xExtent,t.xScaleType):w(n,t.xExtent),c=w(o,t.yExtent),h=!(!(d=t.yExtent)||null==d[0]||null==d[1]),u="exact"===(t.yAxisExtent??t.axisExtent);var d;if("stackedarea"===t.chartType&&!h&&i.size>0){let e=k({config:t,groups:this.groupData(a),getX:this.getX,getY:this.getY,bufferSize:i.size,ingestVersion:this._ingestVersion,stackExtentCache:this._stackExtentCache});c=e.yDomain,this._stackExtentCache=e.stackExtentCache}else"bar"===t.chartType&&t.binSize&&!h&&i.size>0?c=A(i,this.getX,this.getY,t.binSize,this.getCategory,t.extentPadding,u):"waterfall"===t.chartType&&!h&&i.size>0?c=_(i,this.getY,t.extentPadding,u):!h&&c[0]!==1/0&&(c=P(c,a,this.resolvedRibbons),c=S(c,{exactMode:u,extentPadding:t.extentPadding,userMin:t.yExtent?.[0],userMax:t.yExtent?.[1],yScaleType:t.yScaleType,dataYDomain:o}));c=M(c,t.yExtent,!!h),({xDomain:l,yDomain:c}=R(l,c,t.xScaleType)),this.scales=T({config:t,layout:e,xDomain:l,yDomain:c}),this._customLayoutFailedThisBuild=!1;let p=this.buildSceneNodes(e,a);if(this._customLayoutFailedThisBuild)return!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=r,this.lastLayout=s):(this.scene=[],this.spatialIndex.rebuild(this.config.chartType,this.scene)),void(this.needsFullRebuild=!0);this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=p,this.config.decay&&this.applyDecay(this.scene,a),this.config.pulse&&this.applyPulse(this.scene,a,this.currentTime()),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&(this.prevPositionMap.size>0||this.prevPathMap.size>0)&&this.startTransition(),this.spatialIndex.rebuild(this.config.chartType,this.scene),this.needsFullRebuild=!1,this.lastLayout={width:e.width,height:e.height},this.version++}get quadtree(){return this.spatialIndex.quadtree}get maxPointRadius(){return this.spatialIndex.maxPointRadius}remapScene(e){let t=e.width/this.lastLayout.width,i=e.height/this.lastLayout.height;for(let e of this.scene)switch(e.type){case"line":for(let r of e.path)r[0]*=t,r[1]*=i;break;case"area":for(let r of e.topPath)r[0]*=t,r[1]*=i;for(let r of e.bottomPath)r[0]*=t,r[1]*=i;e.clipRect&&(e.clipRect={x:e.clipRect.x*t,y:e.clipRect.y*i,width:e.clipRect.width*t,height:e.clipRect.height*i}),e.strokeColorBands&&(e.strokeColorBands=e.strokeColorBands.map(e=>({...e,y:e.y*i,height:e.height*i})));break;case"point":case"glyph":e.x*=t,e.y*=i;break;case"rect":case"heatcell":e.x*=t,e.y*=i,e.w*=t,e.h*=i;break;case"candlestick":e.x*=t,e.openY*=i,e.closeY*=i,e.highY*=i,e.lowY*=i}let r=this.scales.x.domain(),s=this.scales.y.domain(),a=this.scales.x.range(),n=this.scales.y.range(),o=Y,l=Math.max(0,Math.min(this.config.scalePadding||0,Math.min(e.width,e.height)/2-1)),c=n[1]>n[0];this.scales={x:o(this.config.xScaleType,r,a[0]>a[1]?[e.width-l,l]:[l,e.width-l]),y:o(this.config.yScaleType,s,c?[l,e.height-l]:[e.height-l,l])},this.lastLayout={width:e.width,height:e.height},this.spatialIndex.rebuild(this.config.chartType,this.scene),this.version++}buildSceneNodes(e,t){let{config:i,scales:r}=this;if(!r)return[];if(i.customLayout){let s={data:t,scales:r,dimensions:{width:e.width,height:e.height,margin:i.layoutMargin??{top:0,right:0,bottom:0,left:0},plot:{x:0,y:0,width:e.width,height:e.height}},theme:{semantic:i.themeSemantic??{},categorical:i.themeCategorical??gr},resolveColor:(e,t)=>{let r=this.resolveGroupColor(e);if(r)return r;let s=this.resolveLineStyle(e,t);return s.stroke?s.stroke:"string"==typeof s.fill?s.fill:i.themeSemantic?.primary??"#4e79a7"},config:i.layoutConfig??{},selection:i.layoutSelection??null},a=Xt({family:"xy",logLabel:"customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:i.onLayoutError,run:()=>i.customLayout(s)});if("failure"===a.kind)return this.lastCustomLayoutFailure=a.diagnostic,this._customLayoutFailedThisBuild=!0,a.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,[]);let n=a.result;this.customLayoutOverlays=n.overlays??null,this.lastCustomLayoutResult=n,this.lastCustomLayoutFailure=null;let o=n.nodes??[];if(this._customRestyle=n.restyle,this.hasCustomRestyle=!!n.restyle,this.hasCustomRestyle){this._baseStyles=/* @__PURE__ */new WeakMap;for(let e of o)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(o,i.layoutSelection??null)}return Wt({label:"customLayout",nodes:o,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),o}if(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,0===t.length)return[];let s={scales:r,config:i,getX:this.getX,getY:this.getY,getY0:this.getY0,getSize:this.getSize,getColor:this.getColor,getSymbol:this.getSymbol,getGroup:this.getGroup,getCategory:this.getCategory,getPointId:this.getPointId,ribbons:this.resolvedRibbons,getOpen:this.getOpen,getHigh:this.getHigh,getLow:this.getLow,getClose:this.getClose,resolveLineStyle:(e,t)=>this.resolveLineStyle(e,t),resolveAreaStyle:(e,t)=>this.resolveAreaStyle(e,t),resolveBoundsStyle:(e,t)=>this.resolveBoundsStyle(e,t),resolveColorMap:e=>this.resolveColorMap(e),resolveGroupColor:e=>this.resolveGroupColor(e),groupData:e=>this.groupData(e),barCategoryCache:this._barCategoryCache},a=Ke(i.chartType);if(!a)return qe(n=i.chartType)||Ki&&(zr.has(n)||(zr.add(n),console.warn(`[semiotic] StreamXYFrame: no XY plugin registered for "${n}" during SSR. Import a chart HOC, or call registerBuiltInXYPlugins() from "semiotic/xy" or "semiotic/realtime/core" before render.`))),[];var n;let o=Ze(a(s,t,e));return"bar"===i.chartType&&(this._barCategoryCache=s.barCategoryCache??null,this._binBoundaries=o.binBoundaries),o.nodes}resolveBoundsStyle(e,t){return N(this.config,e,t,(e,t)=>this.resolveLineStyle(e,t))}computeDecayOpacity(e,t){let i=this.config.decay;return i&&t>1?zt(i,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._ingestVersion)return this._datumIndexCache.map;let t=Ft(e);return this._datumIndexCache={version:this._ingestVersion,map:t},t}applyDecay(e,t){this.config.decay&&$t(this.config.decay,e,t,this.getDatumIndexMap(t))}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&bt(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}get transitionContext(){return{runtimeMode:this.config.runtimeMode,getX:this.getX,getY:this.getY,getCategory:this.getCategory,getPointId:this.getPointId}}snapshotPositions(){y(this.transitionContext,this.scene,this.prevPositionMap,this.prevPathMap)}synthesizeIntroPositions(){this.prevPositionMap.clear(),this.prevPathMap.clear();let e=this.scales?.y(0)??0;for(let t=0;this.scene.length>t;t++){let i=this.scene[t],r=p(this.transitionContext,i,t);r&&("point"===i.type?this.prevPositionMap.set(r,{x:i.x,y:i.y,r:0,opacity:0}):"rect"===i.type?this.prevPositionMap.set(r,{x:i.x,y:e,w:i.w,h:0,opacity:i.style.opacity??1}):"heatcell"===i.type?this.prevPositionMap.set(r,{x:i.x,y:i.y,w:i.w,h:i.h,opacity:0}):"line"===i.type?(i._introClipFraction=0,this.prevPathMap.set(r,{path:i.path.map(e=>[e[0],e[1]]),pathIds:i.pathIds?.slice(),opacity:i.style.opacity})):"area"===i.type&&(i._introClipFraction=0,this.prevPathMap.set(r,{topPath:i.topPath.map(e=>[e[0],e[1]]),bottomPath:i.bottomPath.map(e=>[e[0],e[1]]),pathIds:i.pathIds?.slice(),opacity:i.style.opacity})))}}startTransition(){if(!this.config.transition)return;let e=f(this.transitionContext,this.config.transition,{scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},this.prevPositionMap,this.prevPathMap,this.currentTime());this.scene=e.scene,this.exitNodes=e.exitNodes,this.activeTransition=e.activeTransition}advanceTransition(e){if(!this.activeTransition||!this.config.transition)return!1;let t={scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},i=m(e,this.config.transition,t,this.prevPositionMap);return this.scene=t.scene,this.exitNodes=t.exitNodes,this.activeTransition=t.activeTransition,i}cancelIntroAnimation(){this.prevPositionMap.clear(),this.prevPathMap.clear(),this.activeTransition=null,ct(this.scene),this.exitNodes=[]}groupData(e){let{result:t,cache:i}=D(e,this.getGroup,this._ingestVersion,this._groupDataCache);return this._groupDataCache=i,t}resolveColorMap(e){let{map:t,cache:i}=E(e,this.getColor,this.config,this._ingestVersion,this._colorMapCache);return this._colorMapCache=i,t}resolveLineStyle(e,t){return B(this.config,e,t,e=>this.resolveGroupColor(e))}resolveAreaStyle(e,t){return I(this.config,e,t,e=>this.resolveGroupColor(e))}resolveGroupColor(t){let{color:i,groupColorCounter:r}=O({group:t,colorMapCache:this._colorMapCache,groupColorMap:this._groupColorMap,groupColorCounter:this._groupColorCounter,groupColorMapCap:e.GROUP_COLOR_MAP_CAP,config:this.config});return this._groupColorCounter=r,i}getBufferArray(){return(this._bufferDirty||!this._bufferArrayCache)&&(this._bufferArrayCache=this.buffer.toArray(),this._bufferDirty=!1),this._bufferArrayCache}getData(){return this.getBufferArray()}remove(e){if(!this.getPointId)throw Error("remove() requires pointIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();let t=lt(e),i=this.getPointId,r=e=>t.has(i(e));_t(this.buffer,this.timestampBuffer,r);let s=this.buffer.remove(r);if(0===s.length)return this.updateResults.recordNoop("remove"),s;for(let e of s)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",s.length),s}update(e,t){if(!this.getPointId)throw Error("update() requires pointIdAccessor to be configured");let i=lt(e),r=this.getPointId,s=/* @__PURE__ */new Set;this.buffer.forEach((e,t)=>{i.has(r(e))&&s.add(t)});let a=this.buffer.update(e=>i.has(r(e)),t);if(0===a.length)return this.updateResults.recordNoop("update"),a;for(let e of a)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.buffer.forEach((e,t)=>{s.has(t)&&(this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e))}),this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",a.length),a}getBinBoundaries(){return this._binBoundaries}getExtents(){return this.xExtent.min===1/0?null:{x:this.xExtent.extent,y:this.yExtent.extent}}clear(){this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.prevPathMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this._lastBoundedInsertsRef=null,this.needsFullRebuild=!0,this._bufferDirty=!0,this._bufferArrayCache=null,this._datumIndexCache=null,this.lastLayout=null,this.scales=null,this.scene=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this.spatialIndex.clear(),this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=/* @__PURE__ */new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getBuffer(){return this.buffer}getXAccessor(){return this.getX}getYAccessor(){return this.getY}getCategoryAccessor(){return this.getCategory}applyCustomRestyle(e,t){let i=this._customRestyle;if(i)for(let r of e){let e=this._baseStyles.get(r)??r.style??{},s=i(r,t);r.style=s?{...e,...s}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}updateConfig(e){let t={...this.config},i=Object.keys(e).filter(i=>e[i]!==t[i]);"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||"themeCategorical"in e||"colorAccessor"in e)&&(this._colorMapCache=null,this._groupColorMap=/* @__PURE__ */new Map,this._groupColorCounter=0),("barColors"in e||"colorScheme"in e)&&(this._barCategoryCache=null),("normalize"in e||"extentPadding"in e||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e||"boundsAccessor"in e||"band"in e||"y0Accessor"in e||"openAccessor"in e||"highAccessor"in e||"lowAccessor"in e||"closeAccessor"in e||"groupAccessor"in e||"categoryAccessor"in e||"chartType"in e||"runtimeMode"in e)&&(this._stackExtentCache=null);let r=!1,s=!1;Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let a="chartType"in e&&e.chartType!==t.chartType||"runtimeMode"in e&&e.runtimeMode!==t.runtimeMode;if(a||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e){let e=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode,i=e&&this.config.valueAccessor||this.config.yAccessor,n=e&&t.valueAccessor||t.yAccessor,o=a||!Tt(e&&this.config.timeAccessor||this.config.xAccessor,e&&t.timeAccessor||t.xAccessor),l=a||!Tt(i,n);(o||l)&&(e?(this.getX=Lt(this.config.timeAccessor||this.config.xAccessor,"time"),this.getY=Lt(this.config.valueAccessor||this.config.yAccessor,"value")):(this.getX=Lt(this.config.xAccessor,"x"),this.getY=Lt(this.config.yAccessor,"y")),l&&this.resolvedRibbons.some(e=>"bounds"===e.kind)&&(this.resolvedRibbons=v(this.config)),r=!0,s=!0)}if("groupAccessor"in e&&!Tt(e.groupAccessor,t.groupAccessor)&&(this.getGroup=null!=this.config.groupAccessor?Dt(this.config.groupAccessor):void 0,r=!0),"categoryAccessor"in e&&!Tt(e.categoryAccessor,t.categoryAccessor)&&(this.getCategory=null!=this.config.categoryAccessor?Dt(this.config.categoryAccessor):void 0,r=!0),"sizeAccessor"in e&&!Tt(e.sizeAccessor,t.sizeAccessor)&&(this.getSize=this.config.sizeAccessor?Lt(this.config.sizeAccessor,"size"):void 0,r=!0),"symbolAccessor"in e&&!Tt(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?Dt(this.config.symbolAccessor):void 0,r=!0),"colorAccessor"in e&&!Tt(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?Dt(this.config.colorAccessor):void 0,r=!0),"y0Accessor"in e&&!Tt(e.y0Accessor,t.y0Accessor)&&(this.getY0=this.config.y0Accessor?Lt(this.config.y0Accessor,"y0"):void 0,r=!0,s=!0),("boundsAccessor"in e&&!Tt(e.boundsAccessor,t.boundsAccessor)||"band"in e&&e.band!==t.band||"boundsStyle"in e&&e.boundsStyle!==t.boundsStyle)&&(this.resolvedRibbons=v(this.config),r=!0,s=!0),"pointIdAccessor"in e&&!Tt(e.pointIdAccessor,t.pointIdAccessor)&&(this.getPointId=null!=this.config.pointIdAccessor?Dt(this.config.pointIdAccessor):void 0,r=!0),"candlestick"===this.config.chartType&&(a||"openAccessor"in e&&!Tt(e.openAccessor,t.openAccessor)||"closeAccessor"in e&&!Tt(e.closeAccessor,t.closeAccessor)||"highAccessor"in e&&!Tt(e.highAccessor,t.highAccessor)||"lowAccessor"in e&&!Tt(e.lowAccessor,t.lowAccessor))){let e=null!=this.config.openAccessor,t=null!=this.config.closeAccessor;this.getOpen=e?Lt(this.config.openAccessor,"open"):void 0,this.getHigh=Lt(this.config.highAccessor,"high"),this.getLow=Lt(this.config.lowAccessor,"low"),this.getClose=t?Lt(this.config.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!e&&!t,r=!0,s=!0}if("accessorRevision"in e&&e.accessorRevision!==t.accessorRevision&&(r=!0,s=!0),!r){let i=Object.keys(e).filter(e=>!e.endsWith("Accessor")&&"timeAccessor"!==e&&"valueAccessor"!==e);for(let s of i)if(e[s]!==t[s]){r=!0;break}}r&&(s&&this.rebuildExtents(),this.needsFullRebuild=!0),this.updateResults.recordConfig(i,("bar"===this.config.chartType||"heatmap"===this.config.chartType)&&!this.config.trackHoverRows&&Cr(t.areaStyle)!==Cr(this.config.areaStyle))}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};as.GROUP_COLOR_MAP_CAP=1e3;var ns=as;jt(ns);import{useCallback as os,useImperativeHandle as ls}from"react";import{line as cs}from"d3-shape";var hs=/* @__PURE__ */new WeakMap;import*as us from"react";import{jsx as ds,jsxs as ps}from"react/jsx-runtime";import{useEffect as gs,useRef as ys,useState as fs}from"react";import{useEffect as ms,useState as xs}from"react";import{jsx as vs}from"react/jsx-runtime";import{useMemo as bs,useRef as ws,useEffect as ks,useId as As}from"react";import*as _s from"react";import{jsx as Cs}from"react/jsx-runtime";var Ps=null,Ss=null,Ms=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];import{useMemo as Rs}from"react";import{jsx as Ys,jsxs as Ts}from"react/jsx-runtime";import{Fragment as Ls,jsx as Ds,jsxs as Es}from"react/jsx-runtime";import{useCallback as Os,useEffect as Bs,useState as Is}from"react";import*as Ns from"react";import{area as zs,line as Fs}from"d3-shape";import{jsx as $s,jsxs as Ws}from"react/jsx-runtime";var Xs={axisStroke:"#ccc",tickText:"#666",crosshair:"rgba(0, 0, 0, 0.25)",hoverFill:"rgba(255, 255, 255, 0.3)",hoverStroke:"rgba(0, 0, 0, 0.4)",pointRing:"white",primary:"#007bff",background:""};import{useEffect as js}from"react";import{jsx as Vs,jsxs as Hs}from"react/jsx-runtime";$e.ownsChrome=!0;import{jsx as Gs,jsxs as Us}from"react/jsx-runtime";var qs=Yt,Ks=Xs,Js=Mr(Sr(function(t,i){let{chartType:r,runtimeMode:s,data:a,chunkThreshold:n,chunkSize:o,xAccessor:l,yAccessor:c,accessorRevision:h,colorAccessor:u,sizeAccessor:d,symbolAccessor:p,symbolMap:g,groupAccessor:y,lineDataAccessor:f,curve:m,normalize:x,baseline:v,stackOrder:b,binSize:w,valueAccessor:k,arrowOfTime:A="right",windowMode:_,capacityMode:C,windowSize:P,capacity:S,timeAccessor:M,xExtent:R,yExtent:Y,invertY:T,extentPadding:L=.1,scalePadding:D,sizeRange:E,size:O=[500,300],responsiveWidth:B,responsiveHeight:I,margin:N,className:z,background:$,maxDevicePixelRatio:W,renderMode:j,lineStyle:H,pointStyle:G,areaStyle:U,barStyle:q,waterfallStyle:K,swarmStyle:J,barColors:Z,colorScheme:Q,boundsAccessor:ee,boundsStyle:te,y0Accessor:ie,band:re,gradientFill:se,lineGradient:ae,semanticLineStops:ne,areaGroups:oe,openAccessor:le,highAccessor:ce,lowAccessor:he,closeAccessor:ue,candlestickStyle:de,showAxes:pe=!0,axes:ge,xLabel:fe,yLabel:me,yLabelRight:xe,xFormat:ve,yFormat:be,axisExtent:ke,tickFormatTime:Ae,tickFormatValue:_e,hoverAnnotation:Me,tooltipContent:Re,customHoverBehavior:Ye,customClickBehavior:Le,onObservation:De,annotationObservationCallback:Ee,chartId:Fe,enableHover:Ve,hoverRadius:He=30,tooltipMode:Ge,annotations:Ue,onAnnotationActivate:qe,autoPlaceAnnotations:Ke,svgAnnotationRules:Ze,showGrid:Qe,legend:et,legendHoverBehavior:tt,legendClickBehavior:it,legendHighlightedCategory:rt,legendIsolatedCategories:st,legendPosition:at,legendLayout:ot,legendCategoryAccessor:lt,onCategoriesChange:ct,backgroundGraphics:ht,foregroundGraphics:gt,canvasPreRenderers:yt,svgPreRenderers:xt,title:vt,categoryAccessor:bt,brush:wt,onBrush:kt,decay:At,pulse:_t,transition:Yt,animate:Tt,staleness:Lt,frameScheduler:Dt,clock:zt,random:Ft,seed:$t,paused:Wt=!1,suspendWhenHidden:Xt=!0,heatmapAggregation:jt,heatmapXBins:Ut,heatmapYBins:qt,showValues:Kt,heatmapValueFormat:Jt,heatmapColorScale:Zt,onColorDomainChange:ii,marginalGraphics:ri,pointIdAccessor:si,xScaleType:ai,yScaleType:ui,accessibleTable:gi=!0,description:bi,summary:ki,linkedCrosshairName:_i,linkedCrosshairSourceId:Ci,customLayout:Pi,onLayoutError:Si,layoutConfig:Mi,layoutSelection:Ri}=t,Ti=_??C??"sliding",Li=P??S??200,{customHoverBehavior:Di,customClickBehavior:Ei,hasClickBehavior:Bi}=Pt({customHoverBehavior:Ye,customClickBehavior:Le,onObservation:De,chartId:Fe,chartType:"StreamXYFrame"}),Ii=Tr().replace(/:/g,""),zi=Dr(!1),$i=Dr({w:-1,h:-1}),Xi=Dr(!1),ji=di({sizeProp:O,responsiveWidth:B,responsiveHeight:I,userMargin:N,marginDefault:qs,title:vt,legend:et,legendPosition:at,...pt(t,et),animate:Tt,transitionProp:Yt,frameScheduler:Dt,clock:zt,random:Ft,seed:$t,paused:Wt,suspendWhenHidden:Xt,themeDirtyRef:zi}),Hi=Ui(),Gi=qi(),{reducedMotionRef:Zi,responsiveRef:Qi,size:sr,currentTheme:nr,transition:cr,introEnabled:ur,tableId:dr,rafRef:pr,renderFnRef:gr,scheduleRender:yr,frameRuntime:fr}=ji;Yr(()=>xr(()=>{zi.current=!0,yr()}),[yr]);let mr=ji.margin;if(ri){let e={...ji.margin};ri.top&&60>e.top&&(e.top=60),ri.bottom&&60>e.bottom&&(e.bottom=60),ri.left&&60>e.left&&(e.left=60),ri.right&&60>e.right&&(e.right=60),mr=e}let vr=sr[0]-mr.left-mr.right,br=sr[1]-mr.top-mr.bottom,wr=(ge?.find(e=>"left"===e.orient)??ge?.find(e=>"right"===e.orient))?.extent??ke,kr=Lr(()=>Oi(a),[a]),_r=Me??Ve,[Cr,Sr]=Er(0),Mr=Dr(0),[Or,Br]=Er(null),Ir=Et(gt,sr,mr,Or),Nr=Et(ht,sr,mr,Or),zr=Dr(null),Fr=Dr(!1),$r=Dr(null),Wr=Dr(void 0),[Xr,jr]=Er(null),Vr=Dr(Ks.primary),Hr=Dr(Oe()),Gr=Dr(!1),Ur=er("StreamXYFrame"),[qr,Kr]=Er(!1),Jr="streaming"===s||["bar","swarm","waterfall"].includes(r),Zr=!!Di,Qr=Lr(()=>({chartType:r,runtimeMode:Jr?"streaming":"bounded",windowSize:Li,windowMode:Ti,arrowOfTime:Jr?A:"right",extentPadding:L,scalePadding:D,axisExtent:ke,yAxisExtent:wr,xAccessor:l,yAccessor:c,accessorRevision:h,timeAccessor:Jr?M:void 0,valueAccessor:k,colorAccessor:u,sizeAccessor:d,symbolAccessor:p,symbolMap:g,groupAccessor:y||(f?"_lineGroup":void 0),categoryAccessor:bt,lineDataAccessor:f,xScaleType:ai,yScaleType:ui,xExtent:R,yExtent:Y,invertY:T,sizeRange:E,binSize:w,normalize:x,baseline:v,stackOrder:b,boundsAccessor:ee,boundsStyle:te,y0Accessor:ie,band:re,gradientFill:ft(se),areaGroups:oe?new Set(oe):void 0,lineGradient:mt(ae),semanticLineStops:ne,openAccessor:le,highAccessor:ce,lowAccessor:he,closeAccessor:ue,candlestickStyle:de,lineStyle:H,trackHoverRows:Zr,pointStyle:G,areaStyle:U,swarmStyle:J,waterfallStyle:K,colorScheme:Q,barColors:Z,barStyle:q,annotations:Ue,decay:At,pulse:_t,transition:cr,introAnimation:ur,staleness:Lt,clock:fr.now,heatmapAggregation:jt,heatmapXBins:Ut,heatmapYBins:qt,showValues:Kt,heatmapValueFormat:Jt,heatmapColorScale:Zt,pointIdAccessor:si,curve:m,themeCategorical:nr?.colors?.categorical,themeSemantic:Ar(nr),themeSequential:nr?.colors?.sequential,themeDiverging:nr?.colors?.diverging,customLayout:Pi,onLayoutError:Si,layoutConfig:Mi,layoutMargin:mr}),[r,Jr,Li,Ti,A,L,D,ke,wr,l,c,h,M,k,u,d,p,g,y,f,bt,ai,ui,R,Y,T,E,w,x,v,b,ee,te,ie,re,se,oe,ae,ne,le,ce,he,ue,de,H,Zr,G,U,J,K,Q,Z,q,Ue,At,_t,cr,ur,Lt,fr.now,jt,Ut,qt,Kt,Jt,Zt,si,m,nr,Pi,Si,Mi,mr]),es=ni(Qr),ts=Dr(null);ts.current||(ts.current=new ns(es));let is=Ot(ts,lt,ct,e=>e.getData()),rs=Dr({onColorDomainChange:ii,chartType:r}),ss=Dr(void 0);rs.current={onColorDomainChange:ii,chartType:r};let as=Rr(()=>{let{onColorDomainChange:e,chartType:t}=rs.current;if(!e||"heatmap"!==t)return;let i=1/0,r=-1/0;for(let e of ts.current?.scene??[]){if("heatcell"!==e.type)continue;let t=Number(e.value??e.datum?.value);Number.isFinite(t)&&(i>t&&(i=t),t>r&&(r=t))}let s=Number.isFinite(i)&&Number.isFinite(r)?[i,r]:null,a=ss.current;null===a&&null===s||a&&s&&a[0]===s[0]&&a[1]===s[1]||(ss.current=s,e(s))},[]);Ie(r,Pi,zi,yr,ts),Ht(ts,es,zi,yr),Gt(ts,Ri,zi,yr);let os=Dr(null);os.current||(os.current=new nt(e=>{let t=ts.current;t&&t.ingest(e)&&(zi.current=!0,yr())},{chunkThreshold:n,chunkSize:o})),Yr(()=>{os.current?.updateChunkOptions({chunkThreshold:n,chunkSize:o})},[n,o]),F(i,{storeRef:ts,adapterRef:os,dirtyRef:zi,scheduleRender:yr,hoverRef:zr,setHoverPoint:jr}),Yr(()=>{a&&os.current?.setBoundedData(We(kr,f))},[a,kr,f]);let{marginalXValues:ls,marginalYValues:cs,refreshMarginalValues:hs}=Se(ts,ri,kr,l,c),{canvasRef:us,interactionCanvasRef:ds,resolutionDirtyRef:ps}=xi(ji,{storeRef:ts,dirtyRef:zi,hydrated:Hi,wasHydratingFromSSR:Gi,cleanup:()=>os.current?.clear(),maxDevicePixelRatio:W,canvasPaintDependencies:[r,vr,br,pe,$,ht,H,j,yt,yr]}),{hoverHandlerRef:gs,hoverLeaveRef:ys,onPointerMove:fs,onPointerLeave:ms,pointerStateRef:xs}=ji;gs.current=e=>{let t=us.current;if(!t)return;let i=t.getBoundingClientRect(),s=e.clientX-i.left-mr.left,a=e.clientY-i.top-mr.top;if(0>s||s>vr||0>a||a>br){if(Wi(t),!_r)return;return void(zr.current&&(zr.current=null,$r.current=null,jr(null),Di?.(null),yr()))}let n=ts.current;if(!n||0===n.scene.length)return void Wi(t);let o=wi(He,e.pointerType),c=X(n.scene,s,a,o,n.quadtree,n.maxPointRadius);if(Wi(t,Ni(c?.node)),!_r)return;let h="multi"===Ge,u=()=>{zr.current&&(zr.current=null,$r.current=null,jr(null),Di&&Di(null),yr())};if(!c&&!h)return void u();let d=h||!c?s:c.x,p=h||!c?a:c.y,g=c?.datum?Mt(c.datum,n.resolvedRibbons):{},y=n.scales?.x?.invert,f="function"==typeof y?y(d):void 0,m=Ai(g,d,p,null!=f?{xValue:f,xPx:d}:void 0);if(h&&n.scene.length>0&&n.scales){let e=V(n.scene,d,Math.max(o,vr));if(e.length>0){let t=n.scales.y.invert,i=Vr.current,s=y?y(d):d;if(c)m.xValue=s,m.xPx=d;else{let e={xValue:s};"string"==typeof l&&(e[l]=s),m=Ai(e,d,p,{xValue:s,xPx:d})}m.allSeries=e.map(e=>{let s=t?t(e.y):e.y,a=null!=e.y0?t?t(e.y0):e.y0:void 0;return{group:e.group||"",value:"stackedarea"===r&&null!=a?s-a:s,valuePx:e.y,color:e.color||i,datum:Mt(e.datum,n.resolvedRibbons)}})}}c||m.allSeries?.length?(zr.current=m,$r.current=c?.node??null,jr(m),Di?.(m),yr()):u()},ys.current=()=>{Wi(us.current),zr.current&&(zr.current=null,$r.current=null,jr(null),Di?.(null),yr())},Vi(us);let vs=Dr(()=>{});vs.current=e=>{if(mi(e.target)||!Ei)return;let t=us.current;if(!t)return;let i=t.getBoundingClientRect(),r=e.clientX-i.left-mr.left,s=e.clientY-i.top-mr.top;if(0>r||r>vr||0>s||s>br)return void Ei(null);let a=ts.current;if(!a||0===a.scene.length)return void Ei(null);let n=wi(He,Wr.current),o=X(a.scene,r,s,n,a.quadtree,a.maxPointRadius);if(!o)return void Ei(null);let l=o.datum||{},c=a.scales?.x?.invert,h="function"==typeof c?c(o.x):void 0;Ei(Ai(l,o.x,o.y,null!=h?{xValue:h,xPx:o.x}:void 0),{type:"activate",inputType:Yi(Wr.current)})};let bs=Rr(e=>vs.current(e),[]),{kbFocusIndexRef:ws,focusedNavPointRef:ks,onKeyDown:As}=St({storeRef:ts,hoverRef:zr,hoveredNodeRef:$r,setHoverPoint:jr,customHoverBehavior:Di,customClickBehavior:Ei,scheduleRender:yr}),_s=Rr(e=>{Nt(xs,e,!!_r,Fr.current,us.current)&&(Wr.current=e.pointerType,ws.current=-1,ks.current=null,fs(e))},[us,_r,ks,ws,fs,xs]),Cs=Rr(e=>{Nt(xs,e,!!_r,Fr.current,us.current,"mouse")&&(Wr.current="mouse",ws.current=-1,ks.current=null,fs({clientX:e.clientX,clientY:e.clientY,pointerType:"mouse"}))},[us,_r,ks,ws,fs,xs]),Ps=Rr(e=>{Wr.current=e.pointerType},[]);gr.current=()=>{if(pr.current=null,!fr.isActive)return;let e=us.current,t=ds.current;if(!e||!t)return;let i=ts.current;if(!i)return;let s=fr.now(),a=null!=i.activeTransition,n=i.advanceTransition(Zi.current?s+1e6:s),o=!Zi.current&&n,l=$i.current.w!==vr||$i.current.h!==br,c=ps.current,h=zi.current||a||l,u=a&&!n,d=i.consumeStylePaintPending(),p=!1,g=i.getLastUpdateResult(),y=Ur.current.beforeCompute(g,o);(zi.current||l)&&(!o||l)&&(i.computeScene({width:vr,height:br}),$i.current={w:vr,h:br},p=!0,is(),as()),(p||d)&&(Fr.current=Fi(i.scene),Fr.current||Wi(e)),Fr.current&&(a||p||d)&&Xe({canvas:e,pointer:xs.current,store:i,margin:mr,width:vr,height:br,hoverRadius:He,geometryMoved:a||p}),Ur.current.afterCompute(y,p,l);let f=Ct(i,s,p,Xi),m=fi(W,sr);pi(e,sr,m),pi(t,sr,m);let x=Hr.current.resolve(e);Vr.current=x.primary;let v=Qt(Lt,i.lastIngestTime>0?s-i.lastIngestTime:0),b=Lt&&v.isStale;if(h||d||f.changed||c){let t=yi(e,sr,mr,m);if(t){if(t.clearRect(-mr.left,-mr.top,sr[0],sr[1]),Lt&&1>v.alpha&&(t.globalAlpha=v.alpha),li(t,{background:$,hasBackgroundGraphics:!!ht,themeBackground:x.background,x:-mr.left,y:-mr.top,width:sr[0],height:sr[1]}),t.save(),"function"==typeof t.rect&&(t.beginPath(),t.rect(0,0,vr,br),t.clip()),yt&&i.scales)for(let e of yt)t.save(),e(t,i.scene,i.scales,{width:vr,height:br}),t.restore();let e=Je(r,!!Pi);Bt({context:t,nodes:i.scene,renderMode:j,pixelRatio:m,paintBuiltIn:r=>{if(e&&i.scales)for(let s of e)s(t,r,i.scales,{width:vr,height:br})}}),t.restore(),Lt&&1>v.alpha&&(t.globalAlpha=1)}}let w=!!(_r&&zr.current&&i.scales),k=!!($r.current&&Array.isArray(Me)&&Me.some(e=>e&&"object"==typeof e&&"highlight"===e.type)),A=w||k;if(Rt(A,Gr.current)){let e=yi(t,sr,mr,m);if(e&&(e.clearRect(-mr.left,-mr.top,sr[0],sr[1]),w&&zr.current&&Ne(e,zr.current,vr,br,"object"==typeof _r?_r:{},$r.current,x),k&&$r.current&&Array.isArray(Me))){let t=Me.find(e=>e&&"object"==typeof e&&"highlight"===e.type);t&&ze(e,i.scene,$r.current,t,x)}Gr.current=A}h&&e&&e.setAttribute("aria-label",ir(i.scene,r+" chart"));let _=zi.current;if(zi.current=_&&o&&!p,ps.current=!1,_&&i.scales){let e=e=>"object"==typeof e&&null!==e&&"function"==typeof e.valueOf?e.valueOf():e;(!Or||e(Or.x.domain()[0])!==e(i.scales.x.domain()[0])||e(Or.x.domain()[1])!==e(i.scales.x.domain()[1])||e(Or.y.domain()[0])!==e(i.scales.y.domain()[0])||e(Or.y.domain()[1])!==e(i.scales.y.domain()[1])||Or.x.range()[0]!==i.scales.x.range()[0]||Or.x.range()[1]!==i.scales.x.range()[1]||Or.y.range()[0]!==i.scales.y.range()[0]||Or.y.range()[1]!==i.scales.y.range()[1])&&Br(i.scales),ri&&hs(i.getData())}(Ue&&Ue.length>0||Pi)&&(p||a)&&(p||u||s-Mr.current>=33)&&(Sr(e=>e+1),Mr.current=s),Lt?.showBadge&&Kr(!!b),(o||null!=i.activeTransition||f.pending)&&yr()},ei(Lt,ts,zi,yr,fr.now,qr,Kr);let Ss=Lr(()=>{if(!ve&&!Ae&&ts.current?.xIsDate&&Or)return we(Or.x.domain())},[ve,Ae,Or]),Ms=ve||Ae||Ss,Rs=_r&&Xr?Re?Re(Xr):/* @__PURE__ */Gs($e,{hover:Xr}):null,Ys=Rs?/* @__PURE__ */Gs(hi,{x:Xr.x,y:Xr.y,containerWidth:vr,containerHeight:br,margin:mr,className:"stream-frame-tooltip",children:Rs}):null,Ts=ks.current,Ls=/* @__PURE__ */Gs(hr,{active:ws.current>=0,hoverPoint:Xr,margin:mr,size:sr,shape:Ts?.shape,width:Ts?.w,height:Ts?.h}),Ds=ut(l,M,"__semiotic_resolvedX","__semiotic_resolvedTime"),Es=ut(c,k,"__semiotic_resolvedY","__semiotic_resolvedValue"),Os=Ds.key,Bs=Es.key,Is=dt(Ds,Es,Ue&&Ue.length>0||!1);if(Ki||!Hi&&Gi){let e=ts.current;e&&a&&(e.ingest({inserts:We(kr,f),bounded:!0}),e.computeScene({width:vr,height:br}));let t=e?.scene??[],i=e?.scales??null,r=Et(gt,sr,mr,i),s=Et(ht,sr,mr,i),n=Ms||(()=>{if(e?.xIsDate&&i)return we(i.x.domain())})(),o=bi||("string"==typeof vt?vt:"XY chart"),h=ri&&e?ye(e.getData(),l,c):{xValues:[],yValues:[]};/* @__PURE__ */
|
|
45
45
|
return Us("div",{ref:Qi,className:"stream-xy-frame"+(z?" "+z:""),role:"img","aria-label":o,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:B?"100%":sr[0],height:I?"100%":sr[1]},children:[
|
|
46
46
|
/* @__PURE__ */Gs(or,{summary:ki}),
|
|
47
47
|
/* @__PURE__ */Us("svg",{xmlns:"http://www.w3.org/2000/svg",width:sr[0],height:sr[1],style:{position:"absolute",left:0,top:0},children:[
|
|
@@ -52,7 +52,7 @@ return Us("div",{ref:Qi,className:"stream-xy-frame"+(z?" "+z:""),role:"group","a
|
|
|
52
52
|
/* @__PURE__ */Gs(lr,{tableId:dr}),
|
|
53
53
|
/* @__PURE__ */Gs(ar,{scene:ts.current?.scene??[],chartType:r+" chart",tableId:dr,chartTitle:"string"==typeof vt?vt:void 0})]}),
|
|
54
54
|
/* @__PURE__ */Gs(or,{summary:ki}),
|
|
55
|
-
/* @__PURE__ */Gs(
|
|
55
|
+
/* @__PURE__ */Gs(Ji,{hoverPoint:Xr}),
|
|
56
56
|
/* @__PURE__ */Us("div",{role:"img","aria-label":bi||("string"==typeof vt?vt:"XY chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:_s,onMouseMove:Cs,onPointerLeave:ms,onMouseLeave:ms,onPointerDown:_r||Bi?Ps:void 0,onClick:Bi?bs:void 0,children:[
|
|
57
57
|
/* @__PURE__ */Gs(vi,{size:sr,margin:mr,backdropFill:ht?$:void 0,children:Nr}),
|
|
58
58
|
/* @__PURE__ */Gs(Ce,{width:vr,height:br,totalWidth:sr[0],totalHeight:sr[1],margin:mr,scales:Or,showAxes:pe,axes:ge,showGrid:Qe,xFormat:Ms,yFormat:be||_e,axisExtent:ke}),
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function e(e){let t=2166136261;for(let i=0;e.length>i;i++)t^=e.charCodeAt(i),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2146121005),t^=t>>>15,t=Math.imul(t,2221713035),t^=t>>>16,t>>>0}function t(e){return"p"+(Math.round(1e3*e)/10+"").replace(".","_")}function i(e,t,i){let s=e.length;for(e.push(t);s>0;){let n=s-1>>>1;if(0>=i(e[n],t))break;e[s]=e[n],s=n}e[s]=t}function s(e,t){let i=e[0],s=e.pop();if(e.length>0){let i=0;for(;e.length>2*i+1;){let n=2*i+1;if(e.length>n+1&&0>t(e[n+1],e[n])&&n++,0>=t(s,e[n]))break;e[i]=e[n],i=n}e[i]=s}return i}function n(e,t){switch(t){case"distinct":return e.distinct??0;case"p50":case"p95":case"p99":return e.percentiles?.[t]??NaN;default:return e[t]??e.mean}}function o(e,t,i,s=1){if("none"===t)return null;if("minmax"===t)return[e.min,e.max];let o=n(e,i),r=e.stddev*s;return[o-r,o+r]}function r(e){if("number"==typeof e)return Number.isFinite(e)&&e>0?e:null;if("string"!=typeof e)return null;let t=e.trim();if(""===t)return null;ve.lastIndex=0;let i,s=0,n=0;for(;null!==(i=ve.exec(t));){let e=parseFloat(i[1]),t=pe[i[2]];if(null==t||!Number.isFinite(e))return null;s+=e*t,n+=i[0].length}return n!==t.length?null:s>0?s:null}function a(e,t){return e.time-t.time||e.order-t.order}function l(e,t,i){return null==e?void 0:"function"==typeof t?t(e):e["string"==typeof t?t:i]}function c(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?e+"":e.toFixed(2):e instanceof Date?e.toLocaleString():e+""}function u(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:s="x",yLabel:n="y"}=e;return e=>{let o=e?.data??null,r=l(o,t,"time"),a=l(o,i,"value");/* @__PURE__ */
|
|
2
|
+
return _e("div",{className:"semiotic-tooltip",style:He,children:[
|
|
3
|
+
/* @__PURE__ */_e("div",{children:[
|
|
4
|
+
/* @__PURE__ */_e("span",{style:Me,children:[s,":"]}),c(r)]}),
|
|
5
|
+
/* @__PURE__ */_e("div",{children:[
|
|
6
|
+
/* @__PURE__ */_e("span",{style:Me,children:[n,":"]}),c(a)]})]})}}function h(e={}){let{timeAccessor:t,valueAccessor:i}=e;return e=>{let s=e?.data??null,n=l(s,t,"time"),o=s?.delta??l(s,i,"value"),r=s?.cumEnd,a="number"!=typeof o||0>o?c(o):"+"+c(o);/* @__PURE__ */
|
|
7
|
+
return _e("div",{className:"semiotic-tooltip",style:He,children:[
|
|
8
|
+
/* @__PURE__ */_e("div",{children:[
|
|
9
|
+
/* @__PURE__ */Se("span",{style:Me,children:"x:"}),c(n)]}),
|
|
10
|
+
/* @__PURE__ */_e("div",{children:[
|
|
11
|
+
/* @__PURE__ */Se("span",{style:Me,children:"Δ:"}),a]}),null!=r&&/* @__PURE__ */_e("div",{children:[
|
|
12
|
+
/* @__PURE__ */Se("span",{style:Me,children:"total:"}),c(r)]})]})}}function m(e={}){let{timeAccessor:t,valueAccessor:i}=e;return e=>{let s=e?.data??null;if(null==s?.binStart||null==s?.binEnd){let e=l(s,t,"time"),n=l(s,i,"value");/* @__PURE__ */
|
|
13
|
+
return _e("div",{className:"semiotic-tooltip",style:He,children:[
|
|
14
|
+
/* @__PURE__ */_e("div",{children:[
|
|
15
|
+
/* @__PURE__ */Se("span",{style:Me,children:"x:"}),c(e)]}),
|
|
16
|
+
/* @__PURE__ */_e("div",{children:[
|
|
17
|
+
/* @__PURE__ */Se("span",{style:Me,children:"y:"}),c(n)]})]})}/* @__PURE__ */
|
|
18
|
+
return _e("div",{className:"semiotic-tooltip",style:He,children:[
|
|
19
|
+
/* @__PURE__ */_e("div",{children:[
|
|
20
|
+
/* @__PURE__ */Se("span",{style:Me,children:"range:"}),c(s.binStart),"–",c(s.binEnd)]}),null!=s.total&&/* @__PURE__ */_e("div",{children:[
|
|
21
|
+
/* @__PURE__ */Se("span",{style:Me,children:"count:"}),c(s.total)]}),null!=s.category&&/* @__PURE__ */_e("div",{children:[
|
|
22
|
+
/* @__PURE__ */Se("span",{style:Me,children:"category:"}),c(s.category)]})]})}}function d(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:s="x",yLabel:n="y"}=e;return e=>{let o=e?.data??null,r=o?.xCenter??l(o,t,"time"),a=o?.yCenter??l(o,i,"value"),u=o?.count,h=o?.sum,m=o?.value,d=o?.agg??"count";/* @__PURE__ */
|
|
23
|
+
return _e("div",{className:"semiotic-tooltip",style:He,children:[
|
|
24
|
+
/* @__PURE__ */_e("div",{children:[
|
|
25
|
+
/* @__PURE__ */_e("span",{style:Me,children:[s,":"]}),c(r)]}),
|
|
26
|
+
/* @__PURE__ */_e("div",{children:[
|
|
27
|
+
/* @__PURE__ */_e("span",{style:Me,children:[n,":"]}),c(a)]}),null!=u&&/* @__PURE__ */_e("div",{children:[
|
|
28
|
+
/* @__PURE__ */Se("span",{style:Me,children:"count:"}),c(u)]}),"sum"===d&&null!=h&&/* @__PURE__ */_e("div",{children:[
|
|
29
|
+
/* @__PURE__ */Se("span",{style:Me,children:"sum:"}),c(h)]}),"mean"===d&&null!=m&&/* @__PURE__ */_e("div",{children:[
|
|
30
|
+
/* @__PURE__ */Se("span",{style:Me,children:"mean:"}),c(m)]})]})}}function g(e,t,i){return e??i??Math.max(t?.length??0,200)}function p(e){let t=e.window??"tumbling",i=r("session"===t?e.gap??e.size:e.size);if(null==i)return null;let s=null!=e.hop?r(e.hop):void 0,n=null!=e.gap?r(e.gap):void 0;return new ge({window:t,size:i,hop:s??void 0,gap:n??void 0,retain:e.retain,percentiles:e.percentiles,distinct:e.distinct})}function v(e,t){let i=t.stat??"mean",s=t.band??"none",r=t.sigma??1;return e.emit().map(e=>{let t={[Pe]:(e.start+e.end)/2,[Ie]:n(e,i),[ze]:e.count,[Re]:e.partial,[Be]:e.start,[Fe]:e.end},a=o(e,s,i,r);return a&&(t[Te]=a[0],t[Ne]=a[1]),t})}function f(e,t,i){let s="function"==typeof t?t(e):e[(t??i)+""];if(null==s||"string"==typeof s&&""===s.trim())return null;let n=Number(s);return Number.isFinite(n)?n:null}function w(e,t){let i=r(e.lateness);return null==i?null:new fe({lateness:i,getTime:t,latePolicy:e.latePolicy??"drop"})}function y(e){return{...K(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,showAxes:e.showAxes,showLegend:e.showLegend,enableHover:null==e.enableHover?void 0:!!e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight}}function b(e,t){Oe.useImperativeHandle(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,i)=>t.current?.update(e,e=>i(e))??[],clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t])}function x(e,t,i){let s=t.find(Boolean)??null;return Oe.useMemo(()=>s?te(e??je,s,i):e,[s,e,i])}function k(e,t,i){return{responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,legendHoverBehavior:t.onLegendHover,legendClickBehavior:t.onLegendClick,legendHighlightedCategory:t.highlightedCategory,legendIsolatedCategories:"isolate"===i?t.isolatedCategories:void 0}}function A(e,t,i,s=!1){let n=ne({axes:t,showAxes:i});return{...O(e,t,s),...!n.hasAxis&&{bottom:0},...!n.leftAxis?.hasAxis&&{left:0}}}function C({enabled:e,categories:t,colors:i,fallbackColor:s,order:n="discovery",domainKey:o}){let r=Z(!0),a=ee(),l=se(),c=V(),u="function"==typeof o?Je:o,h=Xe(null),m=qe(()=>{let e=h.current,s=e&&Object.is(e.domainKey,u)?new Map(e.indexes):/* @__PURE__ */new Map,o=new Set(t),r="explicit-then-alpha"===n?[...Object.keys(i??{}).filter(e=>o.has(e)),...t.filter(e=>!Object.prototype.hasOwnProperty.call(i??{},e)).sort()]:t;for(let e of r)ie(s,e);return{domainKey:u,indexes:s}},[t,i,n,u]);Qe(()=>{h.current=m},[m]);let d=m.indexes,g=qe(()=>{if(!e)return;let t=c&&c.length>0?c:l?re:ae;return e=>{let n=ie(d,e);return(r?le(r,e):void 0)||(i?le(i,e):void 0)||s||(a?le(a,e):void 0)||t[n%t.length]}},[d,i,e,s,l,a,r,c]),p=qe(()=>{if(!e||!g)return i;let s=Object.keys(i??{}),o=new Set(s),r=t.filter(e=>!o.has(e));"explicit-then-alpha"===n&&r.sort();let a=[...s,...r];if(0===a.length)return;let l=new Set(t),c=[];for(let e of a){if(l.has(e)){c.push([e,g(e)]);continue}let t=i?le(i,e):void 0;t&&c.push([e,t])}return c.length>0?Object.fromEntries(c):void 0},[t,g,i,e,n]);return{colorScale:g,colorMap:p}}function S(e){/* @__PURE__ */
|
|
31
|
+
return Ze(tt,{...e,windowMode:"growing"})}import{a as _}from"./c-GK263BF4.min.js";import{d as H,e as M,f as P,g as I}from"./c-AXJ2QI3F.min.js";import{d as T,e as N}from"./c-HNHKIMIV.min.js";import{a as R,h as z}from"./c-MTX2AO5S.min.js";import{a as B}from"./c-Z6GRGS53.min.js";import{C as F,Y as D,_ as L}from"./c-SAP5KY6R.min.js";import{C as O,Cb as j,Db as E,Eb as W,Fb as V,Lb as $,Nb as K,Pb as G,Sa as Y,Ta as U,Ua as q,Ub as X,bb as J,cb as Q,eb as Z,gb as ee,kb as te,ub as ie,wb as se,y as ne}from"./c-UMGHCBH5.min.js";import{d as oe,m as re,p as ae,s as le}from"./c-Y342FJ6K.min.js";var ce=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;let t=e-this._mean;this._mean+=t/this._count,this._m2+=t*(e-this._mean),this._min>e&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);let t=this._count+e._count,i=e._mean-this._mean;this._mean+=i*e._count/t,this._m2+=e._m2+i*i*this._count*e._count/t,this._count=t,this._min>e._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){let t=new e;return t.merge(this),t}get count(){return this._count}get mean(){return this._mean}get sum(){return this._mean*this._count}get variance(){return 2>this._count?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return 2>this._count?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},ue=class t{constructor(e=10){let t=Math.max(4,Math.min(16,Math.floor(e)));this.p=t,this.m=1<<t,this.registers=new Uint8Array(this.m),this.alpha=.7213/(1+1.079/this.m),this.harmonicSum=this.m,this.zeros=this.m}add(t){let i=e(t+""),s=i>>>32-this.p,n=Math.min(Math.clz32(i<<this.p),32-this.p)+1;this.updateRegister(s,n)}updateRegister(e,t){let i=this.registers[e];i>=t||(this.registers[e]=t,this.harmonicSum+=2**-t-2**-i,0===i&&this.zeros--)}merge(e){if(e.m===this.m)for(let t=0;this.m>t;t++)this.updateRegister(t,e.registers[t])}clone(){let e=new t(this.p);return e.registers.set(this.registers),e.harmonicSum=this.harmonicSum,e.zeros=this.zeros,e}count(){let e=this.alpha*this.m*this.m/this.harmonicSum;return Math.round(2.5*this.m>=e&&this.zeros>0?this.m*Math.log(this.m/this.zeros):e)}},he=class e{constructor(e=100){this.centroids=[],this.total=0,this.pending=0,this.compression=Math.max(20,e)}push(e){Number.isFinite(e)&&(this.centroids.push({mean:e,weight:1}),this.total+=1,this.pending++,this.pending>=2*this.compression&&this.compress())}merge(e){if(0===e.total)return;let t=0===this.total,i=e.centroids.length;for(let t=0;i>t;t++)this.centroids.push({...e.centroids[t]});this.total+=e.total,this.pending=t&&this.compression===e.compression?e.pending:this.pending+i,t||this.compress()}clone(){let t=new e(this.compression);return t.merge(this),t}quantile(e){if(0===this.total||Number.isNaN(e))return NaN;let t=Math.min(1,Math.max(0,e));this.compress();let i=t*this.total,s=this.centroids[0].weight/2;if(s>=i)return this.centroids[0].mean;for(let e=1;this.centroids.length>e;e++){let t=this.centroids[e-1],n=this.centroids[e],o=(t.weight+n.weight)/2,r=s+o;if(r>=i)return t.mean+(i-s)/o*(n.mean-t.mean);s=r}return this.centroids[this.centroids.length-1].mean}get count(){return this.total}compress(){if(0===this.pending||(this.pending=0,1>=this.centroids.length))return;this.centroids.sort((e,t)=>e.mean-t.mean);let e=0,t=0,i=this.total,s=this.compression;for(let n=1;this.centroids.length>n;n++){let o=this.centroids[e],r=this.centroids[n],a=(t+o.weight/2)/i;if(o.weight+r.weight>Math.max(1,4*i*a*(1-a)/s))t+=o.weight,this.centroids[++e]=r;else{let e=o.weight+r.weight;o.mean=(o.mean*o.weight+r.mean*r.weight)/e,o.weight=e}}this.centroids.length=e+1}},me=(e,t)=>e-t,de=class{constructor(e,t){this.stats=new ce,this.digest=e?new he:null,this.hll=t?new ue:null}push(e,t){this.stats.push(e),this.digest?.push(e),this.hll&&this.hll.add(t??e)}merge(e){this.stats.merge(e.stats),this.digest?.merge(e.digest),this.hll?.merge(e.hll)}},ge=class{constructor(e){this.windows=/* @__PURE__ */new Map,this.starts=[],this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;let t=e.hop??e.size;this.hop=t>0&&e.size>=t?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0,this.percentiles=e.percentiles??[],this.wantDistinct=!0===e.distinct}newBucket(){return new de(this.percentiles.length>0,this.wantDistinct)}push(e,t,i){!Number.isFinite(e)||!Number.isFinite(t)||(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t,i):this.pushFixed(e,t,i),this.prune())}pushFixed(e,t,i){if("tumbling"===this.type||this.hop>=this.size)return void this.bump(Math.floor(e/this.size)*this.size,t,i);let s=this.hop,n=Math.floor(e/s);for(let o=Math.floor((e-this.size)/s)+1;n>=o;o++)this.bump(o*s,t,i)}bump(e,t,s){let n=this.windows.get(e);if(!n){if(this.windows.size>=this.retain&&this.starts[0]>e)return;n=this.newBucket(),this.windows.set(e,n),this.retain!==1/0&&i(this.starts,e,me)}n.push(t,s)}pushSession(e,t,i){let s=e-this.gap,n=e+this.gap,o=0,r=this.sessions.length,a=this.sessions[r-1];if(a&&a.end>e)for(;r>o;){let e=o+r>>>1;s>this.sessions[e].end?o=e+1:r=e}else o=r,a&&a.end>=s&&n>=a.start&&o--;let l=this.sessions[o];if(!l||l.start>n){let s=this.newBucket();return s.push(t,i),void this.sessions.splice(o,0,{start:e,end:e,bucket:s})}l.bucket.push(t,i),l.start=Math.min(l.start,e),l.end=Math.max(l.end,e);let c=o+1;for(;this.sessions.length>c&&n>=this.sessions[c].start;){let e=this.sessions[c++];l.bucket.merge(e.bucket),l.end=Math.max(l.end,e.end)}c>o+1&&this.sessions.splice(o+1,c-o-1)}prune(){if(this.retain!==1/0){if("session"===this.type)return void(this.sessions.length>this.retain&&this.sessions.splice(0,this.sessions.length-this.retain));for(;this.windows.size>this.retain;)this.windows.delete(s(this.starts,me))}}emit(){if("session"===this.type)return this.sessions.map(e=>this.row(e.start,e.end,e.bucket,this.gap>this.latest-e.end));let e=[];for(let[t,i]of this.windows){let s=t+this.size;e.push(this.row(t,s,i,s>this.latest))}return e.sort((e,t)=>e.start-t.start),e}row(e,i,s,n){let o=s.stats,r={start:e,end:i,count:o.count,mean:o.mean,sum:o.sum,min:o.min,max:o.max,stddev:o.stddev,partial:n};if(s.digest){let e={};for(let i of this.percentiles)e[t(i)]=s.digest.quantile(i);r.percentiles=e}return s.hll&&(r.distinct=s.hll.count()),r}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.starts=[],this.sessions=[],this.latest=-1/0}},pe={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},ve=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g,fe=class{constructor(e){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){let t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};let s=[];return this._watermark!==-1/0&&Math.max(this._watermark-this.lateness,this._releasedThrough)>t?(this._lateCount+=1,s.push(e),"drop"===this.latePolicy?{released:[],late:s}:{released:[e],late:s}):(t>this._watermark&&(this._watermark=t),i(this.held,{item:e,time:t,order:this.nextOrder++},a),{released:this.drain(this._watermark-this.lateness),late:s})}drain(e){let t=[],i=this.held[0];for(;i&&e>=i.time;)s(this.held,a),t.push(i.item),this._releasedThrough=Math.max(this._releasedThrough,i.time),i=this.held[0];return t}flush(){return this.drain(1/0)}clear(){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}};import{useRef as we,useImperativeHandle as ye,forwardRef as be,useCallback as xe,useState as ke,useEffect as Ae,useMemo as Ce}from"react";import{jsx as Se,jsxs as _e}from"react/jsx-runtime";var He={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},Me={opacity:.7,marginRight:4},Pe="time",Ie="value",Te="__aggLower",Ne="__aggUpper",Re="__aggPartial",ze="count",Be="__aggStart",Fe="__aggEnd",De="__aggSeries",Le=class{constructor(e,t){this.config=e,this.seriesAccessor=t,this.groups=/* @__PURE__ */new Map}push(e,t,i){let s=f(e,t,"time"),n=f(e,i,"value");if(null==s||null==n)return;let o=null==this.seriesAccessor?"":("function"==typeof this.seriesAccessor?this.seriesAccessor(e):e[this.seriesAccessor])+"",r=this.groups.get(o);if(!r){if(r=p(this.config),!r)return;this.groups.set(o,r)}r.push(s,n)}emit(e){let t=[];for(let[i,s]of this.groups)for(let n of v(s,e))t.push(null==this.seriesAccessor?n:{...n,[De]:i});return t}clear(){this.groups.clear()}};import*as Oe from"react";var je=()=>({});import{jsx as Ee}from"react/jsx-runtime";R(z);var We=be(function(e,t){let i=y(e),{size:s,margin:n,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:h,seriesAccessor:m,data:d,timeAccessor:p,valueAccessor:v,timeExtent:b,valueExtent:A,extentPadding:C,stroke:S,strokeWidth:_,strokeDasharray:H,opacity:M,cursor:P,styleRules:I,background:N,tooltipContent:R,tooltip:z,onHover:B,annotations:F,autoPlaceAnnotations:O,svgAnnotationRules:W,tickFormatTime:V,tickFormatValue:K,decay:U,pulse:Z,staleness:ee,transition:te,linkedHover:ie,selection:se,onObservation:ne,chartId:oe,loading:re,loadingContent:ae,emptyContent:le,emphasis:ce,legendPosition:ue,aggregate:he,eventTime:me}=e,de=i.showAxes,ge=i.enableHover,pe=s??[i.width,i.height],ve=S??"#007bff",fe=_??2,be="string"==typeof v?v:"Value",Se=Ce(()=>{if(i.showLegend)return{legendGroups:[{label:"Series",type:"line",items:[{label:be,color:ve}],styleFn:e=>({stroke:e.color||"var(--semiotic-primary, #007bff)",strokeWidth:fe??2})}]}},[i.showLegend,be,ve,fe]),_e=E(e.legendInteraction,()=>be,[be]),{legend:He,margin:Me,legendPosition:Re}=j({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:ue,userMargin:n,defaults:i.marginDefaults,additionalLegend:Se,chartWidth:pe[0],chartHeight:pe[1],axisChrome:{hasAxis:!1!==i.showAxes}}),ze=u({timeAccessor:p,valueAccessor:v}),Be=q(),Fe=Y({tooltip:z,defaultTooltipContent:ze,customFunctionContext:"hover",multiDefaultContent:e=>Be({...e,allSeries:Array.isArray(e.allSeries)?e.allSeries.map(e=>({...e,group:e.group||("string"==typeof v?v:"value")})):e.allSeries})}),Oe=R??Fe.tooltipContent,je=we(null),{activeSelectionHook:We,customHoverBehavior:Ve,customClickBehavior:$e}=$({selection:se,linkedHover:ie,unwrapData:!0,onObservation:ne,chartType:"RealtimeLineChart",chartId:oe,mobileInteraction:i.mobileInteraction}),Ke=xe(e=>{B&&B(e),Ve(e)},[B,Ve]),Ge=null!=he,[Ye,Ue]=ke([]),qe=we(null),Xe=we(he);Xe.current=he;let Je=we(Ge);Je.current=Ge;let Qe=we(Ye),Ze=xe(e=>{Qe.current=e,Ue(e)},[]),et=we({timeAccessor:p,valueAccessor:v});et.current={timeAccessor:p,valueAccessor:v};let tt=Ge?[he.window??"tumbling",he.size,he.hop??"",he.gap??"",he.retain??"",(he.percentiles??[]).join(","),!0===he.distinct?"1":"0"].join("|"):"";Ae(()=>{if(!Ge)return void(qe.current=null);let e=Xe.current,t=new Le(e,m);if(qe.current=t,d){let{timeAccessor:e,valueAccessor:i}=et.current;for(let s of d)t.push(s,e,i)}Ze(t.emit(e))},[tt,Ge,d,p,v,m,Ze]),Ae(()=>{Ge&&qe.current&&Ze(qe.current.emit(Xe.current))},[he?.stat,he?.band,he?.sigma]);let it=xe(e=>{let t=qe.current,i=Xe.current;if(!t||!i)return;let{timeAccessor:s,valueAccessor:n}=et.current;for(let i of e)t.push(i,s,n);Ze(t.emit(i))},[Ze]),st=null!=me,nt=we(null),ot=we(me);ot.current=me;let rt=we(st);rt.current=st;let at=we(ne);at.current=ne;let lt=we(oe);lt.current=oe;let ct=st?`${me.lateness}|${me.latePolicy??"drop"}`:"",ut=xe(e=>{0!==e.length&&(Je.current?it(e):je.current?.pushMany(e))},[it]);Ae(()=>{let e=nt.current;if(e&&ut(e.flush()),!st)return void(nt.current=null);let t=p;nt.current=w(ot.current,e=>f(e,t,"time")??NaN)},[ct,st,ut,p]);let ht=xe(e=>{let t=nt.current;if(!rt.current||!t)return void ut(e);let i=[];for(let s of e){let e=t.push(s);for(let t of e.released)i.push(t);if(e.late.length){let i=at.current;if(i){let{timeAccessor:s}=et.current,n=ot.current?.latePolicy??"drop";for(let o of e.late)i({type:"late-data",datum:o,eventTime:f(o,s,"time")??NaN,watermark:t.watermark,policy:n,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:lt.current})}}}ut(i)},[ut]),mt=xe(()=>{let e=nt.current;!rt.current||!e||ut(e.flush())},[ut]);ye(t,()=>({push:e=>ht([e]),pushMany:e=>ht(e),flush:mt,remove:e=>Je.current?[]:je.current?.remove(e)??[],update:(e,t)=>Je.current?[]:je.current?.update(e,t)??[],clear:()=>{nt.current?.clear(),Je.current?(qe.current?.clear(),Ze([])):je.current?.clear()},getData:()=>Je.current?Qe.current:je.current?.getData()??[],getScales:()=>je.current?.getScales()??null}),[mt,ht,Ze]);let dt=Q(re,pe[0],pe[1],ae),gt=dt?null:J(Ge?void 0:d,pe[0],pe[1],le),pt=Ce(()=>()=>({stroke:"#007bff",strokeWidth:2}),[]),vt=Ce(()=>G(Ge?Pe:p??"time",Ge?Ie:v??"value"),[Ge,p,v]),ft=Ce(()=>X(pt,I,vt),[pt,I,vt]),wt=Ce(()=>{let e=L(ft,{stroke:S,strokeWidth:_,opacity:M});return t=>({...e(t),...null!=H&&{strokeDasharray:H},...null!=P&&{cursor:P}})},[ft,S,_,M,H,P]),yt=x(wt,[We],se),bt=a??l??"sliding",xt=g(c,d,h),kt=ce?`${o||""} semiotic-emphasis-${ce}`.trim():o,At=Ge?Ye:d,Ct=Ge?Pe:p,St=Ge?Ie:v,_t=Ge?"growing":bt,Ht=Ge?Math.max(1,he?.retain??Math.max(Ye.length,600)):xt,Mt=Ge&&he&&"none"!==(he.band??"none")?{y0Accessor:Te,y1Accessor:Ne,perSeries:null!=m}:void 0;return dt||gt||/* @__PURE__ */Ee(T,{ref:je,chartType:"line",runtimeMode:"streaming",size:pe,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Me,className:kt,...k(i,_e,e.legendInteraction),arrowOfTime:r,windowMode:_t,windowSize:Ht,data:At,timeAccessor:Ct,valueAccessor:St,groupAccessor:Ge&&null!=m?De:m,xExtent:b,yExtent:A,extentPadding:C,band:Mt,lineStyle:yt??wt,showAxes:de,background:N,hoverAnnotation:ge,tooltipContent:Oe,tooltipMode:Fe.tooltipMode,...D({linkedHover:ie,selection:se,onObservation:ne,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ke,customClickBehavior:$e}),annotations:F,legend:He,legendPosition:Re,autoPlaceAnnotations:O,svgAnnotationRules:W,tickFormatTime:V,tickFormatValue:K,decay:U,pulse:Z,staleness:ee,transition:te,pointIdAccessor:e.pointIdAccessor})});We.displayName="RealtimeLineChart";import{useRef as Ve,forwardRef as $e,useCallback as Ke,useMemo as Ge}from"react";import{useEffect as Ye,useLayoutEffect as Ue,useMemo as qe,useRef as Xe}from"react";var Je=/* @__PURE__ */Symbol("realtime-function-category-domain"),Qe=typeof window>"u"?Ye:Ue;import{jsx as Ze}from"react/jsx-runtime";R(M);var et=[],tt=$e(function(e,t){let i=y(e),{binSize:s,size:n,margin:o,className:r,arrowOfTime:a="right",windowMode:l,capacityMode:c,windowSize:u,capacity:h,data:d,timeAccessor:p,valueAccessor:v,direction:w="up",timeExtent:S,valueExtent:_,extentPadding:H,categoryAccessor:M,colors:P,fill:I,stroke:R,strokeWidth:z,opacity:L,cursor:O,styleRules:W,gap:V,background:K,tooltipContent:G,tooltip:Y,onHover:q,annotations:Z,autoPlaceAnnotations:ee,svgAnnotationRules:te,tickFormatTime:ie,tickFormatValue:se,linkedHover:oe,selection:re,decay:ae,pulse:le,staleness:ce,transition:ue,onObservation:he,chartId:me,loading:de,loadingContent:ge,emptyContent:pe,emphasis:ve,legendPosition:fe,legend:we,brush:ye,onBrush:be,linkedBrush:xe}=e,ke=i.showAxes,Ae=Ge(()=>{return(t={axes:e.axes,showTimeAxis:e.showTimeAxis,showValueAxis:e.showValueAxis}).axes??[{orient:"bottom",visible:!1!==t.showTimeAxis},{orient:"left",visible:!1!==t.showValueAxis}];var t},[e.axes,e.showTimeAxis,e.showValueAxis]),Ce=ne({showAxes:ke,axes:Ae}),Se=A(i.marginDefaults,Ae,ke,!!i.title),_e=i.enableHover,He=n??[i.width,i.height],Me=B({isPushMode:void 0===d,colorBy:M,colorScheme:P,showLegend:!1,legendPosition:fe,trackCategoryDomain:!1!==i.showLegend,registerLinkedCategories:!1}),Pe=Ge(()=>F(d??[],M),[d,M]),Ie=void 0===d?Me.categories:Pe,{colorScale:Te,colorMap:Ne}=C({enabled:!!M,categories:Ie,colors:P,fallbackColor:I,order:"explicit-then-alpha",domainKey:M}),Re=Ge(()=>{if(!Ne)return Ie;let e=new Set(Ie);return Object.keys(Ne).filter(t=>e.has(t))},[Ie,Ne]),ze=Ke(e=>null!=e.category?e.category+"":("function"==typeof M?M(e):M?e[M]:"")+"",[M]),{legend:Be,margin:Fe,legendPosition:De,hasAutomaticLegend:Le}=j({data:et,colorBy:M,colorScale:Te,showLegend:i.showLegend,legendPosition:fe,userMargin:o,defaults:Se,categories:Re,additionalLegend:we,chartWidth:He[0],chartHeight:He[1],axisChrome:Ce}),Oe=E(e.legendInteraction,M?ze:void 0,Re,Le,!0),je=G??U({tooltip:Y,defaultTooltipContent:m({timeAccessor:p,valueAccessor:v}),customFunctionContext:"hover"}).tooltipContent,Ee=Ve(null),{activeSelectionHook:We,hoverSelectionHook:$e,customHoverBehavior:Ye,customClickBehavior:Ue}=$({selection:re,linkedHover:oe,unwrapData:!0,onObservation:he,chartType:"RealtimeHistogram",chartId:me,mobileInteraction:i.mobileInteraction}),qe=Ke(e=>{q&&q(e),Ye(e)},[q,Ye]),Xe=!0===ye?{dimension:"x",snap:"bin"}:"x"===ye?{dimension:"x"}:"object"==typeof ye?ye:void 0,Je=Ke(e=>{be&&be(e),he&&he(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:me}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:me})},[be,he,me]),{brushStreamProps:Qe}=N({linkedBrush:xe,xAccessor:"string"==typeof p?p:"time",defaultDimension:"x",onBrush:Je});b(t,Ee);let tt=Q(de,He[0],He[1],ge),it=tt?null:J(d,He[0],He[1],pe),st={};null!=I&&(st.fill=I),null!=R&&(st.stroke=R),null!=z&&(st.strokeWidth=z),null!=L&&(st.opacity=L),null!=O&&(st.cursor=O),null!=V&&(st.gap=V);let nt=Ge(()=>{if(M&&Te)return e=>null==e.category?{}:{fill:Te(e.category+"")}},[M,Te]),ot=Ge(()=>e=>{let t=e.categoryValue??e.total,i="number"==typeof t&&Number.isFinite(t)?t:void 0,s=Number(e.binStart),n=Number(e.binEnd);return{value:i,x:Number.isFinite(s)&&Number.isFinite(n)?(s+n)/2:void 0,y:i,category:null==e.category?void 0:e.category+""}},[]),rt=Ge(()=>X(nt,W,ot),[nt,W,ot]),at=x(Ge(()=>e=>({...rt(e),...!M&&null!=I&&{fill:I},...null!=R&&{stroke:R},...null!=z&&{strokeWidth:z},...null!=L&&{opacity:L},...null!=O&&{cursor:O}}),[rt,M,I,R,z,L,O]),[$e||Oe.legendSelectionHook||We],re),lt=ve?`${r||""} semiotic-emphasis-${ve}`.trim():r,ct=Ke(e=>f(e,p,"time")??NaN,[p]),ut=Ke(e=>f(e,v,"value")??NaN,[v]),ht=l??c??"sliding",mt=g(u,d,h);return tt||it||/* @__PURE__ */Ze(T,{ref:Ee,chartType:"bar",runtimeMode:"streaming",size:He,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Fe,className:lt,...k(i,Oe,e.legendInteraction),arrowOfTime:a,windowMode:ht,windowSize:mt,data:d,timeAccessor:ct,valueAccessor:ut,xExtent:S,yExtent:_,invertY:"down"===w,extentPadding:H,binSize:s,categoryAccessor:M,barColors:Ne,barStyle:st,areaStyle:at,showAxes:ke,axes:Ae,background:K,hoverAnnotation:_e,tooltipContent:je,...D({linkedHover:oe,selection:re,onObservation:he,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:qe,customClickBehavior:Ue}),annotations:Z,autoPlaceAnnotations:ee,svgAnnotationRules:te,tickFormatTime:ie,tickFormatValue:se,decay:ae,pulse:le,staleness:ce,transition:ue,pointIdAccessor:e.pointIdAccessor,legend:Be,legendPosition:De,...Me.categoryDomainProps,brush:Xe||(xe?Qe.brush:void 0),onBrush:Xe||xe?Qe.onBrush:void 0})});tt.displayName="RealtimeHistogram",S.displayName="TemporalHistogram";var it=tt;import{useRef as st,forwardRef as nt,useCallback as ot,useMemo as rt}from"react";import{jsx as at}from"react/jsx-runtime";R(P);var lt=[],ct=nt(function(e,t){let i=y(e),{size:s,margin:n,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:h,data:m,timeAccessor:d,valueAccessor:p,timeExtent:v,valueExtent:f,yScaleType:w,extentPadding:A,decay:S,pulse:_,staleness:H,transition:M,categoryAccessor:P,colors:I,radius:N,fill:R,opacity:z,stroke:L,strokeWidth:O,cursor:W,pointStyle:V,styleRules:K,background:Y,tooltipContent:q,tooltip:Z,onHover:ee,annotations:te,autoPlaceAnnotations:ie,svgAnnotationRules:se,tickFormatTime:ne,tickFormatValue:oe,linkedHover:re,selection:ae,onObservation:le,chartId:ce,loading:ue,loadingContent:he,emptyContent:me,emphasis:de,legendPosition:ge}=e,pe=i.showAxes,ve=i.enableHover,fe=!0===i.showLegend,we=s??[i.width,i.height],ye=B({isPushMode:void 0===m,colorBy:P,colorScheme:I,showLegend:!1,legendPosition:ge,trackCategoryDomain:fe,registerLinkedCategories:!1}),be=rt(()=>F(m??[],P),[m,P]),xe=void 0===m?ye.categories:be,{colorScale:ke}=C({enabled:!!P,categories:xe,colors:I,fallbackColor:R,domainKey:P}),{legend:Ae,margin:Ce,legendPosition:Se,hasAutomaticLegend:_e}=j({data:lt,colorBy:P,colorScale:ke,showLegend:fe,legendPosition:ge,userMargin:n,defaults:i.marginDefaults,categories:xe,chartWidth:we[0],chartHeight:we[1],axisChrome:{hasAxis:!1!==i.showAxes}}),He=E(e.legendInteraction,P,xe,_e,!0),Me=q??U({tooltip:Z,defaultTooltipContent:u({timeAccessor:d,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,Pe=st(null),{activeSelectionHook:Ie,hoverSelectionHook:Te,customHoverBehavior:Ne,customClickBehavior:Re}=$({selection:ae,linkedHover:re,unwrapData:!0,onObservation:le,chartType:"RealtimeSwarmChart",chartId:ce,mobileInteraction:i.mobileInteraction}),ze=ot(e=>{ee&&ee(e),Ne(e)},[ee,Ne]);b(t,Pe);let Be=Q(ue,we[0],we[1],he),Fe=Be?null:J(m,we[0],we[1],me),De={};null!=N&&(De.radius=N),null!=R&&(De.fill=R),null!=z&&(De.opacity=z),null!=L&&(De.stroke=L),null!=O&&(De.strokeWidth=O),null!=W&&(De.cursor=W);let Le=V,Oe=rt(()=>{if(P)return e=>{let t="function"==typeof P?P(e):P?e[P]:void 0;return{...P&&ke?{fill:ke(t+"")}:void 0}}},[P,ke]),je=rt(()=>{let e=G(d??"time",p??"value");return t=>{let i="function"==typeof P?P(t):P?t[P]:void 0;return e(t,null==i?void 0:i+"")}},[d,p,P]),Ee=rt(()=>X(Oe,K,je),[Oe,K,je]),We=x(rt(()=>e=>({...Ee(e),...Le?.(e)}),[Ee,Le]),[Te||He.legendSelectionHook||Ie],ae),Ve=de?`${o||""} semiotic-emphasis-${de}`.trim():o,$e=a??l??"sliding",Ke=g(c,m,h);return Be||Fe||/* @__PURE__ */at(T,{ref:Pe,chartType:"swarm",runtimeMode:"streaming",size:we,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Ce,className:Ve,...k(i,He,e.legendInteraction),arrowOfTime:r,windowMode:$e,windowSize:Ke,data:m,timeAccessor:d,valueAccessor:p,xExtent:v,yExtent:f,yScaleType:w,extentPadding:A,decay:S,pulse:_,staleness:H,transition:M,categoryAccessor:P,swarmStyle:De,pointStyle:We,showAxes:pe,background:Y,hoverAnnotation:ve,tooltipContent:Me,...D({linkedHover:re,selection:ae,onObservation:le,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:ze,customClickBehavior:Re}),annotations:te,autoPlaceAnnotations:ie,svgAnnotationRules:se,tickFormatTime:ne,tickFormatValue:oe,legend:Ae,legendPosition:Se,...ye.categoryDomainProps,pointIdAccessor:e.pointIdAccessor})});ct.displayName="RealtimeSwarmChart";import{useRef as ut,forwardRef as ht,useCallback as mt,useMemo as dt}from"react";import{jsx as gt}from"react/jsx-runtime";R(I);var pt=ht(function(e,t){let i=y(e),{size:s,margin:n,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:m,timeAccessor:d,valueAccessor:p,timeExtent:v,valueExtent:f,extentPadding:w,decay:A,pulse:C,staleness:S,transition:_,positiveColor:H,negativeColor:M,connectorStroke:P,connectorWidth:I,gap:N,stroke:R,strokeWidth:z,opacity:B,cursor:F,styleRules:L,background:O,tooltipContent:W,tooltip:V,onHover:K,annotations:Y,autoPlaceAnnotations:q,svgAnnotationRules:Z,tickFormatTime:ee,tickFormatValue:te,linkedHover:ie,selection:se,onObservation:ne,chartId:oe,loading:re,loadingContent:ae,emptyContent:le,emphasis:ce,legendPosition:ue}=e,he=i.showAxes,me=i.enableHover,de=s??[i.width,i.height],ge=dt(()=>{if(i.showLegend)return{legendGroups:[{label:"Change",type:"fill",items:[{label:"Positive",color:H},{label:"Negative",color:M}],styleFn:e=>({fill:e.color||("Positive"===e.label?"var(--semiotic-success, #28a745)":"var(--semiotic-danger, #dc3545)")})}]}},[M,H,i.showLegend]),pe=mt(e=>{let t=e.delta??("function"==typeof p?p(e):e[p??"value"]);return 0>Number(t)?"Negative":"Positive"},[p]),ve=E(e.legendInteraction,pe,["Positive","Negative"]),{legend:fe,margin:we,legendPosition:ye}=j({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:ue,userMargin:n,defaults:i.marginDefaults,additionalLegend:ge,chartWidth:de[0],chartHeight:de[1],axisChrome:{hasAxis:!1!==i.showAxes}}),be=W??U({tooltip:V,defaultTooltipContent:h({timeAccessor:d,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,xe=ut(null),{activeSelectionHook:ke,hoverSelectionHook:Ae,customHoverBehavior:Ce,customClickBehavior:Se}=$({selection:se,linkedHover:ie,unwrapData:!0,onObservation:ne,chartType:"RealtimeWaterfallChart",chartId:oe,mobileInteraction:i.mobileInteraction}),_e=mt(e=>{K&&K(e),Ce(e)},[K,Ce]);b(t,xe);let He=Q(re,de[0],de[1],ae),Me=He?null:J(m,de[0],de[1],le),Pe={};null!=H&&(Pe.positiveColor=H),null!=M&&(Pe.negativeColor=M),null!=P&&(Pe.connectorStroke=P),null!=I&&(Pe.connectorWidth=I),null!=N&&(Pe.gap=N),null!=R&&(Pe.stroke=R),null!=z&&(Pe.strokeWidth=z),null!=B&&(Pe.opacity=B),null!=F&&(Pe.cursor=F);let Ie=Ae||ve.legendSelectionHook||ke,Te=dt(()=>G(d??"time",p??"value"),[d,p]),Ne=dt(()=>X(void 0,L,Te),[L,Te]),Re=x(dt(()=>e=>({...Ne(e),...null!=R&&{stroke:R},...null!=z&&{strokeWidth:z},...null!=B&&{opacity:B},...null!=F&&{cursor:F}}),[Ne,R,z,B,F]),[Ie],se),ze=ce?`${o||""} semiotic-emphasis-${ce}`.trim():o,Be=a??l??"sliding",Fe=g(c,m,u);return He||Me||/* @__PURE__ */gt(T,{ref:xe,chartType:"waterfall",runtimeMode:"streaming",size:de,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:we,className:ze,...k(i,ve,e.legendInteraction),arrowOfTime:r,windowMode:Be,windowSize:Fe,data:m,timeAccessor:d,valueAccessor:p,xExtent:v,yExtent:f,extentPadding:w,decay:A,pulse:C,staleness:S,transition:_,waterfallStyle:Pe,areaStyle:Re,showAxes:he,background:O,hoverAnnotation:me,tooltipContent:be,...D({linkedHover:ie,selection:se,onObservation:ne,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:_e,customClickBehavior:Se}),annotations:Y,autoPlaceAnnotations:q,svgAnnotationRules:Z,tickFormatTime:ee,tickFormatValue:te,legend:fe,legendPosition:ye,pointIdAccessor:e.pointIdAccessor})});pt.displayName="RealtimeWaterfallChart";import{useRef as vt,forwardRef as ft,useCallback as wt,useMemo as yt,useState as bt}from"react";import{jsx as xt}from"react/jsx-runtime";R(H);var kt=ft(function(e,t){let i=y(e),{size:s,margin:n,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:h,timeAccessor:m,valueAccessor:p,categoryAccessor:v,timeExtent:f,valueExtent:w,extentPadding:A,heatmapXBins:C=20,heatmapYBins:S=20,aggregation:H="count",colorScheme:M,customColorScale:P,cursor:I,styleRules:N,background:R,tooltipContent:z,tooltip:B,onHover:F,annotations:L,autoPlaceAnnotations:O,svgAnnotationRules:E,tickFormatTime:V,tickFormatValue:K,decay:G,pulse:Y,staleness:q,linkedHover:Z,selection:ee,onObservation:te,chartId:ie,loading:se,loadingContent:ne,emptyContent:re,emphasis:ae,legendPosition:le}=e,ce=i.showAxes,ue=i.enableHover,he=s??[i.width,i.height],[me,de]=bt(null),ge=yt(()=>me??[0,1],[me]),pe=yt(()=>{if("custom"===M&&P)return P;let e=oe(M||"blues");return t=>e(Math.max(0,Math.min(1,(t-ge[0])/(ge[1]-ge[0]||1))))},[M,P,ge]),ve=W(e.legendInteraction,e=>Number(e.value),ge),fe=yt(()=>i.showLegend?{gradient:{colorFn:pe,domain:ge,label:H}}:void 0,[H,pe,i.showLegend,ge]),{legend:we,margin:ye,legendPosition:be}=j({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:le,userMargin:n,defaults:i.marginDefaults,additionalLegend:fe,chartWidth:he[0],chartHeight:he[1],axisChrome:{hasAxis:!1!==i.showAxes}}),xe=z??U({tooltip:B,defaultTooltipContent:d({timeAccessor:m,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,ke=vt(null),{activeSelectionHook:Ae,hoverSelectionHook:Ce,customHoverBehavior:Se,customClickBehavior:_e}=$({selection:ee,linkedHover:Z,unwrapData:!0,onObservation:te,chartType:"RealtimeHeatmap",chartId:ie,mobileInteraction:i.mobileInteraction}),He=wt(e=>{F&&F(e),Se(e)},[F,Se]);b(t,ke);let Me=Q(se,he[0],he[1],ne),Pe=Me?null:J(h,he[0],he[1],re),Ie=ae?`${o||""} semiotic-emphasis-${ae}`.trim():o,Te=a??l??"sliding",Ne=g(c,h,u),Re=yt(()=>{if(null==I)return;let e={cursor:I};return()=>e},[I]),ze=yt(()=>_(m??"time",p??"value",p??"value"),[m,p]),Be=x(yt(()=>X(Re,N,ze),[Re,N,ze]),[Ce,ve.legendSelectionHook,Ae],ee);return Me||Pe||/* @__PURE__ */xt(T,{ref:ke,chartType:"heatmap",runtimeMode:"streaming",size:he,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ye,className:Ie,...k(i,ve,e.legendInteraction),arrowOfTime:r,windowMode:Te,windowSize:Ne,data:h,timeAccessor:m,valueAccessor:p,categoryAccessor:v,xExtent:f,yExtent:w,extentPadding:A,heatmapXBins:C,heatmapYBins:S,heatmapAggregation:H,colorScheme:"custom"!==M?M:void 0,heatmapColorScale:"custom"===M&&"function"==typeof P?P:void 0,onColorDomainChange:de,areaStyle:Be,showAxes:ce,background:R,hoverAnnotation:ue,tooltipContent:xe,...D({linkedHover:Z,selection:ee,onObservation:te,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:He,customClickBehavior:_e}),annotations:L,autoPlaceAnnotations:O,svgAnnotationRules:E,tickFormatTime:V,tickFormatValue:K,decay:G,pulse:Y,staleness:q,legend:we,legendPosition:be,pointIdAccessor:e.pointIdAccessor})});kt.displayName="RealtimeHeatmap";export{ce as a,ue as b,he as c,ge as d,n as e,o as f,r as g,fe as h,We as i,tt as j,S as k,it as l,ct as m,pt as n,kt as o};
|