@carbon/charts 1.11.3 → 1.11.4

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 (41) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{_baseEach-477c04db.js → _baseEach-326db134.js} +2 -2
  3. package/dist/{_baseEach-477c04db.js.map → _baseEach-326db134.js.map} +1 -1
  4. package/dist/{_baseEach-05847c57.mjs → _baseEach-9b6a12fa.mjs} +2 -2
  5. package/dist/{_baseEach-05847c57.mjs.map → _baseEach-9b6a12fa.mjs.map} +1 -1
  6. package/dist/angle-utils-264ed176.mjs +840 -0
  7. package/dist/angle-utils-264ed176.mjs.map +1 -0
  8. package/dist/angle-utils-ccc0d890.js +3 -0
  9. package/dist/angle-utils-ccc0d890.js.map +1 -0
  10. package/dist/{choropleth-449cf25e.mjs → choropleth-141685a0.mjs} +271 -268
  11. package/dist/{choropleth-449cf25e.mjs.map → choropleth-141685a0.mjs.map} +1 -1
  12. package/dist/{choropleth-db3ae9eb.js → choropleth-b1a3729f.js} +8 -8
  13. package/dist/{choropleth-db3ae9eb.js.map → choropleth-b1a3729f.js.map} +1 -1
  14. package/dist/color-scale-utils-2cd523be.js +2 -0
  15. package/dist/color-scale-utils-2cd523be.js.map +1 -0
  16. package/dist/color-scale-utils-b9604b2c.mjs +3335 -0
  17. package/dist/color-scale-utils-b9604b2c.mjs.map +1 -0
  18. package/dist/components/index.js +1 -1
  19. package/dist/components/index.mjs +4 -4
  20. package/dist/demo/index.js +1 -1
  21. package/dist/demo/index.js.map +1 -1
  22. package/dist/demo/index.mjs +6 -6
  23. package/dist/{index-e425a7b5.mjs → index-4b5d1e49.mjs} +3 -3
  24. package/dist/{index-e425a7b5.mjs.map → index-4b5d1e49.mjs.map} +1 -1
  25. package/dist/{index-4203ca23.js → index-eace9da9.js} +2 -2
  26. package/dist/{index-4203ca23.js.map → index-eace9da9.js.map} +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/index.mjs +38 -38
  29. package/dist/model/index.js +1 -1
  30. package/dist/model/index.mjs +34 -34
  31. package/dist/services/index.js +1 -1
  32. package/dist/services/index.mjs +10 -10
  33. package/package.json +3 -3
  34. package/dist/angle-utils-512bc5cd.js +0 -2
  35. package/dist/angle-utils-512bc5cd.js.map +0 -1
  36. package/dist/angle-utils-7255d1d9.mjs +0 -387
  37. package/dist/angle-utils-7255d1d9.mjs.map +0 -1
  38. package/dist/color-scale-utils-222feda6.mjs +0 -3815
  39. package/dist/color-scale-utils-222feda6.mjs.map +0 -1
  40. package/dist/color-scale-utils-79786095.js +0 -3
  41. package/dist/color-scale-utils-79786095.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./color-scale-utils-79786095.js"),_=require("./index-822564ed.js"),l=require("./model/index.js"),s=require("./enums-aa2efd99.js"),e=require("./choropleth-db3ae9eb.js"),p=require("./index-4203ca23.js"),R=require("./angle-utils-512bc5cd.js");require("d3");require("./index-d865d500.js");require("./a11y-c7c9d087.js");require("./_baseEach-477c04db.js");require("d3-sankey");require("d3-cloud");function N(r,t,o){var a=-1,i=r.length;t<0&&(t=-t>i?0:i+t),o=o>i?i:o,o<0&&(o+=i),i=t>o?0:o-t>>>0,t>>>=0;for(var h=Array(i);++a<i;)h[a]=r[a+t];return h}function W(r,t,o){var a=r.length;return o=o===void 0?a:o,!t&&o>=a?r:N(r,t,o)}var z="\\ud800-\\udfff",q="\\u0300-\\u036f",j="\\ufe20-\\ufe2f",$="\\u20d0-\\u20ff",K=q+j+$,J="\\ufe0e\\ufe0f",X="\\u200d",Q=RegExp("["+X+z+K+J+"]");function k(r){return Q.test(r)}function Y(r){return r.split("")}var M="\\ud800-\\udfff",ee="\\u0300-\\u036f",te="\\ufe20-\\ufe2f",oe="\\u20d0-\\u20ff",se=ee+te+oe,ne="\\ufe0e\\ufe0f",ie="["+M+"]",b="["+se+"]",x="\\ud83c[\\udffb-\\udfff]",re="(?:"+b+"|"+x+")",P="[^"+M+"]",G="(?:\\ud83c[\\udde6-\\uddff]){2}",B="[\\ud800-\\udbff][\\udc00-\\udfff]",ae="\\u200d",F=re+"?",I="["+ne+"]?",le="(?:"+ae+"(?:"+[P,G,B].join("|")+")"+I+F+")*",he=I+F+le,ce="(?:"+[P+b+"?",b,G,B,ie].join("|")+")",pe=RegExp(x+"(?="+x+")|"+ce+he,"g");function me(r){return r.match(pe)||[]}function de(r){return k(r)?me(r):Y(r)}function ue(r){return function(t){t=n.toString(t);var o=k(t)?de(t):void 0,a=o?o[0]:t.charAt(0),i=o?W(o,1).join(""):t.slice(1);return a[r]()+i}}var Ce=ue("toUpperCase");const ge=Ce;function ve(r){return ge(n.toString(r).toLowerCase())}var we=e.createCompounder(function(r,t,o){return t=t.toLowerCase(),r+(o?ve(t):t)});const Te=we;class C{constructor(t,o){this.components=[],this.services={canvasZoom:p.CanvasZoom,domUtils:R.DOMUtils,events:p.Events,files:p.Files,gradientUtils:R.GradientUtils,transitions:p.Transitions},this.model=new l.ChartModel(this.services)}init(t,o){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(a=>{const i=this.services[a];this.services[a]=new i(this.model,this.services)}),this.services.events.addEventListener(s.Events.Model.UPDATE,a=>{const i=!!n.getProperty(a,"detail","animate");this.update(i)}),this.model.setData(o.data),this.services.events.addEventListener(s.Events.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const o=this.services.transitions.getPendingTransitions(),a=Object.keys(o).map(i=>o[i].end().catch(c=>c));Promise.all(a).then(()=>this.services.events.dispatchEvent(s.Events.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,o){const a=this.model.getOptions(),i=n.getProperty(a,"toolbar","enabled"),h={id:"legend",components:[new e.Legend(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},c=n.getProperty(a,"canvasZoom","enabled");c&&c===!0&&t.push(new e.CanvasChartClip(this.model,this.services));const g=!!this.model.getOptions().title,v={id:"title",components:[new e.Title(this.model,this.services)],growth:s.LayoutGrowth.STRETCH},y={id:"toolbar",components:[new e.Toolbar(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},L={id:"header",components:[new e.LayoutComponent(this.model,this.services,[v,...i?[y]:[]],{direction:s.LayoutDirection.ROW,alignItems:s.LayoutAlignItems.CENTER})],growth:s.LayoutGrowth.PREFERRED},S={id:"graph-frame",components:t,growth:s.LayoutGrowth.STRETCH,renderType:n.getProperty(o,"graphFrameRenderType")||s.RenderTypes.SVG},E=n.getProperty(o,"excludeLegend")!==!0&&a.legend.enabled!==!1;let w=s.LayoutDirection.COLUMN;if(E){const T=n.getProperty(a,"legend","position");T==="left"?(w=s.LayoutDirection.ROW,a.legend.orientation||(a.legend.orientation=s.LegendOrientations.VERTICAL)):T==="right"?(w=s.LayoutDirection.ROW_REVERSE,a.legend.orientation||(a.legend.orientation=s.LegendOrientations.VERTICAL)):T==="bottom"&&(w=s.LayoutDirection.COLUMN_REVERSE)}const A={id:"spacer",components:[new e.Spacer(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},d={id:"full-frame",components:[new e.LayoutComponent(this.model,this.services,[...E?[h]:[],...E?[A]:[],S],{direction:w})],growth:s.LayoutGrowth.STRETCH},u=[];if(g||i){u.push(L);const T={id:"spacer",components:[new e.Spacer(this.model,this.services,i?{size:15}:void 0)],growth:s.LayoutGrowth.PREFERRED};u.push(T)}return u.push(d),[new e.Tooltip(this.model,this.services),new e.Modal(this.model,this.services),new e.LayoutComponent(this.model,this.services,u,{direction:s.LayoutDirection.COLUMN})]}}class m extends C{constructor(t,o){super(t,o),this.services=Object.assign(this.services,{cartesianScales:p.CartesianScales,curves:p.Curves,zoom:p.Zoom}),this.model=new l.ChartModelCartesian(this.services)}getAxisChartComponents(t,o){const a=this.model.getOptions(),i=n.getProperty(a,"zoomBar",s.AxisPositions.TOP,"enabled"),h=n.getProperty(a,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const c=this.services.cartesianScales.getMainXAxisPosition(),g=n.getProperty(a,"axes",c,"scaleType"),v=i&&c===s.AxisPositions.BOTTOM&&g===s.ScaleTypes.TIME,y=this.services.zoom.isZoomBarLocked(s.AxisPositions.TOP),L=!!this.model.getOptions().title,S={id:"title",components:[new e.Title(this.model,this.services)],growth:s.LayoutGrowth.STRETCH},E={id:"toolbar",components:[new e.Toolbar(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},w={id:"header",components:[new e.LayoutComponent(this.model,this.services,[S,...h?[E]:[]],{direction:s.LayoutDirection.ROW,alignItems:s.LayoutAlignItems.CENTER})],growth:s.LayoutGrowth.PREFERRED},A={id:"legend",components:[new e.Legend(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED};v&&!y&&t.push(new e.ChartClip(this.model,this.services),new e.ChartBrush(this.model,this.services)),t.push(new e.Threshold(this.model,this.services)),t.push(new e.Highlight(this.model,this.services));const d={id:"graph-frame",components:t,growth:s.LayoutGrowth.STRETCH,renderType:s.RenderTypes.SVG},u=n.getProperty(o,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let T=s.LayoutDirection.COLUMN;if(u){const O=n.getProperty(this.model.getOptions(),"legend","position");O===s.LegendPositions.LEFT?(T=s.LayoutDirection.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=s.LegendOrientations.VERTICAL)):O===s.LegendPositions.RIGHT?(T=s.LayoutDirection.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=s.LegendOrientations.VERTICAL)):O===s.LegendPositions.BOTTOM&&(T=s.LayoutDirection.COLUMN_REVERSE)}const Z={id:"spacer",components:[new e.Spacer(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},U={id:"full-frame",components:[new e.LayoutComponent(this.model,this.services,[...u?[A]:[],...u?[Z]:[],d],{direction:T})],growth:s.LayoutGrowth.STRETCH},V={id:"zoom-bar",components:[new e.ZoomBar(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED,renderType:s.RenderTypes.SVG},D=[];if(L||h){D.push(w);const O={id:"spacer",components:[new e.Spacer(this.model,this.services,h?{size:15}:void 0)],growth:s.LayoutGrowth.PREFERRED};D.push(O)}return v&&D.push(V),D.push(U),[new e.AxisChartsTooltip(this.model,this.services),new e.Modal(this.model,this.services),new e.LayoutComponent(this.model,this.services,D,{direction:s.LayoutDirection.COLUMN})]}}class Re extends C{constructor(t,o){super(t,o),this.model=new l.AlluvialChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.alluvialChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.Alluvial(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class ye extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.clone(n.options.areaChart),o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Ruler(this.model,this.services),new e.Line(this.model,this.services),new e.Area(this.model,this.services),new e.Scatter(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID})];return this.getAxisChartComponents(t)}}class Se extends m{constructor(t,o){super(t,o),this.model=new l.BoxplotChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.boxplotChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Boxplot(this.model,this.services),new e.ZeroLine(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class Ee extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.bubbleChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Ruler(this.model,this.services),new e.Bubble(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID})];return this.getAxisChartComponents(t)}}class Le extends m{constructor(t,o){super(t,o),this.model=new l.BulletChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.bulletChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Bullet(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID})];return this.getAxisChartComponents(t)}}class Ae extends C{constructor(t,o){super(t,o),this.model=new l.ChoroplethModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.choroplethChart,o.options)),this.init(t,o)}getChartComponents(t,o){const a=this.model.getOptions(),i=n.getProperty(a,"toolbar","enabled"),h=!!this.model.getOptions().title,c={id:"title",components:[new e.Title(this.model,this.services)],growth:s.LayoutGrowth.STRETCH},g={id:"toolbar",components:[new e.Toolbar(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},v={id:"header",components:[new e.LayoutComponent(this.model,this.services,[c,...i?[g]:[]],{direction:s.LayoutDirection.ROW,alignItems:s.LayoutAlignItems.CENTER})],growth:s.LayoutGrowth.PREFERRED},y={id:"legend",components:[new e.ColorScaleLegend(this.model,this.services,{chartType:"choropleth"})],growth:s.LayoutGrowth.PREFERRED,renderType:s.RenderTypes.SVG},L={id:"graph-frame",components:t,growth:s.LayoutGrowth.STRETCH,renderType:s.RenderTypes.SVG},S=n.getProperty(o,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,E=s.LayoutDirection.COLUMN_REVERSE,w={id:"spacer",components:[new e.Spacer(this.model,this.services,{size:15})],growth:s.LayoutGrowth.PREFERRED},A={id:"full-frame",components:[new e.LayoutComponent(this.model,this.services,[...S?[y]:[],...S?[w]:[],L],{direction:E})],growth:s.LayoutGrowth.STRETCH},d=[];if(h||i){d.push(v);const u={id:"spacer",components:[new e.Spacer(this.model,this.services,i?{size:15}:void 0)],growth:s.LayoutGrowth.PREFERRED};d.push(u)}return d.push(A),[new e.Tooltip(this.model,this.services),new e.Modal(this.model,this.services),new e.LayoutComponent(this.model,this.services,d,{direction:s.LayoutDirection.COLUMN})]}getComponents(){const t=[new e.Choropleth(this.model,this.services)];return this.getChartComponents(t)}}class De extends C{constructor(t,o){super(t,o),this.model=new l.CirclePackChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.circlePackChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.CirclePack(this.model,this.services)];return this.getChartComponents(t)}}const f={[s.ChartTypes.LINE]:[e.Line,e.Scatter],[s.ChartTypes.SCATTER]:[e.Scatter],[s.ChartTypes.AREA]:[e.Area,e.Line,e.Scatter],[s.ChartTypes.STACKED_AREA]:[e.StackedArea,e.Line,e.StackedScatter,e.StackedRuler],[s.ChartTypes.SIMPLE_BAR]:[e.SimpleBar],[s.ChartTypes.GROUPED_BAR]:[e.GroupedBar,e.ZeroLine],[s.ChartTypes.STACKED_BAR]:[e.StackedBar,e.StackedRuler]};class Oe extends m{constructor(t,o){super(t,o);const a=n.mergeDefaultChartOptions(n.options.comboChart,o.options);o.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),a.comboChartTypes=[{type:s.ChartTypes.LINE,correspondingDatasets:[]}]),this.model.setOptions(a),this.init(t,o)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let o=0;const a=t.map(i=>{const h=i.type;let c;if(typeof i.type=="string"){if(!Object.keys(f).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let g=!1;const v=`${Te(i.type)}Chart`;return c=n.merge({},n.options[v],this.model.getOptions(),i.options),i.type===s.ChartTypes.STACKED_AREA&&(g=!0),f[i.type].map(y=>new y(this.model,this.services,{groups:i.correspondingDatasets,id:o++,options:c,stacked:g}))}else return c=n.merge({},this.model.getOptions(),i.options),new h(this.model,this.services,{groups:i.correspondingDatasets,id:o++,options:c})}).filter(i=>i!==null);return p.flatten(a)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),o=t.some(h=>h.type===s.ChartTypes.STACKED_BAR||h.type===s.ChartTypes.STACKED_AREA),a=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID}),...o?[]:[new e.Ruler(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(a)}}class H extends C{constructor(t,o,a=!1){super(t,o),this.model=new l.PieChartModel(this.services),!a&&(this.model.setOptions(n.mergeDefaultChartOptions(n.options.pieChart,o.options)),this.init(t,o))}getComponents(){const t=[new e.Pie(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.PIE})];return this.getChartComponents(t)}}class be extends H{constructor(t,o){super(t,o,!0),this.model.setOptions(n.mergeDefaultChartOptions(n.options.donutChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.Donut(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.DONUT})];return this.getChartComponents(t)}}class xe extends C{constructor(t,o){super(t,o),this.model=new l.GaugeChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.gaugeChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.Gauge(this.model,this.services)];return this.getChartComponents(t)}}class fe extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.groupedBarChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.GroupedBar(this.model,this.services),new e.ZeroLine(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class ke extends m{constructor(t,o){super(t,o),this.model=new l.HeatmapModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.heatmapChart,o.options)),this.init(t,o)}getAxisChartComponents(t,o){const a=this.model.getOptions(),i=n.getProperty(a,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const h=!!this.model.getOptions().title,c={id:"title",components:[new e.Title(this.model,this.services)],growth:s.LayoutGrowth.STRETCH},g={id:"toolbar",components:[new e.Toolbar(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},v={id:"header",components:[new e.LayoutComponent(this.model,this.services,[c,...i?[g]:[]],{direction:s.LayoutDirection.ROW,alignItems:s.LayoutAlignItems.CENTER})],growth:s.LayoutGrowth.PREFERRED},y={id:"legend",components:[new e.ColorScaleLegend(this.model,this.services,{chartType:"heatmap"})],growth:s.LayoutGrowth.PREFERRED,renderType:s.RenderTypes.SVG},L={id:"graph-frame",components:t,growth:s.LayoutGrowth.STRETCH,renderType:s.RenderTypes.SVG},S=n.getProperty(o,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,E=s.LayoutDirection.COLUMN_REVERSE,w={id:"spacer",components:[new e.Spacer(this.model,this.services,{size:15})],growth:s.LayoutGrowth.PREFERRED},A={id:"full-frame",components:[new e.LayoutComponent(this.model,this.services,[...S?[y]:[],...S?[w]:[],L],{direction:E})],growth:s.LayoutGrowth.STRETCH},d=[];if(h||i){d.push(v);const u={id:"spacer",components:[new e.Spacer(this.model,this.services,i?{size:15}:void 0)],growth:s.LayoutGrowth.PREFERRED};d.push(u)}return d.push(A),[new e.AxisChartsTooltip(this.model,this.services),new e.Modal(this.model,this.services),new e.LayoutComponent(this.model,this.services,d,{direction:s.LayoutDirection.COLUMN})]}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Heatmap(this.model,this.services)];return this.getAxisChartComponents(t)}}class Me extends m{constructor(t,o){super(t,o),this.model=new l.ChartModelBinned(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.histogramChart,o.options)),this.init(t,o),this.update()}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.BinnedRuler(this.model,this.services),new e.Histogram(this.model,this.services)];return this.getAxisChartComponents(t)}}class Pe extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.lineChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Ruler(this.model,this.services),new e.Line(this.model,this.services),new e.Scatter(this.model,this.services,{handleThresholds:!0}),new e.SkeletonLines(this.model,this.services),new e.ZeroLine(this.model,this.services)];return this.getAxisChartComponents(t)}}class Ge extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.lollipopChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Ruler(this.model,this.services),new e.Lollipop(this.model,this.services),new e.Scatter(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID})];return this.getAxisChartComponents(t)}}class Be extends C{constructor(t,o){var i;super(t,o),this.model=new l.MeterChartModel(this.services);const a=(i=o.options.meter)!=null&&i.proportional?n.merge(n.clone(n.options.proportionalMeterChart),o.options):n.merge(n.clone(n.options.meterChart),o.options);this.model.setOptions(a),this.init(t,o)}getComponents(){const o=[...n.getProperty(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new e.MeterTitle(this.model,this.services)],growth:s.LayoutGrowth.STRETCH,renderType:s.RenderTypes.SVG},{id:"spacer",components:[new e.Spacer(this.model,this.services,{size:8})],growth:s.LayoutGrowth.STRETCH}]:[],{id:"meter-graph",components:[new e.Meter(this.model,this.services)],growth:s.LayoutGrowth.STRETCH,renderType:s.RenderTypes.SVG}],a=[new e.LayoutComponent(this.model,this.services,o,{direction:s.LayoutDirection.COLUMN})];return this.getChartComponents(a,{graphFrameRenderType:s.RenderTypes.HTML})}}class Fe extends C{constructor(t,o){super(t,o),this.model=new l.RadarChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.radarChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.Radar(this.model,this.services)];return this.getChartComponents(t)}}class Ie extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.scatterChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Ruler(this.model,this.services),new e.Scatter(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID})];return this.getAxisChartComponents(t)}}class He extends C{constructor(t,o){super(t,o),this.model=new l.TreeChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.treeChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.Tree(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class Ze extends C{constructor(t,o){super(t,o),this.model=new l.TreemapChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.treemapChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.Treemap(this.model,this.services)];return this.getChartComponents(t)}}class Ue extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.simpleBarChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.SimpleBar(this.model,this.services),new e.ZeroLine(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class Ve extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.stackedAreaChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.StackedRuler(this.model,this.services),new e.StackedArea(this.model,this.services),new e.Line(this.model,this.services,{stacked:!0}),new e.StackedScatter(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID})];return this.getAxisChartComponents(t)}}class _e extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.stackedBarChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.StackedRuler(this.model,this.services),new e.StackedBar(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.VERT_OR_HORIZ}),new e.ZeroLine(this.model,this.services)];return this.getAxisChartComponents(t)}}class Ne extends C{constructor(t,o){super(t,o),this.model=new l.WordCloudModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.wordCloudChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.WordCloud(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.PIE})];return this.getChartComponents(t)}}exports.TIME_INTERVALS=n.TIME_INTERVALS;exports.alluvial=n.alluvial;exports.area=n.area;exports.axis=n.axis;exports.baseTooltip=n.baseTooltip;exports.boxplot=n.boxplot;exports.canvasZoomSettings=n.canvasZoomSettings;exports.carbonPrefix=n.carbonPrefix;exports.circlePack=n.circlePack;exports.color=n.color;exports.computeTimeIntervalName=n.computeTimeIntervalName;exports.configurations=n.configuration;exports.defaultLegendAdditionalItems=n.defaultLegendAdditionalItems;exports.formatDateTillMilliSeconds=n.formatDateTillMilliSeconds;exports.formatTick=n.formatTick;exports.getColorScale=n.getColorScale;exports.getDomain=n.getDomain;exports.getTimeformats=n.getTimeformats;exports.grid=n.grid;exports.histogram=n.histogram;exports.isTickPrimary=n.isTickPrimary;exports.legend=n.legend;exports.lines=n.lines;exports.meter=n.meter;exports.options=n.options;exports.pie=n.pie;exports.radar=n.radar;exports.ruler=n.ruler;exports.spacers=n.spacers;exports.timeScale=n.timeScale;exports.toolbar=n.toolbar;exports.tooltips=n.tooltips;exports.transitions=n.transitions;exports.zoomBar=n.zoomBar;exports.interfaces=_.index;exports.AlluvialChartModel=l.AlluvialChartModel;exports.BoxplotChartModel=l.BoxplotChartModel;exports.BulletChartModel=l.BulletChartModel;exports.ChartModel=l.ChartModel;exports.ChartModelBinned=l.ChartModelBinned;exports.ChartModelCartesian=l.ChartModelCartesian;exports.ChoroplethModel=l.ChoroplethModel;exports.CirclePackChartModel=l.CirclePackChartModel;exports.GaugeChartModel=l.GaugeChartModel;exports.HeatmapModel=l.HeatmapModel;exports.MeterChartModel=l.MeterChartModel;exports.PieChartModel=l.PieChartModel;exports.RadarChartModel=l.RadarChartModel;exports.TreeChartModel=l.TreeChartModel;exports.TreemapChartModel=l.TreemapChartModel;exports.WordCloudModel=l.WordCloudModel;exports.Alignments=s.Alignments;exports.AreaEvent=s.Area;exports.ArrowDirections=s.ArrowDirections;exports.AxisEvent=s.Axis;exports.AxisFlavor=s.AxisFlavor;exports.AxisPositions=s.AxisPositions;exports.AxisTitleOrientations=s.AxisTitleOrientations;exports.BarEvent=s.Bar;exports.BoxplotEvent=s.Boxplot;exports.CalloutDirections=s.CalloutDirections;exports.CanvasZoomEvent=s.CanvasZoom;exports.CartesianOrientations=s.CartesianOrientations;exports.ChartEvent=s.Chart;exports.ChartTheme=s.ChartTheme;exports.ChartTypes=s.ChartTypes;exports.ColorClassNameTypes=s.ColorClassNameTypes;exports.ColorLegendType=s.ColorLegendType;exports.DividerStatus=s.DividerStatus;exports.DominantBaseline=s.DominantBaseline;exports.GaugeEvent=s.Gauge;exports.GaugeTypes=s.GaugeTypes;exports.LayoutAlignItems=s.LayoutAlignItems;exports.LayoutDirection=s.LayoutDirection;exports.LayoutGrowth=s.LayoutGrowth;exports.LegendItemType=s.LegendItemType;exports.LegendOrientations=s.LegendOrientations;exports.LegendPositions=s.LegendPositions;exports.LineEvent=s.Line;exports.ModalEvent=s.Modal;exports.ModelEvent=s.Model;exports.PieEvent=s.Pie;exports.Projection=s.Projection;exports.RadarEvent=s.Radar;exports.RenderTypes=s.RenderTypes;exports.ScaleTypes=s.ScaleTypes;exports.ScatterEvent=s.Scatter;exports.Skeletons=s.Skeletons;exports.Statuses=s.Statuses;exports.TextAnchor=s.TextAnchor;exports.ThresholdEvent=s.Threshold;exports.TickRotations=s.TickRotations;exports.ToolbarControlTypes=s.ToolbarControlTypes;exports.TooltipEvent=s.Tooltip;exports.TreeEvent=s.Tree;exports.TreeTypes=s.TreeTypes;exports.TreemapEvent=s.Treemap;exports.TruncationTypes=s.TruncationTypes;exports.WordCloudEvent=s.WordCloud;exports.ZoomBarTypes=s.ZoomBarTypes;exports.ZoomDomainEvent=s.ZoomDomain;exports.ZoombarEvent=s.ZoomBar;exports.Alluvial=e.Alluvial;exports.Area=e.Area;exports.Axis=e.Axis;exports.AxisChartsTooltip=e.AxisChartsTooltip;exports.Bar=e.Bar;exports.BinnedRuler=e.BinnedRuler;exports.Boxplot=e.Boxplot;exports.Bubble=e.Bubble;exports.Bullet=e.Bullet;exports.CanvasChartClip=e.CanvasChartClip;exports.ChartBrush=e.ChartBrush;exports.ChartClip=e.ChartClip;exports.Choropleth=e.Choropleth;exports.CirclePack=e.CirclePack;exports.ColorScaleLegend=e.ColorScaleLegend;exports.Component=e.Component;exports.Donut=e.Donut;exports.Gauge=e.Gauge;exports.GeoProjection=e.GeoProjection;exports.Grid=e.Grid;exports.GroupedBar=e.GroupedBar;exports.Heatmap=e.Heatmap;exports.Highlight=e.Highlight;exports.Histogram=e.Histogram;exports.HoverAxis=e.HoverAxis;exports.LayoutComponent=e.LayoutComponent;exports.Legend=e.Legend;exports.Line=e.Line;exports.Lollipop=e.Lollipop;exports.Meter=e.Meter;exports.MeterTitle=e.MeterTitle;exports.Modal=e.Modal;exports.Pie=e.Pie;exports.Radar=e.Radar;exports.Ruler=e.Ruler;exports.Scatter=e.Scatter;exports.SimpleBar=e.SimpleBar;exports.Skeleton=e.Skeleton;exports.SkeletonLines=e.SkeletonLines;exports.Spacer=e.Spacer;exports.StackedArea=e.StackedArea;exports.StackedBar=e.StackedBar;exports.StackedRuler=e.StackedRuler;exports.StackedScatter=e.StackedScatter;exports.Threshold=e.Threshold;exports.Title=e.Title;exports.Toolbar=e.Toolbar;exports.Tooltip=e.Tooltip;exports.Tree=e.Tree;exports.Treemap=e.Treemap;exports.TwoDimensionalAxes=e.TwoDimensionalAxes;exports.WordCloud=e.WordCloud;exports.ZeroLine=e.ZeroLine;exports.ZoomBar=e.ZoomBar;exports.arrowLeft=e.arrowLeft;exports.arrowRight=e.arrowRight;exports.buildBezierPathString=e.buildBezierPathString;exports.buildElbowPathString=e.buildElbowPathString;exports.buildStraightPathString=e.buildStraightPathString;exports.circle=e.circle;exports.diamond=e.diamond;exports.square=e.square;exports.tee=e.tee;exports.CanvasZoom=p.CanvasZoom;exports.CartesianScales=p.CartesianScales;exports.Curves=p.Curves;exports.Events=p.Events;exports.Files=p.Files;exports.Transitions=p.Transitions;exports.Zoom=p.Zoom;exports.DOMUtils=R.DOMUtils;exports.GradientUtils=R.GradientUtils;exports.Service=R.Service;exports.degToRad=R.degToRad;exports.distanceBetweenPointOnCircAndVerticalDiameter=R.distanceBetweenPointOnCircAndVerticalDiameter;exports.polarToCartesianCoords=R.polarToCartesianCoords;exports.radToDeg=R.radToDeg;exports.radialLabelPlacement=R.radialLabelPlacement;exports.AlluvialChart=Re;exports.AreaChart=ye;exports.AxisChart=m;exports.BoxplotChart=Se;exports.BubbleChart=Ee;exports.BulletChart=Le;exports.Chart=C;exports.CirclePackChart=De;exports.ComboChart=Oe;exports.DonutChart=be;exports.ExperimentalChoroplethChart=Ae;exports.GaugeChart=xe;exports.GroupedBarChart=fe;exports.HeatmapChart=ke;exports.HistogramChart=Me;exports.LineChart=Pe;exports.LollipopChart=Ge;exports.MeterChart=Be;exports.PieChart=H;exports.RadarChart=Fe;exports.ScatterChart=Ie;exports.SimpleBarChart=Ue;exports.StackedAreaChart=Ve;exports.StackedBarChart=_e;exports.TreeChart=He;exports.TreemapChart=Ze;exports.WordCloudChart=Ne;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./color-scale-utils-2cd523be.js"),_=require("./index-822564ed.js"),l=require("./model/index.js"),s=require("./enums-aa2efd99.js"),e=require("./choropleth-b1a3729f.js"),p=require("./index-eace9da9.js"),R=require("./angle-utils-ccc0d890.js");require("d3");require("./index-d865d500.js");require("./a11y-c7c9d087.js");require("./_baseEach-326db134.js");require("d3-sankey");require("d3-cloud");function N(r,t,o){var a=-1,i=r.length;t<0&&(t=-t>i?0:i+t),o=o>i?i:o,o<0&&(o+=i),i=t>o?0:o-t>>>0,t>>>=0;for(var h=Array(i);++a<i;)h[a]=r[a+t];return h}function W(r,t,o){var a=r.length;return o=o===void 0?a:o,!t&&o>=a?r:N(r,t,o)}var z="\\ud800-\\udfff",q="\\u0300-\\u036f",j="\\ufe20-\\ufe2f",$="\\u20d0-\\u20ff",K=q+j+$,J="\\ufe0e\\ufe0f",X="\\u200d",Q=RegExp("["+X+z+K+J+"]");function k(r){return Q.test(r)}function Y(r){return r.split("")}var M="\\ud800-\\udfff",ee="\\u0300-\\u036f",te="\\ufe20-\\ufe2f",oe="\\u20d0-\\u20ff",se=ee+te+oe,ne="\\ufe0e\\ufe0f",ie="["+M+"]",b="["+se+"]",x="\\ud83c[\\udffb-\\udfff]",re="(?:"+b+"|"+x+")",P="[^"+M+"]",G="(?:\\ud83c[\\udde6-\\uddff]){2}",B="[\\ud800-\\udbff][\\udc00-\\udfff]",ae="\\u200d",F=re+"?",I="["+ne+"]?",le="(?:"+ae+"(?:"+[P,G,B].join("|")+")"+I+F+")*",he=I+F+le,ce="(?:"+[P+b+"?",b,G,B,ie].join("|")+")",pe=RegExp(x+"(?="+x+")|"+ce+he,"g");function me(r){return r.match(pe)||[]}function de(r){return k(r)?me(r):Y(r)}function ue(r){return function(t){t=n.toString(t);var o=k(t)?de(t):void 0,a=o?o[0]:t.charAt(0),i=o?W(o,1).join(""):t.slice(1);return a[r]()+i}}var Ce=ue("toUpperCase");const ge=Ce;function ve(r){return ge(n.toString(r).toLowerCase())}var we=e.createCompounder(function(r,t,o){return t=t.toLowerCase(),r+(o?ve(t):t)});const Te=we;class C{constructor(t,o){this.components=[],this.services={canvasZoom:p.CanvasZoom,domUtils:R.DOMUtils,events:p.Events,files:p.Files,gradientUtils:R.GradientUtils,transitions:p.Transitions},this.model=new l.ChartModel(this.services)}init(t,o){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(a=>{const i=this.services[a];this.services[a]=new i(this.model,this.services)}),this.services.events.addEventListener(s.Events.Model.UPDATE,a=>{const i=!!n.getProperty(a,"detail","animate");this.update(i)}),this.model.setData(o.data),this.services.events.addEventListener(s.Events.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const o=this.services.transitions.getPendingTransitions(),a=Object.keys(o).map(i=>o[i].end().catch(c=>c));Promise.all(a).then(()=>this.services.events.dispatchEvent(s.Events.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,o){const a=this.model.getOptions(),i=n.getProperty(a,"toolbar","enabled"),h={id:"legend",components:[new e.Legend(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},c=n.getProperty(a,"canvasZoom","enabled");c&&c===!0&&t.push(new e.CanvasChartClip(this.model,this.services));const g=!!this.model.getOptions().title,v={id:"title",components:[new e.Title(this.model,this.services)],growth:s.LayoutGrowth.STRETCH},y={id:"toolbar",components:[new e.Toolbar(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},L={id:"header",components:[new e.LayoutComponent(this.model,this.services,[v,...i?[y]:[]],{direction:s.LayoutDirection.ROW,alignItems:s.LayoutAlignItems.CENTER})],growth:s.LayoutGrowth.PREFERRED},S={id:"graph-frame",components:t,growth:s.LayoutGrowth.STRETCH,renderType:n.getProperty(o,"graphFrameRenderType")||s.RenderTypes.SVG},E=n.getProperty(o,"excludeLegend")!==!0&&a.legend.enabled!==!1;let w=s.LayoutDirection.COLUMN;if(E){const T=n.getProperty(a,"legend","position");T==="left"?(w=s.LayoutDirection.ROW,a.legend.orientation||(a.legend.orientation=s.LegendOrientations.VERTICAL)):T==="right"?(w=s.LayoutDirection.ROW_REVERSE,a.legend.orientation||(a.legend.orientation=s.LegendOrientations.VERTICAL)):T==="bottom"&&(w=s.LayoutDirection.COLUMN_REVERSE)}const A={id:"spacer",components:[new e.Spacer(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},d={id:"full-frame",components:[new e.LayoutComponent(this.model,this.services,[...E?[h]:[],...E?[A]:[],S],{direction:w})],growth:s.LayoutGrowth.STRETCH},u=[];if(g||i){u.push(L);const T={id:"spacer",components:[new e.Spacer(this.model,this.services,i?{size:15}:void 0)],growth:s.LayoutGrowth.PREFERRED};u.push(T)}return u.push(d),[new e.Tooltip(this.model,this.services),new e.Modal(this.model,this.services),new e.LayoutComponent(this.model,this.services,u,{direction:s.LayoutDirection.COLUMN})]}}class m extends C{constructor(t,o){super(t,o),this.services=Object.assign(this.services,{cartesianScales:p.CartesianScales,curves:p.Curves,zoom:p.Zoom}),this.model=new l.ChartModelCartesian(this.services)}getAxisChartComponents(t,o){const a=this.model.getOptions(),i=n.getProperty(a,"zoomBar",s.AxisPositions.TOP,"enabled"),h=n.getProperty(a,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const c=this.services.cartesianScales.getMainXAxisPosition(),g=n.getProperty(a,"axes",c,"scaleType"),v=i&&c===s.AxisPositions.BOTTOM&&g===s.ScaleTypes.TIME,y=this.services.zoom.isZoomBarLocked(s.AxisPositions.TOP),L=!!this.model.getOptions().title,S={id:"title",components:[new e.Title(this.model,this.services)],growth:s.LayoutGrowth.STRETCH},E={id:"toolbar",components:[new e.Toolbar(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},w={id:"header",components:[new e.LayoutComponent(this.model,this.services,[S,...h?[E]:[]],{direction:s.LayoutDirection.ROW,alignItems:s.LayoutAlignItems.CENTER})],growth:s.LayoutGrowth.PREFERRED},A={id:"legend",components:[new e.Legend(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED};v&&!y&&t.push(new e.ChartClip(this.model,this.services),new e.ChartBrush(this.model,this.services)),t.push(new e.Threshold(this.model,this.services)),t.push(new e.Highlight(this.model,this.services));const d={id:"graph-frame",components:t,growth:s.LayoutGrowth.STRETCH,renderType:s.RenderTypes.SVG},u=n.getProperty(o,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let T=s.LayoutDirection.COLUMN;if(u){const O=n.getProperty(this.model.getOptions(),"legend","position");O===s.LegendPositions.LEFT?(T=s.LayoutDirection.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=s.LegendOrientations.VERTICAL)):O===s.LegendPositions.RIGHT?(T=s.LayoutDirection.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=s.LegendOrientations.VERTICAL)):O===s.LegendPositions.BOTTOM&&(T=s.LayoutDirection.COLUMN_REVERSE)}const Z={id:"spacer",components:[new e.Spacer(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},U={id:"full-frame",components:[new e.LayoutComponent(this.model,this.services,[...u?[A]:[],...u?[Z]:[],d],{direction:T})],growth:s.LayoutGrowth.STRETCH},V={id:"zoom-bar",components:[new e.ZoomBar(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED,renderType:s.RenderTypes.SVG},D=[];if(L||h){D.push(w);const O={id:"spacer",components:[new e.Spacer(this.model,this.services,h?{size:15}:void 0)],growth:s.LayoutGrowth.PREFERRED};D.push(O)}return v&&D.push(V),D.push(U),[new e.AxisChartsTooltip(this.model,this.services),new e.Modal(this.model,this.services),new e.LayoutComponent(this.model,this.services,D,{direction:s.LayoutDirection.COLUMN})]}}class Re extends C{constructor(t,o){super(t,o),this.model=new l.AlluvialChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.alluvialChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.Alluvial(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class ye extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.clone(n.options.areaChart),o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Ruler(this.model,this.services),new e.Line(this.model,this.services),new e.Area(this.model,this.services),new e.Scatter(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID})];return this.getAxisChartComponents(t)}}class Se extends m{constructor(t,o){super(t,o),this.model=new l.BoxplotChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.boxplotChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Boxplot(this.model,this.services),new e.ZeroLine(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class Ee extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.bubbleChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Ruler(this.model,this.services),new e.Bubble(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID})];return this.getAxisChartComponents(t)}}class Le extends m{constructor(t,o){super(t,o),this.model=new l.BulletChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.bulletChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Bullet(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID})];return this.getAxisChartComponents(t)}}class Ae extends C{constructor(t,o){super(t,o),this.model=new l.ChoroplethModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.choroplethChart,o.options)),this.init(t,o)}getChartComponents(t,o){const a=this.model.getOptions(),i=n.getProperty(a,"toolbar","enabled"),h=!!this.model.getOptions().title,c={id:"title",components:[new e.Title(this.model,this.services)],growth:s.LayoutGrowth.STRETCH},g={id:"toolbar",components:[new e.Toolbar(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},v={id:"header",components:[new e.LayoutComponent(this.model,this.services,[c,...i?[g]:[]],{direction:s.LayoutDirection.ROW,alignItems:s.LayoutAlignItems.CENTER})],growth:s.LayoutGrowth.PREFERRED},y={id:"legend",components:[new e.ColorScaleLegend(this.model,this.services,{chartType:"choropleth"})],growth:s.LayoutGrowth.PREFERRED,renderType:s.RenderTypes.SVG},L={id:"graph-frame",components:t,growth:s.LayoutGrowth.STRETCH,renderType:s.RenderTypes.SVG},S=n.getProperty(o,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,E=s.LayoutDirection.COLUMN_REVERSE,w={id:"spacer",components:[new e.Spacer(this.model,this.services,{size:15})],growth:s.LayoutGrowth.PREFERRED},A={id:"full-frame",components:[new e.LayoutComponent(this.model,this.services,[...S?[y]:[],...S?[w]:[],L],{direction:E})],growth:s.LayoutGrowth.STRETCH},d=[];if(h||i){d.push(v);const u={id:"spacer",components:[new e.Spacer(this.model,this.services,i?{size:15}:void 0)],growth:s.LayoutGrowth.PREFERRED};d.push(u)}return d.push(A),[new e.Tooltip(this.model,this.services),new e.Modal(this.model,this.services),new e.LayoutComponent(this.model,this.services,d,{direction:s.LayoutDirection.COLUMN})]}getComponents(){const t=[new e.Choropleth(this.model,this.services)];return this.getChartComponents(t)}}class De extends C{constructor(t,o){super(t,o),this.model=new l.CirclePackChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.circlePackChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.CirclePack(this.model,this.services)];return this.getChartComponents(t)}}const f={[s.ChartTypes.LINE]:[e.Line,e.Scatter],[s.ChartTypes.SCATTER]:[e.Scatter],[s.ChartTypes.AREA]:[e.Area,e.Line,e.Scatter],[s.ChartTypes.STACKED_AREA]:[e.StackedArea,e.Line,e.StackedScatter,e.StackedRuler],[s.ChartTypes.SIMPLE_BAR]:[e.SimpleBar],[s.ChartTypes.GROUPED_BAR]:[e.GroupedBar,e.ZeroLine],[s.ChartTypes.STACKED_BAR]:[e.StackedBar,e.StackedRuler]};class Oe extends m{constructor(t,o){super(t,o);const a=n.mergeDefaultChartOptions(n.options.comboChart,o.options);o.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),a.comboChartTypes=[{type:s.ChartTypes.LINE,correspondingDatasets:[]}]),this.model.setOptions(a),this.init(t,o)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let o=0;const a=t.map(i=>{const h=i.type;let c;if(typeof i.type=="string"){if(!Object.keys(f).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let g=!1;const v=`${Te(i.type)}Chart`;return c=n.merge({},n.options[v],this.model.getOptions(),i.options),i.type===s.ChartTypes.STACKED_AREA&&(g=!0),f[i.type].map(y=>new y(this.model,this.services,{groups:i.correspondingDatasets,id:o++,options:c,stacked:g}))}else return c=n.merge({},this.model.getOptions(),i.options),new h(this.model,this.services,{groups:i.correspondingDatasets,id:o++,options:c})}).filter(i=>i!==null);return p.flatten(a)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),o=t.some(h=>h.type===s.ChartTypes.STACKED_BAR||h.type===s.ChartTypes.STACKED_AREA),a=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID}),...o?[]:[new e.Ruler(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(a)}}class H extends C{constructor(t,o,a=!1){super(t,o),this.model=new l.PieChartModel(this.services),!a&&(this.model.setOptions(n.mergeDefaultChartOptions(n.options.pieChart,o.options)),this.init(t,o))}getComponents(){const t=[new e.Pie(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.PIE})];return this.getChartComponents(t)}}class be extends H{constructor(t,o){super(t,o,!0),this.model.setOptions(n.mergeDefaultChartOptions(n.options.donutChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.Donut(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.DONUT})];return this.getChartComponents(t)}}class xe extends C{constructor(t,o){super(t,o),this.model=new l.GaugeChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.gaugeChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.Gauge(this.model,this.services)];return this.getChartComponents(t)}}class fe extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.groupedBarChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.GroupedBar(this.model,this.services),new e.ZeroLine(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class ke extends m{constructor(t,o){super(t,o),this.model=new l.HeatmapModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.heatmapChart,o.options)),this.init(t,o)}getAxisChartComponents(t,o){const a=this.model.getOptions(),i=n.getProperty(a,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const h=!!this.model.getOptions().title,c={id:"title",components:[new e.Title(this.model,this.services)],growth:s.LayoutGrowth.STRETCH},g={id:"toolbar",components:[new e.Toolbar(this.model,this.services)],growth:s.LayoutGrowth.PREFERRED},v={id:"header",components:[new e.LayoutComponent(this.model,this.services,[c,...i?[g]:[]],{direction:s.LayoutDirection.ROW,alignItems:s.LayoutAlignItems.CENTER})],growth:s.LayoutGrowth.PREFERRED},y={id:"legend",components:[new e.ColorScaleLegend(this.model,this.services,{chartType:"heatmap"})],growth:s.LayoutGrowth.PREFERRED,renderType:s.RenderTypes.SVG},L={id:"graph-frame",components:t,growth:s.LayoutGrowth.STRETCH,renderType:s.RenderTypes.SVG},S=n.getProperty(o,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,E=s.LayoutDirection.COLUMN_REVERSE,w={id:"spacer",components:[new e.Spacer(this.model,this.services,{size:15})],growth:s.LayoutGrowth.PREFERRED},A={id:"full-frame",components:[new e.LayoutComponent(this.model,this.services,[...S?[y]:[],...S?[w]:[],L],{direction:E})],growth:s.LayoutGrowth.STRETCH},d=[];if(h||i){d.push(v);const u={id:"spacer",components:[new e.Spacer(this.model,this.services,i?{size:15}:void 0)],growth:s.LayoutGrowth.PREFERRED};d.push(u)}return d.push(A),[new e.AxisChartsTooltip(this.model,this.services),new e.Modal(this.model,this.services),new e.LayoutComponent(this.model,this.services,d,{direction:s.LayoutDirection.COLUMN})]}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Heatmap(this.model,this.services)];return this.getAxisChartComponents(t)}}class Me extends m{constructor(t,o){super(t,o),this.model=new l.ChartModelBinned(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.histogramChart,o.options)),this.init(t,o),this.update()}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.BinnedRuler(this.model,this.services),new e.Histogram(this.model,this.services)];return this.getAxisChartComponents(t)}}class Pe extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.lineChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Ruler(this.model,this.services),new e.Line(this.model,this.services),new e.Scatter(this.model,this.services,{handleThresholds:!0}),new e.SkeletonLines(this.model,this.services),new e.ZeroLine(this.model,this.services)];return this.getAxisChartComponents(t)}}class Ge extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.lollipopChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Ruler(this.model,this.services),new e.Lollipop(this.model,this.services),new e.Scatter(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID})];return this.getAxisChartComponents(t)}}class Be extends C{constructor(t,o){var i;super(t,o),this.model=new l.MeterChartModel(this.services);const a=(i=o.options.meter)!=null&&i.proportional?n.merge(n.clone(n.options.proportionalMeterChart),o.options):n.merge(n.clone(n.options.meterChart),o.options);this.model.setOptions(a),this.init(t,o)}getComponents(){const o=[...n.getProperty(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new e.MeterTitle(this.model,this.services)],growth:s.LayoutGrowth.STRETCH,renderType:s.RenderTypes.SVG},{id:"spacer",components:[new e.Spacer(this.model,this.services,{size:8})],growth:s.LayoutGrowth.STRETCH}]:[],{id:"meter-graph",components:[new e.Meter(this.model,this.services)],growth:s.LayoutGrowth.STRETCH,renderType:s.RenderTypes.SVG}],a=[new e.LayoutComponent(this.model,this.services,o,{direction:s.LayoutDirection.COLUMN})];return this.getChartComponents(a,{graphFrameRenderType:s.RenderTypes.HTML})}}class Fe extends C{constructor(t,o){super(t,o),this.model=new l.RadarChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.radarChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.Radar(this.model,this.services)];return this.getChartComponents(t)}}class Ie extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.scatterChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.Ruler(this.model,this.services),new e.Scatter(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID})];return this.getAxisChartComponents(t)}}class He extends C{constructor(t,o){super(t,o),this.model=new l.TreeChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.treeChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.Tree(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class Ze extends C{constructor(t,o){super(t,o),this.model=new l.TreemapChartModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.treemapChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.Treemap(this.model,this.services)];return this.getChartComponents(t)}}class Ue extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.simpleBarChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.SimpleBar(this.model,this.services),new e.ZeroLine(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class Ve extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.stackedAreaChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.StackedRuler(this.model,this.services),new e.StackedArea(this.model,this.services),new e.Line(this.model,this.services,{stacked:!0}),new e.StackedScatter(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.GRID})];return this.getAxisChartComponents(t)}}class _e extends m{constructor(t,o){super(t,o),this.model.setOptions(n.mergeDefaultChartOptions(n.options.stackedBarChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.TwoDimensionalAxes(this.model,this.services),new e.Grid(this.model,this.services),new e.StackedRuler(this.model,this.services),new e.StackedBar(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.VERT_OR_HORIZ}),new e.ZeroLine(this.model,this.services)];return this.getAxisChartComponents(t)}}class Ne extends C{constructor(t,o){super(t,o),this.model=new l.WordCloudModel(this.services),this.model.setOptions(n.mergeDefaultChartOptions(n.options.wordCloudChart,o.options)),this.init(t,o)}getComponents(){const t=[new e.WordCloud(this.model,this.services),new e.Skeleton(this.model,this.services,{skeleton:s.Skeletons.PIE})];return this.getChartComponents(t)}}exports.TIME_INTERVALS=n.TIME_INTERVALS;exports.alluvial=n.alluvial;exports.area=n.area;exports.axis=n.axis;exports.baseTooltip=n.baseTooltip;exports.boxplot=n.boxplot;exports.canvasZoomSettings=n.canvasZoomSettings;exports.carbonPrefix=n.carbonPrefix;exports.circlePack=n.circlePack;exports.color=n.color;exports.computeTimeIntervalName=n.computeTimeIntervalName;exports.configurations=n.configuration;exports.defaultLegendAdditionalItems=n.defaultLegendAdditionalItems;exports.formatDateTillMilliSeconds=n.formatDateTillMilliSeconds;exports.formatTick=n.formatTick;exports.getColorScale=n.getColorScale;exports.getDomain=n.getDomain;exports.getTimeformats=n.getTimeformats;exports.grid=n.grid;exports.histogram=n.histogram;exports.isTickPrimary=n.isTickPrimary;exports.legend=n.legend;exports.lines=n.lines;exports.meter=n.meter;exports.options=n.options;exports.pie=n.pie;exports.radar=n.radar;exports.ruler=n.ruler;exports.spacers=n.spacers;exports.timeScale=n.timeScale;exports.toolbar=n.toolbar;exports.tooltips=n.tooltips;exports.transitions=n.transitions;exports.zoomBar=n.zoomBar;exports.interfaces=_.index;exports.AlluvialChartModel=l.AlluvialChartModel;exports.BoxplotChartModel=l.BoxplotChartModel;exports.BulletChartModel=l.BulletChartModel;exports.ChartModel=l.ChartModel;exports.ChartModelBinned=l.ChartModelBinned;exports.ChartModelCartesian=l.ChartModelCartesian;exports.ChoroplethModel=l.ChoroplethModel;exports.CirclePackChartModel=l.CirclePackChartModel;exports.GaugeChartModel=l.GaugeChartModel;exports.HeatmapModel=l.HeatmapModel;exports.MeterChartModel=l.MeterChartModel;exports.PieChartModel=l.PieChartModel;exports.RadarChartModel=l.RadarChartModel;exports.TreeChartModel=l.TreeChartModel;exports.TreemapChartModel=l.TreemapChartModel;exports.WordCloudModel=l.WordCloudModel;exports.Alignments=s.Alignments;exports.AreaEvent=s.Area;exports.ArrowDirections=s.ArrowDirections;exports.AxisEvent=s.Axis;exports.AxisFlavor=s.AxisFlavor;exports.AxisPositions=s.AxisPositions;exports.AxisTitleOrientations=s.AxisTitleOrientations;exports.BarEvent=s.Bar;exports.BoxplotEvent=s.Boxplot;exports.CalloutDirections=s.CalloutDirections;exports.CanvasZoomEvent=s.CanvasZoom;exports.CartesianOrientations=s.CartesianOrientations;exports.ChartEvent=s.Chart;exports.ChartTheme=s.ChartTheme;exports.ChartTypes=s.ChartTypes;exports.ColorClassNameTypes=s.ColorClassNameTypes;exports.ColorLegendType=s.ColorLegendType;exports.DividerStatus=s.DividerStatus;exports.DominantBaseline=s.DominantBaseline;exports.GaugeEvent=s.Gauge;exports.GaugeTypes=s.GaugeTypes;exports.LayoutAlignItems=s.LayoutAlignItems;exports.LayoutDirection=s.LayoutDirection;exports.LayoutGrowth=s.LayoutGrowth;exports.LegendItemType=s.LegendItemType;exports.LegendOrientations=s.LegendOrientations;exports.LegendPositions=s.LegendPositions;exports.LineEvent=s.Line;exports.ModalEvent=s.Modal;exports.ModelEvent=s.Model;exports.PieEvent=s.Pie;exports.Projection=s.Projection;exports.RadarEvent=s.Radar;exports.RenderTypes=s.RenderTypes;exports.ScaleTypes=s.ScaleTypes;exports.ScatterEvent=s.Scatter;exports.Skeletons=s.Skeletons;exports.Statuses=s.Statuses;exports.TextAnchor=s.TextAnchor;exports.ThresholdEvent=s.Threshold;exports.TickRotations=s.TickRotations;exports.ToolbarControlTypes=s.ToolbarControlTypes;exports.TooltipEvent=s.Tooltip;exports.TreeEvent=s.Tree;exports.TreeTypes=s.TreeTypes;exports.TreemapEvent=s.Treemap;exports.TruncationTypes=s.TruncationTypes;exports.WordCloudEvent=s.WordCloud;exports.ZoomBarTypes=s.ZoomBarTypes;exports.ZoomDomainEvent=s.ZoomDomain;exports.ZoombarEvent=s.ZoomBar;exports.Alluvial=e.Alluvial;exports.Area=e.Area;exports.Axis=e.Axis;exports.AxisChartsTooltip=e.AxisChartsTooltip;exports.Bar=e.Bar;exports.BinnedRuler=e.BinnedRuler;exports.Boxplot=e.Boxplot;exports.Bubble=e.Bubble;exports.Bullet=e.Bullet;exports.CanvasChartClip=e.CanvasChartClip;exports.ChartBrush=e.ChartBrush;exports.ChartClip=e.ChartClip;exports.Choropleth=e.Choropleth;exports.CirclePack=e.CirclePack;exports.ColorScaleLegend=e.ColorScaleLegend;exports.Component=e.Component;exports.Donut=e.Donut;exports.Gauge=e.Gauge;exports.GeoProjection=e.GeoProjection;exports.Grid=e.Grid;exports.GroupedBar=e.GroupedBar;exports.Heatmap=e.Heatmap;exports.Highlight=e.Highlight;exports.Histogram=e.Histogram;exports.HoverAxis=e.HoverAxis;exports.LayoutComponent=e.LayoutComponent;exports.Legend=e.Legend;exports.Line=e.Line;exports.Lollipop=e.Lollipop;exports.Meter=e.Meter;exports.MeterTitle=e.MeterTitle;exports.Modal=e.Modal;exports.Pie=e.Pie;exports.Radar=e.Radar;exports.Ruler=e.Ruler;exports.Scatter=e.Scatter;exports.SimpleBar=e.SimpleBar;exports.Skeleton=e.Skeleton;exports.SkeletonLines=e.SkeletonLines;exports.Spacer=e.Spacer;exports.StackedArea=e.StackedArea;exports.StackedBar=e.StackedBar;exports.StackedRuler=e.StackedRuler;exports.StackedScatter=e.StackedScatter;exports.Threshold=e.Threshold;exports.Title=e.Title;exports.Toolbar=e.Toolbar;exports.Tooltip=e.Tooltip;exports.Tree=e.Tree;exports.Treemap=e.Treemap;exports.TwoDimensionalAxes=e.TwoDimensionalAxes;exports.WordCloud=e.WordCloud;exports.ZeroLine=e.ZeroLine;exports.ZoomBar=e.ZoomBar;exports.arrowLeft=e.arrowLeft;exports.arrowRight=e.arrowRight;exports.buildBezierPathString=e.buildBezierPathString;exports.buildElbowPathString=e.buildElbowPathString;exports.buildStraightPathString=e.buildStraightPathString;exports.circle=e.circle;exports.diamond=e.diamond;exports.square=e.square;exports.tee=e.tee;exports.CanvasZoom=p.CanvasZoom;exports.CartesianScales=p.CartesianScales;exports.Curves=p.Curves;exports.Events=p.Events;exports.Files=p.Files;exports.Transitions=p.Transitions;exports.Zoom=p.Zoom;exports.DOMUtils=R.DOMUtils;exports.GradientUtils=R.GradientUtils;exports.Service=R.Service;exports.degToRad=R.degToRad;exports.distanceBetweenPointOnCircAndVerticalDiameter=R.distanceBetweenPointOnCircAndVerticalDiameter;exports.polarToCartesianCoords=R.polarToCartesianCoords;exports.radToDeg=R.radToDeg;exports.radialLabelPlacement=R.radialLabelPlacement;exports.AlluvialChart=Re;exports.AreaChart=ye;exports.AxisChart=m;exports.BoxplotChart=Se;exports.BubbleChart=Ee;exports.BulletChart=Le;exports.Chart=C;exports.CirclePackChart=De;exports.ComboChart=Oe;exports.DonutChart=be;exports.ExperimentalChoroplethChart=Ae;exports.GaugeChart=xe;exports.GroupedBarChart=fe;exports.HeatmapChart=ke;exports.HistogramChart=Me;exports.LineChart=Pe;exports.LollipopChart=Ge;exports.MeterChart=Be;exports.PieChart=H;exports.RadarChart=Fe;exports.ScatterChart=Ie;exports.SimpleBarChart=Ue;exports.StackedAreaChart=Ve;exports.StackedBarChart=_e;exports.TreeChart=He;exports.TreemapChart=Ze;exports.WordCloudChart=Ne;
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.mjs CHANGED
@@ -1,18 +1,18 @@
1
- import { t as Y, g as l, m as a, o as r, f as J, h as V } from "./color-scale-utils-222feda6.mjs";
2
- import { T as It, l as Ht, n as Gt, p as Vt, q as Nt, s as Ut, u as Zt, d as _t, v as zt, w as Wt, M as jt, j as $t, x as Kt, N as Jt, O as qt, P as Xt, Q as Qt, R as Yt, y as eo, z as so, S as to, A as oo, B as no, C as io, D as ro, E as ao, F as ho, G as co, H as mo, K as lo, I as po, J as Co, L as uo } from "./color-scale-utils-222feda6.mjs";
1
+ import { t as Y, g as l, m as a, o as r, e as J, f as V } from "./color-scale-utils-b9604b2c.mjs";
2
+ import { T as It, j as Ht, l as Gt, n as Vt, p as Nt, q as Ut, s as Zt, d as _t, u as zt, v as Wt, L as jt, h as $t, w as Kt, M as Jt, N as qt, O as Xt, P as Qt, Q as Yt, x as eo, y as so, R as to, z as oo, A as no, B as io, C as ro, D as ao, E as ho, F as co, G as mo, J as lo, H as po, I as Co, K as uo } from "./color-scale-utils-b9604b2c.mjs";
3
3
  import { i as go } from "./index-ec554115.mjs";
4
- import { ChartModel as Re, ChartModelCartesian as Te, AlluvialChartModel as be, BoxplotChartModel as Oe, BulletChartModel as Se, ChoroplethModel as fe, CirclePackChartModel as Ae, PieChartModel as xe, GaugeChartModel as ye, HeatmapModel as De, ChartModelBinned as Fe, MeterChartModel as Le, RadarChartModel as Pe, TreeChartModel as Me, TreemapChartModel as ke, WordCloudModel as Be } from "./model/index.mjs";
4
+ import { ChartModel as Re, ChartModelCartesian as Te, AlluvialChartModel as be, BoxplotChartModel as Oe, BulletChartModel as fe, ChoroplethModel as Se, CirclePackChartModel as Ae, PieChartModel as xe, GaugeChartModel as ye, HeatmapModel as De, ChartModelBinned as Fe, MeterChartModel as Le, RadarChartModel as Pe, TreeChartModel as Me, TreemapChartModel as ke, WordCloudModel as Be } from "./model/index.mjs";
5
5
  import { _ as j, r as i, q as c, L as Z, y as A, t as N, e as $, S as Ie, u as K, F as p, l as R } from "./enums-a96ef472.mjs";
6
- import { A as Eo, a as Ro, b as To, c as bo, d as Oo, f as So, B as fo, g as Ao, C as xo, h as yo, i as Do, j as Fo, k as Lo, m as Po, n as Mo, D as ko, o as Bo, G as Io, p as Ho, s as Go, v as Vo, M as No, w as Uo, P as Zo, x as _o, R as zo, z as Wo, H as jo, T as $o, I as Ko, J as Jo, K as qo, N as Xo, O as Qo, Q as Yo, U as en, V as sn, W as tn, Z as on, X as nn, Y as rn } from "./enums-a96ef472.mjs";
7
- import { c as He, L as ee, C as Ge, T as _, a as z, b as g, S as F, d as se, M as W, e as Ve, f as Ne, g as Ue, H as Ze, Z as _e, A as te, h as ze, i as d, G as w, R as B, j as k, k as oe, l as M, m as C, B as We, n as I, o as je, p as $e, q as ne, r as Ke, s as Je, t as ie, u as re, v as U, w as ae, x as he, y as ce, P as qe, D as Xe, z as Qe, E as Ye, F as es, I as ss, J as ts, K as os, N as ns, O as is, Q as rs, U as as, V as hs, W as cs } from "./choropleth-449cf25e.mjs";
8
- import { X as hn, a8 as cn, a9 as mn, a7 as ln, Y as pn, _ as dn, $ as Cn, a0 as un, a1 as vn, a2 as gn, a3 as wn, a4 as En, a5 as Rn, a6 as Tn } from "./choropleth-449cf25e.mjs";
9
- import { C as ms, E as ls, F as ps, T as ds, a as Cs, b as us, Z as vs, f as gs } from "./index-e425a7b5.mjs";
10
- import { D as ws, G as Es } from "./angle-utils-7255d1d9.mjs";
11
- import { S as On, d as Sn, a as fn, p as An, b as xn, r as yn } from "./angle-utils-7255d1d9.mjs";
6
+ import { A as Eo, a as Ro, b as To, c as bo, d as Oo, f as fo, B as So, g as Ao, C as xo, h as yo, i as Do, j as Fo, k as Lo, m as Po, n as Mo, D as ko, o as Bo, G as Io, p as Ho, s as Go, v as Vo, M as No, w as Uo, P as Zo, x as _o, R as zo, z as Wo, H as jo, T as $o, I as Ko, J as Jo, K as qo, N as Xo, O as Qo, Q as Yo, U as en, V as sn, W as tn, Z as on, X as nn, Y as rn } from "./enums-a96ef472.mjs";
7
+ import { c as He, L as ee, C as Ge, T as _, a as z, b as g, S as F, d as se, M as W, e as Ve, f as Ne, g as Ue, H as Ze, Z as _e, A as te, h as ze, i as d, G as w, R as B, j as k, k as oe, l as M, m as C, B as We, n as I, o as je, p as $e, q as ne, r as Ke, s as Je, t as ie, u as re, v as U, w as ae, x as he, y as ce, P as qe, D as Xe, z as Qe, E as Ye, F as es, I as ss, J as ts, K as os, N as ns, O as is, Q as rs, U as as, V as hs, W as cs } from "./choropleth-141685a0.mjs";
8
+ import { X as hn, a8 as cn, a9 as mn, a7 as ln, Y as pn, _ as dn, $ as Cn, a0 as un, a1 as vn, a2 as gn, a3 as wn, a4 as En, a5 as Rn, a6 as Tn } from "./choropleth-141685a0.mjs";
9
+ import { C as ms, E as ls, F as ps, T as ds, a as Cs, b as us, Z as vs, f as gs } from "./index-4b5d1e49.mjs";
10
+ import { D as ws, G as Es } from "./angle-utils-264ed176.mjs";
11
+ import { S as On, d as fn, a as Sn, p as An, b as xn, r as yn } from "./angle-utils-264ed176.mjs";
12
12
  import "d3";
13
13
  import "./index-becfb567.mjs";
14
14
  import "./a11y-7bad4f48.mjs";
15
- import "./_baseEach-05847c57.mjs";
15
+ import "./_baseEach-9b6a12fa.mjs";
16
16
  import "d3-sankey";
17
17
  import "d3-cloud";
18
18
  function Rs(o, e, s) {
@@ -26,7 +26,7 @@ function Ts(o, e, s) {
26
26
  var n = o.length;
27
27
  return s = s === void 0 ? n : s, !e && s >= n ? o : Rs(o, e, s);
28
28
  }
29
- var bs = "\\ud800-\\udfff", Os = "\\u0300-\\u036f", Ss = "\\ufe20-\\ufe2f", fs = "\\u20d0-\\u20ff", As = Os + Ss + fs, xs = "\\ufe0e\\ufe0f", ys = "\\u200d", Ds = RegExp("[" + ys + bs + As + xs + "]");
29
+ var bs = "\\ud800-\\udfff", Os = "\\u0300-\\u036f", fs = "\\ufe20-\\ufe2f", Ss = "\\u20d0-\\u20ff", As = Os + fs + Ss, xs = "\\ufe0e\\ufe0f", ys = "\\u200d", Ds = RegExp("[" + ys + bs + As + xs + "]");
30
30
  function me(o) {
31
31
  return Ds.test(o);
32
32
  }
@@ -138,10 +138,10 @@ class T {
138
138
  growth: i.STRETCH,
139
139
  renderType: l(s, "graphFrameRenderType") || A.SVG
140
140
  }, D = l(s, "excludeLegend") !== !0 && n.legend.enabled !== !1;
141
- let S = c.COLUMN;
141
+ let f = c.COLUMN;
142
142
  if (D) {
143
- const f = l(n, "legend", "position");
144
- f === "left" ? (S = c.ROW, n.legend.orientation || (n.legend.orientation = N.VERTICAL)) : f === "right" ? (S = c.ROW_REVERSE, n.legend.orientation || (n.legend.orientation = N.VERTICAL)) : f === "bottom" && (S = c.COLUMN_REVERSE);
143
+ const S = l(n, "legend", "position");
144
+ S === "left" ? (f = c.ROW, n.legend.orientation || (n.legend.orientation = N.VERTICAL)) : S === "right" ? (f = c.ROW_REVERSE, n.legend.orientation || (n.legend.orientation = N.VERTICAL)) : S === "bottom" && (f = c.COLUMN_REVERSE);
145
145
  }
146
146
  const P = {
147
147
  id: "spacer",
@@ -159,7 +159,7 @@ class T {
159
159
  y
160
160
  ],
161
161
  {
162
- direction: S
162
+ direction: f
163
163
  }
164
164
  )
165
165
  ],
@@ -167,14 +167,14 @@ class T {
167
167
  }, E = [];
168
168
  if (b || t) {
169
169
  E.push(L);
170
- const f = {
170
+ const S = {
171
171
  id: "spacer",
172
172
  components: [
173
173
  new F(this.model, this.services, t ? { size: 15 } : void 0)
174
174
  ],
175
175
  growth: i.PREFERRED
176
176
  };
177
- E.push(f);
177
+ E.push(S);
178
178
  }
179
179
  return E.push(v), [
180
180
  new se(this.model, this.services),
@@ -204,7 +204,7 @@ class u extends T {
204
204
  id: "toolbar",
205
205
  components: [new z(this.model, this.services)],
206
206
  growth: i.PREFERRED
207
- }, S = {
207
+ }, f = {
208
208
  id: "header",
209
209
  components: [
210
210
  new g(
@@ -237,10 +237,10 @@ class u extends T {
237
237
  growth: i.STRETCH,
238
238
  renderType: A.SVG
239
239
  }, E = l(s, "legend", "enabled") !== !1 && this.model.getOptions().legend.enabled !== !1;
240
- let f = c.COLUMN;
240
+ let S = c.COLUMN;
241
241
  if (E) {
242
242
  const G = l(this.model.getOptions(), "legend", "position");
243
- G === K.LEFT ? (f = c.ROW, this.model.getOptions().legend.orientation || (this.model.getOptions().legend.orientation = N.VERTICAL)) : G === K.RIGHT ? (f = c.ROW_REVERSE, this.model.getOptions().legend.orientation || (this.model.getOptions().legend.orientation = N.VERTICAL)) : G === K.BOTTOM && (f = c.COLUMN_REVERSE);
243
+ G === K.LEFT ? (S = c.ROW, this.model.getOptions().legend.orientation || (this.model.getOptions().legend.orientation = N.VERTICAL)) : G === K.RIGHT ? (S = c.ROW_REVERSE, this.model.getOptions().legend.orientation || (this.model.getOptions().legend.orientation = N.VERTICAL)) : G === K.BOTTOM && (S = c.COLUMN_REVERSE);
244
244
  }
245
245
  const ge = {
246
246
  id: "spacer",
@@ -258,7 +258,7 @@ class u extends T {
258
258
  v
259
259
  ],
260
260
  {
261
- direction: f
261
+ direction: S
262
262
  }
263
263
  )
264
264
  ],
@@ -270,7 +270,7 @@ class u extends T {
270
270
  renderType: A.SVG
271
271
  }, H = [];
272
272
  if (L || h) {
273
- H.push(S);
273
+ H.push(f);
274
274
  const G = {
275
275
  id: "spacer",
276
276
  components: [
@@ -362,7 +362,7 @@ class dt extends u {
362
362
  }
363
363
  class Ct extends u {
364
364
  constructor(e, s) {
365
- super(e, s), this.model = new Se(this.services), this.model.setOptions(a(r.bulletChart, s.options)), this.init(e, s);
365
+ super(e, s), this.model = new fe(this.services), this.model.setOptions(a(r.bulletChart, s.options)), this.init(e, s);
366
366
  }
367
367
  getComponents() {
368
368
  const e = [
@@ -378,7 +378,7 @@ class Ct extends u {
378
378
  }
379
379
  class ut extends T {
380
380
  constructor(e, s) {
381
- super(e, s), this.model = new fe(this.services), this.model.setOptions(
381
+ super(e, s), this.model = new Se(this.services), this.model.setOptions(
382
382
  a(r.choroplethChart, s.options)
383
383
  ), this.init(e, s);
384
384
  }
@@ -425,7 +425,7 @@ class ut extends T {
425
425
  components: e,
426
426
  growth: i.STRETCH,
427
427
  renderType: A.SVG
428
- }, y = l(s, "legend", "enabled") !== !1 && this.model.getOptions().legend.enabled !== !1, D = c.COLUMN_REVERSE, S = {
428
+ }, y = l(s, "legend", "enabled") !== !1 && this.model.getOptions().legend.enabled !== !1, D = c.COLUMN_REVERSE, f = {
429
429
  id: "spacer",
430
430
  components: [new F(this.model, this.services, { size: 15 })],
431
431
  growth: i.PREFERRED
@@ -437,7 +437,7 @@ class ut extends T {
437
437
  this.services,
438
438
  [
439
439
  ...y ? [x] : [],
440
- ...y ? [S] : [],
440
+ ...y ? [f] : [],
441
441
  L
442
442
  ],
443
443
  {
@@ -649,7 +649,7 @@ class Tt extends u {
649
649
  components: e,
650
650
  growth: i.STRETCH,
651
651
  renderType: A.SVG
652
- }, y = l(s, "legend", "enabled") !== !1 && this.model.getOptions().legend.enabled !== !1, D = c.COLUMN_REVERSE, S = {
652
+ }, y = l(s, "legend", "enabled") !== !1 && this.model.getOptions().legend.enabled !== !1, D = c.COLUMN_REVERSE, f = {
653
653
  id: "spacer",
654
654
  components: [new F(this.model, this.services, { size: 15 })],
655
655
  growth: i.PREFERRED
@@ -661,7 +661,7 @@ class Tt extends u {
661
661
  this.services,
662
662
  [
663
663
  ...y ? [x] : [],
664
- ...y ? [S] : [],
664
+ ...y ? [f] : [],
665
665
  L
666
666
  ],
667
667
  {
@@ -729,7 +729,7 @@ class Ot extends u {
729
729
  return this.getAxisChartComponents(e);
730
730
  }
731
731
  }
732
- class St extends u {
732
+ class ft extends u {
733
733
  constructor(e, s) {
734
734
  super(e, s), this.model.setOptions(a(r.lollipopChart, s.options)), this.init(e, s);
735
735
  }
@@ -747,7 +747,7 @@ class St extends u {
747
747
  return this.getAxisChartComponents(e);
748
748
  }
749
749
  }
750
- class ft extends T {
750
+ class St extends T {
751
751
  constructor(e, s) {
752
752
  var t;
753
753
  super(e, s), this.model = new Le(this.services);
@@ -925,9 +925,9 @@ export {
925
925
  bo as AxisEvent,
926
926
  Oo as AxisFlavor,
927
927
  $ as AxisPositions,
928
- So as AxisTitleOrientations,
928
+ fo as AxisTitleOrientations,
929
929
  cn as Bar,
930
- fo as BarEvent,
930
+ So as BarEvent,
931
931
  es as BinnedRuler,
932
932
  We as Boxplot,
933
933
  pt as BoxplotChart,
@@ -937,7 +937,7 @@ export {
937
937
  dt as BubbleChart,
938
938
  $e as Bullet,
939
939
  Ct as BulletChart,
940
- Se as BulletChartModel,
940
+ fe as BulletChartModel,
941
941
  xo as CalloutDirections,
942
942
  Ge as CanvasChartClip,
943
943
  ms as CanvasZoom,
@@ -954,7 +954,7 @@ export {
954
954
  Lo as ChartTheme,
955
955
  R as ChartTypes,
956
956
  Ke as Choropleth,
957
- fe as ChoroplethModel,
957
+ Se as ChoroplethModel,
958
958
  Je as CirclePack,
959
959
  vt as CirclePackChart,
960
960
  Ae as CirclePackChartModel,
@@ -1001,9 +1001,9 @@ export {
1001
1001
  Ot as LineChart,
1002
1002
  Vo as LineEvent,
1003
1003
  os as Lollipop,
1004
- St as LollipopChart,
1004
+ ft as LollipopChart,
1005
1005
  is as Meter,
1006
- ft as MeterChart,
1006
+ St as MeterChart,
1007
1007
  Le as MeterChartModel,
1008
1008
  ns as MeterTitle,
1009
1009
  W as Modal,
@@ -1088,9 +1088,9 @@ export {
1088
1088
  jt as computeTimeIntervalName,
1089
1089
  $t as configurations,
1090
1090
  Kt as defaultLegendAdditionalItems,
1091
- Sn as degToRad,
1091
+ fn as degToRad,
1092
1092
  En as diamond,
1093
- fn as distanceBetweenPointOnCircAndVerticalDiameter,
1093
+ Sn as distanceBetweenPointOnCircAndVerticalDiameter,
1094
1094
  Jt as formatDateTillMilliSeconds,
1095
1095
  qt as formatTick,
1096
1096
  Xt as getColorScale,
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../color-scale-utils-79786095.js"),y=require("d3"),D=require("../enums-aa2efd99.js"),b=require("../_baseEach-477c04db.js");require("../index-d865d500.js");function A(g,t,e,s){for(var a=-1,r=g==null?0:g.length;++a<r;){var o=g[a];t(s,o,e(o),g)}return s}function O(g,t,e,s){return b.baseEach(g,function(a,r,o){t(s,a,e(a),o)}),s}function G(g,t){return function(e,s){var a=n.isArray(e)?A:O,r=t?t():{};return a(e,g,n.baseIteratee(s),r)}}function M(g){for(var t=-1,e=g==null?0:g.length,s={};++t<e;){var a=g[t];s[a[0]]=a[1]}return s}var E=Object.prototype,q=E.hasOwnProperty,I=G(function(g,t,e){q.call(g,e)?g[e].push(t):n.baseAssignValue(g,e,[t])});const _=I;class m{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}getAllDataFromDomain(t){if(!this.getData())return null;const e=this.getOptions();let s=this.getData();const a=this.getDataGroups(),{groupMapsTo:r}=n.getProperty(e,"data"),o=n.getProperty(e,"axes");return t&&(s=s.filter(i=>t.includes(i[r]))),o&&Object.keys(o).forEach(i=>{const l=o[i].mapsTo,c=o[i].scaleType;if((c===D.ScaleTypes.LINEAR||c===D.ScaleTypes.LOG)&&(s=s.map(p=>({...p,[l]:p[l]===null?p[l]:Number(p[l])}))),l&&o[i].domain)if(c===D.ScaleTypes.LABELS)s=s.filter(p=>o[i].domain.includes(p[l]));else{const[p,u]=o[i].domain;s=s.filter(h=>!(l in h)||h[l]>=p&&h[l]<=u)}}),s.filter(i=>a.find(l=>l.name===i[r]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:e}=n.legend.items.status,s=this.getDataGroups(t),{groupMapsTo:a}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(o=>s.find(i=>i.name===o[a]&&i.status===e))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const e=this.sanitize(n.clone(t)),s=this.generateDataGroups(e);return this.set({data:e,dataGroups:s}),e}getDataGroups(t){return n.getProperty(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(s=>t.includes(s.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:e}=n.legend.items.status;return this.getDataGroups(t).filter(s=>s.status===e)}getDataGroupNames(t){return this.getDataGroups(t).map(s=>s.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(s=>s.name)}aggregateBinDataByGroup(t){return _(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),e=this.getOptions(),s=this.services.cartesianScales.getMainXAxisPosition(),a=this.services.cartesianScales.getDomainIdentifier(),r=e.axes[s],{groupMapsTo:o}=e.data,{bins:i=n.histogram.defaultBins}=r,l=Array.isArray(i),c=y.bin().value(d=>d[a]).thresholds(i)(t);if(l)c[c.length-1].x1=i[i.length-1];else{const d=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+d}const p=l?[i[0],i[i.length-1]]:[c[0].x0,c[c.length-1].x1],u=Array.from(new Set(t.map(d=>d[o]))),h=[];return c.forEach(d=>{const f=`${d.x0}-${d.x1}`,C=this.aggregateBinDataByGroup(d);u.forEach(P=>{h.push({group:P,key:f,value:C[P]||0,bin:d.x0})})}),{bins:c,binsDomain:p}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:e}=t.data,s=this.getActiveDataGroupNames(),{bins:a}=this.getBinConfigurations(),r=this.getDataValuesGroupedByKeys({bins:a});return y.stack().keys(s)(r).map((o,i)=>Object.keys(o).filter(l=>!isNaN(l)).map(l=>{const c=o[l];return c[e]=s[i],c}))}getGroupedData(t){const e=this.getDisplayData(t),s={},{groupMapsTo:a}=this.getOptions().data;return e.map(r=>{const o=r[a];s[o]!==null&&s[o]!==void 0?s[o].push(r):s[o]=[r]}),Object.keys(s).map(r=>({name:r,data:s[r]}))}getStackKeys({bins:t=null,groups:e=null}={bins:null,groups:null}){const s=this.getOptions(),a=this.getDisplayData(e);let r;t?r=t.map(l=>`${l.x0}-${l.x1}`):r=n.removeArrayDuplicates(a.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?n.formatDateTillMilliSeconds(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const o=this.services.cartesianScales.domainAxisPosition,i=s.axes[o].scaleType;return i===D.ScaleTypes.TIME?r.sort((l,c)=>{const p=new Date(l),u=new Date(c);return p-u}):(i===D.ScaleTypes.LOG||i===D.ScaleTypes.LINEAR)&&r.sort((l,c)=>l-c),r}getDataValuesGroupedByKeys({bins:t=null,groups:e=null}){const s=this.getOptions(),{groupMapsTo:a}=s.data,r=this.getDisplayData(e),o=this.getDataGroupNames(),i=this.getStackKeys({bins:t,groups:e});return t?i.map(l=>{const[c,p]=l.split("-"),u={x0:c,x1:p},h=t.find(d=>d.x0.toString()===c.toString());return o.forEach(d=>{u[d]=h.filter(f=>f[a]===d).length}),u}):i.map(l=>{const c={sharedStackKey:l};return o.forEach(p=>{const u=r.find(d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return d[a]===p&&Object.prototype.hasOwnProperty.call(d,f)&&(d[f]instanceof Date?n.formatDateTillMilliSeconds(d[f])===l:d[f].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[p]=u?u[h]:null}),c})}getStackedData({percentage:t=!1,groups:e=null,divergent:s=!1}){const a=this.getOptions(),{groupMapsTo:r}=a.data,o=this.getActiveDataGroupNames(e),i=this.getDataValuesGroupedByKeys({groups:e});if(t){const c=M(i.map(p=>[p.sharedStackKey,0]));i.forEach(p=>{o.forEach(u=>{c[p.sharedStackKey]+=p[u]})}),i.forEach(p=>{o.forEach(u=>{const h=c[p.sharedStackKey];c[p.sharedStackKey]?p[u]=p[u]/h*100:p[u]=0})})}return(s?y.stack().offset(y.stackOffsetDiverging):y.stack()).keys(o)(i).map((c,p)=>Object.keys(c).filter(u=>!isNaN(u)).map(u=>{const h=c[u];return h[r]=o[p],h}))}getOptions(){return this.state.options}set(t,e){this.state=Object.assign({},this.state,t);const s=Object.assign({skipUpdate:!1,animate:!0},e);s.skipUpdate||this.update(s.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const e=this.getOptions();n.updateLegendAdditionalItems(e,t),this.set({options:n.merge(e,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(D.Events.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:e,DISABLED:s}=n.legend.items.status,a=this.getDataGroups(),r=a.some(p=>p.status===s),o=a.filter(p=>p.status===e);if(r)if(o.length===1&&o[0].name===t)a.forEach((p,u)=>{a[u].status=e});else{const p=a.findIndex(u=>u.name===t);a[p].status=a[p].status===s?e:s}else a.forEach((p,u)=>{a[u].status=p.name===t?e:s});const i=a.filter(p=>p.status===e),l=this.getOptions();a.some(p=>p.status===s)?l.data.selectedGroups=i.map(p=>p.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(D.Events.Legend.ITEMS_UPDATE,{dataGroups:a}),this.set({dataGroups:a})}getIsFilled(t,e,s,a){const r=this.getOptions();return r.getIsFilled?r.getIsFilled(t,e,s,a):a}getFillColor(t,e,s){const a=this.getOptions(),r=n.getProperty(this.colorScale,t);return a.getFillColor?a.getFillColor(t,e,s,r):r}getStrokeColor(t,e,s){const a=this.getOptions(),r=n.getProperty(this.colorScale,t);return a.getStrokeColor?a.getStrokeColor(t,e,s,r):r}isUserProvidedColorScaleValid(){const t=n.getProperty(this.getOptions(),"color","scale"),e=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:e.some(s=>Object.keys(t).includes(s.name))}getColorClassName(t){const e=this.colorClassNames(t.dataGroupName);let s=t.originalClassName;return t.classNameTypes.forEach(a=>s=t.originalClassName?`${s} ${a}-${e}`:`${a}-${e}`),s||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format");const e=[],{datasets:s,labels:a}=t;return s.forEach(r=>{r.data.forEach((o,i)=>{let l;const c=n.getProperty(r,"label");if(c===null){const u=n.getProperty(a,i);u?l=u:l="Ungrouped"}else l=c;const p={group:l,key:a[i]};isNaN(o)?(p.value=o.value,p.date=o.date):p.value=o,e.push(p)})}),e}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(a=>a.map(r=>`"${r==="&ndash;"?"–":r}"`));let e="",s="";t.forEach(function(a,r){s=a.join(","),e+=r<t.length?s+`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../color-scale-utils-2cd523be.js"),y=require("d3"),D=require("../enums-aa2efd99.js"),b=require("../_baseEach-326db134.js");require("../index-d865d500.js");function A(g,t,e,s){for(var a=-1,r=g==null?0:g.length;++a<r;){var o=g[a];t(s,o,e(o),g)}return s}function O(g,t,e,s){return b.baseEach(g,function(a,r,o){t(s,a,e(a),o)}),s}function G(g,t){return function(e,s){var a=n.isArray(e)?A:O,r=t?t():{};return a(e,g,n.baseIteratee(s),r)}}function M(g){for(var t=-1,e=g==null?0:g.length,s={};++t<e;){var a=g[t];s[a[0]]=a[1]}return s}var E=Object.prototype,q=E.hasOwnProperty,I=G(function(g,t,e){q.call(g,e)?g[e].push(t):n.baseAssignValue(g,e,[t])});const _=I;class m{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}getAllDataFromDomain(t){if(!this.getData())return null;const e=this.getOptions();let s=this.getData();const a=this.getDataGroups(),{groupMapsTo:r}=n.getProperty(e,"data"),o=n.getProperty(e,"axes");return t&&(s=s.filter(i=>t.includes(i[r]))),o&&Object.keys(o).forEach(i=>{const l=o[i].mapsTo,c=o[i].scaleType;if((c===D.ScaleTypes.LINEAR||c===D.ScaleTypes.LOG)&&(s=s.map(p=>({...p,[l]:p[l]===null?p[l]:Number(p[l])}))),l&&o[i].domain)if(c===D.ScaleTypes.LABELS)s=s.filter(p=>o[i].domain.includes(p[l]));else{const[p,u]=o[i].domain;s=s.filter(h=>!(l in h)||h[l]>=p&&h[l]<=u)}}),s.filter(i=>a.find(l=>l.name===i[r]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:e}=n.legend.items.status,s=this.getDataGroups(t),{groupMapsTo:a}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(o=>s.find(i=>i.name===o[a]&&i.status===e))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const e=this.sanitize(n.clone(t)),s=this.generateDataGroups(e);return this.set({data:e,dataGroups:s}),e}getDataGroups(t){return n.getProperty(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(s=>t.includes(s.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:e}=n.legend.items.status;return this.getDataGroups(t).filter(s=>s.status===e)}getDataGroupNames(t){return this.getDataGroups(t).map(s=>s.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(s=>s.name)}aggregateBinDataByGroup(t){return _(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),e=this.getOptions(),s=this.services.cartesianScales.getMainXAxisPosition(),a=this.services.cartesianScales.getDomainIdentifier(),r=e.axes[s],{groupMapsTo:o}=e.data,{bins:i=n.histogram.defaultBins}=r,l=Array.isArray(i),c=y.bin().value(d=>d[a]).thresholds(i)(t);if(l)c[c.length-1].x1=i[i.length-1];else{const d=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+d}const p=l?[i[0],i[i.length-1]]:[c[0].x0,c[c.length-1].x1],u=Array.from(new Set(t.map(d=>d[o]))),h=[];return c.forEach(d=>{const f=`${d.x0}-${d.x1}`,C=this.aggregateBinDataByGroup(d);u.forEach(P=>{h.push({group:P,key:f,value:C[P]||0,bin:d.x0})})}),{bins:c,binsDomain:p}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:e}=t.data,s=this.getActiveDataGroupNames(),{bins:a}=this.getBinConfigurations(),r=this.getDataValuesGroupedByKeys({bins:a});return y.stack().keys(s)(r).map((o,i)=>Object.keys(o).filter(l=>!isNaN(l)).map(l=>{const c=o[l];return c[e]=s[i],c}))}getGroupedData(t){const e=this.getDisplayData(t),s={},{groupMapsTo:a}=this.getOptions().data;return e.map(r=>{const o=r[a];s[o]!==null&&s[o]!==void 0?s[o].push(r):s[o]=[r]}),Object.keys(s).map(r=>({name:r,data:s[r]}))}getStackKeys({bins:t=null,groups:e=null}={bins:null,groups:null}){const s=this.getOptions(),a=this.getDisplayData(e);let r;t?r=t.map(l=>`${l.x0}-${l.x1}`):r=n.removeArrayDuplicates(a.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?n.formatDateTillMilliSeconds(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const o=this.services.cartesianScales.domainAxisPosition,i=s.axes[o].scaleType;return i===D.ScaleTypes.TIME?r.sort((l,c)=>{const p=new Date(l),u=new Date(c);return p-u}):(i===D.ScaleTypes.LOG||i===D.ScaleTypes.LINEAR)&&r.sort((l,c)=>l-c),r}getDataValuesGroupedByKeys({bins:t=null,groups:e=null}){const s=this.getOptions(),{groupMapsTo:a}=s.data,r=this.getDisplayData(e),o=this.getDataGroupNames(),i=this.getStackKeys({bins:t,groups:e});return t?i.map(l=>{const[c,p]=l.split("-"),u={x0:c,x1:p},h=t.find(d=>d.x0.toString()===c.toString());return o.forEach(d=>{u[d]=h.filter(f=>f[a]===d).length}),u}):i.map(l=>{const c={sharedStackKey:l};return o.forEach(p=>{const u=r.find(d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return d[a]===p&&Object.prototype.hasOwnProperty.call(d,f)&&(d[f]instanceof Date?n.formatDateTillMilliSeconds(d[f])===l:d[f].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[p]=u?u[h]:null}),c})}getStackedData({percentage:t=!1,groups:e=null,divergent:s=!1}){const a=this.getOptions(),{groupMapsTo:r}=a.data,o=this.getActiveDataGroupNames(e),i=this.getDataValuesGroupedByKeys({groups:e});if(t){const c=M(i.map(p=>[p.sharedStackKey,0]));i.forEach(p=>{o.forEach(u=>{c[p.sharedStackKey]+=p[u]})}),i.forEach(p=>{o.forEach(u=>{const h=c[p.sharedStackKey];c[p.sharedStackKey]?p[u]=p[u]/h*100:p[u]=0})})}return(s?y.stack().offset(y.stackOffsetDiverging):y.stack()).keys(o)(i).map((c,p)=>Object.keys(c).filter(u=>!isNaN(u)).map(u=>{const h=c[u];return h[r]=o[p],h}))}getOptions(){return this.state.options}set(t,e){this.state=Object.assign({},this.state,t);const s=Object.assign({skipUpdate:!1,animate:!0},e);s.skipUpdate||this.update(s.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const e=this.getOptions();n.updateLegendAdditionalItems(e,t),this.set({options:n.merge(e,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(D.Events.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:e,DISABLED:s}=n.legend.items.status,a=this.getDataGroups(),r=a.some(p=>p.status===s),o=a.filter(p=>p.status===e);if(r)if(o.length===1&&o[0].name===t)a.forEach((p,u)=>{a[u].status=e});else{const p=a.findIndex(u=>u.name===t);a[p].status=a[p].status===s?e:s}else a.forEach((p,u)=>{a[u].status=p.name===t?e:s});const i=a.filter(p=>p.status===e),l=this.getOptions();a.some(p=>p.status===s)?l.data.selectedGroups=i.map(p=>p.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(D.Events.Legend.ITEMS_UPDATE,{dataGroups:a}),this.set({dataGroups:a})}getIsFilled(t,e,s,a){const r=this.getOptions();return r.getIsFilled?r.getIsFilled(t,e,s,a):a}getFillColor(t,e,s){const a=this.getOptions(),r=n.getProperty(this.colorScale,t);return a.getFillColor?a.getFillColor(t,e,s,r):r}getStrokeColor(t,e,s){const a=this.getOptions(),r=n.getProperty(this.colorScale,t);return a.getStrokeColor?a.getStrokeColor(t,e,s,r):r}isUserProvidedColorScaleValid(){const t=n.getProperty(this.getOptions(),"color","scale"),e=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:e.some(s=>Object.keys(t).includes(s.name))}getColorClassName(t){const e=this.colorClassNames(t.dataGroupName);let s=t.originalClassName;return t.classNameTypes.forEach(a=>s=t.originalClassName?`${s} ${a}-${e}`:`${a}-${e}`),s||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format");const e=[],{datasets:s,labels:a}=t;return s.forEach(r=>{r.data.forEach((o,i)=>{let l;const c=n.getProperty(r,"label");if(c===null){const u=n.getProperty(a,i);u?l=u:l="Ungrouped"}else l=c;const p={group:l,key:a[i]};isNaN(o)?(p.value=o.value,p.date=o.date):p.value=o,e.push(p)})}),e}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(a=>a.map(r=>`"${r==="&ndash;"?"–":r}"`));let e="",s="";t.forEach(function(a,r){s=a.join(","),e+=r<t.length?s+`
2
2
  `:s}),this.services.files.downloadCSV(e,"myChart.csv")}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:e}=this.getOptions().data,{ACTIVE:s,DISABLED:a}=n.legend.items.status,r=this.getOptions(),o=n.removeArrayDuplicates(t.map(l=>l[e]));r.data.selectedGroups.length&&(r.data.selectedGroups.every(c=>o.includes(c))||(r.data.selectedGroups=[]));const i=l=>!r.data.selectedGroups.length||r.data.selectedGroups.includes(l)?s:a;return o.map(l=>({name:l,status:i(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),e=n.getProperty(t,"color","scale");Object.keys(e).forEach(a=>{this.allDataGroups.includes(a)||console.warn(`"${a}" does not exist in data groups.`)}),this.allDataGroups.filter(a=>e[a]).forEach(a=>this.colorScale[a]=e[a])}setColorClassNames(){const t=n.getProperty(this.getOptions(),"color","pairing");let e=n.getProperty(t,"numberOfVariants");(!e||e<this.allDataGroups.length)&&(e=this.allDataGroups.length);let s=n.getProperty(t,"option");const a=n.color.pairingOptions,r=e>5?14:e,o=`${r}-color`;s=s<=a[o]?s:1;const i=this.allDataGroups.map((l,c)=>`${r}-${s}-${c%14+1}`);this.colorClassNames=y.scaleOrdinal().range(i).domain(this.allDataGroups)}}class x extends m{constructor(t){super(t),this.axisFlavor=D.AxisFlavor.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,e=this.getOptions(),s=t.isDualAxes(),a={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return s&&(a.secondaryDomain=t.secondaryDomainAxisPosition,a.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(a).forEach(r=>{const o=a[r];t.scales[o]?a[r]={position:o,label:t.getScaleLabel(o),identifier:n.getProperty(e,"axes",o,"mapsTo")}:a[r]=null}),a}getTabularDataArray(){const t=this.getDisplayData(),e=this.getOptions(),{groupMapsTo:s}=e.data,{cartesianScales:a}=this.services,{primaryDomain:r,primaryRange:o,secondaryDomain:i,secondaryRange:l}=this.assignRangeAndDomains(),c=a.getDomainAxisScaleType();let p;return c===D.ScaleTypes.TIME&&(p=h=>n.format(h,"MMM d, yyyy")),[["Group",r.label,o.label,...i?[i.label]:[],...l?[l.label]:[]],...t.map(h=>[h[s],h[r.identifier]===null?"&ndash;":p?p(h[r.identifier]):h[r.identifier],h[o.identifier]===null||isNaN(h[o.identifier])?"&ndash;":h[o.identifier].toLocaleString(),...i?[h[i.identifier]===null?"&ndash;":h[i.identifier]]:[],...l?[h[l.identifier]===null||isNaN(h[l.identifier])?"&ndash;":h[l.identifier]]:[]])]}setData(t){let e;if(t&&(e=super.setData(t),n.getProperty(this.getOptions(),"zoomBar",D.AxisPositions.TOP,"enabled"))){const s=n.getProperty(this.getOptions(),"zoomBar",D.AxisPositions.TOP,"data");this.setZoomBarData(s)}return e}setZoomBarData(t){const e=t?this.sanitize(n.clone(t)):this.getDisplayData();let s=e;const{cartesianScales:a}=this.services;if(e&&a.domainAxisPosition&&a.rangeAxisPosition){const r=a.getDomainIdentifier(),o=a.getRangeIdentifier();let i=e.map(l=>l[r].getTime());i=n.removeArrayDuplicates(i).sort(),s=i.map(l=>{let c=0;const p={};return e.forEach(u=>{u[r].getTime()===l&&(c+=u[o])}),p[r]=new Date(l),p[o]=c,p})}this.set({zoomBarData:s})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const e=this.getOptions();if(!e.axes)return t;const s=[];return Object.keys(D.AxisPositions).forEach(a=>{const r=D.AxisPositions[a],o=e.axes[r];if(o&&o.scaleType===D.ScaleTypes.TIME){const i=o.mapsTo;(i!==null||i!==void 0)&&s.push(i)}}),s.length>0&&t.forEach(a=>{s.forEach(r=>{n.getProperty(a,r,"getTime")===null&&(a[r]=new Date(a[r]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}class k extends x{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData();return t.sort((s,a)=>s.source.localeCompare(a.source)),[["Source","Target","Value"],...t.map(s=>[s.source,s.target,s.value])]}}class B extends x{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:y.quantile(t,.25),q_50:y.quantile(t,.5),q_75:y.quantile(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:e}=t.data,s=this.getGroupedData(),a=[];for(const{name:r,data:o}of s){const i=this.services.cartesianScales.getRangeIdentifier(),l=o.map(v=>v[i]).sort(y.ascending),c={[e]:r,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},p=c.quartiles.q_25,u=c.quartiles.q_75,h=(u-p)*1.5,d=p-h,f=u+h,C=[],P=[];for(const v of l)v<d||v>f?C.push(v):P.push(v);c.outliers=C;const T=y.min(P),S=y.max(P);c.whiskers={min:T||y.min([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:S||y.max([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},a.push(c)}return a}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:e}=t.data,s=this.getBoxplotData();return[["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],...s.map(r=>{let o=n.getProperty(r,"outliers");return(o===null||o.length===0)&&(o=["&ndash;"]),[r[e],n.getProperty(r,"whiskers","min")!==null?n.getProperty(r,"whiskers","min").toLocaleString():"&ndash;",n.getProperty(r,"quartiles","q_25")!==null?n.getProperty(r,"quartiles","q_25").toLocaleString():"&ndash;",n.getProperty(r,"quartiles","q_50")!==null?n.getProperty(r,"quartiles","q_50").toLocaleString():"&ndash;",n.getProperty(r,"quartiles","q_75")!==null?n.getProperty(r,"quartiles","q_75").toLocaleString():"&ndash;",n.getProperty(r,"whiskers","max")!==null?n.getProperty(r,"whiskers","max").toLocaleString():"&ndash;",n.getProperty(r,"quartiles","q_75")!==null&&n.getProperty(r,"quartiles","q_25")!==null?(n.getProperty(r,"quartiles","q_75")-n.getProperty(r,"quartiles","q_25")).toLocaleString():"&ndash;",o.map(i=>i.toLocaleString()).join(",")]})]}setColorClassNames(){const e=n.getProperty(this.getOptions(),"color","pairing");let s=n.getProperty(e,"option");const a=n.color.pairingOptions;s=s<=a["1-color"]?s:1;const r=this.allDataGroups.map(()=>`1-${s}-1`);this.colorClassNames=y.scaleOrdinal().range(r).domain(this.allDataGroups)}}class N extends x{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let e;for(let s=t.ranges.length-1;s>0;s--){const a=t.ranges[s];if(t.value>=a)return e=s,e}return 0}getTabularDataArray(){const t=this.getDisplayData(),e=this.getOptions(),{groupMapsTo:s}=e.data,a=this.services.cartesianScales.getRangeIdentifier(),r=n.getProperty(e,"bullet","performanceAreaTitles");return[["Title","Group","Value","Target","Percentage","Performance"],...t.map(i=>[i.title,i[s],i.value===null?"&ndash;":i.value,n.getProperty(i,"marker")===null?"&ndash;":i.marker,n.getProperty(i,"marker")===null?"&ndash;":`${Math.floor(i[a]/i.marker*100)}%`,r[this.getMatchingRangeIndexForDatapoint(i)]])]}}class L extends m{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(n.isEmpty(this._matrix)){const t=this.getOptions(),e=this.getDisplayData();!n.isEmpty(e)&&!n.isEmpty(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(s=>{this._matrix[s.properties.NAME]=s}),e.forEach(s=>{this._matrix[s.name]?this._matrix[s.name].value=s.value||null:console.warn(`Data point ${s} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData();return[["Country ID","Country Name","Value"],...t.map(s=>[s.id===null?"&ndash;":s.id,s.name,s.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=n.getProperty(this.getOptions(),"color");this._colorScale=n.getColorScale(this.getDisplayData(),t)}}class V extends m{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const e=this.getOptions(),s=n.merge({},t,this.getZoomOptions(t));n.updateLegendAdditionalItems(e,s);const a=this.getHierarchyLevel(),r=n.getProperty(e,"circlePack","hierarchyLevel");this.set({options:n.merge(e,s),depth:r&&r<4?r:a})}getZoomOptions(t){if(!this.getDisplayData())return{};const e=this.getDisplayData(),s=t||this.getOptions(),a=e.length===1&&n.getProperty(e,0,"children")?n.getProperty(e,0,"children"):e;let r=this.getHierarchyLevel();return a.some(o=>{if(o.children&&o.children.some(i=>i.children))return r=3,!1}),n.getProperty(s,"canvasZoom","enabled")===!0&&r>2?{legend:{additionalItems:[{type:D.LegendItemType.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),e=this.getOptions(),{groupMapsTo:s}=e.data,a=t.map(r=>{const o=r[s];return this.setChildrenDataGroup(r,o)});this.set({data:a},{skipUpdate:!0})}setChildrenDataGroup(t,e){return t.children?{...t,dataGroupName:e,children:t.children.map(s=>this.setChildrenDataGroup(s,e))}:{...t,dataGroupName:e}}getTabularDataArray(){const t=this.getDisplayData(),e=[["Child","Parent","Value"]];return t.forEach(s=>{let a=s.value?s.value:0;s.children&&(a+=this.getChildrenDatums(s.children,s.name,e,0)),e.push(["&ndash;",s.name,a])}),e}getChildrenDatums(t,e,s=[],a=0){const r=e;return t.forEach(o=>{const i=o.name;let l=0;if(o.children)o.children.length>0&&(typeof o.value=="number"&&(a+=o.value),l+=this.getChildrenDatums(o.children,i,s,l),s.push([i,r,l]),a+=l);else{let c=0;typeof o.value=="number"&&(c=o.value,a+=o.value),s.push([o.name,r,c])}}),a}}class R extends m{constructor(t){super(t)}getTabularData(t){const e=super.getTabularData(t);return t!==e&&e.forEach(s=>{s.key&&s.key!==s.group&&(s.group=s.key)}),e}getTabularDataArray(){const t=this.getDisplayData(),e=this.getOptions(),{groupMapsTo:s}=e.data;return[["Group","Value"],...t.map(r=>[r[s],r.value===null?"&ndash;":r.value.toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((s,a)=>a.value-s.value)}}class $ extends m{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),e=this.getOptions(),{groupMapsTo:s}=e.data;return[["Group","Value"],...t.map(r=>[r[s],r.value===null?"&ndash;":r.value.toLocaleString()])]}}class w extends x{constructor(t){super(t),this.axisFlavor=D.AxisFlavor.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const e=n.getProperty(this.getOptions(),"axes");if(n.getProperty(e,"left","scaleType")&&n.getProperty(e,"left","scaleType")!==D.ScaleTypes.LABELS||n.getProperty(e,"right","scaleType")&&n.getProperty(e,"right","scaleType")!==D.ScaleTypes.LABELS||n.getProperty(e,"top","scaleType")&&n.getProperty(e,"top","scaleType")!==D.ScaleTypes.LABELS||n.getProperty(e,"bottom","scaleType")&&n.getProperty(e,"bottom","scaleType")!==D.ScaleTypes.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=y.extent(this.getDisplayData(),s=>s.value),e=y.scaleLinear().domain(t).nice().domain();if(e[0]>0)e[0]=0;else if(e[0]===0&&e[1]===0)return[0,1];return e[0]<0&&e[1]>0&&(Math.abs(e[0])>e[1]?e[1]=Math.abs(e[0]):e[0]=-e[1]),e}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(n.isEmpty(this._domains)){const t=this.getDisplayData(),{cartesianScales:e}=this.services,s=e.getDomainIdentifier(),a=e.getMainXAxisPosition(),r=e.getCustomDomainValuesByposition(a);if(r)return r;this._domains=Array.from(new Set(t.map(o=>o[s])))}return this._domains}getUniqueRanges(){if(n.isEmpty(this._ranges)){const t=this.getDisplayData(),{cartesianScales:e}=this.services,s=e.getRangeIdentifier(),a=e.getMainYAxisPosition(),r=e.getCustomDomainValuesByposition(a);if(r)return r;this._ranges=Array.from(new Set(t.map(o=>o[s])))}return this._ranges}getMatrix(){if(n.isEmpty(this._matrix)){const t=this.getUniqueDomain(),e=this.getUniqueRanges(),s=this.services.cartesianScales.getDomainIdentifier(),a=this.services.cartesianScales.getRangeIdentifier(),r={};e.forEach(o=>{r[o]={value:null,index:-1}}),t.forEach(o=>{this._matrix[o]=n.clone(r)}),this.getDisplayData().forEach((o,i)=>{this._matrix[o[s]][o[a]]={value:o.value,index:i}})}return this._matrix}setData(t){const e=this.sanitize(n.clone(t)),s=this.generateDataGroups(e);return this.set({data:e,dataGroups:s}),this._domains=[],this._ranges=[],this._matrix={},e}getMatrixAsArray(){n.isEmpty(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),e=this.getUniqueRanges(),s=this.services.cartesianScales.getDomainIdentifier(),a=this.services.cartesianScales.getRangeIdentifier(),r=[];return t.forEach(o=>{e.forEach(i=>{const l={value:this._matrix[o][i].value,index:this._matrix[o][i].index};l[s]=o,l[a]=i,r.push(l)})}),r}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:e,primaryRange:s}=this.assignRangeAndDomains();return[[e.label,s.label,"Value"],...t.map(r=>[r[e.identifier]===null?"&ndash;":r[e.identifier],r[s.identifier]===null?"&ndash;":r[s.identifier].toLocaleString(),r.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),e=n.getProperty(t,"color","gradient","colors"),s=!n.isEmpty(e);let a=n.getProperty(t,"color","pairing","option");const r=this.getValueDomain(),o=r[0]<0&&r[1]>0?"diverge":"mono";(a<1&&a>4&&o==="mono"||a<1&&a>2&&o==="diverge")&&(a=1);const i=s?e:[];if(!s){const c=o==="diverge"?17:11;for(let p=1;p<c+1;p++)i.push(`fill-${o}-${a}-${p}`)}this._colorScale=y.scaleQuantize().domain(r).range(i);const l=n.getProperty(this.getOptions(),"color");this._colorScale=n.getColorScale(this.getDisplayData(),l)}}class F extends x{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:e}=t.data,s=this.getBinnedStackedData();return[[n.get(t,"bins.rangeLabel")||"Range",...s.map(r=>n.get(r,`0.${e}`))],...n.get(s,0).map((r,o)=>[`${n.get(r,"data.x0")} – ${n.get(r,"data.x1")}`,...s.map(i=>n.get(i[o],`data.${n.get(i[o],e)}`))])]}}class z extends m{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((s,a)=>s+a.value,0)}getFillColor(t){const e=this.getOptions(),s=n.getProperty(e,"color","scale"),a=this.getStatus();return s||!a?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),e=n.getProperty(this.getDisplayData()),{value:s}=e?e.reduce((o,i)=>({value:o.value+i.value})):0,a=n.getProperty(t,"meter","proportional")?s:s>100?100:s,r=n.getProperty(t,"meter","status","ranges");if(r){const o=r.filter(i=>i.range[0]<=a&&a<=i.range[1]);if(o.length>0)return o[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),e=this.getOptions(),{groupMapsTo:s}=e.data,a=this.getStatus(),r=n.getProperty(e,"meter","proportional");let o=[],i;if(r===null){i=100;const l=t[0];o=[["Group","Value",...a?["Status"]:[]],[l[s],l.value,...a?[a]:[]]]}else{const l=n.getProperty(r,"total");i=l||this.getMaximumDomain(t),o=[["Group","Value","Percentage of total"],...t.map(c=>[c[s],c.value,(c.value/i*100).toFixed(2)+" %"])]}return o}}class U extends x{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),e=this.getGroupedData(),{angle:s,value:a}=n.getProperty(t,"radar","axes"),r=n.getProperty(e,"0","data").map(i=>i[s]);return[["Group",...r],...e.map(i=>[i.name,...r.map((l,c)=>n.getProperty(i,"data",c,a)!==null?n.getProperty(i,"data",c,a).toLocaleString():"&ndash;")])]}}class j extends m{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),e=[["Child","Parent"]];return t.forEach(s=>{this.getChildrenDatums(s,e),e.push([s.name,"&ndash;"])}),e}getChildrenDatums(t,e=[]){t.children&&t.children.length>0&&t.children.forEach(s=>{this.getChildrenDatums(s,e),e.push([s.name,t.name])})}}class K extends m{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),e=[["Child","Group","Value"]];return t.forEach(s=>{Array.isArray(s.children)?s.children.forEach(a=>{e.push([a.name,s.name,a.value])}):n.getProperty(s.name)!==null&&n.getProperty(s.value)&&e.push(["–",s.name,s.value])}),e}}class Z extends m{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),e=this.getOptions(),{fontSizeMapsTo:s,wordMapsTo:a}=e.wordCloud,{groupMapsTo:r}=e.data;return[[e.tooltip.wordLabel,"Group",e.tooltip.valueLabel],...t.map(i=>[i[a],i[r],i[s]])]}}exports.AlluvialChartModel=k;exports.BoxplotChartModel=B;exports.BulletChartModel=N;exports.ChartModel=m;exports.ChartModelBinned=F;exports.ChartModelCartesian=x;exports.ChoroplethModel=L;exports.CirclePackChartModel=V;exports.GaugeChartModel=$;exports.HeatmapModel=w;exports.MeterChartModel=z;exports.PieChartModel=R;exports.RadarChartModel=U;exports.TreeChartModel=j;exports.TreemapChartModel=K;exports.WordCloudModel=Z;
3
3
  //# sourceMappingURL=index.js.map