@pioneer-code/pioneer-charts 20.0.0 → 20.0.3
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/fesm2022/pioneer-code-pioneer-charts.mjs +166 -180
- package/fesm2022/pioneer-code-pioneer-charts.mjs.map +1 -1
- package/package.json +3 -3
- package/scss/bar-chart/bar-vertical-chart/bar-vertical-chart.component.scss +0 -2
- package/scss/line-area-chart/line-area-chart.component.scss +3 -3
- package/scss/pioneer-charts.scss +4 -4
|
@@ -16,21 +16,17 @@ import { color } from 'd3-color';
|
|
|
16
16
|
* INewChart extends IChart
|
|
17
17
|
*/
|
|
18
18
|
class PcacChartConfig {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.data = [];
|
|
25
|
-
}
|
|
19
|
+
/**
|
|
20
|
+
* Height in pixels
|
|
21
|
+
*/
|
|
22
|
+
height = 200;
|
|
23
|
+
data = [];
|
|
26
24
|
}
|
|
27
25
|
class PcacData {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
this.data = [];
|
|
33
|
-
}
|
|
26
|
+
key = null;
|
|
27
|
+
value = null;
|
|
28
|
+
hide = false;
|
|
29
|
+
data = [];
|
|
34
30
|
}
|
|
35
31
|
var PcacFormatEnum;
|
|
36
32
|
(function (PcacFormatEnum) {
|
|
@@ -89,10 +85,10 @@ class PcacAxisBuilder {
|
|
|
89
85
|
.attr('transform', 'translate(0,' + config.height + ')')
|
|
90
86
|
.call(xAxis);
|
|
91
87
|
}
|
|
92
|
-
static
|
|
93
|
-
static
|
|
88
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacAxisBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
89
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacAxisBuilder, providedIn: 'root' });
|
|
94
90
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacAxisBuilder, decorators: [{
|
|
96
92
|
type: Injectable,
|
|
97
93
|
args: [{
|
|
98
94
|
providedIn: 'root',
|
|
@@ -127,10 +123,10 @@ class PcacGridBuilder {
|
|
|
127
123
|
.attr('x2', config.width)
|
|
128
124
|
.attr('class', (_, i) => (i === 0 ? 'pcac-grid-rule-last' : ''));
|
|
129
125
|
}
|
|
130
|
-
static
|
|
131
|
-
static
|
|
126
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacGridBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
127
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacGridBuilder, providedIn: 'root' });
|
|
132
128
|
}
|
|
133
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacGridBuilder, decorators: [{
|
|
134
130
|
type: Injectable,
|
|
135
131
|
args: [{
|
|
136
132
|
providedIn: 'root',
|
|
@@ -138,24 +134,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
138
134
|
}] });
|
|
139
135
|
|
|
140
136
|
class PcacColorService {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
this.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
this.alert = 'red';
|
|
158
|
-
}
|
|
137
|
+
primary = '#43425d';
|
|
138
|
+
primaryLight = '#a3a1fb';
|
|
139
|
+
success = '#5ee2a0';
|
|
140
|
+
danger = '#ff6565';
|
|
141
|
+
warning = '#fec163';
|
|
142
|
+
orange = '#ffa177';
|
|
143
|
+
blue = '#55d8fe';
|
|
144
|
+
scale = [
|
|
145
|
+
this.primaryLight,
|
|
146
|
+
this.success,
|
|
147
|
+
this.danger,
|
|
148
|
+
this.warning,
|
|
149
|
+
this.orange,
|
|
150
|
+
this.blue
|
|
151
|
+
];
|
|
152
|
+
alert = 'red';
|
|
159
153
|
/**
|
|
160
154
|
* Get a scale of colors dynamically
|
|
161
155
|
* @param numberOfNodes Number of items in dynamically build collection of colors
|
|
@@ -199,10 +193,10 @@ class PcacColorService {
|
|
|
199
193
|
setAlert() {
|
|
200
194
|
return this.alert;
|
|
201
195
|
}
|
|
202
|
-
static
|
|
203
|
-
static
|
|
196
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacColorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
197
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacColorService, providedIn: 'root' });
|
|
204
198
|
}
|
|
205
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacColorService, decorators: [{
|
|
206
200
|
type: Injectable,
|
|
207
201
|
args: [{
|
|
208
202
|
providedIn: 'root',
|
|
@@ -210,16 +204,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
210
204
|
}] });
|
|
211
205
|
|
|
212
206
|
class PcacTransitionService {
|
|
213
|
-
|
|
214
|
-
this.transitionDuration = 750;
|
|
215
|
-
}
|
|
207
|
+
transitionDuration = 750;
|
|
216
208
|
getTransitionDuration() {
|
|
217
209
|
return this.transitionDuration;
|
|
218
210
|
}
|
|
219
|
-
static
|
|
220
|
-
static
|
|
211
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacTransitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
212
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacTransitionService, providedIn: 'root' });
|
|
221
213
|
}
|
|
222
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacTransitionService, decorators: [{
|
|
223
215
|
type: Injectable,
|
|
224
216
|
args: [{
|
|
225
217
|
providedIn: 'root',
|
|
@@ -227,11 +219,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
227
219
|
}] });
|
|
228
220
|
|
|
229
221
|
class PcacTooltipBuilder {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
.attr('class', 'pcac-d3-tooltip'); // TODO: Strongly type
|
|
234
|
-
}
|
|
222
|
+
tooltip = select('body')
|
|
223
|
+
.append('div')
|
|
224
|
+
.attr('class', 'pcac-d3-tooltip'); // TODO: Strongly type
|
|
235
225
|
showBarTooltip(event, data, valueFormat, keyFormat) {
|
|
236
226
|
this.tooltip.style('left', event.pageX - 60 + 'px')
|
|
237
227
|
.style('top', event.pageY - 55 + 'px')
|
|
@@ -271,10 +261,10 @@ class PcacTooltipBuilder {
|
|
|
271
261
|
let finalValue = value ? value.toString() : null;
|
|
272
262
|
return key ? key + '</br>' + finalValue : finalValue;
|
|
273
263
|
}
|
|
274
|
-
static
|
|
275
|
-
static
|
|
264
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacTooltipBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
265
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacTooltipBuilder, providedIn: 'root' });
|
|
276
266
|
}
|
|
277
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacTooltipBuilder, decorators: [{
|
|
278
268
|
type: Injectable,
|
|
279
269
|
args: [{
|
|
280
270
|
providedIn: 'root',
|
|
@@ -282,19 +272,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
282
272
|
}] });
|
|
283
273
|
|
|
284
274
|
class PcacChart {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}
|
|
275
|
+
axisBuilder = inject(PcacAxisBuilder);
|
|
276
|
+
gridBuilder = inject(PcacGridBuilder);
|
|
277
|
+
transitionService = inject(PcacTransitionService);
|
|
278
|
+
tooltipBuilder = inject(PcacTooltipBuilder);
|
|
279
|
+
colorService = inject(PcacColorService);
|
|
280
|
+
margin = { top: 8, right: 16, bottom: 20, left: 40 };
|
|
281
|
+
svg; // Typing?
|
|
282
|
+
width = 400;
|
|
283
|
+
height = 400;
|
|
284
|
+
colors = [];
|
|
285
|
+
startData = []; // TODO: Strongly type
|
|
286
|
+
endData = [];
|
|
298
287
|
/**
|
|
299
288
|
* Prior to building a chart, we need to initialize the state of the chart
|
|
300
289
|
* @param chartElm Reference to SVG on dom
|
|
@@ -352,10 +341,10 @@ class PcacChart {
|
|
|
352
341
|
this.margin.bottom = this.margin.bottom;
|
|
353
342
|
this.width = this.width - this.margin.left;
|
|
354
343
|
}
|
|
355
|
-
static
|
|
356
|
-
static
|
|
344
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacChart, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
345
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacChart, providedIn: 'root' });
|
|
357
346
|
}
|
|
358
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacChart, decorators: [{
|
|
359
348
|
type: Injectable,
|
|
360
349
|
args: [{
|
|
361
350
|
providedIn: 'root',
|
|
@@ -363,9 +352,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
363
352
|
}] });
|
|
364
353
|
|
|
365
354
|
class LineAreaChartEffectsBuilder {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
355
|
+
config;
|
|
356
|
+
lines = [];
|
|
369
357
|
buildEffects(config) {
|
|
370
358
|
this.config = config;
|
|
371
359
|
this.lines = [];
|
|
@@ -476,10 +464,10 @@ class LineAreaChartEffectsBuilder {
|
|
|
476
464
|
return 'translate(' + mousePos[0] + ',' + pos.y + ')';
|
|
477
465
|
});
|
|
478
466
|
}
|
|
479
|
-
static
|
|
480
|
-
static
|
|
467
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: LineAreaChartEffectsBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
468
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: LineAreaChartEffectsBuilder, providedIn: 'root' });
|
|
481
469
|
}
|
|
482
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: LineAreaChartEffectsBuilder, decorators: [{
|
|
483
471
|
type: Injectable,
|
|
484
472
|
args: [{
|
|
485
473
|
providedIn: 'root',
|
|
@@ -487,11 +475,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
487
475
|
}] });
|
|
488
476
|
|
|
489
477
|
class LineAreaChartBuilder extends PcacChart {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
478
|
+
line;
|
|
479
|
+
area;
|
|
480
|
+
xScale;
|
|
481
|
+
yScale;
|
|
482
|
+
dotClickedSource = new Subject();
|
|
483
|
+
config;
|
|
484
|
+
dotClicked$ = this.dotClickedSource.asObservable();
|
|
495
485
|
buildChart(chartElm, config) {
|
|
496
486
|
this.config = JSON.parse(JSON.stringify(config));
|
|
497
487
|
this.startData = range(this.config.data[0].data.length).map((d) => {
|
|
@@ -681,10 +671,10 @@ class LineAreaChartBuilder extends PcacChart {
|
|
|
681
671
|
return this.xScale(index);
|
|
682
672
|
}
|
|
683
673
|
}
|
|
684
|
-
static
|
|
685
|
-
static
|
|
674
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: LineAreaChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
675
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: LineAreaChartBuilder, providedIn: 'root' });
|
|
686
676
|
}
|
|
687
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
677
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: LineAreaChartBuilder, decorators: [{
|
|
688
678
|
type: Injectable,
|
|
689
679
|
args: [{
|
|
690
680
|
providedIn: 'root',
|
|
@@ -692,11 +682,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
692
682
|
}] });
|
|
693
683
|
|
|
694
684
|
class PcacLineAreaChartComponent {
|
|
685
|
+
chartBuilder = inject(LineAreaChartBuilder);
|
|
686
|
+
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
687
|
+
chartElm = viewChild.required('chart');
|
|
688
|
+
dotClicked = output();
|
|
689
|
+
resizeWindowTimeout;
|
|
695
690
|
constructor() {
|
|
696
|
-
this.chartBuilder = inject(LineAreaChartBuilder);
|
|
697
|
-
this.config = input.required();
|
|
698
|
-
this.chartElm = viewChild.required('chart');
|
|
699
|
-
this.dotClicked = output();
|
|
700
691
|
this.chartBuilder.dotClicked$.subscribe(data => {
|
|
701
692
|
this.dotClicked.emit(data);
|
|
702
693
|
});
|
|
@@ -708,6 +699,7 @@ class PcacLineAreaChartComponent {
|
|
|
708
699
|
}
|
|
709
700
|
buildChart() {
|
|
710
701
|
const config = this.config();
|
|
702
|
+
console.log('Building chart with config:', config);
|
|
711
703
|
if (config && config.data && config.data.length > 0) {
|
|
712
704
|
this.chartBuilder.buildChart(this.chartElm(), config);
|
|
713
705
|
}
|
|
@@ -722,10 +714,10 @@ class PcacLineAreaChartComponent {
|
|
|
722
714
|
self.buildChart();
|
|
723
715
|
}, 300);
|
|
724
716
|
}
|
|
725
|
-
static
|
|
726
|
-
static
|
|
717
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacLineAreaChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
718
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.1.7", type: PcacLineAreaChartComponent, isStandalone: true, selector: "pcac-line-area-chart", inputs: { config: { classPropertyName: "config", publicName: "config", 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}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
727
719
|
}
|
|
728
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
720
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacLineAreaChartComponent, decorators: [{
|
|
729
721
|
type: Component,
|
|
730
722
|
args: [{ selector: 'pcac-line-area-chart', encapsulation: ViewEncapsulation.None, standalone: true, 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}\n"] }]
|
|
731
723
|
}], ctorParameters: () => [], propDecorators: { onResize: [{
|
|
@@ -734,24 +726,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
734
726
|
}] } });
|
|
735
727
|
|
|
736
728
|
class PcacLineAreaChartConfig extends PcacChartConfig {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
729
|
+
isArea = false;
|
|
730
|
+
enableEffects = true;
|
|
731
|
+
numberOfTicks = 5;
|
|
732
|
+
hideGrid = false;
|
|
733
|
+
hideAxis = false;
|
|
734
|
+
yFormat = PcacFormatEnum.None;
|
|
735
|
+
xFormat = PcacFormatEnum.None;
|
|
736
|
+
yDomainMax;
|
|
737
|
+
yDomainMin;
|
|
738
|
+
xDomainMin;
|
|
739
|
+
xDomainMax;
|
|
747
740
|
}
|
|
748
741
|
|
|
749
742
|
class PieChartBuilder extends PcacChart {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
743
|
+
radius;
|
|
744
|
+
arcShape;
|
|
745
|
+
arcOverShape;
|
|
746
|
+
pieAngles;
|
|
747
|
+
sliceClickedSource = new Subject();
|
|
748
|
+
sliceClicked$ = this.sliceClickedSource.asObservable();
|
|
755
749
|
buildChart(chartElm, config) {
|
|
756
750
|
this.initializeChartState(chartElm, config);
|
|
757
751
|
this.radius = Math.min(Math.min(this.height, this.width), Math.min(this.height, this.width)) / 2;
|
|
@@ -813,10 +807,10 @@ class PieChartBuilder extends PcacChart {
|
|
|
813
807
|
const i = interpolate({ startAngle: 0, endAngle: 0 }, b);
|
|
814
808
|
return (t) => this.arcShape(i(t)); // TODO: Strongly type
|
|
815
809
|
}
|
|
816
|
-
static
|
|
817
|
-
static
|
|
810
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PieChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
811
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PieChartBuilder, providedIn: 'root' });
|
|
818
812
|
}
|
|
819
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
813
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PieChartBuilder, decorators: [{
|
|
820
814
|
type: Injectable,
|
|
821
815
|
args: [{
|
|
822
816
|
providedIn: 'root',
|
|
@@ -824,11 +818,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
824
818
|
}] });
|
|
825
819
|
|
|
826
820
|
class PcacPieChartComponent {
|
|
821
|
+
chartBuilder = inject(PieChartBuilder);
|
|
822
|
+
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
823
|
+
chartElm = viewChild.required('chart');
|
|
824
|
+
sliceClicked = output();
|
|
825
|
+
resizeWindowTimeout;
|
|
827
826
|
constructor() {
|
|
828
|
-
this.chartBuilder = inject(PieChartBuilder);
|
|
829
|
-
this.config = input.required();
|
|
830
|
-
this.chartElm = viewChild.required('chart');
|
|
831
|
-
this.sliceClicked = output();
|
|
832
827
|
this.chartBuilder.sliceClicked$.subscribe(data => {
|
|
833
828
|
this.sliceClicked.emit(data);
|
|
834
829
|
});
|
|
@@ -852,10 +847,10 @@ class PcacPieChartComponent {
|
|
|
852
847
|
self.buildChart();
|
|
853
848
|
}, 300);
|
|
854
849
|
}
|
|
855
|
-
static
|
|
856
|
-
static
|
|
850
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacPieChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
851
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.1.7", 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 });
|
|
857
852
|
}
|
|
858
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
853
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacPieChartComponent, decorators: [{
|
|
859
854
|
type: Component,
|
|
860
855
|
args: [{ selector: 'pcac-pie-chart', encapsulation: ViewEncapsulation.None, standalone: true, 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"] }]
|
|
861
856
|
}], ctorParameters: () => [], propDecorators: { onResize: [{
|
|
@@ -864,18 +859,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
864
859
|
}] } });
|
|
865
860
|
|
|
866
861
|
class PcacPieChartConfig extends PcacChartConfig {
|
|
867
|
-
|
|
868
|
-
super(...arguments);
|
|
869
|
-
this.numberOfTicks = 5;
|
|
870
|
-
}
|
|
862
|
+
numberOfTicks = 5;
|
|
871
863
|
}
|
|
872
864
|
|
|
873
865
|
class BarHorizontalChartBuilder extends PcacChart {
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
866
|
+
xScale;
|
|
867
|
+
yScaleStacked;
|
|
868
|
+
yScaleGrouped;
|
|
869
|
+
barClickedSource = new Subject();
|
|
870
|
+
config;
|
|
871
|
+
cachedMargins;
|
|
872
|
+
barClicked$ = this.barClickedSource.asObservable();
|
|
879
873
|
buildChart(chartElm, config) {
|
|
880
874
|
this.config = JSON.parse(JSON.stringify(config));
|
|
881
875
|
if (this.config.hideAxis) {
|
|
@@ -1113,10 +1107,10 @@ class BarHorizontalChartBuilder extends PcacChart {
|
|
|
1113
1107
|
this.tooltipBuilder.hideTooltip();
|
|
1114
1108
|
});
|
|
1115
1109
|
}
|
|
1116
|
-
static
|
|
1117
|
-
static
|
|
1110
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: BarHorizontalChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1111
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: BarHorizontalChartBuilder, providedIn: 'root' });
|
|
1118
1112
|
}
|
|
1119
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: BarHorizontalChartBuilder, decorators: [{
|
|
1120
1114
|
type: Injectable,
|
|
1121
1115
|
args: [{
|
|
1122
1116
|
providedIn: 'root',
|
|
@@ -1124,11 +1118,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
1124
1118
|
}] });
|
|
1125
1119
|
|
|
1126
1120
|
class PcacBarHorizontalChartComponent {
|
|
1121
|
+
chartBuilder = inject(BarHorizontalChartBuilder);
|
|
1122
|
+
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
1123
|
+
chartElm = viewChild.required('chart');
|
|
1124
|
+
barClicked = output();
|
|
1125
|
+
resizeWindowTimeout;
|
|
1127
1126
|
constructor() {
|
|
1128
|
-
this.chartBuilder = inject(BarHorizontalChartBuilder);
|
|
1129
|
-
this.config = input.required();
|
|
1130
|
-
this.chartElm = viewChild.required('chart');
|
|
1131
|
-
this.barClicked = output();
|
|
1132
1127
|
this.chartBuilder.barClicked$.subscribe(data => {
|
|
1133
1128
|
this.barClicked.emit(data);
|
|
1134
1129
|
});
|
|
@@ -1152,10 +1147,10 @@ class PcacBarHorizontalChartComponent {
|
|
|
1152
1147
|
self.buildChart();
|
|
1153
1148
|
}, 300);
|
|
1154
1149
|
}
|
|
1155
|
-
static
|
|
1156
|
-
static
|
|
1150
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacBarHorizontalChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1151
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.1.7", 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 });
|
|
1157
1152
|
}
|
|
1158
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacBarHorizontalChartComponent, decorators: [{
|
|
1159
1154
|
type: Component,
|
|
1160
1155
|
args: [{ selector: 'pcac-bar-horizontal-chart', encapsulation: ViewEncapsulation.None, standalone: true, 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"] }]
|
|
1161
1156
|
}], ctorParameters: () => [], propDecorators: { onResize: [{
|
|
@@ -1164,31 +1159,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
1164
1159
|
}] } });
|
|
1165
1160
|
|
|
1166
1161
|
class PcacBarHorizontalChartConfig extends PcacChartConfig {
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
this.spreadColorsPerGroup = false;
|
|
1177
|
-
this.colorOverride = new PcacBarHorizontalChartColorOverrideConfig();
|
|
1178
|
-
}
|
|
1162
|
+
domainMax = 100;
|
|
1163
|
+
numberOfTicks = 5;
|
|
1164
|
+
isStacked = false;
|
|
1165
|
+
thresholds = [];
|
|
1166
|
+
tickFormat = PcacFormatEnum.None;
|
|
1167
|
+
hideGrid = false;
|
|
1168
|
+
hideAxis = false;
|
|
1169
|
+
spreadColorsPerGroup = false;
|
|
1170
|
+
colorOverride = new PcacBarHorizontalChartColorOverrideConfig();
|
|
1179
1171
|
}
|
|
1180
1172
|
class PcacBarHorizontalChartColorOverrideConfig {
|
|
1181
|
-
|
|
1182
|
-
this.colors = [];
|
|
1183
|
-
}
|
|
1173
|
+
colors = [];
|
|
1184
1174
|
}
|
|
1185
1175
|
|
|
1186
1176
|
class BarVerticalChartBuilder extends PcacChart {
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1177
|
+
xScaleStacked;
|
|
1178
|
+
xScaleGrouped;
|
|
1179
|
+
yScale;
|
|
1180
|
+
barClickedSource = new Subject();
|
|
1181
|
+
barClicked$ = this.barClickedSource.asObservable();
|
|
1192
1182
|
buildChart(chartElm, config) {
|
|
1193
1183
|
if (config.colorOverride && config.colorOverride.colors) {
|
|
1194
1184
|
this.colors = config.colorOverride.colors;
|
|
@@ -1438,10 +1428,10 @@ class BarVerticalChartBuilder extends PcacChart {
|
|
|
1438
1428
|
return '3px';
|
|
1439
1429
|
});
|
|
1440
1430
|
}
|
|
1441
|
-
static
|
|
1442
|
-
static
|
|
1431
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: BarVerticalChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1432
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: BarVerticalChartBuilder, providedIn: 'root' });
|
|
1443
1433
|
}
|
|
1444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1434
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: BarVerticalChartBuilder, decorators: [{
|
|
1445
1435
|
type: Injectable,
|
|
1446
1436
|
args: [{
|
|
1447
1437
|
providedIn: 'root',
|
|
@@ -1449,11 +1439,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
1449
1439
|
}] });
|
|
1450
1440
|
|
|
1451
1441
|
class PcacBarVerticalChartComponent {
|
|
1442
|
+
chartBuilder = inject(BarVerticalChartBuilder);
|
|
1443
|
+
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
1444
|
+
chartElm = viewChild.required('chart');
|
|
1445
|
+
barClicked = output();
|
|
1446
|
+
resizeWindowTimeout;
|
|
1452
1447
|
constructor() {
|
|
1453
|
-
this.chartBuilder = inject(BarVerticalChartBuilder);
|
|
1454
|
-
this.config = input.required();
|
|
1455
|
-
this.chartElm = viewChild.required('chart');
|
|
1456
|
-
this.barClicked = output();
|
|
1457
1448
|
this.chartBuilder.barClicked$.subscribe(data => {
|
|
1458
1449
|
this.barClicked.emit(data);
|
|
1459
1450
|
});
|
|
@@ -1477,10 +1468,10 @@ class PcacBarVerticalChartComponent {
|
|
|
1477
1468
|
self.buildChart();
|
|
1478
1469
|
}, 300);
|
|
1479
1470
|
}
|
|
1480
|
-
static
|
|
1481
|
-
static
|
|
1471
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacBarVerticalChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1472
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.1.7", 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 });
|
|
1482
1473
|
}
|
|
1483
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PcacBarVerticalChartComponent, decorators: [{
|
|
1484
1475
|
type: Component,
|
|
1485
1476
|
args: [{ selector: 'pcac-bar-vertical-chart', encapsulation: ViewEncapsulation.None, standalone: true, 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"] }]
|
|
1486
1477
|
}], ctorParameters: () => [], propDecorators: { onResize: [{
|
|
@@ -1489,23 +1480,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
1489
1480
|
}] } });
|
|
1490
1481
|
|
|
1491
1482
|
class PcacBarVerticalChartConfig extends PcacChartConfig {
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
this.spreadColorsPerGroup = false;
|
|
1502
|
-
this.colorOverride = new PcacBarVerticalChartColorOverrideConfig();
|
|
1503
|
-
}
|
|
1483
|
+
domainMax = 100;
|
|
1484
|
+
numberOfTicks = 5;
|
|
1485
|
+
isStacked = false;
|
|
1486
|
+
thresholds = [];
|
|
1487
|
+
tickFormat = PcacFormatEnum.None;
|
|
1488
|
+
hideGrid = false;
|
|
1489
|
+
hideAxis = false;
|
|
1490
|
+
spreadColorsPerGroup = false;
|
|
1491
|
+
colorOverride = new PcacBarVerticalChartColorOverrideConfig();
|
|
1504
1492
|
}
|
|
1505
1493
|
class PcacBarVerticalChartColorOverrideConfig {
|
|
1506
|
-
|
|
1507
|
-
this.colors = [];
|
|
1508
|
-
}
|
|
1494
|
+
colors = [];
|
|
1509
1495
|
}
|
|
1510
1496
|
|
|
1511
1497
|
/*
|