@carbon/charts 0.34.7 → 0.34.8

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 (162) hide show
  1. package/CHANGELOG.md +11 -17
  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/zoom-bar.d.ts +74 -0
  6. package/build/src/axis-chart.d.ts +2 -2
  7. package/build/src/components/axes/axis.d.ts +4 -0
  8. package/build/src/components/axes/chart-clip.d.ts +11 -0
  9. package/build/src/components/axes/grid-brush.d.ts +8 -0
  10. package/build/src/components/axes/zoom-bar.d.ts +20 -0
  11. package/build/src/components/component.d.ts +3 -1
  12. package/build/src/components/graphs/bar.d.ts +1 -0
  13. package/build/src/components/graphs/scatter.d.ts +1 -0
  14. package/build/src/components/index.d.ts +3 -0
  15. package/build/src/configuration.d.ts +4 -0
  16. package/build/src/interfaces/charts.d.ts +5 -1
  17. package/build/src/interfaces/components.d.ts +26 -0
  18. package/build/src/interfaces/events.d.ts +9 -0
  19. package/build/src/model.d.ts +2 -2
  20. package/build/src/services/index.d.ts +1 -0
  21. package/build/src/services/scales-cartesian.d.ts +7 -4
  22. package/build/src/services/zoom.d.ts +5 -0
  23. package/bundle.js +1 -1
  24. package/chart.js +5 -4
  25. package/chart.js.map +1 -1
  26. package/charts/area-stacked.js.map +1 -1
  27. package/charts/area.js.map +1 -1
  28. package/charts/bar-grouped.js.map +1 -1
  29. package/charts/bar-simple.js.map +1 -1
  30. package/charts/bar-stacked.js.map +1 -1
  31. package/charts/bubble.js.map +1 -1
  32. package/charts/donut.js.map +1 -1
  33. package/charts/line.js.map +1 -1
  34. package/charts/meter.js +7 -15
  35. package/charts/meter.js.map +1 -1
  36. package/charts/pie.js.map +1 -1
  37. package/charts/radar.js +3 -1
  38. package/charts/radar.js.map +1 -1
  39. package/charts/scatter.js.map +1 -1
  40. package/components/axes/axis.d.ts +4 -0
  41. package/components/axes/axis.js +33 -2
  42. package/components/axes/axis.js.map +1 -1
  43. package/components/axes/chart-clip.d.ts +11 -0
  44. package/components/axes/chart-clip.js +59 -0
  45. package/components/axes/chart-clip.js.map +1 -0
  46. package/components/axes/grid-brush.d.ts +8 -0
  47. package/components/axes/grid-brush.js +163 -0
  48. package/components/axes/grid-brush.js.map +1 -0
  49. package/components/axes/two-dimensional-axes.js +4 -0
  50. package/components/axes/two-dimensional-axes.js.map +1 -1
  51. package/components/axes/zoom-bar.d.ts +20 -0
  52. package/components/axes/zoom-bar.js +312 -0
  53. package/components/axes/zoom-bar.js.map +1 -0
  54. package/components/component.d.ts +3 -1
  55. package/components/component.js +11 -2
  56. package/components/component.js.map +1 -1
  57. package/components/essentials/legend.js.map +1 -1
  58. package/components/essentials/title-meter.js +28 -17
  59. package/components/essentials/title-meter.js.map +1 -1
  60. package/components/essentials/title.js +2 -1
  61. package/components/essentials/title.js.map +1 -1
  62. package/components/essentials/tooltip-axis.js +4 -1
  63. package/components/essentials/tooltip-axis.js.map +1 -1
  64. package/components/graphs/area-stacked.js +1 -1
  65. package/components/graphs/area-stacked.js.map +1 -1
  66. package/components/graphs/area.js +1 -1
  67. package/components/graphs/area.js.map +1 -1
  68. package/components/graphs/bar-grouped.js +5 -1
  69. package/components/graphs/bar-grouped.js.map +1 -1
  70. package/components/graphs/bar-simple.js +5 -1
  71. package/components/graphs/bar-simple.js.map +1 -1
  72. package/components/graphs/bar-stacked.js +5 -1
  73. package/components/graphs/bar-stacked.js.map +1 -1
  74. package/components/graphs/bar.d.ts +1 -0
  75. package/components/graphs/bar.js +16 -1
  76. package/components/graphs/bar.js.map +1 -1
  77. package/components/graphs/line.js +1 -1
  78. package/components/graphs/line.js.map +1 -1
  79. package/components/graphs/meter.js +13 -12
  80. package/components/graphs/meter.js.map +1 -1
  81. package/components/graphs/pie.js +6 -2
  82. package/components/graphs/pie.js.map +1 -1
  83. package/components/graphs/radar.js.map +1 -1
  84. package/components/graphs/scatter-stacked.js +1 -1
  85. package/components/graphs/scatter-stacked.js.map +1 -1
  86. package/components/graphs/scatter.d.ts +1 -0
  87. package/components/graphs/scatter.js +14 -1
  88. package/components/graphs/scatter.js.map +1 -1
  89. package/components/index.d.ts +3 -0
  90. package/components/index.js +3 -0
  91. package/components/index.js.map +1 -1
  92. package/configuration.d.ts +4 -0
  93. package/configuration.js +10 -1
  94. package/configuration.js.map +1 -1
  95. package/demo/data/bar.js +4 -4
  96. package/demo/data/bar.js.map +1 -1
  97. package/demo/data/bundle.js +1 -1
  98. package/demo/data/donut.js.map +1 -1
  99. package/demo/data/index.js +72 -0
  100. package/demo/data/index.js.map +1 -1
  101. package/demo/data/line.js.map +1 -1
  102. package/demo/data/meter.js.map +1 -1
  103. package/demo/data/pie.js.map +1 -1
  104. package/demo/data/radar.js.map +1 -1
  105. package/demo/data/time-series-axis.js +6 -6
  106. package/demo/data/time-series-axis.js.map +1 -1
  107. package/demo/data/zoom-bar.d.ts +74 -0
  108. package/demo/data/zoom-bar.js +77 -0
  109. package/demo/data/zoom-bar.js.map +1 -0
  110. package/demo/styles.css +352 -4
  111. package/demo/styles.css.map +1 -1
  112. package/demo/styles.min.css +1 -1
  113. package/demo/styles.min.css.map +1 -1
  114. package/demo/tsconfig.tsbuildinfo +38 -18
  115. package/interfaces/axis-scales.js.map +1 -1
  116. package/interfaces/charts.d.ts +5 -1
  117. package/interfaces/charts.js.map +1 -1
  118. package/interfaces/components.d.ts +26 -0
  119. package/interfaces/components.js.map +1 -1
  120. package/interfaces/events.d.ts +9 -0
  121. package/interfaces/events.js +10 -0
  122. package/interfaces/events.js.map +1 -1
  123. package/model-meter.js +3 -1
  124. package/model-meter.js.map +1 -1
  125. package/model.d.ts +2 -2
  126. package/model.js +10 -8
  127. package/model.js.map +1 -1
  128. package/package.json +1 -1
  129. package/services/essentials/dom-utils.js +9 -3
  130. package/services/essentials/dom-utils.js.map +1 -1
  131. package/services/index.d.ts +1 -0
  132. package/services/index.js +1 -0
  133. package/services/index.js.map +1 -1
  134. package/services/scales-cartesian.d.ts +7 -4
  135. package/services/scales-cartesian.js +27 -12
  136. package/services/scales-cartesian.js.map +1 -1
  137. package/services/zoom.d.ts +5 -0
  138. package/services/zoom.js +73 -0
  139. package/services/zoom.js.map +1 -0
  140. package/styles/components/_grid-brush.scss +18 -0
  141. package/styles/components/_meter-title.scss +5 -1
  142. package/styles/components/_zoom-bar.scss +38 -0
  143. package/styles/components/index.scss +2 -0
  144. package/styles/graphs/_meter.scss +5 -1
  145. package/styles/styles.scss +1 -1
  146. package/styles-g10.css +41 -1
  147. package/styles-g10.css.map +1 -1
  148. package/styles-g10.min.css +1 -1
  149. package/styles-g10.min.css.map +1 -1
  150. package/styles-g100.css +41 -1
  151. package/styles-g100.css.map +1 -1
  152. package/styles-g100.min.css +1 -1
  153. package/styles-g100.min.css.map +1 -1
  154. package/styles-g90.css +41 -1
  155. package/styles-g90.css.map +1 -1
  156. package/styles-g90.min.css +1 -1
  157. package/styles-g90.min.css.map +1 -1
  158. package/styles.css +41 -1
  159. package/styles.css.map +1 -1
  160. package/styles.min.css +1 -1
  161. package/styles.min.css.map +1 -1
  162. package/tsconfig.tsbuildinfo +153 -62
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.8](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.7...v0.34.8) (2020-07-30)
7
7
 
8
8
  **Note:** Version bump only for package @carbon/charts
9
9
 
@@ -11,24 +11,26 @@ 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
+ # Change Log
15
15
 
16
- **Note:** Version bump only for package @carbon/charts
16
+ All notable changes to this project will be documented in this file. See
17
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
17
18
 
19
+ ## [0.34.7](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.6...v0.34.7) (2020-07-29)
18
20
 
21
+ **Note:** Version bump only for package @carbon/charts
19
22
 
23
+ ## [0.34.6](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.5...v0.34.6) (2020-07-27)
20
24
 
25
+ **Note:** Version bump only for package @carbon/charts
21
26
 
22
27
  ## [0.34.5](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.4...v0.34.5) (2020-07-22)
23
28
 
24
-
25
29
  ### Bug Fixes
26
30
 
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))
28
-
29
-
30
-
31
-
31
+ - fix pie chart alignment
32
+ ([#716](https://github.com/carbon-design-system/carbon-charts/issues/716))
33
+ ([638c331](https://github.com/carbon-design-system/carbon-charts/commit/638c331b7fa8fbc73cf557cf99a6b3af2435b492))
32
34
 
33
35
  # Change Log
34
36
 
@@ -39,18 +41,10 @@ All notable changes to this project will be documented in this file. See
39
41
 
40
42
  **Note:** Version bump only for package @carbon/charts
41
43
 
42
-
43
-
44
-
45
-
46
44
  ## [0.34.3](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.2...v0.34.3) (2020-07-20)
47
45
 
48
46
  **Note:** Version bump only for package @carbon/charts
49
47
 
50
-
51
-
52
-
53
-
54
48
  ## [0.34.2](https://github.com/carbon-design-system/carbon-charts/compare/v0.34.1...v0.34.2) (2020-07-15)
55
49
 
56
50
  **Note:** Version bump only for package @carbon/charts
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,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ACC,SAAS,EAAE,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,SA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,GAgLnC","sourcesContent":["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"]}
@@ -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,20 @@
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
+ renderZoomBarArea(container: any, querySelector: any, data: any, clipId: any): void;
17
+ updateClipPath(svg: any, clipId: any, x: any, y: any, width: any, height: any): void;
18
+ compensateDataForDefaultDomain(data: any, defaultDomain: any): void;
19
+ destroy(): void;
20
+ }
@@ -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
  }
@@ -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";
@@ -88,5 +88,9 @@ export declare const spacers: {
88
88
  size: number;
89
89
  };
90
90
  };
91
+ export declare const zoomBar: {
92
+ height: number;
93
+ spacerHeight: number;
94
+ };
91
95
  export declare const tickSpaceRatioVertical = 2.5;
92
96
  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
  /**
@@ -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
@@ -105,3 +105,29 @@ export interface BarOptions {
105
105
  export interface StackedBarOptions extends BarOptions {
106
106
  dividerSize?: number;
107
107
  }
108
+ /**
109
+ * customize the ZoomBars in a chart
110
+ */
111
+ export interface ZoomBarsOptions {
112
+ /**
113
+ * currently only the top position is supported
114
+ */
115
+ top?: ZoomBarOptions;
116
+ }
117
+ /**
118
+ * customize the ZoomBar component
119
+ */
120
+ export interface ZoomBarOptions {
121
+ /**
122
+ * is the zoom-bar visible or not
123
+ */
124
+ enabled?: boolean;
125
+ /**
126
+ * an two element array which represents the initial zoom domain
127
+ */
128
+ initialZoomDomain?: Object[];
129
+ /**
130
+ * options related to zoom bar data
131
+ */
132
+ data?: Object[];
133
+ }
@@ -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
  /**
@@ -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
+ }