@carbon/charts 1.6.13 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/axis-chart.js +1 -1
  3. package/axis-chart.js.map +1 -1
  4. package/build/src/interfaces/charts.d.ts +6 -0
  5. package/build/src/tools.d.ts +2420 -151
  6. package/bundle.js +1 -1
  7. package/chart.js +1 -1
  8. package/chart.js.map +1 -1
  9. package/charts/alluvial.js +1 -1
  10. package/charts/alluvial.js.map +1 -1
  11. package/charts/area-stacked.js +1 -1
  12. package/charts/area-stacked.js.map +1 -1
  13. package/charts/area.js +1 -1
  14. package/charts/area.js.map +1 -1
  15. package/charts/bar-grouped.js +1 -1
  16. package/charts/bar-grouped.js.map +1 -1
  17. package/charts/bar-simple.js +1 -1
  18. package/charts/bar-simple.js.map +1 -1
  19. package/charts/bar-stacked.js +1 -1
  20. package/charts/bar-stacked.js.map +1 -1
  21. package/charts/boxplot.js +1 -1
  22. package/charts/boxplot.js.map +1 -1
  23. package/charts/bubble.js +1 -1
  24. package/charts/bubble.js.map +1 -1
  25. package/charts/bullet.js +1 -1
  26. package/charts/bullet.js.map +1 -1
  27. package/charts/circle-pack.js +1 -1
  28. package/charts/circle-pack.js.map +1 -1
  29. package/charts/combo.js +1 -1
  30. package/charts/combo.js.map +1 -1
  31. package/charts/donut.js +1 -1
  32. package/charts/donut.js.map +1 -1
  33. package/charts/gauge.js +1 -1
  34. package/charts/gauge.js.map +1 -1
  35. package/charts/heatmap.js +1 -1
  36. package/charts/heatmap.js.map +1 -1
  37. package/charts/histogram.js +1 -1
  38. package/charts/histogram.js.map +1 -1
  39. package/charts/line.js +1 -1
  40. package/charts/line.js.map +1 -1
  41. package/charts/lollipop.js +1 -1
  42. package/charts/lollipop.js.map +1 -1
  43. package/charts/meter.js +1 -1
  44. package/charts/meter.js.map +1 -1
  45. package/charts/pie.js +1 -1
  46. package/charts/pie.js.map +1 -1
  47. package/charts/radar.js +1 -1
  48. package/charts/radar.js.map +1 -1
  49. package/charts/scatter.js +1 -1
  50. package/charts/scatter.js.map +1 -1
  51. package/charts/tree.js +1 -1
  52. package/charts/tree.js.map +1 -1
  53. package/charts/treemap.js +1 -1
  54. package/charts/treemap.js.map +1 -1
  55. package/charts/wordcloud.js +1 -1
  56. package/charts/wordcloud.js.map +1 -1
  57. package/components/axes/axis.js +1 -1
  58. package/components/axes/axis.js.map +1 -1
  59. package/components/axes/grid.js +1 -1
  60. package/components/axes/grid.js.map +1 -1
  61. package/components/axes/hover-axis.js +1 -1
  62. package/components/axes/hover-axis.js.map +1 -1
  63. package/components/axes/ruler-binned.js +1 -1
  64. package/components/axes/ruler-binned.js.map +1 -1
  65. package/components/axes/ruler.js +1 -1
  66. package/components/axes/ruler.js.map +1 -1
  67. package/components/axes/toolbar.js +1 -1
  68. package/components/axes/toolbar.js.map +1 -1
  69. package/components/axes/two-dimensional-axes.js +1 -1
  70. package/components/axes/two-dimensional-axes.js.map +1 -1
  71. package/components/axes/zero-line.js +1 -1
  72. package/components/axes/zero-line.js.map +1 -1
  73. package/components/axes/zoom-bar.js +1 -1
  74. package/components/axes/zoom-bar.js.map +1 -1
  75. package/components/component.js +1 -1
  76. package/components/component.js.map +1 -1
  77. package/components/essentials/color-scale-legend.js +1 -1
  78. package/components/essentials/color-scale-legend.js.map +1 -1
  79. package/components/essentials/highlights.js +1 -1
  80. package/components/essentials/highlights.js.map +1 -1
  81. package/components/essentials/legend.js +1 -1
  82. package/components/essentials/legend.js.map +1 -1
  83. package/components/essentials/modal.js +1 -1
  84. package/components/essentials/modal.js.map +1 -1
  85. package/components/essentials/threshold.js +1 -1
  86. package/components/essentials/threshold.js.map +1 -1
  87. package/components/essentials/title-meter.js +1 -1
  88. package/components/essentials/title-meter.js.map +1 -1
  89. package/components/essentials/title.js +1 -1
  90. package/components/essentials/title.js.map +1 -1
  91. package/components/essentials/tooltip-axis.js +1 -1
  92. package/components/essentials/tooltip-axis.js.map +1 -1
  93. package/components/essentials/tooltip.js +1 -1
  94. package/components/essentials/tooltip.js.map +1 -1
  95. package/components/graphs/alluvial.js +1 -1
  96. package/components/graphs/alluvial.js.map +1 -1
  97. package/components/graphs/area-stacked.js +1 -1
  98. package/components/graphs/area-stacked.js.map +1 -1
  99. package/components/graphs/area.js +1 -1
  100. package/components/graphs/area.js.map +1 -1
  101. package/components/graphs/bar-grouped.js +1 -1
  102. package/components/graphs/bar-grouped.js.map +1 -1
  103. package/components/graphs/bar-simple.js +1 -1
  104. package/components/graphs/bar-simple.js.map +1 -1
  105. package/components/graphs/bar-stacked.js +1 -1
  106. package/components/graphs/bar-stacked.js.map +1 -1
  107. package/components/graphs/bar.js +1 -1
  108. package/components/graphs/bar.js.map +1 -1
  109. package/components/graphs/boxplot.js +1 -1
  110. package/components/graphs/boxplot.js.map +1 -1
  111. package/components/graphs/bubble.js +1 -1
  112. package/components/graphs/bubble.js.map +1 -1
  113. package/components/graphs/bullet.js +1 -1
  114. package/components/graphs/bullet.js.map +1 -1
  115. package/components/graphs/circle-pack.js +1 -1
  116. package/components/graphs/circle-pack.js.map +1 -1
  117. package/components/graphs/donut.js +1 -1
  118. package/components/graphs/donut.js.map +1 -1
  119. package/components/graphs/gauge.js +1 -1
  120. package/components/graphs/gauge.js.map +1 -1
  121. package/components/graphs/heatmap.js +1 -1
  122. package/components/graphs/heatmap.js.map +1 -1
  123. package/components/graphs/histogram.js +1 -1
  124. package/components/graphs/histogram.js.map +1 -1
  125. package/components/graphs/line.js +1 -1
  126. package/components/graphs/line.js.map +1 -1
  127. package/components/graphs/lollipop.js +1 -1
  128. package/components/graphs/lollipop.js.map +1 -1
  129. package/components/graphs/meter.js +1 -1
  130. package/components/graphs/meter.js.map +1 -1
  131. package/components/graphs/pie.js +1 -1
  132. package/components/graphs/pie.js.map +1 -1
  133. package/components/graphs/radar.js +1 -1
  134. package/components/graphs/radar.js.map +1 -1
  135. package/components/graphs/scatter-stacked.js +1 -1
  136. package/components/graphs/scatter-stacked.js.map +1 -1
  137. package/components/graphs/scatter.js +1 -1
  138. package/components/graphs/scatter.js.map +1 -1
  139. package/components/graphs/skeleton-lines.js +1 -1
  140. package/components/graphs/skeleton-lines.js.map +1 -1
  141. package/components/graphs/skeleton.js +1 -1
  142. package/components/graphs/skeleton.js.map +1 -1
  143. package/components/graphs/tree.js +1 -1
  144. package/components/graphs/tree.js.map +1 -1
  145. package/components/graphs/treemap.js +1 -1
  146. package/components/graphs/treemap.js.map +1 -1
  147. package/components/graphs/wordcloud.js +1 -1
  148. package/components/graphs/wordcloud.js.map +1 -1
  149. package/components/layout/layout.js +1 -1
  150. package/components/layout/layout.js.map +1 -1
  151. package/configuration.js +1 -1
  152. package/configuration.js.map +1 -1
  153. package/demo/data/bar.js +60 -12
  154. package/demo/data/bar.js.map +1 -1
  155. package/demo/tsconfig.tsbuildinfo +1 -1
  156. package/interfaces/charts.d.ts +6 -0
  157. package/interfaces/charts.js.map +1 -1
  158. package/model/boxplot.js +1 -1
  159. package/model/boxplot.js.map +1 -1
  160. package/model/bullet.js +1 -1
  161. package/model/bullet.js.map +1 -1
  162. package/model/cartesian-charts.js +1 -1
  163. package/model/cartesian-charts.js.map +1 -1
  164. package/model/circle-pack.js +1 -1
  165. package/model/circle-pack.js.map +1 -1
  166. package/model/heatmap.js +1 -1
  167. package/model/heatmap.js.map +1 -1
  168. package/model/meter.js +1 -1
  169. package/model/meter.js.map +1 -1
  170. package/model/model.js +8 -2
  171. package/model/model.js.map +1 -1
  172. package/model/radar.js +1 -1
  173. package/model/radar.js.map +1 -1
  174. package/model/treemap.js +1 -1
  175. package/model/treemap.js.map +1 -1
  176. package/package.json +1 -1
  177. package/services/essentials/dom-utils.js +15 -3
  178. package/services/essentials/dom-utils.js.map +1 -1
  179. package/services/essentials/transitions.js +1 -1
  180. package/services/essentials/transitions.js.map +1 -1
  181. package/services/scales-cartesian.js +1 -1
  182. package/services/scales-cartesian.js.map +1 -1
  183. package/services/time-series.js +1 -1
  184. package/services/time-series.js.map +1 -1
  185. package/services/zoom.js +1 -1
  186. package/services/zoom.js.map +1 -1
  187. package/tools.d.ts +141 -155
  188. package/tools.js +315 -344
  189. package/tools.js.map +1 -1
  190. package/tsconfig.tsbuildinfo +92 -92
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.7.0](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.14...v1.7.0) (2023-04-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * **exports:** custom fileDownload.fileName function ([#1536](https://github.com/carbon-design-system/carbon-charts/issues/1536)) ([fc658e0](https://github.com/carbon-design-system/carbon-charts/commit/fc658e03e188884a27ed60e95ded3f41db5d50ba))
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.6.14](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.13...v1.6.14) (2023-03-07)
18
+
19
+ **Note:** Version bump only for package @carbon/charts
20
+
21
+
22
+
23
+
24
+
6
25
  ## [1.6.13](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.12...v1.6.13) (2023-03-07)
7
26
 
8
27
 
package/axis-chart.js CHANGED
@@ -22,7 +22,7 @@ import { Chart } from './chart';
22
22
  import { ChartModelCartesian } from './model/cartesian-charts';
23
23
  import { LayoutDirection, LayoutGrowth, LegendOrientations, LegendPositions, AxisPositions, ScaleTypes, RenderTypes, LayoutAlignItems, } from './interfaces';
24
24
  import { ChartBrush, ChartClip, Modal, LayoutComponent, Legend, Threshold, Highlight, Title, AxisChartsTooltip, Spacer, Toolbar, ZoomBar, } from './components';
25
- import { Tools } from './tools';
25
+ import * as Tools from './tools';
26
26
  import { CartesianScales, Curves, Zoom } from './services';
27
27
  var AxisChart = /** @class */ (function (_super) {
28
28
  __extends(AxisChart, _super);
package/axis-chart.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ax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B,CAAC,CAAC;QAElD,OAAO;YACN,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YAChD,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YACpC,IAAI,eAAe,CAClB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,EACb,wBAAwB,EACxB;gBACC,SAAS,EAAE,eAAe,CAAC,MAAM;aACjC,CACD;SACD,CAAC;IACH,CAAC;IACF,gBAAC;AAAD,CAAC,AA5MD,CAA+B,KAAK,GA4MnC","sourcesContent":["import { Chart } from './chart';\nimport { ChartModelCartesian } from './model/cartesian-charts';\nimport {\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLegendOrientations,\n\tLegendPositions,\n\tChartConfig,\n\tAxisChartOptions,\n\tAxisPositions,\n\tScaleTypes,\n\tRenderTypes,\n\tLayoutAlignItems,\n} from './interfaces';\nimport {\n\tChartBrush,\n\tChartClip,\n\tModal,\n\tLayoutComponent,\n\tLegend,\n\tThreshold,\n\tHighlight,\n\tTitle,\n\tAxisChartsTooltip,\n\tSpacer,\n\tToolbar,\n\tZoomBar,\n} from './components';\nimport { Tools } from './tools';\n\nimport { CartesianScales, Curves, Zoom } from './services';\n\nexport class AxisChart extends Chart {\n\tservices: any = Object.assign(this.services, {\n\t\tcartesianScales: CartesianScales,\n\t\tcurves: Curves,\n\t\tzoom: Zoom,\n\t});\n\tmodel: ChartModelCartesian = new ChartModelCartesian(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<AxisChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\t}\n\n\tprotected getAxisChartComponents(\n\t\tgraphFrameComponents: any[],\n\t\tconfigs?: any\n\t) {\n\t\tconst options = this.model.getOptions();\n\t\tconst isZoomBarEnabled = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'enabled'\n\t\t);\n\t\tconst toolbarEnabled = Tools.getProperty(options, 'toolbar', 'enabled');\n\n\t\tthis.services.cartesianScales.determineAxisDuality();\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes(); // need to do this before getMainXAxisPosition()\n\t\tthis.services.cartesianScales.determineOrientation();\n\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition();\n\t\tconst mainXScaleType = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'axes',\n\t\t\tmainXAxisPosition,\n\t\t\t'scaleType'\n\t\t);\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tconst zoomBarEnabled =\n\t\t\tisZoomBarEnabled &&\n\t\t\tmainXAxisPosition === AxisPositions.BOTTOM &&\n\t\t\tmainXScaleType === ScaleTypes.TIME;\n\n\t\t// @todo - should check if zoom bar in all axes are locked\n\t\tconst isZoomBarLocked = this.services.zoom.isZoomBarLocked(\n\t\t\tAxisPositions.TOP\n\t\t);\n\n\t\tconst titleAvailable = !!this.model.getOptions().title;\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t};\n\n\t\tconst toolbarComponent = {\n\t\t\tid: 'toolbar',\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\tconst headerComponent = {\n\t\t\tid: 'header',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : []),\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW,\n\t\t\t\t\t\talignItems: LayoutAlignItems.CENTER,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\t// if all zoom bars are locked, no need to add chart brush\n\t\tif (zoomBarEnabled && !isZoomBarLocked) {\n\t\t\tgraphFrameComponents.push(\n\t\t\t\tnew ChartClip(this.model, this.services),\n\t\t\t\tnew ChartBrush(this.model, this.services)\n\t\t\t);\n\t\t}\n\n\t\tgraphFrameComponents.push(new Threshold(this.model, this.services));\n\t\tgraphFrameComponents.push(new Highlight(this.model, this.services));\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: RenderTypes.SVG,\n\t\t};\n\n\t\tconst isLegendEnabled =\n\t\t\tTools.getProperty(configs, 'legend', 'enabled') !== false &&\n\t\t\tthis.model.getOptions().legend.enabled !== false;\n\n\t\t// Decide the position of the legend in reference to the chart\n\t\tlet fullFrameComponentDirection = LayoutDirection.COLUMN;\n\t\tif (isLegendEnabled) {\n\t\t\tconst legendPosition = Tools.getProperty(\n\t\t\t\tthis.model.getOptions(),\n\t\t\t\t'legend',\n\t\t\t\t'position'\n\t\t\t);\n\t\t\tif (legendPosition === LegendPositions.LEFT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.RIGHT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.BOTTOM) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE;\n\t\t\t}\n\t\t}\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent,\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t};\n\n\t\tconst zoomBarComponent = {\n\t\t\tid: 'zoom-bar',\n\t\t\tcomponents: [new ZoomBar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t\trenderType: RenderTypes.SVG,\n\t\t};\n\n\t\tconst topLevelLayoutComponents = [];\n\t\t// header component is required for either title or toolbar\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent);\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(\n\t\t\t\t\t\tthis.model,\n\t\t\t\t\t\tthis.services,\n\t\t\t\t\t\ttoolbarEnabled ? { size: 15 } : undefined\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t\t};\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent);\n\t\t}\n\t\tif (zoomBarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(zoomBarComponent);\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent);\n\n\t\treturn [\n\t\t\tnew AxisChartsTooltip(this.model, this.services),\n\t\t\tnew Modal(this.model, this.services),\n\t\t\tnew LayoutComponent(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services,\n\t\t\t\ttopLevelLayoutComponents,\n\t\t\t\t{\n\t\t\t\t\tdirection: LayoutDirection.COLUMN,\n\t\t\t\t}\n\t\t\t),\n\t\t];\n\t}\n}\n"]}
1
+ {"version":3,"file":"axis-chart.js","sourceRoot":"","sources":["axis-chart.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACN,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EAGf,aAAa,EACb,UAAU,EACV,WAAW,EACX,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,UAAU,EACV,SAAS,EACT,KAAK,EACL,eAAe,EACf,MAAM,EACN,SAAS,EACT,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,MAAM,EACN,OAAO,EACP,OAAO,GACP,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAE3D;IAA+B,6BAAK;IAQnC,mBAAY,MAAe,EAAE,YAA2C;QAAxE,YACC,kBAAM,MAAM,EAAE,YAAY,CAAC,SAC3B;QATD,cAAQ,GAAQ,MAAM,CAAC,MAAM,CAAC,KAAI,CAAC,QAAQ,EAAE;YAC5C,eAAe,EAAE,eAAe;YAChC,MAAM,EAAE,MAAM;YAC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Q;gBACZ,UAAU,EAAE;oBACX,IAAI,MAAM,CACT,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,EACb,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CACzC;iBACD;gBACD,MAAM,EAAE,YAAY,CAAC,SAAS;aAC9B,CAAC;YAEF,wBAAwB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;SACpD;QACD,IAAI,cAAc,EAAE;YACnB,wBAAwB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SAChD;QACD,wBAAwB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAElD,OAAO;YACN,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YAChD,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;YACpC,IAAI,eAAe,CAClB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,EACb,wBAAwB,EACxB;gBACC,SAAS,EAAE,eAAe,CAAC,MAAM;aACjC,CACD;SACD,CAAC;IACH,CAAC;IACF,gBAAC;AAAD,CAAC,AA5MD,CAA+B,KAAK,GA4MnC","sourcesContent":["import { Chart } from './chart';\nimport { ChartModelCartesian } from './model/cartesian-charts';\nimport {\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLegendOrientations,\n\tLegendPositions,\n\tChartConfig,\n\tAxisChartOptions,\n\tAxisPositions,\n\tScaleTypes,\n\tRenderTypes,\n\tLayoutAlignItems,\n} from './interfaces';\nimport {\n\tChartBrush,\n\tChartClip,\n\tModal,\n\tLayoutComponent,\n\tLegend,\n\tThreshold,\n\tHighlight,\n\tTitle,\n\tAxisChartsTooltip,\n\tSpacer,\n\tToolbar,\n\tZoomBar,\n} from './components';\nimport * as Tools from './tools';\n\nimport { CartesianScales, Curves, Zoom } from './services';\n\nexport class AxisChart extends Chart {\n\tservices: any = Object.assign(this.services, {\n\t\tcartesianScales: CartesianScales,\n\t\tcurves: Curves,\n\t\tzoom: Zoom,\n\t});\n\tmodel: ChartModelCartesian = new ChartModelCartesian(this.services);\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<AxisChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\t}\n\n\tprotected getAxisChartComponents(\n\t\tgraphFrameComponents: any[],\n\t\tconfigs?: any\n\t) {\n\t\tconst options = this.model.getOptions();\n\t\tconst isZoomBarEnabled = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'zoomBar',\n\t\t\tAxisPositions.TOP,\n\t\t\t'enabled'\n\t\t);\n\t\tconst toolbarEnabled = Tools.getProperty(options, 'toolbar', 'enabled');\n\n\t\tthis.services.cartesianScales.determineAxisDuality();\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes(); // need to do this before getMainXAxisPosition()\n\t\tthis.services.cartesianScales.determineOrientation();\n\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition();\n\t\tconst mainXScaleType = Tools.getProperty(\n\t\t\toptions,\n\t\t\t'axes',\n\t\t\tmainXAxisPosition,\n\t\t\t'scaleType'\n\t\t);\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tconst zoomBarEnabled =\n\t\t\tisZoomBarEnabled &&\n\t\t\tmainXAxisPosition === AxisPositions.BOTTOM &&\n\t\t\tmainXScaleType === ScaleTypes.TIME;\n\n\t\t// @todo - should check if zoom bar in all axes are locked\n\t\tconst isZoomBarLocked = this.services.zoom.isZoomBarLocked(\n\t\t\tAxisPositions.TOP\n\t\t);\n\n\t\tconst titleAvailable = !!this.model.getOptions().title;\n\t\tconst titleComponent = {\n\t\t\tid: 'title',\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t};\n\n\t\tconst toolbarComponent = {\n\t\t\tid: 'toolbar',\n\t\t\tcomponents: [new Toolbar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\tconst headerComponent = {\n\t\t\tid: 'header',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t// always add title to keep layout correct\n\t\t\t\t\t\ttitleComponent,\n\t\t\t\t\t\t...(toolbarEnabled ? [toolbarComponent] : []),\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: LayoutDirection.ROW,\n\t\t\t\t\t\talignItems: LayoutAlignItems.CENTER,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\tconst legendComponent = {\n\t\t\tid: 'legend',\n\t\t\tcomponents: [new Legend(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\t// if all zoom bars are locked, no need to add chart brush\n\t\tif (zoomBarEnabled && !isZoomBarLocked) {\n\t\t\tgraphFrameComponents.push(\n\t\t\t\tnew ChartClip(this.model, this.services),\n\t\t\t\tnew ChartBrush(this.model, this.services)\n\t\t\t);\n\t\t}\n\n\t\tgraphFrameComponents.push(new Threshold(this.model, this.services));\n\t\tgraphFrameComponents.push(new Highlight(this.model, this.services));\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: 'graph-frame',\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t\trenderType: RenderTypes.SVG,\n\t\t};\n\n\t\tconst isLegendEnabled =\n\t\t\tTools.getProperty(configs, 'legend', 'enabled') !== false &&\n\t\t\tthis.model.getOptions().legend.enabled !== false;\n\n\t\t// Decide the position of the legend in reference to the chart\n\t\tlet fullFrameComponentDirection = LayoutDirection.COLUMN;\n\t\tif (isLegendEnabled) {\n\t\t\tconst legendPosition = Tools.getProperty(\n\t\t\t\tthis.model.getOptions(),\n\t\t\t\t'legend',\n\t\t\t\t'position'\n\t\t\t);\n\t\t\tif (legendPosition === LegendPositions.LEFT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.RIGHT) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.ROW_REVERSE;\n\n\t\t\t\tif (!this.model.getOptions().legend.orientation) {\n\t\t\t\t\tthis.model.getOptions().legend.orientation =\n\t\t\t\t\t\tLegendOrientations.VERTICAL;\n\t\t\t\t}\n\t\t\t} else if (legendPosition === LegendPositions.BOTTOM) {\n\t\t\t\tfullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE;\n\t\t\t}\n\t\t}\n\n\t\tconst legendSpacerComponent = {\n\t\t\tid: 'spacer',\n\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t};\n\n\t\tconst fullFrameComponent = {\n\t\t\tid: 'full-frame',\n\t\t\tcomponents: [\n\t\t\t\tnew LayoutComponent(\n\t\t\t\t\tthis.model,\n\t\t\t\t\tthis.services,\n\t\t\t\t\t[\n\t\t\t\t\t\t...(isLegendEnabled ? [legendComponent] : []),\n\t\t\t\t\t\t...(isLegendEnabled ? [legendSpacerComponent] : []),\n\t\t\t\t\t\tgraphFrameComponent,\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tdirection: fullFrameComponentDirection,\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t],\n\t\t\tgrowth: LayoutGrowth.STRETCH,\n\t\t};\n\n\t\tconst zoomBarComponent = {\n\t\t\tid: 'zoom-bar',\n\t\t\tcomponents: [new ZoomBar(this.model, this.services)],\n\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t\trenderType: RenderTypes.SVG,\n\t\t};\n\n\t\tconst topLevelLayoutComponents = [];\n\t\t// header component is required for either title or toolbar\n\t\tif (titleAvailable || toolbarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(headerComponent);\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: 'spacer',\n\t\t\t\tcomponents: [\n\t\t\t\t\tnew Spacer(\n\t\t\t\t\t\tthis.model,\n\t\t\t\t\t\tthis.services,\n\t\t\t\t\t\ttoolbarEnabled ? { size: 15 } : undefined\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t\tgrowth: LayoutGrowth.PREFERRED,\n\t\t\t};\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent);\n\t\t}\n\t\tif (zoomBarEnabled) {\n\t\t\ttopLevelLayoutComponents.push(zoomBarComponent);\n\t\t}\n\t\ttopLevelLayoutComponents.push(fullFrameComponent);\n\n\t\treturn [\n\t\t\tnew AxisChartsTooltip(this.model, this.services),\n\t\t\tnew Modal(this.model, this.services),\n\t\t\tnew LayoutComponent(\n\t\t\t\tthis.model,\n\t\t\t\tthis.services,\n\t\t\t\ttopLevelLayoutComponents,\n\t\t\t\t{\n\t\t\t\t\tdirection: LayoutDirection.COLUMN,\n\t\t\t\t}\n\t\t\t),\n\t\t];\n\t}\n}\n"]}
@@ -113,6 +113,12 @@ export interface BaseChartOptions {
113
113
  colors?: Array<String>;
114
114
  };
115
115
  };
116
+ fileDownload?: {
117
+ /**
118
+ * the number of color variants in the palette (defaults to using the number of data groups in the given data)
119
+ */
120
+ fileName?: (type: 'png' | 'jpg' | 'csv') => string;
121
+ };
116
122
  }
117
123
  /**
118
124
  * Options common to any chart with an axis