@carbon/charts 0.34.7 → 0.34.11

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 (173) hide show
  1. package/CHANGELOG.md +28 -9
  2. package/axis-chart.d.ts +2 -2
  3. package/axis-chart.js +27 -4
  4. package/axis-chart.js.map +1 -1
  5. package/build/demo/data/bar.d.ts +15 -0
  6. package/build/demo/data/zoom-bar.d.ts +74 -0
  7. package/build/src/axis-chart.d.ts +2 -2
  8. package/build/src/components/axes/axis.d.ts +4 -0
  9. package/build/src/components/axes/chart-clip.d.ts +11 -0
  10. package/build/src/components/axes/grid-brush.d.ts +8 -0
  11. package/build/src/components/axes/zoom-bar.d.ts +21 -0
  12. package/build/src/components/component.d.ts +3 -1
  13. package/build/src/components/essentials/legend.d.ts +1 -0
  14. package/build/src/components/graphs/bar.d.ts +1 -0
  15. package/build/src/components/graphs/scatter.d.ts +1 -0
  16. package/build/src/components/index.d.ts +3 -0
  17. package/build/src/configuration.d.ts +8 -1
  18. package/build/src/interfaces/charts.d.ts +6 -2
  19. package/build/src/interfaces/components.d.ts +39 -8
  20. package/build/src/interfaces/enums.d.ts +7 -0
  21. package/build/src/interfaces/events.d.ts +9 -0
  22. package/build/src/model.d.ts +3 -3
  23. package/build/src/services/index.d.ts +1 -0
  24. package/build/src/services/scales-cartesian.d.ts +7 -4
  25. package/build/src/services/zoom.d.ts +5 -0
  26. package/bundle.js +1 -1
  27. package/chart.js +5 -4
  28. package/chart.js.map +1 -1
  29. package/charts/area-stacked.js.map +1 -1
  30. package/charts/area.js.map +1 -1
  31. package/charts/bar-grouped.js.map +1 -1
  32. package/charts/bar-simple.js.map +1 -1
  33. package/charts/bar-stacked.js.map +1 -1
  34. package/charts/bubble.js.map +1 -1
  35. package/charts/donut.js.map +1 -1
  36. package/charts/line.js.map +1 -1
  37. package/charts/meter.js +7 -15
  38. package/charts/meter.js.map +1 -1
  39. package/charts/pie.js.map +1 -1
  40. package/charts/radar.js +3 -1
  41. package/charts/radar.js.map +1 -1
  42. package/charts/scatter.js.map +1 -1
  43. package/components/axes/axis.d.ts +4 -0
  44. package/components/axes/axis.js +33 -2
  45. package/components/axes/axis.js.map +1 -1
  46. package/components/axes/chart-clip.d.ts +11 -0
  47. package/components/axes/chart-clip.js +59 -0
  48. package/components/axes/chart-clip.js.map +1 -0
  49. package/components/axes/grid-brush.d.ts +8 -0
  50. package/components/axes/grid-brush.js +163 -0
  51. package/components/axes/grid-brush.js.map +1 -0
  52. package/components/axes/two-dimensional-axes.js +4 -0
  53. package/components/axes/two-dimensional-axes.js.map +1 -1
  54. package/components/axes/zoom-bar.d.ts +21 -0
  55. package/components/axes/zoom-bar.js +364 -0
  56. package/components/axes/zoom-bar.js.map +1 -0
  57. package/components/component.d.ts +3 -1
  58. package/components/component.js +11 -2
  59. package/components/component.js.map +1 -1
  60. package/components/essentials/legend.d.ts +1 -0
  61. package/components/essentials/legend.js +19 -1
  62. package/components/essentials/legend.js.map +1 -1
  63. package/components/essentials/title-meter.js +28 -17
  64. package/components/essentials/title-meter.js.map +1 -1
  65. package/components/essentials/title.js +2 -1
  66. package/components/essentials/title.js.map +1 -1
  67. package/components/essentials/tooltip-axis.js +4 -1
  68. package/components/essentials/tooltip-axis.js.map +1 -1
  69. package/components/essentials/tooltip.js +13 -0
  70. package/components/essentials/tooltip.js.map +1 -1
  71. package/components/graphs/area-stacked.js +1 -1
  72. package/components/graphs/area-stacked.js.map +1 -1
  73. package/components/graphs/area.js +1 -1
  74. package/components/graphs/area.js.map +1 -1
  75. package/components/graphs/bar-grouped.js +5 -1
  76. package/components/graphs/bar-grouped.js.map +1 -1
  77. package/components/graphs/bar-simple.js +5 -1
  78. package/components/graphs/bar-simple.js.map +1 -1
  79. package/components/graphs/bar-stacked.js +5 -1
  80. package/components/graphs/bar-stacked.js.map +1 -1
  81. package/components/graphs/bar.d.ts +1 -0
  82. package/components/graphs/bar.js +16 -1
  83. package/components/graphs/bar.js.map +1 -1
  84. package/components/graphs/line.js +1 -1
  85. package/components/graphs/line.js.map +1 -1
  86. package/components/graphs/meter.js +13 -12
  87. package/components/graphs/meter.js.map +1 -1
  88. package/components/graphs/pie.js +6 -2
  89. package/components/graphs/pie.js.map +1 -1
  90. package/components/graphs/radar.js.map +1 -1
  91. package/components/graphs/scatter-stacked.js +1 -1
  92. package/components/graphs/scatter-stacked.js.map +1 -1
  93. package/components/graphs/scatter.d.ts +1 -0
  94. package/components/graphs/scatter.js +14 -1
  95. package/components/graphs/scatter.js.map +1 -1
  96. package/components/index.d.ts +3 -0
  97. package/components/index.js +3 -0
  98. package/components/index.js.map +1 -1
  99. package/configuration.d.ts +8 -1
  100. package/configuration.js +20 -3
  101. package/configuration.js.map +1 -1
  102. package/demo/data/bar.d.ts +15 -0
  103. package/demo/data/bar.js +19 -4
  104. package/demo/data/bar.js.map +1 -1
  105. package/demo/data/bundle.js +1 -1
  106. package/demo/data/donut.js.map +1 -1
  107. package/demo/data/index.js +77 -0
  108. package/demo/data/index.js.map +1 -1
  109. package/demo/data/line.js.map +1 -1
  110. package/demo/data/meter.js.map +1 -1
  111. package/demo/data/pie.js.map +1 -1
  112. package/demo/data/radar.js.map +1 -1
  113. package/demo/data/time-series-axis.js +6 -6
  114. package/demo/data/time-series-axis.js.map +1 -1
  115. package/demo/data/zoom-bar.d.ts +74 -0
  116. package/demo/data/zoom-bar.js +91 -0
  117. package/demo/data/zoom-bar.js.map +1 -0
  118. package/demo/styles.css +376 -4
  119. package/demo/styles.css.map +1 -1
  120. package/demo/styles.min.css +1 -1
  121. package/demo/styles.min.css.map +1 -1
  122. package/demo/tsconfig.tsbuildinfo +41 -21
  123. package/interfaces/axis-scales.js.map +1 -1
  124. package/interfaces/charts.d.ts +6 -2
  125. package/interfaces/charts.js.map +1 -1
  126. package/interfaces/components.d.ts +39 -8
  127. package/interfaces/components.js.map +1 -1
  128. package/interfaces/enums.d.ts +7 -0
  129. package/interfaces/enums.js +8 -0
  130. package/interfaces/enums.js.map +1 -1
  131. package/interfaces/events.d.ts +9 -0
  132. package/interfaces/events.js +10 -0
  133. package/interfaces/events.js.map +1 -1
  134. package/model-meter.js +3 -1
  135. package/model-meter.js.map +1 -1
  136. package/model.d.ts +3 -3
  137. package/model.js +10 -9
  138. package/model.js.map +1 -1
  139. package/package.json +1 -1
  140. package/services/essentials/dom-utils.js +9 -3
  141. package/services/essentials/dom-utils.js.map +1 -1
  142. package/services/index.d.ts +1 -0
  143. package/services/index.js +1 -0
  144. package/services/index.js.map +1 -1
  145. package/services/scales-cartesian.d.ts +7 -4
  146. package/services/scales-cartesian.js +27 -12
  147. package/services/scales-cartesian.js.map +1 -1
  148. package/services/zoom.d.ts +5 -0
  149. package/services/zoom.js +73 -0
  150. package/services/zoom.js.map +1 -0
  151. package/styles/components/_grid-brush.scss +18 -0
  152. package/styles/components/_meter-title.scss +5 -1
  153. package/styles/components/_zoom-bar.scss +46 -0
  154. package/styles/components/index.scss +2 -0
  155. package/styles/graphs/_meter.scss +5 -1
  156. package/styles/styles.scss +1 -1
  157. package/styles-g10.css +47 -1
  158. package/styles-g10.css.map +1 -1
  159. package/styles-g10.min.css +1 -1
  160. package/styles-g10.min.css.map +1 -1
  161. package/styles-g100.css +47 -1
  162. package/styles-g100.css.map +1 -1
  163. package/styles-g100.min.css +1 -1
  164. package/styles-g100.min.css.map +1 -1
  165. package/styles-g90.css +47 -1
  166. package/styles-g90.css.map +1 -1
  167. package/styles-g90.min.css +1 -1
  168. package/styles-g90.min.css.map +1 -1
  169. package/styles.css +47 -1
  170. package/styles.css.map +1 -1
  171. package/styles.min.css +1 -1
  172. package/styles.min.css.map +1 -1
  173. package/tsconfig.tsbuildinfo +158 -66
package/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
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
- ## [0.34.7](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.6...v0.34.7) (2020-07-29)
6
+ ## [0.34.11](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.10...v0.34.11) (2020-08-12)
7
7
 
8
8
  **Note:** Version bump only for package @carbon/charts
9
9
 
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- ## [0.34.6](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.5...v0.34.6) (2020-07-27)
14
+ ## [0.34.10](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.9...v0.34.10) (2020-08-11)
15
15
 
16
16
  **Note:** Version bump only for package @carbon/charts
17
17
 
@@ -19,37 +19,56 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
19
19
 
20
20
 
21
21
 
22
- ## [0.34.5](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.4...v0.34.5) (2020-07-22)
23
-
22
+ # Change Log
24
23
 
25
- ### Bug Fixes
24
+ All notable changes to this project will be documented in this file. See
25
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
26
26
 
27
- * fix pie chart alignment ([#716](https://github.com/carbon-design-system/carbon-charts/issues/716)) ([638c331](https://github.com/carbon-design-system/carbon-charts/commit/638c331b7fa8fbc73cf557cf99a6b3af2435b492))
27
+ ## [0.34.9](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.8...v0.34.9) (2020-08-06)
28
28
 
29
+ ### Bug Fixes
29
30
 
31
+ - fix tooltip position with zoom bar enabled
32
+ ([#732](https://github.com/carbon-design-system/carbon-charts/issues/732))
33
+ ([280ab5e](https://github.com/carbon-design-system/carbon-charts/commit/280ab5edb2770c2b30f988b37e72c2c6f40016ff))
30
34
 
35
+ ## [0.34.8](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.7...v0.34.8) (2020-07-30)
31
36
 
37
+ **Note:** Version bump only for package @carbon/charts
32
38
 
33
39
  # Change Log
34
40
 
35
41
  All notable changes to this project will be documented in this file. See
36
42
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
37
43
 
38
- ## [0.34.4](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.3...v0.34.4) (2020-07-21)
44
+ ## [0.34.7](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.6...v0.34.7) (2020-07-29)
39
45
 
40
46
  **Note:** Version bump only for package @carbon/charts
41
47
 
48
+ ## [0.34.6](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.5...v0.34.6) (2020-07-27)
49
+
50
+ **Note:** Version bump only for package @carbon/charts
42
51
 
52
+ ## [0.34.5](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.4...v0.34.5) (2020-07-22)
43
53
 
54
+ ### Bug Fixes
44
55
 
56
+ - fix pie chart alignment
57
+ ([#716](https://github.com/carbon-design-system/carbon-charts/issues/716))
58
+ ([638c331](https://github.com/carbon-design-system/carbon-charts/commit/638c331b7fa8fbc73cf557cf99a6b3af2435b492))
45
59
 
46
- ## [0.34.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.2...v0.34.3) (2020-07-20)
60
+ # Change Log
47
61
 
48
- **Note:** Version bump only for package @carbon/charts
62
+ All notable changes to this project will be documented in this file. See
63
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
49
64
 
65
+ ## [0.34.4](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.3...v0.34.4) (2020-07-21)
50
66
 
67
+ **Note:** Version bump only for package @carbon/charts
51
68
 
69
+ ## [0.34.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.2...v0.34.3) (2020-07-20)
52
70
 
71
+ **Note:** Version bump only for package @carbon/charts
53
72
 
54
73
  ## [0.34.2](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.1...v0.34.2) (2020-07-15)
55
74
 
package/axis-chart.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Chart } from "./chart";
2
- import { ChartConfig, AxisChartOptions } from "./interfaces/index";
3
- import { LayoutComponent, AxisChartsTooltip } from "./components/index";
2
+ import { ChartConfig, AxisChartOptions } from "./interfaces";
3
+ import { LayoutComponent, AxisChartsTooltip } from "./components";
4
4
  export declare class AxisChart extends Chart {
5
5
  services: any;
6
6
  constructor(holder: Element, chartConfigs: ChartConfig<AxisChartOptions>);
package/axis-chart.js CHANGED
@@ -19,21 +19,30 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
19
19
  return r;
20
20
  };
21
21
  import { Chart } from "./chart";
22
- import { LayoutDirection, LayoutGrowth, LegendOrientations, LegendPositions } from "./interfaces/index";
23
- import { LayoutComponent, Legend, Title, AxisChartsTooltip, Spacer } from "./components/index";
22
+ import { LayoutDirection, LayoutGrowth, LegendOrientations, LegendPositions, AxisPositions, ScaleTypes } from "./interfaces";
23
+ import { ChartBrush, ChartClip, LayoutComponent, Legend, Title, AxisChartsTooltip, Spacer, ZoomBar } from "./components";
24
24
  import { Tools } from "./tools";
25
- import { CartesianScales, Curves } from "./services/index";
25
+ import { CartesianScales, Curves, Zoom } from "./services";
26
26
  var AxisChart = /** @class */ (function (_super) {
27
27
  __extends(AxisChart, _super);
28
28
  function AxisChart(holder, chartConfigs) {
29
29
  var _this = _super.call(this, holder, chartConfigs) || this;
30
30
  _this.services = Object.assign(_this.services, {
31
31
  cartesianScales: CartesianScales,
32
- curves: Curves
32
+ curves: Curves,
33
+ zoom: Zoom
33
34
  });
34
35
  return _this;
35
36
  }
36
37
  AxisChart.prototype.getAxisChartComponents = function (graphFrameComponents) {
38
+ var isZoomBarEnabled = Tools.getProperty(this.model.getOptions(), "zoomBar", "top", "enabled");
39
+ this.services.cartesianScales.findDomainAndRangeAxes(); // need to do this before getMainXAxisPosition()
40
+ var mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition();
41
+ var mainXScaleType = Tools.getProperty(this.model.getOptions(), "axes", mainXAxisPosition, "scaleType");
42
+ // @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now
43
+ var zoomBarEnabled = isZoomBarEnabled &&
44
+ mainXAxisPosition === AxisPositions.BOTTOM &&
45
+ mainXScaleType === ScaleTypes.TIME;
37
46
  var titleComponent = {
38
47
  id: "title",
39
48
  components: [new Title(this.model, this.services)],
@@ -50,6 +59,9 @@ var AxisChart = /** @class */ (function (_super) {
50
59
  y: LayoutGrowth.FIXED
51
60
  }
52
61
  };
62
+ if (zoomBarEnabled) {
63
+ graphFrameComponents.push(new ChartClip(this.model, this.services), new ChartBrush(this.model, this.services));
64
+ }
53
65
  var graphFrameComponent = {
54
66
  id: "graph-frame",
55
67
  components: graphFrameComponents,
@@ -105,6 +117,14 @@ var AxisChart = /** @class */ (function (_super) {
105
117
  y: LayoutGrowth.FIXED
106
118
  }
107
119
  };
120
+ var zoomBarComponent = {
121
+ id: "zoom-bar",
122
+ components: [new ZoomBar(this.model, this.services)],
123
+ growth: {
124
+ x: LayoutGrowth.PREFERRED,
125
+ y: LayoutGrowth.FIXED
126
+ }
127
+ };
108
128
  // Add chart title if it exists
109
129
  var topLevelLayoutComponents = [];
110
130
  if (this.model.getOptions().title) {
@@ -119,6 +139,9 @@ var AxisChart = /** @class */ (function (_super) {
119
139
  };
120
140
  topLevelLayoutComponents.push(titleSpacerComponent);
121
141
  }
142
+ if (zoomBarEnabled) {
143
+ topLevelLayoutComponents.push(zoomBarComponent);
144
+ }
122
145
  topLevelLayoutComponents.push(fullFrameComponent);
123
146
  return [
124
147
  new AxisChartsTooltip(this.model, this.services),
package/axis-chart.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"axis-chart.js","sourceRoot":"","sources":["axis-chart.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EACN,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EAGf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,eAAe,EACf,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,MAAM,EACN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,SAA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eAAe,CAAC,MAAM;aACjC,CACD;SACD,CAAC;IACH,CAAC;IACF,gBAAC;AAAD,CAAC,AAvID,CAA+B,KAAK,GAuInC","sourcesContent":["import { Chart } from \"./chart\";\nimport {\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLegendOrientations,\n\tLegendPositions,\n\tChartConfig,\n\tAxisChartOptions\n} from \"./interfaces/index\";\nimport {\n\tLayoutComponent,\n\tLegend,\n\tTitle,\n\tAxisChartsTooltip,\n\tSpacer\n} from \"./components/index\";\nimport { Tools } from \"./tools\";\n\nimport { CartesianScales, Curves } from \"./services/index\";\n\nexport class AxisChart extends Chart {\n\tservices: any = Object.assign(this.services, {\n\t\tcartesianScales: CartesianScales,\n\t\tcurves: Curves\n\t});\n\n\tconstructor(holder: Element, chartConfigs: ChartConfig<AxisChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\t}\n\n\tprotected getAxisChartComponents(graphFrameComponents: any[]) {\n\t\tconst titleComponent = {\n\t\t\tid: \"title\",\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\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: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tconst graphFrameComponent = {\n\t\t\tid: \"graph-frame\",\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\t// if the chart is loading but has data, don't enable legend until loading is false\n\t\tconst isDataLoading = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t\"data\",\n\t\t\t\"loading\"\n\t\t);\n\t\tconst isLegendEnabled =\n\t\t\tthis.model.getOptions().legend.enabled !== false && !isDataLoading;\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: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\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: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\t// Add chart title if it exists\n\t\tconst topLevelLayoutComponents = [];\n\t\tif (this.model.getOptions().title) {\n\t\t\ttopLevelLayoutComponents.push(titleComponent);\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: \"spacer\",\n\t\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\t\tgrowth: {\n\t\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t\t}\n\t\t\t};\n\n\t\t\ttopLevelLayoutComponents.push(titleSpacerComponent);\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 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,EACN,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EAGf,aAAa,EACb,UAAU,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,UAAU,EACV,SAAS,EACT,eAAe,EACf,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,MAAM,EACN,OAAO,EACP,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC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ent":["import { Chart } from \"./chart\";\nimport {\n\tLayoutDirection,\n\tLayoutGrowth,\n\tLegendOrientations,\n\tLegendPositions,\n\tChartConfig,\n\tAxisChartOptions,\n\tAxisPositions,\n\tScaleTypes\n} from \"./interfaces\";\nimport {\n\tChartBrush,\n\tChartClip,\n\tLayoutComponent,\n\tLegend,\n\tTitle,\n\tAxisChartsTooltip,\n\tSpacer,\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\n\tconstructor(holder: Element, chartConfigs: ChartConfig<AxisChartOptions>) {\n\t\tsuper(holder, chartConfigs);\n\t}\n\n\tprotected getAxisChartComponents(graphFrameComponents: any[]) {\n\t\tconst isZoomBarEnabled = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t\"zoomBar\",\n\t\t\t\"top\",\n\t\t\t\"enabled\"\n\t\t);\n\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes(); // need to do this before getMainXAxisPosition()\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition();\n\t\tconst mainXScaleType = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\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\tconst titleComponent = {\n\t\t\tid: \"title\",\n\t\t\tcomponents: [new Title(this.model, this.services)],\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\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: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\tif (zoomBarEnabled) {\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\tconst graphFrameComponent = {\n\t\t\tid: \"graph-frame\",\n\t\t\tcomponents: graphFrameComponents,\n\t\t\tgrowth: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\t// if the chart is loading but has data, don't enable legend until loading is false\n\t\tconst isDataLoading = Tools.getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t\"data\",\n\t\t\t\"loading\"\n\t\t);\n\t\tconst isLegendEnabled =\n\t\t\tthis.model.getOptions().legend.enabled !== false && !isDataLoading;\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: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\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: {\n\t\t\t\tx: LayoutGrowth.STRETCH,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\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: {\n\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t}\n\t\t};\n\n\t\t// Add chart title if it exists\n\t\tconst topLevelLayoutComponents = [];\n\t\tif (this.model.getOptions().title) {\n\t\t\ttopLevelLayoutComponents.push(titleComponent);\n\n\t\t\tconst titleSpacerComponent = {\n\t\t\t\tid: \"spacer\",\n\t\t\t\tcomponents: [new Spacer(this.model, this.services)],\n\t\t\t\tgrowth: {\n\t\t\t\t\tx: LayoutGrowth.PREFERRED,\n\t\t\t\t\ty: LayoutGrowth.FIXED\n\t\t\t\t}\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 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"]}
@@ -68,6 +68,21 @@ export declare const simpleBarOptions: {
68
68
  };
69
69
  };
70
70
  };
71
+ export declare const simpleBarCustomLegendOrderOptions: {
72
+ title: string;
73
+ axes: {
74
+ left: {
75
+ mapsTo: string;
76
+ };
77
+ bottom: {
78
+ mapsTo: string;
79
+ scaleType: string;
80
+ };
81
+ };
82
+ legend: {
83
+ order: string[];
84
+ };
85
+ };
71
86
  export declare const simpleBarDataCustomTicks: {
72
87
  group: string;
73
88
  value: number;
@@ -0,0 +1,74 @@
1
+ export declare const zoomBarStackedAreaTimeSeriesData: {
2
+ group: string;
3
+ date: Date;
4
+ value: number;
5
+ }[];
6
+ export declare const zoomBarStackedAreaTimeSeriesOptions: any;
7
+ export declare const zoomBarSimpleBarTimeSeriesData: {
8
+ group: string;
9
+ date: Date;
10
+ value: number;
11
+ }[];
12
+ export declare const zoomBarSimpleBarTimeSeriesOptions: any;
13
+ export declare const zoomBarStackedBarTimeSeriesData: {
14
+ group: string;
15
+ date: Date;
16
+ value: number;
17
+ }[];
18
+ export declare const zoomBarStackedBarTimeSeriesOptions: any;
19
+ export declare const definedZoomBarStackedBarTimeSeriesData: {
20
+ group: string;
21
+ date: Date;
22
+ value: number;
23
+ }[];
24
+ export declare const definedZoomBarStackedBarTimeSeriesOptions: any;
25
+ export declare const zoomBarBubbleTimeSeriesData: ({
26
+ group: string;
27
+ date: Date;
28
+ value: number;
29
+ } & {
30
+ surplus: number;
31
+ })[];
32
+ export declare const zoomBarBubbleTimeSeriesOptions: any;
33
+ export declare const zoomBarLineTimeSeriesData: {
34
+ group: string;
35
+ date: Date;
36
+ value: number;
37
+ }[];
38
+ export declare const zoomBarLineTimeSeriesOptions: any;
39
+ export declare const zoomBarScatterTimeSeriesData: {
40
+ group: string;
41
+ date: Date;
42
+ value: number;
43
+ }[];
44
+ export declare const zoomBarScatterTimeSeriesOptions: any;
45
+ export declare const zoomBarStepTimeSeriesData: {
46
+ group: string;
47
+ date: Date;
48
+ value: number;
49
+ }[];
50
+ export declare const zoomBarStepTimeSeriesOptions: any;
51
+ export declare const zoomBarLineTimeSeries15secondsData: {
52
+ labels: string[];
53
+ datasets: {
54
+ label: string;
55
+ data: {
56
+ date: Date;
57
+ value: number;
58
+ }[];
59
+ }[];
60
+ };
61
+ export declare const zoomBarLineTimeSeries15secondsOptions: any;
62
+ export declare const zoomBarLineTimeSeriesInitDomainData: {
63
+ labels: string[];
64
+ datasets: {
65
+ label: string;
66
+ data: {
67
+ date: Date;
68
+ value: number;
69
+ }[];
70
+ }[];
71
+ };
72
+ export declare const zoomBarLineTimeSeriesInitDomainOptions: any;
73
+ export declare const zoomBarSkeletonData: any[];
74
+ export declare const zoomBarSkeletonOptions: any;
@@ -1,6 +1,6 @@
1
1
  import { Chart } from "./chart";
2
- import { ChartConfig, AxisChartOptions } from "./interfaces/index";
3
- import { LayoutComponent, AxisChartsTooltip } from "./components/index";
2
+ import { ChartConfig, AxisChartOptions } from "./interfaces";
3
+ import { LayoutComponent, AxisChartsTooltip } from "./components";
4
4
  export declare class AxisChart extends Chart {
5
5
  services: any;
6
6
  constructor(holder: Element, chartConfigs: ChartConfig<AxisChartOptions>);
@@ -6,7 +6,11 @@ export declare class Axis extends Component {
6
6
  margins: any;
7
7
  scale: any;
8
8
  scaleType: ScaleTypes;
9
+ zoomDomainChanging: boolean;
9
10
  constructor(model: ChartModel, services: any, configs?: any);
11
+ init(): void;
12
+ handleZoomBarSelectionStart: () => void;
13
+ handleZoomBarSelectionEnd: () => void;
10
14
  render(animate?: boolean): void;
11
15
  addEventListeners(): void;
12
16
  getInvisibleAxisRef(): any;
@@ -0,0 +1,11 @@
1
+ import { Component } from "../component";
2
+ import { ChartModel } from "../../model";
3
+ export declare class ChartClip extends Component {
4
+ type: string;
5
+ chartClipId: string;
6
+ chartClipPath: any;
7
+ constructor(model: ChartModel, services: any, configs?: any);
8
+ init(): void;
9
+ render(animate?: boolean): void;
10
+ createClipPath(): void;
11
+ }
@@ -0,0 +1,8 @@
1
+ import { Component } from "../component";
2
+ export declare class ChartBrush extends Component {
3
+ static DASH_LENGTH: number;
4
+ type: string;
5
+ selectionSelector: string;
6
+ frontSelectionSelector: string;
7
+ render(animate?: boolean): void;
8
+ }
@@ -0,0 +1,21 @@
1
+ import { Component } from "../component";
2
+ export declare class ZoomBar extends Component {
3
+ type: string;
4
+ MIN_SELECTION_DIFF: number;
5
+ brushSelector: string;
6
+ maxSelectionRange: [0, 0];
7
+ clipId: string;
8
+ brush: import("d3-brush").BrushBehavior<unknown>;
9
+ xScale: any;
10
+ yScale: any;
11
+ init(): void;
12
+ render(animate?: boolean): void;
13
+ addBrushEventListener(zoomDomain: any, axesLeftMargin: any, width: any): void;
14
+ handleBrushedEvent(zoomDomain: any, scale: any, selection: any): void;
15
+ updateBrushHandle(svg: any, selection: any, domain: any): void;
16
+ updateSliderSelectedArea(selection: any): void;
17
+ renderZoomBarArea(container: any, querySelector: any, data: any, clipId: any): void;
18
+ updateClipPath(svg: any, clipId: any, x: any, y: any, width: any, height: any): void;
19
+ compensateDataForDefaultDomain(data: any, defaultDomain: any): void;
20
+ destroy(): void;
21
+ }
@@ -13,5 +13,7 @@ export declare class Component {
13
13
  setServices(newObj: any): void;
14
14
  setParent(parent: any): void;
15
15
  getParent(): any;
16
- getContainerSVG(): any;
16
+ getContainerSVG(configs?: {
17
+ withinChartClip: boolean;
18
+ }): any;
17
19
  }
@@ -2,6 +2,7 @@ import { Component } from "../component";
2
2
  export declare class Legend extends Component {
3
3
  type: string;
4
4
  render(): void;
5
+ sortDataGroups(dataGroups: any, legendOrder: any): any;
5
6
  breakItemsIntoLines(addedLegendItems: any): void;
6
7
  addEventListeners(): void;
7
8
  }
@@ -1,4 +1,5 @@
1
1
  import { Component } from "../component";
2
2
  export declare class Bar extends Component {
3
3
  protected getBarWidth(allDataLabels?: string[]): number;
4
+ protected isOutsideZoomedDomain(x0: number, x1: number): boolean;
4
5
  }
@@ -3,6 +3,7 @@ import { Selection } from "d3-selection";
3
3
  export declare class Scatter extends Component {
4
4
  type: string;
5
5
  init(): void;
6
+ filterBasedOnZoomDomain(data: any): any;
6
7
  render(animate: boolean): void;
7
8
  isDatapointThresholdAnomaly(datum: any, index: number): boolean;
8
9
  styleCircles(selection: Selection<any, any, any, any>, animate: boolean): void;
@@ -22,7 +22,10 @@ export * from "./layout/spacer";
22
22
  export * from "./layout/layout";
23
23
  export * from "./axes/two-dimensional-axes";
24
24
  export * from "./axes/axis";
25
+ export * from "./axes/grid-brush";
26
+ export * from "./axes/chart-clip";
25
27
  export * from "./axes/grid";
26
28
  export * from "./axes/ruler";
27
29
  export * from "./axes/ruler-stacked-bar";
28
30
  export * from "./axes/zero-line";
31
+ export * from "./axes/zoom-bar";
@@ -1,4 +1,4 @@
1
- import { BaseChartOptions, AxisChartOptions, ScatterChartOptions, LineChartOptions, BarChartOptions, StackedBarChartOptions, AreaChartOptions, PieChartOptions, GaugeChartOptions, DonutChartOptions, BubbleChartOptions, RadarChartOptions, GridOptions, TimeScaleOptions, TooltipOptions, LegendOptions, MeterChartOptions } from "./interfaces";
1
+ import { BaseChartOptions, AxisChartOptions, ScatterChartOptions, LineChartOptions, BarChartOptions, StackedBarChartOptions, AreaChartOptions, PieChartOptions, GaugeChartOptions, DonutChartOptions, BubbleChartOptions, RadarChartOptions, GridOptions, TimeScaleOptions, TooltipOptions, LegendOptions, MeterChartOptions, ZoomBarTypes } from "./interfaces";
2
2
  /**
3
3
  * Legend options
4
4
  */
@@ -88,5 +88,12 @@ export declare const spacers: {
88
88
  size: number;
89
89
  };
90
90
  };
91
+ export declare const zoomBar: {
92
+ height: {
93
+ [ZoomBarTypes.GRAPH_VIEW]: number;
94
+ [ZoomBarTypes.SLIDER_VIEW]: number;
95
+ };
96
+ spacerHeight: number;
97
+ };
91
98
  export declare const tickSpaceRatioVertical = 2.5;
92
99
  export declare const tickSpaceRatioHorizontal = 3.5;
@@ -1,5 +1,5 @@
1
1
  import { GaugeTypes, Statuses, ArrowDirections, Alignments } from "./enums";
2
- import { LegendOptions, TooltipOptions, GridOptions, AxesOptions } from "./index";
2
+ import { LegendOptions, TooltipOptions, GridOptions, AxesOptions, ZoomBarsOptions } from "./index";
3
3
  import { BarOptions, StackedBarOptions } from "./components";
4
4
  import { TimeScaleOptions } from "./axis-scales";
5
5
  /**
@@ -66,7 +66,7 @@ export interface BaseChartOptions {
66
66
  /**
67
67
  * used to simulate data loading
68
68
  */
69
- loading?: Boolean;
69
+ loading?: boolean;
70
70
  /**
71
71
  * options related to pre-selected data groups
72
72
  * Remains empty if every legend item is active or dataset doesn't have the data groups.
@@ -90,6 +90,10 @@ export interface AxisChartOptions extends BaseChartOptions {
90
90
  axes?: AxesOptions;
91
91
  grid?: GridOptions;
92
92
  timeScale?: TimeScaleOptions;
93
+ /**
94
+ * zoombar configuration
95
+ */
96
+ zoomBar?: ZoomBarsOptions;
93
97
  }
94
98
  /**
95
99
  * options specific to bar charts
@@ -1,4 +1,4 @@
1
- import { LayoutGrowth, LegendPositions, Alignments } from "./enums";
1
+ import { LayoutGrowth, LegendPositions, Alignments, ZoomBarTypes } from "./enums";
2
2
  import { Component } from "../components/component";
3
3
  import { TruncationOptions } from "./truncation";
4
4
  /**
@@ -34,19 +34,20 @@ export interface LegendOptions {
34
34
  clickable?: boolean;
35
35
  items?: {
36
36
  status?: {
37
- ACTIVE?: Number;
38
- DISABLED?: Number;
37
+ ACTIVE?: number;
38
+ DISABLED?: number;
39
39
  };
40
- horizontalSpace?: Number;
41
- verticalSpace?: Number;
42
- textYOffset?: Number;
40
+ horizontalSpace?: number;
41
+ verticalSpace?: number;
42
+ textYOffset?: number;
43
43
  };
44
44
  checkbox?: {
45
- radius?: Number;
46
- spaceAfter?: Number;
45
+ radius?: number;
46
+ spaceAfter?: number;
47
47
  };
48
48
  truncation?: TruncationOptions;
49
49
  alignment?: Alignments;
50
+ order?: string[];
50
51
  }
51
52
  export interface TooltipOptions {
52
53
  /**
@@ -105,3 +106,33 @@ export interface BarOptions {
105
106
  export interface StackedBarOptions extends BarOptions {
106
107
  dividerSize?: number;
107
108
  }
109
+ /**
110
+ * customize the ZoomBars in a chart
111
+ */
112
+ export interface ZoomBarsOptions {
113
+ /**
114
+ * currently only the top position is supported
115
+ */
116
+ top?: ZoomBarOptions;
117
+ }
118
+ /**
119
+ * customize the ZoomBar component
120
+ */
121
+ export interface ZoomBarOptions {
122
+ /**
123
+ * is the zoom-bar visible or not
124
+ */
125
+ enabled?: boolean;
126
+ /**
127
+ * whether the zoom bar is showing a slider view or a graph view etc.
128
+ */
129
+ type?: ZoomBarTypes;
130
+ /**
131
+ * an two element array which represents the initial zoom domain
132
+ */
133
+ initialZoomDomain?: Object[];
134
+ /**
135
+ * options related to zoom bar data
136
+ */
137
+ data?: Object[];
138
+ }
@@ -18,6 +18,13 @@ export declare enum AxisPositions {
18
18
  TOP = "top",
19
19
  BOTTOM = "bottom"
20
20
  }
21
+ /**
22
+ * enum of all possible axis positions
23
+ */
24
+ export declare enum ZoomBarTypes {
25
+ GRAPH_VIEW = "graph_view",
26
+ SLIDER_VIEW = "slider_view"
27
+ }
21
28
  /**
22
29
  * enum of all possible truncation types
23
30
  */
@@ -13,6 +13,15 @@ export declare enum Chart {
13
13
  export declare enum Model {
14
14
  UPDATE = "model-update"
15
15
  }
16
+ /**
17
+ * enum of all events related to the zoom-bar
18
+ */
19
+ export declare enum ZoomBar {
20
+ UPDATE = "zoom-bar-update",
21
+ SELECTION_START = "zoom-bar-selection-start",
22
+ SELECTION_IN_PROGRESS = "zoom-bar-selection-in-progress",
23
+ SELECTION_END = "zoom-bar-selection-end"
24
+ }
16
25
  /**
17
26
  * enum of all axis-related events
18
27
  */
@@ -40,7 +40,7 @@ export declare class ChartModel {
40
40
  * @return {Object} The chart's options
41
41
  */
42
42
  getOptions(): any;
43
- set(newState: any, skipUpdate?: boolean): void;
43
+ set(newState: any, configs?: any): void;
44
44
  get(property?: string): any;
45
45
  /**
46
46
  *
@@ -52,7 +52,7 @@ export declare class ChartModel {
52
52
  * Updates miscellanous information within the model
53
53
  * such as the color scales, or the legend data labels
54
54
  */
55
- update(): void;
55
+ update(animate?: boolean): void;
56
56
  setUpdateCallback(cb: Function): void;
57
57
  toggleDataLabel(changedLabel: string): void;
58
58
  /**
@@ -80,7 +80,7 @@ export declare class ChartModel {
80
80
  protected updateAllDataGroups(): void;
81
81
  protected generateDataGroups(data: any): {
82
82
  name: string;
83
- status: Number;
83
+ status: number;
84
84
  }[];
85
85
  protected setColorScale(): void;
86
86
  }
@@ -3,3 +3,4 @@ export * from "./essentials/events";
3
3
  export * from "./essentials/transitions";
4
4
  export * from "./scales-cartesian";
5
5
  export * from "./curves";
6
+ export * from "./zoom";
@@ -1,5 +1,5 @@
1
1
  import { Service } from "./service";
2
- import { AxisPositions, CartesianOrientations, ThresholdOptions } from "../interfaces";
2
+ import { AxisPositions, CartesianOrientations, ScaleTypes, ThresholdOptions } from "../interfaces";
3
3
  export declare class CartesianScales extends Service {
4
4
  protected scaleTypes: {
5
5
  top: any;
@@ -35,9 +35,12 @@ export declare class CartesianScales extends Service {
35
35
  getMainYAxisPosition(): AxisPositions;
36
36
  getMainXScale(): any;
37
37
  getMainYScale(): any;
38
- getValueFromScale(axisPosition: AxisPositions, datum: any, index?: number): any;
38
+ getValueFromScale(scale: any, scaleType: ScaleTypes, axisPosition: AxisPositions, datum: any, index?: number): any;
39
+ getValueThroughAxisPosition(axisPosition: AxisPositions, datum: any, index?: number): any;
39
40
  getDomainValue(d: any, i: any): any;
40
41
  getRangeValue(d: any, i: any): any;
42
+ getMainXScaleType(): any;
43
+ getMainYScaleType(): any;
41
44
  getDomainIdentifier(): any;
42
45
  getRangeIdentifier(): any;
43
46
  /** Uses the Y Axis to get data items associated with that value. */
@@ -51,11 +54,11 @@ export declare class CartesianScales extends Service {
51
54
  };
52
55
  protected getScaleDomain(axisPosition: AxisPositions): any;
53
56
  protected createScale(axisPosition: AxisPositions): any;
54
- getHighestDomainThreshold(): null | {
57
+ protected getHighestDomainThreshold(): null | {
55
58
  threshold: ThresholdOptions;
56
59
  scaleValue: number;
57
60
  };
58
- getHighestRangeThreshold(): null | {
61
+ protected getHighestRangeThreshold(): null | {
59
62
  threshold: ThresholdOptions;
60
63
  scaleValue: number;
61
64
  };
@@ -0,0 +1,5 @@
1
+ import { Service } from "./service";
2
+ export declare class Zoom extends Service {
3
+ getZoomBarData(): {}[];
4
+ getDefaultZoomBarDomain(): any;
5
+ }