@skdx/web-components-charts 0.38.0
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/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/area.cjs +109 -0
- package/dist/area.d.cts +2 -0
- package/dist/area.d.ts +2 -0
- package/dist/area.js +109 -0
- package/dist/bar.cjs +109 -0
- package/dist/bar.d.cts +2 -0
- package/dist/bar.d.ts +2 -0
- package/dist/bar.js +109 -0
- package/dist/boxplot.cjs +109 -0
- package/dist/boxplot.d.cts +2 -0
- package/dist/boxplot.d.ts +2 -0
- package/dist/boxplot.js +109 -0
- package/dist/bubble.cjs +109 -0
- package/dist/bubble.d.cts +2 -0
- package/dist/bubble.d.ts +2 -0
- package/dist/bubble.js +109 -0
- package/dist/bullet.cjs +109 -0
- package/dist/bullet.d.cts +2 -0
- package/dist/bullet.d.ts +2 -0
- package/dist/bullet.js +109 -0
- package/dist/bump.cjs +109 -0
- package/dist/bump.d.cts +2 -0
- package/dist/bump.d.ts +2 -0
- package/dist/bump.js +109 -0
- package/dist/candlestick.cjs +109 -0
- package/dist/candlestick.d.cts +2 -0
- package/dist/candlestick.d.ts +2 -0
- package/dist/candlestick.js +109 -0
- package/dist/chord.cjs +109 -0
- package/dist/chord.d.cts +2 -0
- package/dist/chord.d.ts +2 -0
- package/dist/chord.js +109 -0
- package/dist/circle-packing.cjs +109 -0
- package/dist/circle-packing.d.cts +2 -0
- package/dist/circle-packing.d.ts +2 -0
- package/dist/circle-packing.js +109 -0
- package/dist/combo.cjs +109 -0
- package/dist/combo.d.cts +2 -0
- package/dist/combo.d.ts +2 -0
- package/dist/combo.js +109 -0
- package/dist/dumbbell.cjs +109 -0
- package/dist/dumbbell.d.cts +2 -0
- package/dist/dumbbell.d.ts +2 -0
- package/dist/dumbbell.js +109 -0
- package/dist/funnel.cjs +109 -0
- package/dist/funnel.d.cts +2 -0
- package/dist/funnel.d.ts +2 -0
- package/dist/funnel.js +109 -0
- package/dist/gantt.cjs +109 -0
- package/dist/gantt.d.cts +2 -0
- package/dist/gantt.d.ts +2 -0
- package/dist/gantt.js +109 -0
- package/dist/gauge.cjs +109 -0
- package/dist/gauge.d.cts +2 -0
- package/dist/gauge.d.ts +2 -0
- package/dist/gauge.js +109 -0
- package/dist/heatmap.cjs +109 -0
- package/dist/heatmap.d.cts +2 -0
- package/dist/heatmap.d.ts +2 -0
- package/dist/heatmap.js +109 -0
- package/dist/histogram.cjs +109 -0
- package/dist/histogram.d.cts +2 -0
- package/dist/histogram.d.ts +2 -0
- package/dist/histogram.js +109 -0
- package/dist/icicle.cjs +109 -0
- package/dist/icicle.d.cts +2 -0
- package/dist/icicle.d.ts +2 -0
- package/dist/icicle.js +109 -0
- package/dist/index-oF5ss8v9.d.cts +2331 -0
- package/dist/index-oF5ss8v9.d.ts +2331 -0
- package/dist/index.cjs +109 -0
- package/dist/index.d.cts +29 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +109 -0
- package/dist/line.cjs +109 -0
- package/dist/line.d.cts +2 -0
- package/dist/line.d.ts +2 -0
- package/dist/line.js +109 -0
- package/dist/linear-gauge.cjs +109 -0
- package/dist/linear-gauge.d.cts +2 -0
- package/dist/linear-gauge.d.ts +2 -0
- package/dist/linear-gauge.js +109 -0
- package/dist/map.cjs +109 -0
- package/dist/map.d.cts +2 -0
- package/dist/map.d.ts +2 -0
- package/dist/map.js +109 -0
- package/dist/marimekko.cjs +109 -0
- package/dist/marimekko.d.cts +2 -0
- package/dist/marimekko.d.ts +2 -0
- package/dist/marimekko.js +109 -0
- package/dist/network.cjs +109 -0
- package/dist/network.d.cts +2 -0
- package/dist/network.d.ts +2 -0
- package/dist/network.js +109 -0
- package/dist/organization.cjs +109 -0
- package/dist/organization.d.cts +2 -0
- package/dist/organization.d.ts +2 -0
- package/dist/organization.js +109 -0
- package/dist/parallel.cjs +109 -0
- package/dist/parallel.d.cts +2 -0
- package/dist/parallel.d.ts +2 -0
- package/dist/parallel.js +109 -0
- package/dist/pareto.cjs +109 -0
- package/dist/pareto.d.cts +2 -0
- package/dist/pareto.d.ts +2 -0
- package/dist/pareto.js +109 -0
- package/dist/pie.cjs +109 -0
- package/dist/pie.d.cts +2 -0
- package/dist/pie.d.ts +2 -0
- package/dist/pie.js +109 -0
- package/dist/polar-area.cjs +109 -0
- package/dist/polar-area.d.cts +2 -0
- package/dist/polar-area.d.ts +2 -0
- package/dist/polar-area.js +109 -0
- package/dist/radar.cjs +109 -0
- package/dist/radar.d.cts +2 -0
- package/dist/radar.d.ts +2 -0
- package/dist/radar.js +109 -0
- package/dist/radial.cjs +109 -0
- package/dist/radial.d.cts +2 -0
- package/dist/radial.d.ts +2 -0
- package/dist/radial.js +109 -0
- package/dist/range.cjs +109 -0
- package/dist/range.d.cts +2 -0
- package/dist/range.d.ts +2 -0
- package/dist/range.js +109 -0
- package/dist/sankey.cjs +109 -0
- package/dist/sankey.d.cts +2 -0
- package/dist/sankey.d.ts +2 -0
- package/dist/sankey.js +109 -0
- package/dist/scatter.cjs +109 -0
- package/dist/scatter.d.cts +2 -0
- package/dist/scatter.d.ts +2 -0
- package/dist/scatter.js +109 -0
- package/dist/sparkline.cjs +109 -0
- package/dist/sparkline.d.cts +2 -0
- package/dist/sparkline.d.ts +2 -0
- package/dist/sparkline.js +109 -0
- package/dist/sunburst.cjs +109 -0
- package/dist/sunburst.d.cts +2 -0
- package/dist/sunburst.d.ts +2 -0
- package/dist/sunburst.js +109 -0
- package/dist/swarm.cjs +109 -0
- package/dist/swarm.d.cts +2 -0
- package/dist/swarm.d.ts +2 -0
- package/dist/swarm.js +109 -0
- package/dist/timeline.cjs +109 -0
- package/dist/timeline.d.cts +2 -0
- package/dist/timeline.d.ts +2 -0
- package/dist/timeline.js +109 -0
- package/dist/tree.cjs +109 -0
- package/dist/tree.d.cts +2 -0
- package/dist/tree.d.ts +2 -0
- package/dist/tree.js +109 -0
- package/dist/treemap.cjs +109 -0
- package/dist/treemap.d.cts +2 -0
- package/dist/treemap.d.ts +2 -0
- package/dist/treemap.js +109 -0
- package/dist/waffle.cjs +109 -0
- package/dist/waffle.d.cts +2 -0
- package/dist/waffle.d.ts +2 -0
- package/dist/waffle.js +109 -0
- package/dist/waterfall.cjs +109 -0
- package/dist/waterfall.d.cts +2 -0
- package/dist/waterfall.d.ts +2 -0
- package/dist/waterfall.js +109 -0
- package/package.json +76 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
var Zt=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var d=(e,n,t,r)=>{for(var i=r>1?void 0:r?Et(n,t):n,o=e.length-1,s;o>=0;o--)(s=e[o])&&(i=(r?s(n,t,i):s(i))||i);return r&&i&&Zt(n,t,i),i};import{customElement as hn,property as X}from"lit/decorators.js";var bt=e=>Number(e.toPrecision(12)),Wt,Ut=e=>(Wt??(Wt=new Intl.NumberFormat)).format(bt(e)),Kt=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),i=Math.floor(n%3600/60),o=s=>String(s).padStart(2,"0");return r>0?`${t}${r}h ${o(i)}m`:i>0?`${t}${i}m ${o(n%60)}s`:`${t}${n}s`};function gt(e){if(e===void 0)return Ut;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=u=>i?h=>u(h)+i:u,a=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},l=u=>{let h=new Intl.NumberFormat(t,u);return s(p=>h.format(bt(p)))},c=u=>{let h=new Intl.DateTimeFormat(t,o?{...u,timeZone:o}:u);return p=>h.format(p)};switch(n){case"integer":return l({maximumFractionDigits:0});case"decimal":return l(a(2));case"percent":return l({style:"percent",...a(0)});case"currency":return l({style:"currency",currency:e.currency??"USD",...a()});case"compact":return l({notation:"compact",...a(1)});case"scientific":return l({notation:"scientific",...a(2)});case"date":return c({dateStyle:"medium"});case"time":return c({timeStyle:"short"});case"datetime":return c({dateStyle:"medium",timeStyle:"short"});case"duration":return s(Kt)}}var k=e=>Number(e.toFixed(2)),Se=e=>typeof e=="number"&&Number.isFinite(e);function Ce(e){let n=1/0,t=-1/0;for(let r of e)Se(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}var ee=1e3,te=60*ee,ne=60*te,he=24*ne,mn=[ee,5*ee,15*ee,30*ee,te,5*te,15*te,30*te,ne,3*ne,6*ne,12*ne,he,2*he,7*he,14*he];var qt=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,Yt=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,Xt={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function Qt(e,n,t){return e.replace(Yt,(r,i,o)=>{let s=Xt[i];if(s===void 0)return i+o;let l=(o.match(qt)??[]).map((c,u)=>{let h=Number(c);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let p=u%s;return s===7?p===5?String(h+n):p===6?String(h+t):c:String(p%2===0?h+n:h+t)});return i+l.join(" ")})}var xt=(e,n,t)=>e.map(r=>{switch(r.kind){case"rect":return{...r,x:r.x+n,y:r.y+t};case"circle":return{...r,cx:r.cx+n,cy:r.cy+t};case"line":return{...r,x1:r.x1+n,x2:r.x2+n,y1:r.y1+t,y2:r.y2+t};case"text":return{...r,x:r.x+n,y:r.y+t};case"path":return{...r,d:Qt(r.d,n,t)}}});var $e=["primary","success","warning","danger","neutral"].flatMap(e=>[500,700].map(n=>`var(--skdx-color-${e}-${n})`)).sort((e,n)=>Number(e.endsWith("700)"))-Number(n.endsWith("700)"))),v={axis:"var(--skdx-color-border-strong)",grid:"var(--skdx-color-border-subtle)",label:"var(--skdx-color-text-muted)",focus:"var(--skdx-color-focus-ring)",positive:"var(--skdx-color-success-500)",negative:"var(--skdx-color-danger-500)",fontFamily:"var(--skdx-font-family)",fontSize:"var(--skdx-font-size-xs)"};var yt=(e,n)=>n??$e[e%$e.length];function re(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function vt(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var pe=20,Jt=120,wt=e=>{let n=re(e);return n&&(n.position==="left"||n.position==="right")?n.width??Jt:0},Te=(e,n=600,t=300)=>({width:(e.width??n)-wt(e),height:(e.height??t)-(re(e)?.position==="bottom"?pe:0)}),Mt=e=>{let n=re(e);return n&&(n.position===void 0||n.position==="top")?pe:0},j=6.5,fe=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:yt(n)),kt=(e,n)=>e.hiddenSeries?.includes(n)??!1;function Ie(e,n,t=[],r={},i=10,o=8,s=!1){let a=[],l=r.maxItems,c=l!==void 0&&l>=0&&e.length>l?e.slice(0,l):e,u=e.length-c.length,h=r.interactive??!0,p=o,S=i,C=($,m,g,x)=>{let y=(m?18:4)+$.length*j;p>o&&(s||p+y>n-8)&&(p=o,S+=pe),m&&a.push({kind:"rect",part:"legend-swatch",x:p,y:S-5,width:10,height:10,fill:m,opacity:x?.3:void 0,item:g}),a.push({kind:"text",part:"legend-label",x:p+(m?14:0),y:S,text:$,baseline:"middle",fill:x?v.grid:v.label,item:g}),p+=y+12};for(let $ of c){let m=t.includes($.name),g=h?{label:$.name,series:$.name,legend:!0}:void 0;C(r.formatter?.($.name)??$.name,$.color,g,m)}return u>0&&C(`+${u} more`,void 0,void 0,!1),r.align==="end"?en(a,n):a}function en(e,n){let t=new Map;for(let i of e){let o=i.kind==="rect"?i.y+5:i.y;t.set(o,[...t.get(o)??[],i])}let r=[];for(let i of t.values()){let o=Math.max(...i.map(a=>a.kind==="rect"?a.x+a.width:a.x+a.text.length*j)),s=n-8-o;for(let a of i)r.push({...a,x:a.x+s})}return r}var tn=(e,n,t={})=>new Set(Ie(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function Oe(e,n,t,r=[]){let i=re(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=vt(e),a=o?.position==="bottom",l=wt(e),c=e.hiddenSeries??[],u=o?l?Ie(r,1/0,c,o,10,(o.position==="right"?n:0)+8,!0):Ie(r,n,c,o,a?t+10:10):[],h=a?tn(r,n,o):0;return{width:n+l,height:a?t+Math.max(1,h)*pe:t,legendOffset:o?.position==="left"?l:void 0,tooltip:s.enabled,tooltipFormatter:s.formatter,axisTooltipFormatter:s.axisFormatter,tooltipPortal:s.portal,tooltipPlacement:s.placement,tooltipAnchored:s.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:u}}function ze(e){let n=e.legendOffset;if(!n)return e;let t=[...xt(e.shapes.filter(l=>!l.part.startsWith("legend-")),n,0),...e.shapes.filter(l=>l.part.startsWith("legend-"))],r=l=>({...l,x:l.x+n}),i=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(l=>l+n),brush:e.hit.brush?{box:r(e.hit.brush.box),window:r(e.hit.brush.window)}:void 0}:void 0,o=e.edit,s=o?{...o,scale:l=>o.scale(l)+n,invert:l=>o.invert(l-n),bars:o.bars.map(l=>({...l,x0:l.x0+n,x1:l.x1+n}))}:void 0,a=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:s,map:a,legendOffset:void 0}}function me(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],a=Math.max(...s.map(p=>p.length))*j+12,l=6+s.length*16,c=o==="top"?{x:e-a/2,y:n-l-8}:o==="bottom"?{x:e-a/2,y:n+8}:o==="left"?{x:e-a-8,y:n-l/2}:o==="right"?{x:e+8,y:n-l/2}:{x:e+12,y:n-l-6},u=Math.max(0,Math.min(r-a,c.x)),h=Math.max(0,Math.min(i-l,c.y));return[{kind:"rect",part:"tooltip",x:k(u),y:k(h),width:k(a),height:l,fill:"var(--skdx-color-surface-raised)",stroke:v.axis,rx:3},...s.map((p,S)=>({kind:"text",part:"tooltip-label",x:k(u+6),y:k(h+11+S*16),text:p,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:s.length>1&&S===0?"bold":void 0}))]}function St(e,n,t,r){let i=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!i)return null;let{width:o,height:s}=Te(e,t,r),a=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",l=[];return i==="loading"&&l.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:s,fill:"var(--skdx-color-surface-sunken)",rx:4}),l.push({kind:"text",part:`state-${i}`,x:k(o/2),y:k(s/2),text:a,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":v.label}),{...Oe(e,o,s),shapes:l,tooltip:!1}}var Le=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:v.label,...r});var ie=e=>Math.max(0,Math.min(1,e));function Ct(e){let n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(n){let r=n[1],i=r.length===3?r.split("").map(o=>o+o).join(""):r;return[0,2,4].map(o=>parseInt(i.slice(o,o+2),16))}let t=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/i.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:void 0}function $t(e,n){if(e.length===0)return v.axis;if(e.length===1)return e[0];let t=ie(n)*(e.length-1),r=Math.min(e.length-2,Math.floor(t)),i=t-r,o=Ct(e[r]),s=Ct(e[r+1]);if(!o||!s)return e[Math.round(t)];let a=l=>Math.round(o[l]+(s[l]-o[l])*i);return`rgb(${a(0)}, ${a(1)}, ${a(2)})`}var It=(e,n)=>n!==void 0&&n>=2?Math.min(n-1,Math.floor(ie(e)*n))/(n-1):ie(e);function Tt(e,n,t,r=v.negative,i=String){let[o,s]=Ce(n),a=e??{type:"sequential"},l=m=>k(.15+.85*m);if(a.type==="threshold"){let{thresholds:m,colors:g,labels:x}=a,y=z=>{if(typeof z!="number"||!Number.isFinite(z))return;let O=0;for(;O<m.length&&z>=m[O];)O++;return{fill:g[Math.min(O,g.length-1)]??t,opacity:1}},A=g.map((z,O)=>({fill:z,opacity:1,label:x?.[O]??(O===0?`< ${i(m[0]??0)}`:O===m.length?`\u2265 ${i(m[O-1])}`:`${i(m[O-1])} \u2013 ${i(m[O])}`)}));return{color:y,domain:[o,s],swatches:A,kind:"threshold"}}if(a.type==="ordinal"){let m=a.colors?.length?a.colors:[t];return{color:x=>typeof x=="number"&&Number.isFinite(x)?{fill:m[Math.abs(Math.round(x))%m.length],opacity:1}:void 0,domain:[o,s],swatches:m.map((x,y)=>({fill:x,opacity:1,label:String(y)})),kind:"ordinal"}}if(a.type==="diverging"){let[m,g,x]=a.domain??[-Math.max(Math.abs(o),Math.abs(s)),0,Math.max(Math.abs(o),Math.abs(s))],y=a.colors,A=L=>L<g?.5*(L-m)/Math.max(1e-12,g-m):.5+.5*(L-g)/Math.max(1e-12,x-g),z=L=>{let P=It(a.reversed?1-ie(L):L,a.steps);if(y&&y.length>=2)return{fill:$t(y,P),opacity:1};let N=P<.5?r:t,I=Math.abs(P-.5)*2;return{fill:N,opacity:l(I)}},O=L=>typeof L=="number"&&Number.isFinite(L)?z(A(L)):void 0,E=a.steps??5,W=Array.from({length:E},(L,P)=>{let N=E===1?.5:P/(E-1),I=N<.5?m+(g-m)*(N*2):g+(x-g)*((N-.5)*2);return{...z(N),label:i(I)}});return{color:O,domain:[m,x],swatches:W,kind:"diverging"}}let[c,u]=a.domain??[o,s],h=a.colors,p=m=>{let g=It(a.reversed?1-ie(m):m,a.steps);return h&&h.length>=2?{fill:$t(h,g),opacity:1}:{fill:h?.[0]??t,opacity:l(g)}},S=m=>typeof m!="number"||!Number.isFinite(m)?void 0:p(u===c?1:(m-c)/(u-c)),C=a.steps??5,$=Array.from({length:C},(m,g)=>{let x=C===1?1:g/(C-1);return{...p(x),label:i(c+(u-c)*x)}});return{color:S,domain:[c,u],swatches:$,kind:"sequential"}}function be(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Ae=e=>e.id??e.name??e.series,Ot=e=>e.seriesId??e.series;function F(e,n){let t=!1;return n.id!==void 0&&(t=!0,Ae(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Ot(e)!==n.series&&e.series!==n.series)||n.index!==void 0&&(t=!0,e.index!==n.index)||n.category!==void 0&&(t=!0,e.category!==n.category)?!1:t}function H(e){let n={},t=Ae(e);t!==void 0&&(n.id=t);let r=Ot(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var Ne=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function Be(e,n,t){let r=be(e),i=H(n),o=r.some(s=>F(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!F(n,s)):[...r,i]}var nn=.2;function rn(e){let n=v.focus;switch(e.kind){case"rect":return{kind:"rect",part:"selected",x:e.x-1.5,y:e.y-1.5,width:e.width+3,height:e.height+3,fill:"none",stroke:n,rx:e.rx};case"circle":return{kind:"circle",part:"selected",cx:e.cx,cy:e.cy,r:e.r+2.5,fill:"none",stroke:n};case"path":return{kind:"path",part:"selected",d:e.d,fill:"none",stroke:n,strokeWidth:2.5};case"line":return{...e,part:"selected",stroke:n,strokeWidth:(e.strokeWidth??1)+3,title:void 0,item:void 0};case"text":return}}var on=(e,n)=>e.kind==="text"?{...e,fill:v.grid}:{...e,opacity:(e.opacity??1)*n};function Re(e,n){let t=be(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:be(n.highlighted),i=r[0];if(t.length===0&&!i)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],a=u=>!i||r.some(h=>F(u,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&F(u,{series:h.series})):!1,l=u=>{if(!i||o.faded==="none"||a(u))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&F(u,{series:h})}return!0},c=e.shapes.map(u=>{let h=u.item;if(!h||h.legend)return u;if(t.some(p=>F(h,p))){let p=rn(u);p&&s.push(p)}return l(h)?on(u,nn):u});return s.length?{...e,shapes:[...c,...s]}:{...e,shapes:c}}function Y(e,n,t,r,i){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*i/o.height:t}}var Pe=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function zt(e,n){let t=0,r=1/0;return e.xs.forEach((i,o)=>{let s=Math.abs(i-n);s<r&&(r=s,t=o)}),t}function oe(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=zt(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function De(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[zt(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:v.axis,dash:"3 3"}}function Fe(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Pe(r.plot,n,t))return[];let i=De(e,n),{rows:o}=oe(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...me(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Ge(e,n){let t=e.hit;if(!t||t.xs.length===0)return[];let r=t.rows.findIndex(o=>o[0]===n);if(r<0)return[];let i=t.xs[r];return Fe(e,i,t.plot.y+8)}function je(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:l,y:c}=Y(t,r,i,e.width,e.height);if(Pe(e.hit.plot,l,c)){let u=oe(e,l),h=De(e,l);if(u&&h)return{lines:u.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?V(e,n)?.item:void 0,a=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(l=>l.tagName.toLowerCase()==="title")?.textContent;return a?{lines:Array.isArray(a)?a:[a],shapes:[]}:{lines:[],shapes:[]}}function Lt(e,n,t,r,i,o,s){let a=e?.closest?.("[data-skdx-part]"),l=s&&s.tooltipFormatter?V(s,e)?.item:void 0,c=l&&s?.tooltipFormatter?.(l)||a&&Array.from(a.children).find(C=>C.tagName.toLowerCase()==="title")?.textContent;if(!c)return[];let u=s?.tooltipAnchored?V(s,e):void 0,h=u?s?.shapes[u.index]:void 0,{x:p,y:S}=h?se(h):Y(n,t,r,i,o);return me(p,S,c,i,o,s?.tooltipPlacement)}function He(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=Y(t,r,i,e.width,e.height),a=Fe(e,o,s);if(a.length>0)return a}return Lt(n,t,r,i,e.width,e.height,e)}function Ve(e,n){let t=V(e,n);return t&&!t.item.legend?H(t.item):null}var sn=(e,n)=>{let{x:t,y:r}=se(e),i=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height};function _e(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!sn(i,n))continue;let o=H(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Ze=e=>({kind:"rect",part:"selection-box",x:k(e.x),y:k(e.y),width:k(e.width),height:k(e.height),fill:v.focus,opacity:.12,stroke:v.focus}),xe=(e,n,t,r)=>({x:Math.min(e,t),y:Math.min(n,r),width:Math.abs(t-e),height:Math.abs(r-n)});function At(e,n,t){let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let s=e[i],a=e[o];s.y>t!=a.y>t&&n<(a.x-s.x)*(t-s.y)/(a.y-s.y)+s.x&&(r=!r)}return r}function Ee(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor")continue;let{x:o,y:s}=se(i),a=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!At(n,o,a))continue;let l=H(i.item),c=JSON.stringify(l);t.has(c)||(t.add(c),r.push(l))}return r}var We=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${k(n.x)} ${k(n.y)}`).join("L")}`:"",fill:v.focus,fillOpacity:.12,stroke:v.focus,dash:"4 3"}),ge=6;function Ue(e,n,t){let r=e.edit;if(r){for(let i of r.bars)if(!(t<i.y||t>i.y+i.height||n<i.x0-ge||n>i.x1+ge))return Math.abs(n-i.x0)<=ge?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=ge?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function Ke(e,n,t){let r=e.edit;return Nt(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function qe(e,n,t){let r=e.edit,i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!i||!(t.shiftKey||t.altKey))return;let o=r.bars.find(l=>l.index===n);if(!o)return;let s=t.altKey?t.shiftKey?"start":"end":"move",a=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return Nt(r,{bar:o,mode:s},i*a)}function Nt(e,{bar:n,mode:t},r){let i=a=>e.snap?Math.round(a/e.snap)*e.snap:a,o=n.start,s=n.end;return t==="move"?(o=i(n.start+r),s=o+(n.end-n.start)):t==="start"?o=Math.min(i(n.start+r),n.end):s=Math.max(i(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:s}}function Ye(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:k(Math.min(i,o)),y:k(n.bar.y),width:k(Math.max(1,Math.abs(o-i))),height:k(n.bar.height),fill:v.focus,opacity:.25,stroke:v.focus,rx:2}}var an=64,ln=e=>Math.max(1,Math.min(an,e));function Xe(e,n,t,r){let i=n>0?.8:1.25,o=ln(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:a}=e,[l,c]=e.view.center,u=(t-(s.x+s.width/2))/a,h=(r-(s.y+s.height/2))/a,p=e.view.zoom/o;return{center:[l+u*(1-p),e.fromY(e.toY(c)-h*(1-p))],zoom:o}}function Qe(e,n,t,r){let{scale:i}=e;return{center:[n.center[0]-t/i,e.fromY(e.toY(n.center[1])+r/i)],zoom:n.zoom}}function V(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),i=Number.isInteger(r)?e.shapes[r]?.item:void 0;return i?{index:r,item:i}:void 0}var ye=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function se(e){switch(e.kind){case"rect":return{x:e.x+e.width/2,y:e.y};case"circle":return{x:e.cx,y:e.cy-e.r};case"line":return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)};case"text":return{x:e.x,y:e.y};case"path":{let n=/M\s*(-?[\d.]+)[ ,](-?[\d.]+)/.exec(e.d);return n?{x:Number(n[1]),y:Number(n[2])}:{x:0,y:0}}}}function Je(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=v.focus,i;switch(t.kind){case"rect":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-2,width:t.width+4,height:t.height+4,fill:"none",stroke:r,rx:2};break;case"circle":i={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":i={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*j+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":i={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:s}=se(t),a=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...a?me(k(o),k(s),a,e.width,e.height):[]]}function et(e,n,t){let r=ye(e);if(r.length===0)return;let i=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,i+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,i<=0?0:i-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var K=2,q=(e,n,t)=>{let r=Math.max(K,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},Bt=(e,n)=>!e||e.start<=0&&e.end>=n;function tt(e,n,t){if(e.count<=K||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,a=Math.max(K,Math.min(e.count,Math.round(o*s)));if(a===o)return n>0&&!Bt(e.zoom,e.count)?q(r,a,e.count):void 0;let l=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),c=r+l*o;return q(c-l*a,a,e.count)}function nt(e,n,t,r){let i=n.end-n.start,o=Math.max(K,Math.min(e.count,Math.round(i/Math.max(.05,t)))),s=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return q(n.start+s*i-s*o,o,e.count)}function rt(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return q(n.start-t/i,r,e.count)}function it(e,n,t){let r=e.brush;if(!r||!Pe(r.box,n,t))return;let i=r.window;if(Math.abs(n-i.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(i.x+i.width))<=6)return{grab:"right",zoom:e.zoom};if(n>i.x&&n<i.x+i.width)return{grab:"move",zoom:e.zoom};let o=e.zoom.end-e.zoom.start,s=(n-r.box.x)/Math.max(1,r.box.width)*e.count;return{grab:"move",zoom:q(s-o/2,o,e.count)}}function ot(e,n,t,r){let i=e.brush;if(!i)return t;let o=r/Math.max(1,i.box.width)*e.count;if(n==="move")return q(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-K,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+K,Math.round(t.end+o)));return{start:t.start,end:s}}function at(e,n){switch(n.type){case"svg":return Promise.resolve(st(e,n.label,n.resolve));case"csv":return Promise.resolve(Ft(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=st(e,n.label,n.resolve);return Dt(t,e.width,e.height,n.scale,n.background)}}}var G=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/"/g,"""),ae=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${G(String(t))}"`).join("");function Rt(e){let n=e.title?`<title>${G(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${ae([t,["d",e.d],["fill",e.fill??"none"],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-linecap",e.strokeLinecap],["stroke-linejoin",e.strokeLinejoin],["stroke-dasharray",e.dash],["opacity",e.opacity],["fill-opacity",e.fillOpacity]])}>${n}</path>`;case"rect":return`<rect${ae([t,["x",e.x],["y",e.y],["width",e.width],["height",e.height],["rx",e.rx],["fill",e.fill],["stroke",e.stroke],["fill-opacity",e.opacity]])}>${n}</rect>`;case"line":return`<line${ae([t,["x1",e.x1],["y1",e.y1],["x2",e.x2],["y2",e.y2],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-dasharray",e.dash],["opacity",e.opacity]])}>${n}</line>`;case"circle":return`<circle${ae([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${ae([t,["x",e.x],["y",e.y],["text-anchor",e.anchor],["dominant-baseline",e.baseline],["fill",e.fill],["font-weight",e.weight],["transform",e.rotate?`rotate(${e.rotate} ${e.x} ${e.y})`:void 0]])}>${G(e.text)}</text>`}}function Pt(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${G(t.id)}" x1="0" y1="0" x2="${t.vertical===!1?1:0}" y2="${t.vertical===!1?0:1}">${t.stops.map(r=>`<stop offset="${r.offset}" stop-color="${G(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function st(e,n,t){let r=Pt(e)+e.shapes.map(Rt).join("");return t&&(r=r.replace(/var\((--[\w-]+)\)/g,(i,o)=>t(o).trim()||i)),`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" role="img" aria-label="${G(n)}" font-family="${G(v.fontFamily)}" font-size="${G(v.fontSize)}"><title>${G(n)}</title>${r}</svg>`}function Dt(e,n,t,r=2,i){return new Promise((o,s)=>{let a=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),l=new Image;l.onload=()=>{URL.revokeObjectURL(a);let c=document.createElement("canvas");c.width=Math.round(n*r),c.height=Math.round(t*r);let u=c.getContext("2d");if(!u)return s(new Error("canvas 2d context unavailable"));i&&(u.fillStyle=i,u.fillRect(0,0,c.width,c.height)),u.drawImage(l,0,0,c.width,c.height),c.toBlob(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},l.onerror=()=>{URL.revokeObjectURL(a),s(new Error("svg could not be decoded"))},l.src=a})}function Ft(e){let n=t=>{let r=t==null?"":String(t);return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r};return e.map(t=>t.map(n).join(",")).join(`\r
|
|
2
|
+
`)}var _=e=>Se(e.value)?e.value:(e.children??[]).reduce((n,t)=>n+_(t),0);var ve=e=>e.id??e.name;function Gt(e,n){for(let t of e){if(ve(t)===n||t.name===n)return[t];let r=Gt(t.children??[],n);if(r)return[t,...r]}}function lt(e,n,t=1){return n===void 0?[...e]:e.map(r=>t>=n?{...r,value:_(r),children:void 0}:{...r,children:r.children?lt(r.children,n,t+1):void 0})}function jt(e,n){if(n===void 0)return{nodes:[...e],path:[]};let t=Gt(e,n);if(!t)return{nodes:[...e],path:[]};let r=t[t.length-1];return{nodes:r.children?.length?r.children:[r],path:t}}function ct(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let a=r.rows[0];if(r.rows.length>t)return;let l=["",...a.slice(1).map(u=>u.replace(/:\s[^:]*$/,""))],c=r.rows.map(u=>[u[0],...u.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[l,...c]}let i=e.shapes.flatMap(a=>a.item&&!a.item.legend&&!(a.part==="anchor"&&!a.title)?[a.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(a=>i.some(l=>l[a]!==void 0)),s=(a,l)=>a[l]===void 0?"":String(a[l]);return[o.map(a=>a[0]?.toUpperCase()+a.slice(1)),...i.map(a=>o.map(l=>s(a,l)))]}var dt=new Map;function we(e){let n=dt.get(e);if(n)return n.group;let t=new Set,r={},i={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&dt.delete(e)}},publish(o,s){Object.assign(r,o);for(let a of t)a(o,s)}};return dt.set(e,{group:i,listeners:t}),i}var Ht='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',ut=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Ht}{animation:skdx-in var(--skdx-chart-duration,0ms) ease-out;transition:${["x","y","width","height","cx","cy","r","opacity","fill-opacity","d"].map(e=>`${e} var(--skdx-chart-duration,0ms) ease-out`).join(",")}}@media (prefers-reduced-motion:reduce){${Ht}{animation:none;transition:none}}`;function ht(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}function Vt(e,n){let t=[],r=e.map((p,S)=>({r:p,i:S})).sort((p,S)=>S.r-p.r),i=new Array(e.length);for(let{r:p,i:S}of r){let C;if(t.length===0)C={x:0,y:0,r:p};else{let m=Math.max(1,p/4);e:for(let g=0;g<1e6;g+=m)for(let x=0;x<24;x++){let y=x/24*2*Math.PI+g*.05,A={x:g*Math.cos(y),y:g*Math.sin(y),r:p};if(t.every(z=>Math.hypot(z.x-A.x,z.y-A.y)>=z.r+A.r+n)){C=A;break e}}}let $=C??{x:0,y:0,r:p};t.push($),i[S]=$}let o=1/0,s=-1/0,a=1/0,l=-1/0;for(let p of t)o=Math.min(o,p.x-p.r),s=Math.max(s,p.x+p.r),a=Math.min(a,p.y-p.r),l=Math.max(l,p.y+p.r);let c=(o+s)/2,u=(a+l)/2,h=0;for(let p of i)p.x-=c,p.y-=u,h=Math.max(h,Math.hypot(p.x,p.y)+p.r);return{circles:i,enclosing:h}}function pt(e){let n=[],{nodes:t}=jt(e.data,e.rootId),r=lt(t,e.maxDepth).filter(y=>!kt(e,y.name)),i=St(e,!r.some(y=>_(y)>0),300,300);if(i)return{...i,issues:n};let o=gt(e.format),{width:s,height:a}=Te(e,300,300),l=Mt(e),c=e.padding??2,u=e.labels??!0,h=[],p=y=>{y.children?.length?y.children.forEach(p):h.push(_(y))};r.forEach(p);let S=Tt(e.colorScale,h,fe(e,0),void 0,o),C=[],$=[],m=(y,A,z,O,E)=>{let W=y.filter(I=>{let Q=_(I)>0;return Q||n.push({code:"invalid-value",severity:"warning",message:`"${I.name}" has no positive value and was dropped.`,itemId:ve(I)}),Q});if(W.length===0)return;let{circles:L,enclosing:P}=Vt(W.map(I=>Math.sqrt(_(I))),0),N=P>0?(O-c)/P:0;W.forEach((I,Q)=>{let ke=L[Q],le=k(A+ke.x*N),ce=k(z+ke.y*N),J=Math.max(0,ke.r*N-c/2),de=_(I),U=(I.children?.length??0)>0,ue=I.color??E??fe(e,Q),_t=U?ue:e.colorScale?S.color(de)?.fill??ue:ue,mt=`${I.name}: ${o(de)}`;C.push({kind:"circle",part:U?"branch":"leaf",cx:le,cy:ce,r:k(J),fill:_t,opacity:U?.15:e.colorScale&&!U?S.color(de)?.opacity:void 0,stroke:"var(--skdx-color-surface-default)",title:mt,item:{label:mt,id:ve(I),name:I.name,value:de}}),u&&!U&&J*2>I.name.length*j+4&&$.push(Le(le,ce,I.name,{part:"leaf-label",anchor:"middle",baseline:"middle",fill:"var(--skdx-color-text-on-accent)"})),u&&U&&J*2>I.name.length*j+4&&$.push(Le(le,k(ce-J+10),I.name,{part:"branch-label",anchor:"middle",baseline:"middle"})),U&&m(I.children,le,ce,J,ue)})},g=Math.max(0,Math.min(s,a-l)/2-8);m(r,s/2,l+(a-l)/2,g,void 0);let x=Oe(e,s,a,r.map((y,A)=>({name:y.name,color:fe(e,A,y.color)})));return{...x,shapes:[...C,...$,...x.shapes],issues:n}}import{css as cn,html as Z,LitElement as dn,nothing as T,svg as B}from"lit";import{property as f,state as R}from"lit/decorators.js";import{ifDefined as M}from"lit/directives/if-defined.js";var ft={fromAttribute:()=>!1},b=class extends dn{constructor(){super(...arguments);this.legend=!1;this.tooltip=!0;this.selectionMode="none";this.loading=!1;this.decorative=!1;this.accessibleTable=!1;this.zoomable=!1;this.editable=!1;this.crossFilter=!1;this.animated=!1;this.responsive=!1;this.tip=[];this.overlay=[];this.portal=null;this.highlightState=null;this.crossState=null;this.lastCross=null;this.pointers=new Map;this.hover=null;this.token={};this.focused=null;this.hiddenState=[];this.drag=null;this.onPointerMove=t=>{let r=this.layout;if(!r)return;this.pointers.has(t.pointerId)&&this.pointers.set(t.pointerId,this.viewBox(t,r).x);let i=this.drag;if(i?.grab==="select"){let{x:o,y:s}=this.viewBox(t,r);this.overlay=[Ze(xe(i.x,i.y,o,s))];return}if(i?.grab==="lasso"){let{x:o,y:s}=this.viewBox(t,r);i.points=[...i.points??[],{x:o,y:s}],this.overlay=[We(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=Ke(r,i.gantt,o-i.x),this.overlay=[Ye(r,i.gantt,i.change)];return}if(i?.grab==="map"){if(!r.map||!i.view)return;let{x:o,y:s}=this.viewBox(t,r);this.setView(Qe(r.map,i.view,o-i.x,s-i.y));return}if(i&&r.hit){if(i.grab==="pinch"){let[s,a]=[...this.pointers.values()];if(s===void 0||a===void 0||!i.distance)return;this.setZoom(nt(r.hit,i.zoom,Math.abs(s-a)/i.distance,(s+a)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?rt(r.hit,i.zoom,o-i.x):ot(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=je(r,t.target,t.currentTarget,t.clientX,t.clientY);this.tip=s,this.portal=o.length?{x:t.clientX,y:t.clientY,lines:o}:null}else{let o=He(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Ve(r,t.target)),this.syncId&&r.hit?.crosshair){let o=oe(r,this.viewBox(t,r).x);this.shareCrosshair(o?r.hit.rows[o.index]?.[0]??null:null)}};this.onPointerDown=t=>{let r=this.layout;if(!r||t.button!==0)return;let{x:i,y:o}=this.viewBox(t,r),s=V(r,t.target)?.item.legend,a=this.canEdit(r)?Ue(r,i,o):void 0;if(a){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:a},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:i,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let c=r.map.plot;if(i<c.x||i>c.x+c.width||o<c.y||o>c.y+c.height)return;this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let l=r.hit;if(!(!l||!this.canZoom(r))){if(this.pointers.set(t.pointerId,i),this.pointers.size===2){let[c,u]=[...this.pointers.values()];this.drag={x:(c+u)/2,y:o,zoom:l.zoom,grab:"pinch",distance:Math.abs(c-u)||1}}else{let c=it(l,i,o);if(c)this.drag={x:i,y:o,zoom:c.zoom,grab:c.grab},c.zoom!==l.zoom&&this.setZoom(c.zoom);else if(this.zoomable&&i>=l.plot.x&&i<=l.plot.x+l.plot.width&&o>=l.plot.y&&o<=l.plot.y+l.plot.height)this.drag={x:i,y:o,zoom:l.zoom,grab:"pan"};else{this.pointers.delete(t.pointerId);return}}t.currentTarget.setPointerCapture(t.pointerId),this.clearTip()}};this.onPointerUp=t=>{this.pointers.delete(t.pointerId);let r=t.currentTarget;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId);let i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:s,y:a}=this.viewBox(t,o);if(Math.abs(s-i.x)>2||Math.abs(a-i.y)>2){i.grab==="select"?this.setSelected(_e(o,xe(i.x,i.y,s,a))):i.grab==="lasso"?this.setSelected(Ee(o,i.points??[])):i.grab==="edit"&&i.change&&this.emit("skdx-task-change",i.change),this.drag={...i,distance:-1};return}this.drag=null;return}(this.pointers.size===0||this.drag?.grab==="pinch")&&(this.drag=null)};this.onWheel=t=>{let r=this.layout;if(!r)return;let{x:i,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let l=r.map.plot;if(i<l.x||i>l.x+l.width||o<l.y||o>l.y+l.height)return;t.preventDefault(),this.setView(Xe(r.map,t.deltaY,i,o));return}let s=r.hit;if(!s||!this.canZoom(r)||o<s.plot.y||o>s.plot.y+s.plot.height)return;let a=tt(s,t.deltaY,i);a&&(t.preventDefault(),this.setZoom(a))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=V(this.layout,t.target);r&&(r.item.range?this.setZoom(r.item.range):r.item.legend&&r.item.series!==void 0?this.toggle(r.item.series):(this.select(r.item),this.emit("skdx-item-click",r.item)))};this.onKeyDown=t=>{let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let a=r.shapes[this.focused]?.item;a&&(t.preventDefault(),this.select(a),this.emit("skdx-item-click",a));return}let i=this.canEdit(r)?qe(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=et(r,this.focused,t.key);if(o===void 0)return;t.preventDefault(),this.focused=o;let s=o===null?void 0:r.shapes[o]?.item;this.highlight(s?H(s):null)}}connectedCallback(){super.connectedCallback(),!(typeof ResizeObserver>"u")&&(this.observer=new ResizeObserver(([t])=>{let r=Math.floor(t?.contentRect.width??0);r>0&&(this.measured=r)}),this.observer.observe(this))}disconnectedCallback(){this.observer?.disconnect(),this.leave?.(),this.leave=void 0,this.joined=void 0,super.disconnectedCallback()}sized(){let{width:t,height:r,legend:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:u,description:h,decorative:p,animated:S,responsive:C,highlighted:$,highlightScope:m,accessibleTable:g}=this;return{...typeof C=="object"&&this.measured!==void 0&&this.measured<(C.breakpoint??480)?C.compact:void 0,width:C&&this.measured?this.measured:t,height:r,animate:S,responsive:C,legend:i,tooltip:o,format:s,palette:a,loading:l,error:c,emptyMessage:u,description:h,decorative:p,highlighted:$===void 0?this.highlightState:$,highlightScope:m,accessibleTable:g,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&we(this.syncId).publish(t,this.token)}join(){if(this.joined===this.syncId||(this.leave?.(),this.leave=void 0,this.joined=this.syncId,!this.syncId))return;let t=we(this.syncId),r=i=>{"highlighted"in i&&(this.highlightState=i.highlighted??null),i.selected&&(this.selectedState=i.selected,this.crossFilter&&(this.highlightState=i.selected.length?i.selected:null)),"zoom"in i&&(this.zoomState=i.zoom),i.hiddenSeries&&(this.hiddenState=i.hiddenSeries),"crosshair"in i&&(this.crossState=i.crosshair??null)};r(t.current),this.leave=t.subscribe((i,o)=>{o!==this.token&&r(i)})}setZoom(t){this.zoomState=t,this.emit("skdx-zoom-change",t),this.publish({zoom:t})}setView(t){this.viewState=t,this.emit("skdx-view-change",t)}setSelected(t){this.selectedState=t,this.emit("skdx-selected-change",t),this.publish({selected:t})}toggle(t){let r=this.hiddenSeries??this.hiddenState,i=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=i,this.emit("skdx-hidden-series-change",i),this.publish({hiddenSeries:i})}highlight(t){let r=this.hover;r===t||r&&t&&Ne(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.syncId&&(this.highlightState=t,this.publish({highlighted:t})))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(Be(this.selected??this.selectedState,t,r==="single"?"single":"multiple"))}shareCrosshair(t){!this.syncId||this.lastCross===t||(this.lastCross=t,this.publish({crosshair:t}))}clearTip(){this.tip=[],this.portal=null,this.shareCrosshair(null)}canZoom(t){return!!(t.hit&&(this.zoomable||t.hit.brush))}canPan(t){return!!(t.map&&this.zoomable)}canEdit(t){return!!(this.editable&&t.edit)}brushing(){return this.selectionMode==="brush"||this.selectionMode==="lasso"}viewBox(t,r){return Y(t.currentTarget,t.clientX,t.clientY,r.width,r.height)}getSvgElement(){return this.renderRoot.querySelector("svg")}getLayout(){return this.layout}resetZoom(){this.setZoom(void 0)}zoomTo(t){this.setZoom(t)}focusItem(t){let r=this.layout;if(!r)return!1;let i=r.shapes.findIndex(o=>o.item&&!o.item.legend&&F(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?at(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Re(ze(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let g of o.issues??[])this.emit("skdx-data-issue",g)}let s=this.canZoom(o),a=this.canPan(o),l=this.canEdit(o),c=this.brushing(),u=s||a||l||c,h=!o.decorative&&ye(o).length>0,p=o.description?`${r}-desc`:void 0,S=ht(o),C=ct(o,this.accessibleTable),$=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,m=this.portal;return Z`<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
viewBox="0 0 ${o.width} ${o.height}"
|
|
5
|
+
width=${o.width}
|
|
6
|
+
height=${o.height}
|
|
7
|
+
role=${o.decorative?"presentation":"img"}
|
|
8
|
+
aria-hidden=${o.decorative?"true":T}
|
|
9
|
+
aria-label=${o.decorative?T:i}
|
|
10
|
+
aria-describedby=${M(p)}
|
|
11
|
+
tabindex=${h?0:T}
|
|
12
|
+
data-skdx-chart=${r}
|
|
13
|
+
data-zoomable=${s||a?"":T}
|
|
14
|
+
data-brushing=${c&&!(s||a)?"":T}
|
|
15
|
+
data-editable=${l?"":T}
|
|
16
|
+
style=${S?`--skdx-chart-duration:${S}`:T}
|
|
17
|
+
font-family=${v.fontFamily}
|
|
18
|
+
font-size=${v.fontSize}
|
|
19
|
+
@pointermove=${o.tooltip||u?this.onPointerMove:T}
|
|
20
|
+
@pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
|
|
21
|
+
@pointerdown=${u?this.onPointerDown:T}
|
|
22
|
+
@pointerup=${u?this.onPointerUp:T}
|
|
23
|
+
@pointercancel=${u?this.onPointerUp:T}
|
|
24
|
+
@wheel=${s||a?this.onWheel:T}
|
|
25
|
+
@dblclick=${s||a?()=>a?this.setView(void 0):this.setZoom(void 0):T}
|
|
26
|
+
@click=${this.onClick}
|
|
27
|
+
@keydown=${h?this.onKeyDown:T}
|
|
28
|
+
@blur=${()=>{this.focused=null,this.highlight(null)}}
|
|
29
|
+
>
|
|
30
|
+
<title>${i}</title>
|
|
31
|
+
${o.description?B`<desc id=${M(p)}>${o.description}</desc>`:T}
|
|
32
|
+
${S?B`<style>${ut}</style>`:T} ${un(o)}
|
|
33
|
+
${Me(o.shapes)}
|
|
34
|
+
${Me(this.tip.length||!this.crossState?this.tip:Ge(o,this.crossState))}
|
|
35
|
+
${Me(Je(o,this.focused))} ${Me(this.overlay)}
|
|
36
|
+
</svg>
|
|
37
|
+
${m?Z`<div
|
|
38
|
+
role="tooltip"
|
|
39
|
+
data-skdx-tooltip=${r}
|
|
40
|
+
style="left:${m.x+12}px;top:${m.y+12}px"
|
|
41
|
+
>
|
|
42
|
+
${m.lines.map(g=>Z`<div>${g}</div>`)}
|
|
43
|
+
</div>`:T}
|
|
44
|
+
${C?Z`<table data-skdx-table=${r}>
|
|
45
|
+
<caption>
|
|
46
|
+
${$}
|
|
47
|
+
</caption>
|
|
48
|
+
<thead>
|
|
49
|
+
<tr>
|
|
50
|
+
${(C[0]??[]).map(g=>Z`<th scope="col">${g}</th>`)}
|
|
51
|
+
</tr>
|
|
52
|
+
</thead>
|
|
53
|
+
<tbody>
|
|
54
|
+
${C.slice(1).map(g=>Z`<tr>
|
|
55
|
+
${g.map((x,y)=>y===0?Z`<th scope="row">${x}</th>`:Z`<td>${x}</td>`)}
|
|
56
|
+
</tr>`)}
|
|
57
|
+
</tbody>
|
|
58
|
+
</table>`:T}`}};b.styles=cn`
|
|
59
|
+
:host {
|
|
60
|
+
display: inline-block;
|
|
61
|
+
}
|
|
62
|
+
svg {
|
|
63
|
+
display: block;
|
|
64
|
+
max-width: 100%;
|
|
65
|
+
height: auto;
|
|
66
|
+
outline: none;
|
|
67
|
+
}
|
|
68
|
+
svg[data-zoomable] {
|
|
69
|
+
cursor: grab;
|
|
70
|
+
touch-action: none;
|
|
71
|
+
}
|
|
72
|
+
svg[data-brushing] {
|
|
73
|
+
cursor: crosshair;
|
|
74
|
+
touch-action: none;
|
|
75
|
+
}
|
|
76
|
+
svg[data-editable] {
|
|
77
|
+
touch-action: none;
|
|
78
|
+
}
|
|
79
|
+
:host([responsive]) {
|
|
80
|
+
display: block;
|
|
81
|
+
}
|
|
82
|
+
table {
|
|
83
|
+
position: absolute;
|
|
84
|
+
width: 1px;
|
|
85
|
+
height: 1px;
|
|
86
|
+
margin: -1px;
|
|
87
|
+
padding: 0;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
clip: rect(0 0 0 0);
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
border: 0;
|
|
92
|
+
}
|
|
93
|
+
[role='tooltip'] {
|
|
94
|
+
position: fixed;
|
|
95
|
+
pointer-events: none;
|
|
96
|
+
z-index: 1000;
|
|
97
|
+
background: var(--skdx-color-surface-raised);
|
|
98
|
+
color: var(--skdx-color-text-default);
|
|
99
|
+
border: 1px solid var(--skdx-color-border-strong);
|
|
100
|
+
border-radius: 3px;
|
|
101
|
+
padding: 4px 8px;
|
|
102
|
+
font-family: var(--skdx-font-family);
|
|
103
|
+
font-size: var(--skdx-font-size-xs);
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
}
|
|
106
|
+
[role='tooltip'] > :first-child:not(:only-child) {
|
|
107
|
+
font-weight: bold;
|
|
108
|
+
}
|
|
109
|
+
`,d([f({type:Number})],b.prototype,"width",2),d([f({type:Number})],b.prototype,"height",2),d([f()],b.prototype,"label",2),d([f({type:Boolean,reflect:!0})],b.prototype,"legend",2),d([f({type:Boolean,attribute:"no-tooltip",converter:ft})],b.prototype,"tooltip",2),d([f({attribute:!1})],b.prototype,"format",2),d([f({attribute:!1})],b.prototype,"palette",2),d([f({attribute:!1})],b.prototype,"hiddenSeries",2),d([f({attribute:!1})],b.prototype,"selected",2),d([f({attribute:"selection-mode"})],b.prototype,"selectionMode",2),d([f({attribute:!1})],b.prototype,"highlighted",2),d([f({attribute:!1})],b.prototype,"highlightScope",2),d([f({type:Boolean,reflect:!0})],b.prototype,"loading",2),d([f()],b.prototype,"error",2),d([f({attribute:"empty-message"})],b.prototype,"emptyMessage",2),d([f()],b.prototype,"description",2),d([f({type:Boolean,reflect:!0})],b.prototype,"decorative",2),d([f({type:Boolean,attribute:"accessible-table"})],b.prototype,"accessibleTable",2),d([f({attribute:!1})],b.prototype,"zoom",2),d([f({attribute:!1})],b.prototype,"view",2),d([f({type:Boolean,reflect:!0})],b.prototype,"zoomable",2),d([f({type:Boolean,reflect:!0})],b.prototype,"editable",2),d([f({attribute:"sync-id"})],b.prototype,"syncId",2),d([f({type:Boolean,attribute:"cross-filter"})],b.prototype,"crossFilter",2),d([f({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],b.prototype,"animated",2),d([f({type:Boolean,reflect:!0})],b.prototype,"responsive",2),d([R()],b.prototype,"tip",2),d([R()],b.prototype,"overlay",2),d([R()],b.prototype,"portal",2),d([R()],b.prototype,"measured",2),d([R()],b.prototype,"viewState",2),d([R()],b.prototype,"highlightState",2),d([R()],b.prototype,"crossState",2),d([R()],b.prototype,"focused",2),d([R()],b.prototype,"hiddenState",2),d([R()],b.prototype,"zoomState",2),d([R()],b.prototype,"selectedState",2);var w=class extends b{constructor(){super(...arguments);this.series=[];this.labels=!1;this.connectNulls=!1;this.stacked=!1;this.brush=!1;this.crosshair=!1}input(){let{series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:u,connectNulls:h,nulls:p,stacked:S,stackOffset:C,orientation:$,radius:m,barGap:g,barWidth:x,sort:y,transform:A,transforms:z,bins:O,binWidth:E,binDomain:W,binMode:L,sampling:P,brush:N,crosshair:I}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:a,annotations:l,labels:c,curve:u,connectNulls:h,nulls:p,stacked:S,stackOffset:C,orientation:$,radius:m,barGap:g,barWidth:x,sort:y,transform:A,transforms:z,bins:O,binWidth:E,binDomain:W,binMode:L,sampling:P,brush:N,crosshair:I}}};d([f({attribute:!1})],w.prototype,"series",2),d([f({attribute:!1})],w.prototype,"categories",2),d([f({attribute:!1})],w.prototype,"xAxis",2),d([f({attribute:!1})],w.prototype,"yAxis",2),d([f({attribute:!1})],w.prototype,"rightAxis",2),d([f({attribute:!1})],w.prototype,"references",2),d([f({attribute:!1})],w.prototype,"annotations",2),d([f({type:Boolean,reflect:!0})],w.prototype,"labels",2),d([f()],w.prototype,"curve",2),d([f({type:Boolean,attribute:"connect-nulls"})],w.prototype,"connectNulls",2),d([f()],w.prototype,"nulls",2),d([f({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],w.prototype,"stacked",2),d([f({attribute:"stack-offset"})],w.prototype,"stackOffset",2),d([f()],w.prototype,"orientation",2),d([f({type:Number})],w.prototype,"radius",2),d([f({type:Number,attribute:"bar-gap"})],w.prototype,"barGap",2),d([f({type:Number,attribute:"bar-width"})],w.prototype,"barWidth",2),d([f()],w.prototype,"sort",2),d([f()],w.prototype,"transform",2),d([f({attribute:!1})],w.prototype,"transforms",2),d([f({type:Number})],w.prototype,"bins",2),d([f({type:Number,attribute:"bin-width"})],w.prototype,"binWidth",2),d([f({attribute:!1})],w.prototype,"binDomain",2),d([f({attribute:"bin-mode"})],w.prototype,"binMode",2),d([f({attribute:!1})],w.prototype,"sampling",2),d([f({type:Boolean,reflect:!0})],w.prototype,"brush",2),d([f({type:Boolean,reflect:!0})],w.prototype,"crosshair",2);var un=e=>e.defs&&e.defs.length?B`<defs>${e.defs.map(n=>B`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>B`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${M(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:T,Me=e=>B`${e.map((n,t)=>{let r=n.title?B`<title>${n.title}</title>`:T,i=n.item?t:void 0;switch(n.kind){case"path":return B`<path data-skdx-part=${n.part} data-skdx-i=${M(i)} d=${n.d} fill=${n.fill??"none"} stroke=${M(n.stroke)} stroke-width=${M(n.strokeWidth)} stroke-linecap=${M(n.strokeLinecap)} stroke-linejoin=${M(n.strokeLinejoin)} stroke-dasharray=${M(n.dash)} opacity=${M(n.opacity)} fill-opacity=${M(n.fillOpacity)}>${r}</path>`;case"rect":return B`<rect data-skdx-part=${n.part} data-skdx-i=${M(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${M(n.rx)} fill=${n.fill} stroke=${M(n.stroke)} fill-opacity=${M(n.opacity)}>${r}</rect>`;case"line":return B`<line data-skdx-part=${n.part} data-skdx-i=${M(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${M(n.strokeWidth)} stroke-dasharray=${M(n.dash)} opacity=${M(n.opacity)}>${r}</line>`;case"circle":return B`<circle data-skdx-part=${n.part} data-skdx-i=${M(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${M(n.stroke)} opacity=${M(n.opacity)}>${r}</circle>`;case"text":return B`<text data-skdx-part=${n.part} data-skdx-i=${M(i)} x=${n.x} y=${n.y} text-anchor=${M(n.anchor)} dominant-baseline=${M(n.baseline)} fill=${M(n.fill)} font-weight=${M(n.weight)} pointer-events=${M(i===void 0?"none":void 0)} transform=${M(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var D=class extends b{constructor(){super(...arguments);this.data=[];this.labels=!0}render(){let{data:t,rootId:r,maxDepth:i,labels:o,padding:s,colorScale:a}=this;return this.root(pt({...this.sized(),data:t,rootId:r,maxDepth:i,labels:o,padding:s,colorScale:a}),"circle-packing",this.label??"Circle packing chart")}};d([X({attribute:!1})],D.prototype,"data",2),d([X({attribute:!1})],D.prototype,"rootId",2),d([X({type:Number,attribute:"max-depth"})],D.prototype,"maxDepth",2),d([X({type:Boolean,attribute:"no-labels",converter:ft})],D.prototype,"labels",2),d([X({type:Number})],D.prototype,"padding",2),d([X({attribute:!1})],D.prototype,"colorScale",2),D=d([hn("skdx-circle-packing-chart")],D);export{D as SkdxCirclePackingChart};
|
package/dist/combo.cjs
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";var Ye=Object.defineProperty;var Un=Object.getOwnPropertyDescriptor;var Zr=Object.getOwnPropertyNames;var Er=Object.prototype.hasOwnProperty;var Wr=(e,n)=>{for(var t in n)Ye(e,t,{get:n[t],enumerable:!0})},Ur=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Zr(n))!Er.call(e,i)&&i!==t&&Ye(e,i,{get:()=>n[i],enumerable:!(r=Un(n,i))||r.enumerable});return e};var Kr=e=>Ur(Ye({},"__esModule",{value:!0}),e),M=(e,n,t,r)=>{for(var i=r>1?void 0:r?Un(n,t):n,o=e.length-1,s;o>=0;o--)(s=e[o])&&(i=(r?s(n,t,i):s(i))||i);return r&&i&&Ye(n,t,i),i};var Li={};Wr(Li,{SkdxComboChart:()=>_e});module.exports=Kr(Li);var Vr=require("lit/decorators.js");var Kn=e=>Number(e.toPrecision(12)),qr,qn=e=>(qr??(qr=new Intl.NumberFormat)).format(Kn(e)),Yr=e=>{let n=Math.round(Math.abs(e)),t=e<0?"-":"",r=Math.floor(n/3600),i=Math.floor(n%3600/60),o=s=>String(s).padStart(2,"0");return r>0?`${t}${r}h ${o(i)}m`:i>0?`${t}${i}m ${o(n%60)}s`:`${t}${n}s`};function ve(e){if(e===void 0)return qn;if(typeof e=="function")return e;let{style:n,locale:t,digits:r,unit:i="",timeZone:o}=e,s=u=>i?h=>u(h)+i:u,l=u=>r===void 0?u===void 0?{}:{maximumFractionDigits:u}:{minimumFractionDigits:r,maximumFractionDigits:r},c=u=>{let h=new Intl.NumberFormat(t,u);return s(b=>h.format(Kn(b)))},d=u=>{let h=new Intl.DateTimeFormat(t,o?{...u,timeZone:o}:u);return b=>h.format(b)};switch(n){case"integer":return c({maximumFractionDigits:0});case"decimal":return c(l(2));case"percent":return c({style:"percent",...l(0)});case"currency":return c({style:"currency",currency:e.currency??"USD",...l()});case"compact":return c({notation:"compact",...l(1)});case"scientific":return c({notation:"scientific",...l(2)});case"date":return d({dateStyle:"medium"});case"time":return d({timeStyle:"short"});case"datetime":return d({dateStyle:"medium",timeStyle:"short"});case"duration":return s(Yr)}}function Xe(e,n){if(typeof e=="string")return e;let t=e instanceof Date?e.getTime():e;return n?ve(n)(t):e instanceof Date?new Intl.DateTimeFormat().format(e):qn(t)}var ie=e=>{if(e instanceof Date)return e.getTime();if(typeof e=="number")return e;let n=Number(e);return Number.isFinite(n)&&e.trim()!==""?n:Date.parse(e)};function we([e,n],[t,r]){let i=n-e;return o=>i===0?t:t+(o-e)/i*(r-t)}function pe(e,n,t=5){if(e===n)return[e];let r=(n-e)/Math.max(1,t),i=10**Math.floor(Math.log10(r)),o=r/i,s=(o<1.5?1:o<3.5?2:o<7.5?5:10)*i,l=Math.floor(e/s)*s,c=Math.ceil(n/s)*s,d=[];for(let u=l;u<=c+s/2;u+=s)d.push(Xn(u));return d}function Yn(e,[n,t],r=.2){let i=e===0?0:(t-n)/e,o=i*(1-Math.max(0,Math.min(.9,r)));return{step:i,bandwidth:o,start:s=>n+s*i+(i-o)/2,center:s=>n+(s+.5)*i}}var Xn=e=>Number(e.toPrecision(12)),m=e=>Number(e.toFixed(2)),I=e=>typeof e=="number"&&Number.isFinite(e),oe=e=>e.filter(I);function se(e){let n=1/0,t=-1/0;for(let r of e)I(r)&&(r<n&&(n=r),r>t&&(t=r));return n===1/0?[0,0]:[n,t]}function be(e,n="linear"){if(e.length===0)return"";let t=e[0];if(n==="step"||n==="stepBefore"||n==="stepAfter"){let d=`M${t.x} ${t.y}`;for(let u=1;u<e.length;u++){let h=e[u-1],b=e[u];n==="stepAfter"?d+=`H${b.x}V${b.y}`:n==="stepBefore"?d+=`V${b.y}H${b.x}`:d+=`H${m((h.x+b.x)/2)}V${b.y}H${b.x}`}return d}if(n==="linear"||e.length<3)return`M${e.map(d=>`${d.x} ${d.y}`).join("L")}`;let r=e.length,i=e.slice(1).map((d,u)=>d.x-e[u].x),o=e.slice(1).map((d,u)=>d.y-e[u].y),s=i.map((d,u)=>d===0?0:o[u]/d),l=[s[0]];for(let d=1;d<r-1;d++){let u=s[d-1],h=s[d];l.push(u*h<=0?0:(u+h)/2)}l.push(s[r-2]);for(let d=0;d<r-1;d++){let u=s[d];if(u===0){l[d]=0,l[d+1]=0;continue}let h=l[d]/u,b=l[d+1]/u,y=Math.hypot(h,b);y>3&&(l[d]=3*h*u/y,l[d+1]=3*b*u/y)}let c=`M${t.x} ${t.y}`;for(let d=0;d<r-1;d++){let u=e[d],h=e[d+1],b=i[d]/3;c+=`C${m(u.x+b)} ${m(u.y+b*l[d])} ${m(h.x-b)} ${m(h.y-b*l[d+1])} ${h.x} ${h.y}`}return c}var Le=1e3,Re=60*Le,Ve=60*Re,Be=24*Ve,Xr=[Le,5*Le,15*Le,30*Le,Re,5*Re,15*Re,30*Re,Ve,3*Ve,6*Ve,12*Ve,Be,2*Be,7*Be,14*Be];function Qn(e,n,t=6){if(!(n>e))return[e];let r=n-e,i=Xr.find(h=>r/h<=t),o=[];if(i!==void 0){for(let h=Math.ceil(e/i)*i;h<=n;h+=i)o.push(h);return o.length?o:[e,n]}let s=r/(30*Be),l=[1,2,3,6,12,24,60,120].find(h=>s/h<=t)??240,c=new Date(e),d=c.getUTCFullYear(),u=Math.ceil((c.getUTCMonth()+(c.getUTCDate()>1?1:0))/l)*l;for(let h=Date.UTC(d,u,1);h<=n;)o.push(h),u+=l,u>=12&&(d+=Math.floor(u/12),u%=12),h=Date.UTC(d,u,1);return o.length?o:[e,n]}function Jn(e,n){let t=Math.floor(Math.log10(e)),r=Math.ceil(Math.log10(n)),i=r-t<=1?[1,2,5]:[1],o=[];for(let s=t;s<=r;s++)for(let l of i)o.push(Xn(l*10**s));return o.filter(s=>s>=e/1.0001&&s<=n*1.0001)}function Qe(e,n={}){if(n.thresholds&&n.thresholds.length>=2)return[...n.thresholds].filter(Number.isFinite).sort((c,d)=>c-d);let[t,r]=n.domain??se(e),i=Math.max(1,e.length),o=Math.max(1,n.bins??Math.ceil(Math.log2(i)+1)),s=n.binWidth??(r>t?(r-t)/o:1),l=r>t?Math.max(1,Math.ceil((r-t)/s-1e-9)):1;return Array.from({length:l+1},(c,d)=>Number((t+d*s).toPrecision(12)))}function Je(e,n){let t=[];for(let o=0;o+1<n.length;o++)t.push({x0:n[o],x1:n[o+1],count:0});if(t.length===0)return t;let r=n[0],i=n[n.length-1];for(let o of oe(e)){if(o<r||o>i)continue;let s=0,l=t.length-1;for(;s<l;){let c=s+l+1>>1;t[c].x0<=o?s=c:l=c-1}t[s].count++}return t}var Qr=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi,Jr=/([MLTHVCSQAZmlthvcsqaz])([^MLTHVCSQAZmlthvcsqaz]*)/g,ei={M:2,L:2,T:2,C:6,S:4,Q:4,A:7,H:-1,V:-2};function ti(e,n,t){return e.replace(Jr,(r,i,o)=>{let s=ei[i];if(s===void 0)return i+o;let c=(o.match(Qr)??[]).map((d,u)=>{let h=Number(d);if(s===-1)return String(h+n);if(s===-2)return String(h+t);let b=u%s;return s===7?b===5?String(h+n):b===6?String(h+t):d:String(b%2===0?h+n:h+t)});return i+c.join(" ")})}var er=(e,n,t)=>e.map(r=>{switch(r.kind){case"rect":return{...r,x:r.x+n,y:r.y+t};case"circle":return{...r,cx:r.cx+n,cy:r.cy+t};case"line":return{...r,x1:r.x1+n,x2:r.x2+n,y1:r.y1+t,y2:r.y2+t};case"text":return{...r,x:r.x+n,y:r.y+t};case"path":return{...r,d:ti(r.d,n,t)}}});var Tt=["primary","success","warning","danger","neutral"].flatMap(e=>[500,700].map(n=>`var(--skdx-color-${e}-${n})`)).sort((e,n)=>Number(e.endsWith("700)"))-Number(n.endsWith("700)"))),V={axis:"var(--skdx-color-border-strong)",grid:"var(--skdx-color-border-subtle)",label:"var(--skdx-color-text-muted)",focus:"var(--skdx-color-focus-ring)",positive:"var(--skdx-color-success-500)",negative:"var(--skdx-color-danger-500)",fontFamily:"var(--skdx-font-family)",fontSize:"var(--skdx-font-size-xs)"},et=(e="neutral")=>e==="neutral"?V.axis:`var(--skdx-color-${e}-500)`,At=(e="neutral")=>e==="neutral"?V.label:e==="primary"?"var(--skdx-color-text-accent)":`var(--skdx-color-text-${e})`,tr=(e,n)=>n??Tt[e%Tt.length];var ee={top:16,right:16,bottom:32,left:48};function nr(e,n,t=ee){return{x:t.left,y:t.top,width:Math.max(0,e-t.left-t.right),height:Math.max(0,n-t.top-t.bottom)}}function Pe(e){let n=e.legend;if(n)return n===!0?{}:n.enabled===!1?void 0:n}function Ot(e){let n=e.tooltip;return n===void 0||n===!0?{enabled:!0}:n===!1?{enabled:!1}:{...n,enabled:n.enabled??!0}}var rr=e=>e.crosshair===!0||Ot(e).trigger==="axis",tt=20,ni=120,ir=e=>{let n=Pe(e);return n&&(n.position==="left"||n.position==="right")?n.width??ni:0},Lt=(e,n=600,t=300)=>({width:(e.width??n)-ir(e),height:(e.height??t)-(Pe(e)?.position==="bottom"?tt:0)}),or=e=>{let n=Pe(e);return n&&(n.position===void 0||n.position==="top")?tt:0},ae=6.5,sr=(e,n,t)=>t??(e.palette&&e.palette.length>0?e.palette[n%e.palette.length]:tr(n)),ar=(e,n)=>e.hiddenSeries?.includes(n)??!1;function zt(e,n,t=[],r={},i=10,o=8,s=!1){let l=[],c=r.maxItems,d=c!==void 0&&c>=0&&e.length>c?e.slice(0,c):e,u=e.length-d.length,h=r.interactive??!0,b=o,y=i,x=(p,S,v,f)=>{let w=(S?18:4)+p.length*ae;b>o&&(s||b+w>n-8)&&(b=o,y+=tt),S&&l.push({kind:"rect",part:"legend-swatch",x:b,y:y-5,width:10,height:10,fill:S,opacity:f?.3:void 0,item:v}),l.push({kind:"text",part:"legend-label",x:b+(S?14:0),y,text:p,baseline:"middle",fill:f?V.grid:V.label,item:v}),b+=w+12};for(let p of d){let S=t.includes(p.name),v=h?{label:p.name,series:p.name,legend:!0}:void 0;x(r.formatter?.(p.name)??p.name,p.color,v,S)}return u>0&&x(`+${u} more`,void 0,void 0,!1),r.align==="end"?ri(l,n):l}function ri(e,n){let t=new Map;for(let i of e){let o=i.kind==="rect"?i.y+5:i.y;t.set(o,[...t.get(o)??[],i])}let r=[];for(let i of t.values()){let o=Math.max(...i.map(l=>l.kind==="rect"?l.x+l.width:l.x+l.text.length*ae)),s=n-8-o;for(let l of i)r.push({...l,x:l.x+s})}return r}var ii=(e,n,t={})=>new Set(zt(e,n,[],t).flatMap(r=>r.kind==="text"?[r.y]:[])).size;function Rt(e,n,t,r=[]){let i=Pe(e),o=i&&e.direction==="rtl"&&i.align===void 0?{...i,align:"end"}:i,s=Ot(e),l=o?.position==="bottom",c=ir(e),d=e.hiddenSeries??[],u=o?c?zt(r,1/0,d,o,10,(o.position==="right"?n:0)+8,!0):zt(r,n,d,o,l?t+10:10):[],h=l?ii(r,n,o):0;return{width:n+c,height:l?t+Math.max(1,h)*tt:t,legendOffset:o?.position==="left"?c:void 0,tooltip:s.enabled,tooltipFormatter:s.formatter,axisTooltipFormatter:s.axisFormatter,tooltipPortal:s.portal,tooltipPlacement:s.placement,tooltipAnchored:s.followPointer===!1?!0:void 0,description:e.description,decorative:e.decorative,animate:e.animate===!0?300:e.animate||void 0,responsive:!!e.responsive,shapes:u}}function Vt(e){let n=e.legendOffset;if(!n)return e;let t=[...er(e.shapes.filter(c=>!c.part.startsWith("legend-")),n,0),...e.shapes.filter(c=>c.part.startsWith("legend-"))],r=c=>({...c,x:c.x+n}),i=e.hit?{...e.hit,plot:r(e.hit.plot),xs:e.hit.xs.map(c=>c+n),brush:e.hit.brush?{box:r(e.hit.brush.box),window:r(e.hit.brush.window)}:void 0}:void 0,o=e.edit,s=o?{...o,scale:c=>o.scale(c)+n,invert:c=>o.invert(c-n),bars:o.bars.map(c=>({...c,x0:c.x0+n,x1:c.x1+n}))}:void 0,l=e.map?{...e.map,plot:r(e.map.plot)}:void 0;return{...e,shapes:t,hit:i,edit:s,map:l,legendOffset:void 0}}function nt(e,n,t,r,i,o="auto"){let s=Array.isArray(t)?t:[t],l=Math.max(...s.map(b=>b.length))*ae+12,c=6+s.length*16,d=o==="top"?{x:e-l/2,y:n-c-8}:o==="bottom"?{x:e-l/2,y:n+8}:o==="left"?{x:e-l-8,y:n-c/2}:o==="right"?{x:e+8,y:n-c/2}:{x:e+12,y:n-c-6},u=Math.max(0,Math.min(r-l,d.x)),h=Math.max(0,Math.min(i-c,d.y));return[{kind:"rect",part:"tooltip",x:m(u),y:m(h),width:m(l),height:c,fill:"var(--skdx-color-surface-raised)",stroke:V.axis,rx:3},...s.map((b,y)=>({kind:"text",part:"tooltip-label",x:m(u+6),y:m(h+11+y*16),text:b,baseline:"middle",fill:"var(--skdx-color-text-default)",weight:s.length>1&&y===0?"bold":void 0}))]}function lr([e,n],t,r=!1,i){let o=typeof r=="boolean"?{scale:r?"log":"linear"}:r,s=ve(o.format??i),l=o.min??e,c=o.max??n;o.reversed&&(t=[t[1],t[0]]);let d={id:o.id,position:o.position,options:o};if(o.scale==="sqrt"){let p=z=>Math.sign(z)*Math.sqrt(Math.abs(z)),S=o.nice===!1?[l,c]:pe(l,c,o.ticks),v=o.min??S[0],f=o.max??S[S.length-1],w=we([p(v),p(f)],t),A=z=>w(p(z)),k=pe(v,f,o.ticks).filter(z=>z>=v-1e-9&&z<=f+1e-9);return{...d,scale:A,domain:[v,f],format:s,ticks:(k.length>=2?k:[v,f]).map(z=>({pos:m(A(z)),label:s(z)})),zero:m(A(Math.min(Math.max(0,v),f)))}}if(o.scale==="log"){let p=Math.max(l,Number.EPSILON),S=Math.max(c,p),v=Jn(p,S),f=[Math.log10(p),Math.log10(S)],w=we(f,t),A=k=>w(Math.log10(Math.max(k,Number.EPSILON)));return{...d,scale:A,domain:f,format:s,ticks:v.map(k=>({pos:m(A(k)),label:s(k)})),zero:m(t[0])}}let u=pe(l,c,o.ticks),h=[o.min??(o.nice===!1?l:u[0]),o.max??(o.nice===!1?c:u[u.length-1])],b=we(h,t),y=u.filter(p=>p>=h[0]-1e-9&&p<=h[1]+1e-9),x=(y.length>=2?y:[h[0],h[1]]).map(p=>({pos:m(b(p)),label:s(p)}));return{...d,scale:b,domain:h,format:s,ticks:x,zero:m(b(Math.min(Math.max(0,h[0]),h[1])))}}var cr=e=>e?.grid!==!1;function rt(e,n){if(e.length<2)return e;let t=e.reduce((i,o)=>Math.max(i,o.label.length),0)*ae+8,r=Math.max(1,Math.ceil(e.length*t/Math.max(1,n)));return r===1?e:e.filter((i,o)=>o%r===0)}var Bt=(e,n,t,r)=>`${e}, ${n}: ${r(t)}`;function dr(e,n,t,r){let i=e.error!==void 0?"error":e.loading?"loading":n?"empty":null;if(!i)return null;let{width:o,height:s}=Lt(e,t,r),l=i==="error"?e.error:i==="loading"?"Loading\u2026":e.emptyMessage??"No data available",c=[];return i==="loading"&&c.push({kind:"rect",part:"skeleton",x:0,y:0,width:o,height:s,fill:"var(--skdx-color-surface-sunken)",rx:4}),c.push({kind:"text",part:`state-${i}`,x:m(o/2),y:m(s/2),text:l,anchor:"middle",baseline:"middle",fill:i==="error"?"var(--skdx-color-text-danger)":V.label}),{...Rt(e,o,s),shapes:c,tooltip:!1}}function Pt(e,n={}){let{plot:t,xTicks:r,yTicks:i,baseline:o}=e,s=t.x+t.width,l=t.y+t.height,c=[],d=n.grid??!0,u=(x,p)=>p?{kind:"line",part:"grid",x1:x.pos,x2:x.pos,y1:t.y,y2:l,stroke:V.grid}:{kind:"line",part:"grid",x1:t.x,x2:s,y1:x.pos,y2:x.pos,stroke:V.grid},h=n.x?.tickRotation??0,b=(x,p,S,v)=>h?Y(x,p,S,{part:v,anchor:h<0?"end":"start",baseline:"middle",rotate:h}):Y(x,p,S,{part:v,anchor:"middle"}),y=(x,p,S,v,f)=>{for(let w of x)c.push(p==="x"?{kind:"line",part:"tick",x1:w.pos,x2:w.pos,y1:S,y2:m(S+v*f),stroke:V.axis}:{kind:"line",part:"tick",x1:S,x2:m(S+v*f),y1:w.pos,y2:w.pos,stroke:V.axis})};if(n.categoryGrid)for(let x of r)c.push(u(x,!n.horizontal));if(n.horizontal){let x=n.axes??[{ticks:i,position:"bottom",offset:0,label:n.yLabel,...n.y}];if(d)for(let p of i)c.push(u(p,!0));x[0]?.showLine!==!1&&c.push({kind:"line",part:"axis",x1:o,x2:o,y1:t.y,y2:l,stroke:V.axis});for(let p of x){let S=p.position==="top"||p.position==="right",v=m(S?t.y-p.offset:l+p.offset),f=S||p.offset>0;p.showLine&&f&&c.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:v,y2:v,stroke:V.axis}),p.showTicks&&y(p.ticks,"x",v,S?-1:1,p.tickSize??4);let w=m(S?v-8:v+20);for(let A of p.ticks)c.push(S?Y(A.pos,w,A.label,{part:"x-label-top",anchor:"middle"}):b(A.pos,w,A.label,"x-label"));p.label&&c.push(f?Y(4,w,p.label,{part:"axis-title",anchor:"start",baseline:S?void 0:"middle"}):Y(4,t.y-6,p.label,{part:"axis-title",anchor:"start"}))}n.x?.showLine&&c.push({kind:"line",part:"axis",x1:n.rtl?s:t.x,x2:n.rtl?s:t.x,y1:t.y,y2:l,stroke:V.axis}),n.x?.showTicks&&y(r,"y",n.rtl?s:t.x,n.rtl?1:-1,n.x.tickSize??4);for(let p of r)c.push(n.rtl?Y(s+8,p.pos,p.label,{part:"y-label",anchor:"start",baseline:"middle"}):Y(t.x-8,p.pos,p.label,{part:"y-label",anchor:"end",baseline:"middle"}))}else{if(d)for(let p of i)c.push(u(p,!1));n.y?.showLine!==!1&&c.push({kind:"line",part:"axis",x1:t.x,x2:s,y1:o,y2:o,stroke:V.axis});let x=n.axes??[{ticks:i,position:"left",offset:0,label:n.yLabel,...n.y},...n.rightTicks?[{ticks:n.rightTicks,position:"right",offset:0,label:n.rightLabel}]:[]];for(let p of x){let S=p.position==="left",v=S?t.x-p.offset:s+p.offset,f=S?"y-label":"y-label-right";p.showLine&&c.push({kind:"line",part:"axis",x1:m(v),x2:m(v),y1:t.y,y2:l,stroke:V.axis}),p.showTicks&&y(p.ticks,"y",m(v),S?-1:1,p.tickSize??4);for(let w of p.ticks)c.push(Y(m(S?v-8:v+8),w.pos,w.label,{part:f,anchor:S?"end":"start",baseline:"middle"}));p.label&&c.push(Y(m(S?p.offset===0?4:Math.max(4,v-40):p.offset===0?e.width-4:Math.min(e.width-4,v+40)),t.y-6,p.label,{part:"axis-title",anchor:S?"start":"end"}))}n.x?.showTicks&&y(r,"x",l,1,n.x.tickSize??4);for(let p of r)c.push(b(p.pos,l+(h?12:20),p.label,"x-label"))}return n.xLabel&&c.push(Y(m(t.x+t.width/2),e.height-4,n.xLabel,{part:"axis-title",anchor:"middle"})),n.horizontal&&n.rightLabel&&c.push(Y(e.width-4,t.y-6,n.rightLabel,{part:"axis-title",anchor:"end"})),c}var Y=(e,n,t,r={})=>({kind:"text",part:"label",x:e,y:n,text:t,fill:V.label,...r}),De=(e,n,t,r,i,o)=>({kind:"circle",part:"point",cx:e,cy:n,r:t,fill:r,title:i,item:o});function Dt(e,n){let t=[],{plot:r}=n,i=r.x+r.width,o=r.y+r.height,s=c=>Math.max(r.x,Math.min(i,c)),l=c=>Math.max(r.y,Math.min(o,c));for(let c of e??[]){let d=c.color??et(c.variant),u=c.color??At(c.variant),h={part:"reference-label",fill:u},b=n.horizontal===!0;if("y"in c){let y=m(n.y(c.y,c.axis??"left"));if(b){let x=s(y);t.push(...hr(x,r.y,o,d,c.label,h))}else{let x=l(y);t.push(...ur(r.x,i,x,d,c.label,h))}}else if("x"in c){let y=n.x(c.x);if(y===void 0)continue;b?t.push(...ur(r.x,i,l(m(y)),d,c.label,h)):t.push(...hr(s(m(y)),r.y,o,d,c.label,h))}else if("y1"in c){let y=m(n.y(c.y1,c.axis??"left")),x=m(n.y(c.y2,c.axis??"left"));b?t.push(...mr(s(Math.min(y,x)),s(Math.max(y,x)),r,d,c.label,u)):t.push(...fr(l(Math.min(y,x)),l(Math.max(y,x)),r,d,c.label,u))}else{let y=n.x(c.x1),x=n.x(c.x2);if(y===void 0||x===void 0)continue;let p=m(Math.min(y,x)),S=m(Math.max(y,x));b?t.push(...fr(l(p),l(S),r,d,c.label,u)):t.push(...mr(s(p),s(S),r,d,c.label,u))}}return t}function ur(e,n,t,r,i,o){let s={kind:"line",part:"reference",x1:e,x2:n,y1:t,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:i};return i?[s,Y(n-4,t-5,i,{...o,anchor:"end"})]:[s]}function hr(e,n,t,r,i,o){let s={kind:"line",part:"reference",x1:e,x2:e,y1:n,y2:t,stroke:r,dash:"6 4",strokeWidth:1.5,title:i};return i?[s,Y(e+4,n+10,i,{...o,anchor:"start"})]:[s]}function fr(e,n,t,r,i,o){let s={kind:"rect",part:"reference-area",x:t.x,y:e,width:t.width,height:m(Math.max(0,n-e)),fill:r,opacity:.12,title:i};return i?[s,Y(t.x+t.width-4,e+12,i,{part:"reference-label",fill:o,anchor:"end"})]:[s]}function mr(e,n,t,r,i,o){let s={kind:"rect",part:"reference-area",x:e,y:t.y,width:m(Math.max(0,n-e)),height:t.height,fill:r,opacity:.12,title:i};return i?[s,Y(e+4,t.y+12,i,{part:"reference-label",fill:o,anchor:"start"})]:[s]}function pr(e,n){let t=[],{plot:r}=n,i=r.x+r.width,o=r.y+r.height;for(let s of e??[]){let l=s.color??et(s.variant),c=s.color??At(s.variant),d=(x,p,S)=>{let v=n.x(x);if(v===void 0)return;let f=n.y(p,S??"left");return n.horizontal?{x:m(f),y:m(v)}:{x:m(v),y:m(f)}},u=s.id??s.label,h=x=>({label:x,id:u,name:s.label});if(s.type==="line"||s.type==="band"){let{type:x,id:p,...S}=s;t.push(...Dt([S],n));continue}if(s.type==="rect"){let x=d(s.x1,s.y1,s.axis),p=d(s.x2,s.y2,s.axis);if(!x||!p)continue;let S=Math.max(r.x,Math.min(x.x,p.x)),v=Math.max(r.y,Math.min(x.y,p.y)),f=s.label??"";t.push({kind:"rect",part:"annotation-rect",x:m(S),y:m(v),width:m(Math.max(0,Math.min(i,Math.max(x.x,p.x))-S)),height:m(Math.max(0,Math.min(o,Math.max(x.y,p.y))-v)),fill:l,opacity:.12,stroke:l,title:f||void 0,item:f?h(f):void 0}),s.label&&t.push(Y(m(S+4),m(v+12),s.label,{part:"annotation-label",fill:c}));continue}let b=d(s.x,s.y,s.axis);if(!b)continue;if(s.type==="text"){t.push(Y(b.x,b.y,s.text,{part:"annotation-text",fill:c,anchor:"middle",baseline:"middle",title:s.label}));continue}let y=s.label??`${String(s.x)}, ${s.y}`;if(t.push({kind:"circle",part:"annotation-point",cx:b.x,cy:b.y,r:5,fill:l,stroke:"var(--skdx-color-surface-default)",title:y,item:h(y)}),s.type==="callout"&&s.label){let[x,p]=s.offset??[16,-16],S=m(Math.max(r.x,Math.min(i,b.x+x))),v=m(Math.max(r.y,Math.min(o,b.y+p)));t.push({kind:"line",part:"annotation-leader",x1:b.x,y1:b.y,x2:S,y2:v,stroke:l},Y(S,v,s.label,{part:"annotation-label",fill:c,anchor:x>=0?"start":"end",baseline:"middle"}))}}return t}var Nt=2e3;function oi(e){if(e!=="none")return e===void 0||e==="auto"?{strategy:"lttb",threshold:Nt}:typeof e=="string"?{strategy:e,threshold:Nt}:{strategy:e.strategy,threshold:e.threshold??Nt}}function si(e,n){let t=e.length;if(n>=t||n<3)return e.map((l,c)=>c);let r=[0],i=[],o=(t-2)/(n-2),s=0;for(let l=0;l<n-2;l++){let c=Math.floor((l+1)*o)+1,d=Math.min(t-1,Math.floor((l+2)*o)+1),u=0,h=0,b=0;for(let w=c;w<d;w++){let A=e[w];I(A)&&(u+=w,h+=A,b++)}u=b?u/b:(c+d)/2,h=b?h/b:0;let y=Math.floor(l*o)+1,x=Math.min(t-1,Math.floor((l+1)*o)+1),p=e[s],S=I(p)?p:0,v=-1,f=-1;for(let w=y;w<x;w++){let A=e[w];if(!I(A)){i.push(w);continue}let k=Math.abs((s-u)*(A-S)-(s-w)*(h-S));k>f&&(f=k,v=w)}v<0&&(v=y),r.push(v),s=v}return r.push(t-1),i.length?[...new Set([...r,...i])].sort((l,c)=>l-c):r}function ai(e,n){let t=e.length,r=Math.max(1,Math.floor(n/2));if(r*2>=t)return e.map((s,l)=>l);let i=[],o=t/r;for(let s=0;s<r;s++){let l=Math.floor(s*o),c=s===r-1?t:Math.floor((s+1)*o),d=-1,u=-1;for(let h=l;h<c;h++){let b=e[h];if(!I(b)){i.push(h);continue}(d<0||b<e[d])&&(d=h),(u<0||b>e[u])&&(u=h)}d>=0&&i.push(Math.min(d,u)),u>=0&&u!==d&&i.push(Math.max(d,u))}return[...new Set(i)].sort((s,l)=>s-l)}function li(e,n){let t=e.length,r=Math.max(1,Math.floor(n/4));if(r*4>=t)return e.map((s,l)=>l);let i=[],o=t/r;for(let s=0;s<r;s++){let l=Math.floor(s*o),c=s===r-1?t:Math.floor((s+1)*o),d=-1,u=-1,h=-1,b=-1;for(let y=l;y<c;y++){let x=e[y];if(!I(x)){i.push(y);continue}h<0&&(h=y),b=y,(d<0||x<e[d])&&(d=y),(u<0||x>e[u])&&(u=y)}for(let y of[h,d,u,b])y>=0&&i.push(y)}return[...new Set(i)].sort((s,l)=>s-l)}function br(e,n,t){let r=oi(t);if(!r||n<=r.threshold||e.length===0)return;let i=r.strategy==="minmax"?ai:r.strategy==="m4"?li:si,o=new Set;for(let s of e)for(let l of i(s.slice(0,n),r.threshold))o.add(l);return[...o].sort((s,l)=>s-l)}function gr(e,n,t,r,i,o,s,l){if(r==="circle")return{...De(e,n,t,i,o,s),part:l};let c=r==="square"?`M${m(e-t)} ${m(n-t)}h${m(2*t)}v${m(2*t)}h${m(-2*t)}Z`:r==="diamond"?`M${m(e)} ${m(n-t*1.3)}L${m(e+t*1.3)} ${m(n)}L${m(e)} ${m(n+t*1.3)}L${m(e-t*1.3)} ${m(n)}Z`:`M${m(e)} ${m(n-t*1.2)}L${m(e+t*1.15)} ${m(n+t*.9)}L${m(e-t*1.15)} ${m(n+t*.9)}Z`;return{kind:"path",part:l,d:c,fill:i,title:o,item:s}}var ci=e=>{let n=0;return e.map(t=>I(t)?n+=t:null)},di=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&I(n)&&I(r)?n-r:null}),ui=e=>e.map((n,t)=>{let r=e[t-1];return t>0&&I(n)&&I(r)&&r!==0?(n-r)/Math.abs(r):null});function hi(e,n){let t=Math.max(1,Math.floor(n));return e.map((r,i)=>{if(i<t-1)return null;let o=0;for(let s=i-t+1;s<=i;s++){let l=e[s];if(!I(l))return null;o+=l}return o/t})}function fi(e,n="max"){let t=0;for(let r of e)I(r)&&(t=n==="sum"?t+r:Math.max(t,r));return e.map(r=>I(r)?t===0?0:r/t:null)}function mi(e,n="desc"){let t=e.filter(I).sort((r,i)=>n==="asc"?r-i:i-r);return e.map(r=>I(r)?t.indexOf(r)+1:null)}var pi=(e,n=-1/0,t=1/0)=>e.map(r=>I(r)&&r>=n&&r<=t?r:null),bi=(e,n="asc")=>[...e].sort((t,r)=>I(t)?I(r)?n==="asc"?t-r:r-t:-1:I(r)?1:0);function gi(e,n,t="sum"){let r=Math.max(1,Math.floor(n)),i=[];for(let o=0;o<e.length;o+=r){let s=e.slice(o,o+r).filter(I);if(s.length===0){i.push(null);continue}let l=s.reduce((c,d)=>c+d,0);i.push(t==="sum"?l:t==="mean"?l/s.length:t==="min"?Math.min(...s):Math.max(...s))}return i}function xi(e,n={}){let t=e.filter(I),r=Qe(t,n);return{edges:r,counts:Je(t,r).map(i=>i.count)}}function Ft(e,n){let t=[...e];for(let r of n??[])switch(r.type){case"cumulative":t=ci(t);break;case"difference":t=di(t);break;case"percentageChange":t=ui(t);break;case"movingAverage":t=hi(t,r.window);break;case"normalize":t=fi(t,r.to);break;case"rank":t=mi(t,r.order);break;case"filter":t=pi(t,r.min,r.max);break;case"sort":t=bi(t,r.order);break;case"aggregate":t=gi(t,r.every,r.method);break;case"bin":t=xi(t,r).counts;break}return t}var yi=100,ki=2e3,xr=32,yr=28,ot=e=>e.position==="right"||e.position==="top";function vi(e){let t=(e.yAxis===void 0?[]:Array.isArray(e.yAxis)?e.yAxis:[e.yAxis]).map((i,o)=>({...i,id:i.id??(o===0?"left":o===1?"right":String(o)),position:i.position??(o===1?"right":"left")}));t.length===0&&t.push({id:"left",position:"left"});let r=t.some(i=>i.id==="right"||ot(i));return e.rightAxis?t.push({...e.rightAxis,id:"right",position:"right"}):!r&&e.series.some(i=>i.axis==="right")&&t.push({id:"right",position:"right"}),t}function vr(e,n){let t=e[0]?.id;return n===void 0||n==="left"?t:n==="right"?(e.find(r=>r.id==="right")??e.find(ot))?.id:e.find(r=>r.id===n)?.id}var it=e=>e.kind==="bar"||e.kind==="range"&&e.style==="bar";function wr(e,n){let t=ve(e.format),{series:r,categories:i,issues:o,axes:s}=Mi(e,n,t),l=e.direction==="rtl",c=e.baseline??0,d=Math.max(i.length,...r.map(a=>Math.max(a.data.length,a.low.length))),u=r.every(a=>oe(a.data).length===0&&oe(a.high).length===0),h=dr(e,u);if(h)return{...h,issues:o};let b=e.xAxis?.type??"category",y=b!=="category"&&i.length>0&&i.every(a=>typeof a!="string"||b==="time"&&I(ie(a))),x=y?i.map(ie):[],[p,S]=se(x),v=e.xAxis?.format??(b==="time"?{style:S-p<2*864e5?"time":"date"}:void 0),f=Array.from({length:d},(a,g)=>{let C=i[g];return C===void 0?String(g+1):Xe(C,v)}),w=wi(e.zoom,d),A=Array.from({length:w.end-w.start},(a,g)=>w.start+g),k=e.orientation==="horizontal",_=r.map(a=>({...a,hidden:a.hidden||k&&!it(a)})).filter(a=>!a.hidden),H=_.some(a=>!it(a))?br(_.filter(a=>!it(a)).map(a=>A.map(g=>(a.kind==="range"?a.high[g]:a.data[g])??null)),A.length,e.sampling):void 0,P=H?H.map(a=>A[a]):A,X=e.stacked==="percent"||e.stackOffset==="expand",Q=e.stackOffset??"zero",te=new Map,de=new Map,ht=new Map;for(let a of _)a.stack!==void 0&&a.kind!=="range"&&ht.set(a.stack,[...ht.get(a.stack)??[],a]);for(let a of ht.values()){let g=new Array(d).fill(c),C=new Array(d).fill(c),j=new Array(d).fill(0);if(X)for(let D of a)D.data.forEach((O,F)=>{I(O)&&(j[F]=j[F]+Math.abs(O))});for(let D of a){let O=[],F=[];for(let N=0;N<d;N++){let G=D.data[N];if(!I(G)){O.push(null),F.push(null);continue}let R=j[N],T=X?R>0?G/R:0:G,Z=T>=0?g:C;O.push(Z[N]),Z[N]=Z[N]+T,F.push(Z[N])}te.set(D,O),de.set(D,F)}if(Q==="silhouette"||Q==="wiggle"){let D=new Array(d).fill(0);if(Q==="silhouette")for(let O=0;O<d;O++)D[O]=-(g[O]-c)/2;else{let O=0;for(let F=0;F<d;F++){let N=a.length,G=0;for(let T=0;T<N;T++){let Z=a[T],W=Z.data[F],q=Z.data[F-1],J=F>0&&I(W)&&I(q)?W-q:0;G+=(N-T-.5)*J}let R=g[F]-c;O=F===0?-R/2:O-(R>0?G/Math.max(1,N):0),D[F]=O}}for(let O of a){let F=te.get(O),N=de.get(O);for(let G=0;G<d;G++){let R=F[G],T=N[G];I(R)&&(F[G]=R+D[G]),I(T)&&(N[G]=T+D[G])}}}}let wn=a=>a.kind==="range"?{from:a.low,to:a.high}:{from:te.get(a)??new Array(d).fill(c),to:de.get(a)??a.data},Mn=a=>{let g=[],C=!1;for(let O of _){if(O.axis!==a)continue;let{from:F,to:N}=wn(O);for(let G of P){let R=N[G];if(I(R)&&g.push(R),O.kind==="range"||O.stack!==void 0){let T=F[G];I(T)&&g.push(T)}}if(O.errors)for(let G of P){let R=kr(O.data[G],O.errors[G]);R&&g.push(R[0],R[1])}(O.kind==="bar"||O.kind==="area")&&Q==="zero"&&(C=!0)}let[j,D]=se(g);return C?[Math.min(c,j),Math.max(c,D)]:[j,D]},{width:Sn,height:$n}=Lt(e),Br=e.brush?xr+yr:0,Cn=P.reduce((a,g)=>Math.max(a,f[g].length),0)*ae,In=X?{style:"percent"}:void 0,Pr=a=>{if(a.scale==="log")return ee.left;let[g,C]=Mn(a.id),j=ve(a.format??In??e.format),D=pe(a.min??g,a.max??C).reduce((O,F)=>Math.max(O,j(F).length),0);return Math.max(ee.left,D*ae+14)+(a.showTicks?a.tickSize??4:0)},ft=a=>k?ot(a)?"top":"bottom":ot(a)!==l?"right":"left",Tn=a=>k?24+(a.showTicks?a.tickSize??4:0):Pr(a),Dr=new Set(_.map(a=>a.axis)),mt=s.filter(a=>Dr.has(a.id)||s.length>1),An=new Map,ge={left:0,right:0,top:0,bottom:0};for(let a of mt){let g=ft(a);An.set(a.id,ge[g]),ge[g]+=Tn(a)}let zn=mt.find(a=>ft(a)==="bottom"),Nr={top:ee.top+or(e)+(s.some(a=>a.label)?12:0)+ge.top,right:k?l?Math.max(ee.left,Cn+16):ee.right:Math.max(ee.right,ge.right),bottom:ee.bottom+Br+(e.xAxis?.label?14:0)+(e.xAxis?.tickRotation?24:0)+ge.bottom-(zn?Tn(zn):0),left:k?l?ee.right:Math.max(ee.left,Cn+16):Math.max(ee.left,ge.left)},K=nr(Sn,$n,Nr),Fr=k?l?[K.x+K.width,K.x]:[K.x,K.x+K.width]:[K.y+K.height,K.y],On=k?[K.y,K.y+K.height]:l?[K.x+K.width,K.x]:[K.x,K.x+K.width],pt=new Map(s.map(a=>[a.id,{...lr(Mn(a.id),Fr,{format:In,...a},e.format),position:ft(a),offset:An.get(a.id)??0}])),Ln=s[0]?.id,je=pt.get(Ln),bt=a=>pt.get(vr(s,a)??Ln)??je,ne=(a,g)=>bt(g).scale(a),Rn=a=>m(a.scale(Math.min(Math.max(c,Math.min(...a.domain)),Math.max(...a.domain)))),He=Yn(P.length,On,e.barGap),gt=P.map(a=>x[a]),xt=[...gt].sort((a,g)=>a-g),xe=1/0;for(let a=1;a<xt.length;a++)xe=Math.min(xe,xt[a]-xt[a-1]);let[ye,Ce]=se(gt),re=xe===1/0?Math.max(1,Math.abs(Ce)*.05||1):xe/2,Ie=we([ye-re,Ce+re],On),Ze=a=>m(y?Ie(gt[a]):He.center(a)),Vn=y?Math.abs(Ie(ye+(xe===1/0?re:xe))-Ie(ye))*.8:He.bandwidth,Bn=a=>y?Ze(a)-Vn/2:He.start(a),Gr=y?(b==="time"?Qn(ye-re,Ce+re):pe(ye-re,Ce+re)).filter(a=>a>=ye-re&&a<=Ce+re).map(a=>({pos:m(Ie(a)),label:Xe(a,v)})):rt(P.map((a,g)=>({pos:Ze(g),label:f[a]})),k?1/0:K.width/Math.max(.2,Math.abs(Math.cos((e.xAxis?.tickRotation??0)*Math.PI/180)))),yt={...Rt(e,Sn,$n,r.map(a=>({name:a.name,color:a.color}))),plot:K,xTicks:Gr,yTicks:k?rt(je.ticks,K.width):je.ticks,baseline:Rn(je)},_r=s[0],Pn=Pt(yt,{horizontal:k,rtl:l,axes:mt.map(a=>{let g=pt.get(a.id);return{ticks:k?rt(g.ticks,K.width):g.ticks,position:g.position,offset:g.offset??0,label:a.label,showLine:a.showLine,showTicks:a.showTicks,tickSize:a.tickSize}}),xLabel:e.xAxis?.label,grid:cr(_r),categoryGrid:e.xAxis?.grid===!0,x:e.xAxis}),jr=a=>{if(typeof a=="number"&&i.every(C=>typeof C=="string"))return a;let g=typeof a=="string"?a:ie(a);for(let C=0;C<d;C++){let j=i[C];if(j!==void 0&&(typeof g=="string"?j===g||f[C]===g:ie(j)===g))return C}},Dn={plot:K,horizontal:k,x:a=>{if(y&&(typeof a!="string"||I(ie(a))))return Ie(ie(a));let g=jr(a),C=g===void 0?-1:P.indexOf(g);return C<0?void 0:He.center(C)},y:(a,g)=>ne(a,g)};Pn.push(...Dt(e.references,Dn));let kt=[],vt=new Map;for(let a of _){if(!it(a))continue;let g=a.stack??a,C=kt.indexOf(g);C<0&&(C=kt.push(g)-1),vt.set(a,C)}let Ee=Vn/Math.max(1,kt.length),ue=Math.min(Ee,e.barWidth??1/0),Nn=(Ee-ue)/2,wt=[],We=[],Mt=[],St=[],$t=[],Fn=[],Ue=[],Ke=a=>bt(a.axis).format,Ct=Math.max(0,e.minBarSize??0),Hr=(a,g,C)=>{let j=Math.abs(g-a);if(j>=Ct)return[Math.min(a,g),j];let O=a+(k?C?1:-1:C?-1:1)*Ct;return[Math.min(a,O),Ct]},Te=(a,g,C,j)=>({label:j,series:a.name,seriesId:a.id??a.name,category:f[g],index:g,value:C}),Gn=(a,g,C,j)=>{let D=kr(j,a.errors?.[g]);if(!D)return;let O=m(ne(D[0],a.axis)),F=m(ne(D[1],a.axis)),N=4,G="var(--skdx-color-text-default)",R=`${a.name}, ${f[g]}: ${Ke(a)(D[0])} \u2013 ${Ke(a)(D[1])}`;Fn.push(k?{kind:"line",part:"error-bar",x1:O,x2:F,y1:C,y2:C,stroke:G,title:R}:{kind:"line",part:"error-bar",x1:C,x2:C,y1:O,y2:F,stroke:G,title:R},k?{kind:"line",part:"error-cap",x1:O,x2:O,y1:m(C-N),y2:m(C+N),stroke:G}:{kind:"line",part:"error-cap",x1:m(C-N),x2:m(C+N),y1:O,y2:O,stroke:G},k?{kind:"line",part:"error-cap",x1:F,x2:F,y1:m(C-N),y2:m(C+N),stroke:G}:{kind:"line",part:"error-cap",x1:m(C-N),x2:m(C+N),y1:F,y2:F,stroke:G})};for(let a of _){let{from:g,to:C}=wn(a),j=Ke(a),D=P.length<=ki;if(a.kind==="bar"){let R="";P.forEach((T,Z)=>{let W=a.data[T],q=g[T],J=C[T];if(!I(W)||!I(q)||!I(J))return;let ke=ne(q,a.axis),me=ne(J,a.axis),[Ae,ze]=Hr(ke,me,J>=q),Oe=Bn(Z)+vt.get(a)*Ee+Nn,jn=m(k?Ae:Oe),Hn=m(k?Oe:Ae),It=m(k?ze:ue),Zn=m(k?ue:ze);if(!D){R+=`M${jn} ${Hn}h${It}v${Zn}h${-It}Z`;return}let En=Bt(a.name,f[T],X?J-q:W,j);if(We.push({kind:"rect",part:"bar",x:jn,y:Hn,width:It,height:Zn,fill:a.color,rx:e.radius,title:En,item:Te(a,T,W,En)}),Gn(a,T,m(Oe+ue/2),W),e.labels){let Wn=j(X?J-q:W);$t.push(k?Y(m(Math.max(ke,me)+4),m(Oe+ue/2),Wn,{baseline:"middle"}):Y(m(Oe+ue/2),m(Math.min(ke,me)-4),Wn,{anchor:"middle"}))}}),R&&We.push({kind:"path",part:"bars",d:R,fill:a.color,title:a.name});continue}if(a.kind==="range"&&a.style==="bar"){P.forEach((R,T)=>{let Z=g[R],W=C[R];if(!I(Z)||!I(W))return;let q=ne(Math.min(Z,W),a.axis),J=ne(Math.max(Z,W),a.axis),ke=Bn(T)+vt.get(a)*Ee+Nn,me=`${a.name}, ${f[R]}: ${j(Math.min(Z,W))} \u2013 ${j(Math.max(Z,W))}`,Ae=Te(a,R,W,me),ze=Math.max(1,Math.abs(J-q));We.push(k?{kind:"rect",part:"range",x:m(Math.min(q,J)),y:m(ke),width:m(ze),height:m(ue),fill:a.color,rx:e.radius,title:D?me:void 0,item:Ae}:{kind:"rect",part:"range",x:m(ke),y:m(Math.min(q,J)),width:m(ue),height:m(ze),fill:a.color,rx:e.radius,title:D?me:void 0,item:Ae})});continue}let O=e.nulls==="connect"||e.nulls===void 0&&e.connectNulls,F=[],N=[];P.forEach((R,T)=>{let Z=g[R],W=C[R];if(!I(W)||!I(Z)){!O&&N.length&&(F.push(N),N=[]);return}N.push({x:Ze(T),y:m(ne(W,a.axis)),y0:m(ne(Z,a.axis)),i:R})}),N.length&&F.push(N);let G=a.markers??P.length<=yi;for(let R of F){let T=be(R,a.curve);if(a.kind==="range"&&a.style==="line"){Mt.push({kind:"path",part:"range-high",d:T,stroke:a.color,strokeWidth:2,strokeLinejoin:"round"},{kind:"path",part:"range-low",d:be(R.map(Z=>({x:Z.x,y:Z.y0})),a.curve),stroke:a.color,strokeWidth:2,strokeLinejoin:"round",dash:"4 3"});continue}if(a.kind==="range"){let Z=be([...R].reverse().map(W=>({x:W.x,y:W.y0})),a.curve);wt.push({kind:"path",part:"range",d:`${T}L${Z.slice(1)}Z`,fill:a.color,fillOpacity:.2,title:a.name});continue}if(a.kind==="area"){let Z=Rn(bt(a.axis)),W=a.stack!==void 0?be([...R].reverse().map(J=>({x:J.x,y:J.y0})),a.curve).slice(1):`${R[R.length-1]?.x} ${Z}L${R[0]?.x} ${Z}`,q=`skdx-g-${a.index}`;a.gradient&&!Ue.some(J=>J.id===q)&&Ue.push({id:q,vertical:!0,stops:[{offset:0,color:a.color,opacity:a.fillOpacity},{offset:1,color:a.color,opacity:0}]}),wt.push({kind:"path",part:"area",d:`${T}L${W}Z`,fill:a.gradient?`url(#${q})`:a.color,fillOpacity:a.gradient?void 0:a.fillOpacity})}Mt.push({kind:"path",part:"line",d:T,stroke:a.color,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",dash:a.dash})}if(a.kind==="range"&&D)for(let R of F)for(let T of R){let Z=a.low[T.i],W=a.high[T.i],q=`${a.name}, ${f[T.i]}: ${j(Math.min(Z,W))} \u2013 ${j(Math.max(Z,W))}`;St.push({...De(T.x,T.y,.01,a.color,q,Te(a,T.i,W,q)),part:"anchor"})}if(a.kind!=="range")for(let R of F)for(let T of R){if(!G&&!D&&!e.labels&&!a.errors)continue;let Z=a.data[T.i],W=X?C[T.i]-g[T.i]:Z,q=Bt(a.name,f[T.i],W,j);(G||D)&&St.push(G&&a.symbol!=="circle"?gr(T.x,T.y,a.markerSize,a.symbol,a.color,D?q:void 0,Te(a,T.i,Z,q),"point"):{...De(T.x,T.y,G?a.markerSize:.01,a.color,D?q:void 0,Te(a,T.i,Z,q)),part:G?"point":"anchor"}),D&&Gn(a,T.i,k?T.y:T.x,C[T.i]),e.labels&&$t.push(Y(T.x,T.y-8,j(W),{anchor:"middle"}))}}let _n={plot:K,xs:k?[]:P.map((a,g)=>Ze(g)),rows:P.map(a=>[f[a],..._.map(g=>{let C=Ke(g);if(g.kind==="range"){let D=g.low[a],O=g.high[a];return`${g.name}: ${I(D)&&I(O)?`${C(D)} \u2013 ${C(O)}`:"\u2014"}`}let j=g.data[a];return`${g.name}: ${I(j)?C(X?(de.get(g)?.[a]??0)-(te.get(g)?.[a]??0):j):"\u2014"}`})]),count:d,zoom:w,crosshair:rr(e)},qe=[];if(e.brush&&!k){let a={x:K.x,y:K.y+K.height+yr,width:K.width,height:xr},g=_.find(j=>j.kind!=="range"),C={x:m(a.x+w.start/Math.max(1,d)*a.width),y:a.y,width:m((w.end-w.start)/Math.max(1,d)*a.width),height:a.height};if(qe.push({kind:"rect",part:"brush",x:a.x,y:a.y,width:a.width,height:a.height,fill:"var(--skdx-color-surface-sunken)",stroke:V.grid}),g){let j=oe(g.data),[D,O]=se(j),F=d>1?a.width/(d-1):0,N=g.data.flatMap((R,T)=>I(R)?[{x:m(a.x+T*F),y:m(a.y+a.height-(O===D?.5:(R-D)/(O-D))*(a.height-4)-2)}]:[]),G=be(N);N.length>1&&qe.push({kind:"path",part:"brush-series",d:`${G}L${N[N.length-1]?.x} ${a.y+a.height}L${N[0]?.x} ${a.y+a.height}Z`,fill:g.color,fillOpacity:.3})}qe.push({kind:"rect",part:"brush-window",...C,fill:"var(--skdx-color-primary-500)",opacity:.15,stroke:V.axis},{kind:"rect",part:"brush-handle",x:m(C.x-3),y:a.y+8,width:6,height:a.height-16,fill:V.axis,rx:2},{kind:"rect",part:"brush-handle",x:m(C.x+C.width-3),y:a.y+8,width:6,height:a.height-16,fill:V.axis,rx:2}),_n.brush={box:a,window:C}}return{...yt,shapes:[...Pn,...wt,...We,...Mt,...Fn,...St,...$t,...pr(e.annotations,Dn),...qe,...yt.shapes],hit:_n,issues:o,defs:Ue.length?Ue:void 0}}function kr(e,n){if(!(!I(e)||n===null||n===void 0))return typeof n=="number"?I(n)?[e-Math.abs(n),e+Math.abs(n)]:void 0:I(n[0])&&I(n[1])?[Math.min(n[0],n[1]),Math.max(n[0],n[1])]:void 0}function wi(e,n){if(!e||n<2)return{start:0,end:n};let t=Math.max(0,Math.min(n-1,Math.floor(e.start))),r=Math.max(t+1,Math.min(n,Math.ceil(e.end)));return r-t<2&&n>=2?{start:Math.min(t,n-2),end:Math.min(t,n-2)+2}:{start:t,end:r}}function Mi(e,n,t){let r=f=>f.type??n,i=[],o=vi(e),s=e.categories??[],l=(e.transforms??[]).filter(f=>f.type==="sort"||f.type==="bin"||f.type==="aggregate"),c=(e.transforms??[]).filter(f=>!l.includes(f)),d=e.stacked||e.stackOffset!==void 0&&e.stackOffset!=="zero",u=(f,w,A)=>{let k=A.filter(z=>z!==null&&!(typeof z=="number"&&Number.isFinite(z))).length;k&&i.push({code:"invalid-value",severity:"warning",message:`Series "${f}" has ${k} value${k===1?"":"s"} that ${k===1?"is":"are"} neither a number nor null; drawn as gaps.`,itemId:w??f}),s.length&&A.length!==s.length&&!e.transform&&i.push({code:"length-mismatch",severity:"warning",message:`Series "${f}" has ${A.length} values for ${s.length} categories.`,itemId:w??f})},h=e.series.map((f,w)=>{let A=r(f),k=d?!0:void 0,z=f.type==="range"?void 0:f.stack,_=z===!1?void 0:z===!0||z===void 0&&k?`${A}`:z;f.type==="range"?(u(f.name,f.id,f.low),u(f.name,f.id,f.high)):u(f.name,f.id,f.data);let H=X=>e.nulls==="zero"?X.map(Q=>I(Q)?Q:0):X,P=vr(o,f.axis);return P===void 0&&i.push({code:"unknown-axis",severity:"warning",message:`Series "${f.name}" names axis "${String(f.axis)}", which is not defined; drawn on the first axis.`,itemId:f.id??f.name}),{name:f.name,id:f.id,color:sr(e,w,f.color),axis:P??o[0]?.id,hidden:ar(e,f.name),index:w,kind:A,data:f.type==="range"?[]:H(Ft(Ft(f.data,c),f.transforms)),low:f.type==="range"?f.low:[],high:f.type==="range"?f.high:[],curve:f.curve??e.curve??"linear",dash:f.type==="range"?void 0:f.dash,markers:f.type==="range"?void 0:f.markers,symbol:f.type==="range"?"circle":f.symbol??"circle",markerSize:f.type==="range"?3:f.markerSize??3,errors:f.type==="range"?void 0:f.errors,stack:A==="range"||A==="line"?void 0:_,style:f.type==="range"?f.style??"area":"area",fillOpacity:(f.type==="range"?void 0:f.fillOpacity)??e.fillOpacity??.25,gradient:f.type!=="range"&&f.gradient===!0}}),b=()=>Math.max(s.length,...h.map(f=>Math.max(f.data.length,f.low.length))),y=f=>{let w=k=>k.length?f.map(z=>k[z]??null):k,A=Array.from({length:b()},(k,z)=>s[z]??String(z+1));s=f.map(k=>A[k]),h=h.map(k=>({...k,data:w(k.data),low:w(k.low),high:w(k.high)}))},x=(f,w)=>{let A=(w!==void 0?h.find(z=>z.name===w):void 0)??h.find(z=>!z.hidden&&z.kind!=="range")??h[0];w!==void 0&&!h.some(z=>z.name===w)&&i.push({code:"unknown-series",severity:"warning",message:`sort.by names "${w}", which is not a series; sorted by the first series.`});let k=Array.from({length:b()},(z,_)=>_).sort((z,_)=>{let H=A?.data[z]??A?.high[z],P=A?.data[_]??A?.high[_],X=I(H)?H:-1/0,Q=I(P)?P:-1/0;return f==="asc"?X-Q:Q-X});y(k)},p=f=>{let w=h.flatMap(k=>oe(k.data)),A=Qe(w,f);s=A.slice(1).map((k,z)=>`${t(A[z])}\u2013${t(k)}`),h=h.map(k=>{let z=oe(k.data),_=0,H=Je(z,A).map(P=>e.binMode==="density"?z.length?P.count/(z.length*(P.x1-P.x0)):0:e.binMode==="cumulative"?_+=P.count:P.count);return{...k,data:H}})},S=(f,w)=>{let A=Math.max(1,Math.floor(f)),k=b(),z=H=>{if(!H.length)return H;let P=[];for(let X=0;X<k;X+=A){let Q=oe(H.slice(X,X+A));P.push(Q.length===0?null:w==="sum"?Q.reduce((te,de)=>te+de,0):w==="mean"?Q.reduce((te,de)=>te+de,0)/Q.length:w==="min"?Math.min(...Q):Math.max(...Q))}return P};s=Array.from({length:k},(H,P)=>s[P]??String(P+1)).filter((H,P)=>P%A===0),h=h.map(H=>({...H,data:z(H.data),low:z(H.low),high:z(H.high)}))};e.transform==="histogram"?p({bins:e.bins,binWidth:e.binWidth,domain:e.binDomain}):e.transform==="cumulative"&&(h=h.map(f=>{let w=0;return{...f,data:f.data.map(A=>I(A)?w+=A:w)}}));for(let f of l)f.type==="sort"?x(f.order??"desc"):f.type==="bin"?p(f):f.type==="aggregate"&&S(f.every,f.method??"sum");typeof e.sort=="string"?x(e.sort):e.sort&&x(e.sort.order,e.sort.by);let v=e.xAxis?.domain;if(v){let f=b(),w=Array.from({length:f},(_,H)=>s[H]??String(H+1)),A=_=>{let H=typeof _=="string"?_:ie(_);return w.findIndex(P=>typeof H=="string"?P===H||Xe(P)===H:ie(P)===H)},k=v.map(A),z=_=>_.length?k.map(H=>H<0?null:_[H]??null):_;s=[...v],h=h.map(_=>({..._,data:z(_.data),low:z(_.low),high:z(_.high)}))}return{series:h,categories:s,issues:i,axes:o}}function st(e){return e==null?[]:(Array.isArray(e)?e:[e]).map(t=>typeof t=="object"?t:{id:t})}var Gt=e=>e.id??e.name??e.series,Mr=e=>e.seriesId??e.series;function le(e,n){let t=!1;return n.id!==void 0&&(t=!0,Gt(e)!==n.id&&e.id!==n.id&&e.name!==n.id)||n.series!==void 0&&(t=!0,Mr(e)!==n.series&&e.series!==n.series)||n.index!==void 0&&(t=!0,e.index!==n.index)||n.category!==void 0&&(t=!0,e.category!==n.category)?!1:t}function he(e){let n={},t=Gt(e);t!==void 0&&(n.id=t);let r=Mr(e);return r!==void 0&&e.series!==void 0&&(n.series=r),e.index!==void 0&&(n.index=e.index),n}var _t=(e,n)=>e.id===n.id&&e.series===n.series&&e.index===n.index&&e.category===n.category;function jt(e,n,t){let r=st(e),i=he(n),o=r.some(s=>le(n,s));return t==="single"?o?[]:[i]:o?r.filter(s=>!le(n,s)):[...r,i]}var Si=.2;function $i(e){let n=V.focus;switch(e.kind){case"rect":return{kind:"rect",part:"selected",x:e.x-1.5,y:e.y-1.5,width:e.width+3,height:e.height+3,fill:"none",stroke:n,rx:e.rx};case"circle":return{kind:"circle",part:"selected",cx:e.cx,cy:e.cy,r:e.r+2.5,fill:"none",stroke:n};case"path":return{kind:"path",part:"selected",d:e.d,fill:"none",stroke:n,strokeWidth:2.5};case"line":return{...e,part:"selected",stroke:n,strokeWidth:(e.strokeWidth??1)+3,title:void 0,item:void 0};case"text":return}}var Ci=(e,n)=>e.kind==="text"?{...e,fill:V.grid}:{...e,opacity:(e.opacity??1)*n};function Ht(e,n){let t=st(n.selected),r=n.highlighted===void 0||n.highlighted===null?[]:st(n.highlighted),i=r[0];if(t.length===0&&!i)return e;let o={highlighted:n.highlightScope?.highlighted??"item",faded:n.highlightScope?.faded??"global"},s=[],l=u=>!i||r.some(h=>le(u,h))?!0:o.highlighted==="series"?r.some(h=>h.series!==void 0&&le(u,{series:h.series})):!1,c=u=>{if(!i||o.faded==="none"||l(u))return!1;if(o.faded==="series"){let h=i.series;return h!==void 0&&le(u,{series:h})}return!0},d=e.shapes.map(u=>{let h=u.item;if(!h||h.legend)return u;if(t.some(b=>le(h,b))){let b=$i(u);b&&s.push(b)}return c(h)?Ci(u,Si):u});return s.length?{...e,shapes:[...d,...s]}:{...e,shapes:d}}var Zt=e=>wr(e,"bar");function $e(e,n,t,r,i){let o=e.getBoundingClientRect();return{x:o.width?(n-o.left)*r/o.width:n,y:o.height?(t-o.top)*i/o.height:t}}var Et=(e,n,t)=>n>=e.x&&n<=e.x+e.width&&t>=e.y&&t<=e.y+e.height;function Sr(e,n){let t=0,r=1/0;return e.xs.forEach((i,o)=>{let s=Math.abs(i-n);s<r&&(r=s,t=o)}),t}function Ne(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=Sr(t,n),i=t.rows[r]??[];return{index:r,rows:e.axisTooltipFormatter?.(i,r)??i}}function Wt(e,n){let t=e.hit;if(!t||t.xs.length===0)return;let r=t.xs[Sr(t,n)];return{kind:"line",part:"crosshair",x1:r,x2:r,y1:t.plot.y,y2:t.plot.y+t.plot.height,stroke:V.axis,dash:"3 3"}}function Ut(e,n,t){let r=e.hit;if(!r||!r.crosshair||r.xs.length===0||!Et(r.plot,n,t))return[];let i=Wt(e,n),{rows:o}=Ne(e,n),s=e.tooltipAnchored?r.plot.y+8:t;return[i,...nt(i.x1,s,o,e.width,e.height,e.tooltipPlacement)]}function Kt(e,n){let t=e.hit;if(!t||t.xs.length===0)return[];let r=t.rows.findIndex(o=>o[0]===n);if(r<0)return[];let i=t.xs[r];return Ut(e,i,t.plot.y+8)}function qt(e,n,t,r,i){if(!e.tooltip)return{lines:[],shapes:[]};if(e.hit?.crosshair){let{x:c,y:d}=$e(t,r,i,e.width,e.height);if(Et(e.hit.plot,c,d)){let u=Ne(e,c),h=Wt(e,c);if(u&&h)return{lines:u.rows,shapes:[h]}}}let o=n?.closest?.("[data-skdx-part]"),s=e.tooltipFormatter?fe(e,n)?.item:void 0,l=s&&e.tooltipFormatter?.(s)||o&&Array.from(o.children).find(c=>c.tagName.toLowerCase()==="title")?.textContent;return l?{lines:Array.isArray(l)?l:[l],shapes:[]}:{lines:[],shapes:[]}}function $r(e,n,t,r,i,o,s){let l=e?.closest?.("[data-skdx-part]"),c=s&&s.tooltipFormatter?fe(s,e)?.item:void 0,d=c&&s?.tooltipFormatter?.(c)||l&&Array.from(l.children).find(x=>x.tagName.toLowerCase()==="title")?.textContent;if(!d)return[];let u=s?.tooltipAnchored?fe(s,e):void 0,h=u?s?.shapes[u.index]:void 0,{x:b,y}=h?Fe(h):$e(n,t,r,i,o);return nt(b,y,d,i,o,s?.tooltipPlacement)}function Yt(e,n,t,r,i){if(!e.tooltip)return[];if(e.hit?.crosshair){let{x:o,y:s}=$e(t,r,i,e.width,e.height),l=Ut(e,o,s);if(l.length>0)return l}return $r(n,t,r,i,e.width,e.height,e)}function Xt(e,n){let t=fe(e,n);return t&&!t.item.legend?he(t.item):null}var Ii=(e,n)=>{let{x:t,y:r}=Fe(e),i=e.kind==="circle"?e.cy:e.kind==="rect"?e.y+e.height/2:r;return t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height};function Qt(e,n){let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor"||!Ii(i,n))continue;let o=he(i.item),s=JSON.stringify(o);t.has(s)||(t.add(s),r.push(o))}return r}var Jt=e=>({kind:"rect",part:"selection-box",x:m(e.x),y:m(e.y),width:m(e.width),height:m(e.height),fill:V.focus,opacity:.12,stroke:V.focus}),lt=(e,n,t,r)=>({x:Math.min(e,t),y:Math.min(n,r),width:Math.abs(t-e),height:Math.abs(r-n)});function Cr(e,n,t){let r=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){let s=e[i],l=e[o];s.y>t!=l.y>t&&n<(l.x-s.x)*(t-s.y)/(l.y-s.y)+s.x&&(r=!r)}return r}function en(e,n){if(n.length<3)return[];let t=new Set,r=[];for(let i of e.shapes){if(!i.item||i.item.legend||i.part==="anchor")continue;let{x:o,y:s}=Fe(i),l=i.kind==="circle"?i.cy:i.kind==="rect"?i.y+i.height/2:s;if(!Cr(n,o,l))continue;let c=he(i.item),d=JSON.stringify(c);t.has(d)||(t.add(d),r.push(c))}return r}var tn=e=>({kind:"path",part:"selection-lasso",d:e.length?`M${e.map(n=>`${m(n.x)} ${m(n.y)}`).join("L")}`:"",fill:V.focus,fillOpacity:.12,stroke:V.focus,dash:"4 3"}),at=6;function nn(e,n,t){let r=e.edit;if(r){for(let i of r.bars)if(!(t<i.y||t>i.y+i.height||n<i.x0-at||n>i.x1+at))return Math.abs(n-i.x0)<=at?{bar:i,mode:"start"}:Math.abs(n-i.x1)<=at?{bar:i,mode:"end"}:{bar:i,mode:"move"}}}function rn(e,n,t){let r=e.edit;return Ir(r,n,r.invert(n.bar.x0+t)-r.invert(n.bar.x0))}function on(e,n,t){let r=e.edit,i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;if(!r||n===null||!i||!(t.shiftKey||t.altKey))return;let o=r.bars.find(c=>c.index===n);if(!o)return;let s=t.altKey?t.shiftKey?"start":"end":"move",l=r.snap??r.invert(o.x0+10)-r.invert(o.x0);return Ir(r,{bar:o,mode:s},i*l)}function Ir(e,{bar:n,mode:t},r){let i=l=>e.snap?Math.round(l/e.snap)*e.snap:l,o=n.start,s=n.end;return t==="move"?(o=i(n.start+r),s=o+(n.end-n.start)):t==="start"?o=Math.min(i(n.start+r),n.end):s=Math.max(i(n.end+r),n.start),{id:n.id,name:n.name,start:o,end:s}}function sn(e,n,t){let r=e.edit,i=r.scale(t.start),o=r.scale(t.end);return{kind:"rect",part:"edit-ghost",x:m(Math.min(i,o)),y:m(n.bar.y),width:m(Math.max(1,Math.abs(o-i))),height:m(n.bar.height),fill:V.focus,opacity:.25,stroke:V.focus,rx:2}}var Ti=64,Ai=e=>Math.max(1,Math.min(Ti,e));function an(e,n,t,r){let i=n>0?.8:1.25,o=Ai(e.view.zoom*i);if(o===e.view.zoom)return e.view;let{plot:s,scale:l}=e,[c,d]=e.view.center,u=(t-(s.x+s.width/2))/l,h=(r-(s.y+s.height/2))/l,b=e.view.zoom/o;return{center:[c+u*(1-b),e.fromY(e.toY(d)-h*(1-b))],zoom:o}}function ln(e,n,t,r){let{scale:i}=e;return{center:[n.center[0]-t/i,e.fromY(e.toY(n.center[1])+r/i)],zoom:n.zoom}}function fe(e,n){let t=n?.closest?.("[data-skdx-i]"),r=Number(t?.getAttribute("data-skdx-i")),i=Number.isInteger(r)?e.shapes[r]?.item:void 0;return i?{index:r,item:i}:void 0}var ct=e=>e.shapes.flatMap((n,t)=>n.item&&!n.item.legend?[t]:[]);function Fe(e){switch(e.kind){case"rect":return{x:e.x+e.width/2,y:e.y};case"circle":return{x:e.cx,y:e.cy-e.r};case"line":return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)};case"text":return{x:e.x,y:e.y};case"path":{let n=/M\s*(-?[\d.]+)[ ,](-?[\d.]+)/.exec(e.d);return n?{x:Number(n[1]),y:Number(n[2])}:{x:0,y:0}}}}function cn(e,n){let t=n===null?void 0:e.shapes[n];if(!t)return[];let r=V.focus,i;switch(t.kind){case"rect":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-2,width:t.width+4,height:t.height+4,fill:"none",stroke:r,rx:2};break;case"circle":i={kind:"circle",part:"focus",cx:t.cx,cy:t.cy,r:t.r+3,fill:"none",stroke:r};break;case"line":i={kind:"line",part:"focus",x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:r,strokeWidth:4};break;case"text":i={kind:"rect",part:"focus",x:t.x-2,y:t.y-8,width:t.text.length*ae+4,height:16,fill:"none",stroke:r,rx:2};break;case"path":i={kind:"path",part:"focus",d:t.d,stroke:r,strokeWidth:2,fill:"none"};break}let{x:o,y:s}=Fe(t),l=t.item&&e.tooltipFormatter?.(t.item)||(t.item?.label??t.title??"");return[i,...l?nt(m(o),m(s),l,e.width,e.height):[]]}function dn(e,n,t){let r=ct(e);if(r.length===0)return;let i=n===null?-1:r.indexOf(n);switch(t){case"ArrowRight":case"ArrowDown":return r[Math.min(r.length-1,i+1)];case"ArrowLeft":case"ArrowUp":return r[Math.max(0,i<=0?0:i-1)];case"Home":return r[0];case"End":return r[r.length-1];case"Escape":return null;default:return}}var Me=2,Se=(e,n,t)=>{let r=Math.max(Me,Math.min(t,Math.round(n))),i=Math.max(0,Math.min(t-r,Math.round(e)));return{start:i,end:i+r}},Tr=(e,n)=>!e||e.start<=0&&e.end>=n;function un(e,n,t){if(e.count<=Me||!e.plot.width)return;let{start:r,end:i}=e.zoom,o=i-r,s=n>0?1.25:.8,l=Math.max(Me,Math.min(e.count,Math.round(o*s)));if(l===o)return n>0&&!Tr(e.zoom,e.count)?Se(r,l,e.count):void 0;let c=Math.max(0,Math.min(1,(t-e.plot.x)/e.plot.width)),d=r+c*o;return Se(d-c*l,l,e.count)}function hn(e,n,t,r){let i=n.end-n.start,o=Math.max(Me,Math.min(e.count,Math.round(i/Math.max(.05,t)))),s=Math.max(0,Math.min(1,(r-e.plot.x)/Math.max(1,e.plot.width)));return Se(n.start+s*i-s*o,o,e.count)}function fn(e,n,t){let r=n.end-n.start,i=e.plot.width/Math.max(1,r);return Se(n.start-t/i,r,e.count)}function mn(e,n,t){let r=e.brush;if(!r||!Et(r.box,n,t))return;let i=r.window;if(Math.abs(n-i.x)<=6)return{grab:"left",zoom:e.zoom};if(Math.abs(n-(i.x+i.width))<=6)return{grab:"right",zoom:e.zoom};if(n>i.x&&n<i.x+i.width)return{grab:"move",zoom:e.zoom};let o=e.zoom.end-e.zoom.start,s=(n-r.box.x)/Math.max(1,r.box.width)*e.count;return{grab:"move",zoom:Se(s-o/2,o,e.count)}}function pn(e,n,t,r){let i=e.brush;if(!i)return t;let o=r/Math.max(1,i.box.width)*e.count;if(n==="move")return Se(t.start+o,t.end-t.start,e.count);if(n==="left")return{start:Math.max(0,Math.min(t.end-Me,Math.round(t.start+o))),end:t.end};let s=Math.min(e.count,Math.max(t.start+Me,Math.round(t.end+o)));return{start:t.start,end:s}}function gn(e,n){switch(n.type){case"svg":return Promise.resolve(bn(e,n.label,n.resolve));case"csv":return Promise.resolve(Lr(n.rows));case"png":{if(typeof document>"u"||typeof Image>"u")return Promise.reject(new Error("PNG export needs a browser"));let t=bn(e,n.label,n.resolve);return Or(t,e.width,e.height,n.scale,n.background)}}}var ce=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/"/g,"""),Ge=e=>e.filter(([,n])=>n!==void 0&&n!=="").map(([n,t])=>` ${n}="${ce(String(t))}"`).join("");function Ar(e){let n=e.title?`<title>${ce(e.title)}</title>`:"",t=["data-skdx-part",e.part];switch(e.kind){case"path":return`<path${Ge([t,["d",e.d],["fill",e.fill??"none"],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-linecap",e.strokeLinecap],["stroke-linejoin",e.strokeLinejoin],["stroke-dasharray",e.dash],["opacity",e.opacity],["fill-opacity",e.fillOpacity]])}>${n}</path>`;case"rect":return`<rect${Ge([t,["x",e.x],["y",e.y],["width",e.width],["height",e.height],["rx",e.rx],["fill",e.fill],["stroke",e.stroke],["fill-opacity",e.opacity]])}>${n}</rect>`;case"line":return`<line${Ge([t,["x1",e.x1],["y1",e.y1],["x2",e.x2],["y2",e.y2],["stroke",e.stroke],["stroke-width",e.strokeWidth],["stroke-dasharray",e.dash],["opacity",e.opacity]])}>${n}</line>`;case"circle":return`<circle${Ge([t,["cx",e.cx],["cy",e.cy],["r",e.r],["fill",e.fill],["stroke",e.stroke]])}>${n}</circle>`;case"text":return`<text${Ge([t,["x",e.x],["y",e.y],["text-anchor",e.anchor],["dominant-baseline",e.baseline],["fill",e.fill],["font-weight",e.weight],["transform",e.rotate?`rotate(${e.rotate} ${e.x} ${e.y})`:void 0]])}>${ce(e.text)}</text>`}}function zr(e){let n=e.defs??[];return n.length===0?"":`<defs>${n.map(t=>`<linearGradient id="${ce(t.id)}" x1="0" y1="0" x2="${t.vertical===!1?1:0}" y2="${t.vertical===!1?0:1}">${t.stops.map(r=>`<stop offset="${r.offset}" stop-color="${ce(r.color)}"${r.opacity===void 0?"":` stop-opacity="${r.opacity}"`}/>`).join("")}</linearGradient>`).join("")}</defs>`}function bn(e,n,t){let r=zr(e)+e.shapes.map(Ar).join("");return t&&(r=r.replace(/var\((--[\w-]+)\)/g,(i,o)=>t(o).trim()||i)),`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e.width} ${e.height}" width="${e.width}" height="${e.height}" role="img" aria-label="${ce(n)}" font-family="${ce(V.fontFamily)}" font-size="${ce(V.fontSize)}"><title>${ce(n)}</title>${r}</svg>`}function Or(e,n,t,r=2,i){return new Promise((o,s)=>{let l=URL.createObjectURL(new Blob([e],{type:"image/svg+xml;charset=utf-8"})),c=new Image;c.onload=()=>{URL.revokeObjectURL(l);let d=document.createElement("canvas");d.width=Math.round(n*r),d.height=Math.round(t*r);let u=d.getContext("2d");if(!u)return s(new Error("canvas 2d context unavailable"));i&&(u.fillStyle=i,u.fillRect(0,0,d.width,d.height)),u.drawImage(c,0,0,d.width,d.height),d.toBlob(h=>h?o(h):s(new Error("toBlob failed")),"image/png")},c.onerror=()=>{URL.revokeObjectURL(l),s(new Error("svg could not be decoded"))},c.src=l})}function Lr(e){let n=t=>{let r=t==null?"":String(t);return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r};return e.map(t=>t.map(n).join(",")).join(`\r
|
|
2
|
+
`)}function xn(e,n){if(!n)return;let t=typeof n=="object"?n.maxRows??500:500,r=e.hit;if(r&&r.rows.length>0){let l=r.rows[0];if(r.rows.length>t)return;let c=["",...l.slice(1).map(u=>u.replace(/:\s[^:]*$/,""))],d=r.rows.map(u=>[u[0],...u.slice(1).map(h=>h.slice(h.lastIndexOf(": ")+2))]);return[c,...d]}let i=e.shapes.flatMap(l=>l.item&&!l.item.legend&&!(l.part==="anchor"&&!l.title)?[l.item]:[]);if(i.length===0||i.length>t)return;let o=["series","name","category","value"].filter(l=>i.some(c=>c[l]!==void 0)),s=(l,c)=>l[c]===void 0?"":String(l[c]);return[o.map(l=>l[0]?.toUpperCase()+l.slice(1)),...i.map(l=>o.map(c=>s(l,c)))]}var yn=new Map;function dt(e){let n=yn.get(e);if(n)return n.group;let t=new Set,r={},i={current:r,subscribe(o){return t.add(o),()=>{t.delete(o),t.size===0&&yn.delete(e)}},publish(o,s){Object.assign(r,o);for(let l of t)l(o,s)}};return yn.set(e,{group:i,listeners:t}),i}var Rr='[data-skdx-part]:not([data-skdx-part^="tooltip"]):not([data-skdx-part="focus"]):not([data-skdx-part="crosshair"])',kn=`@keyframes skdx-in{from{opacity:0}to{opacity:1}}${Rr}{animation:skdx-in var(--skdx-chart-duration,0ms) ease-out;transition:${["x","y","width","height","cx","cy","r","opacity","fill-opacity","d"].map(e=>`${e} var(--skdx-chart-duration,0ms) ease-out`).join(",")}}@media (prefers-reduced-motion:reduce){${Rr}{animation:none;transition:none}}`;function vn(e){let n=e.animate;return n&&e.shapes.length<=1500?`${n}ms`:void 0}var L=require("lit"),$=require("lit/decorators.js"),U=require("lit/directives/if-defined.js");var zi={fromAttribute:()=>!1},B=class extends L.LitElement{constructor(){super(...arguments);this.legend=!1;this.tooltip=!0;this.selectionMode="none";this.loading=!1;this.decorative=!1;this.accessibleTable=!1;this.zoomable=!1;this.editable=!1;this.crossFilter=!1;this.animated=!1;this.responsive=!1;this.tip=[];this.overlay=[];this.portal=null;this.highlightState=null;this.crossState=null;this.lastCross=null;this.pointers=new Map;this.hover=null;this.token={};this.focused=null;this.hiddenState=[];this.drag=null;this.onPointerMove=t=>{let r=this.layout;if(!r)return;this.pointers.has(t.pointerId)&&this.pointers.set(t.pointerId,this.viewBox(t,r).x);let i=this.drag;if(i?.grab==="select"){let{x:o,y:s}=this.viewBox(t,r);this.overlay=[Jt(lt(i.x,i.y,o,s))];return}if(i?.grab==="lasso"){let{x:o,y:s}=this.viewBox(t,r);i.points=[...i.points??[],{x:o,y:s}],this.overlay=[tn(i.points)];return}if(i?.grab==="edit"){if(!i.gantt)return;let{x:o}=this.viewBox(t,r);i.change=rn(r,i.gantt,o-i.x),this.overlay=[sn(r,i.gantt,i.change)];return}if(i?.grab==="map"){if(!r.map||!i.view)return;let{x:o,y:s}=this.viewBox(t,r);this.setView(ln(r.map,i.view,o-i.x,s-i.y));return}if(i&&r.hit){if(i.grab==="pinch"){let[s,l]=[...this.pointers.values()];if(s===void 0||l===void 0||!i.distance)return;this.setZoom(hn(r.hit,i.zoom,Math.abs(s-l)/i.distance,(s+l)/2));return}let{x:o}=this.viewBox(t,r);this.setZoom(i.grab==="pan"?fn(r.hit,i.zoom,o-i.x):pn(r.hit,i.grab,i.zoom,o-i.x));return}if(r.tooltipPortal){let{lines:o,shapes:s}=qt(r,t.target,t.currentTarget,t.clientX,t.clientY);this.tip=s,this.portal=o.length?{x:t.clientX,y:t.clientY,lines:o}:null}else{let o=Yt(r,t.target,t.currentTarget,t.clientX,t.clientY);(o.length>0||this.tip.length>0)&&(this.tip=o)}if(this.highlight(Xt(r,t.target)),this.syncId&&r.hit?.crosshair){let o=Ne(r,this.viewBox(t,r).x);this.shareCrosshair(o?r.hit.rows[o.index]?.[0]??null:null)}};this.onPointerDown=t=>{let r=this.layout;if(!r||t.button!==0)return;let{x:i,y:o}=this.viewBox(t,r),s=fe(r,t.target)?.item.legend,l=this.canEdit(r)?nn(r,i,o):void 0;if(l){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"edit",gantt:l},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.brushing()&&!s){this.drag={x:i,y:o,zoom:{start:0,end:0},grab:this.selectionMode==="lasso"?"lasso":"select",points:[{x:i,y:o}]},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}if(this.canPan(r)&&r.map){let d=r.map.plot;if(i<d.x||i>d.x+d.width||o<d.y||o>d.y+d.height)return;this.drag={x:i,y:o,zoom:{start:0,end:0},grab:"map",view:r.map.view},t.currentTarget.setPointerCapture(t.pointerId),this.clearTip();return}let c=r.hit;if(!(!c||!this.canZoom(r))){if(this.pointers.set(t.pointerId,i),this.pointers.size===2){let[d,u]=[...this.pointers.values()];this.drag={x:(d+u)/2,y:o,zoom:c.zoom,grab:"pinch",distance:Math.abs(d-u)||1}}else{let d=mn(c,i,o);if(d)this.drag={x:i,y:o,zoom:d.zoom,grab:d.grab},d.zoom!==c.zoom&&this.setZoom(d.zoom);else if(this.zoomable&&i>=c.plot.x&&i<=c.plot.x+c.plot.width&&o>=c.plot.y&&o<=c.plot.y+c.plot.height)this.drag={x:i,y:o,zoom:c.zoom,grab:"pan"};else{this.pointers.delete(t.pointerId);return}}t.currentTarget.setPointerCapture(t.pointerId),this.clearTip()}};this.onPointerUp=t=>{this.pointers.delete(t.pointerId);let r=t.currentTarget;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId);let i=this.drag,o=this.layout;if(o&&(i?.grab==="select"||i?.grab==="lasso"||i?.grab==="edit"||i?.grab==="map")){this.overlay=[];let{x:s,y:l}=this.viewBox(t,o);if(Math.abs(s-i.x)>2||Math.abs(l-i.y)>2){i.grab==="select"?this.setSelected(Qt(o,lt(i.x,i.y,s,l))):i.grab==="lasso"?this.setSelected(en(o,i.points??[])):i.grab==="edit"&&i.change&&this.emit("skdx-task-change",i.change),this.drag={...i,distance:-1};return}this.drag=null;return}(this.pointers.size===0||this.drag?.grab==="pinch")&&(this.drag=null)};this.onWheel=t=>{let r=this.layout;if(!r)return;let{x:i,y:o}=this.viewBox(t,r);if(r.map&&this.canPan(r)){let c=r.map.plot;if(i<c.x||i>c.x+c.width||o<c.y||o>c.y+c.height)return;t.preventDefault(),this.setView(an(r.map,t.deltaY,i,o));return}let s=r.hit;if(!s||!this.canZoom(r)||o<s.plot.y||o>s.plot.y+s.plot.height)return;let l=un(s,t.deltaY,i);l&&(t.preventDefault(),this.setZoom(l))};this.onClick=t=>{if(!this.layout)return;if(this.drag?.distance===-1){this.drag=null;return}let r=fe(this.layout,t.target);r&&(r.item.range?this.setZoom(r.item.range):r.item.legend&&r.item.series!==void 0?this.toggle(r.item.series):(this.select(r.item),this.emit("skdx-item-click",r.item)))};this.onKeyDown=t=>{let r=this.layout;if(!r)return;if((t.key==="Enter"||t.key===" ")&&this.focused!==null){let l=r.shapes[this.focused]?.item;l&&(t.preventDefault(),this.select(l),this.emit("skdx-item-click",l));return}let i=this.canEdit(r)?on(r,this.focused,t):void 0;if(i){t.preventDefault(),this.emit("skdx-task-change",i);return}let o=dn(r,this.focused,t.key);if(o===void 0)return;t.preventDefault(),this.focused=o;let s=o===null?void 0:r.shapes[o]?.item;this.highlight(s?he(s):null)}}connectedCallback(){super.connectedCallback(),!(typeof ResizeObserver>"u")&&(this.observer=new ResizeObserver(([t])=>{let r=Math.floor(t?.contentRect.width??0);r>0&&(this.measured=r)}),this.observer.observe(this))}disconnectedCallback(){this.observer?.disconnect(),this.leave?.(),this.leave=void 0,this.joined=void 0,super.disconnectedCallback()}sized(){let{width:t,height:r,legend:i,tooltip:o,format:s,palette:l,loading:c,error:d,emptyMessage:u,description:h,decorative:b,animated:y,responsive:x,highlighted:p,highlightScope:S,accessibleTable:v}=this;return{...typeof x=="object"&&this.measured!==void 0&&this.measured<(x.breakpoint??480)?x.compact:void 0,width:x&&this.measured?this.measured:t,height:r,animate:y,responsive:x,legend:i,tooltip:o,format:s,palette:l,loading:c,error:d,emptyMessage:u,description:h,decorative:b,highlighted:p===void 0?this.highlightState:p,highlightScope:S,accessibleTable:v,hiddenSeries:this.hiddenSeries??this.hiddenState,zoom:this.zoom??this.zoomState,selected:this.selected??this.selectedState,view:this.view??this.viewState}}emit(t,r){this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}publish(t){this.syncId&&dt(this.syncId).publish(t,this.token)}join(){if(this.joined===this.syncId||(this.leave?.(),this.leave=void 0,this.joined=this.syncId,!this.syncId))return;let t=dt(this.syncId),r=i=>{"highlighted"in i&&(this.highlightState=i.highlighted??null),i.selected&&(this.selectedState=i.selected,this.crossFilter&&(this.highlightState=i.selected.length?i.selected:null)),"zoom"in i&&(this.zoomState=i.zoom),i.hiddenSeries&&(this.hiddenState=i.hiddenSeries),"crosshair"in i&&(this.crossState=i.crosshair??null)};r(t.current),this.leave=t.subscribe((i,o)=>{o!==this.token&&r(i)})}setZoom(t){this.zoomState=t,this.emit("skdx-zoom-change",t),this.publish({zoom:t})}setView(t){this.viewState=t,this.emit("skdx-view-change",t)}setSelected(t){this.selectedState=t,this.emit("skdx-selected-change",t),this.publish({selected:t})}toggle(t){let r=this.hiddenSeries??this.hiddenState,i=r.includes(t)?r.filter(o=>o!==t):[...r,t];this.hiddenState=i,this.emit("skdx-hidden-series-change",i),this.publish({hiddenSeries:i})}highlight(t){let r=this.hover;r===t||r&&t&&_t(r,t)||(this.hover=t,this.emit("skdx-highlighted-change",t),this.syncId&&(this.highlightState=t,this.publish({highlighted:t})))}select(t){let r=this.selectionMode;r!=="none"&&this.setSelected(jt(this.selected??this.selectedState,t,r==="single"?"single":"multiple"))}shareCrosshair(t){!this.syncId||this.lastCross===t||(this.lastCross=t,this.publish({crosshair:t}))}clearTip(){this.tip=[],this.portal=null,this.shareCrosshair(null)}canZoom(t){return!!(t.hit&&(this.zoomable||t.hit.brush))}canPan(t){return!!(t.map&&this.zoomable)}canEdit(t){return!!(this.editable&&t.edit)}brushing(){return this.selectionMode==="brush"||this.selectionMode==="lasso"}viewBox(t,r){return $e(t.currentTarget,t.clientX,t.clientY,r.width,r.height)}getSvgElement(){return this.renderRoot.querySelector("svg")}getLayout(){return this.layout}resetZoom(){this.setZoom(void 0)}zoomTo(t){this.setZoom(t)}focusItem(t){let r=this.layout;if(!r)return!1;let i=r.shapes.findIndex(o=>o.item&&!o.item.legend&&le(o.item,t));return i<0?!1:(this.getSvgElement()?.focus(),this.focused=i,!0)}export(t){let r=this.layout;return r?gn(r,{...t,label:t.label??this.label??this.localName}):Promise.reject(new Error("not rendered yet"))}root(t,r,i){this.join();let o=Ht(Vt(t),this.sized());if(this.layout=o,o.issues!==this.reported){this.reported=o.issues;for(let v of o.issues??[])this.emit("skdx-data-issue",v)}let s=this.canZoom(o),l=this.canPan(o),c=this.canEdit(o),d=this.brushing(),u=s||l||c||d,h=!o.decorative&&ct(o).length>0,b=o.description?`${r}-desc`:void 0,y=vn(o),x=xn(o,this.accessibleTable),p=typeof this.accessibleTable=="object"&&this.accessibleTable.caption||i,S=this.portal;return L.html`<svg
|
|
3
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4
|
+
viewBox="0 0 ${o.width} ${o.height}"
|
|
5
|
+
width=${o.width}
|
|
6
|
+
height=${o.height}
|
|
7
|
+
role=${o.decorative?"presentation":"img"}
|
|
8
|
+
aria-hidden=${o.decorative?"true":L.nothing}
|
|
9
|
+
aria-label=${o.decorative?L.nothing:i}
|
|
10
|
+
aria-describedby=${(0,U.ifDefined)(b)}
|
|
11
|
+
tabindex=${h?0:L.nothing}
|
|
12
|
+
data-skdx-chart=${r}
|
|
13
|
+
data-zoomable=${s||l?"":L.nothing}
|
|
14
|
+
data-brushing=${d&&!(s||l)?"":L.nothing}
|
|
15
|
+
data-editable=${c?"":L.nothing}
|
|
16
|
+
style=${y?`--skdx-chart-duration:${y}`:L.nothing}
|
|
17
|
+
font-family=${V.fontFamily}
|
|
18
|
+
font-size=${V.fontSize}
|
|
19
|
+
@pointermove=${o.tooltip||u?this.onPointerMove:L.nothing}
|
|
20
|
+
@pointerleave=${()=>{this.clearTip(),this.highlight(null)}}
|
|
21
|
+
@pointerdown=${u?this.onPointerDown:L.nothing}
|
|
22
|
+
@pointerup=${u?this.onPointerUp:L.nothing}
|
|
23
|
+
@pointercancel=${u?this.onPointerUp:L.nothing}
|
|
24
|
+
@wheel=${s||l?this.onWheel:L.nothing}
|
|
25
|
+
@dblclick=${s||l?()=>l?this.setView(void 0):this.setZoom(void 0):L.nothing}
|
|
26
|
+
@click=${this.onClick}
|
|
27
|
+
@keydown=${h?this.onKeyDown:L.nothing}
|
|
28
|
+
@blur=${()=>{this.focused=null,this.highlight(null)}}
|
|
29
|
+
>
|
|
30
|
+
<title>${i}</title>
|
|
31
|
+
${o.description?L.svg`<desc id=${(0,U.ifDefined)(b)}>${o.description}</desc>`:L.nothing}
|
|
32
|
+
${y?L.svg`<style>${kn}</style>`:L.nothing} ${Oi(o)}
|
|
33
|
+
${ut(o.shapes)}
|
|
34
|
+
${ut(this.tip.length||!this.crossState?this.tip:Kt(o,this.crossState))}
|
|
35
|
+
${ut(cn(o,this.focused))} ${ut(this.overlay)}
|
|
36
|
+
</svg>
|
|
37
|
+
${S?L.html`<div
|
|
38
|
+
role="tooltip"
|
|
39
|
+
data-skdx-tooltip=${r}
|
|
40
|
+
style="left:${S.x+12}px;top:${S.y+12}px"
|
|
41
|
+
>
|
|
42
|
+
${S.lines.map(v=>L.html`<div>${v}</div>`)}
|
|
43
|
+
</div>`:L.nothing}
|
|
44
|
+
${x?L.html`<table data-skdx-table=${r}>
|
|
45
|
+
<caption>
|
|
46
|
+
${p}
|
|
47
|
+
</caption>
|
|
48
|
+
<thead>
|
|
49
|
+
<tr>
|
|
50
|
+
${(x[0]??[]).map(v=>L.html`<th scope="col">${v}</th>`)}
|
|
51
|
+
</tr>
|
|
52
|
+
</thead>
|
|
53
|
+
<tbody>
|
|
54
|
+
${x.slice(1).map(v=>L.html`<tr>
|
|
55
|
+
${v.map((f,w)=>w===0?L.html`<th scope="row">${f}</th>`:L.html`<td>${f}</td>`)}
|
|
56
|
+
</tr>`)}
|
|
57
|
+
</tbody>
|
|
58
|
+
</table>`:L.nothing}`}};B.styles=L.css`
|
|
59
|
+
:host {
|
|
60
|
+
display: inline-block;
|
|
61
|
+
}
|
|
62
|
+
svg {
|
|
63
|
+
display: block;
|
|
64
|
+
max-width: 100%;
|
|
65
|
+
height: auto;
|
|
66
|
+
outline: none;
|
|
67
|
+
}
|
|
68
|
+
svg[data-zoomable] {
|
|
69
|
+
cursor: grab;
|
|
70
|
+
touch-action: none;
|
|
71
|
+
}
|
|
72
|
+
svg[data-brushing] {
|
|
73
|
+
cursor: crosshair;
|
|
74
|
+
touch-action: none;
|
|
75
|
+
}
|
|
76
|
+
svg[data-editable] {
|
|
77
|
+
touch-action: none;
|
|
78
|
+
}
|
|
79
|
+
:host([responsive]) {
|
|
80
|
+
display: block;
|
|
81
|
+
}
|
|
82
|
+
table {
|
|
83
|
+
position: absolute;
|
|
84
|
+
width: 1px;
|
|
85
|
+
height: 1px;
|
|
86
|
+
margin: -1px;
|
|
87
|
+
padding: 0;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
clip: rect(0 0 0 0);
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
border: 0;
|
|
92
|
+
}
|
|
93
|
+
[role='tooltip'] {
|
|
94
|
+
position: fixed;
|
|
95
|
+
pointer-events: none;
|
|
96
|
+
z-index: 1000;
|
|
97
|
+
background: var(--skdx-color-surface-raised);
|
|
98
|
+
color: var(--skdx-color-text-default);
|
|
99
|
+
border: 1px solid var(--skdx-color-border-strong);
|
|
100
|
+
border-radius: 3px;
|
|
101
|
+
padding: 4px 8px;
|
|
102
|
+
font-family: var(--skdx-font-family);
|
|
103
|
+
font-size: var(--skdx-font-size-xs);
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
}
|
|
106
|
+
[role='tooltip'] > :first-child:not(:only-child) {
|
|
107
|
+
font-weight: bold;
|
|
108
|
+
}
|
|
109
|
+
`,M([(0,$.property)({type:Number})],B.prototype,"width",2),M([(0,$.property)({type:Number})],B.prototype,"height",2),M([(0,$.property)()],B.prototype,"label",2),M([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"legend",2),M([(0,$.property)({type:Boolean,attribute:"no-tooltip",converter:zi})],B.prototype,"tooltip",2),M([(0,$.property)({attribute:!1})],B.prototype,"format",2),M([(0,$.property)({attribute:!1})],B.prototype,"palette",2),M([(0,$.property)({attribute:!1})],B.prototype,"hiddenSeries",2),M([(0,$.property)({attribute:!1})],B.prototype,"selected",2),M([(0,$.property)({attribute:"selection-mode"})],B.prototype,"selectionMode",2),M([(0,$.property)({attribute:!1})],B.prototype,"highlighted",2),M([(0,$.property)({attribute:!1})],B.prototype,"highlightScope",2),M([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"loading",2),M([(0,$.property)()],B.prototype,"error",2),M([(0,$.property)({attribute:"empty-message"})],B.prototype,"emptyMessage",2),M([(0,$.property)()],B.prototype,"description",2),M([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"decorative",2),M([(0,$.property)({type:Boolean,attribute:"accessible-table"})],B.prototype,"accessibleTable",2),M([(0,$.property)({attribute:!1})],B.prototype,"zoom",2),M([(0,$.property)({attribute:!1})],B.prototype,"view",2),M([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"zoomable",2),M([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"editable",2),M([(0,$.property)({attribute:"sync-id"})],B.prototype,"syncId",2),M([(0,$.property)({type:Boolean,attribute:"cross-filter"})],B.prototype,"crossFilter",2),M([(0,$.property)({converter:{fromAttribute:t=>t===null?!1:t===""?!0:Number(t)}})],B.prototype,"animated",2),M([(0,$.property)({type:Boolean,reflect:!0})],B.prototype,"responsive",2),M([(0,$.state)()],B.prototype,"tip",2),M([(0,$.state)()],B.prototype,"overlay",2),M([(0,$.state)()],B.prototype,"portal",2),M([(0,$.state)()],B.prototype,"measured",2),M([(0,$.state)()],B.prototype,"viewState",2),M([(0,$.state)()],B.prototype,"highlightState",2),M([(0,$.state)()],B.prototype,"crossState",2),M([(0,$.state)()],B.prototype,"focused",2),M([(0,$.state)()],B.prototype,"hiddenState",2),M([(0,$.state)()],B.prototype,"zoomState",2),M([(0,$.state)()],B.prototype,"selectedState",2);var E=class extends B{constructor(){super(...arguments);this.series=[];this.labels=!1;this.connectNulls=!1;this.stacked=!1;this.brush=!1;this.crosshair=!1}input(){let{series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:l,annotations:c,labels:d,curve:u,connectNulls:h,nulls:b,stacked:y,stackOffset:x,orientation:p,radius:S,barGap:v,barWidth:f,sort:w,transform:A,transforms:k,bins:z,binWidth:_,binDomain:H,binMode:P,sampling:X,brush:Q,crosshair:te}=this;return{...this.sized(),series:t,categories:r,xAxis:i,yAxis:o,rightAxis:s,references:l,annotations:c,labels:d,curve:u,connectNulls:h,nulls:b,stacked:y,stackOffset:x,orientation:p,radius:S,barGap:v,barWidth:f,sort:w,transform:A,transforms:k,bins:z,binWidth:_,binDomain:H,binMode:P,sampling:X,brush:Q,crosshair:te}}};M([(0,$.property)({attribute:!1})],E.prototype,"series",2),M([(0,$.property)({attribute:!1})],E.prototype,"categories",2),M([(0,$.property)({attribute:!1})],E.prototype,"xAxis",2),M([(0,$.property)({attribute:!1})],E.prototype,"yAxis",2),M([(0,$.property)({attribute:!1})],E.prototype,"rightAxis",2),M([(0,$.property)({attribute:!1})],E.prototype,"references",2),M([(0,$.property)({attribute:!1})],E.prototype,"annotations",2),M([(0,$.property)({type:Boolean,reflect:!0})],E.prototype,"labels",2),M([(0,$.property)()],E.prototype,"curve",2),M([(0,$.property)({type:Boolean,attribute:"connect-nulls"})],E.prototype,"connectNulls",2),M([(0,$.property)()],E.prototype,"nulls",2),M([(0,$.property)({reflect:!0,converter:{fromAttribute:t=>t==="percent"?"percent":t!==null}})],E.prototype,"stacked",2),M([(0,$.property)({attribute:"stack-offset"})],E.prototype,"stackOffset",2),M([(0,$.property)()],E.prototype,"orientation",2),M([(0,$.property)({type:Number})],E.prototype,"radius",2),M([(0,$.property)({type:Number,attribute:"bar-gap"})],E.prototype,"barGap",2),M([(0,$.property)({type:Number,attribute:"bar-width"})],E.prototype,"barWidth",2),M([(0,$.property)()],E.prototype,"sort",2),M([(0,$.property)()],E.prototype,"transform",2),M([(0,$.property)({attribute:!1})],E.prototype,"transforms",2),M([(0,$.property)({type:Number})],E.prototype,"bins",2),M([(0,$.property)({type:Number,attribute:"bin-width"})],E.prototype,"binWidth",2),M([(0,$.property)({attribute:!1})],E.prototype,"binDomain",2),M([(0,$.property)({attribute:"bin-mode"})],E.prototype,"binMode",2),M([(0,$.property)({attribute:!1})],E.prototype,"sampling",2),M([(0,$.property)({type:Boolean,reflect:!0})],E.prototype,"brush",2),M([(0,$.property)({type:Boolean,reflect:!0})],E.prototype,"crosshair",2);var Oi=e=>e.defs&&e.defs.length?L.svg`<defs>${e.defs.map(n=>L.svg`<linearGradient id=${n.id} x1="0" y1="0" x2=${n.vertical===!1?1:0} y2=${n.vertical===!1?0:1}>${n.stops.map(t=>L.svg`<stop offset=${t.offset} stop-color=${t.color} stop-opacity=${(0,U.ifDefined)(t.opacity)}></stop>`)}</linearGradient>`)}</defs>`:L.nothing,ut=e=>L.svg`${e.map((n,t)=>{let r=n.title?L.svg`<title>${n.title}</title>`:L.nothing,i=n.item?t:void 0;switch(n.kind){case"path":return L.svg`<path data-skdx-part=${n.part} data-skdx-i=${(0,U.ifDefined)(i)} d=${n.d} fill=${n.fill??"none"} stroke=${(0,U.ifDefined)(n.stroke)} stroke-width=${(0,U.ifDefined)(n.strokeWidth)} stroke-linecap=${(0,U.ifDefined)(n.strokeLinecap)} stroke-linejoin=${(0,U.ifDefined)(n.strokeLinejoin)} stroke-dasharray=${(0,U.ifDefined)(n.dash)} opacity=${(0,U.ifDefined)(n.opacity)} fill-opacity=${(0,U.ifDefined)(n.fillOpacity)}>${r}</path>`;case"rect":return L.svg`<rect data-skdx-part=${n.part} data-skdx-i=${(0,U.ifDefined)(i)} x=${n.x} y=${n.y} width=${n.width} height=${n.height} rx=${(0,U.ifDefined)(n.rx)} fill=${n.fill} stroke=${(0,U.ifDefined)(n.stroke)} fill-opacity=${(0,U.ifDefined)(n.opacity)}>${r}</rect>`;case"line":return L.svg`<line data-skdx-part=${n.part} data-skdx-i=${(0,U.ifDefined)(i)} x1=${n.x1} y1=${n.y1} x2=${n.x2} y2=${n.y2} stroke=${n.stroke} stroke-width=${(0,U.ifDefined)(n.strokeWidth)} stroke-dasharray=${(0,U.ifDefined)(n.dash)} opacity=${(0,U.ifDefined)(n.opacity)}>${r}</line>`;case"circle":return L.svg`<circle data-skdx-part=${n.part} data-skdx-i=${(0,U.ifDefined)(i)} cx=${n.cx} cy=${n.cy} r=${n.r} fill=${n.fill} stroke=${(0,U.ifDefined)(n.stroke)} opacity=${(0,U.ifDefined)(n.opacity)}>${r}</circle>`;case"text":return L.svg`<text data-skdx-part=${n.part} data-skdx-i=${(0,U.ifDefined)(i)} x=${n.x} y=${n.y} text-anchor=${(0,U.ifDefined)(n.anchor)} dominant-baseline=${(0,U.ifDefined)(n.baseline)} fill=${(0,U.ifDefined)(n.fill)} font-weight=${(0,U.ifDefined)(n.weight)} pointer-events=${(0,U.ifDefined)(i===void 0?"none":void 0)} transform=${(0,U.ifDefined)(n.rotate?`rotate(${n.rotate} ${n.x} ${n.y})`:void 0)}>${n.text}</text>`}})}`;var _e=class extends E{render(){return this.root(Zt(this.input()),"combo",this.label??"Combo chart")}};_e=M([(0,Vr.customElement)("skdx-combo-chart")],_e);0&&(module.exports={SkdxComboChart});
|
package/dist/combo.d.cts
ADDED
package/dist/combo.d.ts
ADDED