@nova-ui/charts 12.0.14-3714 → 12.0.14-3732

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 (171) hide show
  1. package/README.md +35 -30
  2. package/bundles/nova-ui-charts.umd.js +566 -1217
  3. package/bundles/nova-ui-charts.umd.js.map +1 -1
  4. package/core/chart-assists/chart-assist.d.ts +9 -9
  5. package/core/chart.d.ts +1 -1
  6. package/core/plugins/chart-donut-content-plugin.d.ts +2 -2
  7. package/esm2015/chart/chart.component.js +6 -14
  8. package/esm2015/chart-collection/chart-collection-id.directive.js +2 -4
  9. package/esm2015/chart-collection/chart-collection.service.js +1 -1
  10. package/esm2015/chart-donut-content/chart-donut-content.component.js +6 -7
  11. package/esm2015/chart-marker/chart-marker.component.js +7 -14
  12. package/esm2015/chart-popover/chart-popover.component.js +3 -4
  13. package/esm2015/chart-tooltips/chart-tooltip.component.js +6 -4
  14. package/esm2015/chart-tooltips/chart-tooltip.directive.js +3 -3
  15. package/esm2015/chart-tooltips/chart-tooltips.component.js +12 -17
  16. package/esm2015/charts.module.js +12 -4
  17. package/esm2015/constants.js +1 -1
  18. package/esm2015/core/chart-assists/chart-assist.js +33 -52
  19. package/esm2015/core/chart-assists/spark-chart-assist.js +6 -13
  20. package/esm2015/core/chart-assists/types.js +1 -1
  21. package/esm2015/core/chart-collection.js +5 -15
  22. package/esm2015/core/chart.js +13 -19
  23. package/esm2015/core/common/chart-plugin.js +1 -1
  24. package/esm2015/core/common/data-manager.js +9 -11
  25. package/esm2015/core/common/data-series.js +2 -3
  26. package/esm2015/core/common/event-bus.js +1 -1
  27. package/esm2015/core/common/lasagna.js +7 -10
  28. package/esm2015/core/common/mouse-interactive-area.js +7 -21
  29. package/esm2015/core/common/palette/chart-palette.js +2 -5
  30. package/esm2015/core/common/palette/mapped-value-provider.js +3 -2
  31. package/esm2015/core/common/palette/markers/path-marker.js +4 -4
  32. package/esm2015/core/common/palette/markers/svg-marker.js +2 -4
  33. package/esm2015/core/common/palette/palettes.js +7 -5
  34. package/esm2015/core/common/palette/processed-color-provider.js +1 -1
  35. package/esm2015/core/common/palette/sequential-chart-marker-provider.js +1 -1
  36. package/esm2015/core/common/palette/sequential-color-provider.js +1 -1
  37. package/esm2015/core/common/palette/sequential-value-provider.js +1 -1
  38. package/esm2015/core/common/palette/text-color-provider.js +2 -4
  39. package/esm2015/core/common/render-engine.js +30 -46
  40. package/esm2015/core/common/renderer.js +9 -9
  41. package/esm2015/core/common/scales/band-scale.js +7 -12
  42. package/esm2015/core/common/scales/domain-calculation/automatic-domain.js +4 -9
  43. package/esm2015/core/common/scales/domain-calculation/domain-with-auxiliary-series.js +1 -1
  44. package/esm2015/core/common/scales/domain-calculation/domain-with-ticks.js +1 -1
  45. package/esm2015/core/common/scales/domain-calculation/merge-domains.js +6 -10
  46. package/esm2015/core/common/scales/formatters/datetime-formatter.js +6 -14
  47. package/esm2015/core/common/scales/helpers/convert.js +2 -3
  48. package/esm2015/core/common/scales/helpers/invert.js +1 -1
  49. package/esm2015/core/common/scales/helpers/is-in-range.js +2 -2
  50. package/esm2015/core/common/scales/linear-scale.js +2 -2
  51. package/esm2015/core/common/scales/noop-scale.js +1 -1
  52. package/esm2015/core/common/scales/point-scale.js +3 -6
  53. package/esm2015/core/common/scales/scale.js +1 -1
  54. package/esm2015/core/common/scales/time-interval-scale.js +8 -19
  55. package/esm2015/core/common/scales/time-scale.js +3 -5
  56. package/esm2015/core/common/scales/types.js +1 -1
  57. package/esm2015/core/common/types.js +1 -1
  58. package/esm2015/core/common/utility.service.js +18 -22
  59. package/esm2015/core/grid/config/bar-grid-config.js +1 -1
  60. package/esm2015/core/grid/config/bar-horizontal-grid-config.js +1 -1
  61. package/esm2015/core/grid/config/bar-status-grid-config.js +1 -1
  62. package/esm2015/core/grid/config/border-config.js +1 -1
  63. package/esm2015/core/grid/config/grid-config.js +1 -1
  64. package/esm2015/core/grid/config/linear-gauge-grid-config-fn.js +2 -2
  65. package/esm2015/core/grid/config/spark-chart-grid-config.js +1 -1
  66. package/esm2015/core/grid/config/xy-grid-config.js +1 -1
  67. package/esm2015/core/grid/default-text-overflow-handler.js +6 -17
  68. package/esm2015/core/grid/grid.js +30 -42
  69. package/esm2015/core/grid/radial-grid.js +6 -9
  70. package/esm2015/core/grid/types.js +1 -1
  71. package/esm2015/core/grid/xy-grid.js +67 -164
  72. package/esm2015/core/plugins/chart-donut-content-plugin.js +8 -14
  73. package/esm2015/core/plugins/chart-popover-plugin.js +9 -19
  74. package/esm2015/core/plugins/gauge/donut-gauge-labels-plugin.js +10 -21
  75. package/esm2015/core/plugins/gauge/linear-gauge-labels-plugin.js +14 -31
  76. package/esm2015/core/plugins/interaction/interaction-label-plugin.js +21 -44
  77. package/esm2015/core/plugins/interaction/interaction-line-plugin.js +14 -27
  78. package/esm2015/core/plugins/mouse-interactive-area-plugin.js +11 -39
  79. package/esm2015/core/plugins/radial-popover-plugin.js +6 -10
  80. package/esm2015/core/plugins/render-engine-plugin.js +10 -28
  81. package/esm2015/core/plugins/tooltips/bar-tooltips-plugin.js +1 -1
  82. package/esm2015/core/plugins/tooltips/chart-tooltips-plugin.js +19 -41
  83. package/esm2015/core/plugins/tooltips/radial-tooltips-plugin.js +8 -10
  84. package/esm2015/core/plugins/zoom-plugin.js +15 -32
  85. package/esm2015/core/types.js +1 -1
  86. package/esm2015/gauge/gauge-util.js +21 -64
  87. package/esm2015/gauge/types.js +1 -1
  88. package/esm2015/legend/legend-series/legend-series.component.js +7 -10
  89. package/esm2015/legend/legend-tile/basic-legend-tile/basic-legend-tile.component.js +2 -2
  90. package/esm2015/legend/legend-tile/rich-legend-tile/rich-legend-tile.component.js +4 -7
  91. package/esm2015/legend/legend.component.js +4 -4
  92. package/esm2015/legend/types.js +1 -1
  93. package/esm2015/renderers/accessors/noop-accessors.js +1 -1
  94. package/esm2015/renderers/accessors/rectangle-accessors.js +3 -2
  95. package/esm2015/renderers/area/area-accessors.js +2 -2
  96. package/esm2015/renderers/area/area-grid.js +1 -1
  97. package/esm2015/renderers/area/area-renderer.js +12 -32
  98. package/esm2015/renderers/area/stacked-area-accessors.js +1 -1
  99. package/esm2015/renderers/area/stacked-area-preprocessor.js +2 -5
  100. package/esm2015/renderers/area/stacked-percentage-area-preprocessor.js +1 -1
  101. package/esm2015/renderers/bar/accessors/bar-accessors-fn.js +2 -2
  102. package/esm2015/renderers/bar/accessors/bar-accessors.js +3 -3
  103. package/esm2015/renderers/bar/accessors/horizontal-bar-accessors.js +2 -4
  104. package/esm2015/renderers/bar/accessors/status-accessors-fn.js +1 -1
  105. package/esm2015/renderers/bar/accessors/status-accessors.js +1 -1
  106. package/esm2015/renderers/bar/accessors/vertical-bar-accessors.js +2 -4
  107. package/esm2015/renderers/bar/bar-grid.js +2 -4
  108. package/esm2015/renderers/bar/bar-renderer.js +26 -58
  109. package/esm2015/renderers/bar/bar-scales.js +1 -1
  110. package/esm2015/renderers/bar/highlight-strategies/bar-highlight-strategy.js +16 -31
  111. package/esm2015/renderers/bar/highlight-strategies/bar-series-highlight-strategy.js +7 -9
  112. package/esm2015/renderers/bar/linear-gauge-thresholds-renderer.js +8 -15
  113. package/esm2015/renderers/bar/preprocessor-utils.js +1 -1
  114. package/esm2015/renderers/bar/stacked-preprocessor.js +2 -3
  115. package/esm2015/renderers/line/calculate-missing-data.js +1 -1
  116. package/esm2015/renderers/line/interaction-strategies/line-select-series-interaction-strategy.js +12 -19
  117. package/esm2015/renderers/line/line-accessors.js +2 -2
  118. package/esm2015/renderers/line/line-renderer.js +15 -27
  119. package/esm2015/renderers/marker-utils.js +17 -37
  120. package/esm2015/renderers/noop-renderer.js +5 -3
  121. package/esm2015/renderers/radial/accessors/radial-accessors.js +2 -2
  122. package/esm2015/renderers/radial/gauge/donut-gauge-rendering-util.js +1 -1
  123. package/esm2015/renderers/radial/gauge/donut-gauge-thresholds-renderer.js +5 -7
  124. package/esm2015/renderers/radial/pie-renderer.js +3 -2
  125. package/esm2015/renderers/radial/radial-preprocessor.js +6 -8
  126. package/esm2015/renderers/radial/radial-renderer.js +16 -32
  127. package/esm2015/renderers/radial/radial-scales.js +2 -2
  128. package/esm2015/renderers/side-indicator-renderer.js +13 -16
  129. package/esm2015/renderers/types.js +1 -1
  130. package/esm2015/renderers/xy-renderer.js +1 -1
  131. package/esm2015/thresholds/thresholds-service.js +31 -55
  132. package/esm2015/thresholds/thresholds-summary-grid-config.js +1 -1
  133. package/esm2015/thresholds/thresholds-top-grid-config.js +1 -1
  134. package/fesm2015/nova-ui-charts.js +632 -1282
  135. package/fesm2015/nova-ui-charts.js.map +1 -1
  136. package/gauge/types.d.ts +2 -2
  137. package/nova-ui-charts.metadata.json +1 -1
  138. package/package.json +1 -1
  139. package/sdk/atoms/chart/atoms/chart.atom.js +8 -12
  140. package/sdk/atoms/chart/atoms/chart.atom.js.map +1 -1
  141. package/sdk/atoms/chart/atoms/lasagna.atom.js +2 -2
  142. package/sdk/atoms/chart/atoms/lasagna.atom.js.map +1 -1
  143. package/sdk/atoms/chart/atoms/line-series.atom.js +4 -4
  144. package/sdk/atoms/chart/atoms/line-series.atom.js.map +1 -1
  145. package/sdk/atoms/chart/atoms/marker.atom.js +1 -4
  146. package/sdk/atoms/chart/atoms/marker.atom.js.map +1 -1
  147. package/sdk/atoms/chart/atoms/radial-series.atom.js +3 -3
  148. package/sdk/atoms/chart/atoms/radial-series.atom.js.map +1 -1
  149. package/sdk/atoms/chart/atoms/status-bar-data-point.atom.js +1 -3
  150. package/sdk/atoms/chart/atoms/status-bar-data-point.atom.js.map +1 -1
  151. package/sdk/atoms/chart/atoms/threshold-series.atom.js.map +1 -1
  152. package/sdk/atoms/chart/boosters/donut-chart-content.booster.js +1 -3
  153. package/sdk/atoms/chart/boosters/donut-chart-content.booster.js.map +1 -1
  154. package/sdk/atoms/chart/boosters/interactive.booster.js +1 -3
  155. package/sdk/atoms/chart/boosters/interactive.booster.js.map +1 -1
  156. package/sdk/atoms/chart/boosters/zoom.booster.js +7 -4
  157. package/sdk/atoms/chart/boosters/zoom.booster.js.map +1 -1
  158. package/sdk/atoms/chart/line-chart-test.po.js.map +1 -1
  159. package/sdk/atoms/chart/spark-chart-test.po.js.map +1 -1
  160. package/sdk/atoms/chart/status-chart.atom.js +1 -2
  161. package/sdk/atoms/chart/status-chart.atom.js.map +1 -1
  162. package/sdk/atoms/chart/test.po.js.map +1 -1
  163. package/sdk/atoms/chart/thresholds-summary-test.po.js.map +1 -1
  164. package/sdk/atoms/chart/time-frame-bar-test.po.js.map +1 -1
  165. package/sdk/atoms/legend/legend-series.atom.js +3 -7
  166. package/sdk/atoms/legend/legend-series.atom.js.map +1 -1
  167. package/sdk/atoms/legend/legend.atom.js.map +1 -1
  168. package/sdk/atoms/legend/rich-legend-tile.atom.js +1 -3
  169. package/sdk/atoms/legend/rich-legend-tile.atom.js.map +1 -1
  170. package/sdk/less/nui-charts.less +5 -5
  171. package/sdk/locale/messages.en.xlf +50 -52
@@ -49,7 +49,7 @@
49
49
  ChartTooltipComponent.decorators = [
50
50
  { type: core.Component, args: [{
51
51
  selector: "nui-chart-tooltip",
52
- template: "<div>\n <div @tooltip class=\"nui-chart-tooltip px-2 py-1 nui-text-small\">\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n </div>\n</div>\n",
52
+ template: "<div>\n <div @tooltip class='nui-chart-tooltip px-2 py-1 nui-text-small'>\n <ng-container *ngTemplateOutlet='template'></ng-container>\n </div>\n</div>\n",
53
53
  changeDetection: core.ChangeDetectionStrategy.OnPush,
54
54
  animations: [
55
55
  animations.trigger("tooltip", [
@@ -57,7 +57,9 @@
57
57
  animations.style({ opacity: 0 }),
58
58
  animations.animate(300, animations.style({ opacity: 1 })),
59
59
  ]),
60
- animations.transition(":leave", [animations.animate(300, animations.style({ opacity: 0 }))]),
60
+ animations.transition(":leave", [
61
+ animations.animate(300, animations.style({ opacity: 0 })),
62
+ ]),
61
63
  ]),
62
64
  ],
63
65
  styles: [":host{display:block;pointer-events:none}.nui-chart-tooltip{background-color:var(--nui-color-bg-inverse,#111);color:var(--nui-color-text-inverse,#fff);line-height:normal}\n"]
@@ -148,10 +150,9 @@
148
150
  var _a;
149
151
  if (changes.plugin) {
150
152
  (_a = this.contentPositionUpdateSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
151
- this.contentPositionUpdateSubscription =
152
- this.plugin.contentPositionUpdateSubject.subscribe(function (contentPosition) {
153
- _this.contentPosition = contentPosition;
154
- });
153
+ this.contentPositionUpdateSubscription = this.plugin.contentPositionUpdateSubject.subscribe(function (contentPosition) {
154
+ _this.contentPosition = contentPosition;
155
+ });
155
156
  this.plugin.chart.updateDimensions();
156
157
  }
157
158
  };
@@ -165,7 +166,7 @@
165
166
  ChartDonutContentComponent.decorators = [
166
167
  { type: core.Component, args: [{
167
168
  selector: "nui-chart-donut-content",
168
- template: "<div\n *ngIf=\"plugin && contentPosition\"\n class=\"nui-chart-donut-content d-flex justify-content-center align-items-center text-center\"\n [style.top.px]=\"contentPosition.top\"\n [style.left.px]=\"contentPosition.left\"\n [style.height.px]=\"contentPosition.height\"\n [style.width.px]=\"contentPosition.width\"\n>\n <ng-content></ng-content>\n</div>\n",
169
+ template: "<div *ngIf=\"plugin && contentPosition\"\n class=\"nui-chart-donut-content d-flex justify-content-center align-items-center text-center\"\n [style.top.px]=\"contentPosition.top\"\n [style.left.px]=\"contentPosition.left\"\n [style.height.px]=\"contentPosition.height\"\n [style.width.px]=\"contentPosition.width\">\n <ng-content></ng-content>\n</div>\n",
169
170
  styles: [".nui-chart-donut-content{position:absolute;pointer-events:auto;width:100%;height:100%;overflow:hidden;text-overflow:ellipsis}\n"]
170
171
  },] }
171
172
  ];
@@ -190,12 +191,8 @@
190
191
  return;
191
192
  }
192
193
  this.unsubscribe$.next();
193
- this.plugin.showSubject
194
- .pipe(operators.takeUntil(this.unsubscribe$))
195
- .subscribe(function () { return _this.handleOpen(); });
196
- this.plugin.hideSubject
197
- .pipe(operators.takeUntil(this.unsubscribe$))
198
- .subscribe(function () { return _this.handleClose(); });
194
+ this.plugin.showSubject.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () { return _this.handleOpen(); });
195
+ this.plugin.hideSubject.pipe(operators.takeUntil(this.unsubscribe$)).subscribe(function () { return _this.handleClose(); });
199
196
  };
200
197
  ChartTooltipsComponent.prototype.ngOnDestroy = function () {
201
198
  this.unsubscribe$.next();
@@ -294,9 +291,7 @@
294
291
  seriesId: seriesId,
295
292
  x: position.x,
296
293
  y: position.y,
297
- radius: _this.isVertical()
298
- ? position.height / 2
299
- : position.width / 2,
294
+ radius: _this.isVertical() ? position.height / 2 : position.width / 2,
300
295
  };
301
296
  if (_this.isVertical()) {
302
297
  props.fx = position.x;
@@ -316,7 +311,8 @@
316
311
  simulation.on("tick", function () {
317
312
  each__default["default"](nodes, function (node) {
318
313
  var tooltip = tooltipIndex[node.seriesId];
319
- d3Selection.select(tooltip.getOverlayElement()).style(_this.isVertical() ? "top" : "left", (_this.isVertical() ? node.y : node.x) + "px");
314
+ d3Selection.select(tooltip.getOverlayElement())
315
+ .style(_this.isVertical() ? "top" : "left", (_this.isVertical() ? node.y : node.x) + "px");
320
316
  });
321
317
  });
322
318
  return simulation;
@@ -329,7 +325,7 @@
329
325
  ChartTooltipsComponent.decorators = [
330
326
  { type: core.Component, args: [{
331
327
  selector: "nui-chart-tooltips",
332
- template: "<div *ngIf=\"plugin && plugin.dataPoints\">\n <div *ngFor=\"let item of plugin.dataPoints | keyvalue; trackBy: trackByFn\">\n <ng-template #tooltipTemplate>\n <ng-container\n *ngTemplateOutlet=\"template; context: { dataPoint: item.value }\"\n ></ng-container>\n </ng-template>\n\n <div\n nuiChartTooltip\n *ngIf=\"plugin.dataPointPositions[item.key]\"\n [attr.series-id]=\"item.key\"\n [template]=\"tooltipTemplate\"\n [openRemoteControl]=\"openTooltips\"\n [closeRemoteControl]=\"closeTooltips\"\n [positions]=\"plugin.dataPointPositions[item.key].overlayPositions\"\n class=\"chart-tooltips__popover\"\n [style.left.px]=\"plugin.dataPointPositions[item.key].x\"\n [style.top.px]=\"plugin.dataPointPositions[item.key].y\"\n [style.height.px]=\"plugin.dataPointPositions[item.key].height\"\n [style.width.px]=\"plugin.dataPointPositions[item.key].width\"\n ></div>\n </div>\n</div>\n",
328
+ template: "<div *ngIf=\"plugin && plugin.dataPoints\">\n <div *ngFor=\"let item of plugin.dataPoints | keyvalue; trackBy: trackByFn\">\n <ng-template #tooltipTemplate>\n <ng-container *ngTemplateOutlet=\"template; context: {dataPoint:item.value}\"></ng-container>\n </ng-template>\n\n <div nuiChartTooltip\n *ngIf=\"plugin.dataPointPositions[item.key]\"\n [attr.series-id]=\"item.key\"\n [template]=\"tooltipTemplate\"\n [openRemoteControl]=\"openTooltips\"\n [closeRemoteControl]=\"closeTooltips\"\n [positions]=\"plugin.dataPointPositions[item.key].overlayPositions\"\n class=\"chart-tooltips__popover\"\n [style.left.px]=\"plugin.dataPointPositions[item.key].x\"\n [style.top.px]=\"plugin.dataPointPositions[item.key].y\"\n [style.height.px]=\"plugin.dataPointPositions[item.key].height\"\n [style.width.px]=\"plugin.dataPointPositions[item.key].width\"\n ></div>\n </div>\n</div>\n",
333
329
  styles: [".chart-tooltips__popover{position:absolute;pointer-events:none}\n"]
334
330
  },] }
335
331
  ];
@@ -375,8 +371,7 @@
375
371
  (_a = _this.popover) === null || _a === void 0 ? void 0 : _a.resetSize();
376
372
  // calculating a width offset to position the popover's host element at the midpoint of the popover target
377
373
  var widthOffset = position.width / 2;
378
- _this.element.nativeElement.style.left =
379
- position.left + widthOffset + "px";
374
+ _this.element.nativeElement.style.left = position.left + widthOffset + "px";
380
375
  _this.element.nativeElement.style.top = position.top + "px";
381
376
  (_b = _this.popover) === null || _b === void 0 ? void 0 : _b.updatePosition();
382
377
  _this.update.next((_c = _this.plugin) === null || _c === void 0 ? void 0 : _c.dataPoints);
@@ -387,7 +382,7 @@
387
382
  ChartPopoverComponent.decorators = [
388
383
  { type: core.Component, args: [{
389
384
  selector: "nui-chart-popover",
390
- template: "<div *ngIf=\"plugin && plugin.dataPoints\">\n <nui-popover\n class=\"chart-popover__popover\"\n trigger=\"openPopoverSubject\"\n placement=\"top\"\n [unlimited]=\"true\"\n [template]=\"popoverTemplate\"\n [openPopover]=\"plugin.openPopoverSubject\"\n [closePopover]=\"plugin.closePopoverSubject\"\n [hasPadding]=\"false\"\n [container]=\"element.nativeElement\"\n [style.height.px]=\"plugin.popoverTargetPosition.height\"\n [withGrowAfterOpen]=\"true\"\n >\n </nui-popover>\n\n <ng-template #popoverTemplate>\n <ng-container\n *ngTemplateOutlet=\"\n template;\n context: { dataPoints: plugin.dataPoints }\n \"\n ></ng-container>\n </ng-template>\n</div>\n",
385
+ template: "<div *ngIf=\"plugin && plugin.dataPoints\">\n <nui-popover class=\"chart-popover__popover\"\n trigger=\"openPopoverSubject\"\n placement=\"top\"\n [unlimited]=\"true\"\n [template]=\"popoverTemplate\"\n [openPopover]=\"plugin.openPopoverSubject\"\n [closePopover]=\"plugin.closePopoverSubject\"\n [hasPadding]=\"false\"\n [container]=\"element.nativeElement\"\n [style.height.px]=\"plugin.popoverTargetPosition.height\"\n [withGrowAfterOpen]=\"true\">\n </nui-popover>\n\n <ng-template #popoverTemplate>\n <ng-container *ngTemplateOutlet=\"template; context: {dataPoints:plugin.dataPoints}\"></ng-container>\n </ng-template>\n</div>\n",
391
386
  styles: [":host{position:absolute}.chart-popover__popover{position:absolute;pointer-events:none}\n"]
392
387
  },] }
393
388
  ];
@@ -423,9 +418,7 @@
423
418
  if (changes["color"]) {
424
419
  this.marker.setColor(this.color);
425
420
  }
426
- if (this.marker &&
427
- this.marker.getSvg &&
428
- isFunction__default["default"](this.marker.getSvg)) {
421
+ if (this.marker && this.marker.getSvg && isFunction__default["default"](this.marker.getSvg)) {
429
422
  this.svg.next(this.marker.getSvg());
430
423
  }
431
424
  }
@@ -444,15 +437,10 @@
444
437
  svgContainerElement.insertAdjacentHTML("beforeend", svg);
445
438
  setTimeout(function () {
446
439
  var clientRect = svgContainerElement.getBBox();
447
- _this.viewBox =
448
- clientRect.x - SVG_PADDING + " " + (clientRect.y - SVG_PADDING) + " " +
449
- (clientRect.width + 2 * SVG_PADDING + " " + (clientRect.height + 2 * SVG_PADDING));
450
- _this.width =
451
- Math.min(clientRect.width + 2 * SVG_PADDING, _this.maxSize) +
452
- "px";
453
- _this.height =
454
- Math.min(clientRect.height + 2 * SVG_PADDING, _this.maxSize) +
455
- "px";
440
+ _this.viewBox = clientRect.x - SVG_PADDING + " " + (clientRect.y - SVG_PADDING) + " " +
441
+ (clientRect.width + 2 * SVG_PADDING + " " + (clientRect.height + 2 * SVG_PADDING));
442
+ _this.width = Math.min(clientRect.width + 2 * SVG_PADDING, _this.maxSize) + "px";
443
+ _this.height = Math.min(clientRect.height + 2 * SVG_PADDING, _this.maxSize) + "px";
456
444
  _this.changeDetector.markForCheck();
457
445
  });
458
446
  };
@@ -891,12 +879,7 @@
891
879
  *
892
880
  * @type {[string]}
893
881
  */
894
- this.events = [
895
- INTERACTION_VALUES_EVENT,
896
- INTERACTION_COORDINATES_EVENT,
897
- MOUSE_ACTIVE_EVENT,
898
- REFRESH_EVENT,
899
- ];
882
+ this.events = [INTERACTION_VALUES_EVENT, INTERACTION_COORDINATES_EVENT, MOUSE_ACTIVE_EVENT, REFRESH_EVENT];
900
883
  this.charts = {};
901
884
  this.subscriptions = {};
902
885
  }
@@ -954,9 +937,7 @@
954
937
  var _this = this;
955
938
  this.eventBus = new EventBus();
956
939
  var _loop_1 = function (event) {
957
- this_1.eventBus
958
- .getStream(event)
959
- .subscribe(function (e) {
940
+ this_1.eventBus.getStream(event).subscribe(function (e) {
960
941
  var e_2, _b;
961
942
  try {
962
943
  for (var _c = (e_2 = void 0, __values(Object.keys(_this.charts))), _d = _c.next(); !_d.done; _d = _c.next()) {
@@ -964,10 +945,7 @@
964
945
  if (i !== e.chartIndex) {
965
946
  // setting this flag prevents the event from looping infinitely
966
947
  e.event.broadcast = true;
967
- _this.charts[i]
968
- .getEventBus()
969
- .getStream(event)
970
- .next(e.event);
948
+ _this.charts[i].getEventBus().getStream(event).next(e.event);
971
949
  }
972
950
  }
973
951
  }
@@ -1061,9 +1039,7 @@
1061
1039
  this.chartCollectionService = chartCollectionService;
1062
1040
  }
1063
1041
  ChartCollectionIdDirective.prototype.ngAfterViewInit = function () {
1064
- this.chartCollectionService
1065
- .getChartCollection(this.collectionId)
1066
- .addChart(this.chartComponent.chart);
1042
+ this.chartCollectionService.getChartCollection(this.collectionId).addChart(this.chartComponent.chart);
1067
1043
  };
1068
1044
  return ChartCollectionIdDirective;
1069
1045
  }());
@@ -1092,13 +1068,8 @@
1092
1068
  };
1093
1069
  this.intersectionObserverCallback = function (entries, observer) {
1094
1070
  // Since we're only listening for intersection changes for one target (the chart itself), the 'entries' argument always has just one element.
1095
- var data = {
1096
- isChartInView: entries[0].isIntersecting,
1097
- };
1098
- _this.chart
1099
- .getEventBus()
1100
- .getStream(CHART_VIEW_STATUS_EVENT)
1101
- .next({ data: data });
1071
+ var data = { isChartInView: entries[0].isIntersecting };
1072
+ _this.chart.getEventBus().getStream(CHART_VIEW_STATUS_EVENT).next({ data: data });
1102
1073
  };
1103
1074
  }
1104
1075
  ChartComponent.prototype.ngOnInit = function () {
@@ -1119,10 +1090,7 @@
1119
1090
  };
1120
1091
  ChartComponent.prototype.ngAfterContentInit = function () {
1121
1092
  var _this = this;
1122
- this.chart
1123
- .getEventBus()
1124
- .getStream(REFRESH_EVENT)
1125
- .subscribe(function () {
1093
+ this.chart.getEventBus().getStream(REFRESH_EVENT).subscribe(function () {
1126
1094
  _this.chart.updateDimensions();
1127
1095
  });
1128
1096
  };
@@ -1133,7 +1101,7 @@
1133
1101
  // This was suggested here https://github.com/angular/zone.js/issues/1011
1134
1102
  _this.ngZone.run(function () { return _this.resizeHandler(); });
1135
1103
  });
1136
- this.ngZone.runOutsideAngular(function () { var _a; return (_a = _this.resizeObserver) === null || _a === void 0 ? void 0 : _a.observe(_this.elRef.nativeElement); });
1104
+ this.ngZone.runOutsideAngular(function () { var _a; return (_a = _this.resizeObserver) === null || _a === void 0 ? void 0 : _a.observe((_this.elRef.nativeElement)); });
1137
1105
  };
1138
1106
  ChartComponent.prototype.ngOnDestroy = function () {
1139
1107
  var _a, _b, _c;
@@ -1203,8 +1171,8 @@
1203
1171
  { type: core.Component, args: [{
1204
1172
  selector: "nui-legend",
1205
1173
  // eslint-disable-next-line
1206
- host: { class: "d-inline-block" },
1207
- template: "<div\n class=\"nui-legend d-flex flex-wrap\"\n [class.flex-column]=\"orientation === 'vertical'\"\n>\n <ng-content></ng-content>\n</div>\n",
1174
+ host: { "class": "d-inline-block" },
1175
+ template: "<div class=\"nui-legend d-flex flex-wrap\"\n [class.flex-column]=\"orientation === 'vertical'\">\n <ng-content></ng-content>\n</div>\n",
1208
1176
  encapsulation: core.ViewEncapsulation.Emulated
1209
1177
  },] }
1210
1178
  ];
@@ -1296,12 +1264,11 @@
1296
1264
  var _this = this;
1297
1265
  var _a;
1298
1266
  if (this.legend) {
1299
- this.legend.activeChanged.subscribe(function (active) { return (_this._active = active); });
1267
+ this.legend.activeChanged.subscribe(function (active) { return _this._active = active; });
1300
1268
  this.icon = this.icon || this.legend.seriesIcon;
1301
1269
  this._active = this.legend.active;
1302
1270
  this.interactive = (_a = this.interactive) !== null && _a !== void 0 ? _a : this.legend.interactive;
1303
- this.isHorizontalClassApplied =
1304
- this.legend.orientation === LegendOrientation.horizontal;
1271
+ this.isHorizontalClassApplied = this.legend.orientation === LegendOrientation.horizontal;
1305
1272
  }
1306
1273
  };
1307
1274
  /**
@@ -1316,24 +1283,22 @@
1316
1283
  * @returns boolean indicating whether the series has a primary or secondary description
1317
1284
  */
1318
1285
  LegendSeriesComponent.prototype.hasInputDescription = function () {
1319
- return (!isEmpty__default["default"](this.descriptionPrimary) ||
1320
- !isEmpty__default["default"](this.descriptionSecondary));
1286
+ return !isEmpty__default["default"](this.descriptionPrimary) || !isEmpty__default["default"](this.descriptionSecondary);
1321
1287
  };
1322
1288
  /**
1323
1289
  * @returns boolean indicating whether the series has a projected description
1324
1290
  */
1325
1291
  LegendSeriesComponent.prototype.hasProjectedDescription = function () {
1326
- return (!!this.projectedDescription &&
1327
- this.projectedDescription.nativeElement.children.length !== 0);
1292
+ return !!this.projectedDescription && this.projectedDescription.nativeElement.children.length !== 0;
1328
1293
  };
1329
1294
  return LegendSeriesComponent;
1330
1295
  }());
1331
1296
  LegendSeriesComponent.decorators = [
1332
1297
  { type: core.Component, args: [{
1333
1298
  // eslint-disable-next-line
1334
- host: { class: LEGEND_SERIES_CLASS_NAME },
1299
+ host: { "class": LEGEND_SERIES_CLASS_NAME },
1335
1300
  selector: "nui-legend-series",
1336
- template: "<div\n class=\"d-flex\"\n [ngClass]=\"['nui-legend-series--state-' + seriesRenderState]\"\n [class.nui-legend-series--deselected]=\"!isSelected\"\n>\n <div class=\"nui-legend-series__tile-wrapper\">\n <div class=\"nui-legend-series__tile\">\n <ng-content></ng-content>\n </div>\n <div\n class=\"nui-legend-series__checkbox-wrapper\"\n [class.nui-legend-series__checkbox--checked]=\"isSelected\"\n >\n <div class=\"nui-legend-series__checkbox-mark\">\n <i class=\"nui-legend-series__checkbox-glyph\"></i>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"hasInputDescription(); else descriptionTemplate\"\n class=\"description-container nui-text-small d-flex flex-column justify-content-center\"\n >\n <div\n *ngIf=\"!!descriptionPrimary\"\n class=\"description description-primary\"\n [title]=\"descriptionPrimary\"\n >\n {{ descriptionPrimary }}\n </div>\n <div\n *ngIf=\"!!descriptionSecondary\"\n class=\"description description-secondary\"\n [title]=\"descriptionSecondary\"\n >\n {{ descriptionSecondary }}\n </div>\n </div>\n</div>\n<ng-template #descriptionTemplate>\n <div class=\"d-flex\" #projectedDescription>\n <ng-content select=\"[description]\"></ng-content>\n </div>\n</ng-template>\n",
1301
+ template: "<div class=\"d-flex\"\n [ngClass]=\"['nui-legend-series--state-' + seriesRenderState]\"\n [class.nui-legend-series--deselected]=\"!isSelected\">\n <div class=\"nui-legend-series__tile-wrapper\">\n <div class=\"nui-legend-series__tile\">\n <ng-content></ng-content>\n </div>\n <div class=\"nui-legend-series__checkbox-wrapper\"\n [class.nui-legend-series__checkbox--checked]=\"isSelected\">\n <div class=\"nui-legend-series__checkbox-mark\">\n <i class=\"nui-legend-series__checkbox-glyph\"></i>\n </div>\n </div>\n </div>\n <div *ngIf=\"hasInputDescription(); else descriptionTemplate\"\n class=\"description-container nui-text-small d-flex flex-column justify-content-center\">\n <div *ngIf=\"!!descriptionPrimary\" class=\"description description-primary\" [title]=\"descriptionPrimary\">{{ descriptionPrimary }}</div>\n <div *ngIf=\"!!descriptionSecondary\" class=\"description description-secondary\" [title]=\"descriptionSecondary\">{{ descriptionSecondary }}</div>\n </div>\n</div>\n<ng-template #descriptionTemplate>\n <div class=\"d-flex\" #projectedDescription>\n <ng-content select=\"[description]\"></ng-content>\n </div>\n</ng-template>\n",
1337
1302
  changeDetection: core.ChangeDetectionStrategy.OnPush
1338
1303
  },] }
1339
1304
  ];
@@ -1380,15 +1345,12 @@
1380
1345
  RichLegendTileComponent.prototype.ngAfterContentInit = function () {
1381
1346
  if (this.legend) {
1382
1347
  this.unitLabel = this.unitLabel || this.legend.seriesUnitLabel;
1383
- this.backgroundColor =
1384
- this.backgroundColor || this.legend.seriesColor || "white";
1348
+ this.backgroundColor = this.backgroundColor || this.legend.seriesColor || "white";
1385
1349
  }
1386
1350
  };
1387
1351
  RichLegendTileComponent.prototype.ngAfterViewInit = function () {
1388
1352
  if (this.legendSeries) {
1389
- this.seriesHasAdditionalContent =
1390
- this.legendSeries.hasInputDescription() ||
1391
- this.legendSeries.hasProjectedDescription();
1353
+ this.seriesHasAdditionalContent = this.legendSeries.hasInputDescription() || this.legendSeries.hasProjectedDescription();
1392
1354
  this.changeDetector.detectChanges();
1393
1355
  }
1394
1356
  };
@@ -1403,7 +1365,7 @@
1403
1365
  RichLegendTileComponent.decorators = [
1404
1366
  { type: core.Component, args: [{
1405
1367
  selector: "nui-rich-legend-tile",
1406
- template: "<div\n class=\"nui-rich-legend-tile\"\n [class.nui-rich-legend-tile--has-point-marker]=\"\n rightEdge.children.length > 0\n \"\n [class.nui-rich-legend-tile--series-has-additional-content]=\"\n seriesHasAdditionalContent\n \"\n>\n <div\n class=\"nui-rich-legend-tile__tilebox d-flex justify-content-center align-items-end flex-column\"\n [ngStyle]=\"{ 'background-color': backgroundColor }\"\n [style.color]=\"color\"\n >\n <div\n *ngIf=\"hasInputValue(); else projectedTopContent\"\n class=\"nui-rich-legend-tile__tilebox-value nui-rich-legend-tile__ellipsified\"\n >\n {{ value }}\n </div>\n <div\n *ngIf=\"hasInputUnitLabel(); else projectedBottomContent\"\n class=\"nui-rich-legend-tile__tilebox-unit nui-rich-legend-tile__ellipsified\"\n >\n {{ unitLabel }}\n </div>\n <ng-content></ng-content>\n </div>\n <div class=\"nui-rich-legend-tile__icon\" #icon>\n <ng-content select=\"[leftEdge]\"></ng-content>\n </div>\n <div class=\"nui-rich-legend-tile__point-marker\" #rightEdge>\n <ng-content select=\"[rightEdge]\"></ng-content>\n </div>\n</div>\n<ng-template #projectedTopContent>\n <ng-content select=\"[top]\"></ng-content>\n</ng-template>\n<ng-template #projectedBottomContent>\n <ng-content select=\"[bottom]\"></ng-content>\n</ng-template>\n",
1368
+ template: "<div class=\"nui-rich-legend-tile\"\n [class.nui-rich-legend-tile--has-point-marker]=\"rightEdge.children.length > 0\"\n [class.nui-rich-legend-tile--series-has-additional-content]=\"seriesHasAdditionalContent\">\n <div class=\"nui-rich-legend-tile__tilebox d-flex justify-content-center align-items-end flex-column\"\n [ngStyle]=\"{'background-color': backgroundColor}\"\n [style.color]=\"color\">\n <div *ngIf=\"hasInputValue(); else projectedTopContent\"\n class=\"nui-rich-legend-tile__tilebox-value nui-rich-legend-tile__ellipsified\">\n {{ value }}\n </div>\n <div *ngIf=\"hasInputUnitLabel(); else projectedBottomContent\"\n class=\"nui-rich-legend-tile__tilebox-unit nui-rich-legend-tile__ellipsified\">\n {{ unitLabel }}\n </div>\n <ng-content></ng-content>\n </div>\n <div class=\"nui-rich-legend-tile__icon\" #icon>\n <ng-content select=\"[leftEdge]\"></ng-content>\n </div>\n <div class=\"nui-rich-legend-tile__point-marker\" #rightEdge>\n <ng-content select=\"[rightEdge]\"></ng-content>\n </div>\n</div>\n<ng-template #projectedTopContent>\n <ng-content select=\"[top]\"></ng-content>\n</ng-template>\n<ng-template #projectedBottomContent>\n <ng-content select=\"[bottom]\"></ng-content>\n</ng-template>\n",
1407
1369
  encapsulation: core.ViewEncapsulation.Emulated,
1408
1370
  styles: [".nui-rich-legend-tile{position:relative;width:60px;height:100%;line-height:18px}.nui-rich-legend-tile :empty{display:none}.nui-rich-legend-tile__tilebox{width:100%;height:100%;padding:0 5px;background-color:var(--nui-color-bg-light,#fff)}.nui-rich-legend-tile__ellipsified{max-width:100%;overflow:hidden;text-overflow:ellipsis}.nui-rich-legend-tile__tilebox-value{text-align:right;font-weight:600}.nui-rich-legend-tile__tilebox-value:not(:last-child){margin-bottom:-3px}.nui-rich-legend-tile__tilebox-unit{text-align:right;font-size:11px}.nui-rich-legend-tile__tilebox-unit:not(:first-child){margin-top:-3px}.nui-rich-legend-tile__point-marker,.nui-rich-legend-tile__icon{position:absolute;line-height:0;top:50%;pointer-events:none}.nui-rich-legend-tile__point-marker{right:0;transform:translate(50%,-50%)}.nui-rich-legend-tile__icon{left:0;transform:translate(-50%,-50%)}.nui-rich-legend-tile--has-point-marker.nui-rich-legend-tile--series-has-additional-content{margin-right:5px}.nui-rich-legend-tile--has-point-marker .nui-rich-legend-tile__tilebox{padding-right:7px}\n"]
1409
1371
  },] }
@@ -1531,9 +1493,7 @@
1531
1493
  var rgbInput = d3Color.rgb(color);
1532
1494
  var ratioToLight = _this.getContrastRatio(rgbInput, d3Color.rgb(colorDefinitions.light));
1533
1495
  var ratioToDark = _this.getContrastRatio(rgbInput, d3Color.rgb(colorDefinitions.dark));
1534
- return ratioToDark > ratioToLight
1535
- ? colorDefinitions.dark
1536
- : colorDefinitions.light;
1496
+ return ratioToDark > ratioToLight ? colorDefinitions.dark : colorDefinitions.light;
1537
1497
  }) || this;
1538
1498
  return _this;
1539
1499
  }
@@ -1589,10 +1549,7 @@
1589
1549
  else {
1590
1550
  this._standardColors = colors;
1591
1551
  }
1592
- this._textColors = new TextColorProvider(this.standardColors, {
1593
- light: "white",
1594
- dark: "black",
1595
- }); // TODO: oops!
1552
+ this._textColors = new TextColorProvider(this.standardColors, { light: "white", dark: "black" }); // TODO: oops!
1596
1553
  this._backgroundColors = new ProcessedColorProvider(this.standardColors, function (c) {
1597
1554
  var color = getColorValueByName(c);
1598
1555
  var rgbColor = d3Color.rgb(color);
@@ -1635,9 +1592,7 @@
1635
1592
  return this.styledSvg || this.svg;
1636
1593
  };
1637
1594
  SvgMarker.prototype.setColor = function (color) {
1638
- this.styledSvg = isUndefined__default["default"](color)
1639
- ? color
1640
- : "<g fill=\"" + color + "\">" + this.svg + "</g>";
1595
+ this.styledSvg = isUndefined__default["default"](color) ? color : "<g fill=\"" + color + "\">" + this.svg + "</g>";
1641
1596
  };
1642
1597
  return SvgMarker;
1643
1598
  }());
@@ -1764,7 +1719,9 @@
1764
1719
  var ɵ1$1 = function (s) { return "<path class=\"nui-chart--path__outline\" d=\"" + s + "\"></path>"; }, ɵ2$1 = function (s, i) { return "<path class=\"nui-chart--path__outline-fill\" stroke=\"none\" d=\"" + regularShapes[i] + "\"></path>\n <path class=\"nui-chart--path__outline\" d=\"" + s + "\"></path>"; }, ɵ0$1 = function (s) { return new SvgMarker(s); };
1765
1720
  /* eslint-enable max-len */
1766
1721
  /** Default chart marker set */
1767
- var CHART_MARKERS = __spreadArray(__spreadArray([], __read(regularShapes.map(ɵ1$1))), __read(emptyShapes.map(ɵ2$1))).map(ɵ0$1);
1722
+ var CHART_MARKERS = __spreadArray(__spreadArray([], __read(regularShapes
1723
+ .map(ɵ1$1))), __read(emptyShapes
1724
+ .map(ɵ2$1))).map(ɵ0$1);
1768
1725
 
1769
1726
  /**
1770
1727
  * This class matches the provided markers to given series.
@@ -1895,9 +1852,7 @@
1895
1852
  __extends(HorizontalBarAccessors, _super);
1896
1853
  function HorizontalBarAccessors(colorProvider, markerProvider) {
1897
1854
  var _this = _super.call(this, colorProvider, markerProvider) || this;
1898
- _this.data = Object.assign(Object.assign({}, _this.data), { startX: function (d, i, s, ds) { return _this.data.start(d, i, s, ds); }, endX: function (d, i, s, ds) { return _this.data.end(d, i, s, ds); }, startY: function (d, i, s, ds) { return _this.data.category(d, i, s, ds); }, endY: function (d, i, s, ds) { return _this.data.category(d, i, s, ds); }, thicknessY: function (d, i, s, ds) { return _this.data.thickness
1899
- ? _this.data.thickness(d, i, s, ds)
1900
- : undefined; } });
1855
+ _this.data = Object.assign(Object.assign({}, _this.data), { startX: function (d, i, s, ds) { return _this.data.start(d, i, s, ds); }, endX: function (d, i, s, ds) { return _this.data.end(d, i, s, ds); }, startY: function (d, i, s, ds) { return _this.data.category(d, i, s, ds); }, endY: function (d, i, s, ds) { return _this.data.category(d, i, s, ds); }, thicknessY: function (d, i, s, ds) { return _this.data.thickness ? _this.data.thickness(d, i, s, ds) : undefined; } });
1901
1856
  return _this;
1902
1857
  }
1903
1858
  return HorizontalBarAccessors;
@@ -1962,8 +1917,7 @@
1962
1917
  if (values.length === 1 || !bandScale.innerScale || levels <= 1) {
1963
1918
  return bandScale.convert(values[0], position);
1964
1919
  }
1965
- return (bandScale.convert(values[0], 0) +
1966
- convert(bandScale.innerScale, values.slice(1), position, levels - 1));
1920
+ return bandScale.convert(values[0], 0) + convert(bandScale.innerScale, values.slice(1), position, levels - 1);
1967
1921
  }
1968
1922
 
1969
1923
  var _c;
@@ -2013,21 +1967,24 @@
2013
1967
  * @param {number} dataPointIndex index of the highlighted point within the data series (pass -1 to remove the highlight marker)
2014
1968
  * @param {Subject<IRendererEventPayload>} rendererSubject A subject to optionally invoke for emitting events regarding a data point
2015
1969
  */
2016
- Renderer.prototype.highlightDataPoint = function (renderSeries, dataPointIndex, rendererSubject) { };
1970
+ Renderer.prototype.highlightDataPoint = function (renderSeries, dataPointIndex, rendererSubject) {
1971
+ };
2017
1972
  /**
2018
1973
  * Set the RenderState of the target data series
2019
1974
  *
2020
1975
  * @param {IRenderContainers} renderContainers the render containers of the series
2021
1976
  * @param {RenderState} state The new state for the target series
2022
1977
  */
2023
- Renderer.prototype.setSeriesState = function (renderContainers, state) { };
1978
+ Renderer.prototype.setSeriesState = function (renderContainers, state) {
1979
+ };
2024
1980
  /**
2025
1981
  * Set the RenderState of the target data point
2026
1982
  *
2027
1983
  * @param {D3Selection} target the target data point
2028
1984
  * @param {RenderState} state The new state for the target data point
2029
1985
  */
2030
- Renderer.prototype.setDataPointState = function (target, state) { };
1986
+ Renderer.prototype.setDataPointState = function (target, state) {
1987
+ };
2031
1988
  /**
2032
1989
  * Calculate domain for data filtered by given filterScales
2033
1990
  *
@@ -2073,10 +2030,7 @@
2073
2030
  if (!data || data.length === 0) {
2074
2031
  return EMPTY_CONTINUOUS_DOMAIN;
2075
2032
  }
2076
- return d3Array.extent(data, function (datum, index, arr) {
2077
- var _a, _b;
2078
- return (_b = (_a = dataSeries.accessors.data) === null || _a === void 0 ? void 0 : _a[scaleName]) === null || _b === void 0 ? void 0 : _b.call(_a, datum, index, Array.from(arr), dataSeries);
2079
- });
2033
+ return d3Array.extent(data, function (datum, index, arr) { var _a, _b; return (_b = (_a = dataSeries.accessors.data) === null || _a === void 0 ? void 0 : _a[scaleName]) === null || _b === void 0 ? void 0 : _b.call(_a, datum, index, Array.from(arr), dataSeries); });
2080
2034
  };
2081
2035
  /**
2082
2036
  * Filters given dataset by domain of provided scale
@@ -2185,18 +2139,16 @@
2185
2139
  }
2186
2140
  var closestDataIndex = this.findNearestIndex(haystack, needle, accessor);
2187
2141
  // Compensate for bisect
2188
- closestDataIndex =
2189
- closestDataIndex > 0 ? closestDataIndex - 1 : closestDataIndex;
2142
+ closestDataIndex = (closestDataIndex > 0) ? closestDataIndex - 1 : closestDataIndex;
2190
2143
  // Ensure inbounds reference if right end of data
2191
- closestDataIndex =
2192
- closestDataIndex >= haystack.length - 1 && haystack.length !== 1
2193
- ? haystack.length - 2
2194
- : closestDataIndex;
2144
+ closestDataIndex = (closestDataIndex >= haystack.length - 1 && haystack.length !== 1)
2145
+ ? haystack.length - 2
2146
+ : closestDataIndex;
2195
2147
  var indexIncrement = UtilityService.getCloser(valueAccessor(haystack[closestDataIndex], closestDataIndex), valueAccessor(haystack[closestDataIndex + 1], closestDataIndex + 1), needle);
2196
2148
  return closestDataIndex + indexIncrement;
2197
2149
  };
2198
2150
  UtilityService.getCloser = function (a, b, test) {
2199
- return Math.abs(test - a) <= Math.abs(test - b) ? 0 : 1;
2151
+ return (Math.abs(test - a) <= Math.abs(test - b)) ? 0 : 1;
2200
2152
  };
2201
2153
  /**
2202
2154
  * Clamps given value to range
@@ -2221,7 +2173,7 @@
2221
2173
  var r = (dt + Math.random() * 16) % 16 | 0;
2222
2174
  dt = Math.floor(dt / 16);
2223
2175
  // eslint-disable-next-line
2224
- return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
2176
+ return (c === "x" ? r : (r & 0x3 | 0x8)).toString(16);
2225
2177
  });
2226
2178
  return uuid;
2227
2179
  };
@@ -2255,17 +2207,15 @@
2255
2207
  if (
2256
2208
  // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
2257
2209
  // U+007F, […]
2258
- (codeUnit >= 0x0001 && codeUnit <= 0x001f) ||
2259
- codeUnit === 0x007f ||
2210
+ (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit === 0x007F ||
2260
2211
  // If the character is the first character and is in the range [0-9]
2261
2212
  // (U+0030 to U+0039), […]
2262
2213
  (index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
2263
2214
  // If the character is the second character and is in the range [0-9]
2264
2215
  // (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
2265
2216
  (index === 1 &&
2266
- codeUnit >= 0x0030 &&
2267
- codeUnit <= 0x0039 &&
2268
- firstCodeUnit === 0x002d)) {
2217
+ codeUnit >= 0x0030 && codeUnit <= 0x0039 &&
2218
+ firstCodeUnit === 0x002D)) {
2269
2219
  // https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
2270
2220
  result += "\\" + codeUnit.toString(16) + " ";
2271
2221
  continue;
@@ -2275,7 +2225,7 @@
2275
2225
  // there is no second character, […]
2276
2226
  index === 0 &&
2277
2227
  length === 1 &&
2278
- codeUnit === 0x002d) {
2228
+ codeUnit === 0x002D) {
2279
2229
  result += "\\" + sstring.charAt(index);
2280
2230
  continue;
2281
2231
  }
@@ -2284,11 +2234,11 @@
2284
2234
  // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
2285
2235
  // U+005A), or [a-z] (U+0061 to U+007A), […]
2286
2236
  if (codeUnit >= 0x0080 ||
2287
- codeUnit === 0x002d ||
2288
- codeUnit === 0x005f ||
2289
- (codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
2290
- (codeUnit >= 0x0041 && codeUnit <= 0x005a) ||
2291
- (codeUnit >= 0x0061 && codeUnit <= 0x007a)) {
2237
+ codeUnit === 0x002D ||
2238
+ codeUnit === 0x005F ||
2239
+ codeUnit >= 0x0030 && codeUnit <= 0x0039 ||
2240
+ codeUnit >= 0x0041 && codeUnit <= 0x005A ||
2241
+ codeUnit >= 0x0061 && codeUnit <= 0x007A) {
2292
2242
  // the character itself
2293
2243
  result += sstring.charAt(index);
2294
2244
  continue;
@@ -2312,7 +2262,7 @@
2312
2262
  while (low < high) {
2313
2263
  // eslint-disable-next-line no-bitwise
2314
2264
  var mid = (low + high) >>> 1, computed = selector(haystack[mid], mid);
2315
- if (computed !== null && computed < needle) {
2265
+ if (computed !== null && (computed < needle)) {
2316
2266
  low = mid + 1;
2317
2267
  }
2318
2268
  else {
@@ -2437,26 +2387,17 @@
2437
2387
  // TODO: This is tricky: we should not draw anything for hidden data
2438
2388
  // (seriesOffset will be undefined and this means we should provide empty array to d3).
2439
2389
  // TODO fix this
2440
- var bars = target
2441
- .selectAll("g." + this.barContainerClass)
2442
- .data(dataSeries.data);
2390
+ var bars = target.selectAll("g." + this.barContainerClass).data(dataSeries.data);
2443
2391
  bars.exit().remove();
2444
- var barContainers = bars
2445
- .enter()
2392
+ var barContainers = bars.enter()
2446
2393
  .append("g")
2447
2394
  .classed(this.barContainerClass, true);
2448
- barContainers.append("rect").on("click", function (d, i) {
2395
+ barContainers.append("rect")
2396
+ .on("click", function (d, i) {
2449
2397
  _this.emitBarClick(renderSeries, d, i, rendererSubject);
2450
2398
  });
2451
- var getCssClass = function (d, i) {
2452
- var _a;
2453
- return (typeof ((_a = accessors.data) === null || _a === void 0 ? void 0 : _a.cssClass) !== "undefined" &&
2454
- " " +
2455
- accessors.data.cssClass(d, i, dataSeries.data, dataSeries)) ||
2456
- "";
2457
- };
2458
- barContainers
2459
- .merge(bars)
2399
+ var getCssClass = function (d, i) { var _a; return (typeof ((_a = accessors.data) === null || _a === void 0 ? void 0 : _a.cssClass) !== "undefined" && " " + accessors.data.cssClass(d, i, dataSeries.data, dataSeries)) || ""; };
2400
+ barContainers.merge(bars)
2460
2401
  .property(generatedAttrs, function (d, i) { return attrsGenerator(d, i); }) // This saves attrsGenerator() output to local d3 variable generatedAttrs
2461
2402
  .select("rect")
2462
2403
  // eslint-disable-next-line max-len
@@ -2465,9 +2406,8 @@
2465
2406
  .style("stroke-width", (_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.strokeWidth) !== null && _c !== void 0 ? _c : "")
2466
2407
  .style("fill", function (d, i) {
2467
2408
  var _a, _b;
2468
- return accessors.data.color
2469
- ? accessors.data.color(d, i, dataSeries.data, dataSeries)
2470
- : (_b = (_a = accessors.series).color) === null || _b === void 0 ? void 0 : _b.call(_a, dataSeries.id, dataSeries);
2409
+ return accessors.data.color ? accessors.data.color(d, i, dataSeries.data, dataSeries) :
2410
+ (_b = (_a = accessors.series).color) === null || _b === void 0 ? void 0 : _b.call(_a, dataSeries.id, dataSeries);
2471
2411
  })
2472
2412
  .attrs(function () {
2473
2413
  // @ts-ignore: Suppressing shadowed this and implicit any type error
@@ -2476,22 +2416,19 @@
2476
2416
  .select("rect")
2477
2417
  .style("fill", function (d, i) {
2478
2418
  var _a, _b;
2479
- return accessors.data.color
2480
- ? accessors.data.color(d, i, dataSeries.data, dataSeries)
2481
- : (_b = (_a = accessors.series).color) === null || _b === void 0 ? void 0 : _b.call(_a, dataSeries.id, dataSeries);
2419
+ return accessors.data.color ? accessors.data.color(d, i, dataSeries.data, dataSeries) :
2420
+ (_b = (_a = accessors.series).color) === null || _b === void 0 ? void 0 : _b.call(_a, dataSeries.id, dataSeries);
2482
2421
  })
2483
2422
  .attrs(generatedAttrs.get); // TODO: find a way to convert to ValueMap<>
2484
2423
  if (accessors.data.marker) {
2485
- barContainers.append("g").classed("bar-icon", true);
2486
- barContainers
2487
- .merge(bars)
2424
+ barContainers.append("g")
2425
+ .classed("bar-icon", true);
2426
+ barContainers.merge(bars)
2488
2427
  .select("g.bar-icon")
2489
2428
  .html(function (d, i) {
2490
2429
  var _a, _b;
2491
2430
  var barSize = generatedAttrs.get(this);
2492
- if (!barSize ||
2493
- isUndefined__default["default"](barSize === null || barSize === void 0 ? void 0 : barSize.height) ||
2494
- isUndefined__default["default"](barSize === null || barSize === void 0 ? void 0 : barSize.width)) {
2431
+ if (!barSize || isUndefined__default["default"](barSize === null || barSize === void 0 ? void 0 : barSize.height) || isUndefined__default["default"](barSize === null || barSize === void 0 ? void 0 : barSize.width)) {
2495
2432
  throw new Error("barSize is undefined");
2496
2433
  }
2497
2434
  var minBarSide = Math.min(barSize.height, barSize.width) - 1;
@@ -2501,9 +2438,7 @@
2501
2438
  })
2502
2439
  .attr("transform", function () {
2503
2440
  var barAttrs = generatedAttrs.get(this);
2504
- if (!barAttrs ||
2505
- isUndefined__default["default"](barAttrs === null || barAttrs === void 0 ? void 0 : barAttrs.height) ||
2506
- isUndefined__default["default"](barAttrs === null || barAttrs === void 0 ? void 0 : barAttrs.width)) {
2441
+ if (!barAttrs || isUndefined__default["default"](barAttrs === null || barAttrs === void 0 ? void 0 : barAttrs.height) || isUndefined__default["default"](barAttrs === null || barAttrs === void 0 ? void 0 : barAttrs.width)) {
2507
2442
  throw new Error("barAttrs is undefined");
2508
2443
  }
2509
2444
  return "translate(" + (barAttrs.x + barAttrs.width / 2) + ", " + (barAttrs.y + barAttrs.height / 2) + ")";
@@ -2533,9 +2468,7 @@
2533
2468
  dataSeries: renderSeries.dataSeries,
2534
2469
  index: i,
2535
2470
  data: data,
2536
- position: data
2537
- ? this.getDataPointPosition(renderSeries.dataSeries, i, renderSeries.scales)
2538
- : undefined,
2471
+ position: data ? this.getDataPointPosition(renderSeries.dataSeries, i, renderSeries.scales) : undefined,
2539
2472
  };
2540
2473
  };
2541
2474
  BarRenderer.prototype.filterDataByDomain = function (data) {
@@ -2544,18 +2477,13 @@
2544
2477
  BarRenderer.prototype.getDomain = function (data, dataSeries, scaleKey, scale) {
2545
2478
  var accessors = dataSeries.accessors.data;
2546
2479
  var accessorSuffix = scaleKey.toUpperCase();
2547
- var accessor = function (name) { return function (d, i, arr) {
2548
- var _a;
2549
- return (_a = accessors[name + accessorSuffix]) === null || _a === void 0 ? void 0 : _a.call(accessors, d, i, Array.from(arr), dataSeries);
2550
- }; };
2480
+ var accessor = function (name) { return function (d, i, arr) { var _a; return (_a = accessors[name + accessorSuffix]) === null || _a === void 0 ? void 0 : _a.call(accessors, d, i, Array.from(arr), dataSeries); }; };
2551
2481
  if (scale.isContinuous()) {
2552
- return !data || data.length === 0
2553
- ? EMPTY_CONTINUOUS_DOMAIN
2554
- : [d3Array.min(data, accessor("start")), d3Array.max(data, accessor("end"))];
2482
+ return !data || data.length === 0 ? EMPTY_CONTINUOUS_DOMAIN : [d3Array.min(data, accessor("start")), d3Array.max(data, accessor("end"))];
2555
2483
  }
2556
2484
  else {
2557
2485
  var values_1 = data && data.length > 0 ? data.map(accessor("start")) : [];
2558
- var maxLength = Math.max.apply(Math, __spreadArray([], __read(values_1.map(function (d) { return (isArray__default["default"](d) ? d.length : -1); }))));
2486
+ var maxLength = Math.max.apply(Math, __spreadArray([], __read(values_1.map(function (d) { return isArray__default["default"](d) ? d.length : -1; }))));
2559
2487
  if (maxLength >= 0) {
2560
2488
  return Array.from(Array(maxLength)).map(function (e, i) {
2561
2489
  var scalesDomains = values_1.map(function (d) { return i < d.length ? d[i] : []; });
@@ -2568,10 +2496,7 @@
2568
2496
  }
2569
2497
  };
2570
2498
  BarRenderer.prototype.emitBarClick = function (renderSeries, data, i, rendererSubject) {
2571
- rendererSubject.next({
2572
- eventName: SELECT_DATA_POINT_EVENT,
2573
- data: this.getDataPoint(renderSeries, data, i),
2574
- });
2499
+ rendererSubject.next({ eventName: SELECT_DATA_POINT_EVENT, data: this.getDataPoint(renderSeries, data, i) });
2575
2500
  };
2576
2501
  /**
2577
2502
  * Returns function to generate attributes to draw bar from dataSeries that typically comes from preprocessor with help of accessors that
@@ -2586,12 +2511,7 @@
2586
2511
  return function (d, i) {
2587
2512
  var x = _this.getDimensions(accessors, d, i, dataSeries, scales.x, "X");
2588
2513
  var y = _this.getDimensions(accessors, d, i, dataSeries, scales.y, "Y");
2589
- return {
2590
- x: x.start,
2591
- width: x.thickness,
2592
- y: y.start,
2593
- height: y.thickness,
2594
- };
2514
+ return { x: x.start, width: x.thickness, y: y.start, height: y.thickness };
2595
2515
  };
2596
2516
  };
2597
2517
  BarRenderer.prototype.getDimensions = function (accessors, d, i, dataSeries, scale, accessorSuffix) {
@@ -2605,9 +2525,7 @@
2605
2525
  if (!startAccessor) {
2606
2526
  throw new Error("Can't compute dimensions");
2607
2527
  }
2608
- start =
2609
- convert(scale, startAccessor(d, i, dataSeries.data, dataSeries), 0.5) -
2610
- thickness / 2;
2528
+ start = convert(scale, startAccessor(d, i, dataSeries.data, dataSeries), 0.5) - thickness / 2;
2611
2529
  }
2612
2530
  else {
2613
2531
  if (!startAccessor || !endAccessor) {
@@ -2782,15 +2700,13 @@
2782
2700
  dataPointIndex = dataSeries.data.length - 1;
2783
2701
  }
2784
2702
  var dataPoint = dataSeries.data[dataPointIndex];
2785
- if (!((_a = accessors.data) === null || _a === void 0 ? void 0 : _a.x) || !accessors.data.y) {
2703
+ if (!((_a = accessors.data) === null || _a === void 0 ? void 0 : _a.x) || !(accessors.data.y)) {
2786
2704
  throw new Error("Color or marker are undefined");
2787
2705
  }
2788
2706
  var x = scales.x.convert(accessors.data.x(dataPoint, dataPointIndex, dataSeries.data, dataSeries));
2789
2707
  var y = scales.y.convert(accessors.data.y(dataPoint, dataPointIndex, dataSeries.data, dataSeries));
2790
- if (typeof x !== "undefined" &&
2791
- typeof y !== "undefined" &&
2792
- isInRange(scales.x, x) &&
2793
- isInRange(scales.y, y)) {
2708
+ if (typeof x !== "undefined" && typeof y !== "undefined" &&
2709
+ isInRange(scales.x, x) && isInRange(scales.y, y)) {
2794
2710
  var seriesId = dataSeries.id;
2795
2711
  var dataPointInfo = {
2796
2712
  index: dataPointIndex,
@@ -2816,26 +2732,19 @@
2816
2732
  var xCoord = (_a = dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.position) === null || _a === void 0 ? void 0 : _a.x;
2817
2733
  var yCoord = (_b = dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.position) === null || _b === void 0 ? void 0 : _b.y;
2818
2734
  var attrs = {
2819
- transform: "translate(" + xCoord + ", " + yCoord + ")",
2820
- cursor: "crosshair",
2735
+ "transform": "translate(" + xCoord + ", " + yCoord + ")",
2736
+ "cursor": "crosshair",
2821
2737
  };
2822
2738
  var getPointerEventsClass = function () { return "" + (markerInteractionConfig.enabled ? " pointer-events" : ""); };
2823
- var getPointerEventsClickClass = function () { return "" + (markerInteractionConfig.enabled &&
2824
- markerInteractionConfig.clickable
2825
- ? " pointer-events-click"
2826
- : ""); };
2739
+ var getPointerEventsClickClass = function () { return "" + (markerInteractionConfig.enabled && markerInteractionConfig.clickable ? " pointer-events-click" : ""); };
2827
2740
  if (markerTarget.empty()) {
2828
- markerTarget = target
2829
- .append("g")
2741
+ markerTarget = target.append("g")
2830
2742
  .classed("" + className + getPointerEventsClass() + getPointerEventsClickClass(), true);
2831
2743
  }
2832
2744
  marker.setColor(color);
2833
2745
  markerTarget.attrs(attrs);
2834
2746
  markerTarget.on("mouseenter", function () {
2835
- dataPointSubject.next({
2836
- eventName: INTERACTION_DATA_POINT_EVENT,
2837
- data: { interactionType: exports.InteractionType.Hover, dataPoint: dataPoint },
2838
- });
2747
+ dataPointSubject.next({ eventName: INTERACTION_DATA_POINT_EVENT, data: { interactionType: exports.InteractionType.Hover, dataPoint: dataPoint } });
2839
2748
  });
2840
2749
  markerTarget.on("mouseleave", function () {
2841
2750
  dataPointSubject.next({
@@ -2847,31 +2756,20 @@
2847
2756
  });
2848
2757
  });
2849
2758
  markerTarget.on("click", function () {
2850
- dataPointSubject.next({
2851
- eventName: INTERACTION_DATA_POINT_EVENT,
2852
- data: { interactionType: exports.InteractionType.Click, dataPoint: dataPoint },
2853
- });
2759
+ dataPointSubject.next({ eventName: INTERACTION_DATA_POINT_EVENT, data: { interactionType: exports.InteractionType.Click, dataPoint: dataPoint } });
2854
2760
  });
2855
- if (!markerTarget
2856
- .selectAll("g > *")
2857
- .size() &&
2858
- markerTarget.node()) {
2859
- (_c = markerTarget
2860
- .node()) === null || _c === void 0 ? void 0 : _c.appendChild(bits.UtilService.getSvgFromString(marker.getSvg()));
2861
- markerTarget
2862
- .select("path")
2863
- .classed(MarkerUtils.MARKER_PATH_CLASS, true);
2864
- }
2865
- var path = markerTarget
2866
- .select("path")
2867
- .node();
2761
+ if (!markerTarget.selectAll("g > *").size() && markerTarget.node()) {
2762
+ (_c = markerTarget.node()) === null || _c === void 0 ? void 0 : _c.appendChild(bits.UtilService.getSvgFromString(marker.getSvg()));
2763
+ markerTarget.select("path").classed(MarkerUtils.MARKER_PATH_CLASS, true);
2764
+ }
2765
+ var path = markerTarget.select("path").node();
2868
2766
  if (path && markerInteractionConfig.enabled) {
2869
2767
  // Hack to accommodate existing Firefox hack in MouseInteractiveArea
2870
2768
  var pathRect = path.getBoundingClientRect();
2871
2769
  // 'x' in this case represents the absolute position of the left side of the marker
2872
- path.setAttribute("x", Math.ceil(((_d = dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.position) === null || _d === void 0 ? void 0 : _d.x) - pathRect.width / 2).toString());
2770
+ path.setAttribute("x", Math.ceil((((_d = dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.position) === null || _d === void 0 ? void 0 : _d.x) - pathRect.width / 2)).toString());
2873
2771
  // 'y' in this case represents the absolute position of the top side of the marker
2874
- path.setAttribute("y", Math.ceil(((_e = dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.position) === null || _e === void 0 ? void 0 : _e.y) - pathRect.height / 2).toString());
2772
+ path.setAttribute("y", Math.ceil((((_e = dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.position) === null || _e === void 0 ? void 0 : _e.y) - pathRect.height / 2)).toString());
2875
2773
  }
2876
2774
  };
2877
2775
  MarkerUtils.removeMarker = function (target, className) {
@@ -2928,16 +2826,15 @@
2928
2826
  var strokeValue = (_b = (_a = renderSeries.dataSeries.accessors.series).color) === null || _b === void 0 ? void 0 : _b.call(_a, renderSeries.dataSeries.id, renderSeries.dataSeries);
2929
2827
  var path = target.select("path.main");
2930
2828
  if (path.empty()) {
2931
- path = target
2932
- .append("path")
2829
+ path = target.append("path")
2933
2830
  .classed("main", true)
2934
2831
  // Assigning null value to match ValueMap<GElement, Datum> D3's signature
2935
2832
  .attrs({
2936
- stroke: strokeValue !== null && strokeValue !== void 0 ? strokeValue : null,
2833
+ "stroke": strokeValue !== null && strokeValue !== void 0 ? strokeValue : null,
2937
2834
  "stroke-width": (_c = this.config.strokeWidth) !== null && _c !== void 0 ? _c : null,
2938
2835
  "stroke-dasharray": (_d = this.config.strokeStyle) !== null && _d !== void 0 ? _d : null,
2939
2836
  "stroke-linecap": (_e = this.config.strokeLinecap) !== null && _e !== void 0 ? _e : null,
2940
- fill: "none",
2837
+ "fill": "none",
2941
2838
  });
2942
2839
  }
2943
2840
  this.drawLine(renderSeries, path);
@@ -2952,8 +2849,7 @@
2952
2849
  */
2953
2850
  LineRenderer.prototype.isInfiniteLineData = function (renderSeries) {
2954
2851
  var dataSeries = renderSeries.dataSeries;
2955
- return (dataSeries.data.length === 1 &&
2956
- typeof dataSeries.accessors.data.x(dataSeries.data[0], 0, dataSeries.data, dataSeries) === "undefined");
2852
+ return dataSeries.data.length === 1 && typeof dataSeries.accessors.data.x(dataSeries.data[0], 0, dataSeries.data, dataSeries) === "undefined";
2957
2853
  };
2958
2854
  /**
2959
2855
  * Renders the line in prepared <path> element
@@ -3000,10 +2896,8 @@
3000
2896
  var accessors = dataSeries.accessors;
3001
2897
  var warned = false;
3002
2898
  var validatedData = dataSeries.data.filter(function (d, i) {
3003
- var valid = typeof accessors.data.x(d, i, dataSeries.data, dataSeries) !==
3004
- "undefined" &&
3005
- typeof accessors.data.y(d, i, dataSeries.data, dataSeries) !==
3006
- "undefined";
2899
+ var valid = typeof accessors.data.x(d, i, dataSeries.data, dataSeries) !== "undefined" &&
2900
+ typeof accessors.data.y(d, i, dataSeries.data, dataSeries) !== "undefined";
3007
2901
  if (!valid && !warned) {
3008
2902
  console.warn("Data point", d, "was skipped as accessors didn't manage to extract any data.");
3009
2903
  console.warn(" -> accessors.data.x:", accessors.data.x);
@@ -3018,9 +2912,7 @@
3018
2912
  var lineFunc = d3Shape.line()
3019
2913
  .x(function (d, i) { return renderSeries.scales.x.convert(accessors.data.x(d, i, dataSeries.data, dataSeries)); })
3020
2914
  .y(function (d, i) { return renderSeries.scales.y.convert(accessors.data.y(d, i, dataSeries.data, dataSeries)); })
3021
- .defined(function (d, i) { return accessors.data.defined
3022
- ? accessors.data.defined(d, i, dataSeries.data, dataSeries)
3023
- : true; })
2915
+ .defined(function (d, i) { return accessors.data.defined ? accessors.data.defined(d, i, dataSeries.data, dataSeries) : true; })
3024
2916
  .curve(this.config.curveType);
3025
2917
  path.attr("d", (_a = lineFunc(validatedData)) !== null && _a !== void 0 ? _a : "");
3026
2918
  if (this.config.useEnhancedLineCaps) {
@@ -3042,29 +2934,23 @@
3042
2934
  if (!result) {
3043
2935
  throw new Error("Line cannot be computed");
3044
2936
  }
3045
- path.attr("shape-rendering", "crispEdges").attr("d", result);
2937
+ path
2938
+ .attr("shape-rendering", "crispEdges")
2939
+ .attr("d", result);
3046
2940
  };
3047
2941
  LineRenderer.prototype.updateLineCaps = function (validatedData, renderSeries, fill) {
3048
2942
  var _a, _b, _c;
3049
2943
  var dataSeries = renderSeries.dataSeries;
3050
2944
  var accessors = dataSeries.accessors;
3051
- var definedData = validatedData.filter(function (d, i) {
3052
- var _a, _b;
3053
- return ((_a = accessors === null || accessors === void 0 ? void 0 : accessors.data) === null || _a === void 0 ? void 0 : _a.defined)
3054
- ? (_b = accessors === null || accessors === void 0 ? void 0 : accessors.data) === null || _b === void 0 ? void 0 : _b.defined(d, i, dataSeries.data, dataSeries)
3055
- : true;
3056
- });
2945
+ var definedData = validatedData.filter(function (d, i) { var _a, _b; return ((_a = accessors === null || accessors === void 0 ? void 0 : accessors.data) === null || _a === void 0 ? void 0 : _a.defined) ? (_b = accessors === null || accessors === void 0 ? void 0 : accessors.data) === null || _b === void 0 ? void 0 : _b.defined(d, i, dataSeries.data, dataSeries) : true; });
3057
2946
  var updateCx = function (d, i) { return renderSeries.scales.x.convert(accessors.data.x(d, i, dataSeries.data, dataSeries)); };
3058
2947
  var updateCy = function (d, i) { return renderSeries.scales.y.convert(accessors.data.y(d, i, dataSeries.data, dataSeries)); };
3059
2948
  // use an unclipped layer to ensure the line caps on the left and right sides of the chart don't get clipped
3060
- var lineCaps = renderSeries.containers[exports.RenderLayerName.unclippedData]
3061
- .selectAll("." + LineRenderer.LINE_CAP_CLASS_NAME)
2949
+ var lineCaps = renderSeries.containers[exports.RenderLayerName.unclippedData].selectAll("." + LineRenderer.LINE_CAP_CLASS_NAME)
3062
2950
  .data(definedData)
3063
2951
  .attr("cx", updateCx)
3064
2952
  .attr("cy", updateCy);
3065
- lineCaps
3066
- .enter()
3067
- .append("circle")
2953
+ lineCaps.enter().append("circle")
3068
2954
  .attr("class", LineRenderer.LINE_CAP_CLASS_NAME)
3069
2955
  .attr("r", (_a = this.config.enhancedLineCap) === null || _a === void 0 ? void 0 : _a.radius)
3070
2956
  .attr("cx", updateCx)
@@ -3127,15 +3013,12 @@
3127
3013
  var scales = renderSeries.scales;
3128
3014
  var accessors = renderSeries.dataSeries.accessors;
3129
3015
  var rect = target.select("rect");
3130
- var isActive = dataSeries.data.length > 0
3131
- ? accessors.data.active(dataSeries.data[0], 0, renderSeries.dataSeries.data, renderSeries.dataSeries)
3132
- : false;
3133
- var colorAccessor = !isActive && accessors.series.inactiveColor
3134
- ? accessors.series.inactiveColor
3135
- : accessors.series.activeColor;
3016
+ var isActive = dataSeries.data.length > 0 ?
3017
+ accessors.data.active(dataSeries.data[0], 0, renderSeries.dataSeries.data, renderSeries.dataSeries) : false;
3018
+ var colorAccessor = !isActive && accessors.series.inactiveColor ? accessors.series.inactiveColor : accessors.series.activeColor;
3136
3019
  if (rect.empty()) {
3137
3020
  rect = target.append("rect").attrs({
3138
- fill: colorAccessor(dataSeries.id, dataSeries),
3021
+ "fill": colorAccessor(dataSeries.id, dataSeries),
3139
3022
  });
3140
3023
  if (!isActive && !accessors.series.inactiveColor) {
3141
3024
  rect.style("filter", GRAYSCALE_FILTER);
@@ -3144,16 +3027,14 @@
3144
3027
  var start = accessors.series.start(dataSeries.id, dataSeries);
3145
3028
  var end = accessors.series.end(dataSeries.id, dataSeries);
3146
3029
  var top = end == null ? 0 : scales.y.convert(end);
3147
- var bottom = start == null
3148
- ? scales.y.range()[0]
3149
- : Math.min(scales.y.range()[0], scales.y.convert(start));
3030
+ var bottom = start == null ? scales.y.range()[0] : Math.min(scales.y.range()[0], scales.y.convert(start));
3150
3031
  var height = bottom - top;
3151
3032
  var width = 2;
3152
3033
  rect.attrs({
3153
- x: -width,
3154
- y: top,
3155
- height: height < 0 ? 0 : height,
3156
- width: width,
3034
+ "x": -width,
3035
+ "y": top,
3036
+ "height": height < 0 ? 0 : height,
3037
+ "width": width,
3157
3038
  });
3158
3039
  };
3159
3040
  /** See {@link Renderer#getDataPointIndex} */
@@ -3162,7 +3043,9 @@
3162
3043
  };
3163
3044
  /** See {@link Renderer#getRequiredLayers} */
3164
3045
  SideIndicatorRenderer.prototype.getRequiredLayers = function () {
3165
- return [STANDARD_RENDER_LAYERS[exports.RenderLayerName.unclippedData]];
3046
+ return [
3047
+ STANDARD_RENDER_LAYERS[exports.RenderLayerName.unclippedData],
3048
+ ];
3166
3049
  };
3167
3050
  return SideIndicatorRenderer;
3168
3051
  }(XYRenderer));
@@ -3195,7 +3078,7 @@
3195
3078
  */
3196
3079
  ThresholdsService.prototype.injectThresholdsData = function (dataSeries, zones) {
3197
3080
  var zoneIndexes = {};
3198
- zones.forEach(function (z) { return (z.entered = false); });
3081
+ zones.forEach(function (z) { return z.entered = false; });
3199
3082
  for (var i = 0; i < dataSeries.data.length; i++) {
3200
3083
  var d = dataSeries.data[i];
3201
3084
  var x = dataSeries.accessors.data.x(d, i, dataSeries.data, dataSeries);
@@ -3227,8 +3110,7 @@
3227
3110
  ThresholdsService.prototype.getBackgrounds = function (sourceSeries, zones, scales, colorProvider, thicknessMap, rendererConfig) {
3228
3111
  if (thicknessMap === void 0) { thicknessMap = {}; }
3229
3112
  if (rendererConfig === void 0) { rendererConfig = cloneDeep__default["default"](THRESHOLDS_MAIN_CHART_RENDERER_CONFIG); }
3230
- if (sourceSeries.data.length > 0 &&
3231
- typeof sourceSeries.data[0].__thresholds === "undefined") {
3113
+ if (sourceSeries.data.length > 0 && typeof sourceSeries.data[0].__thresholds === "undefined") {
3232
3114
  this.loggerService.warn("Thresholds metadata is not defined on provided data series", sourceSeries);
3233
3115
  }
3234
3116
  var data;
@@ -3238,9 +3120,8 @@
3238
3120
  data = cloneDeep__default["default"](sourceSeries.data);
3239
3121
  accessors.data.start = sourceSeries.accessors.data.x;
3240
3122
  accessors.data.end = sourceSeries.accessors.data.x;
3241
- accessors.data.color = function (d) { return d.__thresholds && d.__thresholds.status
3242
- ? colorProvider.get(d.__thresholds.status)
3243
- : "transparent"; };
3123
+ accessors.data.color = function (d) { return (d.__thresholds && d.__thresholds.status) ?
3124
+ colorProvider.get(d.__thresholds.status) : "transparent"; };
3244
3125
  accessors.data.thickness = function (d) { return thicknessMap[d.__thresholds.status]; };
3245
3126
  }
3246
3127
  else {
@@ -3272,25 +3153,16 @@
3272
3153
  if (!p1 || !p2) {
3273
3154
  throw new Error("p1 or p2 are undefined");
3274
3155
  }
3275
- var midPoint = {
3276
- x: (p1.x + p2.x) / 2,
3277
- y: (p1.y + p2.y) / 2,
3278
- };
3156
+ var midPoint = { x: (p1.x + p2.x) / 2, y: (p1.y + p2.y) / 2 };
3279
3157
  var zone = this.getZoneByXY(zones, zoneIndexes, midPoint.x, midPoint.y);
3280
3158
  if (zone) {
3281
3159
  var lastBgPoint = backgroundData[backgroundData.length - 1];
3282
- if (lastBgPoint &&
3283
- ((_a = lastBgPoint.end) === null || _a === void 0 ? void 0 : _a.valueOf()) === p1.x &&
3284
- lastBgPoint.status === zone.value) {
3160
+ if (lastBgPoint && ((_a = lastBgPoint.end) === null || _a === void 0 ? void 0 : _a.valueOf()) === p1.x && lastBgPoint.status === zone.value) {
3285
3161
  // Extend previous data point instead of creating a new one
3286
3162
  lastBgPoint.end = new Date(p2.x);
3287
3163
  }
3288
3164
  else {
3289
- backgroundData.push({
3290
- status: zone.value,
3291
- start: new Date(p1.x),
3292
- end: new Date(p2.x),
3293
- });
3165
+ backgroundData.push({ status: zone.value, start: new Date(p1.x), end: new Date(p2.x) });
3294
3166
  }
3295
3167
  }
3296
3168
  }
@@ -3313,30 +3185,19 @@
3313
3185
  var d2 = sourceSeries.data[i + 1];
3314
3186
  // calculate their positions
3315
3187
  var xy1 = {
3316
- x: sourceAccessors
3317
- .x(d1, i, sourceSeries.data, sourceSeries)
3318
- .valueOf(),
3319
- y: sourceAccessors
3320
- .y(d1, i, sourceSeries.data, sourceSeries)
3321
- .valueOf(),
3188
+ x: sourceAccessors.x(d1, i, sourceSeries.data, sourceSeries).valueOf(),
3189
+ y: sourceAccessors.y(d1, i, sourceSeries.data, sourceSeries).valueOf(),
3322
3190
  };
3323
3191
  var xy2 = {
3324
- x: sourceAccessors
3325
- .x(d2, i + 1, sourceSeries.data, sourceSeries)
3326
- .valueOf(),
3327
- y: sourceAccessors
3328
- .y(d2, i + 1, sourceSeries.data, sourceSeries)
3329
- .valueOf(),
3192
+ x: sourceAccessors.x(d2, i + 1, sourceSeries.data, sourceSeries).valueOf(),
3193
+ y: sourceAccessors.y(d2, i + 1, sourceSeries.data, sourceSeries).valueOf(),
3330
3194
  };
3331
3195
  var _loop_2 = function (j) {
3332
3196
  var zone = zones[j];
3333
3197
  // TODO: so far only works with constant thresholds
3334
3198
  var zoneStartY = (_b = (_a = zone.accessors.data).start) === null || _b === void 0 ? void 0 : _b.call(_a, zone.data[0], 0, zone.data, zone);
3335
3199
  var zoneEndY = (_d = (_c = zone.accessors.data).end) === null || _d === void 0 ? void 0 : _d.call(_c, zone.data[0], 0, zone.data, zone);
3336
- var zoneCrossPoints = [
3337
- zoneStartY,
3338
- zoneEndY,
3339
- ]
3200
+ var zoneCrossPoints = [zoneStartY, zoneEndY]
3340
3201
  .map(function (y) { return _this.getCrossPointWithY(xy1, xy2, y); }) // calculate cross points for both limits
3341
3202
  .filter(function (c) { return c; }); // take only those that actually intersect
3342
3203
  [xy1, xy2].forEach(function (xy) {
@@ -3374,7 +3235,9 @@
3374
3235
  return simpleZones.map(function (z, i) { return ({
3375
3236
  id: sourceSeries.id + "__" + z.status + "-" + i,
3376
3237
  value: z.status,
3377
- data: [{ start: z.start, end: z.end }],
3238
+ data: [
3239
+ { start: z.start, end: z.end },
3240
+ ],
3378
3241
  scales: sourceSeries.scales,
3379
3242
  accessors: areaAccessors,
3380
3243
  }); });
@@ -3394,8 +3257,7 @@
3394
3257
  var limits = {};
3395
3258
  function addLimitEntry(accessor, zone, zoneBoundary) {
3396
3259
  var value = accessor(zone.data[0], 0, zone.data, zone);
3397
- if (typeof value !== "undefined" &&
3398
- typeof limits[value] === "undefined") {
3260
+ if (typeof value !== "undefined" && typeof limits[value] === "undefined") {
3399
3261
  limits[value] = { series: zone, accessor: accessor, zoneBoundary: zoneBoundary };
3400
3262
  }
3401
3263
  }
@@ -3465,19 +3327,17 @@
3465
3327
  x: thresholdTo.x - thresholdFrom.x,
3466
3328
  y: thresholdTo.y - thresholdFrom.y,
3467
3329
  };
3468
- var s = (-dataShift.y * (dataFrom.x - thresholdFrom.x) +
3469
- dataShift.x * (dataFrom.y - thresholdFrom.y)) /
3470
- (-thresholdShift.x * dataShift.y + dataShift.x * thresholdShift.y);
3471
- var t = (thresholdShift.x * (dataFrom.y - thresholdFrom.y) -
3472
- thresholdShift.y * (dataFrom.x - thresholdFrom.x)) /
3473
- (-thresholdShift.x * dataShift.y + dataShift.x * thresholdShift.y);
3330
+ var s = (-dataShift.y * (dataFrom.x - thresholdFrom.x) + dataShift.x * (dataFrom.y - thresholdFrom.y))
3331
+ / (-thresholdShift.x * dataShift.y + dataShift.x * thresholdShift.y);
3332
+ var t = (thresholdShift.x * (dataFrom.y - thresholdFrom.y) - thresholdShift.y * (dataFrom.x - thresholdFrom.x))
3333
+ / (-thresholdShift.x * dataShift.y + dataShift.x * thresholdShift.y);
3474
3334
  if (!(s >= 0 && s <= 1 && t >= 0 && t <= 1)) {
3475
3335
  // No cross point detected
3476
3336
  return undefined;
3477
3337
  }
3478
3338
  return {
3479
- x: dataFrom.x + t * dataShift.x,
3480
- y: dataFrom.y + t * dataShift.y,
3339
+ x: dataFrom.x + (t * dataShift.x),
3340
+ y: dataFrom.y + (t * dataShift.y),
3481
3341
  };
3482
3342
  };
3483
3343
  /**
@@ -3522,8 +3382,7 @@
3522
3382
  return null;
3523
3383
  };
3524
3384
  ThresholdsService.prototype.moveZoneIndex = function (zoneIndex, zone, x) {
3525
- while (zoneIndex < zone.data.length - 1 &&
3526
- zone.accessors.data.x(zone.data[zoneIndex + 1], zoneIndex + 1, zone.data, zone) < x) {
3385
+ while (zoneIndex < zone.data.length - 1 && zone.accessors.data.x(zone.data[zoneIndex + 1], zoneIndex + 1, zone.data, zone) < x) {
3527
3386
  zoneIndex++;
3528
3387
  }
3529
3388
  return zoneIndex;
@@ -3592,7 +3451,12 @@
3592
3451
  }());
3593
3452
  NuiChartsModule.decorators = [
3594
3453
  { type: core.NgModule, args: [{
3595
- imports: [bits.NuiCommonModule, bits.NuiIconModule, bits.NuiPopoverModule, overlay.OverlayModule],
3454
+ imports: [
3455
+ bits.NuiCommonModule,
3456
+ bits.NuiIconModule,
3457
+ bits.NuiPopoverModule,
3458
+ overlay.OverlayModule,
3459
+ ],
3596
3460
  declarations: [
3597
3461
  LegendComponent,
3598
3462
  LegendSeriesComponent,
@@ -3621,7 +3485,10 @@
3621
3485
  ChartTooltipComponent,
3622
3486
  ChartTooltipDirective,
3623
3487
  ],
3624
- providers: [ChartCollectionService, ThresholdsService],
3488
+ providers: [
3489
+ ChartCollectionService,
3490
+ ThresholdsService,
3491
+ ],
3625
3492
  },] }
3626
3493
  ];
3627
3494
 
@@ -3706,9 +3573,7 @@
3706
3573
  __extends(VerticalBarAccessors, _super);
3707
3574
  function VerticalBarAccessors(colorProvider, markerProvider) {
3708
3575
  var _this = _super.call(this, colorProvider, markerProvider) || this;
3709
- _this.data = Object.assign(Object.assign({}, _this.data), { startX: function (d, i, s, ds) { return _this.data.category(d, i, s, ds); }, endX: function (d, i, s, ds) { return _this.data.category(d, i, s, ds); }, thicknessX: function (d, i, s, ds) { return _this.data.thickness
3710
- ? _this.data.thickness(d, i, s, ds)
3711
- : undefined; }, startY: function (d, i, s, ds) { return _this.data.start(d, i, s, ds); }, endY: function (d, i, s, ds) { return _this.data.end(d, i, s, ds); } });
3576
+ _this.data = Object.assign(Object.assign({}, _this.data), { startX: function (d, i, s, ds) { return _this.data.category(d, i, s, ds); }, endX: function (d, i, s, ds) { return _this.data.category(d, i, s, ds); }, thicknessX: function (d, i, s, ds) { return _this.data.thickness ? _this.data.thickness(d, i, s, ds) : undefined; }, startY: function (d, i, s, ds) { return _this.data.start(d, i, s, ds); }, endY: function (d, i, s, ds) { return _this.data.end(d, i, s, ds); } });
3712
3577
  return _this;
3713
3578
  }
3714
3579
  return VerticalBarAccessors;
@@ -3726,17 +3591,13 @@
3726
3591
  if (nonEmptyDomains.length === 0) {
3727
3592
  return EMPTY_CONTINUOUS_DOMAIN;
3728
3593
  }
3729
- var domainMin = d3Array.min(nonEmptyDomains
3730
- .filter(function (e) { return typeof e[0] !== undefined; })
3731
- .map(function (e) { return e[0]; }));
3732
- var domainMax = d3Array.max(nonEmptyDomains
3733
- .filter(function (e) { return typeof e[1] !== undefined; })
3734
- .map(function (e) { return e[1]; }));
3594
+ var domainMin = d3Array.min(nonEmptyDomains.filter(function (e) { return typeof e[0] !== undefined; }).map(function (e) { return e[0]; }));
3595
+ var domainMax = d3Array.max(nonEmptyDomains.filter(function (e) { return typeof e[1] !== undefined; }).map(function (e) { return e[1]; }));
3735
3596
  return [domainMin, domainMax];
3736
3597
  }
3737
3598
  var maxLength = Math.max.apply(Math, __spreadArray([], __read(domains.map(function (d) { return d.length; }))));
3738
3599
  return Array.from(Array(maxLength)).map(function (e, i) {
3739
- var scalesDomains = domains.map(function (d) { return (i < d.length ? d[i] : []); });
3600
+ var scalesDomains = domains.map(function (d) { return i < d.length ? d[i] : []; });
3740
3601
  return uniq__default["default"](flatten__default["default"](scalesDomains));
3741
3602
  });
3742
3603
  }
@@ -3788,9 +3649,7 @@
3788
3649
  // find fixed, continuous scales that are referenced by this series
3789
3650
  var filterScales = Object.keys(fixedDomains).reduce(function (result, next) {
3790
3651
  var seriesScale = cs.scales[next];
3791
- if (seriesScale &&
3792
- seriesScale.isContinuous() &&
3793
- indexOf__default["default"](fixedDomains[next], seriesScale) !== -1) {
3652
+ if (seriesScale && seriesScale.isContinuous() && indexOf__default["default"](fixedDomains[next], seriesScale) !== -1) {
3794
3653
  result[next] = seriesScale;
3795
3654
  }
3796
3655
  return result;
@@ -3808,10 +3667,7 @@
3808
3667
  */
3809
3668
  var getAutomaticDomainWithIncludedInterval = function (interval) { return function (chartSeriesSet, scaleId, scale) {
3810
3669
  var automaticDomain = getAutomaticDomain(chartSeriesSet, scaleId, scale);
3811
- return [
3812
- Math.min(automaticDomain[0], interval[0]),
3813
- Math.max(automaticDomain[1], interval[1]),
3814
- ];
3670
+ return [Math.min(automaticDomain[0], interval[0]), Math.max(automaticDomain[1], interval[1])];
3815
3671
  }; };
3816
3672
 
3817
3673
  var Scale = /** @class */ (function () {
@@ -3948,9 +3804,7 @@
3948
3804
  else {
3949
3805
  // bisector needs to have values sorted in natural order, so we reverse the domain first ...
3950
3806
  var rangeMidPoints = this.getRangeMidPoints(domain.map(function (d, i) { return _this._d3Scale(domain[domain.length - 1 - i /* ... here ... */]); }));
3951
- return domain[domain.length -
3952
- 1 -
3953
- d3Array.bisect(rangeMidPoints, coordinate) /* ... and reverse it back here */];
3807
+ return domain[domain.length - 1 - d3Array.bisect(rangeMidPoints, coordinate) /* ... and reverse it back here */];
3954
3808
  }
3955
3809
  };
3956
3810
  BandScale.prototype.range = function (range) {
@@ -4001,16 +3855,15 @@
4001
3855
  * Please note the fact that bandScale._d3Scale.step() returns step size without outer paddings!
4002
3856
  */
4003
3857
  BandScale.prototype.step = function () {
4004
- return this.domain().length
4005
- ? Math.abs(this.range()[1] - this.range()[0]) / this.domain().length
4006
- : 0;
3858
+ return this.domain().length ? Math.abs(this.range()[1] - this.range()[0]) / this.domain().length : 0;
4007
3859
  };
4008
3860
  /**
4009
3861
  * Creates linear scale with domain and range that are equal to current scale's range
4010
3862
  */
4011
3863
  BandScale.prototype.copyToLinear = function () {
4012
3864
  var scale = new LinearScale();
4013
- scale.domain(this.range()).range(this.range());
3865
+ scale.domain(this.range())
3866
+ .range(this.range());
4014
3867
  return scale;
4015
3868
  };
4016
3869
  /**
@@ -4032,10 +3885,8 @@
4032
3885
  };
4033
3886
  BandScale.prototype.getRangeMidPoints = function (coords) {
4034
3887
  var _this = this;
4035
- return coords
4036
- .slice(1)
4037
- .map(function (d) { return d -
4038
- (_this._d3Scale.step() * _this._d3Scale.paddingInner()) / 2; });
3888
+ return coords.slice(1)
3889
+ .map(function (d) { return d - _this._d3Scale.step() * _this._d3Scale.paddingInner() / 2; });
4039
3890
  };
4040
3891
  return BandScale;
4041
3892
  }(Scale));
@@ -4103,30 +3954,23 @@
4103
3954
  // last value in the thresholds series is the max value of the gauge (needed by RadialGaugeThresholdsRenderer).
4104
3955
  // removing this value to avoid rendering a marker for it
4105
3956
  data.pop();
4106
- var markerSelection = dataContainer
4107
- .selectAll("circle." + GAUGE_THRESHOLD_MARKER_CLASS)
4108
- .data(data);
3957
+ var markerSelection = dataContainer.selectAll("circle." + GAUGE_THRESHOLD_MARKER_CLASS).data(data);
4109
3958
  markerSelection.exit().remove();
4110
- markerSelection
4111
- .enter()
3959
+ markerSelection.enter()
4112
3960
  .append("circle")
4113
3961
  .attr("class", GAUGE_THRESHOLD_MARKER_CLASS)
4114
3962
  .merge(markerSelection)
4115
- .attr("cx", function (d, i) {
4116
- var _a, _b;
4117
- return renderSeries.scales.x.convert((_b = (_a = accessors === null || accessors === void 0 ? void 0 : accessors.data) === null || _a === void 0 ? void 0 : _a.endX) === null || _b === void 0 ? void 0 : _b.call(_a, d, i, dataSeries.data, dataSeries));
4118
- })
4119
- .attr("cy", function (d, i) {
4120
- var _a, _b;
4121
- return renderSeries.scales.y.convert((_b = (_a = accessors === null || accessors === void 0 ? void 0 : accessors.data) === null || _a === void 0 ? void 0 : _a.endY) === null || _b === void 0 ? void 0 : _b.call(_a, d, i, dataSeries.data, dataSeries));
4122
- })
3963
+ .attr("cx", function (d, i) { var _a, _b; return renderSeries.scales.x.convert((_b = (_a = accessors === null || accessors === void 0 ? void 0 : accessors.data) === null || _a === void 0 ? void 0 : _a.endX) === null || _b === void 0 ? void 0 : _b.call(_a, d, i, dataSeries.data, dataSeries)); })
3964
+ .attr("cy", function (d, i) { var _a, _b; return renderSeries.scales.y.convert((_b = (_a = accessors === null || accessors === void 0 ? void 0 : accessors.data) === null || _a === void 0 ? void 0 : _a.endY) === null || _b === void 0 ? void 0 : _b.call(_a, d, i, dataSeries.data, dataSeries)); })
4123
3965
  .attr("r", this.config.markerRadius)
4124
3966
  .style("fill", function (d, i) { return "var(--nui-color-" + (data[i].hit ? "text-light" : "icon-default") + ")"; })
4125
3967
  .style("stroke-width", 0);
4126
3968
  };
4127
3969
  /** See {@link Renderer#getRequiredLayers} */
4128
3970
  LinearGaugeThresholdsRenderer.prototype.getRequiredLayers = function () {
4129
- return [STANDARD_RENDER_LAYERS[exports.RenderLayerName.unclippedData]];
3971
+ return [
3972
+ STANDARD_RENDER_LAYERS[exports.RenderLayerName.unclippedData],
3973
+ ];
4130
3974
  };
4131
3975
  return LinearGaugeThresholdsRenderer;
4132
3976
  }(BarRenderer));
@@ -4136,7 +3980,7 @@
4136
3980
  if (colorProvider === void 0) { colorProvider = defaultColorProvider(); }
4137
3981
  this.colorProvider = colorProvider;
4138
3982
  this.data = {
4139
- value: function (d) { return (Number.isFinite(d) ? d : d.value); },
3983
+ value: function (d) { return Number.isFinite(d) ? d : d.value; },
4140
3984
  };
4141
3985
  this.series = {
4142
3986
  color: this.colorProvider ? this.colorProvider.get : undefined,
@@ -4198,10 +4042,10 @@
4198
4042
  return separateArc(d);
4199
4043
  };
4200
4044
  this.segmentWidth = this.getSegmentWidth(renderSeries);
4201
- var g = dataContainer.selectAll("path.arc").data(data);
4045
+ var g = dataContainer.selectAll("path.arc")
4046
+ .data(data);
4202
4047
  g.exit().remove();
4203
- g.enter()
4204
- .append("path")
4048
+ g.enter().append("path")
4205
4049
  .attr("class", "arc pointer-events nui-chart--path__outline")
4206
4050
  .style("stroke-width", this.config.strokeWidth)
4207
4051
  .style("cursor", this.config.cursor)
@@ -4227,9 +4071,9 @@
4227
4071
  .attr("d", arcGenerator)
4228
4072
  .attr("fill", function (d, i) {
4229
4073
  var _a, _b;
4230
- return accessors.data.color
4231
- ? accessors.data.color(d.data, i, data, renderSeries.dataSeries)
4232
- : (_b = (_a = accessors.series).color) === null || _b === void 0 ? void 0 : _b.call(_a, renderSeries.dataSeries.id, renderSeries.dataSeries);
4074
+ return accessors.data.color ?
4075
+ accessors.data.color(d.data, i, data, renderSeries.dataSeries) :
4076
+ (_b = (_a = accessors.series).color) === null || _b === void 0 ? void 0 : _b.call(_a, renderSeries.dataSeries.id, renderSeries.dataSeries);
4233
4077
  });
4234
4078
  };
4235
4079
  /** See {@link Renderer#getDataPointPosition} */
@@ -4248,30 +4092,22 @@
4248
4092
  };
4249
4093
  };
4250
4094
  RadialRenderer.prototype.getInnerRadius = function (range, index) {
4251
- if (isUndefined__default["default"](this.segmentWidth) ||
4252
- isUndefined__default["default"](this.config.annularPadding)) {
4095
+ if (isUndefined__default["default"](this.segmentWidth) || isUndefined__default["default"](this.config.annularPadding)) {
4253
4096
  throw new Error("Can't compute inner radius");
4254
4097
  }
4255
- var calculatedRadius = range[1] -
4256
- range[0] -
4257
- this.segmentWidth -
4258
- index * (this.config.annularPadding + this.segmentWidth);
4098
+ var calculatedRadius = (range[1] - range[0] - this.segmentWidth) - index * (this.config.annularPadding + this.segmentWidth);
4259
4099
  return calculatedRadius >= 0 ? calculatedRadius : 0;
4260
4100
  };
4261
4101
  RadialRenderer.prototype.getOuterRadius = function (range, index) {
4262
- if (isUndefined__default["default"](this.segmentWidth) ||
4263
- isUndefined__default["default"](this.config.annularPadding)) {
4102
+ if (isUndefined__default["default"](this.segmentWidth) || isUndefined__default["default"](this.config.annularPadding)) {
4264
4103
  throw new Error("Can't compute outer radius");
4265
4104
  }
4266
- var calculatedRadius = range[1] -
4267
- range[0] -
4268
- index * (this.config.annularPadding + this.segmentWidth);
4105
+ var calculatedRadius = (range[1] - range[0]) - index * (this.config.annularPadding + this.segmentWidth);
4269
4106
  return calculatedRadius >= 0 ? calculatedRadius : 0;
4270
4107
  };
4271
4108
  RadialRenderer.prototype.getArc = function (range, generatedArc, index) {
4272
4109
  var innerRadius = this.getInnerRadius(range, index);
4273
- return generatedArc
4274
- .outerRadius(this.getOuterRadius(range, index))
4110
+ return generatedArc.outerRadius(this.getOuterRadius(range, index))
4275
4111
  .innerRadius(innerRadius);
4276
4112
  };
4277
4113
  RadialRenderer.prototype.getSegmentWidth = function (renderSeries) {
@@ -4279,9 +4115,7 @@
4279
4115
  return this.config.annularWidth;
4280
4116
  }
4281
4117
  else {
4282
- return Math.min((renderSeries.scales.r.range()[1] -
4283
- renderSeries.scales.r.range()[0]) *
4284
- this.config.annularGrowth, this.config.maxThickness);
4118
+ return Math.min((renderSeries.scales.r.range()[1] - renderSeries.scales.r.range()[0]) * this.config.annularGrowth, this.config.maxThickness);
4285
4119
  }
4286
4120
  };
4287
4121
  RadialRenderer.prototype.emitDataPointHighlight = function (renderSeries, data, i, rendererSubject) {
@@ -4295,16 +4129,10 @@
4295
4129
  position: position,
4296
4130
  };
4297
4131
  if (this.config.enableSeriesHighlighting) {
4298
- rendererSubject.next({
4299
- eventName: HIGHLIGHT_SERIES_EVENT,
4300
- data: dataPoint,
4301
- });
4132
+ rendererSubject.next({ eventName: HIGHLIGHT_SERIES_EVENT, data: dataPoint });
4302
4133
  }
4303
4134
  if (this.config.enableDataPointHighlighting) {
4304
- rendererSubject.next({
4305
- eventName: HIGHLIGHT_DATA_POINT_EVENT,
4306
- data: dataPoint,
4307
- });
4135
+ rendererSubject.next({ eventName: HIGHLIGHT_DATA_POINT_EVENT, data: dataPoint });
4308
4136
  }
4309
4137
  // we're emitting this event manually, because it's not triggered by mouse interactive area in this case
4310
4138
  rendererSubject.next({
@@ -4385,12 +4213,10 @@
4385
4213
  var markerGenerator = d3Shape.arc()
4386
4214
  .outerRadius(this.getOuterRadius(renderSeries.scales.r.range(), 0))
4387
4215
  .innerRadius(innerRadius >= 0 ? innerRadius : 0);
4388
- var markerSelection = dataContainer
4389
- .selectAll("circle." + GAUGE_THRESHOLD_MARKER_CLASS)
4216
+ var markerSelection = dataContainer.selectAll("circle." + GAUGE_THRESHOLD_MARKER_CLASS)
4390
4217
  .data(DonutGaugeRenderingUtil.generateThresholdArcData(data));
4391
4218
  markerSelection.exit().remove();
4392
- markerSelection
4393
- .enter()
4219
+ markerSelection.enter()
4394
4220
  .append("circle")
4395
4221
  .attr("class", GAUGE_THRESHOLD_MARKER_CLASS)
4396
4222
  .merge(markerSelection)
@@ -4485,10 +4311,7 @@
4485
4311
  this.toggleSeries = function (seriesId, visible) {
4486
4312
  _this.legendInteractionAssist.setGroupVisibility(seriesId, visible);
4487
4313
  _this.update(_this.inputSeriesSet, false);
4488
- _this.chartAssistSubject.next({
4489
- type: exports.ChartAssistEventType.ToggleSeries,
4490
- payload: { seriesId: seriesId, visible: visible },
4491
- });
4314
+ _this.chartAssistSubject.next({ type: exports.ChartAssistEventType.ToggleSeries, payload: { seriesId: seriesId, visible: visible } });
4492
4315
  };
4493
4316
  /**
4494
4317
  * Resets all visible series to default state
@@ -4496,10 +4319,7 @@
4496
4319
  this.resetVisibleSeries = function () {
4497
4320
  _this.legendInteractionAssist.resetSeries();
4498
4321
  _this.publishRenderStates();
4499
- _this.chartAssistSubject.next({
4500
- type: exports.ChartAssistEventType.ResetVisibleSeries,
4501
- payload: {},
4502
- });
4322
+ _this.chartAssistSubject.next({ type: exports.ChartAssistEventType.ResetVisibleSeries, payload: {} });
4503
4323
  };
4504
4324
  /**
4505
4325
  * For series that are currently visible, emphasize the given series and deemphasizes all the other ones
@@ -4509,10 +4329,7 @@
4509
4329
  this.emphasizeSeries = function (seriesId) {
4510
4330
  _this.legendInteractionAssist.emphasizeSeries(seriesId);
4511
4331
  _this.publishRenderStates();
4512
- _this.chartAssistSubject.next({
4513
- type: exports.ChartAssistEventType.EmphasizeSeries,
4514
- payload: { seriesId: seriesId },
4515
- });
4332
+ _this.chartAssistSubject.next({ type: exports.ChartAssistEventType.EmphasizeSeries, payload: { seriesId: seriesId } });
4516
4333
  };
4517
4334
  this.getVisibleSeriesWithLegend = function () { return _this.legendSeriesSet.filter(function (s) { return !_this.isSeriesHidden(s.id); }); };
4518
4335
  this.configureChartEventSubscriptions(chart.getEventBus());
@@ -4574,18 +4391,14 @@
4574
4391
  * @param chartSeries
4575
4392
  */
4576
4393
  ChartAssist.prototype.legendLabelData$ = function (chartSeries) {
4577
- var seriesHighlight$ = this.chart
4578
- .getEventBus()
4579
- .getStream(INTERACTION_DATA_POINTS_EVENT)
4580
- .asObservable()
4394
+ var seriesHighlight$ = this.chart.getEventBus().getStream(INTERACTION_DATA_POINTS_EVENT).asObservable()
4581
4395
  .pipe(operators.filter(function (event) { return event.data.interactionType === exports.InteractionType.MouseMove; }), operators.map(function (event) { return event.data.dataPoints[chartSeries.id]; }));
4582
4396
  // if there is no highlightData, or index is "-1", we'll show the last value from series (if possible)
4583
4397
  var highlightDataPresentPredicate = function (highlightData) { return highlightData && highlightData.index >= 0; };
4584
- return seriesHighlight$.pipe(operators.switchMap(function (highlightData) { return highlightDataPresentPredicate(highlightData)
4398
+ return seriesHighlight$
4399
+ .pipe(operators.switchMap(function (highlightData) { return highlightDataPresentPredicate(highlightData)
4585
4400
  ? rxjs.of(highlightData.data)
4586
- : rxjs.of(chartSeries.data && chartSeries.data.length
4587
- ? chartSeries.data[chartSeries.data.length - 1]
4588
- : null); }));
4401
+ : rxjs.of((chartSeries.data && chartSeries.data.length) ? chartSeries.data[chartSeries.data.length - 1] : null); }));
4589
4402
  };
4590
4403
  ChartAssist.prototype.seriesProcessor = function (series) {
4591
4404
  return series;
@@ -4614,15 +4427,15 @@
4614
4427
  return item.id;
4615
4428
  };
4616
4429
  /**
4617
- * Retrieves the display value for the highlighted data point on the specified series
4618
- *
4619
- * @param chartSeries The series containing the highlighted data point to get a label for
4620
- * @param scaleKey The key for the scale potentially containing a formatter that can be used to format the label
4621
- * @param formatterName The name of the formatter to use for formatting the label
4622
- * @param dataAccessorKey The accessor key to use for accessing the data value if the accessor key differs from the scale key
4623
- *
4624
- * @returns The display value for the highlighted data point
4625
- */
4430
+ * Retrieves the display value for the highlighted data point on the specified series
4431
+ *
4432
+ * @param chartSeries The series containing the highlighted data point to get a label for
4433
+ * @param scaleKey The key for the scale potentially containing a formatter that can be used to format the label
4434
+ * @param formatterName The name of the formatter to use for formatting the label
4435
+ * @param dataAccessorKey The accessor key to use for accessing the data value if the accessor key differs from the scale key
4436
+ *
4437
+ * @returns The display value for the highlighted data point
4438
+ */
4626
4439
  ChartAssist.prototype.getHighlightedValue = function (chartSeries, scaleKey, formatterName, dataAccessorKey) {
4627
4440
  if (!this.highlightedDataPoints) {
4628
4441
  return undefined;
@@ -4643,11 +4456,8 @@
4643
4456
  ChartAssist.prototype.syncWithChartAssist = function (chartAssist) {
4644
4457
  var _this = this;
4645
4458
  this.getVisibleSeriesWithLegendBackup = this.getVisibleSeriesWithLegend;
4646
- this.getVisibleSeriesWithLegend =
4647
- chartAssist.getVisibleSeriesWithLegend;
4648
- this.syncSubscription = chartAssist.chartAssistSubject
4649
- .pipe(operators.takeUntil(chartAssist.chart.getEventBus().getStream(DESTROY_EVENT)))
4650
- .subscribe(function (event) {
4459
+ this.getVisibleSeriesWithLegend = chartAssist.getVisibleSeriesWithLegend;
4460
+ this.syncSubscription = chartAssist.chartAssistSubject.pipe(operators.takeUntil(chartAssist.chart.getEventBus().getStream(DESTROY_EVENT))).subscribe(function (event) {
4651
4461
  var _b;
4652
4462
  var args = Object.keys(event.payload).map(function (key) { return event.payload[key]; });
4653
4463
  (_b = _this.syncHandlerMap)[event.type].apply(_b, __spreadArray([], __read(args)));
@@ -4715,9 +4525,8 @@
4715
4525
  // override render states
4716
4526
  for (var _c = __values(seriesSet.filter(function (s) { return s.renderState; })), _d = _c.next(); !_d.done; _d = _c.next()) {
4717
4527
  var series = _d.value;
4718
- this.renderStatesIndex[series.id] = new ChartAssistRenderStateData(series.id, series, series.renderState === exports.RenderState.hidden
4719
- ? exports.RenderState.default
4720
- : series.renderState, series.renderState !== exports.RenderState.hidden);
4528
+ this.renderStatesIndex[series.id] =
4529
+ new ChartAssistRenderStateData(series.id, series, series.renderState === exports.RenderState.hidden ? exports.RenderState.default : series.renderState, series.renderState !== exports.RenderState.hidden);
4721
4530
  }
4722
4531
  }
4723
4532
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -4742,7 +4551,7 @@
4742
4551
  for (var seriesSet_1 = __values(seriesSet), seriesSet_1_1 = seriesSet_1.next(); !seriesSet_1_1.done; seriesSet_1_1 = seriesSet_1.next()) {
4743
4552
  var s = seriesSet_1_1.value;
4744
4553
  var separatorIndex = s.id.indexOf("__");
4745
- var parentId = separatorIndex >= 0 ? s.id.substring(0, separatorIndex) : s.id;
4554
+ var parentId = (separatorIndex >= 0) ? s.id.substring(0, separatorIndex) : s.id;
4746
4555
  if (!seriesGroups[parentId]) {
4747
4556
  seriesGroups[parentId] = [];
4748
4557
  }
@@ -4809,9 +4618,7 @@
4809
4618
  try {
4810
4619
  for (var _c = __values(Object.keys(this.seriesGroups)), _d = _c.next(); !_d.done; _d = _c.next()) {
4811
4620
  var group = _d.value;
4812
- this.setGroupState(group, group === seriesId
4813
- ? exports.RenderState.emphasized
4814
- : exports.RenderState.deemphasized);
4621
+ this.setGroupState(group, group === seriesId ? exports.RenderState.emphasized : exports.RenderState.deemphasized);
4815
4622
  }
4816
4623
  }
4817
4624
  catch (e_5_1) { e_5 = { error: e_5_1 }; }
@@ -4879,18 +4686,16 @@
4879
4686
  if (!seriesSet[0]) {
4880
4687
  return seriesSet;
4881
4688
  }
4882
- var pieGenerator = d3Shape.pie().sort(null);
4689
+ var pieGenerator = d3Shape.pie()
4690
+ .sort(null);
4883
4691
  var seriesNeededOnlyToKnowHowManyLayersDonutHas = seriesSet[0].data;
4884
4692
  var rawArcDataForAllSeries = seriesNeededOnlyToKnowHowManyLayersDonutHas.reduce(function (accumulator, value) {
4885
- accumulator.push(seriesSet.map(function (s) { return isVisible(s) && !s.excludeFromArcCalculation
4886
- ? s.accessors.data.value(s.data[accumulator.length], accumulator.length, s.data, s)
4887
- : 0; }));
4693
+ accumulator.push(seriesSet.map(function (s) { return isVisible(s) && !s.excludeFromArcCalculation ?
4694
+ s.accessors.data.value(s.data[accumulator.length], accumulator.length, s.data, s) : 0; }));
4888
4695
  return accumulator;
4889
4696
  }, []);
4890
4697
  var pieData = rawArcDataForAllSeries.map(function (rawArcData) { return pieGenerator(rawArcData); });
4891
- return seriesSet.map(function (s, index) { return (Object.assign(Object.assign({}, s), { data: s.preprocess === false
4892
- ? s.data
4893
- : pieData.map(function (d) { return (Object.assign(Object.assign({}, d[index]), { data: s.data[0] })); }) })); });
4698
+ return seriesSet.map(function (s, index) { return (Object.assign(Object.assign({}, s), { data: s.preprocess === false ? s.data : pieData.map(function (d) { return (Object.assign(Object.assign({}, d[index]), { data: s.data[0] })); }) })); });
4894
4699
  }
4895
4700
  function radial(chartSeriesSet) {
4896
4701
  var _this = this;
@@ -4939,8 +4744,7 @@
4939
4744
  var metadata = {};
4940
4745
  var coef = isVisible(chartSeries) ? 1 : 0;
4941
4746
  metadata.start = acc[i];
4942
- acc[i] +=
4943
- (valueAccessor(datum, dataIndex[category], chartSeries.data, chartSeries) || 0) * coef;
4747
+ acc[i] += (valueAccessor(datum, dataIndex[category], chartSeries.data, chartSeries) || 0) * coef;
4944
4748
  metadata.end = acc[i];
4945
4749
  datum["__bar"] = metadata;
4946
4750
  reorderedData.push(datum);
@@ -5026,11 +4830,9 @@
5026
4830
  }
5027
4831
  if (scale.domainCalculator) {
5028
4832
  var chartSeriesSet = this.chartSeriesSet
5029
- .filter(function (cs) { return cs.scales[scaleKey] === scale &&
5030
- !cs.renderer.config.ignoreForDomainCalculation; })
4833
+ .filter(function (cs) { return cs.scales[scaleKey] === scale && !cs.renderer.config.ignoreForDomainCalculation; })
5031
4834
  .filter(function (c) { return c.renderState !== exports.RenderState.hidden; });
5032
- if (chartSeriesSet.length ||
5033
- ((_b = (_a = this.chart) === null || _a === void 0 ? void 0 : _a.configuration) === null || _b === void 0 ? void 0 : _b.updateDomainForEmptySeries)) {
4835
+ if (chartSeriesSet.length || ((_b = (_a = this.chart) === null || _a === void 0 ? void 0 : _a.configuration) === null || _b === void 0 ? void 0 : _b.updateDomainForEmptySeries)) {
5034
4836
  var calculatedDomain = scale.domainCalculator(chartSeriesSet, scaleKey, scale);
5035
4837
  domain(scale, calculatedDomain);
5036
4838
  }
@@ -5099,23 +4901,18 @@
5099
4901
  var scaleValidity = {};
5100
4902
  each__default["default"](this.dataManager.chartSeriesSet, function (chartSeries) {
5101
4903
  var childContainers = _this.getSeriesChildContainers(chartSeries.id);
5102
- var areDomainsValid = -1 ===
5103
- Object.values(chartSeries.scales).findIndex(function (scale) {
5104
- if (typeof scaleValidity[scale.id] === "undefined") {
5105
- var isValid = scale.isDomainValid();
5106
- if (!isValid) {
5107
- console.warn("Invalid scale domain detected for scale:", scale);
5108
- }
5109
- scaleValidity[scale.id] = isValid;
4904
+ var areDomainsValid = -1 === Object.values(chartSeries.scales).findIndex(function (scale) {
4905
+ if (typeof scaleValidity[scale.id] === "undefined") {
4906
+ var isValid = scale.isDomainValid();
4907
+ if (!isValid) {
4908
+ console.warn("Invalid scale domain detected for scale:", scale);
5110
4909
  }
5111
- return !scaleValidity[scale.id];
5112
- });
4910
+ scaleValidity[scale.id] = isValid;
4911
+ }
4912
+ return !scaleValidity[scale.id];
4913
+ });
5113
4914
  if (areDomainsValid) {
5114
- chartSeries.renderer.draw({
5115
- dataSeries: chartSeries,
5116
- containers: childContainers,
5117
- scales: chartSeries.scales,
5118
- }, _this.rendererSubject);
4915
+ chartSeries.renderer.draw({ dataSeries: chartSeries, containers: childContainers, scales: chartSeries.scales }, _this.rendererSubject);
5119
4916
  }
5120
4917
  });
5121
4918
  };
@@ -5157,10 +4954,8 @@
5157
4954
  };
5158
4955
  if (payload.interactionType === exports.InteractionType.MouseMove) {
5159
4956
  var prevHighlight = _this.highlightedDataPoints[chartSeries.id];
5160
- if (!isUndefined__default["default"](dataIndex) &&
5161
- (isUndefined__default["default"](prevHighlight) ||
5162
- dataIndex === DATA_POINT_INTERACTION_RESET ||
5163
- dataIndex !== prevHighlight.index)) {
4957
+ if (!isUndefined__default["default"](dataIndex) && (isUndefined__default["default"](prevHighlight) ||
4958
+ (dataIndex === DATA_POINT_INTERACTION_RESET || dataIndex !== prevHighlight.index))) {
5164
4959
  highlightChangeDetected = true;
5165
4960
  _this.rendererSubject.next({
5166
4961
  eventName: HIGHLIGHT_DATA_POINT_EVENT,
@@ -5172,12 +4967,8 @@
5172
4967
  result[chartSeries.id] = dataPoint;
5173
4968
  return result;
5174
4969
  }, {});
5175
- if (payload.interactionType !== exports.InteractionType.MouseMove ||
5176
- highlightChangeDetected) {
5177
- this.interactionDataPointsSubject.next({
5178
- interactionType: payload.interactionType,
5179
- dataPoints: interactionDataPoints,
5180
- });
4970
+ if (payload.interactionType !== exports.InteractionType.MouseMove || highlightChangeDetected) {
4971
+ this.interactionDataPointsSubject.next({ interactionType: payload.interactionType, dataPoints: interactionDataPoints });
5181
4972
  }
5182
4973
  if (highlightChangeDetected) {
5183
4974
  this.highlightedDataPoints = interactionDataPoints;
@@ -5233,8 +5024,7 @@
5233
5024
  var layerIndex = {};
5234
5025
  each__default["default"](chartSeriesSet, function (chartSeries) {
5235
5026
  each__default["default"](chartSeries.renderer.getRequiredLayers(), function (layerDef) {
5236
- if (STANDARD_RENDER_LAYERS[layerDef.name] &&
5237
- !isEqual__default["default"](STANDARD_RENDER_LAYERS[layerDef.name], layerDef)) {
5027
+ if (STANDARD_RENDER_LAYERS[layerDef.name] && !isEqual__default["default"](STANDARD_RENDER_LAYERS[layerDef.name], layerDef)) {
5238
5028
  throw new Error("Custom definition detected for render layer \"" + layerDef.name + "\". " +
5239
5029
  "Custom layers must use a name not already taken by the predefined layer set.");
5240
5030
  }
@@ -5264,8 +5054,7 @@
5264
5054
  var _this = this;
5265
5055
  each__default["default"](this.layerIndex, function (layerData) {
5266
5056
  if (!_this.renderLayers[layerData.layerDefinition.name]) {
5267
- _this.renderLayers[layerData.layerDefinition.name] =
5268
- _this.lasagna.addLayer(layerData.layerDefinition);
5057
+ _this.renderLayers[layerData.layerDefinition.name] = _this.lasagna.addLayer(layerData.layerDefinition);
5269
5058
  }
5270
5059
  });
5271
5060
  };
@@ -5273,16 +5062,13 @@
5273
5062
  var _this = this;
5274
5063
  each__default["default"](Object.keys(this.renderLayers), function (layerName) {
5275
5064
  var renderLayer = _this.renderLayers[layerName];
5276
- var containers = renderLayer
5277
- .selectAll("g.data-series-container")
5065
+ var containers = renderLayer.selectAll("g.data-series-container")
5278
5066
  .data(_this.layerIndex[layerName].seriesUsing, function (d) { return d.id; })
5279
5067
  .order();
5280
- containers
5281
- .enter()
5282
- .append("g")
5068
+ containers.enter().append("g")
5283
5069
  .attrs({
5284
- id: function (d) { return _this.getChildContainerId(layerName, d.id); },
5285
- class: "data-series-container",
5070
+ "id": function (d) { return _this.getChildContainerId(layerName, d.id); },
5071
+ "class": "data-series-container",
5286
5072
  });
5287
5073
  containers.exit().remove();
5288
5074
  });
@@ -5325,44 +5111,26 @@
5325
5111
  RenderEnginePlugin.prototype.initialize = function () {
5326
5112
  var _this = this;
5327
5113
  this.renderEngine = this.chart.getRenderEngine();
5328
- this.chart
5329
- .getEventBus()
5330
- .getStream(INTERACTION_VALUES_EVENT)
5114
+ this.chart.getEventBus().getStream(INTERACTION_VALUES_EVENT)
5331
5115
  .pipe(operators.takeUntil(this.destroy$))
5332
5116
  .subscribe(function (event) {
5333
5117
  _this.lastInteractionValuesPayload = event.data;
5334
5118
  if (_this.isChartInView) {
5335
- _this.chart
5336
- .getRenderEngine()
5337
- .emitInteractionDataPoints(_this.lastInteractionValuesPayload);
5119
+ _this.chart.getRenderEngine().emitInteractionDataPoints(_this.lastInteractionValuesPayload);
5338
5120
  }
5339
5121
  });
5340
- this.renderEngine.interactionDataPointsSubject
5341
- .pipe(operators.takeUntil(this.destroy$))
5342
- .subscribe(function (event) {
5343
- _this.chart
5344
- .getEventBus()
5345
- .getStream(INTERACTION_DATA_POINTS_EVENT)
5346
- .next({ data: event });
5122
+ this.renderEngine.interactionDataPointsSubject.pipe(operators.takeUntil(this.destroy$)).subscribe(function (event) {
5123
+ _this.chart.getEventBus().getStream(INTERACTION_DATA_POINTS_EVENT).next({ data: event });
5347
5124
  });
5348
- this.renderEngine.rendererSubject
5349
- .pipe(operators.takeUntil(this.destroy$))
5350
- .subscribe(function (event) {
5351
- _this.chart
5352
- .getEventBus()
5353
- .getStream(event.eventName)
5354
- .next({ data: event.data });
5125
+ this.renderEngine.rendererSubject.pipe(operators.takeUntil(this.destroy$)).subscribe(function (event) {
5126
+ _this.chart.getEventBus().getStream(event.eventName).next({ data: event.data });
5355
5127
  });
5356
- this.chart
5357
- .getEventBus()
5358
- .getStream(CHART_VIEW_STATUS_EVENT)
5128
+ this.chart.getEventBus().getStream(CHART_VIEW_STATUS_EVENT)
5359
5129
  .pipe(operators.takeUntil(this.destroy$))
5360
5130
  .subscribe(function (event) {
5361
5131
  _this.isChartInView = event.data.isChartInView;
5362
5132
  if (_this.isChartInView && _this.lastInteractionValuesPayload) {
5363
- _this.chart
5364
- .getRenderEngine()
5365
- .emitInteractionDataPoints(_this.lastInteractionValuesPayload);
5133
+ _this.chart.getRenderEngine().emitInteractionDataPoints(_this.lastInteractionValuesPayload);
5366
5134
  }
5367
5135
  });
5368
5136
  };
@@ -5460,8 +5228,7 @@
5460
5228
  }
5461
5229
  };
5462
5230
  Chart.prototype.hasPlugin = function (classRef) {
5463
- return (-1 !==
5464
- this.plugins.findIndex(function (plugin) { return plugin instanceof classRef; }));
5231
+ return -1 !== this.plugins.findIndex(function (plugin) { return plugin instanceof classRef; });
5465
5232
  };
5466
5233
  Chart.prototype.build = function (element) {
5467
5234
  var e_3, _c;
@@ -5471,9 +5238,9 @@
5471
5238
  this.target = d3Selection.select(this.element)
5472
5239
  .append("svg")
5473
5240
  .attrs({
5474
- class: "nui-chart",
5475
- height: "100%",
5476
- width: "100%",
5241
+ "class": "nui-chart",
5242
+ "height": "100%",
5243
+ "width": "100%",
5477
5244
  });
5478
5245
  this.configureCssFilters();
5479
5246
  this.buildGrid();
@@ -5498,14 +5265,11 @@
5498
5265
  }
5499
5266
  this.initialize();
5500
5267
  var untilDestroy = function () { return operators.takeUntil(_this.getEventBus().getStream(DESTROY_EVENT)); };
5501
- this.updateSubject
5502
- .pipe(untilDestroy())
5268
+ this.updateSubject.pipe(untilDestroy())
5503
5269
  .subscribe(function (d) { return _this.onUpdate(d); });
5504
- this.updateDimensionsSubject
5505
- .pipe(untilDestroy())
5270
+ this.updateDimensionsSubject.pipe(untilDestroy())
5506
5271
  .subscribe(function () { return _this.onUpdateDimensions(); });
5507
- this.seriesStatesSubject
5508
- .pipe(untilDestroy())
5272
+ this.seriesStatesSubject.pipe(untilDestroy())
5509
5273
  .subscribe(function (rs) { return _this.onSetSeriesStates(rs); });
5510
5274
  };
5511
5275
  Chart.prototype.configureCssFilters = function () {
@@ -5548,9 +5312,7 @@
5548
5312
  };
5549
5313
  Chart.prototype.setSeriesStates = function (renderStateData) {
5550
5314
  this.seriesStatesSubject.next(renderStateData);
5551
- this.eventBus
5552
- .getStream(SERIES_STATE_CHANGE_EVENT)
5553
- .next({ data: renderStateData });
5315
+ this.eventBus.getStream(SERIES_STATE_CHANGE_EVENT).next({ data: renderStateData });
5554
5316
  };
5555
5317
  Chart.prototype.onUpdate = function (seriesSet) {
5556
5318
  this.dataManager.update(seriesSet);
@@ -5616,17 +5378,11 @@
5616
5378
  order: STANDARD_RENDER_LAYERS[exports.RenderLayerName.data].order,
5617
5379
  clipped: false,
5618
5380
  });
5619
- this.chart
5620
- .getEventBus()
5621
- .getStream(INTERACTION_DATA_POINTS_EVENT)
5622
- .pipe(operators.takeUntil(this.destroy$))
5623
- .subscribe(function (event) {
5381
+ this.chart.getEventBus().getStream(INTERACTION_DATA_POINTS_EVENT).pipe(operators.takeUntil(this.destroy$)).subscribe(function (event) {
5624
5382
  var gaugeThresholdLabelsGroup = _this.lasagnaLayer.select("." + GAUGE_LABELS_CONTAINER_CLASS);
5625
5383
  if (!gaugeThresholdLabelsGroup.empty()) {
5626
5384
  var dataPoints_1 = event.data.dataPoints;
5627
- var labelOpacity = Object.keys(dataPoints_1).find(function (key, index) { return dataPoints_1[key].index === DATA_POINT_NOT_FOUND; })
5628
- ? 0
5629
- : 1;
5385
+ var labelOpacity = Object.keys(dataPoints_1).find(function (key, index) { return dataPoints_1[key].index === DATA_POINT_NOT_FOUND; }) ? 0 : 1;
5630
5386
  gaugeThresholdLabelsGroup.style("opacity", labelOpacity);
5631
5387
  }
5632
5388
  });
@@ -5646,17 +5402,14 @@
5646
5402
  DonutGaugeLabelsPlugin.prototype.drawThresholdLabels = function () {
5647
5403
  var _this = this;
5648
5404
  var _a, _b;
5649
- var thresholdsSeries = this.chart
5650
- .getDataManager()
5651
- .chartSeriesSet.find(function (series) { return series.renderer instanceof DonutGaugeThresholdsRenderer; });
5405
+ var thresholdsSeries = this.chart.getDataManager().chartSeriesSet.find(function (series) { return series.renderer instanceof DonutGaugeThresholdsRenderer; });
5652
5406
  if (isUndefined__default["default"](thresholdsSeries)) {
5653
5407
  console.warn("Threshold series is undefined. As a result, threshold labels for the donut gauge will not be rendered.");
5654
5408
  return;
5655
5409
  }
5656
5410
  var gaugeThresholdsLabelsGroup = this.lasagnaLayer.select("." + GAUGE_LABELS_CONTAINER_CLASS);
5657
5411
  if (gaugeThresholdsLabelsGroup.empty()) {
5658
- gaugeThresholdsLabelsGroup = this.lasagnaLayer
5659
- .append("svg:g")
5412
+ gaugeThresholdsLabelsGroup = this.lasagnaLayer.append("svg:g")
5660
5413
  .attr("class", GAUGE_LABELS_CONTAINER_CLASS)
5661
5414
  .style("opacity", 0);
5662
5415
  }
@@ -5675,12 +5428,10 @@
5675
5428
  }
5676
5429
  // ensure the data is sorted in ascending order by value since we're using it to calculate circle arcs
5677
5430
  data.sort(function (a, b) { return a.value - b.value; });
5678
- var labelSelection = gaugeThresholdsLabelsGroup
5679
- .selectAll("text." + GAUGE_THRESHOLD_LABEL_CLASS)
5431
+ var labelSelection = gaugeThresholdsLabelsGroup.selectAll("text." + GAUGE_THRESHOLD_LABEL_CLASS)
5680
5432
  .data(DonutGaugeRenderingUtil.generateThresholdArcData(data));
5681
5433
  labelSelection.exit().remove();
5682
- labelSelection
5683
- .enter()
5434
+ labelSelection.enter()
5684
5435
  .append("text")
5685
5436
  .attr("class", GAUGE_THRESHOLD_LABEL_CLASS)
5686
5437
  .merge(labelSelection)
@@ -5743,8 +5494,7 @@
5743
5494
  _this.xTranslate = function (d, i) {
5744
5495
  var _a, _b, _c, _d, _e;
5745
5496
  if (_this.isHorizontal) {
5746
- var thresholdsSeries = _this
5747
- .thresholdsSeries;
5497
+ var thresholdsSeries = _this.thresholdsSeries;
5748
5498
  var value = (_d = (_c = (_b = (_a = _this.thresholdsSeries) === null || _a === void 0 ? void 0 : _a.accessors) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.call(_c, d, i, thresholdsSeries === null || thresholdsSeries === void 0 ? void 0 : thresholdsSeries.data, thresholdsSeries);
5749
5499
  return (_e = _this.thresholdsSeries) === null || _e === void 0 ? void 0 : _e.scales.x.convert(value);
5750
5500
  }
@@ -5755,8 +5505,7 @@
5755
5505
  if (_this.isHorizontal) {
5756
5506
  return _this.getLabelOffset();
5757
5507
  }
5758
- var thresholdsSeries = _this
5759
- .thresholdsSeries;
5508
+ var thresholdsSeries = _this.thresholdsSeries;
5760
5509
  var value = (_d = (_c = (_b = (_a = _this.thresholdsSeries) === null || _a === void 0 ? void 0 : _a.accessors) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.call(_c, d, i, thresholdsSeries === null || thresholdsSeries === void 0 ? void 0 : thresholdsSeries.data, thresholdsSeries);
5761
5510
  return (_e = _this.thresholdsSeries) === null || _e === void 0 ? void 0 : _e.scales.y.convert(value);
5762
5511
  };
@@ -5770,11 +5519,7 @@
5770
5519
  order: STANDARD_RENDER_LAYERS[exports.RenderLayerName.data].order,
5771
5520
  clipped: false,
5772
5521
  });
5773
- this.chart
5774
- .getEventBus()
5775
- .getStream(MOUSE_ACTIVE_EVENT)
5776
- .pipe(operators.takeUntil(this.destroy$))
5777
- .subscribe(function (event) {
5522
+ this.chart.getEventBus().getStream(MOUSE_ACTIVE_EVENT).pipe(operators.takeUntil(this.destroy$)).subscribe(function (event) {
5778
5523
  var gaugeThresholdLabelsGroup = _this.lasagnaLayer.select("." + GAUGE_LABELS_CONTAINER_CLASS);
5779
5524
  if (!gaugeThresholdLabelsGroup.empty()) {
5780
5525
  gaugeThresholdLabelsGroup.style("opacity", event.data ? 1 : 0);
@@ -5797,11 +5542,8 @@
5797
5542
  };
5798
5543
  LinearGaugeLabelsPlugin.prototype.updateData = function () {
5799
5544
  var _a;
5800
- this.thresholdsSeries = this.chart
5801
- .getDataManager()
5802
- .chartSeriesSet.find(function (series) { return series.id === GAUGE_THRESHOLD_MARKERS_SERIES_ID; });
5803
- this.isHorizontal =
5804
- ((_a = this.thresholdsSeries) === null || _a === void 0 ? void 0 : _a.scales.x) instanceof LinearScale;
5545
+ this.thresholdsSeries = this.chart.getDataManager().chartSeriesSet.find(function (series) { return series.id === GAUGE_THRESHOLD_MARKERS_SERIES_ID; });
5546
+ this.isHorizontal = ((_a = this.thresholdsSeries) === null || _a === void 0 ? void 0 : _a.scales.x) instanceof LinearScale;
5805
5547
  };
5806
5548
  LinearGaugeLabelsPlugin.prototype.drawThresholdLabels = function () {
5807
5549
  var _this = this;
@@ -5812,14 +5554,11 @@
5812
5554
  }
5813
5555
  var gaugeThresholdsLabelsGroup = this.lasagnaLayer.select("." + GAUGE_LABELS_CONTAINER_CLASS);
5814
5556
  if (gaugeThresholdsLabelsGroup.empty()) {
5815
- gaugeThresholdsLabelsGroup = this.lasagnaLayer
5816
- .append("svg:g")
5557
+ gaugeThresholdsLabelsGroup = this.lasagnaLayer.append("svg:g")
5817
5558
  .attr("class", GAUGE_LABELS_CONTAINER_CLASS)
5818
5559
  .style("opacity", 0);
5819
5560
  }
5820
- var data = cloneDeep__default["default"](this.config.disableThresholdLabels
5821
- ? []
5822
- : (_a = this.thresholdsSeries) === null || _a === void 0 ? void 0 : _a.data);
5561
+ var data = cloneDeep__default["default"](this.config.disableThresholdLabels ? [] : (_a = this.thresholdsSeries) === null || _a === void 0 ? void 0 : _a.data);
5823
5562
  if (isUndefined__default["default"](data)) {
5824
5563
  throw new Error("Gauge threshold series data is undefined");
5825
5564
  }
@@ -5827,12 +5566,9 @@
5827
5566
  // removing this value to avoid rendering a label for it
5828
5567
  data.pop();
5829
5568
  var formatter = (_c = (_b = this.thresholdsSeries) === null || _b === void 0 ? void 0 : _b.scales[this.isHorizontal ? "x" : "y"].formatters[this.config.formatterName]) !== null && _c !== void 0 ? _c : (function (d) { return d; });
5830
- var labelSelection = gaugeThresholdsLabelsGroup
5831
- .selectAll("text." + GAUGE_THRESHOLD_LABEL_CLASS)
5832
- .data(data);
5569
+ var labelSelection = gaugeThresholdsLabelsGroup.selectAll("text." + GAUGE_THRESHOLD_LABEL_CLASS).data(data);
5833
5570
  labelSelection.exit().remove();
5834
- labelSelection
5835
- .enter()
5571
+ labelSelection.enter()
5836
5572
  .append("text")
5837
5573
  .attr("class", GAUGE_THRESHOLD_LABEL_CLASS)
5838
5574
  .merge(labelSelection)
@@ -5846,12 +5582,10 @@
5846
5582
  var labelStart = 0;
5847
5583
  if (!this.config.flippedLabels) {
5848
5584
  var gridDimensions = this.chart.getGrid().config().dimension;
5849
- labelStart = this.isHorizontal
5850
- ? gridDimensions.height()
5851
- : gridDimensions.width();
5585
+ labelStart = this.isHorizontal ? gridDimensions.height() : gridDimensions.width();
5852
5586
  }
5853
5587
  var padding = this.config.padding;
5854
- padding = this.config.flippedLabels ? -padding : padding;
5588
+ padding = this.config.flippedLabels ? -(padding) : padding;
5855
5589
  return labelStart + padding;
5856
5590
  };
5857
5591
  LinearGaugeLabelsPlugin.prototype.getTextAnchor = function () {
@@ -5972,9 +5706,7 @@
5972
5706
  function Lasagna(target, clipPath) {
5973
5707
  this.clipPath = clipPath;
5974
5708
  this.layers = [];
5975
- this.container = target
5976
- .append("g")
5977
- .attr("class", Lasagna.CONTAINER_CLASS + " pointer-events");
5709
+ this.container = target.append("g").attr("class", Lasagna.CONTAINER_CLASS + " pointer-events");
5978
5710
  }
5979
5711
  Lasagna.prototype.addLayer = function (layer) {
5980
5712
  this.layers = orderBy__default["default"](this.layers.concat(layer), "order");
@@ -5997,19 +5729,18 @@
5997
5729
  };
5998
5730
  Lasagna.prototype.update = function () {
5999
5731
  var _this = this;
6000
- var layerContainers = this.container
6001
- .selectAll("g." + Lasagna.LAYER_CLASS)
5732
+ var layerContainers = this.container.selectAll("g." + Lasagna.LAYER_CLASS)
6002
5733
  .data(this.layers, function (d) { return d.name; })
6003
5734
  .order();
6004
- layerContainers
6005
- .enter()
5735
+ layerContainers.enter()
6006
5736
  .append("g")
6007
5737
  .attrs({
6008
- class: function (d) { return Lasagna.LAYER_CLASS + " " + Lasagna.LAYER_CLASS + "-" + d.name; },
5738
+ "class": function (d) { return Lasagna.LAYER_CLASS + " " + Lasagna.LAYER_CLASS + "-" + d.name; },
6009
5739
  "clip-path": function (d) { return d.clipped ? "url(#" + _this.clipPath + ")" : ""; },
6010
5740
  "pointer-events": "none",
6011
5741
  });
6012
- layerContainers.exit().remove();
5742
+ layerContainers.exit()
5743
+ .remove();
6013
5744
  };
6014
5745
  return Lasagna;
6015
5746
  }());
@@ -6034,22 +5765,15 @@
6034
5765
  var disableHeightCorrection = _this.config().disableRenderAreaHeightCorrection;
6035
5766
  var disableWidthCorrection = _this.config().disableRenderAreaWidthCorrection;
6036
5767
  var renderingAreaClipPathAttrs = {
6037
- width: Math.max(0, d.width()),
6038
- height: Math.max(0, d.height() +
6039
- (disableHeightCorrection
6040
- ? 0
6041
- : Grid.RENDER_AREA_HEIGHT_CORRECTION)),
5768
+ "width": Math.max(0, d.width()),
5769
+ "height": Math.max(0, d.height() + (disableHeightCorrection ? 0 : Grid.RENDER_AREA_HEIGHT_CORRECTION)),
6042
5770
  };
6043
5771
  if (!disableHeightCorrection) {
6044
- renderingAreaClipPathAttrs["y"] =
6045
- -Grid.RENDER_AREA_HEIGHT_CORRECTION;
5772
+ renderingAreaClipPathAttrs["y"] = -Grid.RENDER_AREA_HEIGHT_CORRECTION;
6046
5773
  }
6047
5774
  var renderingAreaAttrs = Object.assign(Object.assign({}, renderingAreaClipPathAttrs), {
6048
5775
  // Width correction needed to prevent interaction gap between right side of grid and the edge of the rendering area
6049
- width: Math.max(0, d.width() -
6050
- (disableWidthCorrection
6051
- ? 0
6052
- : Grid.RENDER_AREA_WIDTH_CORRECTION))
5776
+ "width": Math.max(0, d.width() - (disableWidthCorrection ? 0 : Grid.RENDER_AREA_WIDTH_CORRECTION))
6053
5777
  });
6054
5778
  _this.renderingAreaClipPath.attrs(renderingAreaClipPathAttrs);
6055
5779
  _this.renderingArea.attrs(renderingAreaAttrs);
@@ -6097,8 +5821,9 @@
6097
5821
  var config = new GridConfig();
6098
5822
  this.config(config);
6099
5823
  }
6100
- this.container = this._target.append("g").attrs({
6101
- class: Grid.GRID_CLASS_NAME,
5824
+ this.container = this._target.append("g")
5825
+ .attrs({
5826
+ "class": Grid.GRID_CLASS_NAME,
6102
5827
  });
6103
5828
  var clipPathId = Grid.RENDERING_AREA_CLIP_PATH_PREFIX + UtilityService.uuid();
6104
5829
  // Asserting similar type to avoid refactoring all the grids
@@ -6180,8 +5905,7 @@
6180
5905
  var _a;
6181
5906
  // We're creating even invisible borders and updating visibility afterwards
6182
5907
  if (borderConfigs[side]) {
6183
- borders[side] =
6184
- (_a = _this.createBorder(container, borderConfigs[side])) !== null && _a !== void 0 ? _a : undefined;
5908
+ borders[side] = (_a = _this.createBorder(container, borderConfigs[side])) !== null && _a !== void 0 ? _a : undefined;
6185
5909
  }
6186
5910
  });
6187
5911
  return borders;
@@ -6194,8 +5918,7 @@
6194
5918
  * @returns {D3Selection} The grid's rendering area
6195
5919
  */
6196
5920
  Grid.prototype.buildRenderingArea = function (clipPathId) {
6197
- this.renderingAreaClipPath = this._target
6198
- .append("clipPath")
5921
+ this.renderingAreaClipPath = this._target.append("clipPath")
6199
5922
  .attr("id", clipPathId)
6200
5923
  .append("rect");
6201
5924
  var renderingAreaContainer = this.lasagna.addLayer({
@@ -6203,9 +5926,10 @@
6203
5926
  order: -1,
6204
5927
  clipped: true,
6205
5928
  });
6206
- return renderingAreaContainer.append("rect").attrs({
5929
+ return renderingAreaContainer.append("rect")
5930
+ .attrs({
6207
5931
  "pointer-events": "all",
6208
- fill: "transparent",
5932
+ "fill": "transparent",
6209
5933
  });
6210
5934
  };
6211
5935
  /**
@@ -6217,8 +5941,7 @@
6217
5941
  * @returns {SVGElement} The created border
6218
5942
  */
6219
5943
  Grid.prototype.createBorder = function (container, config) {
6220
- var border = container
6221
- .append("line")
5944
+ var border = container.append("line")
6222
5945
  .attr("class", config.className || Grid.DEFAULT_BORDER_CLASS_NAME);
6223
5946
  if (config.width) {
6224
5947
  // use style instead of attr to override css style
@@ -6239,11 +5962,10 @@
6239
5962
  }
6240
5963
  d3Selection.select(this.borders.bottom)
6241
5964
  .attrs({
6242
- x1: 0,
6243
- y1: this.config().dimension.height() - borderMidpoint,
6244
- x2: this.config().dimension.width() +
6245
- Grid.TICK_DIMENSION_CORRECTION,
6246
- y2: this.config().dimension.height() - borderMidpoint,
5965
+ "x1": 0,
5966
+ "y1": this.config().dimension.height() - borderMidpoint,
5967
+ "x2": this.config().dimension.width() + Grid.TICK_DIMENSION_CORRECTION,
5968
+ "y2": this.config().dimension.height() - borderMidpoint,
6247
5969
  })
6248
5970
  .classed("hidden", !((_a = this._config.borders.bottom) === null || _a === void 0 ? void 0 : _a.visible));
6249
5971
  };
@@ -6258,33 +5980,30 @@
6258
5980
  if (this.borders.top) {
6259
5981
  d3Selection.select(this.borders.top)
6260
5982
  .attrs({
6261
- x1: 0,
6262
- y1: borderMidpoint,
6263
- x2: this.config().dimension.width() +
6264
- Grid.TICK_DIMENSION_CORRECTION,
6265
- y2: borderMidpoint,
5983
+ "x1": 0,
5984
+ "y1": borderMidpoint,
5985
+ "x2": this.config().dimension.width() + Grid.TICK_DIMENSION_CORRECTION,
5986
+ "y2": borderMidpoint,
6266
5987
  })
6267
5988
  .classed("hidden", !((_a = this._config.borders.top) === null || _a === void 0 ? void 0 : _a.visible));
6268
5989
  }
6269
5990
  if (this.borders.right) {
6270
5991
  d3Selection.select(this.borders.right)
6271
5992
  .attrs({
6272
- x1: this.config().dimension.width() - borderMidpoint,
6273
- y1: 0,
6274
- x2: this.config().dimension.width() - borderMidpoint,
6275
- y2: this.config().dimension.height() +
6276
- Grid.TICK_DIMENSION_CORRECTION, // to get nice alignment with ticks
5993
+ "x1": this.config().dimension.width() - borderMidpoint,
5994
+ "y1": 0,
5995
+ "x2": this.config().dimension.width() - borderMidpoint,
5996
+ "y2": this.config().dimension.height() + Grid.TICK_DIMENSION_CORRECTION, // to get nice alignment with ticks
6277
5997
  })
6278
5998
  .classed("hidden", !((_b = this._config.borders.right) === null || _b === void 0 ? void 0 : _b.visible));
6279
5999
  }
6280
6000
  if (this.borders.left) {
6281
6001
  d3Selection.select(this.borders.left)
6282
6002
  .attrs({
6283
- x1: borderMidpoint,
6284
- y1: 0,
6285
- x2: borderMidpoint,
6286
- y2: this.config().dimension.height() +
6287
- Grid.TICK_DIMENSION_CORRECTION, // to get nice alignment with ticks
6003
+ "x1": borderMidpoint,
6004
+ "y1": 0,
6005
+ "x2": borderMidpoint,
6006
+ "y2": this.config().dimension.height() + Grid.TICK_DIMENSION_CORRECTION, // to get nice alignment with ticks
6288
6007
  })
6289
6008
  .classed("hidden", !((_c = this._config.borders.left) === null || _c === void 0 ? void 0 : _c.visible));
6290
6009
  }
@@ -6316,9 +6035,9 @@
6316
6035
  _this.adjustRenderingArea = function () {
6317
6036
  var d = _this.config().dimension;
6318
6037
  var attrs = {
6319
- width: d.outerWidth(),
6320
- height: d.outerHeight(),
6321
- transform: "translate(" + -d.outerWidth() / 2 + ", " + -d.outerHeight() / 2 + ")",
6038
+ "width": d.outerWidth(),
6039
+ "height": d.outerHeight(),
6040
+ "transform": "translate(" + -d.outerWidth() / 2 + ", " + -d.outerHeight() / 2 + ")",
6322
6041
  };
6323
6042
  _this.renderingAreaClipPath.attrs(attrs);
6324
6043
  _this.renderingArea.attrs(attrs);
@@ -6343,10 +6062,7 @@
6343
6062
  if (this.scales) {
6344
6063
  var radiusScale = this.scales["r"];
6345
6064
  if (radiusScale) {
6346
- radiusScale.list[0].range([
6347
- 0,
6348
- Math.min(dimensionConfig.width(), dimensionConfig.height()) / 2,
6349
- ]);
6065
+ radiusScale.list[0].range([0, Math.min(dimensionConfig.width(), dimensionConfig.height()) / 2]);
6350
6066
  }
6351
6067
  }
6352
6068
  this.adjustRenderingArea();
@@ -6360,7 +6076,7 @@
6360
6076
  };
6361
6077
  RadialGrid.prototype.recenter = function () {
6362
6078
  this.container.attrs({
6363
- transform: "translate(" + this.config().dimension.outerWidth() / 2 + "," + this.config().dimension.outerHeight() / 2 + ")",
6079
+ "transform": "translate(" + this.config().dimension.outerWidth() / 2 + "," + this.config().dimension.outerHeight() / 2 + ")",
6364
6080
  });
6365
6081
  };
6366
6082
  return RadialGrid;
@@ -6382,10 +6098,7 @@
6382
6098
  this.interactiveArea = interactiveArea;
6383
6099
  this.gridMargin = gridMargin;
6384
6100
  this.active = new rxjs.BehaviorSubject(false);
6385
- this.interaction = new rxjs.BehaviorSubject({
6386
- type: exports.InteractionType.Click,
6387
- coordinates: { x: 0, y: 0 },
6388
- });
6101
+ this.interaction = new rxjs.BehaviorSubject({ type: exports.InteractionType.Click, coordinates: { x: 0, y: 0 } });
6389
6102
  this.isActive = false;
6390
6103
  this.onMouseInteraction = function (interactionType) {
6391
6104
  var _a, _b;
@@ -6403,32 +6116,22 @@
6403
6116
  // Note: Margin must be subtracted because of the transform that occurs in XYGrid.recalculateMargins
6404
6117
  var calculatedX = x + d3Selection.event.offsetX - (((_a = _this.gridMargin) === null || _a === void 0 ? void 0 : _a.left) || 0);
6405
6118
  // clamp output to right or left side of interactive area if necessary
6406
- calculatedX =
6407
- calculatedX > interactiveAreaWidth
6408
- ? interactiveAreaWidth
6409
- : calculatedX;
6119
+ calculatedX = calculatedX > interactiveAreaWidth ? interactiveAreaWidth : calculatedX;
6410
6120
  x = calculatedX < 0 ? 0 : calculatedX;
6411
6121
  // Note: Margin must be subtracted because of the transform that occurs in XYGrid.recalculateMargins
6412
6122
  var calculatedY = y + d3Selection.event.offsetY - (((_b = _this.gridMargin) === null || _b === void 0 ? void 0 : _b.top) || 0);
6413
6123
  // clamp output to top or bottom side of interactive area if necessary
6414
- calculatedY =
6415
- calculatedY > interactiveAreaHeight
6416
- ? interactiveAreaHeight
6417
- : calculatedY;
6124
+ calculatedY = calculatedY > interactiveAreaHeight ? interactiveAreaHeight : calculatedY;
6418
6125
  y = calculatedY < 0 ? 0 : calculatedY;
6419
6126
  }
6420
6127
  else {
6421
6128
  // this works in Chrome
6422
6129
  var mouseOutput = d3Selection.mouse(d3Selection.event.currentTarget);
6423
6130
  // clamp output to right or left side of interactive area if necessary
6424
- var calculatedX = mouseOutput[0] > interactiveAreaWidth
6425
- ? interactiveAreaWidth
6426
- : mouseOutput[0];
6131
+ var calculatedX = mouseOutput[0] > interactiveAreaWidth ? interactiveAreaWidth : mouseOutput[0];
6427
6132
  x = calculatedX < 0 ? 0 : calculatedX;
6428
6133
  // clamp output to top or bottom side of interactive area if necessary
6429
- var calculatedY = mouseOutput[1] > interactiveAreaHeight
6430
- ? interactiveAreaHeight
6431
- : mouseOutput[1];
6134
+ var calculatedY = mouseOutput[1] > interactiveAreaHeight ? interactiveAreaHeight : mouseOutput[1];
6432
6135
  y = calculatedY < 0 ? 0 : calculatedY;
6433
6136
  }
6434
6137
  _this.interaction.next({
@@ -6437,8 +6140,7 @@
6437
6140
  });
6438
6141
  };
6439
6142
  this.onMouseOver = function () {
6440
- if (_this.isActive ||
6441
- d3Selection.event.target.classList.contains(IGNORE_INTERACTION_CLASS)) {
6143
+ if (_this.isActive || d3Selection.event.target.classList.contains(IGNORE_INTERACTION_CLASS)) {
6442
6144
  return;
6443
6145
  }
6444
6146
  _this.isActive = true;
@@ -6529,17 +6231,12 @@
6529
6231
  }
6530
6232
  InteractionLabelPlugin.prototype.initialize = function () {
6531
6233
  var _this = this;
6532
- this.interactionLabelLayer = this.chart
6533
- .getGrid()
6534
- .getLasagna()
6535
- .addLayer({
6234
+ this.interactionLabelLayer = this.chart.getGrid().getLasagna().addLayer({
6536
6235
  name: InteractionLabelPlugin.LAYER_NAME,
6537
6236
  order: 901,
6538
6237
  clipped: false,
6539
6238
  });
6540
- this.chart
6541
- .getEventBus()
6542
- .getStream(INTERACTION_VALUES_EVENT)
6239
+ this.chart.getEventBus().getStream(INTERACTION_VALUES_EVENT)
6543
6240
  .pipe(operators.takeUntil(this.destroy$))
6544
6241
  .subscribe(function (event) {
6545
6242
  _this.lastInteractionValuesPayload = event.data;
@@ -6547,9 +6244,7 @@
6547
6244
  _this.handleLabelUpdate();
6548
6245
  }
6549
6246
  });
6550
- this.chart
6551
- .getEventBus()
6552
- .getStream(CHART_VIEW_STATUS_EVENT)
6247
+ this.chart.getEventBus().getStream(CHART_VIEW_STATUS_EVENT)
6553
6248
  .pipe(operators.takeUntil(this.destroy$))
6554
6249
  .subscribe(function (event) {
6555
6250
  _this.isChartInView = event.data.isChartInView;
@@ -6560,10 +6255,7 @@
6560
6255
  };
6561
6256
  InteractionLabelPlugin.prototype.handleLabelUpdate = function () {
6562
6257
  var scales = this.chart.getGrid().scales;
6563
- if (!this.areLabelUpdatesEnabled ||
6564
- this.lastInteractionValuesPayload.interactionType !==
6565
- exports.InteractionType.MouseMove ||
6566
- isEmpty__default["default"](scales)) {
6258
+ if (!this.areLabelUpdatesEnabled || this.lastInteractionValuesPayload.interactionType !== exports.InteractionType.MouseMove || isEmpty__default["default"](scales)) {
6567
6259
  return;
6568
6260
  }
6569
6261
  var grid = this.chart.getGrid();
@@ -6571,9 +6263,7 @@
6571
6263
  if (!xScale) {
6572
6264
  throw new Error("xScale is not defined");
6573
6265
  }
6574
- var xValue = this.lastInteractionValuesPayload.values.x
6575
- ? this.lastInteractionValuesPayload.values.x[xScale.id]
6576
- : null;
6266
+ var xValue = this.lastInteractionValuesPayload.values.x ? this.lastInteractionValuesPayload.values.x[xScale.id] : null;
6577
6267
  this.updateLabel(xScale, isArray__default["default"](xValue) ? xValue.slice(0, xValue.length - 1) : xValue);
6578
6268
  };
6579
6269
  InteractionLabelPlugin.prototype.updateLabel = function (scale, value) {
@@ -6585,60 +6275,49 @@
6585
6275
  interactionLabel.remove();
6586
6276
  return;
6587
6277
  }
6588
- var formatter = scale.formatters[this.formatterName] ||
6589
- scale.formatters[FALLBACK_FORMATTER];
6278
+ var formatter = scale.formatters[this.formatterName] || scale.formatters[FALLBACK_FORMATTER];
6590
6279
  var labelContent = formatter === null || formatter === void 0 ? void 0 : formatter(value);
6591
6280
  if (!labelContent) {
6592
6281
  throw new Error("labelContent is not defined");
6593
6282
  }
6594
- var textSelection = interactionLabel
6595
- .select("text")
6283
+ var textSelection = interactionLabel.select("text")
6596
6284
  .text(labelContent);
6597
6285
  var bbox = textSelection.node().getBBox();
6598
6286
  var gridDimension = this.chart.getGrid().config().dimension;
6599
6287
  // subtract the relative vertical text offset inside the bbox from
6600
6288
  // the grid height to determine the label's vertical placement
6601
- var heightOffset = gridDimension.height() - bbox.y;
6289
+ var heightOffset = (gridDimension.height() - bbox.y);
6602
6290
  textSelection
6603
6291
  .attr("transform", "translate(0, " + heightOffset + ")")
6604
6292
  .style("text-anchor", "middle");
6605
6293
  // match the horizontal padding to the built-in bbox vertical padding
6606
6294
  var horizontalPadding = (bbox.height + bbox.y) * 2;
6607
6295
  var labelWidth = bbox.width + horizontalPadding;
6608
- var allowedRange = [
6609
- labelWidth / 2,
6610
- gridDimension.width() - labelWidth / 2,
6611
- ];
6296
+ var allowedRange = [(labelWidth / 2), gridDimension.width() - (labelWidth / 2)];
6612
6297
  var x = convert(scale, value, 0.5);
6613
6298
  var clampedX = UtilityService.clampToRange(x, allowedRange);
6614
6299
  interactionLabel
6615
6300
  .attr("transform", "translate(" + clampedX + ",0)")
6616
6301
  .select("rect")
6617
6302
  .attrs({
6618
- transform: "translate(0," + heightOffset + ")",
6619
- x: -(labelWidth / 2),
6620
- y: bbox.y,
6621
- width: labelWidth,
6622
- height: bbox.height,
6303
+ "transform": "translate(0," + heightOffset + ")",
6304
+ "x": -(labelWidth / 2),
6305
+ "y": bbox.y,
6306
+ "width": labelWidth,
6307
+ "height": bbox.height,
6623
6308
  });
6624
6309
  };
6625
6310
  InteractionLabelPlugin.prototype.destroy = function () {
6626
- this.chart
6627
- .getGrid()
6628
- .getLasagna()
6629
- .removeLayer(InteractionLabelPlugin.LAYER_NAME);
6311
+ this.chart.getGrid().getLasagna().removeLayer(InteractionLabelPlugin.LAYER_NAME);
6630
6312
  this.destroy$.next();
6631
6313
  this.destroy$.complete();
6632
6314
  };
6633
6315
  InteractionLabelPlugin.prototype.buildInteractionLabel = function (target) {
6634
- var label = target
6635
- .append("g")
6316
+ var label = target.append("g")
6636
6317
  .attr("class", InteractionLabelPlugin.LAYER_NAME);
6637
- label
6638
- .append("rect")
6318
+ label.append("rect")
6639
6319
  .attr("class", InteractionLabelPlugin.LAYER_NAME + "__rect");
6640
- label
6641
- .append("text")
6320
+ label.append("text")
6642
6321
  .attr("class", InteractionLabelPlugin.LAYER_NAME + "__text");
6643
6322
  return label;
6644
6323
  };
@@ -6667,9 +6346,7 @@
6667
6346
  order: 900,
6668
6347
  clipped: true,
6669
6348
  });
6670
- this.chart
6671
- .getEventBus()
6672
- .getStream(INTERACTION_VALUES_EVENT)
6349
+ this.chart.getEventBus().getStream(INTERACTION_VALUES_EVENT)
6673
6350
  .pipe(operators.takeUntil(this.destroy$))
6674
6351
  .subscribe(function (event) {
6675
6352
  _this.lastInteractionValuesPayload = event.data;
@@ -6677,9 +6354,7 @@
6677
6354
  _this.handleLineUpdate();
6678
6355
  }
6679
6356
  });
6680
- this.chart
6681
- .getEventBus()
6682
- .getStream(CHART_VIEW_STATUS_EVENT)
6357
+ this.chart.getEventBus().getStream(CHART_VIEW_STATUS_EVENT)
6683
6358
  .pipe(operators.takeUntil(this.destroy$))
6684
6359
  .subscribe(function (event) {
6685
6360
  _this.isChartInView = event.data.isChartInView;
@@ -6690,9 +6365,7 @@
6690
6365
  };
6691
6366
  InteractionLinePlugin.prototype.handleLineUpdate = function () {
6692
6367
  var scales = this.chart.getGrid().scales;
6693
- if (this.lastInteractionValuesPayload.interactionType !==
6694
- exports.InteractionType.MouseMove ||
6695
- isEmpty__default["default"](scales)) {
6368
+ if (this.lastInteractionValuesPayload.interactionType !== exports.InteractionType.MouseMove || isEmpty__default["default"](scales)) {
6696
6369
  return;
6697
6370
  }
6698
6371
  var grid = this.chart.getGrid();
@@ -6700,9 +6373,7 @@
6700
6373
  if (!xScale) {
6701
6374
  throw new Error("xScale is not defined");
6702
6375
  }
6703
- var xValue = this.lastInteractionValuesPayload.values.x
6704
- ? this.lastInteractionValuesPayload.values.x[xScale.id]
6705
- : null;
6376
+ var xValue = this.lastInteractionValuesPayload.values.x ? this.lastInteractionValuesPayload.values.x[xScale.id] : null;
6706
6377
  this.updateLine(this.interactionLineLayer, xScale, xValue);
6707
6378
  };
6708
6379
  InteractionLinePlugin.prototype.updateLine = function (layer, xScale, value) {
@@ -6710,16 +6381,14 @@
6710
6381
  if (value) {
6711
6382
  data.push(value);
6712
6383
  }
6713
- var line = layer
6714
- .selectAll("." + InteractionLinePlugin.LAYER_NAME)
6715
- .data(data);
6384
+ var line = layer.selectAll("." + InteractionLinePlugin.LAYER_NAME).data(data);
6716
6385
  var xFn = function (d) { return xScale.convert(d); };
6717
6386
  var attrs = {
6718
- class: InteractionLinePlugin.LAYER_NAME,
6719
- x1: xFn,
6720
- y1: 0,
6721
- x2: xFn,
6722
- y2: this.chart.getGrid().config().dimension.height(),
6387
+ "class": InteractionLinePlugin.LAYER_NAME,
6388
+ "x1": xFn,
6389
+ "y1": 0,
6390
+ "x2": xFn,
6391
+ "y2": this.chart.getGrid().config().dimension.height(),
6723
6392
  };
6724
6393
  line.enter()
6725
6394
  .append("line")
@@ -6728,10 +6397,7 @@
6728
6397
  line.exit().remove();
6729
6398
  };
6730
6399
  InteractionLinePlugin.prototype.destroy = function () {
6731
- this.chart
6732
- .getGrid()
6733
- .getLasagna()
6734
- .removeLayer(InteractionLinePlugin.LAYER_NAME);
6400
+ this.chart.getGrid().getLasagna().removeLayer(InteractionLinePlugin.LAYER_NAME);
6735
6401
  this.destroy$.next();
6736
6402
  this.destroy$.complete();
6737
6403
  };
@@ -6751,17 +6417,10 @@
6751
6417
  }
6752
6418
  MouseInteractiveAreaPlugin.prototype.initialize = function () {
6753
6419
  var _this = this;
6754
- this.mouseInteractiveArea.active
6755
- .pipe(operators.takeUntil(this.destroy$))
6756
- .subscribe(function (active) {
6757
- _this.chart
6758
- .getEventBus()
6759
- .getStream(MOUSE_ACTIVE_EVENT)
6760
- .next({ data: active });
6420
+ this.mouseInteractiveArea.active.pipe(operators.takeUntil(this.destroy$)).subscribe(function (active) {
6421
+ _this.chart.getEventBus().getStream(MOUSE_ACTIVE_EVENT).next({ data: active });
6761
6422
  });
6762
- this.chart
6763
- .getEventBus()
6764
- .getStream(MOUSE_ACTIVE_EVENT)
6423
+ this.chart.getEventBus().getStream(MOUSE_ACTIVE_EVENT)
6765
6424
  .pipe(operators.takeUntil(this.destroy$))
6766
6425
  .subscribe(function (event) {
6767
6426
  var active = event.data;
@@ -6769,11 +6428,9 @@
6769
6428
  _this.highlightReset();
6770
6429
  }
6771
6430
  });
6772
- this.chart
6773
- .getEventBus()
6774
- .getStream(INTERACTION_VALUES_ACTIVE_EVENT)
6431
+ this.chart.getEventBus().getStream(INTERACTION_VALUES_ACTIVE_EVENT)
6775
6432
  .pipe(operators.takeUntil(this.destroy$))
6776
- .subscribe(function (event) { return (_this.interactionValuesActive = event.data); });
6433
+ .subscribe(function (event) { return _this.interactionValuesActive = event.data; });
6777
6434
  this.mouseInteractiveArea.interaction
6778
6435
  .pipe(operators.takeUntil(this.destroy$))
6779
6436
  .subscribe(function (event) {
@@ -6787,21 +6444,10 @@
6787
6444
  var xCoordinate = event.coordinates.x;
6788
6445
  var yCoordinate = event.coordinates.y;
6789
6446
  var values = UtilityService.getXYValues(xScales, yScales, xCoordinate, yCoordinate);
6790
- _this.chart
6791
- .getEventBus()
6792
- .getStream(INTERACTION_VALUES_EVENT)
6793
- .next({
6794
- data: { interactionType: event.type, values: values },
6795
- });
6447
+ _this.chart.getEventBus().getStream(INTERACTION_VALUES_EVENT).next({ data: { interactionType: event.type, values: values } });
6796
6448
  }
6797
- _this.chart
6798
- .getEventBus()
6799
- .getStream(INTERACTION_COORDINATES_EVENT)
6800
- .next({
6801
- data: {
6802
- interactionType: event.type,
6803
- coordinates: event.coordinates,
6804
- },
6449
+ _this.chart.getEventBus().getStream(INTERACTION_COORDINATES_EVENT).next({
6450
+ data: { interactionType: event.type, coordinates: event.coordinates },
6805
6451
  });
6806
6452
  });
6807
6453
  };
@@ -6816,15 +6462,7 @@
6816
6462
  this.destroy$.complete();
6817
6463
  };
6818
6464
  MouseInteractiveAreaPlugin.prototype.highlightReset = function () {
6819
- this.chart
6820
- .getEventBus()
6821
- .getStream(INTERACTION_VALUES_EVENT)
6822
- .next({
6823
- data: {
6824
- interactionType: exports.InteractionType.MouseMove,
6825
- values: {},
6826
- },
6827
- });
6465
+ this.chart.getEventBus().getStream(INTERACTION_VALUES_EVENT).next({ data: { interactionType: exports.InteractionType.MouseMove, values: {} } });
6828
6466
  };
6829
6467
  return MouseInteractiveAreaPlugin;
6830
6468
  }(ChartPlugin));
@@ -6840,26 +6478,15 @@
6840
6478
  var originalText = textSelection.text();
6841
6479
  var chars = originalText.split("");
6842
6480
  // add IGNORE_INTERACTION_CLASS so that mouse events used for displaying the title don't propagate from the mouse-interactive-area
6843
- var ellipsisTSpan = textSelection
6844
- .text("")
6845
- .append("tspan")
6846
- .attr("class", IGNORE_INTERACTION_CLASS + " ellipsis")
6847
- .text("...");
6848
- var textTSpan = textSelection
6849
- .insert("tspan", ":first-child")
6850
- .attr("class", IGNORE_INTERACTION_CLASS + " text")
6851
- .text(originalText);
6481
+ var ellipsisTSpan = textSelection.text("").append("tspan").attr("class", IGNORE_INTERACTION_CLASS + " ellipsis").text("...");
6482
+ var textTSpan = textSelection.insert("tspan", ":first-child").attr("class", IGNORE_INTERACTION_CLASS + " text").text(originalText);
6852
6483
  var paddingAndEllipsisWidth = args.ellipsisWidth + args.horizontalPadding * 2;
6853
6484
  var originalCharCount = chars.length;
6854
- var labelWidth = (((_a = textTSpan === null || textTSpan === void 0 ? void 0 : textTSpan.node()) === null || _a === void 0 ? void 0 : _a.getComputedTextLength()) || 0) +
6855
- args.horizontalPadding * 2;
6856
- while (chars.length &&
6857
- (labelWidth > args.widthLimit || chars[chars.length - 1] === " ")) {
6485
+ var labelWidth = (((_a = textTSpan === null || textTSpan === void 0 ? void 0 : textTSpan.node()) === null || _a === void 0 ? void 0 : _a.getComputedTextLength()) || 0) + args.horizontalPadding * 2;
6486
+ while (chars.length && (labelWidth > args.widthLimit || chars[chars.length - 1] === " ")) {
6858
6487
  chars.pop();
6859
6488
  textTSpan.text(chars.join(""));
6860
- labelWidth =
6861
- paddingAndEllipsisWidth +
6862
- (((_b = textTSpan === null || textTSpan === void 0 ? void 0 : textTSpan.node()) === null || _b === void 0 ? void 0 : _b.getComputedTextLength()) || 0);
6489
+ labelWidth = paddingAndEllipsisWidth + (((_b = textTSpan === null || textTSpan === void 0 ? void 0 : textTSpan.node()) === null || _b === void 0 ? void 0 : _b.getComputedTextLength()) || 0);
6863
6490
  }
6864
6491
  if (chars.length === originalCharCount) {
6865
6492
  ellipsisTSpan.remove();
@@ -7056,12 +6683,9 @@
7056
6683
  config = _this.config().axis.bottom;
7057
6684
  axisGenerator = d3Axis.axisBottom;
7058
6685
  }
7059
- if (scale.domainCalculator &&
7060
- !isDomainWithTicksCalculator(scale.domainCalculator) &&
7061
- config.gridTicks) {
6686
+ if (scale.domainCalculator && !isDomainWithTicksCalculator(scale.domainCalculator) && config.gridTicks) {
7062
6687
  scale.__domainCalculatedWithTicks = true;
7063
- scale.domainCalculator =
7064
- getAutomaticDomainWithTicks(config, axisGenerator, scale.domainCalculator);
6688
+ scale.domainCalculator = getAutomaticDomainWithTicks(config, axisGenerator, scale.domainCalculator);
7065
6689
  }
7066
6690
  });
7067
6691
  });
@@ -7088,14 +6712,9 @@
7088
6712
  this.buildAxes(this.gridElementsLayer);
7089
6713
  this.recalculateMargins(this.container);
7090
6714
  var untilDestroy = function () { return operators.takeUntil(_this.eventBus.getStream(DESTROY_EVENT)); };
7091
- this.eventBus
7092
- .getStream(SERIES_STATE_CHANGE_EVENT)
7093
- .pipe(untilDestroy())
7094
- .subscribe(function (e) {
6715
+ this.eventBus.getStream(SERIES_STATE_CHANGE_EVENT).pipe(untilDestroy()).subscribe(function (e) {
7095
6716
  var axesStyles = _this.handleSeriesStateChange(e);
7096
- _this.eventBus.getStream(AXES_STYLE_CHANGE_EVENT).next({
7097
- data: axesStyles,
7098
- });
6717
+ _this.eventBus.getStream(AXES_STYLE_CHANGE_EVENT).next({ data: axesStyles });
7099
6718
  });
7100
6719
  return this;
7101
6720
  };
@@ -7112,10 +6731,7 @@
7112
6731
  return;
7113
6732
  }
7114
6733
  var axes = [
7115
- {
7116
- scaleId: this.leftScaleId,
7117
- element: this.axisYLeft.group,
7118
- },
6734
+ { scaleId: this.leftScaleId, element: this.axisYLeft.group },
7119
6735
  { scaleId: this.rightScaleId, element: (_a = this.axisYRight) === null || _a === void 0 ? void 0 : _a.group },
7120
6736
  ];
7121
6737
  var axesStyles = this.calculateAxesStyles(e, axes);
@@ -7150,19 +6766,14 @@
7150
6766
  .filter(function (rs) { return rs.state === exports.RenderState.emphasized && rs.series; })
7151
6767
  .map(function (rs) { return rs.series; });
7152
6768
  if (emphasizedSeries.length > 0) {
7153
- var emphasizedYScales = uniq__default["default"](emphasizedSeries
7154
- .map(function (s) { return s === null || s === void 0 ? void 0 : s.scales["y"]; })
7155
- .filter(function (s) { return !!s; }));
6769
+ var emphasizedYScales = uniq__default["default"](emphasizedSeries.map(function (s) { return s === null || s === void 0 ? void 0 : s.scales["y"]; }).filter(function (s) { return !!s; }));
7156
6770
  if (emphasizedYScales.length <= 0) {
7157
6771
  return {};
7158
6772
  }
7159
6773
  var _loop_1 = function (emphasizedYScale) {
7160
- if (emphasizedYScale.id === this_1.leftScaleId ||
7161
- emphasizedYScale.id === this_1.rightScaleId) {
6774
+ if (emphasizedYScale.id === this_1.leftScaleId || emphasizedYScale.id === this_1.rightScaleId) {
7162
6775
  return { value: axes.reduce(function (acc, next) {
7163
- acc[next.scaleId] = {
7164
- opacity: emphasizedYScale.id === next.scaleId ? 1 : 0.1,
7165
- };
6776
+ acc[next.scaleId] = { opacity: emphasizedYScale.id === next.scaleId ? 1 : 0.1 };
7166
6777
  return acc;
7167
6778
  }, {}) };
7168
6779
  }
@@ -7219,7 +6830,8 @@
7219
6830
  .ticks(config.approximateTicks)
7220
6831
  .tickSize(0)
7221
6832
  .tickFormat(scale.formatters["tick"]);
7222
- axis.labelGroup.call(bottomLabelAxis);
6833
+ axis.labelGroup
6834
+ .call(bottomLabelAxis);
7223
6835
  var tickAxis = void 0;
7224
6836
  if (scale instanceof BandScale) {
7225
6837
  tickAxis = axisGenerator(scale.copyToLinear().d3Scale)
@@ -7272,19 +6884,14 @@
7272
6884
  }
7273
6885
  if (this.scales.y) {
7274
6886
  each__default["default"](this.scales.y.list, function (yScale) {
7275
- yScale.range([
7276
- dimension.height() - padding.bottom,
7277
- padding.top,
7278
- ]);
6887
+ yScale.range([dimension.height() - padding.bottom, padding.top]);
7279
6888
  });
7280
6889
  }
7281
6890
  _super.prototype.updateRanges.call(this);
7282
6891
  return this;
7283
6892
  };
7284
6893
  XYGrid.prototype.updateXAxis = function () {
7285
- var xScale = this.bottomScaleId
7286
- ? this.scales["x"].index[this.bottomScaleId]
7287
- : undefined;
6894
+ var xScale = this.bottomScaleId ? this.scales["x"].index[this.bottomScaleId] : undefined;
7288
6895
  var axis = this.config().axis;
7289
6896
  if (!xScale) {
7290
6897
  throw new Error("xScale is not defined");
@@ -7294,13 +6901,12 @@
7294
6901
  this.axisX.labelGroup.attr("transform", "translate(0, " + axis.bottom.tickSize + ")");
7295
6902
  this.drawTicks(axis.bottom, this.axisX, xScale, d3Axis.axisBottom);
7296
6903
  this.drawGrids(axis.bottom, this.gridX, d3Axis.axisTop, xScale, this.config().dimension.height());
7297
- this.gridX.tickGroup.attr("transform", "translate(0, " + this.config().dimension.height() + ")");
6904
+ this.gridX.tickGroup
6905
+ .attr("transform", "translate(0, " + this.config().dimension.height() + ")");
7298
6906
  };
7299
6907
  XYGrid.prototype.updateYAxes = function () {
7300
6908
  var axis = this.config().axis;
7301
- var yLeftScale = this.leftScaleId
7302
- ? this.scales["y"].index[this.leftScaleId]
7303
- : undefined;
6909
+ var yLeftScale = this.leftScaleId ? this.scales["y"].index[this.leftScaleId] : undefined;
7304
6910
  if (!yLeftScale) {
7305
6911
  throw new Error("yLeftScale is not defined");
7306
6912
  }
@@ -7309,9 +6915,7 @@
7309
6915
  this.drawGrids(axis.left, this.gridY, d3Axis.axisRight, yLeftScale, this.config().dimension.width());
7310
6916
  if (this.rightScaleId) {
7311
6917
  var yRightScale = this.scales["y"].index[this.rightScaleId];
7312
- var rightScaleLabelX = axis.right.padding +
7313
- this.config().dimension.width() +
7314
- axis.right.tickSize;
6918
+ var rightScaleLabelX = axis.right.padding + this.config().dimension.width() + axis.right.tickSize;
7315
6919
  this.axisYRight.labelGroup.attr("transform", "translate(" + rightScaleLabelX + ", 0)");
7316
6920
  this.axisYRight.tickGroup.attr("transform", "translate(" + this.config().dimension.width() + ", 0)");
7317
6921
  this.drawTicks(axis.right, this.axisYRight, yRightScale, d3Axis.axisRight);
@@ -7328,9 +6932,7 @@
7328
6932
  var textOfTicks = [];
7329
6933
  labelGroup.attr("cursor", "default");
7330
6934
  labelGroup.selectAll("g").each(function () {
7331
- d3Selection.select(this)
7332
- .classed("sw-hidden", false)
7333
- .classed("tick-hidden-text", false);
6935
+ d3Selection.select(this).classed("sw-hidden", false).classed("tick-hidden-text", false);
7334
6936
  textOfTicks.push(this);
7335
6937
  });
7336
6938
  var toRemove = this.filterRepeatedElements(textOfTicks);
@@ -7342,16 +6944,11 @@
7342
6944
  var groupSelection = d3Selection.select(group);
7343
6945
  // zero-out the d3-provided x position of all labels since we're manually translating the x position of the entire group;
7344
6946
  // add IGNORE_INTERACTION_CLASS so that mouse events used for displaying the title don't propagate from the mouse-interactive-area
7345
- groupSelection
7346
- .select("text")
7347
- .attr("x", 0)
7348
- .classed(IGNORE_INTERACTION_CLASS, true);
6947
+ groupSelection.select("text").attr("x", 0).classed(IGNORE_INTERACTION_CLASS, true);
7349
6948
  groupSelection.classed("pointer-events", true);
7350
6949
  if (groupSelection.select("title").empty()) {
7351
6950
  var datum = groupSelection.data()[0];
7352
- var titleText = (scale.formatters["tick"]
7353
- ? scale.formatters["tick"](datum)
7354
- : datum);
6951
+ var titleText = (scale.formatters["tick"] ? scale.formatters["tick"](datum) : datum);
7355
6952
  groupSelection.append("title").text(titleText);
7356
6953
  }
7357
6954
  });
@@ -7361,9 +6958,7 @@
7361
6958
  var _this = this;
7362
6959
  var _a;
7363
6960
  var axisConfig = this.config().axis;
7364
- if (scale.id === this.bottomScaleId &&
7365
- (scale.isContinuous() ||
7366
- !axisConfig.bottom.tickLabel.overflowHandler)) {
6961
+ if (scale.id === this.bottomScaleId && (scale.isContinuous() || !axisConfig.bottom.tickLabel.overflowHandler)) {
7367
6962
  var textToHide = this.getElementsToHide(axisLabels, this._config.dimension.width(), true);
7368
6963
  textToHide.forEach(function (group) {
7369
6964
  var groupSelection = d3Selection.select(group);
@@ -7389,14 +6984,9 @@
7389
6984
  var maxLeftWidth = axisConfig.left.tickLabel.maxWidth;
7390
6985
  if (scale.id === this.bottomScaleId) {
7391
6986
  var maxBottomWidth = axisConfig.bottom.tickLabel.maxWidth;
7392
- var calculatedBottomWidth = scale.bandwidth
7393
- ? scale.bandwidth()
7394
- : this.getTickDistance(axisLabels);
6987
+ var calculatedBottomWidth = scale.bandwidth ? scale.bandwidth() : this.getTickDistance(axisLabels);
7395
6988
  if (!isUndefined__default["default"](maxBottomWidth)) {
7396
- widthLimit =
7397
- calculatedBottomWidth > maxBottomWidth
7398
- ? maxBottomWidth
7399
- : calculatedBottomWidth;
6989
+ widthLimit = calculatedBottomWidth > maxBottomWidth ? maxBottomWidth : calculatedBottomWidth;
7400
6990
  }
7401
6991
  else {
7402
6992
  widthLimit = calculatedBottomWidth;
@@ -7405,14 +6995,9 @@
7405
6995
  overflowHandler = axisConfig.bottom.tickLabel.overflowHandler;
7406
6996
  }
7407
6997
  else if (scale.id === this.rightScaleId && !axisConfig.right.fit) {
7408
- var calculatedRightWidth = margin.right -
7409
- axisConfig.right.padding -
7410
- axisConfig.right.tickSize;
6998
+ var calculatedRightWidth = margin.right - axisConfig.right.padding - axisConfig.right.tickSize;
7411
6999
  if (!isUndefined__default["default"](maxRightWidth)) {
7412
- widthLimit =
7413
- calculatedRightWidth > maxRightWidth
7414
- ? maxRightWidth
7415
- : calculatedRightWidth;
7000
+ widthLimit = calculatedRightWidth > maxRightWidth ? maxRightWidth : calculatedRightWidth;
7416
7001
  }
7417
7002
  else {
7418
7003
  widthLimit = calculatedRightWidth;
@@ -7421,14 +7006,9 @@
7421
7006
  overflowHandler = axisConfig.right.tickLabel.overflowHandler;
7422
7007
  }
7423
7008
  else if (scale.id === this.leftScaleId && !axisConfig.left.fit) {
7424
- var calculatedLeftWidth = margin.left -
7425
- axisConfig.left.padding -
7426
- axisConfig.left.tickSize;
7009
+ var calculatedLeftWidth = margin.left - axisConfig.left.padding - axisConfig.left.tickSize;
7427
7010
  if (!isUndefined__default["default"](maxLeftWidth)) {
7428
- widthLimit =
7429
- calculatedLeftWidth > maxLeftWidth
7430
- ? maxLeftWidth
7431
- : calculatedLeftWidth;
7011
+ widthLimit = calculatedLeftWidth > maxLeftWidth ? maxLeftWidth : calculatedLeftWidth;
7432
7012
  }
7433
7013
  else {
7434
7014
  widthLimit = calculatedLeftWidth;
@@ -7436,17 +7016,13 @@
7436
7016
  horizontalPadding = axisConfig.left.tickLabel.horizontalPadding;
7437
7017
  overflowHandler = axisConfig.left.tickLabel.overflowHandler;
7438
7018
  }
7439
- else if (scale.id === this.rightScaleId &&
7440
- axisConfig.right.fit &&
7441
- !isUndefined__default["default"](maxRightWidth)) {
7019
+ else if (scale.id === this.rightScaleId && axisConfig.right.fit && !isUndefined__default["default"](maxRightWidth)) {
7442
7020
  widthLimit = maxRightWidth;
7443
7021
  horizontalPadding = axisConfig.right.tickLabel.horizontalPadding;
7444
7022
  overflowHandler = axisConfig.right.tickLabel.overflowHandler;
7445
7023
  fixRightMargin = true;
7446
7024
  }
7447
- else if (scale.id === this.leftScaleId &&
7448
- axisConfig.left.fit &&
7449
- !isUndefined__default["default"](maxLeftWidth)) {
7025
+ else if (scale.id === this.leftScaleId && axisConfig.left.fit && !isUndefined__default["default"](maxLeftWidth)) {
7450
7026
  widthLimit = maxLeftWidth;
7451
7027
  horizontalPadding = axisConfig.left.tickLabel.horizontalPadding;
7452
7028
  overflowHandler = axisConfig.left.tickLabel.overflowHandler;
@@ -7462,11 +7038,7 @@
7462
7038
  var ellipsisWidth = 0;
7463
7039
  if (labelGroup.select(".sample-ellipsis").empty()) {
7464
7040
  var testText = labelGroup.append("text");
7465
- var ellipsis = testText
7466
- .classed("sample-ellipsis", true)
7467
- .attr("opacity", 0)
7468
- .append("tspan")
7469
- .text("...");
7041
+ var ellipsis = testText.classed("sample-ellipsis", true).attr("opacity", 0).append("tspan").text("...");
7470
7042
  ellipsisWidth = ((_a = ellipsis.node()) === null || _a === void 0 ? void 0 : _a.getComputedTextLength()) || 0;
7471
7043
  testText.remove();
7472
7044
  }
@@ -7485,13 +7057,7 @@
7485
7057
  axisLabels.forEach(function (group) {
7486
7058
  var groupSelection = d3Selection.select(group);
7487
7059
  // invoke the handler for each text element
7488
- groupSelection
7489
- .select("text")
7490
- .call(overflowHandler, {
7491
- widthLimit: widthLimit,
7492
- horizontalPadding: horizontalPadding,
7493
- ellipsisWidth: ellipsisWidth,
7494
- });
7060
+ groupSelection.select("text").call(overflowHandler, { widthLimit: widthLimit, horizontalPadding: horizontalPadding, ellipsisWidth: ellipsisWidth });
7495
7061
  // restore pointer events
7496
7062
  groupSelection.classed("pointer-events", true);
7497
7063
  });
@@ -7513,9 +7079,7 @@
7513
7079
  return actualTextElements;
7514
7080
  };
7515
7081
  XYGrid.prototype.getOuterWidthDimensionCorrection = function () {
7516
- return this.config().axis.bottom.visible
7517
- ? Grid.TICK_DIMENSION_CORRECTION
7518
- : 0;
7082
+ return this.config().axis.bottom.visible ? Grid.TICK_DIMENSION_CORRECTION : 0;
7519
7083
  };
7520
7084
  XYGrid.prototype.handleMarginUpdate = function () {
7521
7085
  var oldMargin = clone__default["default"](this._config.dimension.margin);
@@ -7524,43 +7088,32 @@
7524
7088
  };
7525
7089
  XYGrid.prototype.hasRightYAxis = function () {
7526
7090
  var _a;
7527
- return (this.config().axis.right.visible && ((_a = this.rightScaleId) === null || _a === void 0 ? void 0 : _a.length) > 0);
7091
+ return this.config().axis.right.visible && ((_a = this.rightScaleId) === null || _a === void 0 ? void 0 : _a.length) > 0;
7528
7092
  };
7529
7093
  XYGrid.prototype.buildAxes = function (container) {
7530
7094
  // Grid lines: no sense to have right
7531
- this.gridY.tickGroup = container
7532
- .append("g")
7095
+ this.gridY.tickGroup = container.append("g")
7533
7096
  .classed("sw-axis sw-axis-grid sw-axis-gridY", true);
7534
- this.gridX.tickGroup = container
7535
- .append("g")
7097
+ this.gridX.tickGroup = container.append("g")
7536
7098
  .classed("sw-axis sw-axis-grid sw-axis-gridX", true);
7537
7099
  // Axis groups
7538
- this.axisX.group = container
7539
- .append("g")
7100
+ this.axisX.group = container.append("g")
7540
7101
  .classed("sw-axis sw-axis-x", true);
7541
- this.axisX.tickGroup = this.axisX.group
7542
- .append("g")
7102
+ this.axisX.tickGroup = this.axisX.group.append("g")
7543
7103
  .classed("sw-axis sw-axis-x sw-axis-x-ticks", true);
7544
- this.axisX.labelGroup = this.axisX.group
7545
- .append("g")
7104
+ this.axisX.labelGroup = this.axisX.group.append("g")
7546
7105
  .classed("sw-axis sw-axis-x sw-axis-x-labels", true);
7547
- this.axisYLeft.group = container
7548
- .append("g")
7106
+ this.axisYLeft.group = container.append("g")
7549
7107
  .classed("sw-axis sw-axis-y sw-axis-y-left", true);
7550
- this.axisYLeft.tickGroup = this.axisYLeft.group
7551
- .append("g")
7108
+ this.axisYLeft.tickGroup = this.axisYLeft.group.append("g")
7552
7109
  .classed("sw-axis sw-axis-y sw-axis-y-ticks", true);
7553
- this.axisYLeft.labelGroup = this.axisYLeft.group
7554
- .append("g")
7110
+ this.axisYLeft.labelGroup = this.axisYLeft.group.append("g")
7555
7111
  .classed("sw-axis sw-axis-y sw-axis-y-labels", true);
7556
- this.axisYRight.group = container
7557
- .append("g")
7112
+ this.axisYRight.group = container.append("g")
7558
7113
  .classed("sw-axis sw-axis-y sw-axis-y-right", true);
7559
- this.axisYRight.tickGroup = this.axisYRight.group
7560
- .append("g")
7114
+ this.axisYRight.tickGroup = this.axisYRight.group.append("g")
7561
7115
  .classed("sw-axis sw-axis-y sw-axis-y-ticks", true);
7562
- this.axisYRight.labelGroup = this.axisYRight.group
7563
- .append("g")
7116
+ this.axisYRight.labelGroup = this.axisYRight.group.append("g")
7564
7117
  .classed("sw-axis sw-axis-y sw-axis-y-labels", true);
7565
7118
  };
7566
7119
  XYGrid.prototype.filterRepeatedElements = function (elementsToFilter) {
@@ -7577,15 +7130,9 @@
7577
7130
  XYGrid.prototype.getElementsToHide = function (elementsToFilter, measurement, isBottomAxis) {
7578
7131
  var elementsToDisplay;
7579
7132
  var measureType = isBottomAxis ? "width" : "height";
7580
- var measurementComparison = this.getTextMeasurement(elementsToFilter, measureType) <
7581
- measurement;
7582
- var bottomAxisComparison = isBottomAxis
7583
- ? this.getMaxTextWidth(elementsToFilter) <
7584
- this.getTickDistance(elementsToFilter)
7585
- : false;
7586
- var shouldNotFilter = isBottomAxis
7587
- ? measurementComparison && bottomAxisComparison
7588
- : measurementComparison;
7133
+ var measurementComparison = (this.getTextMeasurement(elementsToFilter, measureType) < measurement);
7134
+ var bottomAxisComparison = isBottomAxis ? this.getMaxTextWidth(elementsToFilter) < this.getTickDistance(elementsToFilter) : false;
7135
+ var shouldNotFilter = isBottomAxis ? measurementComparison && bottomAxisComparison : measurementComparison;
7589
7136
  if (shouldNotFilter) {
7590
7137
  return [];
7591
7138
  }
@@ -7600,11 +7147,10 @@
7600
7147
  ? _this.getMaxTextWidth(array) > _this.getTickDistance(array)
7601
7148
  : _this.getTextMeasurement(array, measureType) > parameter; };
7602
7149
  do {
7603
- elementsToDisplay = elementsToFilter.filter(function (element, index) { return index % counter === 0; });
7150
+ elementsToDisplay = elementsToFilter.filter(function (element, index) { return (index % counter) === 0; });
7604
7151
  counter++;
7605
7152
  // Break the loop when we have only 1 tick and its size is bigger than available width/height
7606
- if (elementsToDisplay.length === 1 &&
7607
- condition(elementsToDisplay)) {
7153
+ if (elementsToDisplay.length === 1 && condition(elementsToDisplay)) {
7608
7154
  break;
7609
7155
  }
7610
7156
  } while (condition(elementsToDisplay));
@@ -7612,9 +7158,7 @@
7612
7158
  };
7613
7159
  XYGrid.prototype.getTextMeasurement = function (array, measureType) {
7614
7160
  var textPadding = measureType === "width" ? 5 : 0;
7615
- return array.reduce(function (prev, next) { return prev +
7616
- next.getBoundingClientRect()[measureType] +
7617
- textPadding; }, 0);
7161
+ return array.reduce(function (prev, next) { return prev + next.getBoundingClientRect()[measureType] + textPadding; }, 0);
7618
7162
  };
7619
7163
  XYGrid.prototype.getMaxTextWidth = function (array) {
7620
7164
  if (array.length === 0) {
@@ -7653,24 +7197,13 @@
7653
7197
  var oldOuterWidth = d.outerWidth();
7654
7198
  var oldOuterHeight = d.outerHeight();
7655
7199
  if (!((_a = d.marginLocked) === null || _a === void 0 ? void 0 : _a.left) && axis.left.fit && axis.left.visible) {
7656
- d.margin.left =
7657
- this.getMaxTextWidth(this.selectAllAxisLabels(this.axisYLeft.labelGroup)) +
7658
- axis.left.tickSize +
7659
- axis.left.padding;
7200
+ d.margin.left = this.getMaxTextWidth(this.selectAllAxisLabels(this.axisYLeft.labelGroup)) + axis.left.tickSize + axis.left.padding;
7660
7201
  }
7661
7202
  if (!((_b = d.marginLocked) === null || _b === void 0 ? void 0 : _b.right) && axis.right.fit && this.hasRightYAxis()) {
7662
- d.margin.right =
7663
- this.getMaxTextWidth(this.selectAllAxisLabels(this.axisYRight.labelGroup)) +
7664
- axis.right.tickSize +
7665
- axis.right.padding;
7666
- }
7667
- var bottomScale = this.bottomScaleId && this.scales
7668
- ? (_c = this.scales["x"]) === null || _c === void 0 ? void 0 : _c.index[this.bottomScaleId]
7669
- : undefined;
7670
- if (axis.bottom.fit &&
7671
- axis.bottom.visible &&
7672
- ((bottomScale === null || bottomScale === void 0 ? void 0 : bottomScale.isContinuous()) ||
7673
- !axis.bottom.tickLabel.overflowHandler)) {
7203
+ d.margin.right = this.getMaxTextWidth(this.selectAllAxisLabels(this.axisYRight.labelGroup)) + axis.right.tickSize + axis.right.padding;
7204
+ }
7205
+ var bottomScale = this.bottomScaleId && this.scales ? (_c = this.scales["x"]) === null || _c === void 0 ? void 0 : _c.index[this.bottomScaleId] : undefined;
7206
+ if (axis.bottom.fit && axis.bottom.visible && ((bottomScale === null || bottomScale === void 0 ? void 0 : bottomScale.isContinuous()) || !axis.bottom.tickLabel.overflowHandler)) {
7674
7207
  this.fitBottomAxis(d);
7675
7208
  }
7676
7209
  var newTopMargin = d.margin.top; // TODO: Do the calculation, if needed
@@ -7694,15 +7227,12 @@
7694
7227
  }
7695
7228
  var lastTextWidth = 0;
7696
7229
  var lastTickScaleValue = 0;
7697
- var node = this.axisX.labelGroup
7698
- .select(".tick:not(.tick-hidden-text):last-child text")
7699
- .node();
7230
+ var node = this.axisX.labelGroup.select(".tick:not(.tick-hidden-text):last-child text").node();
7700
7231
  if (node) {
7701
7232
  lastTextWidth = node.getBoundingClientRect().width;
7702
7233
  lastTickScaleValue = (_c = scale(node.innerHTML)) !== null && _c !== void 0 ? _c : 0;
7703
7234
  var topOfRange = scale.range()[1];
7704
- var diff = lastTextWidth / 2 -
7705
- Math.abs(topOfRange - lastTickScaleValue) / 2;
7235
+ var diff = (lastTextWidth / 2) - (Math.abs(topOfRange - lastTickScaleValue) / 2);
7706
7236
  d.margin.right = diff > 0 ? diff : 0;
7707
7237
  }
7708
7238
  };
@@ -7729,10 +7259,10 @@
7729
7259
  }, 100);
7730
7260
  };
7731
7261
  XYGrid.prototype.areMarginsApproximatelyEqual = function (margin1, margin2) {
7732
- return (this.isApproximatelyEqual(margin1.top, margin2.top) &&
7262
+ return this.isApproximatelyEqual(margin1.top, margin2.top) &&
7733
7263
  this.isApproximatelyEqual(margin1.right, margin2.right) &&
7734
7264
  this.isApproximatelyEqual(margin1.bottom, margin2.bottom) &&
7735
- this.isApproximatelyEqual(margin1.left, margin2.left));
7265
+ this.isApproximatelyEqual(margin1.left, margin2.left);
7736
7266
  };
7737
7267
  return XYGrid;
7738
7268
  }(Grid));
@@ -7789,18 +7319,14 @@
7789
7319
  */
7790
7320
  GaugeUtil.createChartAssist = function (gaugeConfig, mode, labelsPlugin) {
7791
7321
  var _a, _b, _c;
7792
- var grid = mode === exports.GaugeMode.Donut
7793
- ? radialGrid()
7794
- : new XYGrid(linearGaugeGridConfig(mode, gaugeConfig.linearThickness));
7322
+ var grid = (mode === exports.GaugeMode.Donut) ? radialGrid() : new XYGrid(linearGaugeGridConfig(mode, gaugeConfig.linearThickness));
7795
7323
  var gridConfig = grid.config();
7796
7324
  var chart = new Chart(grid);
7797
- var enableLabels = !isEmpty__default["default"]((_a = gaugeConfig.thresholds) === null || _a === void 0 ? void 0 : _a.definitions) &&
7798
- !((_b = gaugeConfig.thresholds) === null || _b === void 0 ? void 0 : _b.disableMarkers);
7325
+ var enableLabels = !isEmpty__default["default"]((_a = gaugeConfig.thresholds) === null || _a === void 0 ? void 0 : _a.definitions) && !((_b = gaugeConfig.thresholds) === null || _b === void 0 ? void 0 : _b.disableMarkers);
7799
7326
  if (mode === exports.GaugeMode.Donut) {
7800
7327
  if (enableLabels) {
7801
7328
  chart.addPlugin(labelsPlugin !== null && labelsPlugin !== void 0 ? labelsPlugin : new DonutGaugeLabelsPlugin());
7802
- gridConfig.dimension.margin =
7803
- GaugeUtil.getMarginForLabelClearance(gaugeConfig, mode, gridConfig.dimension.margin);
7329
+ gridConfig.dimension.margin = GaugeUtil.getMarginForLabelClearance(gaugeConfig, mode, gridConfig.dimension.margin);
7804
7330
  }
7805
7331
  return new ChartAssist(chart, radial);
7806
7332
  }
@@ -7852,21 +7378,10 @@
7852
7378
  var updatedSeriesSet = seriesSet.map(function (series) {
7853
7379
  var _a, _b, _c;
7854
7380
  if (series.id === GAUGE_QUANTITY_SERIES_ID) {
7855
- return Object.assign(Object.assign({}, series), { data: [
7856
- {
7857
- category: GaugeUtil.DATA_CATEGORY,
7858
- value: clampedConfig.value,
7859
- },
7860
- ], activeThreshold: thresholdsData.activeThreshold, defaultColor: clampedConfig.defaultQuantityColor ||
7861
- exports.StandardGaugeColor.Ok });
7381
+ return Object.assign(Object.assign({}, series), { data: [{ category: GaugeUtil.DATA_CATEGORY, value: clampedConfig.value }], activeThreshold: thresholdsData.activeThreshold, defaultColor: clampedConfig.defaultQuantityColor || exports.StandardGaugeColor.Ok });
7862
7382
  }
7863
7383
  if (series.id === GAUGE_REMAINDER_SERIES_ID) {
7864
- return Object.assign(Object.assign({}, series), { data: [
7865
- {
7866
- category: GaugeUtil.DATA_CATEGORY,
7867
- value: clampedConfig.max - clampedConfig.value,
7868
- },
7869
- ] });
7384
+ return Object.assign(Object.assign({}, series), { data: [{ category: GaugeUtil.DATA_CATEGORY, value: clampedConfig.max - clampedConfig.value }] });
7870
7385
  }
7871
7386
  if (series.id === GAUGE_THRESHOLD_MARKERS_SERIES_ID) {
7872
7387
  series.renderer.config.enabled = !((_a = clampedConfig.thresholds) === null || _a === void 0 ? void 0 : _a.disableMarkers);
@@ -7960,21 +7475,16 @@
7960
7475
  var seriesSet = GaugeUtil.generateQuantityAndRemainderData(gaugeConfig).map(function (series) {
7961
7476
  var quantityAccessors = renderingAttributes.quantityAccessors, remainderAccessors = renderingAttributes.remainderAccessors, scales = renderingAttributes.scales, mainRenderer = renderingAttributes.mainRenderer;
7962
7477
  if (quantityAccessors.data) {
7963
- quantityAccessors.data.color = function (data, i, series, dataSeries) { return dataSeries.activeThreshold
7964
- ? dataSeries.activeThreshold.color
7965
- : dataSeries.defaultColor; };
7478
+ quantityAccessors.data.color = function (data, i, series, dataSeries) { return dataSeries.activeThreshold ? dataSeries.activeThreshold.color : dataSeries.defaultColor; };
7966
7479
  }
7967
7480
  if (remainderAccessors.data) {
7968
7481
  remainderAccessors.data.color = function () { return gaugeConfig.remainderColor || exports.StandardGaugeColor.Remainder; };
7969
7482
  }
7970
7483
  if (series.id === GAUGE_QUANTITY_SERIES_ID) {
7971
7484
  series.activeThreshold = activeThreshold;
7972
- series.defaultColor =
7973
- gaugeConfig.defaultQuantityColor || exports.StandardGaugeColor.Ok;
7485
+ series.defaultColor = gaugeConfig.defaultQuantityColor || exports.StandardGaugeColor.Ok;
7974
7486
  }
7975
- return Object.assign(Object.assign({}, series), { accessors: series.id === GAUGE_QUANTITY_SERIES_ID
7976
- ? quantityAccessors
7977
- : remainderAccessors, scales: scales, renderer: mainRenderer });
7487
+ return Object.assign(Object.assign({}, series), { accessors: series.id === GAUGE_QUANTITY_SERIES_ID ? quantityAccessors : remainderAccessors, scales: scales, renderer: mainRenderer });
7978
7488
  });
7979
7489
  return seriesSet;
7980
7490
  };
@@ -8037,8 +7547,7 @@
8037
7547
  remainderAccessorFunction: function () { return new RadialAccessors(); },
8038
7548
  scaleFunction: function () {
8039
7549
  var scales = radialScales();
8040
- scales.r.formatters[GAUGE_LABEL_FORMATTER_NAME_DEFAULT] =
8041
- labelFormatter;
7550
+ scales.r.formatters[GAUGE_LABEL_FORMATTER_NAME_DEFAULT] = labelFormatter;
8042
7551
  return scales;
8043
7552
  },
8044
7553
  },
@@ -8049,8 +7558,7 @@
8049
7558
  remainderAccessorFunction: function () { return new HorizontalBarAccessors(); },
8050
7559
  scaleFunction: function () {
8051
7560
  var scales = barScales({ horizontal: true });
8052
- scales.x.formatters[GAUGE_LABEL_FORMATTER_NAME_DEFAULT] =
8053
- labelFormatter;
7561
+ scales.x.formatters[GAUGE_LABEL_FORMATTER_NAME_DEFAULT] = labelFormatter;
8054
7562
  return scales;
8055
7563
  },
8056
7564
  },
@@ -8061,8 +7569,7 @@
8061
7569
  remainderAccessorFunction: function () { return new VerticalBarAccessors(); },
8062
7570
  scaleFunction: function () {
8063
7571
  var scales = barScales();
8064
- scales.y.formatters[GAUGE_LABEL_FORMATTER_NAME_DEFAULT] =
8065
- labelFormatter;
7572
+ scales.y.formatters[GAUGE_LABEL_FORMATTER_NAME_DEFAULT] = labelFormatter;
8066
7573
  return scales;
8067
7574
  },
8068
7575
  },
@@ -8080,24 +7587,8 @@
8080
7587
  GaugeUtil.generateQuantityAndRemainderData = function (gaugeConfig) {
8081
7588
  return [
8082
7589
  // category property is used for unifying the linear-style gauge visualization into a single bar stack
8083
- {
8084
- id: GAUGE_QUANTITY_SERIES_ID,
8085
- data: [
8086
- {
8087
- category: GaugeUtil.DATA_CATEGORY,
8088
- value: gaugeConfig.value,
8089
- },
8090
- ],
8091
- },
8092
- {
8093
- id: GAUGE_REMAINDER_SERIES_ID,
8094
- data: [
8095
- {
8096
- category: GaugeUtil.DATA_CATEGORY,
8097
- value: gaugeConfig.max - gaugeConfig.value,
8098
- },
8099
- ],
8100
- },
7590
+ { id: GAUGE_QUANTITY_SERIES_ID, data: [{ category: GaugeUtil.DATA_CATEGORY, value: gaugeConfig.value }] },
7591
+ { id: GAUGE_REMAINDER_SERIES_ID, data: [{ category: GaugeUtil.DATA_CATEGORY, value: gaugeConfig.max - gaugeConfig.value }] },
8101
7592
  ];
8102
7593
  };
8103
7594
  /**
@@ -8143,15 +7634,11 @@
8143
7634
  var _a;
8144
7635
  return (Object.assign(Object.assign({}, threshold), { category: GaugeUtil.DATA_CATEGORY,
8145
7636
  // threshold values are exclusive when in reversed mode, inclusive otherwise
8146
- hit: ((_a = gaugeConfig.thresholds) === null || _a === void 0 ? void 0 : _a.reversed)
8147
- ? threshold.value < gaugeConfig.value
8148
- : threshold.value <= gaugeConfig.value }));
8149
- })
8150
- .sort(function (a, b) { return a.value - b.value; });
8151
- var activeThreshold = ((_b = gaugeConfig
8152
- .thresholds) === null || _b === void 0 ? void 0 : _b.reversed)
8153
- ? thresholds === null || thresholds === void 0 ? void 0 : thresholds.find(function (threshold) { return !isUndefined__default["default"](threshold.hit) && !threshold.hit; })
8154
- : thresholds === null || thresholds === void 0 ? void 0 : thresholds.slice().reverse().find(function (threshold) { return threshold.hit; });
7637
+ hit: ((_a = gaugeConfig.thresholds) === null || _a === void 0 ? void 0 : _a.reversed) ? threshold.value < gaugeConfig.value : threshold.value <= gaugeConfig.value }));
7638
+ }).sort(function (a, b) { return a.value - b.value; });
7639
+ var activeThreshold = ((_b = gaugeConfig.thresholds) === null || _b === void 0 ? void 0 : _b.reversed) ?
7640
+ thresholds === null || thresholds === void 0 ? void 0 : thresholds.find(function (threshold) { return !isUndefined__default["default"](threshold.hit) && !threshold.hit; }) :
7641
+ thresholds === null || thresholds === void 0 ? void 0 : thresholds.slice().reverse().find(function (threshold) { return threshold.hit; });
8155
7642
  return {
8156
7643
  thresholds: thresholds,
8157
7644
  activeThreshold: activeThreshold,
@@ -8203,7 +7690,8 @@
8203
7690
  this.get = function (entityId) { return _this.valueMap[entityId] || _this.defaultValue; };
8204
7691
  this.reset();
8205
7692
  }
8206
- MappedValueProvider.prototype.reset = function () { };
7693
+ MappedValueProvider.prototype.reset = function () {
7694
+ };
8207
7695
  return MappedValueProvider;
8208
7696
  }());
8209
7697
 
@@ -8219,13 +7707,13 @@
8219
7707
  function PathMarker(d) {
8220
7708
  this.element = document.createElement("path");
8221
7709
  this.setAttributes({
8222
- class: "nui-chart-element-marker nui-chart--path__outline",
7710
+ "class": "nui-chart-element-marker nui-chart--path__outline",
8223
7711
  "vector-effect": "non-scaling-stroke",
8224
- d: d,
7712
+ "d": d,
8225
7713
  });
8226
7714
  }
8227
7715
  PathMarker.prototype.setColor = function (color) {
8228
- this.setAttributes({ fill: color });
7716
+ this.setAttributes({ "fill": color });
8229
7717
  };
8230
7718
  PathMarker.prototype.setAttributes = function (attrs) {
8231
7719
  var e_1, _a;
@@ -8278,10 +7766,7 @@
8278
7766
  PointScale.prototype.invert = function (coordinate) {
8279
7767
  var _this = this;
8280
7768
  var domain = this._d3Scale.domain();
8281
- var rangeMidPoints = domain
8282
- .map(this._d3Scale)
8283
- .slice(0, -1)
8284
- .map(function (d) { return d + _this._d3Scale.step() / 2; });
7769
+ var rangeMidPoints = domain.map(this._d3Scale).slice(0, -1).map(function (d) { return d + _this._d3Scale.step() / 2; });
8285
7770
  return domain[d3Array.bisect(rangeMidPoints, coordinate)];
8286
7771
  };
8287
7772
  PointScale.prototype.round = function (round) {
@@ -8328,23 +7813,15 @@
8328
7813
 
8329
7814
  var intlFormat = function (date, options) { return new Intl.DateTimeFormat(moment__default["default"].locale(), options).format(date); };
8330
7815
  var ɵ0 = intlFormat;
8331
- var formatSecond = function (d) { return intlFormat(d, {
8332
- hour: "numeric",
8333
- minute: "2-digit",
8334
- second: "2-digit",
8335
- }); }, formatMinute = function (d) { return intlFormat(d, { hour: "numeric", minute: "2-digit" }); }, formatWeek = function (d) { return intlFormat(d, { month: "short", day: "2-digit" }); }, formatMonth = function (d) { return intlFormat(d, { month: "short" }); }, formatYear = function (d) { return intlFormat(d, { year: "numeric" }); };
7816
+ var formatSecond = function (d) { return intlFormat(d, { hour: "numeric", minute: "2-digit", second: "2-digit" }); }, formatMinute = function (d) { return intlFormat(d, { hour: "numeric", minute: "2-digit" }); }, formatWeek = function (d) { return intlFormat(d, { month: "short", day: "2-digit" }); }, formatMonth = function (d) { return intlFormat(d, { month: "short" }); }, formatYear = function (d) { return intlFormat(d, { year: "numeric" }); };
8336
7817
  var ɵ1 = formatSecond, ɵ2 = formatMinute, ɵ3 = formatWeek, ɵ4 = formatMonth, ɵ5 = formatYear;
8337
7818
  /**
8338
7819
  * Formatter for dates
8339
7820
  */
8340
- var datetimeFormatter = function (date) { return (d3Time.timeMinute(date) < date
8341
- ? formatSecond
8342
- : d3Time.timeDay(date) < date
8343
- ? formatMinute
8344
- : d3Time.timeMonth(date) < date
8345
- ? formatWeek
8346
- : d3Time.timeYear(date) < date
8347
- ? formatMonth
7821
+ var datetimeFormatter = function (date) { return (d3Time.timeMinute(date) < date ? formatSecond
7822
+ : d3Time.timeDay(date) < date ? formatMinute
7823
+ : d3Time.timeMonth(date) < date ? formatWeek
7824
+ : d3Time.timeYear(date) < date ? formatMonth
8348
7825
  : formatYear)(date); };
8349
7826
 
8350
7827
  /**
@@ -8365,16 +7842,14 @@
8365
7842
  };
8366
7843
  TimeScale.prototype.invert = function (coordinate) {
8367
7844
  var date = this._d3Scale.invert(coordinate);
8368
- var result = isNaN(date.getTime())
8369
- ? undefined
8370
- : date;
7845
+ var result = isNaN(date.getTime()) ? undefined : date;
8371
7846
  return result;
8372
7847
  };
8373
7848
  TimeScale.prototype.isContinuous = function () {
8374
7849
  return true;
8375
7850
  };
8376
7851
  TimeScale.prototype.isDomainValid = function () {
8377
- return (-1 === this.domain().findIndex(function (value) { return isNaN(value.getTime()); }));
7852
+ return -1 === this.domain().findIndex(function (value) { return isNaN(value.getTime()); });
8378
7853
  };
8379
7854
  return TimeScale;
8380
7855
  }(Scale));
@@ -8405,10 +7880,8 @@
8405
7880
  standardTimeOffsetMs = isTransFromDst ? 3600000 : -3600000;
8406
7881
  }
8407
7882
  var adjustedDate = new Date(inputDate.getTime() + standardTimeOffsetMs);
8408
- var endDate = intervalDays >= 1
8409
- ? moment__default["default"](adjustedDate).add(intervalDays, "days").toDate()
8410
- : moment__default["default"](adjustedDate).add(_this.interval()).toDate();
8411
- return (datetimeFormatter(adjustedDate) + " - " + datetimeFormatter(endDate));
7883
+ var endDate = intervalDays >= 1 ? moment__default["default"](adjustedDate).add(intervalDays, "days").toDate() : moment__default["default"](adjustedDate).add(_this.interval()).toDate();
7884
+ return datetimeFormatter(adjustedDate) + " - " + datetimeFormatter(endDate);
8412
7885
  };
8413
7886
  _this.interval(interval);
8414
7887
  _this._bandScale = d3Scale.scaleBand();
@@ -8437,9 +7910,7 @@
8437
7910
  }
8438
7911
  this._bandScale.domain(bands);
8439
7912
  // maintain the same domain if it's empty
8440
- var d = isDomainEmpty
8441
- ? domain
8442
- : [domain[0], moment__default["default"](domain[1]).add(this.interval()).toDate()];
7913
+ var d = isDomainEmpty ? domain : [domain[0], moment__default["default"](domain[1]).add(this.interval()).toDate()];
8443
7914
  return _super.prototype.domain.call(this, d);
8444
7915
  }
8445
7916
  return _super.prototype.domain.call(this);
@@ -8487,22 +7958,17 @@
8487
7958
  return datetime;
8488
7959
  }
8489
7960
  var isDst = isDaylightSavingTime(datetime);
8490
- var isDomainStartDst = isDomainChange
8491
- ? isDst
8492
- : isDaylightSavingTime(this.domain()[0]);
7961
+ var isDomainStartDst = isDomainChange ? isDst : isDaylightSavingTime(this.domain()[0]);
8493
7962
  var isTransFromDst = isDomainStartDst && !isDst;
8494
7963
  var isTransToDst = !isDomainStartDst && isDst;
8495
7964
  var intervalDays = this.interval().asDays();
8496
- var transToDstAdjustment = intervalDays >= 1 && isTransToDst
8497
- ? moment.duration(1, "hour").asMilliseconds()
8498
- : 0;
7965
+ var transToDstAdjustment = intervalDays >= 1 && isTransToDst ? moment.duration(1, "hour").asMilliseconds() : 0;
8499
7966
  var adjustedDt = new Date(datetime.getTime() + transToDstAdjustment);
8500
7967
  var standardTimeOffsetMinutes = 0;
8501
7968
  if (isTransFromDst || isTransToDst) {
8502
7969
  standardTimeOffsetMinutes = isTransFromDst ? -60 : 60;
8503
7970
  }
8504
- var timeZoneOffsetMs = (adjustedDt.getTimezoneOffset() + standardTimeOffsetMinutes) *
8505
- 60000;
7971
+ var timeZoneOffsetMs = (adjustedDt.getTimezoneOffset() + standardTimeOffsetMinutes) * 60000;
8506
7972
  var timestamp = adjustedDt.getTime() - timeZoneOffsetMs;
8507
7973
  var intervalMs = interval.asMilliseconds();
8508
7974
  var remainder = timestamp % intervalMs;
@@ -8529,9 +7995,7 @@
8529
7995
  // Add one hour to the "to" date if:
8530
7996
  // 1) we're transitioning to daylight saving time and 2) the interval is >= one day.
8531
7997
  // This ensures that the last day in the domain, which starts an hour later, is included in the generated bands.
8532
- var dstAdjustment = !isDomainStartDst && isDomainEndDst
8533
- ? moment.duration(1, "hour").asMilliseconds()
8534
- : 0;
7998
+ var dstAdjustment = !isDomainStartDst && isDomainEndDst ? moment.duration(1, "hour").asMilliseconds() : 0;
8535
7999
  var adjustedToDate = intervalDays >= 1 ? new Date(to.getTime() + dstAdjustment) : to;
8536
8000
  while (bandDate <= adjustedToDate) {
8537
8001
  bands.push(bandDate);
@@ -8599,8 +8063,7 @@
8599
8063
  data: {
8600
8064
  category: function (d) { return d.name; },
8601
8065
  value: function (d) { return d.value; },
8602
- },
8603
- series: {},
8066
+ }, series: {},
8604
8067
  };
8605
8068
  }
8606
8069
  return DataSeries;
@@ -8722,8 +8185,8 @@
8722
8185
  }
8723
8186
 
8724
8187
  /**
8725
- * This plugin calculates new size and position for content inside donut chart
8726
- */
8188
+ * This plugin calculates new size and position for content inside donut chart
8189
+ */
8727
8190
  var ChartDonutContentPlugin = /** @class */ (function (_super) {
8728
8191
  __extends(ChartDonutContentPlugin, _super);
8729
8192
  function ChartDonutContentPlugin() {
@@ -8740,11 +8203,8 @@
8740
8203
  return _this;
8741
8204
  }
8742
8205
  ChartDonutContentPlugin.prototype.updateDimensions = function () {
8743
- var radius = this.chart
8744
- .getDataManager()
8745
- .chartSeriesSet.reduce(function (prev, current) {
8746
- if (current.renderer instanceof RadialRenderer &&
8747
- !isUndefined__default["default"](prev)) {
8206
+ var radius = this.chart.getDataManager().chartSeriesSet.reduce(function (prev, current) {
8207
+ if (current.renderer instanceof RadialRenderer && !isUndefined__default["default"](prev)) {
8748
8208
  return Math.min(prev, current.renderer.getInnerRadius(current.scales.r.range(), current.data.length - 1));
8749
8209
  }
8750
8210
  return prev;
@@ -8759,13 +8219,10 @@
8759
8219
  this.contentPositionUpdateSubject.complete();
8760
8220
  };
8761
8221
  ChartDonutContentPlugin.prototype.getContentPosition = function (areaSize) {
8762
- var basics = [
8763
- this.chart.getGrid().config().dimension.outerHeight() / 2,
8764
- this.chart.getGrid().config().dimension.outerWidth() / 2,
8765
- ];
8222
+ var basics = [this.chart.getGrid().config().dimension.outerHeight() / 2, this.chart.getGrid().config().dimension.outerWidth() / 2];
8766
8223
  return {
8767
- top: basics[0] - areaSize / Math.sqrt(2),
8768
- left: basics[1] - areaSize / Math.sqrt(2),
8224
+ top: basics[0] - (areaSize / Math.sqrt(2)),
8225
+ left: basics[1] - (areaSize / Math.sqrt(2)),
8769
8226
  width: areaSize * Math.sqrt(2),
8770
8227
  height: areaSize * Math.sqrt(2),
8771
8228
  };
@@ -8809,19 +8266,12 @@
8809
8266
  }
8810
8267
  ChartPopoverPlugin.prototype.initialize = function () {
8811
8268
  var _this = this;
8812
- this.chart
8813
- .getEventBus()
8814
- .getStream(this.config.eventStreamId)
8815
- .pipe(operators.takeUntil(this.destroy$))
8816
- .subscribe(function (event) {
8269
+ this.chart.getEventBus().getStream(this.config.eventStreamId).pipe(operators.takeUntil(this.destroy$)).subscribe(function (event) {
8817
8270
  var _c;
8818
8271
  var _a;
8819
8272
  if (event.data.interactionType === _this.config.interactionType) {
8820
8273
  // here we handle data either of type IInteractionDataPointsEvent or IInteractionDataPointEvent
8821
- var dataPoints = (_a = event.data
8822
- .dataPoints) !== null && _a !== void 0 ? _a : (_c = {},
8823
- _c[event.data.dataPoint.seriesId] = event.data.dataPoint,
8824
- _c);
8274
+ var dataPoints = (_a = event.data.dataPoints) !== null && _a !== void 0 ? _a : (_c = {}, _c[event.data.dataPoint.seriesId] = event.data.dataPoint, _c);
8825
8275
  _this.processDataPoints(dataPoints);
8826
8276
  }
8827
8277
  });
@@ -8848,11 +8298,8 @@
8848
8298
  throw new Error("Chart parent node is not defined");
8849
8299
  }
8850
8300
  var dataPointsLeft = Math.min.apply(Math, __spreadArray([], __read(valuesArray.map(function (d) { return d.position.x; }))));
8851
- var left = chartElement.offsetLeft +
8852
- this.chart.getGrid().config().dimension.margin.left +
8853
- dataPointsLeft;
8854
- var top = chartElement.offsetTop +
8855
- this.chart.getGrid().config().dimension.margin.top;
8301
+ var left = chartElement.offsetLeft + this.chart.getGrid().config().dimension.margin.left + dataPointsLeft;
8302
+ var top = chartElement.offsetTop + this.chart.getGrid().config().dimension.margin.top;
8856
8303
  // area for popovers is enlarged to cover the whole chart (top to bottom),
8857
8304
  // so that we avoid collision of chart visualization and popover (by UX request)
8858
8305
  return {
@@ -8905,13 +8352,9 @@
8905
8352
  }
8906
8353
  var dataPointsLeft = Math.min.apply(Math, __spreadArray([], __read(valArr.map(function (d) { return d.position.x; }))));
8907
8354
  var dataPointsTop = Math.min.apply(Math, __spreadArray([], __read(valArr.map(function (d) { return d.position.y; }))));
8908
- var left = chartElement.offsetLeft +
8909
- this.chart.getGrid().config().dimension.margin.left +
8910
- dataPointsLeft +
8911
- this.chart.getGrid().config().dimension.width() / 2;
8912
- var top = chartElement.offsetTop +
8913
- dataPointsTop +
8914
- this.chart.getGrid().config().dimension.height() / 2;
8355
+ var left = chartElement.offsetLeft + this.chart.getGrid().config().dimension.margin.left
8356
+ + dataPointsLeft + this.chart.getGrid().config().dimension.width() / 2;
8357
+ var top = chartElement.offsetTop + dataPointsTop + this.chart.getGrid().config().dimension.height() / 2;
8915
8358
  return {
8916
8359
  top: top,
8917
8360
  left: left,
@@ -8926,40 +8369,34 @@
8926
8369
  var TOOLTIP_POSITION_OFFSET = 10;
8927
8370
  /** @ignore
8928
8371
  * Used for charts where tooltips should be placed aside of some vertical line */
8929
- var getVerticalSetup = function (offset) { return [
8930
- {
8372
+ var getVerticalSetup = function (offset) { return [{
8931
8373
  originX: "end",
8932
8374
  originY: "top",
8933
8375
  overlayX: "start",
8934
8376
  overlayY: "center",
8935
8377
  offsetX: offset,
8936
- },
8937
- {
8378
+ }, {
8938
8379
  originX: "start",
8939
8380
  originY: "center",
8940
8381
  overlayX: "end",
8941
8382
  overlayY: "center",
8942
8383
  offsetX: -offset,
8943
- },
8944
- ]; };
8384
+ }]; };
8945
8385
  /** @ignore
8946
8386
  * Used for charts where tooltips should be placed aligned to some horizontal line (as Horizontal Bar Charts) */
8947
- var getHorizontalSetup = function (offset) { return [
8948
- {
8387
+ var getHorizontalSetup = function (offset) { return [{
8949
8388
  originX: "end",
8950
8389
  originY: "top",
8951
8390
  overlayX: "center",
8952
8391
  overlayY: "bottom",
8953
8392
  offsetY: -offset,
8954
- },
8955
- {
8393
+ }, {
8956
8394
  originX: "end",
8957
8395
  originY: "bottom",
8958
8396
  overlayX: "center",
8959
8397
  overlayY: "top",
8960
8398
  offsetY: offset,
8961
- },
8962
- ]; };
8399
+ }]; };
8963
8400
  /**
8964
8401
  * This plugin listens to the INTERACTION_DATA_POINTS_EVENT and transforms received data into tooltips inputs.
8965
8402
  * The actual tooltips are handled by the ChartTooltipsComponent.
@@ -8999,30 +8436,22 @@
8999
8436
  }
9000
8437
  ChartTooltipsPlugin.prototype.initialize = function () {
9001
8438
  var _this = this;
9002
- this.chart
9003
- .getEventBus()
9004
- .getStream(INTERACTION_DATA_POINTS_EVENT)
8439
+ this.chart.getEventBus().getStream(INTERACTION_DATA_POINTS_EVENT)
9005
8440
  .pipe(operators.takeUntil(this.destroy$))
9006
8441
  .subscribe(function (event) {
9007
- if (event.data.interactionType === exports.InteractionType.MouseMove &&
9008
- _this.isChartInView) {
8442
+ if (event.data.interactionType === exports.InteractionType.MouseMove && _this.isChartInView) {
9009
8443
  var dataPoints = event.data.dataPoints;
9010
8444
  _this.processHighlightedDataPoints(dataPoints);
9011
8445
  }
9012
8446
  });
9013
- this.chart
9014
- .getEventBus()
9015
- .getStream(SERIES_STATE_CHANGE_EVENT)
8447
+ this.chart.getEventBus().getStream(SERIES_STATE_CHANGE_EVENT)
9016
8448
  .pipe(operators.takeUntil(this.destroy$))
9017
8449
  .subscribe(function (event) {
9018
8450
  event.data.forEach(function (series) {
9019
- _this.seriesVisibilityMap[series.seriesId] =
9020
- series.state !== exports.RenderState.hidden;
8451
+ _this.seriesVisibilityMap[series.seriesId] = series.state !== exports.RenderState.hidden;
9021
8452
  });
9022
8453
  });
9023
- this.chart
9024
- .getEventBus()
9025
- .getStream(CHART_VIEW_STATUS_EVENT)
8454
+ this.chart.getEventBus().getStream(CHART_VIEW_STATUS_EVENT)
9026
8455
  .pipe(operators.takeUntil(this.destroy$))
9027
8456
  .subscribe(function (event) {
9028
8457
  _this.isChartInView = event.data.isChartInView;
@@ -9038,9 +8467,7 @@
9038
8467
  ChartTooltipsPlugin.prototype.processHighlightedDataPoints = function (dataPoints) {
9039
8468
  var _this = this;
9040
8469
  var _a, _b;
9041
- var validDataPoints = pickBy__default["default"](dataPoints, function (d) { return d.index >= 0 &&
9042
- d.position &&
9043
- _this.seriesVisibilityMap[d.seriesId] !== false; });
8470
+ var validDataPoints = pickBy__default["default"](dataPoints, function (d) { return d.index >= 0 && d.position && (_this.seriesVisibilityMap[d.seriesId] !== false); });
9044
8471
  if (values__default["default"](validDataPoints).length === 0) {
9045
8472
  this.hideSubject.next();
9046
8473
  return;
@@ -9058,9 +8485,7 @@
9058
8485
  };
9059
8486
  each__default["default"](Object.keys(this.dataPoints), function (seriesId) {
9060
8487
  var dataPoint = _this.dataPoints[seriesId];
9061
- var chartSeries = _this.chart
9062
- .getDataManager()
9063
- .getChartSeries(dataPoint.seriesId);
8488
+ var chartSeries = _this.chart.getDataManager().getChartSeries(dataPoint.seriesId);
9064
8489
  var tooltipRelativePosition = _this.getTooltipPosition(dataPoint, chartSeries);
9065
8490
  _this.dataPointPositions[seriesId] = _this.getAbsolutePosition(tooltipRelativePosition, chartPosition);
9066
8491
  });
@@ -9092,12 +8517,8 @@
9092
8517
  */
9093
8518
  ChartTooltipsPlugin.prototype.getAbsolutePosition = function (relativePosition, chartPosition) {
9094
8519
  return Object.assign({}, relativePosition, {
9095
- x: chartPosition.x +
9096
- this.chart.getGrid().config().dimension.margin.left +
9097
- relativePosition.x,
9098
- y: chartPosition.y +
9099
- this.chart.getGrid().config().dimension.margin.top +
9100
- relativePosition.y,
8520
+ x: chartPosition.x + this.chart.getGrid().config().dimension.margin.left + relativePosition.x,
8521
+ y: chartPosition.y + this.chart.getGrid().config().dimension.margin.top + relativePosition.y,
9101
8522
  });
9102
8523
  };
9103
8524
  return ChartTooltipsPlugin;
@@ -9119,10 +8540,10 @@
9119
8540
  ];
9120
8541
  /** This conversion map is used to calculate the opposite connection points for the tooltip element */
9121
8542
  var OPPOSITE = {
9122
- start: "end",
9123
- end: "start",
9124
- top: "bottom",
9125
- bottom: "top",
8543
+ "start": "end",
8544
+ "end": "start",
8545
+ "top": "bottom",
8546
+ "bottom": "top",
9126
8547
  };
9127
8548
  /**
9128
8549
  * This radial tooltips plugin handles special tooltip positioning requirements for donut / pie charts.
@@ -9153,10 +8574,8 @@
9153
8574
  var absolutePosition = _super.prototype.getAbsolutePosition.call(this, relativePosition, chartPosition);
9154
8575
  // radial grid is shifted so that the origin is located in the middle of the rendering area,
9155
8576
  // so we need to add it back when we're emitting absolute positions for the tooltips
9156
- absolutePosition.x +=
9157
- this.chart.getGrid().config().dimension.width() / 2;
9158
- absolutePosition.y +=
9159
- this.chart.getGrid().config().dimension.height() / 2;
8577
+ absolutePosition.x += this.chart.getGrid().config().dimension.width() / 2;
8578
+ absolutePosition.y += this.chart.getGrid().config().dimension.height() / 2;
9160
8579
  return absolutePosition;
9161
8580
  };
9162
8581
  /**
@@ -9180,7 +8599,7 @@
9180
8599
  * @param {number} sections The number of sections the circle is divided into
9181
8600
  */
9182
8601
  RadialTooltipsPlugin.prototype.getSectionIndex = function (angle, sections) {
9183
- var sectionIndex = Math.round(angle / ((Math.PI * 2) / sections)) % sections;
8602
+ var sectionIndex = Math.round(angle / (Math.PI * 2 / sections)) % sections;
9184
8603
  while (sectionIndex < 0) {
9185
8604
  sectionIndex += sections;
9186
8605
  }
@@ -9212,10 +8631,7 @@
9212
8631
  if (!isUndefined__default["default"](_this.brushStartX)) {
9213
8632
  return;
9214
8633
  }
9215
- _this.chart
9216
- .getEventBus()
9217
- .getStream(INTERACTION_VALUES_ACTIVE_EVENT)
9218
- .next({ data: false });
8634
+ _this.chart.getEventBus().getStream(INTERACTION_VALUES_ACTIVE_EVENT).next({ data: false });
9219
8635
  _this.brushStartX = xCoord;
9220
8636
  };
9221
8637
  _this.brushMove = function (xCoord) {
@@ -9231,10 +8647,7 @@
9231
8647
  }
9232
8648
  var selection = [_this.brushStartX, xCoord].sort(function (a, b) { return a - b; });
9233
8649
  _this.brushStartX = undefined;
9234
- _this.chart
9235
- .getEventBus()
9236
- .getStream(INTERACTION_VALUES_ACTIVE_EVENT)
9237
- .next({ data: true });
8650
+ _this.chart.getEventBus().getStream(INTERACTION_VALUES_ACTIVE_EVENT).next({ data: true });
9238
8651
  // remove the brush
9239
8652
  _this.brush.move(_this.brushElement, null);
9240
8653
  var xScales = _this.grid.scales.x.list;
@@ -9243,17 +8656,12 @@
9243
8656
  }
9244
8657
  var widthCorrection = 0;
9245
8658
  var gridConfig = _this.grid.config();
9246
- if (!gridConfig.disableRenderAreaWidthCorrection &&
9247
- selection[1] ===
9248
- gridConfig.dimension.width() - Grid.RENDER_AREA_WIDTH_CORRECTION) {
8659
+ if (!gridConfig.disableRenderAreaWidthCorrection && selection[1] === gridConfig.dimension.width() - Grid.RENDER_AREA_WIDTH_CORRECTION) {
9249
8660
  // Width correction to accommodate similar adjustment in grid. This ensures that the right-most column of pixels on the chart is selectable.
9250
8661
  widthCorrection = Grid.RENDER_AREA_WIDTH_CORRECTION;
9251
8662
  }
9252
8663
  var data = xScales.reduce(function (result, next) {
9253
- result[next.id] = [
9254
- selection[0],
9255
- selection[1] + widthCorrection,
9256
- ].map(function (x) { return next.invert(x); });
8664
+ result[next.id] = [selection[0], selection[1] + widthCorrection].map(function (x) { return next.invert(x); });
9257
8665
  return result;
9258
8666
  }, {});
9259
8667
  // zoom the chart
@@ -9276,9 +8684,7 @@
9276
8684
  order: STANDARD_RENDER_LAYERS[exports.RenderLayerName.foreground].order + 1,
9277
8685
  clipped: true,
9278
8686
  });
9279
- this.chart
9280
- .getEventBus()
9281
- .getStream(INTERACTION_COORDINATES_EVENT)
8687
+ this.chart.getEventBus().getStream(INTERACTION_COORDINATES_EVENT)
9282
8688
  .pipe(operators.takeUntil(this.destroy$))
9283
8689
  .subscribe(function (chartEvent) {
9284
8690
  if (chartEvent.broadcast && !_this.config.enableExternalEvents) {
@@ -9294,31 +8700,27 @@
9294
8700
  }
9295
8701
  });
9296
8702
  this.brush = d3Brush.brushX();
9297
- this.brushElement = this.zoomBrushLayer
9298
- .append("g")
8703
+ this.brushElement = this.zoomBrushLayer.append("g")
9299
8704
  .attr("class", "brush");
9300
8705
  // engage pointer capture to confine mouse events to the interactive area
9301
8706
  // (in other words, if the 'mouseup' is physically triggered outside the interactive area,
9302
8707
  // the pointer capture allows us to still zoom based on that event)
9303
- this.chart
9304
- .getGrid()
9305
- .getInteractiveArea()
8708
+ this.chart.getGrid().getInteractiveArea()
9306
8709
  .on("pointerdown", function () { return d3Selection.event.target.setPointerCapture(d3Selection.event.pointerId); })
9307
8710
  .on("pointerup", function () { return d3Selection.event.target.releasePointerCapture(d3Selection.event.pointerId); });
9308
8711
  };
9309
8712
  ZoomPlugin.prototype.updateDimensions = function () {
9310
8713
  var dimension = this.grid.config().dimension;
9311
8714
  // set the brush area's dimensions
9312
- this.brush.extent([
9313
- [0, 0],
9314
- [dimension.width(), dimension.height()],
9315
- ]);
8715
+ this.brush.extent([[0, 0], [dimension.width(), dimension.height()]]);
9316
8716
  // render the brush area after we have dimensions
9317
8717
  this.brush(this.zoomBrushLayer.select(".brush"));
9318
8718
  // prevent the brush from handling its own pointer events
9319
- this.brushElement.select(".overlay").style("pointer-events", "none");
8719
+ this.brushElement.select(".overlay")
8720
+ .style("pointer-events", "none");
9320
8721
  // remove stroke per mockups
9321
- this.brushElement.select(".selection").attr("stroke", null);
8722
+ this.brushElement.select(".selection")
8723
+ .attr("stroke", null);
9322
8724
  };
9323
8725
  ZoomPlugin.prototype.destroy = function () {
9324
8726
  this.grid.getLasagna().removeLayer(ZoomPlugin.LAYER_NAME);
@@ -9365,10 +8767,7 @@
9365
8767
  * See {@link IChartAssist#update}
9366
8768
  */
9367
8769
  SparkChartAssist.prototype.update = function (inputSeriesSet) {
9368
- var sparks = inputSeriesSet.map(function (chartSeries) { return ({
9369
- id: chartSeries.id,
9370
- chartSeriesSet: [chartSeries],
9371
- }); });
8770
+ var sparks = inputSeriesSet.map(function (chartSeries) { return ({ id: chartSeries.id, chartSeriesSet: [chartSeries] }); });
9372
8771
  this.updateSparks(sparks);
9373
8772
  };
9374
8773
  /**
@@ -9381,9 +8780,7 @@
9381
8780
  var inputSparks = cloneDeep__default["default"](sparks);
9382
8781
  this.sparks = inputSparks.map(function (spark, index) {
9383
8782
  var lastSpark = index === inputSparks.length - 1;
9384
- var existingSparkIndex = spark.id
9385
- ? _this.sparks.findIndex(function (existingSpark) { return existingSpark.id === spark.id; })
9386
- : -1;
8783
+ var existingSparkIndex = spark.id ? _this.sparks.findIndex(function (existingSpark) { return existingSpark.id === spark.id; }) : -1;
9387
8784
  if (existingSparkIndex !== -1) {
9388
8785
  spark.chart = _this.reconfigureChart(_this.sparks[existingSparkIndex].chart, lastSpark);
9389
8786
  }
@@ -9439,9 +8836,7 @@
9439
8836
  });
9440
8837
  };
9441
8838
  SparkChartAssist.prototype.reconfigureChart = function (chart, lastSpark) {
9442
- chart
9443
- .getGrid()
9444
- .config(lastSpark ? this.lastGridConfig : this.gridConfig);
8839
+ chart.getGrid().config(lastSpark ? this.lastGridConfig : this.gridConfig);
9445
8840
  chart.updateDimensions();
9446
8841
  var hasInteractionLabel = chart.hasPlugin(InteractionLabelPlugin);
9447
8842
  if (lastSpark && !hasInteractionLabel && this.showBottomAxis) {
@@ -9474,9 +8869,11 @@
9474
8869
  return _super !== null && _super.apply(this, arguments) || this;
9475
8870
  }
9476
8871
  /** See {@link Renderer#draw} */
9477
- NoopRenderer.prototype.draw = function (renderSeries, rendererSubject) { };
8872
+ NoopRenderer.prototype.draw = function (renderSeries, rendererSubject) {
8873
+ };
9478
8874
  /** See {@link Renderer#highlightDataPoint} */
9479
- NoopRenderer.prototype.highlightDataPoint = function (renderSeries, dataPointIndex, rendererSubject) { };
8875
+ NoopRenderer.prototype.highlightDataPoint = function (renderSeries, dataPointIndex, rendererSubject) {
8876
+ };
9480
8877
  /** See {@link Renderer#getRequiredLayers} */
9481
8878
  NoopRenderer.prototype.getRequiredLayers = function () {
9482
8879
  return [];
@@ -9498,9 +8895,7 @@
9498
8895
  */
9499
8896
  function barGrid(config) {
9500
8897
  var grid = new XYGrid();
9501
- grid.config(config && config.horizontal
9502
- ? new BarHorizontalGridConfig()
9503
- : new BarGridConfig());
8898
+ grid.config((config && config.horizontal) ? new BarHorizontalGridConfig() : new BarGridConfig());
9504
8899
  return grid;
9505
8900
  }
9506
8901
 
@@ -9514,7 +8909,7 @@
9514
8909
  * @returns {IBarAccessors}
9515
8910
  */
9516
8911
  function barAccessors(config, colorProvider, markerProvider) {
9517
- return config && config.horizontal
8912
+ return (config && config.horizontal)
9518
8913
  ? new HorizontalBarAccessors(colorProvider, markerProvider)
9519
8914
  : new VerticalBarAccessors(colorProvider, markerProvider);
9520
8915
  }
@@ -9565,58 +8960,42 @@
9565
8960
  else if (value.valueOf) {
9566
8961
  var valueOf_1 = value.valueOf();
9567
8962
  if (scales && ((_a = scales[scaleKey]) === null || _a === void 0 ? void 0 : _a.isContinuous())) {
9568
- var index = findIndex__default["default"](series.data, function (d, i) { return valueOf_1 >=
9569
- (startAccessor === null || startAccessor === void 0 ? void 0 : startAccessor(d, i, series.data, series).valueOf()) &&
9570
- valueOf_1 <=
9571
- (endAccessor === null || endAccessor === void 0 ? void 0 : endAccessor(d, i, series.data, series).valueOf()); });
8963
+ var index = findIndex__default["default"](series.data, function (d, i) { return valueOf_1 >= (startAccessor === null || startAccessor === void 0 ? void 0 : startAccessor(d, i, series.data, series).valueOf()) &&
8964
+ valueOf_1 <= (endAccessor === null || endAccessor === void 0 ? void 0 : endAccessor(d, i, series.data, series).valueOf()); });
9572
8965
  if (index === -1 && typeof endAccessor !== "undefined") {
9573
8966
  if (isBandScale(scales[scaleKey])) {
9574
8967
  var accessor = function (d, i) { return startAccessor === null || startAccessor === void 0 ? void 0 : startAccessor(d, i, series.data, series); };
9575
8968
  var nearestIndex = UtilityService.findNearestIndex(series.data, value, accessor);
9576
- index =
9577
- nearestIndex >= series.data.length ||
9578
- accessor(series.data[nearestIndex], nearestIndex) >
9579
- valueOf_1
9580
- ? -1
9581
- : nearestIndex;
8969
+ index = (nearestIndex >= series.data.length || accessor(series.data[nearestIndex], nearestIndex) > valueOf_1) ? -1 : nearestIndex;
9582
8970
  }
9583
8971
  else {
9584
8972
  // @ts-ignore
9585
8973
  // Needs to catch -1 otherwise typescript errors
9586
- index =
9587
- (_b = UtilityService.getClosestIndex(series.data, function (d, i) { return endAccessor(d, i, series.data, series); }, value)) !== null && _b !== void 0 ? _b : -1;
8974
+ index = (_b = UtilityService.getClosestIndex(series.data, function (d, i) { return endAccessor(d, i, series.data, series); }, value)) !== null && _b !== void 0 ? _b : -1;
9588
8975
  }
9589
8976
  }
9590
8977
  return index;
9591
8978
  }
9592
- return findIndex__default["default"](series.data, function (d, i) { return valueOf_1 >=
9593
- (startAccessor === null || startAccessor === void 0 ? void 0 : startAccessor(d, i, series.data, series).valueOf()) &&
9594
- valueOf_1 <=
9595
- (endAccessor === null || endAccessor === void 0 ? void 0 : endAccessor(d, i, series.data, series).valueOf()); });
8979
+ return findIndex__default["default"](series.data, function (d, i) { return valueOf_1 >= (startAccessor === null || startAccessor === void 0 ? void 0 : startAccessor(d, i, series.data, series).valueOf()) &&
8980
+ valueOf_1 <= (endAccessor === null || endAccessor === void 0 ? void 0 : endAccessor(d, i, series.data, series).valueOf()); });
9596
8981
  }
9597
8982
  return DATA_POINT_INTERACTION_RESET;
9598
8983
  };
9599
8984
  BarHighlightStrategy.prototype.highlightDataPoint = function (renderer, renderSeries, dataPointIndex, rendererSubject) {
9600
8985
  var target = renderSeries.containers[exports.RenderLayerName.data];
9601
8986
  var barStylesFn = renderer.getContainerStateStyles;
9602
- var selectedDataPointIdx = !isUndefined__default["default"](this.selectedDataPointIdxFn)
9603
- ? this.selectedDataPointIdxFn(renderSeries.dataSeries.id)
9604
- : DATA_POINT_NOT_FOUND;
9605
- target
9606
- .selectAll("g." + renderer.barContainerClass)
9607
- .each(function (d, index) {
8987
+ var selectedDataPointIdx = !isUndefined__default["default"](this.selectedDataPointIdxFn) ? this.selectedDataPointIdxFn(renderSeries.dataSeries.id) : DATA_POINT_NOT_FOUND;
8988
+ target.selectAll("g." + renderer.barContainerClass).each(function (d, index) {
9608
8989
  var renderState;
9609
8990
  if (dataPointIndex === DATA_POINT_INTERACTION_RESET) {
9610
- if (index === selectedDataPointIdx ||
9611
- selectedDataPointIdx === DATA_POINT_NOT_FOUND) {
8991
+ if (index === selectedDataPointIdx || selectedDataPointIdx === DATA_POINT_NOT_FOUND) {
9612
8992
  renderState = exports.RenderState.default;
9613
8993
  }
9614
8994
  else {
9615
8995
  renderState = exports.RenderState.deemphasized;
9616
8996
  }
9617
8997
  }
9618
- else if (dataPointIndex === index ||
9619
- index === selectedDataPointIdx) {
8998
+ else if (dataPointIndex === index || index === selectedDataPointIdx) {
9620
8999
  renderState = exports.RenderState.emphasized;
9621
9000
  }
9622
9001
  else {
@@ -9629,7 +9008,8 @@
9629
9008
  // data: renderer.getDataPoint(renderSeries, renderSeries.dataSeries.data[dataPointIndex], dataPointIndex),
9630
9009
  // });
9631
9010
  };
9632
- BarHighlightStrategy.prototype.draw = function (renderer, renderSeries, rendererSubject) { };
9011
+ BarHighlightStrategy.prototype.draw = function (renderer, renderSeries, rendererSubject) {
9012
+ };
9633
9013
  return BarHighlightStrategy;
9634
9014
  }());
9635
9015
 
@@ -9676,23 +9056,21 @@
9676
9056
  }
9677
9057
  else if (value.valueOf) {
9678
9058
  var valueOf_1 = value.valueOf();
9679
- return findIndex__default["default"](series.data, function (d, i) { return valueOf_1 >=
9680
- (startAccessor === null || startAccessor === void 0 ? void 0 : startAccessor(d, i, series.data, series).valueOf()) &&
9681
- valueOf_1 <=
9682
- (endAccessor === null || endAccessor === void 0 ? void 0 : endAccessor(d, i, series.data, series).valueOf()); });
9059
+ return findIndex__default["default"](series.data, function (d, i) { return valueOf_1 >= (startAccessor === null || startAccessor === void 0 ? void 0 : startAccessor(d, i, series.data, series).valueOf()) &&
9060
+ valueOf_1 <= (endAccessor === null || endAccessor === void 0 ? void 0 : endAccessor(d, i, series.data, series).valueOf()); });
9683
9061
  }
9684
9062
  return DATA_POINT_INTERACTION_RESET;
9685
9063
  };
9686
9064
  BarSeriesHighlightStrategy.prototype.highlightDataPoint = function (renderer, renderSeries, dataPointIndex, rendererSubject) {
9687
- if (dataPointIndex >= 0 ||
9688
- dataPointIndex === DATA_POINT_INTERACTION_RESET) {
9065
+ if (dataPointIndex >= 0 || dataPointIndex === DATA_POINT_INTERACTION_RESET) {
9689
9066
  rendererSubject.next({
9690
9067
  eventName: HIGHLIGHT_SERIES_EVENT,
9691
9068
  data: renderer.getDataPoint(renderSeries, renderSeries.dataSeries.data[dataPointIndex], dataPointIndex),
9692
9069
  });
9693
9070
  }
9694
9071
  };
9695
- BarSeriesHighlightStrategy.prototype.draw = function (renderer, renderSeries, rendererSubject) { };
9072
+ BarSeriesHighlightStrategy.prototype.draw = function (renderer, renderSeries, rendererSubject) {
9073
+ };
9696
9074
  return BarSeriesHighlightStrategy;
9697
9075
  }());
9698
9076
 
@@ -9705,7 +9083,8 @@
9705
9083
  return _super !== null && _super.apply(this, arguments) || this;
9706
9084
  }
9707
9085
  PieRenderer.prototype.getArc = function (range, arc, index) {
9708
- return arc.outerRadius(range[1] - range[0]).innerRadius(0);
9086
+ return arc.outerRadius(range[1] - range[0])
9087
+ .innerRadius(0);
9709
9088
  };
9710
9089
  return PieRenderer;
9711
9090
  }(RadialRenderer));
@@ -9768,15 +9147,13 @@
9768
9147
  throw new Error("renderer.config.strokeWidth is not defined");
9769
9148
  }
9770
9149
  if (interactionPath.empty()) {
9771
- interactionPath = target
9772
- .append("path")
9150
+ interactionPath = target.append("path")
9773
9151
  .classed("interaction", true)
9774
9152
  .classed("pointer-events pointer-events-click", true)
9775
9153
  .attrs({
9776
- "stroke-width": renderer.config.strokeWidth +
9777
- 2 * this.INTERACTION_MARGIN,
9778
- stroke: "transparent",
9779
- fill: "none",
9154
+ "stroke-width": renderer.config.strokeWidth + (2 * this.INTERACTION_MARGIN),
9155
+ "stroke": "transparent",
9156
+ "fill": "none",
9780
9157
  })
9781
9158
  .on("mouseenter", function () {
9782
9159
  var dataPoint = {
@@ -9786,10 +9163,7 @@
9786
9163
  index: 0,
9787
9164
  data: renderSeries.dataSeries.data[0],
9788
9165
  };
9789
- rendererSubject.next({
9790
- eventName: HIGHLIGHT_SERIES_EVENT,
9791
- data: dataPoint,
9792
- });
9166
+ rendererSubject.next({ eventName: HIGHLIGHT_SERIES_EVENT, data: dataPoint });
9793
9167
  })
9794
9168
  .on("mouseleave", function () {
9795
9169
  var dataPoint = {
@@ -9797,10 +9171,7 @@
9797
9171
  dataSeries: renderSeries.dataSeries,
9798
9172
  index: DATA_POINT_NOT_FOUND,
9799
9173
  };
9800
- rendererSubject.next({
9801
- eventName: HIGHLIGHT_SERIES_EVENT,
9802
- data: dataPoint,
9803
- });
9174
+ rendererSubject.next({ eventName: HIGHLIGHT_SERIES_EVENT, data: dataPoint });
9804
9175
  })
9805
9176
  .on("click", function (d, i) {
9806
9177
  _this.emitEvent(renderer, INTERACTION_SERIES_EVENT, exports.InteractionType.Click, renderSeries, d, i, rendererSubject);
@@ -9813,7 +9184,8 @@
9813
9184
  // @ts-ignore
9814
9185
  return;
9815
9186
  };
9816
- LineSelectSeriesInteractionStrategy.prototype.highlightDataPoint = function (renderer, renderSeries, dataPointIndex, rendererSubject) { };
9187
+ LineSelectSeriesInteractionStrategy.prototype.highlightDataPoint = function (renderer, renderSeries, dataPointIndex, rendererSubject) {
9188
+ };
9817
9189
  LineSelectSeriesInteractionStrategy.prototype.emitEvent = function (renderer, eventName, interactionType, renderSeries, data, i, rendererSubject) {
9818
9190
  var dataPoint = {
9819
9191
  seriesId: renderSeries.dataSeries.id,
@@ -9888,11 +9260,10 @@
9888
9260
  if (!this.config.areaClass) {
9889
9261
  throw new Error("areaClass is not defined");
9890
9262
  }
9891
- path = target
9892
- .append("path")
9263
+ path = target.append("path")
9893
9264
  .classed(this.config.areaClass, true)
9894
9265
  .attrs({
9895
- fill: (_b = (_a = accessors.series).color) === null || _b === void 0 ? void 0 : _b.call(_a, renderSeries.dataSeries.id, renderSeries.dataSeries),
9266
+ "fill": (_b = (_a = accessors.series).color) === null || _b === void 0 ? void 0 : _b.call(_a, renderSeries.dataSeries.id, renderSeries.dataSeries),
9896
9267
  })
9897
9268
  .style("stroke-width", (_c = this.config.strokeWidth) !== null && _c !== void 0 ? _c : 1);
9898
9269
  }
@@ -9930,22 +9301,10 @@
9930
9301
  throw new Error("curveType is not defined");
9931
9302
  }
9932
9303
  var areaFunc = d3Shape.area()
9933
- .x0(function (d, i) {
9934
- var _a, _b;
9935
- return _this.safetyCheck(renderSeries.scales.x.convert((_b = (_a = accessors.data).absoluteX0) === null || _b === void 0 ? void 0 : _b.call(_a, d, i, dataSeries.data, dataSeries)));
9936
- })
9937
- .x1(function (d, i) {
9938
- var _a, _b;
9939
- return _this.safetyCheck(renderSeries.scales.x.convert((_b = (_a = accessors.data).absoluteX1) === null || _b === void 0 ? void 0 : _b.call(_a, d, i, dataSeries.data, dataSeries)));
9940
- })
9941
- .y0(function (d, i) {
9942
- var _a, _b;
9943
- return _this.safetyCheck(renderSeries.scales.y.convert((_b = (_a = accessors.data).absoluteY0) === null || _b === void 0 ? void 0 : _b.call(_a, d, i, dataSeries.data, dataSeries)));
9944
- })
9945
- .y1(function (d, i) {
9946
- var _a, _b;
9947
- return _this.safetyCheck(renderSeries.scales.y.convert((_b = (_a = accessors.data).absoluteY1) === null || _b === void 0 ? void 0 : _b.call(_a, d, i, dataSeries.data, dataSeries)));
9948
- })
9304
+ .x0(function (d, i) { var _a, _b; return _this.safetyCheck(renderSeries.scales.x.convert((_b = (_a = accessors.data).absoluteX0) === null || _b === void 0 ? void 0 : _b.call(_a, d, i, dataSeries.data, dataSeries))); })
9305
+ .x1(function (d, i) { var _a, _b; return _this.safetyCheck(renderSeries.scales.x.convert((_b = (_a = accessors.data).absoluteX1) === null || _b === void 0 ? void 0 : _b.call(_a, d, i, dataSeries.data, dataSeries))); })
9306
+ .y0(function (d, i) { var _a, _b; return _this.safetyCheck(renderSeries.scales.y.convert((_b = (_a = accessors.data).absoluteY0) === null || _b === void 0 ? void 0 : _b.call(_a, d, i, dataSeries.data, dataSeries))); })
9307
+ .y1(function (d, i) { var _a, _b; return _this.safetyCheck(renderSeries.scales.y.convert((_b = (_a = accessors.data).absoluteY1) === null || _b === void 0 ? void 0 : _b.call(_a, d, i, dataSeries.data, dataSeries))); })
9949
9308
  .curve(this.config.curveType);
9950
9309
  path.attr("d", (_a = areaFunc(validatedData)) !== null && _a !== void 0 ? _a : "");
9951
9310
  };
@@ -9960,14 +9319,8 @@
9960
9319
  var accessor0 = dataAccessors["absolute" + scaleName.toUpperCase() + "0"];
9961
9320
  var accessor1 = dataAccessors["absolute" + scaleName.toUpperCase() + "1"];
9962
9321
  return [
9963
- d3Array.min(data, function (datum, index, arr) { return d3Array.min([
9964
- accessor0 === null || accessor0 === void 0 ? void 0 : accessor0(datum, index, arr, dataSeries),
9965
- accessor1 === null || accessor1 === void 0 ? void 0 : accessor1(datum, index, arr, dataSeries),
9966
- ]); }),
9967
- d3Array.max(data, function (datum, index, arr) { return d3Array.max([
9968
- accessor0 === null || accessor0 === void 0 ? void 0 : accessor0(datum, index, arr, dataSeries),
9969
- accessor1 === null || accessor1 === void 0 ? void 0 : accessor1(datum, index, arr, dataSeries),
9970
- ]); }),
9322
+ d3Array.min(data, function (datum, index, arr) { return d3Array.min([accessor0 === null || accessor0 === void 0 ? void 0 : accessor0(datum, index, arr, dataSeries), accessor1 === null || accessor1 === void 0 ? void 0 : accessor1(datum, index, arr, dataSeries)]); }),
9323
+ d3Array.max(data, function (datum, index, arr) { return d3Array.max([accessor0 === null || accessor0 === void 0 ? void 0 : accessor0(datum, index, arr, dataSeries), accessor1 === null || accessor1 === void 0 ? void 0 : accessor1(datum, index, arr, dataSeries)]); }),
9971
9324
  ];
9972
9325
  };
9973
9326
  /** See {@link Renderer#getRequiredLayers} */
@@ -9991,8 +9344,7 @@
9991
9344
  return data.filter(function (d, i) {
9992
9345
  var value0 = accessor0 === null || accessor0 === void 0 ? void 0 : accessor0(d, i, data, dataSeries);
9993
9346
  var value1 = accessor1 === null || accessor1 === void 0 ? void 0 : accessor1(d, i, data, dataSeries);
9994
- return (Math.max(value0, value1) >= domain[0] &&
9995
- Math.min(value0, value1) <= domain[1]);
9347
+ return Math.max(value0, value1) >= domain[0] && Math.min(value0, value1) <= domain[1];
9996
9348
  });
9997
9349
  };
9998
9350
  AreaRenderer.prototype.highlightDataPoint = function (renderSeries, dataPointIndex, rendererSubject) {
@@ -10040,10 +9392,7 @@
10040
9392
  }
10041
9393
  var end = start + diff;
10042
9394
  domainValueStacks[base.valueOf()] = end;
10043
- datum["__stack_" + valueAccessorKey] = {
10044
- start: start,
10045
- end: end,
10046
- };
9395
+ datum["__stack_" + valueAccessorKey] = { start: start, end: end };
10047
9396
  });
10048
9397
  };
10049
9398
  try {