@pioneer-code/pioneer-charts 20.3.18 → 20.3.20
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.
|
@@ -6,9 +6,9 @@ import { select as select$1 } from 'd3-selection';
|
|
|
6
6
|
import { Subject } from 'rxjs';
|
|
7
7
|
import { axisLeft, axisBottom } from 'd3-axis';
|
|
8
8
|
import { format } from 'd3-format';
|
|
9
|
-
import { select, scaleTime } from 'd3';
|
|
10
|
-
import { line, area, arc, pie } from 'd3-shape';
|
|
9
|
+
import { select, scaleTime, zoom } from 'd3';
|
|
11
10
|
import { range } from 'd3-array';
|
|
11
|
+
import { line, area, arc, pie } from 'd3-shape';
|
|
12
12
|
import { interpolate } from 'd3-interpolate';
|
|
13
13
|
import { transition } from 'd3-transition';
|
|
14
14
|
|
|
@@ -48,14 +48,12 @@ var PcacFormatEnum;
|
|
|
48
48
|
|
|
49
49
|
class PcacAxisBuilder {
|
|
50
50
|
drawAxis(config) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
if (!config.hideYAxis) {
|
|
55
|
-
this.drawYAxis(config);
|
|
56
|
-
}
|
|
51
|
+
this.drawXAxis(config);
|
|
52
|
+
this.drawYAxis(config);
|
|
57
53
|
}
|
|
58
54
|
drawYAxis(config) {
|
|
55
|
+
if (config.hideYAxis)
|
|
56
|
+
return;
|
|
59
57
|
const yAxis = axisLeft(config.yScale).ticks(config.numberOfTicks);
|
|
60
58
|
if (config.yFormat) {
|
|
61
59
|
switch (config.yFormat.toLocaleLowerCase()) {
|
|
@@ -75,6 +73,9 @@ class PcacAxisBuilder {
|
|
|
75
73
|
.call(yAxis);
|
|
76
74
|
}
|
|
77
75
|
drawXAxis(config) {
|
|
76
|
+
if (config.hideYAxis)
|
|
77
|
+
return;
|
|
78
|
+
config.svg.selectAll('.pcac-x-axis').remove();
|
|
78
79
|
const xAxis = axisBottom(config.xScale).ticks(config.numberOfTicks);
|
|
79
80
|
if (config.xFormat) {
|
|
80
81
|
switch (config.xFormat) {
|
|
@@ -105,10 +106,10 @@ class PcacAxisBuilder {
|
|
|
105
106
|
.attr('transform', 'translate(0,' + config.height + ')')
|
|
106
107
|
.call(xAxis);
|
|
107
108
|
}
|
|
108
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
109
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
109
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacAxisBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
110
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacAxisBuilder, providedIn: 'root' });
|
|
110
111
|
}
|
|
111
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacAxisBuilder, decorators: [{
|
|
112
113
|
type: Injectable,
|
|
113
114
|
args: [{
|
|
114
115
|
providedIn: 'root',
|
|
@@ -143,10 +144,10 @@ class PcacGridBuilder {
|
|
|
143
144
|
.attr('x2', config.width)
|
|
144
145
|
.attr('class', (_, i) => (i === 0 ? 'pcac-grid-rule-last' : ''));
|
|
145
146
|
}
|
|
146
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
147
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
147
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacGridBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
148
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacGridBuilder, providedIn: 'root' });
|
|
148
149
|
}
|
|
149
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacGridBuilder, decorators: [{
|
|
150
151
|
type: Injectable,
|
|
151
152
|
args: [{
|
|
152
153
|
providedIn: 'root',
|
|
@@ -213,10 +214,10 @@ class PcacColorService {
|
|
|
213
214
|
setAlert() {
|
|
214
215
|
return this.alert;
|
|
215
216
|
}
|
|
216
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
217
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
217
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacColorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
218
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacColorService, providedIn: 'root' });
|
|
218
219
|
}
|
|
219
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
220
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacColorService, decorators: [{
|
|
220
221
|
type: Injectable,
|
|
221
222
|
args: [{
|
|
222
223
|
providedIn: 'root',
|
|
@@ -228,10 +229,10 @@ class PcacTransitionService {
|
|
|
228
229
|
getTransitionDuration() {
|
|
229
230
|
return this.transitionDuration;
|
|
230
231
|
}
|
|
231
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
232
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
232
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacTransitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
233
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacTransitionService, providedIn: 'root' });
|
|
233
234
|
}
|
|
234
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacTransitionService, decorators: [{
|
|
235
236
|
type: Injectable,
|
|
236
237
|
args: [{
|
|
237
238
|
providedIn: 'root',
|
|
@@ -281,10 +282,10 @@ class PcacTooltipBuilder {
|
|
|
281
282
|
let finalValue = value ? value.toString() : value;
|
|
282
283
|
return key ? key + '</br>' + finalValue : `${finalValue}`;
|
|
283
284
|
}
|
|
284
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
285
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
285
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacTooltipBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
286
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacTooltipBuilder, providedIn: 'root' });
|
|
286
287
|
}
|
|
287
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacTooltipBuilder, decorators: [{
|
|
288
289
|
type: Injectable,
|
|
289
290
|
args: [{
|
|
290
291
|
providedIn: 'root',
|
|
@@ -361,10 +362,10 @@ class PcacChart {
|
|
|
361
362
|
this.margin.bottom = this.margin.bottom;
|
|
362
363
|
this.width = this.width - this.margin.left;
|
|
363
364
|
}
|
|
364
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
365
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
365
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacChart, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
366
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacChart, providedIn: 'root' });
|
|
366
367
|
}
|
|
367
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
368
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacChart, decorators: [{
|
|
368
369
|
type: Injectable,
|
|
369
370
|
args: [{
|
|
370
371
|
providedIn: 'root',
|
|
@@ -621,10 +622,10 @@ class BarHorizontalChartBuilder extends PcacChart {
|
|
|
621
622
|
this.tooltipBuilder.hideTooltip();
|
|
622
623
|
});
|
|
623
624
|
}
|
|
624
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
625
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
625
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: BarHorizontalChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
626
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: BarHorizontalChartBuilder, providedIn: 'root' });
|
|
626
627
|
}
|
|
627
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
628
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: BarHorizontalChartBuilder, decorators: [{
|
|
628
629
|
type: Injectable,
|
|
629
630
|
args: [{
|
|
630
631
|
providedIn: 'root',
|
|
@@ -661,10 +662,10 @@ class PcacBarHorizontalChartComponent {
|
|
|
661
662
|
self.buildChart();
|
|
662
663
|
}, 300);
|
|
663
664
|
}
|
|
664
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
665
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.
|
|
665
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacBarHorizontalChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
666
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.4", type: PcacBarHorizontalChartComponent, isStandalone: true, selector: "pcac-bar-horizontal-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { barClicked: "barClicked" }, host: { listeners: { "window:resize": "onResize()" } }, viewQueries: [{ propertyName: "chartElm", first: true, predicate: ["chart"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<section class=\"pcac-bar-horizontal-chart\">\n <svg #chart></svg>\n</section>\n", styles: [".pcac-bar-horizontal-chart{display:block}.pcac-bar-horizontal-chart svg{width:100%;display:block}.pcac-d3-tooltip{position:absolute;text-align:center;font-size:14px;padding:.5rem;pointer-events:none;display:none;background-color:#000000bf;color:#fff;border-radius:5px}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
666
667
|
}
|
|
667
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
668
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacBarHorizontalChartComponent, decorators: [{
|
|
668
669
|
type: Component,
|
|
669
670
|
args: [{ selector: 'pcac-bar-horizontal-chart', encapsulation: ViewEncapsulation.None, template: "<section class=\"pcac-bar-horizontal-chart\">\n <svg #chart></svg>\n</section>\n", styles: [".pcac-bar-horizontal-chart{display:block}.pcac-bar-horizontal-chart svg{width:100%;display:block}.pcac-d3-tooltip{position:absolute;text-align:center;font-size:14px;padding:.5rem;pointer-events:none;display:none;background-color:#000000bf;color:#fff;border-radius:5px}\n"] }]
|
|
670
671
|
}], ctorParameters: () => [], propDecorators: { onResize: [{
|
|
@@ -950,10 +951,10 @@ class BarVerticalChartBuilder extends PcacChart {
|
|
|
950
951
|
return '3px';
|
|
951
952
|
});
|
|
952
953
|
}
|
|
953
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
954
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
954
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: BarVerticalChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
955
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: BarVerticalChartBuilder, providedIn: 'root' });
|
|
955
956
|
}
|
|
956
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
957
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: BarVerticalChartBuilder, decorators: [{
|
|
957
958
|
type: Injectable,
|
|
958
959
|
args: [{
|
|
959
960
|
providedIn: 'root',
|
|
@@ -990,10 +991,10 @@ class PcacBarVerticalChartComponent {
|
|
|
990
991
|
self.buildChart();
|
|
991
992
|
}, 300);
|
|
992
993
|
}
|
|
993
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
994
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.
|
|
994
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacBarVerticalChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
995
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.4", type: PcacBarVerticalChartComponent, isStandalone: true, selector: "pcac-bar-vertical-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { barClicked: "barClicked" }, host: { listeners: { "window:resize": "onResize()" } }, viewQueries: [{ propertyName: "chartElm", first: true, predicate: ["chart"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<section class=\"pcac-bar-vertical-chart\">\n <svg #chart></svg>\n</section>\n", styles: [".pcac-bar-vertical-chart svg{width:100%;display:block}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
995
996
|
}
|
|
996
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
997
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacBarVerticalChartComponent, decorators: [{
|
|
997
998
|
type: Component,
|
|
998
999
|
args: [{ selector: 'pcac-bar-vertical-chart', encapsulation: ViewEncapsulation.None, template: "<section class=\"pcac-bar-vertical-chart\">\n <svg #chart></svg>\n</section>\n", styles: [".pcac-bar-vertical-chart svg{width:100%;display:block}\n"] }]
|
|
999
1000
|
}], ctorParameters: () => [], propDecorators: { onResize: [{
|
|
@@ -1019,6 +1020,7 @@ class PcacBarVerticalChartColorOverrideConfig {
|
|
|
1019
1020
|
class PcacLegendConfigItem {
|
|
1020
1021
|
label;
|
|
1021
1022
|
checked = true;
|
|
1023
|
+
colorOverride = null;
|
|
1022
1024
|
}
|
|
1023
1025
|
class PcacLegendConfig {
|
|
1024
1026
|
heading = null;
|
|
@@ -1035,15 +1037,15 @@ class PcacLegend {
|
|
|
1035
1037
|
this.config.set(data);
|
|
1036
1038
|
this.itemClicked.emit(data.items);
|
|
1037
1039
|
}
|
|
1038
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1039
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
1040
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacLegend, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1041
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: PcacLegend, isStandalone: true, selector: "pcac-legend", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { config: "configChange", itemClicked: "itemClicked" }, ngImport: i0, template: "<label class=\"pcac-legend-label\"><small>{{config().heading}}</small></label>\n@for(item of config().items; track item; let i = $index; let first = $first; let last = $last;) {\n<div class=\"pcac-legend-item\" [class.pcac-legend-item-last]=\"last\" [class.pcac-legend-unchecked]=\"!item.checked\"\n (click)=\"onItemClicked(i)\">\n @let color = item.colorOverride ? item.colorOverride : colorScale()[i];\n <div class=\"pcac-legend-circle\" [style.backgroundColor]=\"color\"></div>\n <small>{{ item.label }}</small>\n</div>\n}", styles: [":host{display:flex;align-items:center}.pcac-legend-label{margin-right:8px;margin-bottom:2.5px}.pcac-legend-item{cursor:pointer;display:flex;align-items:center;margin-right:8px}.pcac-legend-item:hover .pcac-legend-circle{box-shadow:0 0 6px #0000004d;transform:scale(1.2)}.pcac-legend-circle{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:4px;transition:box-shadow .3s ease,transform .3s ease}.pcac-legend-unchecked{opacity:.5}.pcac-legend-item-last{margin-right:0}\n"] });
|
|
1040
1042
|
}
|
|
1041
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1043
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacLegend, decorators: [{
|
|
1042
1044
|
type: Component,
|
|
1043
|
-
args: [{ selector: 'pcac-legend', template: "<label class=\"pcac-legend-label\"><small>{{config().heading}}</small></label>\n@for(item of config().items; track item; let i = $index; let first = $first; let last = $last;) {\n<div class=\"pcac-legend-item\" [class.pcac-legend-item-last]=\"last\" [class.pcac-legend-unchecked]=\"!item.checked\"\n (click)=\"onItemClicked(i)\">\n <div class=\"pcac-legend-circle\" [style.backgroundColor]=\"
|
|
1045
|
+
args: [{ selector: 'pcac-legend', template: "<label class=\"pcac-legend-label\"><small>{{config().heading}}</small></label>\n@for(item of config().items; track item; let i = $index; let first = $first; let last = $last;) {\n<div class=\"pcac-legend-item\" [class.pcac-legend-item-last]=\"last\" [class.pcac-legend-unchecked]=\"!item.checked\"\n (click)=\"onItemClicked(i)\">\n @let color = item.colorOverride ? item.colorOverride : colorScale()[i];\n <div class=\"pcac-legend-circle\" [style.backgroundColor]=\"color\"></div>\n <small>{{ item.label }}</small>\n</div>\n}", styles: [":host{display:flex;align-items:center}.pcac-legend-label{margin-right:8px;margin-bottom:2.5px}.pcac-legend-item{cursor:pointer;display:flex;align-items:center;margin-right:8px}.pcac-legend-item:hover .pcac-legend-circle{box-shadow:0 0 6px #0000004d;transform:scale(1.2)}.pcac-legend-circle{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:4px;transition:box-shadow .3s ease,transform .3s ease}.pcac-legend-unchecked{opacity:.5}.pcac-legend-item-last{margin-right:0}\n"] }]
|
|
1044
1046
|
}] });
|
|
1045
1047
|
|
|
1046
|
-
class
|
|
1048
|
+
class PlaChartEffectsBuilder {
|
|
1047
1049
|
config;
|
|
1048
1050
|
lines = [];
|
|
1049
1051
|
buildEffects(config) {
|
|
@@ -1156,10 +1158,10 @@ class LineAreaChartEffectsBuilder {
|
|
|
1156
1158
|
return 'translate(' + mousePos[0] + ',' + pos.y + ')';
|
|
1157
1159
|
});
|
|
1158
1160
|
}
|
|
1159
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1160
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
1161
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PlaChartEffectsBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1162
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PlaChartEffectsBuilder, providedIn: 'root' });
|
|
1161
1163
|
}
|
|
1162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PlaChartEffectsBuilder, decorators: [{
|
|
1163
1165
|
type: Injectable,
|
|
1164
1166
|
args: [{
|
|
1165
1167
|
providedIn: 'root',
|
|
@@ -1174,6 +1176,7 @@ var PcacLineAreaPlotChartConfigType;
|
|
|
1174
1176
|
})(PcacLineAreaPlotChartConfigType || (PcacLineAreaPlotChartConfigType = {}));
|
|
1175
1177
|
class PcacLineAreaChartConfig extends PcacChartConfig {
|
|
1176
1178
|
enableEffects = true;
|
|
1179
|
+
enableZoom = true;
|
|
1177
1180
|
numberOfTicks = 5;
|
|
1178
1181
|
hideGrid = false;
|
|
1179
1182
|
hideAxis = false;
|
|
@@ -1189,89 +1192,161 @@ class PcacLineAreaChartConfig extends PcacChartConfig {
|
|
|
1189
1192
|
colorOverride = [];
|
|
1190
1193
|
}
|
|
1191
1194
|
|
|
1192
|
-
class
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1195
|
+
class PlaChartScales {
|
|
1196
|
+
x;
|
|
1197
|
+
y;
|
|
1198
|
+
}
|
|
1199
|
+
class PlaChartScalesBuilder {
|
|
1200
|
+
build(config, chartWidth, chartHeight) {
|
|
1201
|
+
let resp = new PlaChartScales();
|
|
1202
|
+
resp.x = this.buildXScale(config, chartWidth);
|
|
1203
|
+
resp.y = this.buildYScale(config, chartHeight);
|
|
1204
|
+
return resp;
|
|
1205
|
+
}
|
|
1206
|
+
buildXScale(config, chartWidth) {
|
|
1207
|
+
let resp;
|
|
1208
|
+
switch (config.xFormat) {
|
|
1209
|
+
case PcacFormatEnum.DateTime:
|
|
1210
|
+
resp = scaleTime()
|
|
1211
|
+
.domain([new Date(config.xDomainMin), new Date(config.xDomainMax)])
|
|
1212
|
+
.range([0, chartWidth]);
|
|
1213
|
+
break;
|
|
1214
|
+
case PcacFormatEnum.Decimal:
|
|
1215
|
+
resp = scaleLinear()
|
|
1216
|
+
.domain([config.xDomainMin || 0, config.xDomainMax || 100])
|
|
1217
|
+
.range([0, chartWidth]);
|
|
1218
|
+
break;
|
|
1219
|
+
case PcacFormatEnum.DatasetLength:
|
|
1220
|
+
resp = scaleLinear()
|
|
1221
|
+
.domain([0, config.data[0].data.length - 1])
|
|
1222
|
+
.range([0, chartWidth]);
|
|
1223
|
+
break;
|
|
1224
|
+
default:
|
|
1225
|
+
resp = scaleLinear()
|
|
1226
|
+
.domain([0, config.data[0].data.length - 1])
|
|
1227
|
+
.range([0, chartWidth]);
|
|
1228
|
+
break;
|
|
1229
|
+
}
|
|
1230
|
+
return resp;
|
|
1231
|
+
}
|
|
1232
|
+
buildYScale(config, chartHeight) {
|
|
1233
|
+
return scaleLinear()
|
|
1234
|
+
.domain([config.yDomainMin || 0, config.yDomainMax || 100])
|
|
1235
|
+
.range([chartHeight, 0]);
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
function getXFormat(type, data, index, xScale) {
|
|
1240
|
+
switch (type) {
|
|
1241
|
+
case PcacFormatEnum.DateTime:
|
|
1242
|
+
if (data.key) {
|
|
1243
|
+
return xScale(new Date(data.key));
|
|
1244
|
+
}
|
|
1245
|
+
return 0;
|
|
1246
|
+
case PcacFormatEnum.Decimal:
|
|
1247
|
+
if (data.key) {
|
|
1248
|
+
return xScale(data.key);
|
|
1249
|
+
}
|
|
1250
|
+
return 0;
|
|
1251
|
+
default:
|
|
1252
|
+
return xScale(index);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
function buildLineGenerator(format, scales) {
|
|
1257
|
+
return line()
|
|
1258
|
+
.x((d, i) => {
|
|
1259
|
+
return getXFormat(format, d, i, scales.x);
|
|
1260
|
+
})
|
|
1261
|
+
.y((d) => {
|
|
1262
|
+
return scales.y(d.value);
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
function buildAreaGenerator(format, scales, chartHeight) {
|
|
1267
|
+
return area()
|
|
1268
|
+
.x((d, i) => {
|
|
1269
|
+
return getXFormat(format, d, i, scales.x);
|
|
1270
|
+
})
|
|
1271
|
+
.y0(chartHeight)
|
|
1272
|
+
.y1((d) => {
|
|
1273
|
+
return scales.y(d.value);
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
function buildZoomBehavior(width, height, zoomedFn) {
|
|
1278
|
+
return zoom()
|
|
1279
|
+
.scaleExtent([1, 10])
|
|
1280
|
+
.translateExtent([[0, 0], [width, height]])
|
|
1281
|
+
.on("zoom", zoomedFn);
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
class PlaChartBuilder extends PcacChart {
|
|
1285
|
+
scales;
|
|
1286
|
+
lineGenerator;
|
|
1287
|
+
areaGenerator;
|
|
1288
|
+
zoomBehavior;
|
|
1197
1289
|
dotClickedSource = new Subject();
|
|
1198
1290
|
config;
|
|
1199
1291
|
dotClicked$ = this.dotClickedSource.asObservable();
|
|
1200
1292
|
buildChart(chartElm, config, type) {
|
|
1201
1293
|
this.config = JSON.parse(JSON.stringify(config));
|
|
1202
|
-
this.startData = range(this.config.data[0].data.length).map((
|
|
1294
|
+
this.startData = range(this.config.data[0].data.length).map(() => {
|
|
1203
1295
|
return {
|
|
1204
1296
|
value: 0,
|
|
1205
1297
|
key: ''
|
|
1206
1298
|
};
|
|
1207
1299
|
});
|
|
1208
1300
|
if (this.config.hideAxis) {
|
|
1209
|
-
this.
|
|
1301
|
+
this.config.height = this.config.height + 12;
|
|
1302
|
+
this.margin.top = 8;
|
|
1303
|
+
this.margin.bottom = 8;
|
|
1304
|
+
this.margin.left = 8;
|
|
1305
|
+
this.margin.right = 8;
|
|
1210
1306
|
}
|
|
1211
1307
|
this.initializeChartState(chartElm, this.config);
|
|
1212
1308
|
if (this.config.colorOverride) {
|
|
1213
1309
|
this.colors = this.config.colorOverride;
|
|
1214
1310
|
}
|
|
1215
|
-
this.
|
|
1216
|
-
this.
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
.
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
this.
|
|
1234
|
-
.
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
this.
|
|
1239
|
-
.
|
|
1240
|
-
|
|
1241
|
-
break;
|
|
1242
|
-
default:
|
|
1243
|
-
this.xScale = scaleLinear()
|
|
1244
|
-
.domain([0, config.data[0].data.length - 1])
|
|
1245
|
-
.range([0, this.width]);
|
|
1311
|
+
this.scales = new PlaChartScalesBuilder().build(config, this.width, this.height);
|
|
1312
|
+
this.lineGenerator = buildLineGenerator(config.xFormat, this.scales);
|
|
1313
|
+
this.areaGenerator = buildAreaGenerator(config.xFormat, this.scales, this.height);
|
|
1314
|
+
if (this.config.enableZoom) {
|
|
1315
|
+
this.zoomBehavior = buildZoomBehavior(this.width, this.height, (event) => {
|
|
1316
|
+
// Rescale x
|
|
1317
|
+
const newX = event.transform.rescaleX(this.scales.x);
|
|
1318
|
+
// Update axis
|
|
1319
|
+
this.axisBuilder.drawXAxis({
|
|
1320
|
+
svg: this.svg,
|
|
1321
|
+
numberOfTicks: this.config.numberOfTicks || 5,
|
|
1322
|
+
height: this.height,
|
|
1323
|
+
xScale: newX,
|
|
1324
|
+
yScale: this.scales.y,
|
|
1325
|
+
yFormat: this.config.yFormat,
|
|
1326
|
+
xFormat: this.config.xFormat
|
|
1327
|
+
});
|
|
1328
|
+
// Update lines/areas
|
|
1329
|
+
this.svg.selectAll('.line')
|
|
1330
|
+
.attr('d', (d) => this.lineGenerator.x((_, i) => newX(i))(d));
|
|
1331
|
+
this.svg.selectAll('.area')
|
|
1332
|
+
.attr('d', (d) => this.areaGenerator.x((_, i) => newX(i))(d));
|
|
1333
|
+
// Update dots
|
|
1334
|
+
this.svg.selectAll('.dot')
|
|
1335
|
+
.attr('cx', (d, i) => getXFormat(this.config.xFormat, d, i, newX));
|
|
1336
|
+
});
|
|
1246
1337
|
}
|
|
1247
|
-
this.
|
|
1248
|
-
.domain([config.yDomainMin || 0, config.yDomainMax || 100])
|
|
1249
|
-
.range([this.height, 0]);
|
|
1250
|
-
this.line = line()
|
|
1251
|
-
.x((d, i) => {
|
|
1252
|
-
return this.getXFormat(config.xFormat, d, i);
|
|
1253
|
-
})
|
|
1254
|
-
.y((d) => {
|
|
1255
|
-
return this.yScale(d.value);
|
|
1256
|
-
});
|
|
1257
|
-
this.area = area()
|
|
1258
|
-
.x((d, i) => {
|
|
1259
|
-
return this.getXFormat(config.xFormat, d, i);
|
|
1260
|
-
})
|
|
1261
|
-
.y0(this.height)
|
|
1262
|
-
.y1((d) => {
|
|
1263
|
-
return this.yScale(d.value);
|
|
1264
|
-
});
|
|
1338
|
+
this.drawChart(chartElm, this.config, type);
|
|
1265
1339
|
}
|
|
1266
1340
|
drawChart(chartElm, config, type) {
|
|
1267
1341
|
this.buildContainer(chartElm);
|
|
1342
|
+
this.attachZoomBehavior();
|
|
1268
1343
|
if (!config.hideAxis) {
|
|
1269
1344
|
this.axisBuilder.drawAxis({
|
|
1270
1345
|
svg: this.svg,
|
|
1271
1346
|
numberOfTicks: config.numberOfTicks || 5,
|
|
1272
1347
|
height: this.height,
|
|
1273
|
-
xScale: this.
|
|
1274
|
-
yScale: this.
|
|
1348
|
+
xScale: this.scales.x,
|
|
1349
|
+
yScale: this.scales.y,
|
|
1275
1350
|
yFormat: config.yFormat,
|
|
1276
1351
|
xFormat: config.xFormat
|
|
1277
1352
|
});
|
|
@@ -1281,16 +1356,40 @@ class LineAreaChartBuilder extends PcacChart {
|
|
|
1281
1356
|
svg: this.svg,
|
|
1282
1357
|
numberOfTicks: config.numberOfTicks || 5,
|
|
1283
1358
|
width: this.width,
|
|
1284
|
-
xScale: this.
|
|
1285
|
-
yScale: this.
|
|
1359
|
+
xScale: this.scales.x,
|
|
1360
|
+
yScale: this.scales.y
|
|
1286
1361
|
});
|
|
1287
1362
|
}
|
|
1288
1363
|
this.drawLineArea(config, type);
|
|
1289
1364
|
if (config.enableEffects) {
|
|
1290
|
-
|
|
1365
|
+
new PlaChartEffectsBuilder().buildEffects({
|
|
1366
|
+
svg: this.svg,
|
|
1367
|
+
height: this.height,
|
|
1368
|
+
width: this.width,
|
|
1369
|
+
data: config.data,
|
|
1370
|
+
colors: this.colors,
|
|
1371
|
+
x: this.scales.x,
|
|
1372
|
+
y: this.scales.y
|
|
1373
|
+
});
|
|
1291
1374
|
}
|
|
1292
1375
|
this.drawDots(config);
|
|
1293
1376
|
}
|
|
1377
|
+
attachZoomBehavior() {
|
|
1378
|
+
if (!this.config.enableZoom)
|
|
1379
|
+
return;
|
|
1380
|
+
// Add a transparent rect to capture zoom events
|
|
1381
|
+
this.svg.insert('rect', ':first-child')
|
|
1382
|
+
.attr('width', this.width)
|
|
1383
|
+
.attr('height', this.height)
|
|
1384
|
+
.attr('fill', 'none')
|
|
1385
|
+
.attr('pointer-events', 'all')
|
|
1386
|
+
.call(this.zoomBehavior)
|
|
1387
|
+
.transition()
|
|
1388
|
+
.duration(750);
|
|
1389
|
+
this.svg.call(this.zoomBehavior)
|
|
1390
|
+
.transition()
|
|
1391
|
+
.duration(750);
|
|
1392
|
+
}
|
|
1294
1393
|
drawLineArea(config, type) {
|
|
1295
1394
|
for (let i = 0; i < config.data.length; i++) {
|
|
1296
1395
|
if (type === PcacLineAreaPlotChartConfigType.Area) {
|
|
@@ -1307,10 +1406,10 @@ class LineAreaChartBuilder extends PcacChart {
|
|
|
1307
1406
|
.append('path')
|
|
1308
1407
|
.datum(lineData)
|
|
1309
1408
|
.attr('class', 'line')
|
|
1310
|
-
.attr('d', this.
|
|
1409
|
+
.attr('d', this.lineGenerator(this.startData))
|
|
1311
1410
|
.transition()
|
|
1312
1411
|
.duration(this.transitionService.getTransitionDuration())
|
|
1313
|
-
.attr('d', this.
|
|
1412
|
+
.attr('d', this.lineGenerator) // TODO: strongly type
|
|
1314
1413
|
.attr('stroke', () => {
|
|
1315
1414
|
return this.colors[index];
|
|
1316
1415
|
})
|
|
@@ -1327,24 +1426,10 @@ class LineAreaChartBuilder extends PcacChart {
|
|
|
1327
1426
|
.style('fill', () => {
|
|
1328
1427
|
return this.colors[index]; // TODO: strongly type
|
|
1329
1428
|
})
|
|
1330
|
-
.attr('d', this.
|
|
1429
|
+
.attr('d', this.lineGenerator(this.startData))
|
|
1331
1430
|
.transition()
|
|
1332
1431
|
.duration(this.transitionService.getTransitionDuration())
|
|
1333
|
-
.attr('d', this.
|
|
1334
|
-
}
|
|
1335
|
-
drawEffects(config) {
|
|
1336
|
-
if (config.enableEffects) {
|
|
1337
|
-
const effectsBuilder = new LineAreaChartEffectsBuilder();
|
|
1338
|
-
effectsBuilder.buildEffects({
|
|
1339
|
-
svg: this.svg,
|
|
1340
|
-
height: this.height,
|
|
1341
|
-
width: this.width,
|
|
1342
|
-
data: config.data,
|
|
1343
|
-
colors: this.colors,
|
|
1344
|
-
x: this.xScale,
|
|
1345
|
-
y: this.yScale
|
|
1346
|
-
});
|
|
1347
|
-
}
|
|
1432
|
+
.attr('d', this.areaGenerator); // TODO: strongly type
|
|
1348
1433
|
}
|
|
1349
1434
|
drawDots(config) {
|
|
1350
1435
|
const self = this;
|
|
@@ -1355,14 +1440,14 @@ class LineAreaChartBuilder extends PcacChart {
|
|
|
1355
1440
|
.data(config.data[index].data)
|
|
1356
1441
|
.enter().append('circle')
|
|
1357
1442
|
.attr('class', 'dot')
|
|
1358
|
-
.attr('stroke', (
|
|
1443
|
+
.attr('stroke', (_) => {
|
|
1359
1444
|
return this.colors[index];
|
|
1360
1445
|
})
|
|
1361
1446
|
.attr('cx', (d, i) => {
|
|
1362
|
-
return
|
|
1447
|
+
return getXFormat(config.xFormat, d, i, this.scales.x);
|
|
1363
1448
|
})
|
|
1364
1449
|
.attr('cy', (d) => {
|
|
1365
|
-
return this.
|
|
1450
|
+
return this.scales.y(0);
|
|
1366
1451
|
})
|
|
1367
1452
|
.attr('fill', '#fff')
|
|
1368
1453
|
.on('mouseover', function (event, d) {
|
|
@@ -1387,32 +1472,16 @@ class LineAreaChartBuilder extends PcacChart {
|
|
|
1387
1472
|
.transition()
|
|
1388
1473
|
.duration(this.transitionService.getTransitionDuration())
|
|
1389
1474
|
.attr('cy', (d) => {
|
|
1390
|
-
return this.
|
|
1475
|
+
return this.scales.y(d.value);
|
|
1391
1476
|
})
|
|
1392
1477
|
.attr('r', 4)
|
|
1393
1478
|
.attr('style', () => config.data[index].hide ? 'display: none' : null);
|
|
1394
1479
|
}
|
|
1395
1480
|
}
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
case PcacFormatEnum.DateTime:
|
|
1399
|
-
if (data.key) {
|
|
1400
|
-
return this.xScale(new Date(data.key));
|
|
1401
|
-
}
|
|
1402
|
-
return 0;
|
|
1403
|
-
case PcacFormatEnum.Decimal:
|
|
1404
|
-
if (data.key) {
|
|
1405
|
-
return this.xScale(data.key);
|
|
1406
|
-
}
|
|
1407
|
-
return 0;
|
|
1408
|
-
default:
|
|
1409
|
-
return this.xScale(index);
|
|
1410
|
-
}
|
|
1411
|
-
}
|
|
1412
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: LineAreaChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1413
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: LineAreaChartBuilder, providedIn: 'root' });
|
|
1481
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PlaChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1482
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PlaChartBuilder, providedIn: 'root' });
|
|
1414
1483
|
}
|
|
1415
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PlaChartBuilder, decorators: [{
|
|
1416
1485
|
type: Injectable,
|
|
1417
1486
|
args: [{
|
|
1418
1487
|
providedIn: 'root',
|
|
@@ -1420,7 +1489,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
1420
1489
|
}] });
|
|
1421
1490
|
|
|
1422
1491
|
class PcacLineAreaChartComponent {
|
|
1423
|
-
chartBuilder = inject(
|
|
1492
|
+
chartBuilder = inject(PlaChartBuilder);
|
|
1424
1493
|
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
1425
1494
|
type = input.required(...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
1426
1495
|
chartElm = viewChild.required('chart');
|
|
@@ -1452,10 +1521,10 @@ class PcacLineAreaChartComponent {
|
|
|
1452
1521
|
self.buildChart();
|
|
1453
1522
|
}, 300);
|
|
1454
1523
|
}
|
|
1455
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1456
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.
|
|
1524
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacLineAreaChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1525
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.4", type: PcacLineAreaChartComponent, isStandalone: true, selector: "pcac-line-area-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, host: { listeners: { "window:resize": "onResize()" } }, viewQueries: [{ propertyName: "chartElm", first: true, predicate: ["chart"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<section class=\"pcac-line-area-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-line-area-chart svg{width:100%;display:block}.pcac-line-area-chart .dot{stroke-width:2px}.pcac-line-area-chart .effects-canvas{fill:none}.pcac-line-area-chart .effect-line{stroke:#ced4da;stroke-width:1px;opacity:0}.pcac-line-area-chart .effect-circle{stroke-width:1px;fill:none;opacity:0}.pcac-line-area-chart .effect-text{font-size:11px;font-weight:700;fill:#343a40}.pcac-d3-tooltip{position:absolute;text-align:center;font-size:14px;padding:.5rem;pointer-events:none;display:none;background-color:#000000bf;color:#fff;border-radius:5px}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
1457
1526
|
}
|
|
1458
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1527
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacLineAreaChartComponent, decorators: [{
|
|
1459
1528
|
type: Component,
|
|
1460
1529
|
args: [{ selector: 'pcac-line-area-chart', encapsulation: ViewEncapsulation.None, template: "<section class=\"pcac-line-area-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-line-area-chart svg{width:100%;display:block}.pcac-line-area-chart .dot{stroke-width:2px}.pcac-line-area-chart .effects-canvas{fill:none}.pcac-line-area-chart .effect-line{stroke:#ced4da;stroke-width:1px;opacity:0}.pcac-line-area-chart .effect-circle{stroke-width:1px;fill:none;opacity:0}.pcac-line-area-chart .effect-text{font-size:11px;font-weight:700;fill:#343a40}.pcac-d3-tooltip{position:absolute;text-align:center;font-size:14px;padding:.5rem;pointer-events:none;display:none;background-color:#000000bf;color:#fff;border-radius:5px}\n"] }]
|
|
1461
1530
|
}], ctorParameters: () => [], propDecorators: { onResize: [{
|
|
@@ -1471,10 +1540,10 @@ class PcacPlotChart {
|
|
|
1471
1540
|
onResize() {
|
|
1472
1541
|
this.chart()?.onResize();
|
|
1473
1542
|
}
|
|
1474
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1475
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.
|
|
1543
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacPlotChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1544
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.4", type: PcacPlotChart, isStandalone: true, selector: "pcac-plot-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, viewQueries: [{ propertyName: "chart", first: true, predicate: PcacLineAreaChartComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<pcac-line-area-chart [config]=\"config()\" [type]=\"types.Plot\" (dotClicked)=\"dotClicked.emit($event)\"/>", dependencies: [{ kind: "component", type: PcacLineAreaChartComponent, selector: "pcac-line-area-chart", inputs: ["config", "type"], outputs: ["dotClicked"] }] });
|
|
1476
1545
|
}
|
|
1477
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1546
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacPlotChart, decorators: [{
|
|
1478
1547
|
type: Component,
|
|
1479
1548
|
args: [{ selector: 'pcac-plot-chart', imports: [PcacLineAreaChartComponent], template: "<pcac-line-area-chart [config]=\"config()\" [type]=\"types.Plot\" (dotClicked)=\"dotClicked.emit($event)\"/>" }]
|
|
1480
1549
|
}] });
|
|
@@ -1490,10 +1559,10 @@ class PcacLineChart {
|
|
|
1490
1559
|
onResize() {
|
|
1491
1560
|
this.chart()?.onResize();
|
|
1492
1561
|
}
|
|
1493
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1494
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.
|
|
1562
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacLineChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1563
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.4", type: PcacLineChart, isStandalone: true, selector: "pcac-line-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, viewQueries: [{ propertyName: "chart", first: true, predicate: PcacLineAreaChartComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<pcac-line-area-chart [config]=\"config()\" [type]=\"types.Line\" />", dependencies: [{ kind: "component", type: PcacLineAreaChartComponent, selector: "pcac-line-area-chart", inputs: ["config", "type"], outputs: ["dotClicked"] }] });
|
|
1495
1564
|
}
|
|
1496
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1565
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacLineChart, decorators: [{
|
|
1497
1566
|
type: Component,
|
|
1498
1567
|
args: [{ selector: 'pcac-line-chart', imports: [PcacLineAreaChartComponent], template: "<pcac-line-area-chart [config]=\"config()\" [type]=\"types.Line\" />" }]
|
|
1499
1568
|
}] });
|
|
@@ -1509,10 +1578,10 @@ class PcacAreaChart {
|
|
|
1509
1578
|
onResize() {
|
|
1510
1579
|
this.chart()?.onResize();
|
|
1511
1580
|
}
|
|
1512
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1513
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.
|
|
1581
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacAreaChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1582
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.4", type: PcacAreaChart, isStandalone: true, selector: "pcac-area-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dotClicked: "dotClicked" }, viewQueries: [{ propertyName: "chart", first: true, predicate: PcacLineAreaChartComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<pcac-line-area-chart [config]=\"config()\" [type]=\"types.Area\" />", dependencies: [{ kind: "component", type: PcacLineAreaChartComponent, selector: "pcac-line-area-chart", inputs: ["config", "type"], outputs: ["dotClicked"] }] });
|
|
1514
1583
|
}
|
|
1515
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacAreaChart, decorators: [{
|
|
1516
1585
|
type: Component,
|
|
1517
1586
|
args: [{ selector: 'pcac-area-chart', imports: [PcacLineAreaChartComponent], template: "<pcac-line-area-chart [config]=\"config()\" [type]=\"types.Area\" />" }]
|
|
1518
1587
|
}] });
|
|
@@ -1593,10 +1662,10 @@ class PieChartBuilder extends PcacChart {
|
|
|
1593
1662
|
const i = interpolate({ startAngle: 0, endAngle: 0 }, b);
|
|
1594
1663
|
return (t) => this.arcShape(i(t)); // TODO: Strongly type
|
|
1595
1664
|
}
|
|
1596
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1597
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
1665
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PieChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1666
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PieChartBuilder, providedIn: 'root' });
|
|
1598
1667
|
}
|
|
1599
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1668
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PieChartBuilder, decorators: [{
|
|
1600
1669
|
type: Injectable,
|
|
1601
1670
|
args: [{
|
|
1602
1671
|
providedIn: 'root',
|
|
@@ -1633,10 +1702,10 @@ class PcacPieChartComponent {
|
|
|
1633
1702
|
self.buildChart();
|
|
1634
1703
|
}, 300);
|
|
1635
1704
|
}
|
|
1636
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
1637
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.
|
|
1705
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacPieChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1706
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.4", type: PcacPieChartComponent, isStandalone: true, selector: "pcac-pie-chart", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { sliceClicked: "sliceClicked" }, host: { listeners: { "window:resize": "onResize()" } }, viewQueries: [{ propertyName: "chartElm", first: true, predicate: ["chart"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<section class=\"pcac-pie-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-pie-chart svg{width:100%;display:block}.pcac-pie-chart .dot{fill:none;stroke-width:1px}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
1638
1707
|
}
|
|
1639
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
1708
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: PcacPieChartComponent, decorators: [{
|
|
1640
1709
|
type: Component,
|
|
1641
1710
|
args: [{ selector: 'pcac-pie-chart', encapsulation: ViewEncapsulation.None, template: "<section class=\"pcac-pie-chart\">\n <svg #chart></svg>\n</section>\n\n", styles: [".pcac-pie-chart svg{width:100%;display:block}.pcac-pie-chart .dot{fill:none;stroke-width:1px}\n"] }]
|
|
1642
1711
|
}], ctorParameters: () => [], propDecorators: { onResize: [{
|