@blukavantui/charts-community 1.0.1 → 1.2.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.
Files changed (98) hide show
  1. package/LICENSE.txt +0 -2
  2. package/README.md +75 -70
  3. package/dist/bar.js +1 -1
  4. package/dist/browser/charts-community.css +1 -1
  5. package/dist/browser/charts-community.js +17 -17
  6. package/dist/build-audit.json +129 -84
  7. package/dist/catalogue-runtime.d.ts +13 -1
  8. package/dist/chunk-2GUWWKHW.js +1 -0
  9. package/dist/chunk-3PITHTEO.js +1 -0
  10. package/dist/chunk-4B5MQ6GZ.js +1 -0
  11. package/dist/chunk-4EQMOBBN.js +1 -0
  12. package/dist/chunk-4WDZUJDS.js +1 -0
  13. package/dist/chunk-5NUOOMHV.js +1 -0
  14. package/dist/chunk-7OCMRHIH.js +1 -0
  15. package/dist/chunk-CF5Q2DDP.js +1 -0
  16. package/dist/chunk-EITBQBN2.js +1 -0
  17. package/dist/chunk-FXNKAHRG.js +1 -0
  18. package/dist/chunk-IDMAFTWV.js +1 -0
  19. package/dist/chunk-ILTENI35.js +1 -0
  20. package/dist/chunk-KRMM7EWI.js +1 -0
  21. package/dist/chunk-LUUPBBD4.js +1 -0
  22. package/dist/chunk-MR5VITXX.js +1 -0
  23. package/dist/chunk-NASBRHIW.js +1 -0
  24. package/dist/chunk-NXDBBMF5.js +1 -0
  25. package/dist/chunk-OQ6MP7PY.js +1 -0
  26. package/dist/{chunk-QETOF22L.js → chunk-RC2TCMJF.js} +1 -1
  27. package/dist/{chunk-MSZ5J5WG.js → chunk-RXOGAN23.js} +1 -1
  28. package/dist/chunk-UGXWOWAG.js +2 -0
  29. package/dist/chunk-UO2KNHTU.js +2 -0
  30. package/dist/chunk-UQMMBG26.js +3 -0
  31. package/dist/chunk-VTJ4XPRV.js +1 -0
  32. package/dist/chunk-WJ3UHH6J.js +1 -0
  33. package/dist/chunk-XLJUSNGV.js +1 -0
  34. package/dist/doughnut.js +1 -1
  35. package/dist/heatmap.js +1 -1
  36. package/dist/index.js +1 -1
  37. package/dist/line.js +1 -1
  38. package/dist/motion/bar.css +1 -0
  39. package/dist/motion/bar.d.ts +8 -0
  40. package/dist/motion/bar.js +1 -0
  41. package/dist/motion/doughnut.css +1 -0
  42. package/dist/motion/doughnut.d.ts +8 -0
  43. package/dist/motion/doughnut.js +1 -0
  44. package/dist/motion/heatmap.css +1 -0
  45. package/dist/motion/heatmap.d.ts +7 -0
  46. package/dist/motion/heatmap.js +1 -0
  47. package/dist/motion/line.css +1 -0
  48. package/dist/motion/line.d.ts +8 -0
  49. package/dist/motion/line.js +1 -0
  50. package/dist/motion/pie.css +1 -0
  51. package/dist/motion/pie.d.ts +8 -0
  52. package/dist/motion/pie.js +1 -0
  53. package/dist/motion/radar.css +1 -0
  54. package/dist/motion/radar.d.ts +8 -0
  55. package/dist/motion/radar.js +1 -0
  56. package/dist/motion/scatter.css +1 -0
  57. package/dist/motion/scatter.d.ts +8 -0
  58. package/dist/motion/scatter.js +1 -0
  59. package/dist/motion/sparkline.d.ts +7 -0
  60. package/dist/motion/sparkline.js +1 -0
  61. package/dist/motion-collection.d.ts +7 -0
  62. package/dist/motion-community.d.ts +40 -0
  63. package/dist/motion-policy.d.ts +14 -0
  64. package/dist/motion.css +1 -0
  65. package/dist/motion.d.ts +40 -0
  66. package/dist/motion.js +1 -0
  67. package/dist/pie.js +1 -1
  68. package/dist/radar.js +1 -1
  69. package/dist/scatter.js +1 -1
  70. package/dist/sparkline.js +1 -1
  71. package/dist/styles.css +8 -0
  72. package/dist/web-api.json +162 -2
  73. package/dist/web-motion-sparkline.d.ts +4 -0
  74. package/edition.json +1 -1
  75. package/package.json +40 -33
  76. package/src/catalogue-runtime.ts +49 -5
  77. package/src/motion/bar.ts +15 -0
  78. package/src/motion/doughnut.ts +14 -0
  79. package/src/motion/heatmap.ts +14 -0
  80. package/src/motion/line.ts +15 -0
  81. package/src/motion/pie.ts +14 -0
  82. package/src/motion/radar.ts +15 -0
  83. package/src/motion/scatter.ts +15 -0
  84. package/src/motion/sparkline.ts +10 -0
  85. package/src/motion-collection.ts +20 -0
  86. package/src/motion-community.ts +22 -0
  87. package/src/motion-policy.ts +36 -0
  88. package/src/web-motion-sparkline.ts +37 -0
  89. package/dist/chunk-5NXLEMCV.js +0 -3
  90. package/dist/chunk-FHHQWCUO.js +0 -1
  91. package/dist/chunk-FZ7J7BEC.js +0 -1
  92. package/dist/chunk-JNSBTZUP.js +0 -2
  93. package/dist/chunk-KCW3WN5P.js +0 -1
  94. package/dist/chunk-QBKO4AG7.js +0 -1
  95. package/dist/chunk-QFXXWRD5.js +0 -1
  96. package/dist/chunk-YJKEV5J7.js +0 -2
  97. package/scripts/build.mjs +0 -31
  98. package/tsconfig.json +0 -16
@@ -0,0 +1,15 @@
1
+ /** Optional motion factory; preserves the original chart contract. */
2
+ import type {ComponentMotionSettings} from '@blukavantui/community/motion/settings';
3
+ import {configuredChart,type MotionState} from '../motion-policy.ts';
4
+ import {use} from 'echarts/core';
5
+ import {createChartRuntime} from '../catalogue-runtime.ts';
6
+ import {ScatterChart} from 'echarts/charts';
7
+ import {GridComponent} from 'echarts/components';
8
+ import {buildOption as scatter} from '../builders/scatter.ts';
9
+ import type {ChartPoint,ScatterOptions} from '../catalogue-types.ts';
10
+ import type {ChartEvents} from '../types.ts';
11
+ export function createMotionScatterChart(host: HTMLElement, options: ScatterOptions, motion: MotionState, events: ChartEvents<ChartPoint> = {}, settings:ComponentMotionSettings = {}) {
12
+ return configuredChart(host,motion,settings,(policy,host)=>{
13
+ use([ScatterChart, GridComponent]); return createChartRuntime<ScatterOptions, ChartPoint>(host, 'scatter', options, events, scatter, policy);
14
+ });
15
+ }
@@ -0,0 +1,10 @@
1
+ /** Optional motion factory; preserves the original chart contract. */
2
+ import type {ComponentMotionSettings} from '@blukavantui/community/motion/settings';
3
+ import {configuredChart,type MotionState} from '../motion-policy.ts';
4
+ import {createMotionSparkline as sparklineWithPolicy} from '../web-motion-sparkline.ts';
5
+ import type {SparklineOptions,SparklineEvents} from '../sparkline.ts';
6
+ export function createMotionSparkline(host: HTMLElement, options: SparklineOptions, motion: MotionState, events: SparklineEvents = {}, settings:ComponentMotionSettings = {}) {
7
+ return configuredChart(host,motion,settings,(policy,host)=>{
8
+ return sparklineWithPolicy(host, options, events, policy);
9
+ });
10
+ }
@@ -0,0 +1,20 @@
1
+ import {createMotionSettingsGroup} from '@blukavantui/community/motion/settings';
2
+ import type {ComponentMotionSettings} from '@blukavantui/community/motion/settings';
3
+ import type {MotionState} from './motion-policy.ts';
4
+ export function bindMotionCharts<F extends Record<string, (host:any,options:any,motion:MotionState,events?:any,settings?:ComponentMotionSettings)=>any>>(factories:F, motion:MotionState,defaults:ComponentMotionSettings={}) {
5
+ const settings=createMotionSettingsGroup(defaults);
6
+ const owned=new Set<{destroy():void}>(); let dead=false;
7
+ function bind<F extends (host:any,options:any,motion:MotionState,events?:any,settings?:ComponentMotionSettings)=>any>(factory:F) {
8
+ return (host:Parameters<F>[0],options:Parameters<F>[1],events:Parameters<F>[3]={}):ReturnType<F> => {
9
+ if(dead)throw Error('Motion charts are destroyed.');
10
+ const instance=factory(host,options,motion,events,settings.settings),destroy=instance.destroy.bind(instance);let disposed=false;
11
+ const binding=settings.bind(instance.setMotion);instance.setMotion=binding.setMotion;
12
+ instance.destroy=()=>{if(disposed)return;disposed=true;owned.delete(instance);binding.destroy();destroy();};owned.add(instance);return instance;
13
+ };
14
+ }
15
+ return {
16
+ configure(next:ComponentMotionSettings={}){if(dead)throw Error('Motion charts are destroyed.');settings.configure(next);},
17
+ ...Object.fromEntries(Object.entries(factories).map(([name,factory])=>[name,bind(factory)])) as {[K in keyof F]:(host:Parameters<F[K]>[0],options:Parameters<F[K]>[1],events?:Parameters<F[K]>[3])=>ReturnType<F[K]>},
18
+ destroy(){if(dead)return;dead=true;for(const instance of [...owned])instance.destroy();}
19
+ };
20
+ }
@@ -0,0 +1,22 @@
1
+ import {bindMotionCharts} from './motion-collection.ts';
2
+ import type {MotionState} from './motion-policy.ts';
3
+ import type {ComponentMotionSettings} from '@blukavantui/community/motion/settings';
4
+ import {createMotionSparkline} from './motion/sparkline.ts';
5
+ export {createMotionSparkline} from './motion/sparkline.ts';
6
+ import {createMotionLineChart} from './motion/line.ts';
7
+ export {createMotionLineChart} from './motion/line.ts';
8
+ import {createMotionBarChart} from './motion/bar.ts';
9
+ export {createMotionBarChart} from './motion/bar.ts';
10
+ import {createMotionPieChart} from './motion/pie.ts';
11
+ export {createMotionPieChart} from './motion/pie.ts';
12
+ import {createMotionDoughnutChart} from './motion/doughnut.ts';
13
+ export {createMotionDoughnutChart} from './motion/doughnut.ts';
14
+ import {createMotionScatterChart} from './motion/scatter.ts';
15
+ export {createMotionScatterChart} from './motion/scatter.ts';
16
+ import {createMotionRadarChart} from './motion/radar.ts';
17
+ export {createMotionRadarChart} from './motion/radar.ts';
18
+ import {createMotionHeatmap} from './motion/heatmap.ts';
19
+ export {createMotionHeatmap} from './motion/heatmap.ts';
20
+ export function createMotionCharts(motion:MotionState,defaults:ComponentMotionSettings={}) {
21
+ return bindMotionCharts({createSparkline:createMotionSparkline,createLineChart:createMotionLineChart,createBarChart:createMotionBarChart,createPieChart:createMotionPieChart,createDoughnutChart:createMotionDoughnutChart,createScatterChart:createMotionScatterChart,createRadarChart:createMotionRadarChart,createHeatmap:createMotionHeatmap},motion,defaults);
22
+ }
@@ -0,0 +1,36 @@
1
+ import type {ChartPresentation} from './catalogue-runtime.ts';
2
+ import {createComponentMotionState,validateComponentMotion,type ComponentMotionSettings} from '@blukavantui/community/motion/settings';
3
+ import {motionEasings} from '@blukavantui/community/motion';
4
+ export interface MotionState { readonly mode:'full'|'reduced'|'off'; }
5
+ const engineEasing={standard:'cubicOut','ease-in':'cubicIn','ease-out':'cubicOut','ease-in-out':'cubicInOut',linear:'linear',spring:'backOut'};
6
+ export function chartMotionPolicy(motion:MotionState,state?:ReturnType<typeof createComponentMotionState>) {
7
+ const listeners=new Set<()=>void>();
8
+ const policy:ChartPresentation & {notify():void} = {
9
+ mode(host) {
10
+ if(motion.mode==='off'||host.closest('[data-blu-motion="off"], .blu-motion-off'))return 'off';
11
+ return motion.mode==='reduced'||host.closest('[data-blu-motion="reduced"]')?'reduced':'full';
12
+ },
13
+ timing() {const s=state?.settings;return {duration:s?.duration,easing:s?.easing?engineEasing[s.easing]:undefined,curve:s?.easing?motionEasings[s.easing]:undefined};},
14
+ subscribe(host,refresh) {
15
+ let previous=policy.mode(host);
16
+ const changed=()=>{previous=policy.mode(host);refresh();};listeners.add(changed);
17
+ const observer=new MutationObserver(()=>{if(policy.mode(host)!==previous)changed();});
18
+ for(let ancestor:HTMLElement|null=host;ancestor;ancestor=ancestor.parentElement)observer.observe(ancestor,{attributes:true,attributeFilter:['data-blu-motion','class']});
19
+ return ()=>{listeners.delete(changed);observer.disconnect();};
20
+ },
21
+ notify(){for(const listener of listeners)listener();},
22
+ };
23
+ return policy;
24
+ }
25
+ /** Preserves the original chart instance, selection, events, licence and disposal. */
26
+ export function configuredChart<C extends {destroy():void}>(host:HTMLElement,motion:MotionState,settings:ComponentMotionSettings,create:(policy:ChartPresentation,root:HTMLElement)=>C) {
27
+ validateComponentMotion(settings);
28
+ // A collection may append several charts to one host. Each owns its own scope.
29
+ const root=document.createElement('div');root.className='blu-chart-motion-scope';host.append(root);
30
+ const state=createComponentMotionState(root,motion,settings),policy=chartMotionPolicy(motion,state);
31
+ let instance:C;
32
+ try{instance=create(policy,root);}catch(error){state.destroy();root.remove();throw error;}
33
+ const destroy=instance.destroy.bind(instance);let dead=false;
34
+ instance.destroy=()=>{if(dead)return;dead=true;destroy();state.destroy();root.remove();};
35
+ return Object.assign(instance,{setMotion(next:ComponentMotionSettings={}){if(dead)throw Error('Chart motion is destroyed.');state.update(next);policy.notify();}});
36
+ }
@@ -0,0 +1,37 @@
1
+ /** Local opt-in adapter. The compact SVG runtime and its ordinary defaults stay intact. */
2
+ import { createSparkline, type SparklineOptions, type SparklineEvents } from './sparkline.ts';
3
+ import { validateSparkline } from './sparkline-validation.ts';
4
+ import type { ChartPresentation } from './catalogue-runtime.ts';
5
+ export function createMotionSparkline(host: HTMLElement, options: SparklineOptions, events: SparklineEvents, policy: ChartPresentation) {
6
+ let requested = structuredClone(options), dead = false, paused = false;
7
+ const effective = () => {
8
+ if(policy.enabled?.()===false)return {...requested};
9
+ const animation=requested.Animation??(requested.AnimateGlow===false?'Off':'Once');
10
+ return {...requested,Animation:policy.mode(host)!=='full'||(animation==='Once'&&policy.timing?.().duration===0)?'Off':animation} as SparklineOptions;
11
+ };
12
+ function finiteTiming() {
13
+ if(policy.enabled?.()===false||effective().Animation!=='Once')return; // Continuous glow keeps its own cadence and Pause control.
14
+ const timing=policy.timing?.();
15
+ for(const element of instance.element.querySelectorAll('animateMotion')){
16
+ if(timing?.duration!==undefined)element.setAttribute('dur',timing.duration/1000+'s');
17
+ const curve=timing?.curve?.match(/^cubic-bezier\((.+)\)$/)?.[1];
18
+ if(curve){element.setAttribute('calcMode','spline');element.setAttribute('keyTimes','0;1');element.setAttribute('keySplines',curve.split(',').map(v=>Math.max(0,Math.min(1,Number(v)))).join(' '));}
19
+ else if(timing?.curve==='linear')element.setAttribute('calcMode','linear');
20
+ }
21
+ }
22
+ const instance = createSparkline(host, effective(), events), update = instance.update, destroy = instance.destroy;
23
+ const pauseState = (event: Event) => { if (!(event.target instanceof Element) || !event.target.closest('.blu-sparkline__pause')) return; const svg = instance.element.querySelector('svg'); if (svg?.animationsPaused) paused = svg.animationsPaused(); };
24
+ // Preserve the user's Pause choice across scope changes and recreated SVGs.
25
+ instance.element.addEventListener('click', pauseState);
26
+ const restorePause = () => { const svg = instance.element.querySelector('svg'); if (paused && svg?.animationsPaused && !svg.animationsPaused()) instance.element.querySelector<HTMLButtonElement>('.blu-sparkline__pause')?.click(); };
27
+ finiteTiming();
28
+ const stop = policy.subscribe(host, () => { update(effective()); finiteTiming(); restorePause(); });
29
+ instance.update = patch => {
30
+ if (dead) throw Error('Component is destroyed.');
31
+ const next = { ...requested, ...structuredClone(patch) }; validateSparkline(next);
32
+ if (patch.Animation !== undefined && patch.Animation !== requested.Animation) paused = false;
33
+ requested = next; update(effective()); finiteTiming(); restorePause();
34
+ };
35
+ instance.destroy = () => { if (dead) return; dead = true; stop(); instance.element.removeEventListener('click', pauseState); destroy(); };
36
+ return instance;
37
+ }
@@ -1,3 +0,0 @@
1
- import{a as s,b as K,c as g,f as v,j as N,k as P,l as D,n as I}from"./chunk-QFXXWRD5.js";import{e as k,g as x}from"./chunk-QETOF22L.js";function R(u,o,O,M=!1,z=640){let n="doughnut",a=u,$=K(n,u),E=(e,t)=>a.ShowPatterns?N(e,t):void 0,f=o.palette,b=(e,t)=>v(o.forcedColors?o.text:k(e,f[t%f.length],o.dark,o.read),o.surface,n==="line"||n==="radar"||n==="polar"&&a.PolarType==="Line"?4.5:3.2),H=(e,t,l)=>D(b(t,l),o.surface,a.SelectedKey===e),V=(e,t)=>$.find(l=>l.Key===e&&(!t||l.SeriesKey===t)),F={data:["line","radar","bar","polar"].includes(n)?a.Series.map(e=>e.Label):n==="scatter"?[...new Set(a.Points.map(e=>e.Group||"Observations"))]:["pie","doughnut","nightingale","funnel"].includes(n)?[...new Set(a.Items.map(e=>e.Label))]:[],show:a.ShowLegend,type:"scroll",top:6,left:10,right:10,itemWidth:24,itemHeight:12,selectedMode:!1,pageTextStyle:{color:o.muted},pageIconColor:o.text,textStyle:{color:o.muted,fontSize:11}},A={show:a.ShowLabels,color:x(o.surface),fontSize:11,backgroundColor:o.surface,padding:[2,3],borderRadius:2},X={show:a.ShowTooltip,confine:!0,enterable:!0,backgroundColor:o.surface,borderColor:o.border,textStyle:{color:o.text,fontSize:12},formatter:e=>{let t=e.data?.point;if(!t)return`${s(e.name||"")}${e.value==null||Number.isNaN(e.value)?" \xB7 No data":""}`;let l=t.Date?`<br/>${s(t.Date)}<br/><strong>${s(g(t.Value,a))}</strong>`:t.X!==void 0?`<br/>${s(a.XLabel||"X")}: ${t.X}<br/>${s(a.YLabel||"Y")}: ${t.Y}${t.Size===void 0?"":`<br/>Size: ${t.Size}`}`:`<br/><strong>${s(g(t.Value,a))}</strong>`;return`${s(t.SeriesName?`${t.SeriesName} \xB7 ${t.Label}`:t.Label)}${l}${e.data?.conversion?`<br/>${s(e.data.conversion)}`:""}`}},B={backgroundColor:o.surface,color:f.map((e,t)=>b(e,t)),animation:!!a.EnableAnimation&&!M,animationDuration:300,animationDurationUpdate:150,textStyle:{fontFamily:"Inter,system-ui,sans-serif",color:o.text},aria:{enabled:!0,description:`${a.Title}. ${a.Description||""} Exact values and keyboard selection are in the data table.`},tooltip:X},Z={axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:o.muted,fontSize:10,hideOverlap:!0},splitLine:{lineStyle:{color:o.border,type:"dashed"}}},r=u,d=r.Nested?r.Rings:[{Key:"",Label:""}],m=r.Shape==="Half",y=!!r.Nested&&d.length>1,h=n==="pie"?0:r.InnerRadius??(n==="doughnut"?48:18),C=r.LabelPosition!=="Inside",S=C?66:76,Y=[...new Set(r.Items.map(e=>e.Label))],w=d.map((e,t)=>{let l=y?t===0?[0,32]:[44+(S-44)*(t-1)/(d.length-1),44+(S-44)*t/(d.length-1)-(t===d.length-1?0:2)]:[h,Math.max(S,h+5)],p=!C||y&&t<d.length-1;return{type:"pie",id:e.Key||n,name:e.Label,top:a.ShowLegend?28:0,bottom:2,center:["50%",m?"72%":"55%"],radius:l.map(i=>`${i}%`),startAngle:m?180:90,endAngle:m?360:"auto",roseType:n==="nightingale"?r.RoseMode==="Radius"?"radius":"area":!1,avoidLabelOverlap:!0,stillShowZeroSum:!1,label:{...A,position:p?"inside":"outside",backgroundColor:p?void 0:o.surface,alignTo:"none",bleedMargin:6,distanceToLabelLine:4,formatter:`{b}
2
- {d}%`,lineHeight:15},labelLine:{show:!!a.ShowLabels&&!p,length:12,length2:8,smooth:.15},labelLayout:{hideOverlap:!0},emphasis:{scale:!0},data:r.Items.filter(i=>!r.Nested||i.RingKey===e.Key).map(i=>{let L=Y.indexOf(i.Label),c=b(i.Color,L);return{id:i.Key,name:i.Label,value:i.Value,point:V(i.Key),label:{color:x(p?c:o.surface),backgroundColor:p?c:o.surface},labelLine:{lineStyle:{color:c,width:1.25}},itemStyle:{...H(i.Key,i.Color,L),decal:E(L,c),borderRadius:3},emphasis:{itemStyle:P(c)}}})}}),T=$.find(e=>e.Key===a.SelectedKey),q=T?.Value??r.Items.reduce((e,t)=>e+(t.Value||0),0);return{...B,legend:F,series:w,media:C?[{query:{maxWidth:420},option:{series:w.map(e=>({id:e.id,radius:e.radius.map(t=>`${parseFloat(t)*.84}%`)}))}}]:[],graphic:n==="doughnut"&&!y&&h>=35?[{type:"text",left:"center",top:m?"63%":"48%",silent:!0,style:{text:`${g(q,a,!0)}
3
- ${T?.Label||r.CenterLabel||"Total"}`,textAlign:"center",fill:o.text,font:"600 16px Inter,system-ui",lineHeight:24,width:Math.max(24,Math.min(z,a.Height||320)*h/100-12),overflow:"truncate"}}]:[]}}import{use as G}from"echarts/core";import{PieChart as W}from"echarts/charts";function ce(u,o,O={}){return G([W]),I(u,"doughnut",o,O,R)}export{ce as a};
@@ -1 +0,0 @@
1
- import{a as l,b as x,c as d,f as L,h as O,i as $,j as w,k as T,l as f,n as v}from"./chunk-QFXXWRD5.js";import{e as k,g as u}from"./chunk-QETOF22L.js";function N(s,o,g,P=!1,z=640){let a=s,K=x("bar",s),h=(e,t)=>a.ShowPatterns?w(e,t):void 0,m=o.palette,i=(e,t)=>L(o.forcedColors?o.text:k(e,m[t%m.length],o.dark,o.read),o.surface,3.2),B=(e,t,n)=>f(i(t,n),o.surface,a.SelectedKey===e),A=(e,t)=>K.find(n=>n.Key===e&&(!t||n.SeriesKey===t)),D={data:["line","radar","bar","polar"].includes("bar")?a.Series.map(e=>e.Label):["pie","doughnut","nightingale","funnel"].includes("bar")?[...new Set(a.Items.map(e=>e.Label))]:[],show:a.ShowLegend,type:"scroll",top:6,left:10,right:10,itemWidth:24,itemHeight:12,selectedMode:!1,pageTextStyle:{color:o.muted},pageIconColor:o.text,textStyle:{color:o.muted,fontSize:11}},E={show:a.ShowLabels,color:u(o.surface),fontSize:11,backgroundColor:o.surface,padding:[2,3],borderRadius:2},M={show:a.ShowTooltip,confine:!0,enterable:!0,backgroundColor:o.surface,borderColor:o.border,textStyle:{color:o.text,fontSize:12},formatter:e=>{let t=e.data?.point;if(!t)return`${l(e.name||"")}${e.value==null||Number.isNaN(e.value)?" \xB7 No data":""}`;let n=t.Date?`<br/>${l(t.Date)}<br/><strong>${l(d(t.Value,a))}</strong>`:t.X!==void 0?`<br/>${l(a.XLabel||"X")}: ${t.X}<br/>${l(a.YLabel||"Y")}: ${t.Y}${t.Size===void 0?"":`<br/>Size: ${t.Size}`}`:`<br/><strong>${l(d(t.Value,a))}</strong>`;return`${l(t.SeriesName?`${t.SeriesName} \xB7 ${t.Label}`:t.Label)}${n}${e.data?.conversion?`<br/>${l(e.data.conversion)}`:""}`}},V={backgroundColor:o.surface,color:m.map((e,t)=>i(e,t)),animation:!!a.EnableAnimation&&!P,animationDuration:300,animationDurationUpdate:150,textStyle:{fontFamily:"Inter,system-ui,sans-serif",color:o.text},aria:{enabled:!0,description:`${a.Title}. ${a.Description||""} Exact values and keyboard selection are in the data table.`},tooltip:M},p={axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:o.muted,fontSize:10,hideOverlap:!0},splitLine:{lineStyle:{color:o.border,type:"dashed"}}},r=s,c=r.Stacking==="Percent",S={...p,type:"category",data:r.Categories.map(e=>e.Label),axisLabel:{...p.axisLabel,width:Math.min(140,z*.2),overflow:"truncate"},splitLine:{show:!1}},C={...p,type:"value",max:c?1:void 0,axisLabel:{...p.axisLabel,formatter:e=>c?`${Math.round(e*100)}%`:d(e,a,!0)}},y=!!r.Stacking&&r.Stacking!=="None",H=r.Series.map((e,t)=>({id:e.Key,name:e.Label,type:"bar",coordinateSystem:"cartesian2d",stack:r.Stacking&&r.Stacking!=="None"?"total":void 0,smooth:r.LineStyle==="Smooth",step:r.LineStyle==="Step"?"middle":!1,connectNulls:!1,areaStyle:r.ShowArea?{opacity:.1}:void 0,barMaxWidth:38,symbol:O(t),symbolSize:8,itemStyle:{...f(i(e.Color,t),o.surface),decal:h(t,i(e.Color,t))},lineStyle:{width:2.5,color:i(e.Color,t),type:$(t)},label:{...E,color:y?u(i(e.Color,t)):u(o.surface),backgroundColor:y?i(e.Color,t):o.surface,position:y?"inside":r.Orientation==="Horizontal"?"right":"top",formatter:n=>c?`${Math.round(Number(n.value)*100)}%`:d(n.data.point.Value,a,!0)},labelLayout:{hideOverlap:!0},emphasis:{focus:"none",scale:!1},blur:{itemStyle:{opacity:1},lineStyle:{opacity:1},label:{opacity:1}},data:e.Values.map((n,b)=>({value:n===null?null:c?n/(r.Series.reduce((F,X)=>F+(X.Values[b]||0),0)||1):n,point:A(r.Categories[b].Key,e.Key),itemStyle:{...B(r.Categories[b].Key,e.Color,t),decal:h(t,i(e.Color,t))},emphasis:{itemStyle:T(i(e.Color,t))}}))}));return{...V,legend:D,grid:{left:14,right:22,top:a.ShowLegend?48:20,bottom:16,containLabel:!0},xAxis:r.Orientation==="Horizontal"?C:S,yAxis:r.Orientation==="Horizontal"?{...S,inverse:!0}:C,series:H}}import{use as G}from"echarts/core";import{BarChart as I}from"echarts/charts";import{GridComponent as R}from"echarts/components";function se(s,o,g={}){return G([I,R]),v(s,"bar",o,g,N)}export{se as a};
@@ -1 +0,0 @@
1
- import{a as n,b as h,c,f as S,h as g,j as C,k as O,l as x,m as L,n as $}from"./chunk-QFXXWRD5.js";import{e as b,g as f}from"./chunk-QETOF22L.js";function v(l,o,u,w=!1,d=640){let i="scatter",a=l,T=h(i,l),F=(e,t)=>a.ShowPatterns?C(e,t):void 0,m=o.palette,p=(e,t)=>S(o.forcedColors?o.text:b(e,m[t%m.length],o.dark,o.read),o.surface,i==="line"||i==="radar"||i==="polar"&&a.PolarType==="Line"?4.5:3.2),k=(e,t,r)=>x(p(t,r),o.surface,a.SelectedKey===e),P=(e,t)=>T.find(r=>r.Key===e&&(!t||r.SeriesKey===t)),z={data:["line","radar","bar","polar"].includes(i)?a.Series.map(e=>e.Label):i==="scatter"?[...new Set(a.Points.map(e=>e.Group||"Observations"))]:["pie","doughnut","nightingale","funnel"].includes(i)?[...new Set(a.Items.map(e=>e.Label))]:[],show:a.ShowLegend,type:"scroll",top:6,left:10,right:10,itemWidth:24,itemHeight:12,selectedMode:!1,pageTextStyle:{color:o.muted},pageIconColor:o.text,textStyle:{color:o.muted,fontSize:11}},K={show:a.ShowLabels,color:f(o.surface),fontSize:11,backgroundColor:o.surface,padding:[2,3],borderRadius:2},N={show:a.ShowTooltip,confine:!0,enterable:!0,backgroundColor:o.surface,borderColor:o.border,textStyle:{color:o.text,fontSize:12},formatter:e=>{let t=e.data?.point;if(!t)return`${n(e.name||"")}${e.value==null||Number.isNaN(e.value)?" \xB7 No data":""}`;let r=t.Date?`<br/>${n(t.Date)}<br/><strong>${n(c(t.Value,a))}</strong>`:t.X!==void 0?`<br/>${n(a.XLabel||"X")}: ${t.X}<br/>${n(a.YLabel||"Y")}: ${t.Y}${t.Size===void 0?"":`<br/>Size: ${t.Size}`}`:`<br/><strong>${n(c(t.Value,a))}</strong>`;return`${n(t.SeriesName?`${t.SeriesName} \xB7 ${t.Label}`:t.Label)}${r}${e.data?.conversion?`<br/>${n(e.data.conversion)}`:""}`}},D={backgroundColor:o.surface,color:m.map((e,t)=>p(e,t)),animation:!!a.EnableAnimation&&!w,animationDuration:300,animationDurationUpdate:150,textStyle:{fontFamily:"Inter,system-ui,sans-serif",color:o.text},aria:{enabled:!0,description:`${a.Title}. ${a.Description||""} Exact values and keyboard selection are in the data table.`},tooltip:N},y={axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:o.muted,fontSize:10,hideOverlap:!0},splitLine:{lineStyle:{color:o.border,type:"dashed"}}},s=l,E=[...new Set(s.Points.map(e=>e.Group||"Observations"))],G=Math.max(1,...s.Points.map(e=>e.Size||0));return{...D,legend:z,grid:{left:20,right:30,top:a.ShowLegend?50:30,bottom:36,containLabel:!0},xAxis:{...y,type:"value",name:s.XLabel||"X",nameLocation:"middle",nameGap:30},yAxis:{...y,type:"value",name:s.YLabel||"Y"},series:E.map((e,t)=>({type:"scatter",name:e,symbol:g(t),itemStyle:{color:p(s.Points.find(r=>(r.Group||"Observations")===e)?.Color,t)},label:{...K,width:Math.min(140,d*.25),overflow:"truncate",position:"top",formatter:"{b}"},labelLayout:L(d,a.Height||320,a.ShowLegend?38:8),symbolSize:(r,X)=>s.Bubble?8+36*Math.sqrt((X.data.point.Size??1)/G):12,emphasis:{focus:"none",scale:!1},blur:{itemStyle:{opacity:1},lineStyle:{opacity:1},label:{opacity:1}},data:s.Points.filter(r=>(r.Group||"Observations")===e).map(r=>({name:r.Label,value:[r.X,r.Y],point:P(r.Key),itemStyle:k(r.Key,r.Color,t),emphasis:{itemStyle:O(p(r.Color,t))}}))}))}}import{use as M}from"echarts/core";import{ScatterChart as Y}from"echarts/charts";import{GridComponent as B}from"echarts/components";function ae(l,o,u={}){return M([Y,B]),$(l,"scatter",o,u,v)}export{ae as a};
@@ -1,2 +0,0 @@
1
- import{a as n,b as w,c as m,f as O,h as T,i as k,j as b,k as v,l as S,m as M,n as K}from"./chunk-QFXXWRD5.js";import{e as L,g as $}from"./chunk-QETOF22L.js";import{format as H}from"echarts/core";function N(p,a,g,R=!1,d=640){let s="radar",o=p,P=w(s,p),X=(e,t)=>o.ShowPatterns?b(e,t):void 0,u=a.palette,y=(e,t)=>O(a.forcedColors?a.text:L(e,u[t%u.length],a.dark,a.read),a.surface,s==="line"||s==="radar"||s==="polar"&&o.PolarType==="Line"?4.5:3.2),Y=(e,t,r)=>S(y(t,r),a.surface,o.SelectedKey===e),j=(e,t)=>P.find(r=>r.Key===e&&(!t||r.SeriesKey===t)),V={data:["line","radar","bar","polar"].includes(s)?o.Series.map(e=>e.Label):s==="scatter"?[...new Set(o.Points.map(e=>e.Group||"Observations"))]:["pie","doughnut","nightingale","funnel"].includes(s)?[...new Set(o.Items.map(e=>e.Label))]:[],show:o.ShowLegend,type:"scroll",top:6,left:10,right:10,itemWidth:24,itemHeight:12,selectedMode:!1,pageTextStyle:{color:a.muted},pageIconColor:a.text,textStyle:{color:a.muted,fontSize:11}},z={show:o.ShowLabels,color:$(a.surface),fontSize:11,backgroundColor:a.surface,padding:[2,3],borderRadius:2},C={show:o.ShowTooltip,confine:!0,enterable:!0,backgroundColor:a.surface,borderColor:a.border,textStyle:{color:a.text,fontSize:12},formatter:e=>{let t=e.data?.point;if(!t)return`${n(e.name||"")}${e.value==null||Number.isNaN(e.value)?" \xB7 No data":""}`;let r=t.Date?`<br/>${n(t.Date)}<br/><strong>${n(m(t.Value,o))}</strong>`:t.X!==void 0?`<br/>${n(o.XLabel||"X")}: ${t.X}<br/>${n(o.YLabel||"Y")}: ${t.Y}${t.Size===void 0?"":`<br/>Size: ${t.Size}`}`:`<br/><strong>${n(m(t.Value,o))}</strong>`;return`${n(t.SeriesName?`${t.SeriesName} \xB7 ${t.Label}`:t.Label)}${r}${e.data?.conversion?`<br/>${n(e.data.conversion)}`:""}`}},D={backgroundColor:a.surface,color:u.map((e,t)=>y(e,t)),animation:!!o.EnableAnimation&&!R,animationDuration:300,animationDurationUpdate:150,textStyle:{fontFamily:"Inter,system-ui,sans-serif",color:a.text},aria:{enabled:!0,description:`${o.Title}. ${o.Description||""} Exact values and keyboard selection are in the data table.`},tooltip:C},B={axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:a.muted,fontSize:10,hideOverlap:!0},splitLine:{lineStyle:{color:a.border,type:"dashed"}}},i=p,h=o.ShowLegend?48:22,f=o.Height||320,E=h+(f-h-38)/2,A=Math.max(12,Math.min(d*.24,(f-h-64)/2)),x=i.Categories.map((e,t)=>{let r=Math.max(1,...i.Series.map(c=>c.Values[t]??0)),l=10**Math.floor(Math.log10(r));return e.Max??Math.ceil(r/l)*l});return{...D,legend:V,tooltip:{...C,formatter:e=>{let t=i.Series.find(r=>r.Key===e.data?.point?.SeriesKey);return t?`<strong>${n(t.Label)}</strong><br/>${i.Categories.map((r,l)=>`${n(r.Label)}: ${n(m(t.Values[l],o))}`).join("<br/>")}`:""}},radar:{center:["50%",E],radius:A,shape:i.GridShape==="Circle"?"circle":"polygon",splitNumber:i.SplitNumber??4,indicator:i.Categories.map((e,t)=>({name:H.truncateText(`${e.Label}${i.ShowAxisBounds!==!1?`
2
- 0\u2013${m(x[t],o,!0)}`:""}`,Math.max(28,Math.min(100,d*.22)),"11px Inter,system-ui","\u2026"),min:0,max:x[t]})),axisName:{color:a.text,fontSize:11,lineHeight:15,width:Math.max(28,Math.min(100,d*.22)),overflow:"truncate"},axisNameGap:7,axisLine:{lineStyle:{color:a.border,width:1}},splitLine:{lineStyle:{color:a.border,width:1}},splitArea:{show:!1}},series:i.Series.map((e,t)=>{let r=y(e.Color,t),l=o.SelectedKey===e.Key;return{id:e.Key,name:e.Label,type:"radar",symbol:T(t),symbolSize:l?9:7,lineStyle:{color:r,width:l?3:2.5,type:k(t)},itemStyle:{...S(r,a.surface,l),decal:i.ShowArea&&o.ShowPatterns?b(t,r):void 0},areaStyle:i.ShowArea?{color:r,opacity:.08}:void 0,label:{...z,position:"top",formatter:c=>m(c.value,o,!0)},labelLayout:M(d,f,o.ShowLegend?38:8),emphasis:{focus:"none",itemStyle:v(r),lineStyle:{width:3}},blur:{lineStyle:{opacity:1},itemStyle:{opacity:1}},data:e.Values.some(c=>c===null)||!e.Values.length?[]:[{name:e.Label,value:e.Values,point:{Key:e.Key,Label:e.Label,Value:null,SeriesKey:e.Key,SeriesName:e.Label,PointType:"Series"}}]}})}}import{use as F}from"echarts/core";import{RadarChart as G}from"echarts/charts";import{RadarComponent as I}from"echarts/components";function me(p,a,g={}){return F([G,I]),K(p,"radar",a,g,N)}export{me as a};
@@ -1 +0,0 @@
1
- import{a as s,b as w,c,f as T,h as v,i as N,j as P,k as z,l as S,n as K}from"./chunk-QFXXWRD5.js";import{e as $,g as m}from"./chunk-QETOF22L.js";function A(p,o,C,D=!1,E=640){let n="line",a=p,M=w(n,p),L=(e,t)=>a.ShowPatterns?P(e,t):void 0,y=o.palette,l=(e,t)=>T(o.forcedColors?o.text:$(e,y[t%y.length],o.dark,o.read),o.surface,n==="line"||n==="radar"||n==="polar"&&a.PolarType==="Line"?4.5:3.2),V=(e,t,i)=>S(l(t,i),o.surface,a.SelectedKey===e),H=(e,t)=>M.find(i=>i.Key===e&&(!t||i.SeriesKey===t)),x={data:["line","radar","bar","polar"].includes(n)?a.Series.map(e=>e.Label):n==="scatter"?[...new Set(a.Points.map(e=>e.Group||"Observations"))]:["pie","doughnut","nightingale","funnel"].includes(n)?[...new Set(a.Items.map(e=>e.Label))]:[],show:a.ShowLegend,type:"scroll",top:6,left:10,right:10,itemWidth:24,itemHeight:12,selectedMode:!1,pageTextStyle:{color:o.muted},pageIconColor:o.text,textStyle:{color:o.muted,fontSize:11}},B={show:a.ShowLabels,color:m(o.surface),fontSize:11,backgroundColor:o.surface,padding:[2,3],borderRadius:2},F={show:a.ShowTooltip,confine:!0,enterable:!0,backgroundColor:o.surface,borderColor:o.border,textStyle:{color:o.text,fontSize:12},formatter:e=>{let t=e.data?.point;if(!t)return`${s(e.name||"")}${e.value==null||Number.isNaN(e.value)?" \xB7 No data":""}`;let i=t.Date?`<br/>${s(t.Date)}<br/><strong>${s(c(t.Value,a))}</strong>`:t.X!==void 0?`<br/>${s(a.XLabel||"X")}: ${t.X}<br/>${s(a.YLabel||"Y")}: ${t.Y}${t.Size===void 0?"":`<br/>Size: ${t.Size}`}`:`<br/><strong>${s(c(t.Value,a))}</strong>`;return`${s(t.SeriesName?`${t.SeriesName} \xB7 ${t.Label}`:t.Label)}${i}${e.data?.conversion?`<br/>${s(e.data.conversion)}`:""}`}},O={backgroundColor:o.surface,color:y.map((e,t)=>l(e,t)),animation:!!a.EnableAnimation&&!D,animationDuration:300,animationDurationUpdate:150,textStyle:{fontFamily:"Inter,system-ui,sans-serif",color:o.text},aria:{enabled:!0,description:`${a.Title}. ${a.Description||""} Exact values and keyboard selection are in the data table.`},tooltip:F},d={axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:o.muted,fontSize:10,hideOverlap:!0},splitLine:{lineStyle:{color:o.border,type:"dashed"}}},r=p,u=r.Stacking==="Percent",f={...d,type:"category",data:r.Categories.map(e=>e.Label),axisLabel:{...d.axisLabel,width:Math.min(n==="polar"?100:140,E*.2),overflow:"truncate"},splitLine:{show:!1}},b={...d,type:"value",max:u?1:void 0,axisLabel:{...d.axisLabel,formatter:e=>u?`${Math.round(e*100)}%`:c(e,a,!0)}},g=(n==="bar"||n==="polar"&&r.PolarType!=="Line")&&(n==="polar"||!!r.Stacking&&r.Stacking!=="None"),k=r.Series.map((e,t)=>({id:e.Key,name:e.Label,type:n==="line"||n==="polar"&&r.PolarType==="Line"?"line":"bar",coordinateSystem:n==="polar"?"polar":"cartesian2d",stack:r.Stacking&&r.Stacking!=="None"?"total":void 0,smooth:r.LineStyle==="Smooth",step:r.LineStyle==="Step"?"middle":!1,connectNulls:!1,areaStyle:r.ShowArea?{opacity:.1}:void 0,barMaxWidth:38,symbol:v(t),symbolSize:8,itemStyle:{...S(l(e.Color,t),o.surface),decal:L(t,l(e.Color,t))},lineStyle:{width:2.5,color:l(e.Color,t),type:N(t)},label:{...B,color:g?m(l(e.Color,t)):m(o.surface),backgroundColor:g?l(e.Color,t):o.surface,position:g?"inside":n==="bar"&&r.Orientation==="Horizontal"?"right":"top",formatter:i=>u?`${Math.round(Number(i.value)*100)}%`:c(i.data.point.Value,a,!0)},labelLayout:{hideOverlap:!0},emphasis:{focus:"none",scale:!1},blur:{itemStyle:{opacity:1},lineStyle:{opacity:1},label:{opacity:1}},data:e.Values.map((i,h)=>({value:i===null?null:u?i/(r.Series.reduce((X,G)=>X+(G.Values[h]||0),0)||1):i,point:H(r.Categories[h].Key,e.Key),itemStyle:{...V(r.Categories[h].Key,e.Color,t),decal:L(t,l(e.Color,t))},emphasis:{itemStyle:z(l(e.Color,t))}}))}));return n==="polar"?{...O,legend:x,polar:{radius:["12%","72%"],center:["50%","55%"]},angleAxis:{...f,startAngle:90},radiusAxis:b,series:k}:{...O,legend:x,grid:{left:14,right:22,top:a.ShowLegend?48:20,bottom:16,containLabel:!0},xAxis:r.Orientation==="Horizontal"?b:f,yAxis:r.Orientation==="Horizontal"?{...f,inverse:!0}:b,series:k}}import{use as I}from"echarts/core";import{LineChart as R}from"echarts/charts";import{GridComponent as Y}from"echarts/components";function se(p,o,C={}){return I([R,Y]),K(p,"line",o,C,A)}export{se as a};
@@ -1 +0,0 @@
1
- import{a as l,c as d,d as C,e as b,f as p,g as x,k as y,l as g,o as S}from"./chunk-QFXXWRD5.js";import{b as u,d as h,f as s,g as f}from"./chunk-QETOF22L.js";function T(e,t){return{backgroundColor:t.surface,animation:e.EnableAnimation&&!matchMedia("(prefers-reduced-motion: reduce)").matches,animationDuration:350,animationDurationUpdate:180,textStyle:{fontFamily:"Inter, system-ui, sans-serif",color:t.text},aria:{enabled:!0,description:`${e.Title}. ${e.Description||""} Exact values and keyboard selections are available in the chart data table.`},tooltip:{show:e.ShowTooltip,confine:!0,enterable:!0,backgroundColor:t.surface,borderColor:t.border,textStyle:{color:t.text,fontSize:12},extraCssText:"border-radius:8px;box-shadow:0 8px 28px #0002;"}}}function m(e){return{axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:e.muted,fontSize:11}}}function O(e,t){let{min:r,max:n}=b(e),c=h(u(e.ColorScale)?e.ColorScale:"Purple",t.dark,t.read),k=t.forcedColors?t.text:e.ColorScale==="Automatic"?t.palette[0]:e.ColorScale==="Teal"?"#126e5b":c.solid,i=e.ColorScale==="Diverging"&&!t.forcedColors?[p("#ba5943",t.surface,9),p(t.surface,t.surface),p("#6850bf",t.surface,9)]:x(k,t.surface);return{...T(e,t),grid:{left:12,right:12,top:16,bottom:e.ShowLegend?62:12,containLabel:!0},tooltip:{...T(e,t).tooltip,formatter:a=>{let o=C(e,a.dataIndex);return`${l(o.YLabel)} \xB7 ${l(o.XLabel)}<br/><strong>${l(d(o.Value,e))}</strong>`}},xAxis:{...m(t),type:"category",data:e.XCategories.map(a=>a.Label),axisLabel:{...m(t).axisLabel,hideOverlap:!0,width:120,overflow:"truncate"}},yAxis:{...m(t),type:"category",inverse:!0,data:e.YCategories.map(a=>a.Label),axisLabel:{...m(t).axisLabel,width:80,overflow:"truncate"}},visualMap:{show:e.ShowLegend,min:r,max:n,calculable:!1,orient:"horizontal",left:"center",bottom:6,itemWidth:9,itemHeight:130,text:["Higher","Lower"],textGap:9,textStyle:{color:t.muted,fontSize:10},inRange:{color:i}},series:[{type:"heatmap",data:e.Cells.map(a=>({name:a.Key,value:[e.XCategories.findIndex(o=>o.Key===a.XKey),e.YCategories.findIndex(o=>o.Key===a.YKey),a.Value??"-"],itemStyle:{...g(s(i,((a.Value??r)-r)/(n-r)),t.surface,e.SelectedKey===a.Key),borderRadius:4},label:{color:f(s(i,((a.Value??r)-r)/(n-r)))},emphasis:{itemStyle:y(s(i,((a.Value??r)-r)/(n-r)))}})),label:{show:e.ShowLabels,fontSize:10,formatter:a=>d(e.Cells[a.dataIndex].Value,e,!0)},emphasis:{itemStyle:{borderColor:t.text,borderWidth:2,borderType:"solid"}}}]}}import{use as v}from"echarts/core";import{HeatmapChart as L}from"echarts/charts";import{GridComponent as E,VisualMapComponent as w}from"echarts/components";function H(e,t,r,n,c){return S(e,t,r,n,c)}function U(e,t,r={}){return v([L,E,w]),H(e,"heatmap",t,r,O)}export{U as a};
@@ -1 +0,0 @@
1
- import{a as We,b as Ze,c as ie,f as xe,g as $e,h as I,i as le,j as U,k as j}from"./chunk-QETOF22L.js";import*as Ke from"echarts/core";import{LabelLayout as Tt,LegacyGridContainLabel as $t}from"echarts/features";import{TooltipComponent as Ot,AriaComponent as Rt,GraphicComponent as Nt}from"echarts/components";import{SVGRenderer as Vt}from"echarts/renderers";var Qe={Title:"Chart",Description:"",Height:320,ValueFormat:"Number",CurrencyCode:"USD",Locale:"en-US",UseCustomPrecision:!1,DecimalPlaces:2,AccessibleLabel:"",ExtendedClass:"",ResetKey:"",Messages:{},ShowHeader:!0,ShowToolbar:!0,ShowLegend:!0,LegendStyle:"Standard",LegendPosition:"Top",LegendShowValues:!0,LegendShowPercentages:!1,ShowTooltip:!0,ShowLabels:!1,ShowDataTable:!0,ShowPatterns:!1,EnableSelection:!0,EnableAnimation:!0,IsLoading:!1,EmptyMessage:"No data to display",SelectedKey:null,ExportFootnote:"BluKavantUI Charts"};function Z(n,a,e=!1){return n===null?a.Messages?.NoData??"No data":new Intl.NumberFormat(a.Locale||"en-US",{style:a.ValueFormat==="Currency"?"currency":a.ValueFormat==="Percent"?"percent":"decimal",currency:a.CurrencyCode||"USD",notation:e?"compact":"standard",...e?{maximumFractionDigits:1}:a.UseCustomPrecision?{minimumFractionDigits:a.DecimalPlaces??2,maximumFractionDigits:a.DecimalPlaces??2}:a.ValueFormat==="Currency"?{}:{maximumFractionDigits:12}}).format(n)}function et(n,a){return n===null?"No data":a??String(n)}function tt(n,a,e=0){let t=n.Categories[a],o=n.Series[e];return t&&o?{Key:t.Key,CategoryLabel:t.Label,SeriesKey:o.Key,SeriesName:o.Name,Value:o.Values[a]}:null}function at(n,a){let e=n.Cells[a];return e?{...e,XLabel:n.XCategories.find(t=>t.Key===e.XKey).Label,YLabel:n.YCategories.find(t=>t.Key===e.YKey).Label}:null}function zt(n){let a=0,e=0;for(let t of n.Cells)t.Value!==null&&(a=Math.min(a,t.Value),e=Math.max(e,t.Value));return a=n.MinValue??a,e=n.MaxValue??e,a>=e&&(n.MaxValue!==void 0?a=e-1:e=a+1),{min:a,max:e}}function c(n,a){if(!n)throw new Error(a)}function se(n,a){U(n,a);let e=new Set;for(let t of n)c(t&&j(t.Key)&&t.Key.length>0&&j(t.Label),`${a} require a non-empty Key and a Label within the text limit.`),c(!e.has(t.Key),`${a} contain a duplicate key: ${t.Key}.`),e.add(t.Key);return e}function pe(n){return n===null||le(n)}function _e(n){c(n.Height===void 0||Number.isFinite(n.Height)&&n.Height>=160&&n.Height<=1e3,"Height must be between 160 and 1000 pixels."),c(n.ValueFormat===void 0||["Currency","Number","Percent"].includes(n.ValueFormat),"Invalid ValueFormat.");for(let a of["UseCustomPrecision","ShowHeader","ShowToolbar","ShowLegend","LegendShowValues","LegendShowPercentages","ShowTooltip","ShowLabels","ShowDataTable","ShowPatterns","EnableSelection","EnableAnimation","IsLoading"])c(n[a]===void 0||typeof n[a]=="boolean",`${a} must be a boolean.`);for(let a of["AccessibleLabel","ExtendedClass","ResetKey","Title","Description","EmptyMessage","ExportFootnote","Locale","CurrencyCode"])c(n[a]===void 0||j(n[a]),`${a} must be text within the text limit.`);c(n.LegendStyle===void 0||["Standard","ValueList","Compact","SummaryCards"].includes(n.LegendStyle),"Invalid LegendStyle."),c(n.LegendPosition===void 0||["Top","Left","Right","Bottom"].includes(n.LegendPosition),"Invalid LegendPosition."),c(n.DecimalPlaces===void 0||Number.isInteger(n.DecimalPlaces)&&n.DecimalPlaces>=0&&n.DecimalPlaces<=12,"DecimalPlaces must be an integer from 0 to 12."),c(n.Messages===void 0||!!n.Messages&&typeof n.Messages=="object"&&!Array.isArray(n.Messages)&&Object.keys(n.Messages).length<=100&&Object.values(n.Messages).every(j),"Messages must contain plain text translations."),new Intl.NumberFormat(n.Locale||"en-US",n.ValueFormat==="Currency"?{style:"currency",currency:n.CurrencyCode||"USD"}:{})}function nt(n){_e(n);let a=se(n.Categories,"Categories");c(n.SelectedKey==null||a.has(n.SelectedKey),"SelectedKey must match a category."),c(n.BarLayout===void 0||["Stacked","Grouped"].includes(n.BarLayout),"Invalid BarLayout."),c(n.SmoothLines===void 0||typeof n.SmoothLines=="boolean","SmoothLines must be a boolean."),U(n.Series,"Series"),c(n.Categories.length*n.Series.length<=I.observations,"Too many chart observations. Aggregate the data first.");let e=new Set;for(let t of n.Series)c(t&&j(t.Key)&&t.Key.length&&!e.has(t.Key),"Each series needs a unique, non-empty Key."),e.add(t.Key),c(j(t.Name)&&["Bar","Line"].includes(t.Type),"Each series needs a Name and a Bar or Line Type."),c(Array.isArray(t.Values)&&t.Values.length===n.Categories.length,`${t.Key}: Values must match the category count.`),c(t.Values.every(pe),`${t.Key}: Values must be finite numbers or null.`),c(t.Color===void 0||ie(t.Color),"Series Color must be a ComponentColor or hex color."),c(t.IsDashed===void 0||typeof t.IsDashed=="boolean","IsDashed must be a boolean.")}function rt(n){_e(n);let a=se(n.XCategories,"XCategories"),e=se(n.YCategories,"YCategories");U(n.Cells,"Cells"),c(a.size*e.size<=I.observations,"Too many heatmap positions. Aggregate the data first.");let t=new Set,o=new Set;for(let r of n.Cells){c(r&&typeof r.Key=="string"&&r.Key.length&&!t.has(r.Key),"Each cell needs a unique, non-empty Key."),c(a.has(r.XKey)&&e.has(r.YKey),`${r.Key}: XKey and YKey must match category keys.`);let i=JSON.stringify([r.XKey,r.YKey]);c(!o.has(i),"Only one cell may occupy each X/Y position."),c(pe(r.Value),`${r.Key}: Value must be a finite number or null.`),o.add(i),t.add(r.Key)}c(n.SelectedKey==null||t.has(n.SelectedKey),"SelectedKey must match a cell."),c(n.ColorScale===void 0||Ze(n.ColorScale)||["Automatic","Teal","Diverging"].includes(n.ColorScale),"Invalid ColorScale."),c(n.MinValue===void 0||Number.isFinite(n.MinValue),"MinValue must be finite."),c(n.MaxValue===void 0||Number.isFinite(n.MaxValue),"MaxValue must be finite."),c(n.MinValue===void 0||n.MaxValue===void 0||n.MinValue<n.MaxValue,"MinValue must be less than MaxValue.")}function f(n){return n.replace(/[&<>"']/g,a=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[a])}function Oe(n){let a=getComputedStyle(n),e=(r,i)=>a.getPropertyValue(r).trim()||i,t=document.documentElement.dataset.bluuiTheme==="dark",o=matchMedia("(forced-colors: active)").matches;if(o){let r=document.createElement("span");r.style.cssText="position:absolute;visibility:hidden;color:Canvas;background-color:CanvasText;forced-color-adjust:none",n.append(r);let i=getComputedStyle(r),u=i.color,d=i.backgroundColor;return r.remove(),{surface:u,text:d,muted:d,border:d,dark:t,forcedColors:o,read:()=>"",palette:Array(8).fill(d)}}return{forcedColors:o,surface:e("--bluui-surface","#fff"),text:e("--bluui-text","#182230"),muted:e("--bluui-text-muted","#667085"),border:e("--bluui-border","#e3e5ed"),dark:t,read:r=>a.getPropertyValue(r),palette:We(t)}}function ot(n){let a="",e=0;return{update(t){if(t===a)return;let o=!a;if(a=t,window.clearTimeout(e),o){n.textContent=t;return}n.textContent="",e=window.setTimeout(()=>{n.isConnected&&(n.textContent=t)},150)},destroy(){window.clearTimeout(e)}}}import{createSkeleton as Re}from"@blukavantui/community/skeleton";import"@blukavantui/community/skeleton.css";function it(n){let a=document.createElement("div");a.className="blu-chart__skeleton",a.setAttribute("aria-hidden","true");let e=document.createElement("div");e.className="blu-chart__skeleton-key";let t=document.createElement("div"),o=document.createElement("div");e.append(t,o);let r=document.createElement("div");r.className="blu-chart__skeleton-plot",a.append(e,r);let i=document.createElement("span");i.className="blu-chart__state-message",n.replaceChildren(a,i);let u=[Re(t,{Shape:"Text",Width:"88px",Height:"12px",IsAnimated:!1}),Re(o,{Shape:"Text",Width:"64px",Height:"12px",IsAnimated:!1}),Re(r,{Shape:"Rectangle",Width:"100%",Height:"100%",IsAnimated:!1})],d=!1;return{update(l,S,g,x){n.hidden=!l&&!S,n.classList.toggle("blu-chart__state--loading",l),a.hidden=!l,i.textContent=g;let b=l&&x;b!==d&&(d=b,u.forEach(v=>v.update({IsAnimated:b})))},destroy(){u.forEach(l=>l.destroy())}}}import{createChip as Lt}from"@blukavantui/community/chip";import"@blukavantui/community/chip.css";function te(n,a,e,t={}){return(n.Messages?.[a]??e).replace(/\{(\w+)\}/g,(o,r)=>t[r]??o)}function J(n,a,e="Label"){U(n,a);let t=new Set;for(let o of n)c(o&&j(o.Key)&&o.Key.length&&!t.has(o.Key),`${a} require unique, non-empty keys.`),c(!e||j(o[e]),`${o.Key}: ${e} must be text within the text limit.`),c(o.Color===void 0||ie(o.Color),`${o.Key}: Color must be a shared ComponentColor or hex color.`),t.add(o.Key);return t}var B=le;function Ce(n){return n===null||B(n)&&n>=0}function D(n,a,e){c(n[a]===void 0||e.includes(n[a]),`Invalid ${a}. Choose ${e.join(", ")}.`)}function Se(n){c(n?.type==="FeatureCollection"&&Array.isArray(n.features)&&n.features.length>0,"GeoJSON must be a non-empty FeatureCollection."),U(n.features,"Map features",I.mapFeatures);let a=0,e=new Set;n.features.forEach(t=>{c(t?.type==="Feature"&&typeof t.properties?.name=="string"&&t.properties.name.length&&!e.has(t.properties.name),"Each map feature needs a unique properties.name region key."),e.add(t.properties.name),c(["Polygon","MultiPolygon"].includes(t.geometry?.type),"Map geometry must be Polygon or MultiPolygon.");let o=t.geometry.type==="Polygon"?[t.geometry.coordinates]:t.geometry.coordinates;c(Array.isArray(o)&&o.length>0,"Map polygons must contain coordinates.");for(let r of o){c(Array.isArray(r)&&r.length>0,"Each polygon needs rings.");for(let i of r)c(Array.isArray(i)&&i.length>=4,"Each polygon ring needs at least four coordinates."),a+=i.length,c(a<=I.mapCoordinates,"Map has too many coordinates. Use a simplified boundary file."),i.forEach(u=>c(Array.isArray(u)&&u.length>=2&&B(u[0])&&B(u[1])&&Math.abs(u[0])<=180&&Math.abs(u[1])<=90,"Map coordinates must be longitude/latitude in degrees.")),c(i[0][0]===i.at(-1)[0]&&i[0][1]===i.at(-1)[1],"Polygon rings must close.")}})}function Ne(n){return typeof n=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(n)&&Number.isFinite(Date.parse(n+"T00:00:00Z"))&&new Date(n+"T00:00:00Z").toISOString().slice(0,10)===n}function lt(n,a){_e(a),"Series"in a&&(U(a.Series,"Series"),U(a.Categories,"Categories"),c(a.Series.length*a.Categories.length<=I.observations,"Too many chart observations. Aggregate the data first."));for(let e of["ShowArea","Nested","Bubble","Drilldown","ShowConversion","Roam"])c(a[e]===void 0||typeof a[e]=="boolean",`${e} must be a boolean.`);if(n==="radar"){let e=a;se(e.Categories,"Categories"),c(e.Categories.length===0||e.Categories.length>=3&&e.Categories.length<=12,"Radar needs 3\u201312 categories, or an empty array for an empty state."),J(e.Series,"Series"),e.Categories.forEach(t=>c(t.Max===void 0||B(t.Max)&&t.Max>0,`${t.Key}: Max must be a positive number.`)),e.Series.forEach(t=>{c(Array.isArray(t.Values)&&t.Values.length===e.Categories.length&&t.Values.every(Ce),`${t.Key}: Values must match categories and contain non-negative numbers or null.`),t.Values.forEach((o,r)=>c(o===null||e.Categories[r].Max===void 0||o<=e.Categories[r].Max,`${t.Key}: Value exceeds ${e.Categories[r].Label} Max.`))}),D(e,"GridShape",["Polygon","Circle"]),c(e.SplitNumber===void 0||Number.isInteger(e.SplitNumber)&&e.SplitNumber>=2&&e.SplitNumber<=8,"SplitNumber must be an integer from 2 to 8."),c(e.ShowAxisBounds===void 0||typeof e.ShowAxisBounds=="boolean","ShowAxisBounds must be Boolean.")}else if(["line","bar","polar"].includes(n)){let e=a;se(e.Categories,"Categories"),J(e.Series,"Series"),e.Series.forEach(t=>{c(Array.isArray(t.Values)&&t.Values.length===e.Categories.length&&t.Values.every(pe),`${t.Key}: Values must match categories and contain finite numbers or null.`),e.Stacking==="Percent"&&c(t.Values.every(o=>o===null||o>=0),"Percentage stacks require non-negative values.")}),D(e,"Orientation",["Vertical","Horizontal"]),D(e,"Stacking",["None","Stacked","Percent"]),D(e,"LineStyle",["Straight","Smooth","Step"]),D(e,"PolarType",["Bar","Line"])}else if(["pie","doughnut","nightingale","funnel"].includes(n)){let e=a;if(J(e.Items,"Items"),e.Items.forEach(t=>c(Ce(t.Value),`${t.Key}: Value must be non-negative or null.`)),n!=="funnel"){let t=J(e.Rings||[],"Rings");e.Items.forEach(o=>c(!o.RingKey||t.has(o.RingKey),`${o.Key}: RingKey must match a ring.`)),e.Nested&&(c(t.size>0,"Nested charts need Rings."),e.Items.forEach(o=>c(o.RingKey&&t.has(o.RingKey),`${o.Key}: nested items need RingKey.`))),D(e,"Shape",["Full","Half"]),D(e,"LabelPosition",["Outside","Inside"]),D(e,"RoseMode",["Area","Radius"]),c(e.InnerRadius===void 0||B(e.InnerRadius)&&e.InnerRadius>=0&&e.InnerRadius<=75,"InnerRadius must be 0\u201375 percent."),c(e.CenterLabel===void 0||typeof e.CenterLabel=="string","CenterLabel must be text.")}else D(a,"Sort",["Input","Descending","Ascending"])}else if(n==="calendar-heatmap"){let e=a;c(Ne(e.RangeStart)&&Ne(e.RangeEnd),"RangeStart and RangeEnd must be real dates in YYYY-MM-DD format.");let t=(Date.parse(e.RangeEnd)-Date.parse(e.RangeStart))/864e5;c(t>=0&&t<=365,"Choose a calendar range of 1\u2013366 days."),J(e.Items,"Items");let o=new Set;e.Items.forEach(r=>{c(Ne(r.Date),`${r.Key}: Date must be a real YYYY-MM-DD date.`),c(r.Date>=e.RangeStart&&r.Date<=e.RangeEnd,`${r.Key}: Date must be within the calendar range.`),c(!o.has(r.Date),"Use one item per date. Aggregate observations before passing the data."),c(Ce(r.Value),`${r.Key}: Value must be non-negative or null.`),o.add(r.Date)}),D(e,"FirstDay",["Monday","Sunday"]),c(e.ColorScale===void 0||e.ColorScale==="Automatic"||ie(e.ColorScale),"Invalid ColorScale.");for(let r of["ShowMonthLabels","ShowDayLabels"])c(e[r]===void 0||typeof e[r]=="boolean",`${r} must be a boolean.`)}else if(n==="scatter"){let e=a;J(e.Points,"Points"),e.Points.forEach(t=>{c(B(t.X)&&B(t.Y),`${t.Key}: X and Y must be finite numbers.`),c(t.Size===void 0||B(t.Size)&&t.Size>=0,`${t.Key}: Size must be non-negative.`),c(t.Group===void 0||typeof t.Group=="string","Group must be text.")});for(let t of["XLabel","YLabel"])c(e[t]===void 0||typeof e[t]=="string",`${t} must be text.`)}else if(n==="treemap"){let e=a,t=J(e.Nodes,"Nodes");e.Nodes.forEach(i=>{c(i.ParentKey===null||typeof i.ParentKey=="string"&&t.has(i.ParentKey),`${i.Key}: ParentKey must be null or match a node.`),c(Ce(i.Value),`${i.Key}: Value must be non-negative or null.`)});let o=we(e.Nodes),r=new Set(e.Nodes.map(i=>i.ParentKey));e.Nodes.forEach(i=>{r.has(i.Key)&&i.Value!==null&&c(o.get(i.Key)!==null&&Math.abs(o.get(i.Key)-i.Value)<1e-6,`${i.Key}: branch Value must equal its leaf total, or use null to calculate it.`)})}else if(n==="sankey"){let e=a,t=J(e.Nodes,"Nodes");J(e.Links,"Links",""),U(e.Nodes,"Flow nodes",I.flowNodes),U(e.Links,"Flow links",I.flowLinks);let o=new Map(e.Nodes.map(l=>[l.Key,[]]));e.Links.forEach(l=>{c(t.has(l.SourceKey)&&t.has(l.TargetKey),`${l.Key}: link endpoints must match node keys.`),c(B(l.Value)&&l.Value>=0,`${l.Key}: Value must be non-negative.`),o.get(l.SourceKey).push(l.TargetKey)});let r=new Map,i=new Map;for(let l of e.Links)r.set(l.TargetKey,(r.get(l.TargetKey)||0)+l.Value),i.set(l.SourceKey,(i.get(l.SourceKey)||0)+l.Value);c([...r.values(),...i.values()].every(le),"Flow totals exceed the supported numeric range.");let u=new Map(e.Nodes.map(l=>[l.Key,0]));e.Links.forEach(l=>u.set(l.TargetKey,u.get(l.TargetKey)+1));let d=[...u].filter(([,l])=>!l).map(([l])=>l);for(let l=0;l<d.length;l++)for(let S of o.get(d[l])){let g=u.get(S)-1;u.set(S,g),g||d.push(S)}c(d.length===t.size,"Sankey links cannot contain cycles."),D(e,"Orientation",["Horizontal","Vertical"]),D(e,"NodeAlign",["Justify","Left","Right"]),c(e.Links.every(l=>!t.has(l.Key)),"Link keys must be distinct from node keys.")}else{let e=a;J(e.Regions,"Regions"),J(e.Locations,"Locations"),e.Regions.forEach(t=>c(pe(t.Value),`${t.Key}: Value must be finite or null.`)),e.Locations.forEach(t=>{c(B(t.Longitude)&&Math.abs(t.Longitude)<=180&&B(t.Latitude)&&Math.abs(t.Latitude)<=90,`${t.Key}: invalid longitude/latitude.`),c(B(t.Value)&&t.Value>=0,`${t.Key}: Value must be non-negative.`)}),c(e.Locations.every(t=>!e.Regions.some(o=>o.Key===t.Key)),"Location and region keys must be distinct."),D(e,"Map",["World","US","Custom"]),D(e,"MapView",["Mainland","Full"]),c(e.MapURL===void 0||j(e.MapURL)&&!!e.MapURL,"MapURL must be non-empty text."),c(!e.MapURL||!e.GeoJSON,"Supply either MapURL or GeoJSON, not both."),c(!e.MapURL||e.Map==="Custom","MapURL requires Map Custom."),D(e,"MapMode",["Regions","Locations","Combined"]),c(e.ColorScale===void 0||e.ColorScale==="Automatic"||ie(e.ColorScale),"Invalid ColorScale."),e.GeoJSON!==void 0&&Se(e.GeoJSON),e.Map==="Custom"&&(c(e.GeoJSON||e.MapURL,"Custom maps need GeoJSON or MapURL."),e.GeoJSON&&ce(e,e.GeoJSON))}c(a.SelectedKey==null||Ve(n,a).some(e=>e.Key===a.SelectedKey),"SelectedKey must match an input key.")}function ce(n,a){let e=new Set(a.features.map(t=>t.properties.name));n.Regions.forEach(t=>c(e.has(t.Key),`Region ${t.Key} does not exist in this map. Use its properties.name key.`))}function we(n){U(n,"Tree nodes",I.treeNodes);let a=new Map,e=new Map;for(let o of n){let r=a.get(o.ParentKey)||[];r.push(o),a.set(o.ParentKey,r)}let t=(a.get(null)||[]).map(o=>({n:o,depth:1}));for(let o=0;o<t.length;o++){let{n:r,depth:i}=t[o];c(i<=I.treeDepth,"Tree exceeds maximum depth.");for(let u of a.get(r.Key)||[])t.push({n:u,depth:i+1});c(t.length<=n.length,"Tree nodes cannot contain cycles.")}c(t.length===n.length,"Tree nodes cannot contain cycles or disconnected parents.");for(let o=t.length-1;o>=0;o--){let r=t[o].n,i=a.get(r.Key)||[],u=i.map(l=>e.get(l.Key)).filter(l=>l!=null),d=i.length?u.length?u.reduce((l,S)=>l+S,0):null:r.Value;c(d===null||le(d),"Tree total exceeds the supported numeric range."),e.set(r.Key,d)}return e}function Ve(n,a){if(n==="radar"){let t=a;return t.Series.flatMap(o=>t.Categories.map((r,i)=>({Key:o.Key,Label:r.Label,Value:o.Values[i],CategoryKey:r.Key,SeriesKey:o.Key,SeriesName:o.Label})))}if(["line","bar","polar"].includes(n)){let t=a;return t.Series.flatMap(o=>t.Categories.map((r,i)=>({Key:r.Key,Label:r.Label,Value:o.Values[i],SeriesKey:o.Key,SeriesName:o.Label})))}if(["pie","doughnut","nightingale","funnel"].includes(n))return a.Items.map(t=>({Key:t.Key,Label:t.Label,Value:t.Value,RingKey:t.RingKey}));if(n==="calendar-heatmap")return a.Items.map(t=>({...t}));if(n==="scatter")return a.Points.map(t=>({...t,Value:t.Y}));if(n==="treemap"){let t=a,o=we(t.Nodes);return t.Nodes.map(r=>({Key:r.Key,Label:r.Label,Value:o.get(r.Key),ParentKey:r.ParentKey}))}if(n==="sankey"){let t=a;return[...t.Nodes.map(o=>({Key:o.Key,Label:o.Label,PointType:"Node",Value:Math.max(t.Links.filter(r=>r.SourceKey===o.Key).reduce((r,i)=>r+i.Value,0),t.Links.filter(r=>r.TargetKey===o.Key).reduce((r,i)=>r+i.Value,0))})),...t.Links.map(o=>({Key:o.Key,Label:`${t.Nodes.find(r=>r.Key===o.SourceKey)?.Label} \u2192 ${t.Nodes.find(r=>r.Key===o.TargetKey)?.Label}`,Value:o.Value,SourceKey:o.SourceKey,TargetKey:o.TargetKey,PointType:"Link"}))]}let e=a;return[...e.Regions.map(t=>({...t,PointType:"Region"})),...e.Locations.map(t=>({...t,PointType:"Location"}))]}function st(n,a,e,t){let o=e.series||[],r=[],i=(g,x,b={})=>te(a,g,x,b),u=(g,x)=>g?.itemStyle?.color||g?.itemStyle?.areaColor||x?.itemStyle?.color||x?.lineStyle?.color||t.palette[0],d=(g,x,b,v,_,w,h,m,R)=>r.push({id:w,label:_,color:u(g,x),value:Z(h,a),compactValue:Z(h,a,!0),detail:m,percent:R,targets:[{seriesIndex:b,dataIndex:v}]});if(a.Series)a.Series.forEach((g,x)=>{let b=o[x],v=g.Values.flatMap((h,m)=>h===null?[]:[{v:h,i:m}]),_=v.at(-1),w=n==="radar";r.push({id:g.Key,label:g.Label||g.Name,color:b?.lineStyle?.color||u(null,b),line:b?.type==="line"||w,symbol:b?.symbol,dash:b?.lineStyle?.type,value:w?`${v.length} / ${a.Categories.length}`:Z(_?.v??null,a),compactValue:w?void 0:Z(_?.v??null,a,!0),detail:w?i("MeasuresReported","Measures reported"):_?i("Latest","Latest \xB7 {label}",{label:a.Categories[_.i].Label}):i("LatestValue","Latest value"),targets:[{seriesIndex:x}]})});else if(["pie","doughnut","nightingale","funnel"].includes(n))o.forEach((g,x)=>{let b=g.data.reduce((_,w)=>_+(w.value??0),0),v=a.Nested?a.Rings?.[x]?.Label:void 0;g.data.forEach((_,w)=>d(_,g,x,w,_.name,_.point.Key,_.value,v,n!=="funnel"&&_.value!==null&&b>0?_.value/b:void 0))});else if(n==="scatter")o.forEach((g,x)=>r.push({id:g.name,label:g.name,color:u(null,g),symbol:g.symbol,value:String(g.data.length),detail:i("Observations","Observations"),targets:[{seriesIndex:x}]}));else if(n==="treemap"){let g=we(a.Nodes),x=a.Nodes.filter(h=>h.ParentKey===null),b=x.reduce((h,m)=>h+(g.get(m.Key)??0),0),v=new Map,_=1,w=h=>h.forEach(m=>{v.set(m.id,_++),w(m.children||[])});w(o[0].data),x.forEach((h,m)=>{let R=g.get(h.Key);d(o[0].data[m],o[0],0,v.get(h.Key),h.Label,h.Key,R,i("TopLevelGroup","Top-level group"),b>0&&R!==null?R/b:void 0)})}else n==="sankey"&&a.Nodes.forEach((g,x)=>{let b=a.Links.filter(_=>_.TargetKey===g.Key).reduce((_,w)=>_+w.Value,0),v=a.Links.filter(_=>_.SourceKey===g.Key).reduce((_,w)=>_+w.Value,0);d(o[0].data[x],o[0],0,x,g.Label,g.Key,Math.max(b,v),i("NodeThroughput","Node throughput"))});let l=Array.isArray(e.visualMap)?e.visualMap[0]:e.visualMap,S=l?{label:n==="geo-map"?i("RegionValue","Region value"):n==="calendar-heatmap"?i("DailyValue","Daily value"):i("CellValue","Cell value"),min:l.min,max:l.max,colors:[...l.inRange.color]}:void 0;return n==="geo-map"?o.forEach((g,x)=>g.data.forEach((b,v)=>{(g.type==="scatter"||a.Regions.find(_=>_.Key===b.point.Key)?.Color)&&d(b,g,x,v,b.point.Label,b.point.Key,b.point.Value,g.type==="scatter"?i("LocationValue","Location \xB7 size = value"):i("CustomRegionColor","Custom region color"))})):n==="calendar-heatmap"&&o[0]?.data.forEach((g,x)=>{a.Items.find(b=>b.Key===g.point.Key)?.Color&&d(g,o[0],0,x,g.point.Label,g.point.Key,g.point.Value,i("CustomDayColor","Custom day color"))}),{entries:r,scale:S,note:n==="scatter"&&a.Bubble?i("BubbleSize","Bubble size represents Size."):void 0}}function Ae(n,a){return{value:a.LegendShowValues===!1?"":n.compactValue||n.value||"",detail:a.LegendShowValues===!1?"":n.detail||"",percent:a.LegendShowPercentages&&n.percent!==void 0?new Intl.NumberFormat(a.Locale||"en-US",{style:"percent",maximumFractionDigits:1}).format(n.percent):""}}function ct(n){let a=f(n.color),e=n.symbol||"rect",t=e.startsWith("empty"),o=e.replace(/^empty/,"").toLowerCase(),r=t?"none":a,i=n.dash==="dashed"?"5 3":n.dash==="dotted"?"2 3":"",u=o.includes("diamond")?'<path d="M14 2 20 8 14 14 8 8Z"':o.includes("triangle")||o==="arrow"?'<path d="M14 2 20 13 8 13Z"':o.includes("circle")||o==="pin"?'<circle cx="14" cy="8" r="4"':'<rect x="9" y="3" width="10" height="10" rx="2"';return`<svg viewBox="${n.line?"0 0 28 16":"6 0 16 16"}" width="${n.line?28:16}" height="16" aria-hidden="true">${n.line?`<path d="M1 8H27" fill="none" stroke="${a}" stroke-width="2" stroke-dasharray="${i}"/>`:""}${u} fill="${r}" stroke="${a}" stroke-width="1.5"/></svg>`}function dt(n,a,e){let t=n.querySelector(".blu-chart__stage"),o=document.createElement("div");o.className="blu-chart__body",t.before(o),o.append(t);let r=document.createElement("div");r.className="blu-chart__legend",r.setAttribute("role","group"),r.setAttribute("aria-label","Chart legend"),o.append(r);let i=null,u={entries:[]},d={},l="",S=[],g=n.querySelector(".blu-chart__status");function x(h){let m=Ae(h,d);return`<span class="blu-chart__legend-heading"><span class="blu-chart__legend-marker">${ct(h)}</span><span class="blu-chart__legend-text blu-chart__legend-label">${f(h.label)}</span><span class="blu-chart__legend-text blu-chart__legend-check" aria-hidden="true">\u2713</span></span>${m.value||m.percent?`<span class="blu-chart__legend-numbers">${m.value?`<span class="blu-chart__legend-text blu-chart__legend-value">${f(m.value)}</span>`:""}${m.percent?`<span class="blu-chart__legend-text blu-chart__legend-percent">${f(m.percent)}</span>`:""}</span>`:""}${m.detail?`<span class="blu-chart__legend-text blu-chart__legend-detail">${f(m.detail)}</span>`:""}${d.LegendStyle==="ValueList"?`<span class="blu-chart__legend-track" aria-hidden="true"><span style="width:${h.percent===void 0?100:Math.max(0,Math.min(100,h.percent*100))}%;background:${f(h.color)}"></span></span>`:""}`}function b(h,m){let R=Ae(m,d);h.dataset.legendKey=m.id,h.setAttribute("aria-label",`${te(d,"Highlight","Highlight {label}",{label:m.label})}${R.detail?" \xB7 "+R.detail:""}${R.value?": "+m.value:""}${R.percent?" \xB7 "+R.percent:""}`),h.innerHTML=x(m)}function v(){a.dispatchAction({type:"downplay"}),u.entries.find(m=>m.id===i)?.targets.forEach(m=>a.dispatchAction({type:"highlight",...m})),S.forEach(m=>{m.instance.update({IsSelected:m.entry.id===i}),b(m.host.querySelector("button"),m.entry)}),r.querySelectorAll("[data-legend-key]").forEach(m=>m.setAttribute("aria-pressed",String(m.dataset.legendKey===i)))}function _(h){i=i===h?null:h,v(),g.textContent=i?te(d,"Highlighting","Highlighting {label}. Activate again to clear.",{label:u.entries.find(m=>m.id===i).label}):te(d,"HighlightCleared","Legend highlight cleared.")}function w(){S.splice(0).forEach(h=>h.instance.destroy())}return{prepare(h,m){d=h,r.setAttribute("aria-label",te(h,"Legend","Chart legend"));let R=h.LegendPosition||"Top",z=n.clientWidth<520&&["Left","Right"].includes(R)?"Bottom":R;o.dataset.legendPosition=z,r.hidden=h.ShowLegend===!1||m,o.classList.toggle("blu-chart__body--no-legend",r.hidden),r.dataset.style=h.LegendStyle||"Standard",r.hidden&&(i=null)},render(h,m,R){u=st(e,h,m,R),u.entries.some(P=>P.id===i)||(i=null),!u.entries.length&&!u.scale&&(r.hidden=!0,o.classList.add("blu-chart__body--no-legend"));let z=Math.max(1,Math.min(4,Math.floor((r.clientWidth-30)/150))),Y=Math.ceil(u.entries.length/Math.ceil(u.entries.length/z))||1;r.style.setProperty("--legend-columns",String(Y));let F=JSON.stringify([u,h.LegendStyle,h.LegendShowValues,h.LegendShowPercentages,h.Messages,R.surface,R.text]);if(F!==l){let P=r.contains(document.activeElement)?document.activeElement.dataset.legendKey:void 0;l=F,w(),r.innerHTML=`${u.scale?`<div class="blu-chart__legend-scale"><span class="blu-chart__legend-text blu-chart__legend-scale-title">${f(u.scale.label)}</span><div class="blu-chart__legend-gradient" style="background:linear-gradient(90deg,${u.scale.colors.map(f).join(",")})" aria-hidden="true"></div><div class="blu-chart__legend-range"><span class="blu-chart__legend-text">${f(Z(u.scale.min,h))}</span><span class="blu-chart__legend-text">${f(Z(u.scale.max,h))}</span></div></div>`:""}<div class="blu-chart__legend-items"></div>${u.note?`<span class="blu-chart__legend-text blu-chart__legend-note">${f(u.note)}</span>`:""}`;let G=r.querySelector(".blu-chart__legend-items");u.entries.forEach(N=>{if(h.LegendStyle==="Compact"){let k=document.createElement("div");k.className="blu-chart__legend-chip-host",G.append(k);let A=Lt(k,{Label:N.label,Color:"Secondary",IsSelectable:!0,IsSelected:N.id===i,ExtendedClass:"blu-chart__legend-chip"},{SelectionChanged:()=>_(N.id)});S.push({entry:N,host:k,instance:A})}else{let k=document.createElement("button");k.type="button",k.className="blu-chart__legend-entry",b(k,N),k.onclick=()=>_(N.id),G.append(k)}}),v(),P&&[...r.querySelectorAll("[data-legend-key]")].find(N=>N.dataset.legendKey===P)?.focus({preventScroll:!0})}else v()},exportLayout(){return{body:o,stage:t,legend:r,model:u}},reset(){i=null},destroy(){w(),r.replaceChildren()}}}function ut(n){let{body:a,legend:e,model:t}=n;if(e.hidden)return"";let o=a.getBoundingClientRect(),r=[],i=d=>{let l=d.getBoundingClientRect();return{x:l.x-o.x,y:l.y-o.y,w:l.width,h:l.height}};for(let d of e.querySelectorAll(".blu-chart__legend-entry,.blu-chart__legend-chip,.blu-chart__legend-scale")){let l=i(d),S=getComputedStyle(d);r.push(`<rect x="${l.x}" y="${l.y}" width="${l.w}" height="${l.h}" rx="${Math.min(parseFloat(S.borderRadius)||0,l.w/2,l.h/2)}" fill="${f(S.backgroundColor)}" stroke="${parseFloat(S.borderWidth)>0?f(S.borderColor):"none"}" stroke-width="${parseFloat(S.borderWidth)||0}"/>`)}for(let d of e.querySelectorAll(".blu-chart__legend-marker svg")){let l=i(d);r.push(`<svg x="${l.x}" y="${l.y}" width="${l.w}" height="${l.h}" viewBox="${f(d.getAttribute("viewBox")||"0 0 28 16")}">${d.innerHTML}</svg>`)}let u=e.querySelector(".blu-chart__legend-gradient");if(u&&t.scale){let d=i(u);r.push(`<defs><linearGradient id="blu-export-legend-scale">${t.scale.colors.map((l,S)=>`<stop offset="${S/(t.scale.colors.length-1)*100}%" stop-color="${f(l)}"/>`).join("")}</linearGradient></defs><rect x="${d.x}" y="${d.y}" width="${d.w}" height="${d.h}" rx="4" fill="url(#blu-export-legend-scale)"/>`)}for(let d of e.querySelectorAll(".blu-chart__legend-track,.blu-chart__legend-track>span")){let l=i(d);l.w&&l.h&&r.push(`<rect x="${l.x}" y="${l.y}" width="${l.w}" height="${l.h}" rx="2" fill="${f(getComputedStyle(d).backgroundColor)}"/>`)}for(let d of e.querySelectorAll(".blu-chart__legend-text")){let l=d.firstChild;if(!l||l.nodeType!==Node.TEXT_NODE)continue;let S=getComputedStyle(d);if(!d.getClientRects().length||S.visibility==="hidden")continue;let g=parseFloat(S.fontSize),x=document.createRange(),b=[];for(let v=0;v<l.textContent.length;v++){x.setStart(l,v),x.setEnd(l,v+1);let _=x.getBoundingClientRect(),w=b.at(-1);w&&Math.abs(w.y-_.y)<1?w.text+=l.textContent[v]:b.push({x:_.x,y:_.y,text:l.textContent[v]})}for(let v of b)r.push(`<text x="${v.x-o.x}" y="${v.y-o.y+g*.86}" font-size="${g}" font-weight="${S.fontWeight}" fill="${f(S.color)}"${S.textDecorationLine.includes("underline")?' text-decoration="underline"':""}>${f(v.text)}</text>`)}return r.join("")}async function he(n,a,e,t){a?.aborted&&(n.catch(()=>{}),a.throwIfAborted());let o,r=()=>{};try{return await Promise.race([n,new Promise((i,u)=>{r=()=>u(a?.reason??new DOMException("Operation aborted.","AbortError")),a?.addEventListener("abort",r,{once:!0}),o=setTimeout(()=>u(new Error(t)),e)})])}finally{clearTimeout(o),a?.removeEventListener("abort",r)}}function Kt(n,a){let e=URL.createObjectURL(n),t=document.createElement("a");t.href=e,t.download=a,document.body.append(t),t.click(),t.remove(),setTimeout(()=>URL.revokeObjectURL(e),1e3)}function pt(n,a){let e=[];for(let t of n.split(/\s+/))!e.length||e[e.length-1].length+t.length>a?e.push(t):e[e.length-1]+=` ${t}`;return e.slice(0,4)}async function ht(n,a,e,t,o,r,i,u,d){d?.throwIfAborted();let l=u?.body.clientWidth||n.getWidth(),S=u?.body.getBoundingClientRect().height||n.getHeight(),g=u?.body.getBoundingClientRect(),x=u?.stage.getBoundingClientRect(),b=g&&x?x.x-g.x:0,v=g&&x?x.y-g.y:0;if(l<=0||n.getHeight()<=0)throw new Error("Show the chart before downloading it.");let _=pt(a.Title||"Chart",Math.max(16,Math.floor((l-32)/10))),w=pt(a.Description||"",Math.max(24,Math.floor((l-32)/6))),h=_.length*22+w.length*15+24,m=S+h+32,R=_.map((P,G)=>`<text x="16" y="${26+G*22}" font-size="17" font-weight="600" fill="${r}">${f(P)}</text>`).join(""),z=w.map((P,G)=>`<text x="16" y="${28+_.length*22+G*15}" font-size="11" fill="${i}">${f(P)}</text>`).join(""),Y=`<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${m}" viewBox="0 0 ${l} ${m}" role="img" aria-labelledby="chart-title chart-description"><title id="chart-title">${f(a.Title||"Chart")}</title><desc id="chart-description">${f(a.Description||"Chart visualization. Exact values are available in the source chart data table.")}</desc><rect width="100%" height="100%" fill="${o}"/><g font-family="Inter,system-ui,sans-serif">${R}${z}<g transform="translate(0 ${h})"><g transform="translate(${b} ${v})">${n.renderToSVGString()}</g>${u?ut(u):""}</g><text x="16" y="${m-12}" fill="${i}" font-size="9">${f(a.ExportFootnote||"BluKavantUI")}</text></g></svg>`,F=new Blob([Y],{type:"image/svg+xml"});if(e==="png"){if(l*2>16384||m*2>16384||l*m*4>32e6)throw new Error("This chart is too large for PNG. Use SVG or reduce the displayed data.");let P=URL.createObjectURL(F);try{let G=new Image;G.src=P,await he(G.decode(),d,15e3,"PNG decoding timed out. Try SVG."),d?.throwIfAborted();let N=document.createElement("canvas");N.width=Math.ceil(l*2),N.height=Math.ceil(m*2);let k=N.getContext("2d");if(!k)throw new Error("PNG export is unavailable. Try SVG.");k.drawImage(G,0,0,N.width,N.height),F=await he(new Promise((A,T)=>N.toBlob(H=>H?A(H):T(new Error("PNG export failed. Try SVG.")),"image/png")),d,15e3,"PNG encoding timed out. Try SVG.")}finally{URL.revokeObjectURL(P)}}d?.throwIfAborted(),Kt(F,t)}function ve(n,a){n==="mixed"?nt(a):n==="heatmap"?rt(a):lt(n,a)}function ke(n,a){if(n==="mixed"){let e=a;return e.Series.flatMap((t,o)=>e.Categories.map((r,i)=>({...tt(e,i,o),Label:r.Label,CategoryKey:r.Key})))}return n==="heatmap"?a.Cells.map((e,t)=>{let o=at(a,t);return{...o,Label:`${o.YLabel}, ${o.XLabel}`}}):Ve(n,a)}function Le(n,a){return JSON.stringify([n,a.Key,a.SeriesKey||"",a.CategoryKey||"",a.RingKey||"",a.PointType||""])}function gt(n,a,e){let t={...a,...structuredClone(e)};ve(n,{...t,SelectedKey:null});let r=t.SelectedKey!=null&&!ke(n,t).some(i=>i.Key===t.SelectedKey)&&(!Object.hasOwn(e,"SelectedKey")||e.SelectedKey===a.SelectedKey);return r&&(t.SelectedKey=null),ve(n,t),{next:t,cleared:r}}function mt(n,a){let e=[];return(n?.series||[]).forEach((t,o)=>{if(t.type==="treemap"){let r=1,i=u=>u.forEach(d=>{let l=r++;d.id===a&&e.push({seriesIndex:o,dataIndex:l}),i(d.children||[])});i(t.data||[])}else(t.data||[]).forEach((r,i)=>{r?.point?.Key===a&&e.push({seriesIndex:o,dataIndex:i,...t.type==="sankey"?{dataType:"node"}:{}})});(t.links||[]).forEach((r,i)=>{r?.point?.Key===a&&e.push({seriesIndex:o,dataIndex:i,dataType:"edge"})})}),e}function bt(n,a,e){return n.Messages?.[a]??e}import{registerMap as Mt}from"echarts/core";var Pe={World:new URL("./maps/world.geojson",import.meta.url).href,US:new URL("./maps/us-states.geojson",import.meta.url).href};async function yt(n,a){let e=new AbortController,t=()=>e.abort(a?.reason);a?.addEventListener("abort",t,{once:!0}),a?.aborted&&t();try{return await he((async()=>{let o=new URL(n,typeof location>"u"?"http://localhost/":location.href);if(!["http:","https:"].includes(o.protocol)||o.username||o.password)throw new Error("Map URL must be an HTTP resource without embedded credentials.");let r=await fetch(o.href,{signal:e.signal,credentials:"same-origin"});if(!r.ok)throw new Error(`Map resource failed (${r.status}).`);if(Number(r.headers.get("Content-Length"))>I.mapBytes)throw new Error("Map resource exceeds the size limit.");let i="";if(r.body){let d=r.body.getReader(),l=new TextDecoder,S=0;try{for(;;){let g=await d.read();if(g.done)break;if(S+=g.value.length,S>I.mapBytes)throw new Error("Map resource exceeds the size limit.");i+=l.decode(g.value,{stream:!0})}i+=l.decode()}finally{await d.cancel().catch(()=>{})}}else if(i=await r.text(),new TextEncoder().encode(i).length>I.mapBytes)throw new Error("Map resource exceeds the size limit.");e.signal.throwIfAborted();let u=JSON.parse(i);return Se(u),u})(),e.signal,1e4,"Map resource timed out. Retry the update.")}finally{e.abort(),a?.removeEventListener("abort",t)}}function Et(n=Mt,a=16){let e=[];return{acquire(t){let o=JSON.stringify(t);if(new TextEncoder().encode(o).length>I.mapBytes)throw new Error("Map resource exceeds the size limit.");let r=e.find(d=>d.refs>0&&d.signature===o);if(!r){if(r=e.find(d=>!d.refs),!r){if(e.length>=a)throw new Error("Too many different maps are active.");r={name:`blu-charts-map-v1-${e.length}`,signature:"",refs:0},e.push(r)}n(r.name,t),r.signature=o}r.refs++;let i=!1,u=r;return{name:r.name,release(){i||(i=!0,--u.refs||(u.signature="",n(u.name,{type:"FeatureCollection",features:[]})))}}},stats(){return{slots:e.length,active:e.filter(t=>t.refs>0).length}}}}var Ie=Et();async function ft(n,a){let e=n.Map==="Custom"?n.GeoJSON??await yt(n.MapURL,a):await yt(n.Map==="US"?Pe.US:Pe.World,a);return a.throwIfAborted(),Se(e),ce(n,e),e}function rn(n,a,e,t,o){return At(n,a,e,t,o)}function At(n,a,e,t,o){let r={...Qe,...structuredClone(e)},i=r,u=(s,...p)=>{if(!d)try{s?.(...p)}catch(y){console.error("Chart event handler failed.",y)}},d=!1,l=!1,S=0,g=0,x=0,b=!1,v=!1,_="",w="";try{ve(a,r)}catch(s){throw u(t.Error,{Message:String(s.message),Code:"InvalidData"}),s}let h,m,R,z,Y,F="",P,G=new AbortController,N,k="treemapRootToNode",A=document.createElement("section");A.className="blu-chart",A.innerHTML='<div class="blu-chart__heading"><div><h3></h3><p></p></div><div class="blu-chart__export"><select aria-label="Chart download format"><option value="png">PNG image</option><option value="svg">SVG vector</option></select><button type="button" aria-label="Download chart">\u2193 <span>Download</span></button></div></div><div class="blu-chart__stage"><div class="blu-chart__plot" role="img"></div><div class="blu-chart__state" aria-hidden="true" hidden></div></div><p class="blu-chart__missing-note" hidden></p><div class="blu-chart__navigation" role="group" aria-label="Chart navigation" hidden></div><details class="blu-chart__data"><summary>View data & keyboard selections</summary><label class="blu-chart__patterns"><input type="checkbox"><span>Use fill patterns</span></label><div class="blu-chart__table" tabindex="0" role="region"></div></details><div class="blu-chart__state-announcement" role="status" aria-live="polite" aria-atomic="true"></div><div class="blu-chart__status" role="status" aria-live="polite"></div>',n.append(A);let T=s=>A.querySelector(s),H=T(".blu-chart__plot"),Q=T(".blu-chart__table"),ae=T(".blu-chart__status"),W=T(".blu-chart__navigation"),De=it(T(".blu-chart__state")),ze=ot(T(".blu-chart__state-announcement")),ne=T(".blu-chart__export button"),me=T(".blu-chart__patterns input"),be=matchMedia("(prefers-reduced-motion: reduce)"),Me=matchMedia("(forced-colors: active)"),Ge=matchMedia("(prefers-color-scheme: dark)"),re=()=>ke(a,r),Ee=()=>re().some(s=>s.Value!==null),$=(s,p)=>bt(r,s,p);function ye(){if(d)throw new Error("This chart has been destroyed.")}function de(s,p="InvalidData",y=""){d||(ae.textContent=s instanceof Error?s.message:String(s),u(t.Error,{Message:ae.textContent,Code:p,RequestId:y}),Fe("Error"))}function Fe(s){s!==_&&(_=s,u(t.StateChange,{State:s,Revision:S}))}function Ct(s){if(h?.dispatchAction({type:"downplay"}),!(!s||b||r.IsLoading)){if(a==="mixed"){let p=r,y=p.Categories.findIndex(C=>C.Key===s);y>=0&&p.Series.forEach((C,M)=>h?.dispatchAction({type:"highlight",seriesIndex:M,dataIndex:y}));return}if(a==="heatmap"){let p=r.Cells.findIndex(y=>y.Key===s);p>=0&&h?.dispatchAction({type:"highlight",seriesIndex:0,dataIndex:p});return}for(let p of mt(R,s))h?.dispatchAction({type:"highlight",...p})}}function St(){if(!(h||H.clientWidth<=0||H.clientHeight<=0)){Ke.use([Tt,$t,Ot,Rt,Nt,Vt]),h=Ke.init(H,void 0,{renderer:"svg"}),m=dt(A,h,a),h.on("click","series",s=>{let p=s.data?.point;if(a==="mixed"){let y=r;p=re().find(C=>C.Key===y.Categories[s.dataIndex]?.Key&&C.SeriesKey===y.Series[s.seriesIndex]?.Key)}a==="heatmap"&&(p=re()[s.dataIndex]),p&&Be(p,"Chart")});for(let[s,p]of[["treemaproottonode","treemapRootToNode"],["treemapzoomtonode","treemapZoomToNode"]])h.on(s,y=>{N=y.targetNodeId||y.targetNode?.getId?.(),k=p})}}function ue(s){return s.Value===null?$("NoData","No data"):et(s.Value,r.__valueText?.[Le(a,s)])}function Ue(s){cancelAnimationFrame(x),x=requestAnimationFrame(()=>{if(d||!A.isConnected)return;let p=document.activeElement;if(p!==document.body&&p!==Q&&p?.dataset.point!==s)return;([...Q.querySelectorAll("[data-point]")].find(C=>C.dataset.point===s)||Q).focus({preventScroll:!0})})}function wt(){let s=re(),p=document.activeElement,y=p&&Q.contains(p)?p.dataset.point:void 0,C=(O,L)=>r.EnableSelection&&O.Value!==null?`<button type="button" data-point="${f(Le(a,O))}" aria-label="${f(`${O.Label}${O.SeriesName?", "+O.SeriesName:""}: ${ue(O)}`)}" aria-pressed="${r.SelectedKey===O.Key}">${f(L)}</button>`:f(L),M="",E="";if(a==="mixed"){let O=r,L=new Map(s.map(K=>[JSON.stringify([K.Key,K.SeriesKey]),K]));M=`<tr><th scope="col">${f($("Category","Category"))}</th>${O.Series.map(K=>`<th scope="col">${f(K.Name)}</th>`).join("")}</tr>`,E=O.Categories.map(K=>`<tr><th scope="row">${f(K.Label)}</th>${O.Series.map(V=>{let q=L.get(JSON.stringify([K.Key,V.Key]));return`<td>${C(q,ue(q))}</td>`}).join("")}</tr>`).join("")}else if(a==="heatmap"){let O=r,L=new Map(s.map(K=>[JSON.stringify([K.XKey,K.YKey]),K]));M=`<tr><th scope="col">${f($("Category","Category"))}</th>${O.XCategories.map(K=>`<th scope="col">${f(K.Label)}</th>`).join("")}</tr>`,E=O.YCategories.map(K=>`<tr><th scope="row">${f(K.Label)}</th>${O.XCategories.map(V=>{let q=L.get(JSON.stringify([V.Key,K.Key]));return`<td>${q?C(q,ue(q)):f($("NoData","No data"))}</td>`}).join("")}</tr>`).join("")}else{let O=["Key","Label","Date","Value","CategoryKey","SeriesKey","RingKey","ParentKey","X","Y","Size","Group","SourceKey","TargetKey","Longitude","Latitude","PointType"].filter(L=>s.some(K=>K[L]!==void 0));M=`<tr>${O.map(L=>`<th scope="col">${f($(L,L))}</th>`).join("")}</tr>`,E=s.map(L=>`<tr>${O.map(K=>{let V=L[K],q=K==="Value"?ue(L):V===null?"null":String(V??"");return`<td>${K==="Label"?C(L,q):f(q)}</td>`}).join("")}</tr>`).join("")}Q.setAttribute("aria-label",`${r.Title} ${$("Values","values")}`),Q.innerHTML=`<table><caption>${f(r.Title||"Chart")} \u2014 ${f($("ExactValues","original values"))}</caption><thead>${M}</thead><tbody>${E}</tbody></table>`,y&&Ue(y)}function ee(s=!1){if(d)return;let p=b||!!r.IsLoading,y=!Ee(),C=!!w&&!p;if(A.className=`blu-chart ${r.ExtendedClass||""}`,A.setAttribute("aria-label",r.AccessibleLabel||r.Title||"Chart"),T("h3").textContent=r.Title||"Chart",T(".blu-chart__heading p").textContent=r.Description||"",T(".blu-chart__heading").hidden=!r.ShowHeader&&!r.ShowToolbar,T("h3").parentElement.hidden=!r.ShowHeader,T(".blu-chart__export").hidden=!r.ShowToolbar,ne.querySelector("span").textContent=$("Download","Download"),ne.setAttribute("aria-label",$("DownloadChart","Download chart")),T("select").setAttribute("aria-label",$("DownloadFormat","Chart download format")),T('option[value="png"]').textContent=$("PNG","PNG image"),T('option[value="svg"]').textContent=$("SVG","SVG vector"),W.setAttribute("aria-label",$("Navigation","Chart navigation")),T(".blu-chart__patterns").hidden=!["mixed","line","radar","bar","polar","pie","doughnut","nightingale","treemap","sankey","funnel"].includes(a),T(".blu-chart__patterns span").textContent=$("Patterns",a==="line"||a==="radar"?"Use fill patterns (with Area fill)":"Use fill patterns"),me.checked=!!r.ShowPatterns,T(".blu-chart__data").hidden=p||y,T(".blu-chart__data").classList.toggle("blu-chart__data--compact",!r.ShowDataTable),T(".blu-chart__data summary").textContent=r.ShowDataTable?$("ViewData","View data & keyboard selections"):$("ExploreData","Explore chart data"),H.style.height=`${r.Height}px`,H.style.visibility=p||y?"hidden":"visible",H.setAttribute("aria-busy",String(p)),a==="calendar-heatmap"){let L=r,K=Math.ceil(((Date.parse(L.RangeEnd)-Date.parse(L.RangeStart))/864e5+7)/7);H.style.minWidth=`${Math.max(300,K*12+56)}px`;let V=T(".blu-chart__stage");V.style.overflowX="auto",V.tabIndex=0,V.setAttribute("role","region"),V.setAttribute("aria-label",$("CalendarScroll","Calendar plot; scroll horizontally for more dates"))}let M=p?$("Loading",b?"Loading map\u2026":"Loading chart\u2026"):r.EmptyMessage||"No data to display";De.update(p,y,M,!!r.EnableAnimation&&!be.matches),ze.update(C?w:!p&&!y?$("Ready","Chart ready."):M),ne.disabled=l||p||y||C,W.hidden=p||y||C||!(a==="geo-map"&&r.Roam!==!1||a==="treemap"&&r.Drilldown),a==="geo-map"&&!W.children.length&&(W.innerHTML=["in","out","left","right","up","down","reset","full"].map(L=>`<button type="button" data-nav="${L}"></button>`).join("")),a==="treemap"&&!W.children.length&&(W.innerHTML='<button type="button" data-nav="reset"></button>');let E={in:"Zoom in",out:"Zoom out",left:"Pan left",right:"Pan right",up:"Pan up",down:"Pan down",reset:a==="treemap"?"Show entire tree":"Reset map",full:"Show full map"};if(W.querySelectorAll("[data-nav]").forEach(L=>{L.textContent=$("Map_"+L.dataset.nav,E[L.dataset.nav])}),St(),s&&m?.reset(),m?.prepare(r,p||y),h&&!b&&(a!=="geo-map"||z)){let L=!s&&h.getOption()?.geo?.[0],K=Oe(A),V=o({...r,ShowLegend:!1},K,z?.name,be.matches,H.clientWidth);delete V.legend,V.aria={...V.aria,description:`${r.Title}. ${r.Description||""} ${$("DataAlternative","Original values and keyboard selection are in the data table.")}`},V.geo&&L&&(V.geo.zoom=L.zoom,L.center&&(V.geo.center=L.center)),h.resize(),h.setOption(V,{notMerge:!0}),R=V,s&&(N=void 0),a==="treemap"&&N&&re().some(q=>q.Key===N)&&h.dispatchAction({type:k,seriesIndex:0,targetNodeId:N}),m?.render(r,V,K)}let O=T(".blu-chart__missing-note");if(a==="radar"){let L=r.Series.filter(K=>K.Values.some(V=>V===null));O.hidden=!L.length||p||y,O.textContent=`${L.map(K=>K.Label).join(", ")}: ${$("IncompleteRadar","incomplete profile. Available measurements remain in the data table; missing values are not drawn as zero.")}`}wt(),Me.matches&&!p&&!y&&(T(".blu-chart__data").open=!0),h&&!b&&!C&&!v&&(a!=="geo-map"||z)&&(v=!0,u(t.Ready)),d||Fe(p?"Loading":C?"Error":y?"Empty":"Ready")}function fe(s,p,y=z,C=Y,M=F){let E={options:r,map:z,geometry:Y,geometryKey:F,resourceError:w};r=s,z=y,Y=C,F=M;try{w="",ae.textContent="",ee(E.options.ResetKey!==s.ResetKey||E.geometryKey!==M)}catch(O){r=E.options,z=E.map,Y=E.geometry,F=E.geometryKey,w=E.resourceError,i=r;try{ee()}catch{}throw y!==E.map&&y?.release(),O}E.map!==y&&E.map?.release(),p&&u(t.SelectionChange,{Key:null,Reason:"DataChanged"})}function Te(s,p=!1){let y=++S;if(P?.abort(),b=!1,i=s,a!=="geo-map"){fe(s,p);return}let C=s,M=JSON.stringify([C.Map||"World",C.MapURL||"",C.GeoJSON||null]);if(Y&&M===F){ce(C,Y),fe(s,p);return}if(C.Map==="Custom"&&C.GeoJSON){ce(C,C.GeoJSON);let E=Ie.acquire(C.GeoJSON);fe(s,p,E,C.GeoJSON,M);return}b=!0,P=new AbortController,ee(),ft(C,P.signal).then(E=>{if(d||y!==S)return;b=!1;let O=Ie.acquire(E);fe(s,p,O,E,M)}).catch(E=>{d||y!==S||(b=!1,i=r,w=E instanceof Error?E.message:String(E),ee(),de(E,"ResourceLoadFailed"))})}function Be(s,p){if(d||b||r.IsLoading||s.Value===null&&!(a==="radar"&&s.PointType==="Series"))return;let y={...structuredClone(s),ValueText:s.Value===null?"":ue(s)},C=!!r.EnableSelection,M=r.SelectedKey===s.Key?null:s.Key;if(C){let E={...r,SelectedKey:M};if(a==="treemap"&&p==="Table"&&E.Drilldown&&(N=s.Key,k="treemapRootToNode"),Te(E),d)return;ae.textContent=M?`${$("Selected","Selected")} ${s.Label}.`:$("SelectionCleared","Selection cleared.")}u(t.PointClick,y,p),C&&!d&&u(t.SelectionChange,{Key:M,Reason:"User"})}Q.onclick=s=>{let p=s.target.closest("[data-point]"),y=p?.dataset.point,C=p&&re().find(M=>Le(a,M)===y);C&&(Be(C,"Table"),!d&&A.isConnected&&(document.activeElement===document.body||A.contains(document.activeElement))&&Ue(y))},me.onchange=()=>{oe.update({ShowPatterns:me.checked}),u(t.PatternsChange,{ShowPatterns:me.checked})},W.onclick=s=>{let p=s.target.closest("[data-nav]")?.dataset.nav;if(!(!p||!h)){if(p==="full"){oe.update({MapView:"Full",ResetKey:crypto.randomUUID()});return}if(p==="reset"){N=void 0,ee(!0);return}h.dispatchAction({type:"geoRoam",componentType:"geo",geoIndex:0,dx:p==="left"?-60:p==="right"?60:0,dy:p==="up"?-60:p==="down"?60:0,zoom:p==="in"?1.3:p==="out"?1/1.3:1,originX:H.clientWidth/2,originY:H.clientHeight/2}),ae.textContent=$("Map_"+p,vt(p))}};function vt(s){return`Map view changed: ${s}.`}let X=()=>{try{ee()}catch(s){de(s,"RenderFailed")}},qe=s=>{s.key==="Escape"&&h?.dispatchAction({type:"hideTip"})},je=0,Je=0,Ye=new ResizeObserver(()=>{let s=H.clientWidth,p=H.clientHeight;s===je&&p===Je||(je=s,Je=p,cancelAnimationFrame(g),g=requestAnimationFrame(()=>{!d&&s>0&&p>0&&X()}))}),Xe=new MutationObserver(X);Xe.observe(document.documentElement,{attributes:!0,attributeFilter:["data-bluui-theme"]}),be.addEventListener("change",X),Me.addEventListener("change",X),Ge.addEventListener("change",X),document.addEventListener("keydown",qe);let oe={update(s){ye();try{let{next:p,cleared:y}=gt(a,i,s);Te(p,y)}catch(p){if(!b){i=r;try{ee()}catch{}}throw de(p,/SelectedKey/.test(p.message)?"InvalidSelection":"InvalidData"),p}},resize(){ye(),X()},setSelection(s){oe.update({SelectedKey:s})},highlight(s){ye(),Ct(s)},async download(s="png",p=`blukavant-${a}.${s}`,y=crypto.randomUUID()){ye();let C=!1;try{if(!["png","svg"].includes(s))throw new Error("Choose PNG or SVG.");if(l)throw new Error("ExportBusy");if(!h||b||w||r.IsLoading||!Ee())throw new Error("Wait for a visible chart with valid data before downloading.");l=!0,C=!0,ne.disabled=!0;let M=Oe(A);await ht(h,r,s,p,M.surface,M.text,M.muted,m?.exportLayout(),G.signal),d||(ae.textContent=$("ExportStarted","Chart download started."),u(t.ExportStarted,{Format:s,FileName:p,RequestId:y}),u(t.ExportComplete,{Format:s,FileName:p}))}catch(M){throw d||de(M,M instanceof Error&&M.message==="ExportBusy"?"ExportBusy":"ExportFailed",y),M}finally{C&&(l=!1,d||(ne.disabled=b||!!w||!!r.IsLoading||!Ee()))}},destroy(){d||(d=!0,S++,P?.abort(),G.abort(),cancelAnimationFrame(g),cancelAnimationFrame(x),Ye.disconnect(),Xe.disconnect(),be.removeEventListener("change",X),Me.removeEventListener("change",X),Ge.removeEventListener("change",X),document.removeEventListener("keydown",qe),ze.destroy(),De.destroy(),m?.destroy(),h?.dispose(),z?.release(),A.remove())}};ne.onclick=()=>{oe.download(T("select").value).catch(()=>{})},Ye.observe(A);try{Te(r)}catch(s){throw de(s),oe.destroy(),s}return oe}var kt=3.2;function He(n){if(n.startsWith("#")){let e=n.slice(1);return e.length<=4&&(e=e.split("").map(t=>t+t).join("")),[0,2,4].map(t=>parseInt(e.slice(t,t+2),16)).concat(e.length===8?parseInt(e.slice(6),16)/255:1)}let a=n.match(/[\d.]+/g)?.map(Number);return a&&a.length>=3?[...a.slice(0,3),a[3]??1]:[24,34,48,1]}function Pt(n){return`rgb(${n.slice(0,3).map(a=>Math.round(a)).join(",")})`}function It(n,a){let e=He(n),t=He(a);return Pt(e.slice(0,3).map((o,r)=>o*e[3]+t[r]*(1-e[3])))}function xt(n){let a=He(n).slice(0,3).map(e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4});return a[0]*.2126+a[1]*.7152+a[2]*.0722}function ge(n,a){let e=xt(n),t=xt(a);return(Math.max(e,t)+.05)/(Math.min(e,t)+.05)}function _t(n,a,e=kt){let t=It(n,a);if(ge(t,a)>=e)return t;let o=ge("#000",a)>=ge("#fff",a)?"#000":"#fff",r=Math.min(e,ge(o,a)),i=0,u=1;for(let d=0;d<20;d++){let l=(i+u)/2;ge(xe([t,o],l),a)>=r?u=l:i=l}return xe([t,o],u)}function sn(n,a){let e=_t(n,a,9);return[_t(xe([a,e],.12),a),e]}var cn=n=>["circle","diamond","triangle","rect","roundRect","pin","arrow","emptyCircle","emptyDiamond","emptyTriangle","emptyRect","emptyRoundRect"][n%12],dn=n=>["solid","dashed","dotted"][(n+Math.floor(n/12))%3];function Ht(n,a){let e=[{symbol:"rect",symbolSize:0,dashArrayX:[1,0],dashArrayY:[1,8],rotation:0},{symbol:"rect",symbolSize:1,dashArrayX:[1,0],dashArrayY:[1,8],rotation:Math.PI/4},{symbol:"circle",symbolSize:1,dashArrayX:[2,7],dashArrayY:[2,7],rotation:0},{symbol:"rect",symbolSize:1,dashArrayX:[1,0],dashArrayY:[1,8],rotation:-Math.PI/4},{symbol:"rect",symbolSize:1,dashArrayX:[1,0],dashArrayY:[1,6],rotation:0},{symbol:"rect",symbolSize:1,dashArrayX:[3,5],dashArrayY:[3,5],rotation:Math.PI/4},{symbol:"triangle",symbolSize:1,dashArrayX:[4,6],dashArrayY:[4,6],rotation:0},{symbol:"diamond",symbolSize:1,dashArrayX:[4,6],dashArrayY:[4,6],rotation:0},{symbol:"rect",symbolSize:1,dashArrayX:[1,0],dashArrayY:[1,3,1,7],rotation:Math.PI/4},{symbol:"circle",symbolSize:1,dashArrayX:[2,3],dashArrayY:[2,3],rotation:0},{symbol:"rect",symbolSize:1,dashArrayX:[1,0],dashArrayY:[3,4],rotation:-Math.PI/4},{symbol:"rect",symbolSize:1,dashArrayX:[4,4],dashArrayY:[1,5],rotation:0}];return{...e[n%e.length],color:$e(a),backgroundColor:"none"}}function Dt(n){return{color:n,borderColor:$e(n),borderWidth:2,borderType:"solid"}}function un(n,a,e=!1,t){return{color:n,opacity:1,borderColor:a,borderWidth:1.5,borderType:"solid",...e?Dt(n):{},...t===void 0?{}:{decal:Ht(t,n)}}}function pn(n,a,e=8){return({labelRect:t})=>({hideOverlap:!0,dx:Math.max(0,8-t.x)+Math.min(0,n-8-t.x-t.width),dy:Math.max(0,e-t.y)+Math.min(0,a-8-t.y-t.height)})}export{f as a,Ve as b,Z as c,at as d,zt as e,_t as f,sn as g,cn as h,dn as i,Ht as j,Dt as k,un as l,pn as m,rn as n,At as o};
@@ -1,2 +0,0 @@
1
- import{a as i,b as w,c as C,f as T,j as K,k as v,l as P,n as N}from"./chunk-QFXXWRD5.js";import{e as $,g as y}from"./chunk-QETOF22L.js";function I(d,o,S,R=!1,Y=640){let n=d,L=w("pie",d),M=(t,e)=>n.ShowPatterns?K(t,e):void 0,c=o.palette,m=(t,e)=>T(o.forcedColors?o.text:$(t,c[e%c.length],o.dark,o.read),o.surface,3.2),V=(t,e,s)=>P(m(e,s),o.surface,n.SelectedKey===t),z=(t,e)=>L.find(s=>s.Key===t&&(!e||s.SeriesKey===e)),D={data:["line","radar","bar","polar"].includes("pie")?n.Series.map(t=>t.Label):["pie","doughnut","nightingale","funnel"].includes("pie")?[...new Set(n.Items.map(t=>t.Label))]:[],show:n.ShowLegend,type:"scroll",top:6,left:10,right:10,itemWidth:24,itemHeight:12,selectedMode:!1,pageTextStyle:{color:o.muted},pageIconColor:o.text,textStyle:{color:o.muted,fontSize:11}},E={show:n.ShowLabels,color:y(o.surface),fontSize:11,backgroundColor:o.surface,padding:[2,3],borderRadius:2},H={show:n.ShowTooltip,confine:!0,enterable:!0,backgroundColor:o.surface,borderColor:o.border,textStyle:{color:o.text,fontSize:12},formatter:t=>{let e=t.data?.point;if(!e)return`${i(t.name||"")}${t.value==null||Number.isNaN(t.value)?" \xB7 No data":""}`;let s=e.Date?`<br/>${i(e.Date)}<br/><strong>${i(C(e.Value,n))}</strong>`:e.X!==void 0?`<br/>${i(n.XLabel||"X")}: ${e.X}<br/>${i(n.YLabel||"Y")}: ${e.Y}${e.Size===void 0?"":`<br/>Size: ${e.Size}`}`:`<br/><strong>${i(C(e.Value,n))}</strong>`;return`${i(e.SeriesName?`${e.SeriesName} \xB7 ${e.Label}`:e.Label)}${s}${t.data?.conversion?`<br/>${i(t.data.conversion)}`:""}`}},F={backgroundColor:o.surface,color:c.map((t,e)=>m(t,e)),animation:!!n.EnableAnimation&&!R,animationDuration:300,animationDurationUpdate:150,textStyle:{fontFamily:"Inter,system-ui,sans-serif",color:o.text},aria:{enabled:!0,description:`${n.Title}. ${n.Description||""} Exact values and keyboard selection are in the data table.`},tooltip:H},W={axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:o.muted,fontSize:10,hideOverlap:!0},splitLine:{lineStyle:{color:o.border,type:"dashed"}}},r=d,l=r.Nested?r.Rings:[{Key:"",Label:""}],h=r.Shape==="Half",x=!!r.Nested&&l.length>1,k=0,f=r.LabelPosition!=="Inside",g=f?66:76,A=[...new Set(r.Items.map(t=>t.Label))],O=l.map((t,e)=>{let s=x?e===0?[0,32]:[44+(g-44)*(e-1)/(l.length-1),44+(g-44)*e/(l.length-1)-(e===l.length-1?0:2)]:[k,Math.max(g,k+5)],p=!f||x&&e<l.length-1;return{type:"pie",id:t.Key||"pie",name:t.Label,top:n.ShowLegend?28:0,bottom:2,center:["50%",h?"72%":"55%"],radius:s.map(a=>`${a}%`),startAngle:h?180:90,endAngle:h?360:"auto",roseType:!1,avoidLabelOverlap:!0,stillShowZeroSum:!1,label:{...E,position:p?"inside":"outside",backgroundColor:p?void 0:o.surface,alignTo:"none",bleedMargin:6,distanceToLabelLine:4,formatter:`{b}
2
- {d}%`,lineHeight:15},labelLine:{show:!!n.ShowLabels&&!p,length:12,length2:8,smooth:.15},labelLayout:{hideOverlap:!0},emphasis:{scale:!0},data:r.Items.filter(a=>!r.Nested||a.RingKey===t.Key).map(a=>{let b=A.indexOf(a.Label),u=m(a.Color,b);return{id:a.Key,name:a.Label,value:a.Value,point:z(a.Key),label:{color:y(p?u:o.surface),backgroundColor:p?u:o.surface},labelLine:{lineStyle:{color:u,width:1.25}},itemStyle:{...V(a.Key,a.Color,b),decal:M(b,u),borderRadius:3},emphasis:{itemStyle:v(u)}}})}}),Z=L.find(t=>t.Key===n.SelectedKey)?.Value??r.Items.reduce((t,e)=>t+(e.Value||0),0);return{...F,legend:D,series:O,media:f?[{query:{maxWidth:420},option:{series:O.map(t=>({id:t.id,radius:t.radius.map(e=>`${parseFloat(e)*.84}%`)}))}}]:[],graphic:[]}}import{use as X}from"echarts/core";import{PieChart as B}from"echarts/charts";function ce(d,o,S={}){return X([B]),N(d,"pie",o,S,I)}export{ce as a};
package/scripts/build.mjs DELETED
@@ -1,31 +0,0 @@
1
- // Standalone build for the source included in Charts Community.
2
- // This does not need the BluKavantUI monorepo and cannot build Pro.
3
- import { build } from 'esbuild';
4
- import { cp, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
5
- import { execFileSync } from 'node:child_process';
6
- import { dirname, resolve } from 'node:path';
7
- import { fileURLToPath } from 'node:url';
8
-
9
- const root = fileURLToPath(new URL('../', import.meta.url));
10
- process.chdir(root);
11
- const edition = JSON.parse(await readFile('edition.json', 'utf8'));
12
- const allowed = ['sparkline', 'line', 'bar', 'pie', 'doughnut', 'scatter', 'radar', 'heatmap'];
13
- if (edition.edition !== 'community' || edition.charts.some(c => !allowed.includes(c.slug))) {
14
- throw new Error('This build accepts only the eight Charts Community entries.');
15
- }
16
- await rm('dist', { recursive: true, force: true });
17
- await mkdir('dist', { recursive: true });
18
- const entries = { index: 'src/community.ts', ...Object.fromEntries(edition.charts.map(c => [c.slug, 'src/' + c.slug + '.ts'])) };
19
- await build({ entryPoints: entries, bundle: true, splitting: true, format: 'esm', target: 'es2022', minify: true, outdir: 'dist', external: ['echarts/*', '@blukavantui/community', '@blukavantui/community/*'] });
20
- await build({ entryPoints: ['src/community.ts'], bundle: true, format: 'iife', globalName: 'BluKavantChartsCommunity', target: 'es2022', minify: true, outfile: 'dist/browser/charts-community.js', define: { 'import.meta.url': 'document.currentScript.src' } });
21
- execFileSync(process.execPath, [fileURLToPath(import.meta.resolve('typescript/bin/tsc')), '--emitDeclarationOnly', '--declaration', '--outDir', 'dist'], { stdio: 'inherit' });
22
- await cp('dist/community.d.ts', 'dist/index.d.ts');
23
- await mkdir('dist/sparkline-runtime', { recursive: true });
24
- await cp('src/sparkline-runtime/runtime.d.ts', 'dist/sparkline-runtime/runtime.d.ts');
25
- const uiDist = dirname(fileURLToPath(import.meta.resolve('@blukavantui/community/theme.css')));
26
- const sheets = await Promise.all(['src/charts.css', 'src/legend.css', resolve(uiDist, 'chip.css'), resolve(uiDist, 'skeleton.css'), 'src/sparkline.css'].map(f => readFile(f, 'utf8')));
27
- await writeFile('dist/styles.css', sheets.join('\n'));
28
- await cp('src/sparkline.css', 'dist/sparkline.css');
29
- await cp(resolve(uiDist, 'theme.css'), 'dist/theme.css');
30
- await cp(resolve(uiDist, 'fonts'), 'dist/fonts', { recursive: true });
31
- console.log('Built the eight Charts Community entries, CSS, declarations and browser bundle.');
package/tsconfig.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "moduleResolution": "Bundler",
6
- "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
- "strict": true,
8
- "skipLibCheck": false,
9
- "allowImportingTsExtensions": true,
10
- "declaration": true,
11
- "emitDeclarationOnly": true,
12
- "types": ["node"],
13
- "rootDir": "src"
14
- },
15
- "include": ["src/**/*.ts"]
16
- }