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