@pioneer-code/pioneer-charts 19.0.0 → 20.0.0
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 +169 -205
- package/fesm2022/pioneer-code-pioneer-charts.mjs.map +1 -1
- package/index.d.ts +363 -3
- package/package.json +3 -3
- package/lib/bar-chart/bar-horizontal-chart/bar-horizontal-chart.builder.d.ts +0 -41
- package/lib/bar-chart/bar-horizontal-chart/bar-horizontal-chart.component.d.ts +0 -21
- package/lib/bar-chart/bar-horizontal-chart/bar-horizontal-chart.model.d.ts +0 -15
- package/lib/bar-chart/bar-horizontal-chart/public-api.d.ts +0 -3
- package/lib/bar-chart/bar-vertical-chart/bar-vertical-chart.builder.d.ts +0 -42
- package/lib/bar-chart/bar-vertical-chart/bar-vertical-chart.component.d.ts +0 -21
- package/lib/bar-chart/bar-vertical-chart/bar-vertical-chart.model.d.ts +0 -15
- package/lib/bar-chart/bar-vertical-chart/public-api.d.ts +0 -3
- package/lib/core/axis.builder.d.ts +0 -21
- package/lib/core/chart.d.ts +0 -55
- package/lib/core/chart.model.d.ts +0 -24
- package/lib/core/color.service.d.ts +0 -32
- package/lib/core/grid.builder.d.ts +0 -22
- package/lib/core/index.d.ts +0 -1
- package/lib/core/public-api.d.ts +0 -7
- package/lib/core/tooltip.builder.d.ts +0 -10
- package/lib/core/transition.service.d.ts +0 -7
- package/lib/line-area-chart/line-area-chart-effects.builders.d.ts +0 -28
- package/lib/line-area-chart/line-area-chart.builder.d.ts +0 -37
- package/lib/line-area-chart/line-area-chart.component.d.ts +0 -21
- package/lib/line-area-chart/line-area-chart.model.d.ts +0 -14
- package/lib/line-area-chart/public-api.d.ts +0 -3
- package/lib/pie-chart/pie-chart.builder.d.ts +0 -33
- package/lib/pie-chart/pie-chart.component.d.ts +0 -21
- package/lib/pie-chart/pie-chart.model.d.ts +0 -4
- package/lib/pie-chart/public-api.d.ts +0 -3
- package/public-api.d.ts +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { axisLeft, axisBottom } from 'd3-axis';
|
|
2
|
-
import { select as select$1 } from 'd3-selection';
|
|
3
2
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable,
|
|
3
|
+
import { Injectable, inject, input, viewChild, output, HostListener, ViewEncapsulation, Component } from '@angular/core';
|
|
4
|
+
import { select as select$1 } from 'd3-selection';
|
|
5
5
|
import { select, scaleTime } from 'd3';
|
|
6
6
|
import { transition } from 'd3-transition';
|
|
7
7
|
import { scaleLinear, scaleBand } from 'd3-scale';
|
|
@@ -89,10 +89,10 @@ class PcacAxisBuilder {
|
|
|
89
89
|
.attr('transform', 'translate(0,' + config.height + ')')
|
|
90
90
|
.call(xAxis);
|
|
91
91
|
}
|
|
92
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
93
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
92
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacAxisBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
93
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacAxisBuilder, providedIn: 'root' }); }
|
|
94
94
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacAxisBuilder, decorators: [{
|
|
96
96
|
type: Injectable,
|
|
97
97
|
args: [{
|
|
98
98
|
providedIn: 'root',
|
|
@@ -127,82 +127,10 @@ class PcacGridBuilder {
|
|
|
127
127
|
.attr('x2', config.width)
|
|
128
128
|
.attr('class', (_, i) => (i === 0 ? 'pcac-grid-rule-last' : ''));
|
|
129
129
|
}
|
|
130
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
131
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
132
|
-
}
|
|
133
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: PcacGridBuilder, decorators: [{
|
|
134
|
-
type: Injectable,
|
|
135
|
-
args: [{
|
|
136
|
-
providedIn: 'root',
|
|
137
|
-
}]
|
|
138
|
-
}] });
|
|
139
|
-
|
|
140
|
-
class PcacTransitionService {
|
|
141
|
-
constructor() {
|
|
142
|
-
this.transitionDuration = 750;
|
|
143
|
-
}
|
|
144
|
-
getTransitionDuration() {
|
|
145
|
-
return this.transitionDuration;
|
|
146
|
-
}
|
|
147
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: PcacTransitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
148
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: PcacTransitionService, providedIn: 'root' }); }
|
|
149
|
-
}
|
|
150
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: PcacTransitionService, decorators: [{
|
|
151
|
-
type: Injectable,
|
|
152
|
-
args: [{
|
|
153
|
-
providedIn: 'root',
|
|
154
|
-
}]
|
|
155
|
-
}] });
|
|
156
|
-
|
|
157
|
-
class PcacTooltipBuilder {
|
|
158
|
-
constructor() {
|
|
159
|
-
this.tooltip = select('body')
|
|
160
|
-
.append('div')
|
|
161
|
-
.attr('class', 'pcac-d3-tooltip'); // TODO: Strongly type
|
|
162
|
-
}
|
|
163
|
-
showBarTooltip(event, data, valueFormat, keyFormat) {
|
|
164
|
-
this.tooltip.style('left', event.pageX - 60 + 'px')
|
|
165
|
-
.style('top', event.pageY - 55 + 'px')
|
|
166
|
-
.style('display', 'inline-block')
|
|
167
|
-
.html(this.getBarTipData(data, valueFormat, keyFormat));
|
|
168
|
-
}
|
|
169
|
-
hideTooltip() {
|
|
170
|
-
this.tooltip.style('display', 'none');
|
|
171
|
-
}
|
|
172
|
-
getBarTipData(data, valueFormat, keyFormat) {
|
|
173
|
-
let value = data.value;
|
|
174
|
-
let key = data.key;
|
|
175
|
-
if (valueFormat) {
|
|
176
|
-
switch (valueFormat) {
|
|
177
|
-
case PcacFormatEnum.Percentage:
|
|
178
|
-
value = value * 100 + '%';
|
|
179
|
-
break;
|
|
180
|
-
case PcacFormatEnum.Fahrenheit:
|
|
181
|
-
value = `${value} F`;
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
if (key && keyFormat) {
|
|
186
|
-
switch (keyFormat) {
|
|
187
|
-
case PcacFormatEnum.DateTime:
|
|
188
|
-
key = new Date(key).toLocaleDateString('en-US', {
|
|
189
|
-
day: '2-digit',
|
|
190
|
-
month: '2-digit',
|
|
191
|
-
year: 'numeric',
|
|
192
|
-
hour: '2-digit',
|
|
193
|
-
minute: '2-digit',
|
|
194
|
-
second: '2-digit'
|
|
195
|
-
});
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
let finalValue = value ? value.toString() : null;
|
|
200
|
-
return key ? key + '</br>' + finalValue : finalValue;
|
|
201
|
-
}
|
|
202
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: PcacTooltipBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
203
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: PcacTooltipBuilder, providedIn: 'root' }); }
|
|
130
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacGridBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
131
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacGridBuilder, providedIn: 'root' }); }
|
|
204
132
|
}
|
|
205
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacGridBuilder, decorators: [{
|
|
206
134
|
type: Injectable,
|
|
207
135
|
args: [{
|
|
208
136
|
providedIn: 'root',
|
|
@@ -271,10 +199,82 @@ class PcacColorService {
|
|
|
271
199
|
setAlert() {
|
|
272
200
|
return this.alert;
|
|
273
201
|
}
|
|
274
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
275
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
202
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacColorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
203
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacColorService, providedIn: 'root' }); }
|
|
204
|
+
}
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacColorService, decorators: [{
|
|
206
|
+
type: Injectable,
|
|
207
|
+
args: [{
|
|
208
|
+
providedIn: 'root',
|
|
209
|
+
}]
|
|
210
|
+
}] });
|
|
211
|
+
|
|
212
|
+
class PcacTransitionService {
|
|
213
|
+
constructor() {
|
|
214
|
+
this.transitionDuration = 750;
|
|
215
|
+
}
|
|
216
|
+
getTransitionDuration() {
|
|
217
|
+
return this.transitionDuration;
|
|
218
|
+
}
|
|
219
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacTransitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
220
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacTransitionService, providedIn: 'root' }); }
|
|
221
|
+
}
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacTransitionService, decorators: [{
|
|
223
|
+
type: Injectable,
|
|
224
|
+
args: [{
|
|
225
|
+
providedIn: 'root',
|
|
226
|
+
}]
|
|
227
|
+
}] });
|
|
228
|
+
|
|
229
|
+
class PcacTooltipBuilder {
|
|
230
|
+
constructor() {
|
|
231
|
+
this.tooltip = select('body')
|
|
232
|
+
.append('div')
|
|
233
|
+
.attr('class', 'pcac-d3-tooltip'); // TODO: Strongly type
|
|
234
|
+
}
|
|
235
|
+
showBarTooltip(event, data, valueFormat, keyFormat) {
|
|
236
|
+
this.tooltip.style('left', event.pageX - 60 + 'px')
|
|
237
|
+
.style('top', event.pageY - 55 + 'px')
|
|
238
|
+
.style('display', 'inline-block')
|
|
239
|
+
.html(this.getBarTipData(data, valueFormat, keyFormat));
|
|
240
|
+
}
|
|
241
|
+
hideTooltip() {
|
|
242
|
+
this.tooltip.style('display', 'none');
|
|
243
|
+
}
|
|
244
|
+
getBarTipData(data, valueFormat, keyFormat) {
|
|
245
|
+
let value = data.value;
|
|
246
|
+
let key = data.key;
|
|
247
|
+
if (valueFormat) {
|
|
248
|
+
switch (valueFormat) {
|
|
249
|
+
case PcacFormatEnum.Percentage:
|
|
250
|
+
value = value * 100 + '%';
|
|
251
|
+
break;
|
|
252
|
+
case PcacFormatEnum.Fahrenheit:
|
|
253
|
+
value = `${value} F`;
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (key && keyFormat) {
|
|
258
|
+
switch (keyFormat) {
|
|
259
|
+
case PcacFormatEnum.DateTime:
|
|
260
|
+
key = new Date(key).toLocaleDateString('en-US', {
|
|
261
|
+
day: '2-digit',
|
|
262
|
+
month: '2-digit',
|
|
263
|
+
year: 'numeric',
|
|
264
|
+
hour: '2-digit',
|
|
265
|
+
minute: '2-digit',
|
|
266
|
+
second: '2-digit'
|
|
267
|
+
});
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
let finalValue = value ? value.toString() : null;
|
|
272
|
+
return key ? key + '</br>' + finalValue : finalValue;
|
|
273
|
+
}
|
|
274
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacTooltipBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
275
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacTooltipBuilder, providedIn: 'root' }); }
|
|
276
276
|
}
|
|
277
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
277
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacTooltipBuilder, decorators: [{
|
|
278
278
|
type: Injectable,
|
|
279
279
|
args: [{
|
|
280
280
|
providedIn: 'root',
|
|
@@ -282,18 +282,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
282
282
|
}] });
|
|
283
283
|
|
|
284
284
|
class PcacChart {
|
|
285
|
-
constructor(
|
|
286
|
-
this.axisBuilder =
|
|
287
|
-
this.gridBuilder =
|
|
288
|
-
this.transitionService =
|
|
289
|
-
this.tooltipBuilder =
|
|
290
|
-
this.colorService =
|
|
285
|
+
constructor() {
|
|
286
|
+
this.axisBuilder = inject(PcacAxisBuilder);
|
|
287
|
+
this.gridBuilder = inject(PcacGridBuilder);
|
|
288
|
+
this.transitionService = inject(PcacTransitionService);
|
|
289
|
+
this.tooltipBuilder = inject(PcacTooltipBuilder);
|
|
290
|
+
this.colorService = inject(PcacColorService);
|
|
291
291
|
this.margin = { top: 8, right: 16, bottom: 20, left: 40 };
|
|
292
292
|
this.width = 400;
|
|
293
293
|
this.height = 400;
|
|
294
294
|
this.colors = [];
|
|
295
295
|
this.startData = []; // TODO: Strongly type
|
|
296
|
-
this.endData = [];
|
|
296
|
+
this.endData = [];
|
|
297
297
|
}
|
|
298
298
|
/**
|
|
299
299
|
* Prior to building a chart, we need to initialize the state of the chart
|
|
@@ -352,15 +352,15 @@ class PcacChart {
|
|
|
352
352
|
this.margin.bottom = this.margin.bottom;
|
|
353
353
|
this.width = this.width - this.margin.left;
|
|
354
354
|
}
|
|
355
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
356
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
355
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacChart, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
356
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacChart, providedIn: 'root' }); }
|
|
357
357
|
}
|
|
358
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
358
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacChart, decorators: [{
|
|
359
359
|
type: Injectable,
|
|
360
360
|
args: [{
|
|
361
361
|
providedIn: 'root',
|
|
362
362
|
}]
|
|
363
|
-
}]
|
|
363
|
+
}] });
|
|
364
364
|
|
|
365
365
|
class LineAreaChartEffectsBuilder {
|
|
366
366
|
constructor() {
|
|
@@ -476,10 +476,10 @@ class LineAreaChartEffectsBuilder {
|
|
|
476
476
|
return 'translate(' + mousePos[0] + ',' + pos.y + ')';
|
|
477
477
|
});
|
|
478
478
|
}
|
|
479
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
480
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
479
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: LineAreaChartEffectsBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
480
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: LineAreaChartEffectsBuilder, providedIn: 'root' }); }
|
|
481
481
|
}
|
|
482
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
482
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: LineAreaChartEffectsBuilder, decorators: [{
|
|
483
483
|
type: Injectable,
|
|
484
484
|
args: [{
|
|
485
485
|
providedIn: 'root',
|
|
@@ -487,13 +487,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
|
|
|
487
487
|
}] });
|
|
488
488
|
|
|
489
489
|
class LineAreaChartBuilder extends PcacChart {
|
|
490
|
-
constructor(
|
|
491
|
-
super(
|
|
492
|
-
this.axisBuilder = axisBuilder;
|
|
493
|
-
this.gridBuilder = gridBuilder;
|
|
494
|
-
this.transitionService = transitionService;
|
|
495
|
-
this.tooltipBuilder = tooltipBuilder;
|
|
496
|
-
this.colorService = colorService;
|
|
490
|
+
constructor() {
|
|
491
|
+
super(...arguments);
|
|
497
492
|
this.dotClickedSource = new Subject();
|
|
498
493
|
this.dotClicked$ = this.dotClickedSource.asObservable();
|
|
499
494
|
}
|
|
@@ -686,20 +681,22 @@ class LineAreaChartBuilder extends PcacChart {
|
|
|
686
681
|
return this.xScale(index);
|
|
687
682
|
}
|
|
688
683
|
}
|
|
689
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
690
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
684
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: LineAreaChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
685
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: LineAreaChartBuilder, providedIn: 'root' }); }
|
|
691
686
|
}
|
|
692
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
687
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: LineAreaChartBuilder, decorators: [{
|
|
693
688
|
type: Injectable,
|
|
694
689
|
args: [{
|
|
695
690
|
providedIn: 'root',
|
|
696
691
|
}]
|
|
697
|
-
}]
|
|
692
|
+
}] });
|
|
698
693
|
|
|
699
694
|
class PcacLineAreaChartComponent {
|
|
700
|
-
constructor(
|
|
701
|
-
this.chartBuilder =
|
|
702
|
-
this.
|
|
695
|
+
constructor() {
|
|
696
|
+
this.chartBuilder = inject(LineAreaChartBuilder);
|
|
697
|
+
this.config = input.required();
|
|
698
|
+
this.chartElm = viewChild.required('chart');
|
|
699
|
+
this.dotClicked = output();
|
|
703
700
|
this.chartBuilder.dotClicked$.subscribe(data => {
|
|
704
701
|
this.dotClicked.emit(data);
|
|
705
702
|
});
|
|
@@ -710,8 +707,9 @@ class PcacLineAreaChartComponent {
|
|
|
710
707
|
}
|
|
711
708
|
}
|
|
712
709
|
buildChart() {
|
|
713
|
-
|
|
714
|
-
|
|
710
|
+
const config = this.config();
|
|
711
|
+
if (config && config.data && config.data.length > 0) {
|
|
712
|
+
this.chartBuilder.buildChart(this.chartElm(), config);
|
|
715
713
|
}
|
|
716
714
|
}
|
|
717
715
|
/**
|
|
@@ -724,20 +722,13 @@ class PcacLineAreaChartComponent {
|
|
|
724
722
|
self.buildChart();
|
|
725
723
|
}, 300);
|
|
726
724
|
}
|
|
727
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
728
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
725
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacLineAreaChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
726
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0.4", 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 }); }
|
|
729
727
|
}
|
|
730
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
728
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacLineAreaChartComponent, decorators: [{
|
|
731
729
|
type: Component,
|
|
732
730
|
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"] }]
|
|
733
|
-
}], ctorParameters: () => [
|
|
734
|
-
type: Input
|
|
735
|
-
}], chartElm: [{
|
|
736
|
-
type: ViewChild,
|
|
737
|
-
args: ['chart', { static: true }]
|
|
738
|
-
}], dotClicked: [{
|
|
739
|
-
type: Output
|
|
740
|
-
}], onResize: [{
|
|
731
|
+
}], ctorParameters: () => [], propDecorators: { onResize: [{
|
|
741
732
|
type: HostListener,
|
|
742
733
|
args: ['window:resize']
|
|
743
734
|
}] } });
|
|
@@ -756,13 +747,8 @@ class PcacLineAreaChartConfig extends PcacChartConfig {
|
|
|
756
747
|
}
|
|
757
748
|
|
|
758
749
|
class PieChartBuilder extends PcacChart {
|
|
759
|
-
constructor(
|
|
760
|
-
super(
|
|
761
|
-
this.axisBuilder = axisBuilder;
|
|
762
|
-
this.gridBuilder = gridBuilder;
|
|
763
|
-
this.transitionService = transitionService;
|
|
764
|
-
this.tooltipBuilder = tooltipBuilder;
|
|
765
|
-
this.colorService = colorService;
|
|
750
|
+
constructor() {
|
|
751
|
+
super(...arguments);
|
|
766
752
|
this.sliceClickedSource = new Subject();
|
|
767
753
|
this.sliceClicked$ = this.sliceClickedSource.asObservable();
|
|
768
754
|
}
|
|
@@ -827,20 +813,22 @@ class PieChartBuilder extends PcacChart {
|
|
|
827
813
|
const i = interpolate({ startAngle: 0, endAngle: 0 }, b);
|
|
828
814
|
return (t) => this.arcShape(i(t)); // TODO: Strongly type
|
|
829
815
|
}
|
|
830
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
831
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
816
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PieChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
817
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PieChartBuilder, providedIn: 'root' }); }
|
|
832
818
|
}
|
|
833
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
819
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PieChartBuilder, decorators: [{
|
|
834
820
|
type: Injectable,
|
|
835
821
|
args: [{
|
|
836
822
|
providedIn: 'root',
|
|
837
823
|
}]
|
|
838
|
-
}]
|
|
824
|
+
}] });
|
|
839
825
|
|
|
840
826
|
class PcacPieChartComponent {
|
|
841
|
-
constructor(
|
|
842
|
-
this.chartBuilder =
|
|
843
|
-
this.
|
|
827
|
+
constructor() {
|
|
828
|
+
this.chartBuilder = inject(PieChartBuilder);
|
|
829
|
+
this.config = input.required();
|
|
830
|
+
this.chartElm = viewChild.required('chart');
|
|
831
|
+
this.sliceClicked = output();
|
|
844
832
|
this.chartBuilder.sliceClicked$.subscribe(data => {
|
|
845
833
|
this.sliceClicked.emit(data);
|
|
846
834
|
});
|
|
@@ -849,8 +837,9 @@ class PcacPieChartComponent {
|
|
|
849
837
|
this.buildChart();
|
|
850
838
|
}
|
|
851
839
|
buildChart() {
|
|
852
|
-
|
|
853
|
-
|
|
840
|
+
const config = this.config();
|
|
841
|
+
if (config && config.data && config.data.length > 0) {
|
|
842
|
+
this.chartBuilder.buildChart(this.chartElm(), config);
|
|
854
843
|
}
|
|
855
844
|
}
|
|
856
845
|
/**
|
|
@@ -863,20 +852,13 @@ class PcacPieChartComponent {
|
|
|
863
852
|
self.buildChart();
|
|
864
853
|
}, 300);
|
|
865
854
|
}
|
|
866
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
867
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
855
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacPieChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
856
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0.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 }); }
|
|
868
857
|
}
|
|
869
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
858
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacPieChartComponent, decorators: [{
|
|
870
859
|
type: Component,
|
|
871
860
|
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"] }]
|
|
872
|
-
}], ctorParameters: () => [
|
|
873
|
-
type: Input
|
|
874
|
-
}], chartElm: [{
|
|
875
|
-
type: ViewChild,
|
|
876
|
-
args: ['chart', { static: true }]
|
|
877
|
-
}], sliceClicked: [{
|
|
878
|
-
type: Output
|
|
879
|
-
}], onResize: [{
|
|
861
|
+
}], ctorParameters: () => [], propDecorators: { onResize: [{
|
|
880
862
|
type: HostListener,
|
|
881
863
|
args: ['window:resize']
|
|
882
864
|
}] } });
|
|
@@ -889,13 +871,8 @@ class PcacPieChartConfig extends PcacChartConfig {
|
|
|
889
871
|
}
|
|
890
872
|
|
|
891
873
|
class BarHorizontalChartBuilder extends PcacChart {
|
|
892
|
-
constructor(
|
|
893
|
-
super(
|
|
894
|
-
this.axisBuilder = axisBuilder;
|
|
895
|
-
this.gridBuilder = gridBuilder;
|
|
896
|
-
this.transitionService = transitionService;
|
|
897
|
-
this.tooltipBuilder = tooltipBuilder;
|
|
898
|
-
this.colorService = colorService;
|
|
874
|
+
constructor() {
|
|
875
|
+
super(...arguments);
|
|
899
876
|
this.barClickedSource = new Subject();
|
|
900
877
|
this.barClicked$ = this.barClickedSource.asObservable();
|
|
901
878
|
}
|
|
@@ -1136,20 +1113,22 @@ class BarHorizontalChartBuilder extends PcacChart {
|
|
|
1136
1113
|
this.tooltipBuilder.hideTooltip();
|
|
1137
1114
|
});
|
|
1138
1115
|
}
|
|
1139
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1140
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1116
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: BarHorizontalChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1117
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: BarHorizontalChartBuilder, providedIn: 'root' }); }
|
|
1141
1118
|
}
|
|
1142
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: BarHorizontalChartBuilder, decorators: [{
|
|
1143
1120
|
type: Injectable,
|
|
1144
1121
|
args: [{
|
|
1145
1122
|
providedIn: 'root',
|
|
1146
1123
|
}]
|
|
1147
|
-
}]
|
|
1124
|
+
}] });
|
|
1148
1125
|
|
|
1149
1126
|
class PcacBarHorizontalChartComponent {
|
|
1150
|
-
constructor(
|
|
1151
|
-
this.chartBuilder =
|
|
1152
|
-
this.
|
|
1127
|
+
constructor() {
|
|
1128
|
+
this.chartBuilder = inject(BarHorizontalChartBuilder);
|
|
1129
|
+
this.config = input.required();
|
|
1130
|
+
this.chartElm = viewChild.required('chart');
|
|
1131
|
+
this.barClicked = output();
|
|
1153
1132
|
this.chartBuilder.barClicked$.subscribe(data => {
|
|
1154
1133
|
this.barClicked.emit(data);
|
|
1155
1134
|
});
|
|
@@ -1158,8 +1137,9 @@ class PcacBarHorizontalChartComponent {
|
|
|
1158
1137
|
this.buildChart();
|
|
1159
1138
|
}
|
|
1160
1139
|
buildChart() {
|
|
1161
|
-
|
|
1162
|
-
|
|
1140
|
+
const config = this.config();
|
|
1141
|
+
if (config && config.data && config.data.length > 0) {
|
|
1142
|
+
this.chartBuilder.buildChart(this.chartElm(), config);
|
|
1163
1143
|
}
|
|
1164
1144
|
}
|
|
1165
1145
|
/**
|
|
@@ -1172,20 +1152,13 @@ class PcacBarHorizontalChartComponent {
|
|
|
1172
1152
|
self.buildChart();
|
|
1173
1153
|
}, 300);
|
|
1174
1154
|
}
|
|
1175
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1176
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1155
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacBarHorizontalChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1156
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0.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 }); }
|
|
1177
1157
|
}
|
|
1178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacBarHorizontalChartComponent, decorators: [{
|
|
1179
1159
|
type: Component,
|
|
1180
1160
|
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"] }]
|
|
1181
|
-
}], ctorParameters: () => [
|
|
1182
|
-
type: Input
|
|
1183
|
-
}], chartElm: [{
|
|
1184
|
-
type: ViewChild,
|
|
1185
|
-
args: ['chart', { static: true }]
|
|
1186
|
-
}], barClicked: [{
|
|
1187
|
-
type: Output
|
|
1188
|
-
}], onResize: [{
|
|
1161
|
+
}], ctorParameters: () => [], propDecorators: { onResize: [{
|
|
1189
1162
|
type: HostListener,
|
|
1190
1163
|
args: ['window:resize']
|
|
1191
1164
|
}] } });
|
|
@@ -1211,13 +1184,8 @@ class PcacBarHorizontalChartColorOverrideConfig {
|
|
|
1211
1184
|
}
|
|
1212
1185
|
|
|
1213
1186
|
class BarVerticalChartBuilder extends PcacChart {
|
|
1214
|
-
constructor(
|
|
1215
|
-
super(
|
|
1216
|
-
this.axisBuilder = axisBuilder;
|
|
1217
|
-
this.gridBuilder = gridBuilder;
|
|
1218
|
-
this.transitionService = transitionService;
|
|
1219
|
-
this.tooltipBuilder = tooltipBuilder;
|
|
1220
|
-
this.colorService = colorService;
|
|
1187
|
+
constructor() {
|
|
1188
|
+
super(...arguments);
|
|
1221
1189
|
this.barClickedSource = new Subject();
|
|
1222
1190
|
this.barClicked$ = this.barClickedSource.asObservable();
|
|
1223
1191
|
}
|
|
@@ -1470,20 +1438,22 @@ class BarVerticalChartBuilder extends PcacChart {
|
|
|
1470
1438
|
return '3px';
|
|
1471
1439
|
});
|
|
1472
1440
|
}
|
|
1473
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1474
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1441
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: BarVerticalChartBuilder, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1442
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: BarVerticalChartBuilder, providedIn: 'root' }); }
|
|
1475
1443
|
}
|
|
1476
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: BarVerticalChartBuilder, decorators: [{
|
|
1477
1445
|
type: Injectable,
|
|
1478
1446
|
args: [{
|
|
1479
1447
|
providedIn: 'root',
|
|
1480
1448
|
}]
|
|
1481
|
-
}]
|
|
1449
|
+
}] });
|
|
1482
1450
|
|
|
1483
1451
|
class PcacBarVerticalChartComponent {
|
|
1484
|
-
constructor(
|
|
1485
|
-
this.chartBuilder =
|
|
1486
|
-
this.
|
|
1452
|
+
constructor() {
|
|
1453
|
+
this.chartBuilder = inject(BarVerticalChartBuilder);
|
|
1454
|
+
this.config = input.required();
|
|
1455
|
+
this.chartElm = viewChild.required('chart');
|
|
1456
|
+
this.barClicked = output();
|
|
1487
1457
|
this.chartBuilder.barClicked$.subscribe(data => {
|
|
1488
1458
|
this.barClicked.emit(data);
|
|
1489
1459
|
});
|
|
@@ -1492,8 +1462,9 @@ class PcacBarVerticalChartComponent {
|
|
|
1492
1462
|
this.buildChart();
|
|
1493
1463
|
}
|
|
1494
1464
|
buildChart() {
|
|
1495
|
-
|
|
1496
|
-
|
|
1465
|
+
const config = this.config();
|
|
1466
|
+
if (config && config.data && config.data.length > 0) {
|
|
1467
|
+
this.chartBuilder.buildChart(this.chartElm(), config);
|
|
1497
1468
|
}
|
|
1498
1469
|
}
|
|
1499
1470
|
/**
|
|
@@ -1506,20 +1477,13 @@ class PcacBarVerticalChartComponent {
|
|
|
1506
1477
|
self.buildChart();
|
|
1507
1478
|
}, 300);
|
|
1508
1479
|
}
|
|
1509
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1510
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1480
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacBarVerticalChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1481
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0.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 }); }
|
|
1511
1482
|
}
|
|
1512
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1483
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: PcacBarVerticalChartComponent, decorators: [{
|
|
1513
1484
|
type: Component,
|
|
1514
1485
|
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"] }]
|
|
1515
|
-
}], ctorParameters: () => [
|
|
1516
|
-
type: Input
|
|
1517
|
-
}], chartElm: [{
|
|
1518
|
-
type: ViewChild,
|
|
1519
|
-
args: ['chart', { static: true }]
|
|
1520
|
-
}], barClicked: [{
|
|
1521
|
-
type: Output
|
|
1522
|
-
}], onResize: [{
|
|
1486
|
+
}], ctorParameters: () => [], propDecorators: { onResize: [{
|
|
1523
1487
|
type: HostListener,
|
|
1524
1488
|
args: ['window:resize']
|
|
1525
1489
|
}] } });
|