@codeauradev/ngx-wind-charts 0.0.0-stage → 1.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.
@@ -0,0 +1,3902 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, afterNextRender, computed, effect, inject, input, signal } from "@angular/core";
3
+ function resolveFormat(format, currency = "USD") {
4
+ if (typeof format === "function") return format;
5
+ const number = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 });
6
+ if (format === "compact") {
7
+ const compact = new Intl.NumberFormat(void 0, {
8
+ notation: "compact",
9
+ maximumFractionDigits: 1
10
+ });
11
+ return (value) => compact.format(value);
12
+ }
13
+ if (format === "percent") return (value) => `${number.format(value)}%`;
14
+ if (format === "currency") {
15
+ const money = new Intl.NumberFormat(void 0, {
16
+ style: "currency",
17
+ currency,
18
+ maximumFractionDigits: 0
19
+ });
20
+ return (value) => money.format(value);
21
+ }
22
+ return (value) => number.format(value);
23
+ }
24
+ function percentLabel(part, total) {
25
+ if (total <= 0) return "0%";
26
+ return `${Math.round(part / total * 1e3) / 10}%`;
27
+ }
28
+ const DEFAULT_PALETTE = [
29
+ "var(--ngx-1)",
30
+ "var(--ngx-2)",
31
+ "var(--ngx-3)",
32
+ "var(--ngx-4)",
33
+ "var(--ngx-5)"
34
+ ];
35
+ function num(value) {
36
+ return Number.isFinite(value) ? value : 0;
37
+ }
38
+ function clamp(value, min, max) {
39
+ return Math.min(max, Math.max(min, value));
40
+ }
41
+ function round(value) {
42
+ return Math.round(value * 100) / 100;
43
+ }
44
+ function ellipsize(label, max = 16) {
45
+ if (label.length <= max) return label;
46
+ return `${label.slice(0, max - 1)}…`;
47
+ }
48
+ function seriesColor(explicit, index, palette) {
49
+ if (explicit) return explicit;
50
+ const source = palette.length > 0 ? palette : DEFAULT_PALETTE;
51
+ return source[index % source.length] ?? DEFAULT_PALETTE[0];
52
+ }
53
+ function niceNum(range, roundToStep) {
54
+ const abs = Math.abs(range);
55
+ if (!Number.isFinite(abs) || abs === 0) return 1;
56
+ const exp = Math.floor(Math.log10(abs));
57
+ const frac = abs / 10 ** exp;
58
+ let nice;
59
+ if (roundToStep) {
60
+ if (frac < 1.5) nice = 1;
61
+ else if (frac < 3) nice = 2;
62
+ else if (frac < 7) nice = 5;
63
+ else nice = 10;
64
+ } else if (frac <= 1) nice = 1;
65
+ else if (frac <= 2) nice = 2;
66
+ else if (frac <= 5) nice = 5;
67
+ else nice = 10;
68
+ return nice * 10 ** exp;
69
+ }
70
+ function niceTicks(min, max, count = 4) {
71
+ if (!Number.isFinite(min) || !Number.isFinite(max)) return [0, 1];
72
+ if (min > max) {
73
+ const swap = min;
74
+ min = max;
75
+ max = swap;
76
+ }
77
+ if (min === max) {
78
+ const pad = Math.abs(min) || 1;
79
+ min -= pad / 2;
80
+ max += pad / 2;
81
+ }
82
+ const step = niceNum((max - min) / Math.max(count, 1), true);
83
+ const start = Math.floor(min / step) * step;
84
+ const end = Math.ceil(max / step) * step;
85
+ const ticks = [];
86
+ const steps = Math.round((end - start) / step);
87
+ const guard = Math.min(Math.max(steps, 0), count + 8);
88
+ for (let i = 0; i <= guard; i += 1) ticks.push(Number((start + i * step).toPrecision(12)));
89
+ if (ticks.length < 2) return [min, max];
90
+ return ticks;
91
+ }
92
+ function pointOnCircle(cx, cy, radius, radians) {
93
+ return [cx + Math.cos(radians) * radius, cy + Math.sin(radians) * radius];
94
+ }
95
+ function mathPoint(cx, cy, radius, degrees) {
96
+ const radians = degrees * Math.PI / 180;
97
+ return [cx + Math.cos(radians) * radius, cy - Math.sin(radians) * radius];
98
+ }
99
+ function arcPath(cx, cy, radius, startDeg, endDeg) {
100
+ const [x0, y0] = mathPoint(cx, cy, radius, startDeg);
101
+ const [x1, y1] = mathPoint(cx, cy, radius, endDeg);
102
+ let delta = startDeg - endDeg;
103
+ delta = (delta % 360 + 360) % 360;
104
+ if (delta === 0) return "";
105
+ const large = delta > 180 ? 1 : 0;
106
+ return `M ${round(x0)} ${round(y0)} A ${round(radius)} ${round(radius)} 0 ${large} 1 ${round(x1)} ${round(y1)}`;
107
+ }
108
+ function donutSlicePath(cx, cy, outer, inner, start, end) {
109
+ const sweep = end - start;
110
+ if (sweep <= 1e-4) return "";
111
+ if (sweep >= Math.PI * 2 - 1e-4) {
112
+ const mid = start + Math.PI;
113
+ return `${donutSlicePath(cx, cy, outer, inner, start, mid)} ${donutSlicePath(cx, cy, outer, inner, mid, start + Math.PI * 2 - 1e-4)}`;
114
+ }
115
+ const large = sweep > Math.PI ? 1 : 0;
116
+ const [x0, y0] = pointOnCircle(cx, cy, outer, start);
117
+ const [x1, y1] = pointOnCircle(cx, cy, outer, end);
118
+ if (inner <= 0) return `M ${round(cx)} ${round(cy)} L ${round(x0)} ${round(y0)} A ${round(outer)} ${round(outer)} 0 ${large} 1 ${round(x1)} ${round(y1)} Z`;
119
+ const [ix0, iy0] = pointOnCircle(cx, cy, inner, end);
120
+ const [ix1, iy1] = pointOnCircle(cx, cy, inner, start);
121
+ return `M ${round(x0)} ${round(y0)} A ${round(outer)} ${round(outer)} 0 ${large} 1 ${round(x1)} ${round(y1)} L ${round(ix0)} ${round(iy0)} A ${round(inner)} ${round(inner)} 0 ${large} 0 ${round(ix1)} ${round(iy1)} Z`;
122
+ }
123
+ function domainOf(values, includeZero, maxPin) {
124
+ const finite = values.filter((value) => Number.isFinite(value));
125
+ if (finite.length === 0) return {
126
+ min: 0,
127
+ max: 1,
128
+ ticks: [0, 1]
129
+ };
130
+ let min = Math.min(...finite);
131
+ let max = Math.max(...finite);
132
+ if (includeZero) {
133
+ min = Math.min(0, min);
134
+ max = Math.max(0, max);
135
+ }
136
+ if (maxPin !== void 0 && Number.isFinite(maxPin)) max = Math.max(max, maxPin);
137
+ if (min === max) {
138
+ const pad = Math.abs(min) || 1;
139
+ min -= includeZero ? 0 : pad * .5;
140
+ max += pad * .5;
141
+ if (includeZero) min = Math.min(0, min);
142
+ } else if (!includeZero) {
143
+ const pad = (max - min) * .08;
144
+ min -= pad;
145
+ max += pad;
146
+ }
147
+ const ticks = niceTicks(min, max, 4);
148
+ return {
149
+ min: ticks[0] ?? min,
150
+ max: ticks[ticks.length - 1] ?? max,
151
+ ticks
152
+ };
153
+ }
154
+ function scale(domainMin, domainMax, rangeMin, rangeMax) {
155
+ const span = domainMax - domainMin || 1;
156
+ return (value) => rangeMin + (value - domainMin) / span * (rangeMax - rangeMin);
157
+ }
158
+ function box(width, height, pad) {
159
+ return {
160
+ left: pad.left,
161
+ right: width - pad.right,
162
+ top: pad.top,
163
+ bottom: height - pad.bottom,
164
+ width: Math.max(1, width - pad.left - pad.right),
165
+ height: Math.max(1, height - pad.top - pad.bottom)
166
+ };
167
+ }
168
+ function yTicks(values, format, plot) {
169
+ const y = scale(values[0] ?? 0, values[values.length - 1] ?? 1, plot.bottom, plot.top);
170
+ return values.map((value) => {
171
+ const py = round(y(value));
172
+ return {
173
+ x1: plot.left,
174
+ y1: py,
175
+ x2: plot.right,
176
+ y2: py,
177
+ label: format(value),
178
+ labelX: plot.left - 8,
179
+ labelY: py,
180
+ anchor: "end"
181
+ };
182
+ });
183
+ }
184
+ function xValueTicks(values, format, plot) {
185
+ const x = scale(values[0] ?? 0, values[values.length - 1] ?? 1, plot.left, plot.right);
186
+ return values.map((value) => {
187
+ const px = round(x(value));
188
+ return {
189
+ x1: px,
190
+ y1: plot.top,
191
+ x2: px,
192
+ y2: plot.bottom,
193
+ label: format(value),
194
+ labelX: px,
195
+ labelY: plot.bottom + 16,
196
+ anchor: "middle"
197
+ };
198
+ });
199
+ }
200
+ function legendOf(series, palette) {
201
+ return series.map((item, index) => ({
202
+ name: item.name,
203
+ color: seriesColor(item.color, index, palette)
204
+ }));
205
+ }
206
+ function labelStep(count, space, estimate = 56) {
207
+ const fit = Math.max(1, Math.floor(space / estimate));
208
+ return Math.max(1, Math.ceil(count / Math.max(fit, 1)));
209
+ }
210
+ function layoutBars(input) {
211
+ const palette = input.palette ?? DEFAULT_PALETTE;
212
+ const categories = input.categories;
213
+ const series = input.series;
214
+ const values = series.reduce((all, item) => all.concat(item.data), []);
215
+ const empty = categories.length === 0 || series.length === 0;
216
+ const domain = domainOf(values, true, input.max);
217
+ const longest = domain.ticks.reduce((max, tick) => Math.max(max, input.format(tick).length), 2);
218
+ const horizontal = input.orientation === "horizontal";
219
+ const categoryEstimate = categories.reduce((max, label) => Math.max(max, label.length), 0);
220
+ const pad = horizontal ? {
221
+ top: 12,
222
+ right: 16,
223
+ bottom: 28,
224
+ left: Math.min(132, Math.max(48, categoryEstimate * 7 + 16))
225
+ } : {
226
+ top: 12,
227
+ right: 12,
228
+ bottom: 28,
229
+ left: Math.min(96, Math.max(40, longest * 7 + 14))
230
+ };
231
+ const width = Math.max(input.width, pad.left + pad.right + 40);
232
+ const height = Math.max(input.height, pad.top + pad.bottom + 40);
233
+ const plot = box(width, height, pad);
234
+ const legend = series.length > 1 || series.some((item) => item.name !== "Value") ? legendOf(series, palette) : legendOf(series, palette);
235
+ if (empty) return {
236
+ empty: true,
237
+ width,
238
+ height,
239
+ marks: [],
240
+ ticks: [],
241
+ categories: [],
242
+ zero: null,
243
+ legend: []
244
+ };
245
+ const marks = [];
246
+ const mode = input.mode;
247
+ const showValues = input.showValues ?? false;
248
+ if (!horizontal) {
249
+ const y = scale(domain.min, domain.max, plot.bottom, plot.top);
250
+ const band = plot.width / categories.length;
251
+ const step = labelStep(categories.length, plot.width);
252
+ const categoryLabels = categories.map((label, index) => ({
253
+ label: ellipsize(label),
254
+ x: round(plot.left + band * index + band / 2),
255
+ y: plot.bottom + 16,
256
+ anchor: "middle"
257
+ })).filter((_, index) => index % step === 0);
258
+ const zeroY = round(y(0));
259
+ categories.forEach((category, categoryIndex) => {
260
+ const inset = band * .18;
261
+ const inner = Math.max(1, band - inset * 2);
262
+ if (mode === "stacked") {
263
+ let positive = 0;
264
+ let negative = 0;
265
+ series.forEach((item, seriesIndex) => {
266
+ const value = num(item.data[categoryIndex] ?? 0);
267
+ const start = value >= 0 ? positive : negative;
268
+ const end = start + value;
269
+ if (value >= 0) positive = end;
270
+ else negative = end;
271
+ const y0 = y(start);
272
+ const y1 = y(end);
273
+ const top = Math.min(y0, y1);
274
+ const barHeight = Math.max(Math.abs(y1 - y0), value === 0 ? 0 : 1);
275
+ const x = plot.left + band * categoryIndex + inset;
276
+ const color = input.pointColors?.[categoryIndex] || seriesColor(item.color, seriesIndex, palette);
277
+ marks.push(barMark(category, item.name, value, input.format, color, x, top, inner, barHeight, showValues, `${categoryIndex}-${seriesIndex}`));
278
+ });
279
+ } else {
280
+ const gap = series.length > 1 ? Math.min(4, inner * .08) : 0;
281
+ const barWidth = Math.max(1, (inner - gap * (series.length - 1)) / series.length);
282
+ series.forEach((item, seriesIndex) => {
283
+ const value = num(item.data[categoryIndex] ?? 0);
284
+ const y0 = y(0);
285
+ const y1 = y(value);
286
+ const top = Math.min(y0, y1);
287
+ const barHeight = Math.max(Math.abs(y1 - y0), value === 0 ? 0 : 1);
288
+ const x = plot.left + band * categoryIndex + inset + seriesIndex * (barWidth + gap);
289
+ const color = (series.length === 1 ? input.pointColors?.[categoryIndex] : void 0) || seriesColor(item.color, seriesIndex, palette);
290
+ marks.push(barMark(category, item.name, value, input.format, color, x, top, barWidth, barHeight, showValues, `${categoryIndex}-${seriesIndex}`));
291
+ });
292
+ }
293
+ });
294
+ return {
295
+ empty: false,
296
+ width,
297
+ height,
298
+ marks,
299
+ ticks: yTicks(domain.ticks, input.format, plot),
300
+ categories: categoryLabels,
301
+ zero: domain.min < 0 && domain.max > 0 ? {
302
+ x1: plot.left,
303
+ y1: zeroY,
304
+ x2: plot.right,
305
+ y2: zeroY
306
+ } : null,
307
+ legend
308
+ };
309
+ }
310
+ const x = scale(domain.min, domain.max, plot.left, plot.right);
311
+ const band = plot.height / categories.length;
312
+ const categoryLabels = categories.map((label, index) => ({
313
+ label: ellipsize(label, 18),
314
+ x: plot.left - 8,
315
+ y: round(plot.top + band * index + band / 2),
316
+ anchor: "end"
317
+ }));
318
+ const zeroX = round(x(0));
319
+ categories.forEach((category, categoryIndex) => {
320
+ const inset = band * .2;
321
+ const inner = Math.max(1, band - inset * 2);
322
+ if (mode === "stacked") {
323
+ let positive = 0;
324
+ let negative = 0;
325
+ series.forEach((item, seriesIndex) => {
326
+ const value = num(item.data[categoryIndex] ?? 0);
327
+ const start = value >= 0 ? positive : negative;
328
+ const end = start + value;
329
+ if (value >= 0) positive = end;
330
+ else negative = end;
331
+ const x0 = x(start);
332
+ const x1 = x(end);
333
+ const left = Math.min(x0, x1);
334
+ const barWidth = Math.max(Math.abs(x1 - x0), value === 0 ? 0 : 1);
335
+ const y = plot.top + band * categoryIndex + inset;
336
+ const color = input.pointColors?.[categoryIndex] || seriesColor(item.color, seriesIndex, palette);
337
+ marks.push(barMark(category, item.name, value, input.format, color, left, y, barWidth, inner, showValues, `${categoryIndex}-${seriesIndex}`, true));
338
+ });
339
+ } else {
340
+ const gap = series.length > 1 ? Math.min(4, inner * .08) : 0;
341
+ const barHeight = Math.max(1, (inner - gap * (series.length - 1)) / series.length);
342
+ series.forEach((item, seriesIndex) => {
343
+ const value = num(item.data[categoryIndex] ?? 0);
344
+ const x0 = x(0);
345
+ const x1 = x(value);
346
+ const left = Math.min(x0, x1);
347
+ const barWidth = Math.max(Math.abs(x1 - x0), value === 0 ? 0 : 1);
348
+ const y = plot.top + band * categoryIndex + inset + seriesIndex * (barHeight + gap);
349
+ const color = (series.length === 1 ? input.pointColors?.[categoryIndex] : void 0) || seriesColor(item.color, seriesIndex, palette);
350
+ marks.push(barMark(category, item.name, value, input.format, color, left, y, barWidth, barHeight, showValues, `${categoryIndex}-${seriesIndex}`, true));
351
+ });
352
+ }
353
+ });
354
+ return {
355
+ empty: false,
356
+ width,
357
+ height,
358
+ marks,
359
+ ticks: xValueTicks(domain.ticks, input.format, plot),
360
+ categories: categoryLabels,
361
+ zero: domain.min < 0 && domain.max > 0 ? {
362
+ x1: zeroX,
363
+ y1: plot.top,
364
+ x2: zeroX,
365
+ y2: plot.bottom
366
+ } : null,
367
+ legend
368
+ };
369
+ }
370
+ function barMark(category, seriesName, value, format, color, x, y, width, height, showValues, key, horizontal = false) {
371
+ const formatted = format(value);
372
+ const showLabel = showValues && (horizontal ? width > 28 : height > 16);
373
+ return {
374
+ key,
375
+ x: round(x),
376
+ y: round(y),
377
+ width: round(Math.max(width, 0)),
378
+ height: round(Math.max(height, 0)),
379
+ color,
380
+ category,
381
+ series: seriesName,
382
+ value,
383
+ formatted,
384
+ labelX: round(horizontal ? x + width + 6 : x + width / 2),
385
+ labelY: round(horizontal ? y + height / 2 : y - 6),
386
+ showLabel
387
+ };
388
+ }
389
+ function layoutTrend(input) {
390
+ const palette = input.palette ?? DEFAULT_PALETTE;
391
+ const categories = input.categories;
392
+ const series = input.series;
393
+ const empty = categories.length === 0 || series.length === 0;
394
+ const stacked = input.stacked ?? false;
395
+ const domain = domainOf(stacked ? categories.map((_, index) => series.reduce((sum, item) => sum + num(item.data[index] ?? 0), 0)) : series.reduce((all, item) => all.concat(item.data.map(num)), []), stacked || Boolean(input.filled), void 0);
396
+ const longest = domain.ticks.reduce((max, tick) => Math.max(max, input.format(tick).length), 2);
397
+ const pad = {
398
+ top: 16,
399
+ right: 16,
400
+ bottom: 28,
401
+ left: Math.min(96, Math.max(40, longest * 7 + 14))
402
+ };
403
+ const width = Math.max(input.width, pad.left + pad.right + 40);
404
+ const height = Math.max(input.height, pad.top + pad.bottom + 40);
405
+ const plot = box(width, height, pad);
406
+ if (empty) return {
407
+ empty: true,
408
+ width,
409
+ height,
410
+ series: [],
411
+ ticks: [],
412
+ categories: [],
413
+ zero: null,
414
+ legend: []
415
+ };
416
+ const y = scale(domain.min, domain.max, plot.bottom, plot.top);
417
+ const xAt = (index) => {
418
+ if (categories.length === 1) return plot.left + plot.width / 2;
419
+ return plot.left + index / (categories.length - 1) * plot.width;
420
+ };
421
+ const step = labelStep(categories.length, plot.width, 48);
422
+ const categoryLabels = categories.map((label, index) => ({
423
+ label: ellipsize(label),
424
+ x: round(xAt(index)),
425
+ y: plot.bottom + 16,
426
+ anchor: "middle"
427
+ })).filter((_, index) => index % step === 0);
428
+ const baselines = categories.map(() => 0);
429
+ const layouts = series.map((item, seriesIndex) => {
430
+ const color = seriesColor(item.color, seriesIndex, palette);
431
+ const points = categories.map((category, index) => {
432
+ const value = num(item.data[index] ?? 0);
433
+ const base = stacked ? baselines[index] ?? 0 : 0;
434
+ const yValue = stacked ? base + value : value;
435
+ if (stacked) baselines[index] = yValue;
436
+ return {
437
+ key: `${seriesIndex}-${index}`,
438
+ x: round(xAt(index)),
439
+ y: round(y(yValue)),
440
+ value,
441
+ formatted: input.format(value),
442
+ category,
443
+ series: item.name,
444
+ color
445
+ };
446
+ });
447
+ const line = points.map((point, index) => `${index === 0 ? "M" : "L"} ${point.x} ${point.y}`).join(" ");
448
+ let area = null;
449
+ if (input.filled) {
450
+ if (!stacked) {
451
+ const baseline = round(y(domain.min < 0 && domain.max > 0 ? 0 : domain.min));
452
+ area = `${line} L ${points[points.length - 1]?.x ?? 0} ${baseline} L ${points[0]?.x ?? 0} ${baseline} Z`;
453
+ } else {
454
+ const previous = seriesIndex === 0 ? categories.map((_, index) => ({
455
+ x: round(xAt(index)),
456
+ y: round(y(0))
457
+ })) : null;
458
+ area = `${line} ${(previous ? [...previous].reverse() : categories.map((_, index) => {
459
+ const base = series.slice(0, seriesIndex).reduce((sum, entry) => sum + num(entry.data[index] ?? 0), 0);
460
+ return {
461
+ x: round(xAt(index)),
462
+ y: round(y(base))
463
+ };
464
+ }).reverse()).map((point) => `L ${point.x} ${point.y}`).join(" ")} Z`;
465
+ }
466
+ }
467
+ return {
468
+ name: item.name,
469
+ color,
470
+ line,
471
+ area,
472
+ points
473
+ };
474
+ });
475
+ const zeroY = round(y(0));
476
+ return {
477
+ empty: false,
478
+ width,
479
+ height,
480
+ series: layouts,
481
+ ticks: yTicks(domain.ticks, input.format, plot),
482
+ categories: categoryLabels,
483
+ zero: domain.min < 0 && domain.max > 0 ? {
484
+ x1: plot.left,
485
+ y1: zeroY,
486
+ x2: plot.right,
487
+ y2: zeroY
488
+ } : null,
489
+ legend: legendOf(series, palette)
490
+ };
491
+ }
492
+ function layoutPie(input) {
493
+ const palette = input.palette ?? DEFAULT_PALETTE;
494
+ const slicesIn = input.data.map((datum) => ({
495
+ ...datum,
496
+ value: Math.max(0, num(datum.value))
497
+ })).filter((datum) => datum.value > 0);
498
+ const width = Math.max(input.width, 80);
499
+ const height = Math.max(input.height, 80);
500
+ const total = slicesIn.reduce((sum, datum) => sum + datum.value, 0);
501
+ if (total <= 0) return {
502
+ empty: true,
503
+ width,
504
+ height,
505
+ slices: [],
506
+ total: 0,
507
+ legend: []
508
+ };
509
+ const size = Math.min(width, height);
510
+ const cx = width / 2;
511
+ const cy = height / 2;
512
+ const outer = size / 2 - 8;
513
+ const inner = input.donut ? outer * clamp(input.innerRatio ?? .62, .2, .85) : 0;
514
+ let angle = -Math.PI / 2;
515
+ const slices = slicesIn.map((datum, index) => {
516
+ const sweep = datum.value / total * Math.PI * 2;
517
+ const start = angle;
518
+ const end = angle + sweep;
519
+ angle = end;
520
+ const color = datum.color || seriesColor(void 0, index, palette);
521
+ return {
522
+ key: `${datum.label}-${index}`,
523
+ label: datum.label,
524
+ value: datum.value,
525
+ formatted: input.format(datum.value),
526
+ percent: percentLabel(datum.value, total),
527
+ color,
528
+ path: donutSlicePath(cx, cy, outer, inner, start, end - 1e-5)
529
+ };
530
+ });
531
+ return {
532
+ empty: false,
533
+ width,
534
+ height,
535
+ slices,
536
+ total,
537
+ legend: slices.map((slice) => ({
538
+ name: slice.label,
539
+ color: slice.color
540
+ }))
541
+ };
542
+ }
543
+ function layoutRadar(input) {
544
+ const palette = input.palette ?? DEFAULT_PALETTE;
545
+ const categories = input.categories;
546
+ const series = input.series;
547
+ const width = Math.max(input.width, 160);
548
+ const height = Math.max(input.height, 160);
549
+ if (categories.length < 3 || series.length === 0) return {
550
+ empty: true,
551
+ width,
552
+ height,
553
+ rings: [],
554
+ spokes: [],
555
+ axes: [],
556
+ series: [],
557
+ legend: []
558
+ };
559
+ const maxValue = Math.max(1, ...series.reduce((all, item) => all.concat(item.data.map((value) => Math.max(0, num(value)))), []));
560
+ const cx = width / 2;
561
+ const cy = height / 2 + 4;
562
+ const radius = Math.min(width, height) / 2 - 36;
563
+ const levels = 4;
564
+ return {
565
+ empty: false,
566
+ width,
567
+ height,
568
+ rings: Array.from({ length: levels }, (_, level) => {
569
+ const ringRadius = radius * ((level + 1) / levels);
570
+ return categories.map((_, index) => {
571
+ const angle = -Math.PI / 2 + index / categories.length * Math.PI * 2;
572
+ const [x, y] = pointOnCircle(cx, cy, ringRadius, angle);
573
+ return `${index === 0 ? "M" : "L"} ${round(x)} ${round(y)}`;
574
+ }).join(" ") + " Z";
575
+ }),
576
+ spokes: categories.map((_, index) => {
577
+ const angle = -Math.PI / 2 + index / categories.length * Math.PI * 2;
578
+ const [x, y] = pointOnCircle(cx, cy, radius, angle);
579
+ return {
580
+ x1: round(cx),
581
+ y1: round(cy),
582
+ x2: round(x),
583
+ y2: round(y)
584
+ };
585
+ }),
586
+ axes: categories.map((label, index) => {
587
+ const angle = -Math.PI / 2 + index / categories.length * Math.PI * 2;
588
+ const [x, y] = pointOnCircle(cx, cy, radius + 16, angle);
589
+ const anchor = x < cx - 8 ? "end" : x > cx + 8 ? "start" : "middle";
590
+ return {
591
+ label: ellipsize(label, 14),
592
+ x: round(x),
593
+ y: round(y),
594
+ anchor
595
+ };
596
+ }),
597
+ series: series.map((item, seriesIndex) => {
598
+ const color = seriesColor(item.color, seriesIndex, palette);
599
+ const points = categories.map((axis, index) => {
600
+ const value = Math.max(0, num(item.data[index] ?? 0));
601
+ const angle = -Math.PI / 2 + index / categories.length * Math.PI * 2;
602
+ const [x, y] = pointOnCircle(cx, cy, radius * (value / maxValue), angle);
603
+ return {
604
+ key: `${seriesIndex}-${index}`,
605
+ x: round(x),
606
+ y: round(y),
607
+ value,
608
+ formatted: input.format(value),
609
+ axis,
610
+ series: item.name,
611
+ color
612
+ };
613
+ });
614
+ const polygon = `${points.map((point, index) => `${index === 0 ? "M" : "L"} ${point.x} ${point.y}`).join(" ")} Z`;
615
+ return {
616
+ name: item.name,
617
+ color,
618
+ polygon,
619
+ points
620
+ };
621
+ }),
622
+ legend: legendOf(series, palette)
623
+ };
624
+ }
625
+ function layoutScatter(input) {
626
+ const palette = input.palette ?? DEFAULT_PALETTE;
627
+ const series = input.series.filter((item) => item.data.length > 0);
628
+ const width = Math.max(input.width, 160);
629
+ const height = Math.max(input.height, 160);
630
+ const pointsIn = series.reduce((all, item) => all.concat(item.data), []);
631
+ if (series.length === 0 || pointsIn.length === 0) return {
632
+ empty: true,
633
+ width,
634
+ height,
635
+ ticksX: [],
636
+ ticksY: [],
637
+ points: [],
638
+ legend: []
639
+ };
640
+ const xDomain = domainOf(pointsIn.map((point) => num(point.x)), false);
641
+ const yDomain = domainOf(pointsIn.map((point) => num(point.y)), false);
642
+ const longest = yDomain.ticks.reduce((max, tick) => Math.max(max, input.format(tick).length), 2);
643
+ const plot = box(width, height, {
644
+ top: 16,
645
+ right: 16,
646
+ bottom: 32,
647
+ left: Math.min(96, Math.max(40, longest * 7 + 14))
648
+ });
649
+ const x = scale(xDomain.min, xDomain.max, plot.left, plot.right);
650
+ const y = scale(yDomain.min, yDomain.max, plot.bottom, plot.top);
651
+ const points = series.reduce((all, item, seriesIndex) => {
652
+ const color = seriesColor(item.color, seriesIndex, palette);
653
+ return all.concat(item.data.map((point, index) => ({
654
+ key: `${seriesIndex}-${index}`,
655
+ cx: round(x(num(point.x))),
656
+ cy: round(y(num(point.y))),
657
+ color,
658
+ series: item.name,
659
+ label: point.label || item.name,
660
+ xValue: num(point.x),
661
+ yValue: num(point.y),
662
+ formattedX: input.format(num(point.x)),
663
+ formattedY: input.format(num(point.y))
664
+ })));
665
+ }, []);
666
+ return {
667
+ empty: false,
668
+ width,
669
+ height,
670
+ ticksX: xValueTicks(xDomain.ticks, input.format, plot),
671
+ ticksY: yTicks(yDomain.ticks, input.format, plot),
672
+ points,
673
+ legend: legendOf(series, palette)
674
+ };
675
+ }
676
+ function layoutGauge(input) {
677
+ const width = Math.max(input.width, 160);
678
+ const height = Math.max(input.height, 120);
679
+ const min = input.min ?? 0;
680
+ const max = input.max ?? 100;
681
+ const fraction = clamp((num(input.value) - min) / (max - min || 1), 0, 1);
682
+ const cx = width / 2;
683
+ const cy = height * .72;
684
+ const radius = Math.min(width * .38, height * .48);
685
+ const start = 210;
686
+ return {
687
+ empty: false,
688
+ width,
689
+ height,
690
+ track: arcPath(cx, cy, radius, start, -30),
691
+ valuePath: fraction <= 0 ? "" : arcPath(cx, cy, radius, start, start - 240 * fraction),
692
+ fraction,
693
+ labelX: round(cx),
694
+ labelY: round(cy + 4),
695
+ color: input.color || "var(--ngx-1)"
696
+ };
697
+ }
698
+ function layoutSparkline(input) {
699
+ const data = input.data.map(num);
700
+ const width = Math.max(input.width, 40);
701
+ const height = Math.max(input.height, 28);
702
+ const color = input.color || "var(--ngx-1)";
703
+ if (data.length === 0) return {
704
+ empty: true,
705
+ width,
706
+ height,
707
+ line: "",
708
+ area: "",
709
+ last: null,
710
+ color
711
+ };
712
+ const min = Math.min(...data);
713
+ const span = Math.max(...data) - min || 1;
714
+ const pad = 4;
715
+ const xAt = (index) => data.length === 1 ? width / 2 : pad + index / (data.length - 1) * (width - 8);
716
+ const yAt = (value) => pad + (1 - (value - min) / span) * (height - 8);
717
+ const coords = data.map((value, index) => ({
718
+ x: round(xAt(index)),
719
+ y: round(yAt(value)),
720
+ value
721
+ }));
722
+ const line = coords.map((point, index) => `${index === 0 ? "M" : "L"} ${point.x} ${point.y}`).join(" ");
723
+ const area = `${line} L ${coords[coords.length - 1]?.x ?? 0} ${round(height - 1)} L ${coords[0]?.x ?? 0} ${round(height - 1)} Z`;
724
+ const last = coords[coords.length - 1];
725
+ return {
726
+ empty: false,
727
+ width,
728
+ height,
729
+ line,
730
+ area,
731
+ last: last ? {
732
+ x: last.x,
733
+ y: last.y,
734
+ value: last.value,
735
+ formatted: input.format(last.value)
736
+ } : null,
737
+ color
738
+ };
739
+ }
740
+ function layoutHeatmap(input) {
741
+ const xLabels = input.xLabels;
742
+ const yLabels = input.yLabels;
743
+ const width = Math.max(input.width, 160);
744
+ const height = Math.max(input.height, 120);
745
+ const rows = yLabels.map((_, row) => xLabels.map((_, column) => num(input.data[row]?.[column] ?? 0)));
746
+ const flat = rows.reduce((all, row) => all.concat(row), []);
747
+ if (xLabels.length === 0 || yLabels.length === 0) return {
748
+ empty: true,
749
+ width,
750
+ height,
751
+ cells: [],
752
+ xLabels: [],
753
+ yLabels: [],
754
+ min: 0,
755
+ max: 0
756
+ };
757
+ const min = Math.min(...flat);
758
+ const max = Math.max(...flat);
759
+ const span = max - min || 1;
760
+ const yEstimate = yLabels.reduce((longest, label) => Math.max(longest, label.length), 0);
761
+ const plot = box(width, height, {
762
+ top: 8,
763
+ right: 8,
764
+ bottom: 28,
765
+ left: Math.min(120, Math.max(36, yEstimate * 7 + 12))
766
+ });
767
+ const gap = 3;
768
+ const cellW = Math.max(1, (plot.width - gap * (xLabels.length - 1)) / xLabels.length);
769
+ const cellH = Math.max(1, (plot.height - gap * (yLabels.length - 1)) / yLabels.length);
770
+ const cells = [];
771
+ yLabels.forEach((ylabel, row) => {
772
+ xLabels.forEach((xlabel, column) => {
773
+ const value = rows[row]?.[column] ?? 0;
774
+ cells.push({
775
+ key: `${row}-${column}`,
776
+ x: round(plot.left + column * (cellW + gap)),
777
+ y: round(plot.top + row * (cellH + gap)),
778
+ width: round(cellW),
779
+ height: round(cellH),
780
+ t: clamp((value - min) / span, 0, 1),
781
+ value,
782
+ formatted: input.format(value),
783
+ xlabel,
784
+ ylabel
785
+ });
786
+ });
787
+ });
788
+ return {
789
+ empty: false,
790
+ width,
791
+ height,
792
+ cells,
793
+ xLabels: xLabels.map((label, index) => ({
794
+ label: ellipsize(label, 8),
795
+ x: round(plot.left + index * (cellW + gap) + cellW / 2),
796
+ y: plot.bottom + 16,
797
+ anchor: "middle"
798
+ })),
799
+ yLabels: yLabels.map((label, index) => ({
800
+ label: ellipsize(label, 14),
801
+ x: plot.left - 8,
802
+ y: round(plot.top + index * (cellH + gap) + cellH / 2),
803
+ anchor: "end"
804
+ })),
805
+ min,
806
+ max
807
+ };
808
+ }
809
+ var NgxChartFrame = class NgxChartFrame {
810
+ title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
811
+ ariaLabel = input("Chart", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
812
+ legend = input([], ...ngDevMode ? [{ debugName: "legend" }] : /* istanbul ignore next */ []);
813
+ showLegend = input(false, ...ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []);
814
+ tooltip = input(null, ...ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []);
815
+ srHeaders = input([], ...ngDevMode ? [{ debugName: "srHeaders" }] : /* istanbul ignore next */ []);
816
+ srRows = input([], ...ngDevMode ? [{ debugName: "srRows" }] : /* istanbul ignore next */ []);
817
+ range = input(void 0, ...ngDevMode ? [{ debugName: "range" }] : /* istanbul ignore next */ []);
818
+ static ɵfac = i0.ɵɵngDeclareFactory({
819
+ minVersion: "12.0.0",
820
+ version: "22.2.3",
821
+ ngImport: i0,
822
+ type: NgxChartFrame,
823
+ deps: [],
824
+ target: i0.ɵɵFactoryTarget.Component
825
+ });
826
+ static ɵcmp = i0.ɵɵngDeclareComponent({
827
+ minVersion: "17.0.0",
828
+ version: "22.2.3",
829
+ type: NgxChartFrame,
830
+ isStandalone: true,
831
+ selector: "ngx-chart-frame",
832
+ inputs: {
833
+ title: {
834
+ classPropertyName: "title",
835
+ publicName: "title",
836
+ isSignal: true,
837
+ isRequired: false,
838
+ transformFunction: null
839
+ },
840
+ ariaLabel: {
841
+ classPropertyName: "ariaLabel",
842
+ publicName: "ariaLabel",
843
+ isSignal: true,
844
+ isRequired: false,
845
+ transformFunction: null
846
+ },
847
+ legend: {
848
+ classPropertyName: "legend",
849
+ publicName: "legend",
850
+ isSignal: true,
851
+ isRequired: false,
852
+ transformFunction: null
853
+ },
854
+ showLegend: {
855
+ classPropertyName: "showLegend",
856
+ publicName: "showLegend",
857
+ isSignal: true,
858
+ isRequired: false,
859
+ transformFunction: null
860
+ },
861
+ tooltip: {
862
+ classPropertyName: "tooltip",
863
+ publicName: "tooltip",
864
+ isSignal: true,
865
+ isRequired: false,
866
+ transformFunction: null
867
+ },
868
+ srHeaders: {
869
+ classPropertyName: "srHeaders",
870
+ publicName: "srHeaders",
871
+ isSignal: true,
872
+ isRequired: false,
873
+ transformFunction: null
874
+ },
875
+ srRows: {
876
+ classPropertyName: "srRows",
877
+ publicName: "srRows",
878
+ isSignal: true,
879
+ isRequired: false,
880
+ transformFunction: null
881
+ },
882
+ range: {
883
+ classPropertyName: "range",
884
+ publicName: "range",
885
+ isSignal: true,
886
+ isRequired: false,
887
+ transformFunction: null
888
+ }
889
+ },
890
+ ngImport: i0,
891
+ template: `
892
+ <figure class="ngx-charts ngx-wind-charts text-sm text-muted" [attr.aria-label]="ariaLabel()">
893
+ @if (title()) {
894
+ <div class="text-sm font-medium text-foreground">{{ title() }}</div>
895
+ }
896
+ <div class="ngx-plot relative w-full">
897
+ <ng-content />
898
+ @if (tooltip(); as tip) {
899
+ <div class="ngx-tip" [style.left.px]="tip.x" [style.top.px]="tip.y">
900
+ <div class="font-medium">{{ tip.title }}</div>
901
+ @for (row of tip.rows; track row.label) {
902
+ <div class="ngx-key mt-1">
903
+ <span class="ngx-swatch" [style.background]="row.swatch"></span>
904
+ <span>{{ row.label }}</span>
905
+ <span class="ml-auto pl-3 font-medium text-foreground">{{ row.value }}</span>
906
+ </div>
907
+ }
908
+ </div>
909
+ }
910
+ </div>
911
+ @if (showLegend() && legend().length > 0) {
912
+ <ul class="ngx-legend">
913
+ @for (item of legend(); track item.name) {
914
+ <li>
915
+ <span class="ngx-swatch" [style.background]="item.color"></span>
916
+ <span>{{ item.name }}</span>
917
+ </li>
918
+ }
919
+ </ul>
920
+ }
921
+ @if (range(); as scale) {
922
+ <div class="ngx-key text-xs">
923
+ <span>{{ scale.min }}</span>
924
+ <span class="ngx-heat-scale"></span>
925
+ <span>{{ scale.max }}</span>
926
+ </div>
927
+ }
928
+ <table class="ngx-sr">
929
+ <caption>{{ ariaLabel() }}</caption>
930
+ <thead>
931
+ <tr>
932
+ @for (header of srHeaders(); track header) {
933
+ <th>{{ header }}</th>
934
+ }
935
+ </tr>
936
+ </thead>
937
+ <tbody>
938
+ @for (row of srRows(); track $index) {
939
+ <tr>
940
+ @for (cell of row; track $index) {
941
+ <td>{{ cell }}</td>
942
+ }
943
+ </tr>
944
+ }
945
+ </tbody>
946
+ </table>
947
+ </figure>
948
+ `,
949
+ isInline: true,
950
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"],
951
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
952
+ });
953
+ };
954
+ i0.ɵɵngDeclareClassMetadata({
955
+ minVersion: "12.0.0",
956
+ version: "22.2.3",
957
+ ngImport: i0,
958
+ type: NgxChartFrame,
959
+ decorators: [{
960
+ type: Component,
961
+ args: [{
962
+ selector: "ngx-chart-frame",
963
+ changeDetection: ChangeDetectionStrategy.OnPush,
964
+ template: `
965
+ <figure class="ngx-charts ngx-wind-charts text-sm text-muted" [attr.aria-label]="ariaLabel()">
966
+ @if (title()) {
967
+ <div class="text-sm font-medium text-foreground">{{ title() }}</div>
968
+ }
969
+ <div class="ngx-plot relative w-full">
970
+ <ng-content />
971
+ @if (tooltip(); as tip) {
972
+ <div class="ngx-tip" [style.left.px]="tip.x" [style.top.px]="tip.y">
973
+ <div class="font-medium">{{ tip.title }}</div>
974
+ @for (row of tip.rows; track row.label) {
975
+ <div class="ngx-key mt-1">
976
+ <span class="ngx-swatch" [style.background]="row.swatch"></span>
977
+ <span>{{ row.label }}</span>
978
+ <span class="ml-auto pl-3 font-medium text-foreground">{{ row.value }}</span>
979
+ </div>
980
+ }
981
+ </div>
982
+ }
983
+ </div>
984
+ @if (showLegend() && legend().length > 0) {
985
+ <ul class="ngx-legend">
986
+ @for (item of legend(); track item.name) {
987
+ <li>
988
+ <span class="ngx-swatch" [style.background]="item.color"></span>
989
+ <span>{{ item.name }}</span>
990
+ </li>
991
+ }
992
+ </ul>
993
+ }
994
+ @if (range(); as scale) {
995
+ <div class="ngx-key text-xs">
996
+ <span>{{ scale.min }}</span>
997
+ <span class="ngx-heat-scale"></span>
998
+ <span>{{ scale.max }}</span>
999
+ </div>
1000
+ }
1001
+ <table class="ngx-sr">
1002
+ <caption>{{ ariaLabel() }}</caption>
1003
+ <thead>
1004
+ <tr>
1005
+ @for (header of srHeaders(); track header) {
1006
+ <th>{{ header }}</th>
1007
+ }
1008
+ </tr>
1009
+ </thead>
1010
+ <tbody>
1011
+ @for (row of srRows(); track $index) {
1012
+ <tr>
1013
+ @for (cell of row; track $index) {
1014
+ <td>{{ cell }}</td>
1015
+ }
1016
+ </tr>
1017
+ }
1018
+ </tbody>
1019
+ </table>
1020
+ </figure>
1021
+ `,
1022
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"]
1023
+ }]
1024
+ }],
1025
+ propDecorators: {
1026
+ title: [{
1027
+ type: i0.Input,
1028
+ args: [{
1029
+ isSignal: true,
1030
+ alias: "title",
1031
+ required: false
1032
+ }]
1033
+ }],
1034
+ ariaLabel: [{
1035
+ type: i0.Input,
1036
+ args: [{
1037
+ isSignal: true,
1038
+ alias: "ariaLabel",
1039
+ required: false
1040
+ }]
1041
+ }],
1042
+ legend: [{
1043
+ type: i0.Input,
1044
+ args: [{
1045
+ isSignal: true,
1046
+ alias: "legend",
1047
+ required: false
1048
+ }]
1049
+ }],
1050
+ showLegend: [{
1051
+ type: i0.Input,
1052
+ args: [{
1053
+ isSignal: true,
1054
+ alias: "showLegend",
1055
+ required: false
1056
+ }]
1057
+ }],
1058
+ tooltip: [{
1059
+ type: i0.Input,
1060
+ args: [{
1061
+ isSignal: true,
1062
+ alias: "tooltip",
1063
+ required: false
1064
+ }]
1065
+ }],
1066
+ srHeaders: [{
1067
+ type: i0.Input,
1068
+ args: [{
1069
+ isSignal: true,
1070
+ alias: "srHeaders",
1071
+ required: false
1072
+ }]
1073
+ }],
1074
+ srRows: [{
1075
+ type: i0.Input,
1076
+ args: [{
1077
+ isSignal: true,
1078
+ alias: "srRows",
1079
+ required: false
1080
+ }]
1081
+ }],
1082
+ range: [{
1083
+ type: i0.Input,
1084
+ args: [{
1085
+ isSignal: true,
1086
+ alias: "range",
1087
+ required: false
1088
+ }]
1089
+ }]
1090
+ }
1091
+ });
1092
+ function normalizeSeries(input) {
1093
+ if (input.series && input.series.length > 0) {
1094
+ const longest = input.series.reduce((max, series) => Math.max(max, series.data.length), 0);
1095
+ const categories = input.categories && input.categories.length > 0 ? input.categories : Array.from({ length: longest }, (_, index) => String(index + 1));
1096
+ return {
1097
+ categories,
1098
+ series: input.series.map((series) => ({
1099
+ name: series.name || "Series",
1100
+ color: series.color,
1101
+ data: categories.map((_, index) => num(series.data[index] ?? 0))
1102
+ }))
1103
+ };
1104
+ }
1105
+ const data = input.data ?? [];
1106
+ return {
1107
+ categories: data.map((datum) => datum.label),
1108
+ series: [{
1109
+ name: "Value",
1110
+ data: data.map((datum) => num(datum.value))
1111
+ }],
1112
+ pointColors: data.map((datum) => datum.color)
1113
+ };
1114
+ }
1115
+ function tooltipAt(event, title, rows) {
1116
+ const box = (event.currentTarget?.closest(".ngx-plot"))?.getBoundingClientRect();
1117
+ return {
1118
+ x: box ? event.clientX - box.left : event.offsetX,
1119
+ y: box ? event.clientY - box.top : event.offsetY,
1120
+ title,
1121
+ rows
1122
+ };
1123
+ }
1124
+ function chartBox(preferred, initialWidth = 640) {
1125
+ const host = inject(ElementRef);
1126
+ const destroyRef = inject(DestroyRef);
1127
+ const width = signal(initialWidth, ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
1128
+ const height = signal(Math.max(1, preferred()), ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
1129
+ effect(() => height.set(Math.max(1, preferred())));
1130
+ afterNextRender(() => {
1131
+ const root = host.nativeElement;
1132
+ const measure = () => {
1133
+ const nextW = root.clientWidth;
1134
+ if (nextW > 0) width.set(Math.round(nextW));
1135
+ };
1136
+ measure();
1137
+ if (typeof ResizeObserver === "undefined") return;
1138
+ const observer = new ResizeObserver(measure);
1139
+ observer.observe(root);
1140
+ destroyRef.onDestroy(() => observer.disconnect());
1141
+ });
1142
+ return {
1143
+ width,
1144
+ height
1145
+ };
1146
+ }
1147
+ var NgxLineChart = class NgxLineChart {
1148
+ host = inject(ElementRef);
1149
+ data = input(void 0, ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
1150
+ series = input(void 0, ...ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []);
1151
+ categories = input(void 0, ...ngDevMode ? [{ debugName: "categories" }] : /* istanbul ignore next */ []);
1152
+ stacked = input(false, ...ngDevMode ? [{ debugName: "stacked" }] : /* istanbul ignore next */ []);
1153
+ height = input(320, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
1154
+ showLegend = input(void 0, ...ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []);
1155
+ showGrid = input(true, ...ngDevMode ? [{ debugName: "showGrid" }] : /* istanbul ignore next */ []);
1156
+ format = input("number", ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
1157
+ currency = input("USD", ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
1158
+ colors = input(void 0, ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
1159
+ ariaLabel = input("Line chart", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
1160
+ title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
1161
+ animate = input(true, ...ngDevMode ? [{ debugName: "animate" }] : /* istanbul ignore next */ []);
1162
+ box = chartBox(this.height);
1163
+ tip = signal(null, ...ngDevMode ? [{ debugName: "tip" }] : /* istanbul ignore next */ []);
1164
+ filled = computed(() => this.host.nativeElement.localName === "ngx-area-chart", ...ngDevMode ? [{ debugName: "filled" }] : /* istanbul ignore next */ []);
1165
+ normalized = computed(() => normalizeSeries({
1166
+ data: this.data(),
1167
+ series: this.series(),
1168
+ categories: this.categories()
1169
+ }), ...ngDevMode ? [{ debugName: "normalized" }] : /* istanbul ignore next */ []);
1170
+ layout = computed(() => layoutTrend({
1171
+ categories: this.normalized().categories,
1172
+ series: this.normalized().series,
1173
+ width: this.box.width(),
1174
+ height: this.height(),
1175
+ palette: this.colors(),
1176
+ format: resolveFormat(this.format(), this.currency()),
1177
+ filled: this.filled(),
1178
+ stacked: this.stacked()
1179
+ }), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
1180
+ legendOn = computed(() => this.showLegend() ?? this.layout().legend.length > 1, ...ngDevMode ? [{ debugName: "legendOn" }] : /* istanbul ignore next */ []);
1181
+ headers = computed(() => ["Category", ...this.normalized().series.map((item) => item.name)], ...ngDevMode ? [{ debugName: "headers" }] : /* istanbul ignore next */ []);
1182
+ rows = computed(() => this.normalized().categories.map((category, index) => [category, ...this.normalized().series.map((item) => String(item.data[index] ?? 0))]), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
1183
+ onPoint(point, event) {
1184
+ this.tip.set(tooltipAt(event, point.category, [{
1185
+ swatch: point.color,
1186
+ label: point.series,
1187
+ value: point.formatted
1188
+ }]));
1189
+ }
1190
+ static ɵfac = i0.ɵɵngDeclareFactory({
1191
+ minVersion: "12.0.0",
1192
+ version: "22.2.3",
1193
+ ngImport: i0,
1194
+ type: NgxLineChart,
1195
+ deps: [],
1196
+ target: i0.ɵɵFactoryTarget.Component
1197
+ });
1198
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1199
+ minVersion: "17.0.0",
1200
+ version: "22.2.3",
1201
+ type: NgxLineChart,
1202
+ isStandalone: true,
1203
+ selector: "ngx-line-chart, ngx-area-chart",
1204
+ inputs: {
1205
+ data: {
1206
+ classPropertyName: "data",
1207
+ publicName: "data",
1208
+ isSignal: true,
1209
+ isRequired: false,
1210
+ transformFunction: null
1211
+ },
1212
+ series: {
1213
+ classPropertyName: "series",
1214
+ publicName: "series",
1215
+ isSignal: true,
1216
+ isRequired: false,
1217
+ transformFunction: null
1218
+ },
1219
+ categories: {
1220
+ classPropertyName: "categories",
1221
+ publicName: "categories",
1222
+ isSignal: true,
1223
+ isRequired: false,
1224
+ transformFunction: null
1225
+ },
1226
+ stacked: {
1227
+ classPropertyName: "stacked",
1228
+ publicName: "stacked",
1229
+ isSignal: true,
1230
+ isRequired: false,
1231
+ transformFunction: null
1232
+ },
1233
+ height: {
1234
+ classPropertyName: "height",
1235
+ publicName: "height",
1236
+ isSignal: true,
1237
+ isRequired: false,
1238
+ transformFunction: null
1239
+ },
1240
+ showLegend: {
1241
+ classPropertyName: "showLegend",
1242
+ publicName: "showLegend",
1243
+ isSignal: true,
1244
+ isRequired: false,
1245
+ transformFunction: null
1246
+ },
1247
+ showGrid: {
1248
+ classPropertyName: "showGrid",
1249
+ publicName: "showGrid",
1250
+ isSignal: true,
1251
+ isRequired: false,
1252
+ transformFunction: null
1253
+ },
1254
+ format: {
1255
+ classPropertyName: "format",
1256
+ publicName: "format",
1257
+ isSignal: true,
1258
+ isRequired: false,
1259
+ transformFunction: null
1260
+ },
1261
+ currency: {
1262
+ classPropertyName: "currency",
1263
+ publicName: "currency",
1264
+ isSignal: true,
1265
+ isRequired: false,
1266
+ transformFunction: null
1267
+ },
1268
+ colors: {
1269
+ classPropertyName: "colors",
1270
+ publicName: "colors",
1271
+ isSignal: true,
1272
+ isRequired: false,
1273
+ transformFunction: null
1274
+ },
1275
+ ariaLabel: {
1276
+ classPropertyName: "ariaLabel",
1277
+ publicName: "ariaLabel",
1278
+ isSignal: true,
1279
+ isRequired: false,
1280
+ transformFunction: null
1281
+ },
1282
+ title: {
1283
+ classPropertyName: "title",
1284
+ publicName: "title",
1285
+ isSignal: true,
1286
+ isRequired: false,
1287
+ transformFunction: null
1288
+ },
1289
+ animate: {
1290
+ classPropertyName: "animate",
1291
+ publicName: "animate",
1292
+ isSignal: true,
1293
+ isRequired: false,
1294
+ transformFunction: null
1295
+ }
1296
+ },
1297
+ host: { properties: { "style.--ngx-chart-height.px": "height()" } },
1298
+ ngImport: i0,
1299
+ template: `
1300
+ <ngx-chart-frame
1301
+ [title]="title()"
1302
+ [ariaLabel]="ariaLabel()"
1303
+ [legend]="layout().legend"
1304
+ [showLegend]="legendOn()"
1305
+ [tooltip]="tip()"
1306
+ [srHeaders]="headers()"
1307
+ [srRows]="rows()"
1308
+ >
1309
+ @if (layout().empty) {
1310
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">No data yet.</p>
1311
+ } @else {
1312
+ <svg
1313
+ class="block w-full max-w-full"
1314
+ [style.height.px]="height()"
1315
+ [attr.viewBox]="'0 0 ' + layout().width + ' ' + layout().height"
1316
+ aria-hidden="true"
1317
+ (pointerleave)="tip.set(null)"
1318
+ >
1319
+ @for (tick of layout().ticks; track tick.label + '-' + tick.labelY) {
1320
+ @if (showGrid()) {
1321
+ <line class="ngx-grid" [attr.x1]="tick.x1" [attr.y1]="tick.y1" [attr.x2]="tick.x2" [attr.y2]="tick.y2" />
1322
+ }
1323
+ <text [attr.x]="tick.labelX" [attr.y]="tick.labelY" [attr.text-anchor]="tick.anchor" dominant-baseline="middle">
1324
+ {{ tick.label }}
1325
+ </text>
1326
+ }
1327
+ @if (layout().zero; as zero) {
1328
+ <line class="ngx-zero" [attr.x1]="zero.x1" [attr.y1]="zero.y1" [attr.x2]="zero.x2" [attr.y2]="zero.y2" />
1329
+ }
1330
+ @for (item of layout().series; track item.name) {
1331
+ @if (item.area) {
1332
+ <path [attr.d]="item.area" [attr.fill]="item.color" fill-opacity="0.18" [class.ngx-in]="animate()" />
1333
+ }
1334
+ <path
1335
+ [attr.d]="item.line"
1336
+ fill="none"
1337
+ [attr.stroke]="item.color"
1338
+ stroke-width="2"
1339
+ stroke-linejoin="round"
1340
+ stroke-linecap="round"
1341
+ [class.ngx-in]="animate()"
1342
+ />
1343
+ @for (point of item.points; track point.key) {
1344
+ <circle
1345
+ [attr.cx]="point.x"
1346
+ [attr.cy]="point.y"
1347
+ r="4"
1348
+ [attr.fill]="point.color"
1349
+ class="cursor-pointer"
1350
+ stroke="var(--ngx-surface)"
1351
+ stroke-width="1.5"
1352
+ (pointerenter)="onPoint(point, $event)"
1353
+ />
1354
+ }
1355
+ }
1356
+ @for (label of layout().categories; track label.label + '-' + label.x) {
1357
+ <text [attr.x]="label.x" [attr.y]="label.y" text-anchor="middle" dominant-baseline="middle">{{ label.label }}</text>
1358
+ }
1359
+ </svg>
1360
+ }
1361
+ </ngx-chart-frame>
1362
+ `,
1363
+ isInline: true,
1364
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"],
1365
+ dependencies: [{
1366
+ kind: "component",
1367
+ type: NgxChartFrame,
1368
+ selector: "ngx-chart-frame",
1369
+ inputs: [
1370
+ "title",
1371
+ "ariaLabel",
1372
+ "legend",
1373
+ "showLegend",
1374
+ "tooltip",
1375
+ "srHeaders",
1376
+ "srRows",
1377
+ "range"
1378
+ ]
1379
+ }],
1380
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1381
+ });
1382
+ };
1383
+ i0.ɵɵngDeclareClassMetadata({
1384
+ minVersion: "12.0.0",
1385
+ version: "22.2.3",
1386
+ ngImport: i0,
1387
+ type: NgxLineChart,
1388
+ decorators: [{
1389
+ type: Component,
1390
+ args: [{
1391
+ selector: "ngx-line-chart, ngx-area-chart",
1392
+ changeDetection: ChangeDetectionStrategy.OnPush,
1393
+ imports: [NgxChartFrame],
1394
+ host: { "[style.--ngx-chart-height.px]": "height()" },
1395
+ template: `
1396
+ <ngx-chart-frame
1397
+ [title]="title()"
1398
+ [ariaLabel]="ariaLabel()"
1399
+ [legend]="layout().legend"
1400
+ [showLegend]="legendOn()"
1401
+ [tooltip]="tip()"
1402
+ [srHeaders]="headers()"
1403
+ [srRows]="rows()"
1404
+ >
1405
+ @if (layout().empty) {
1406
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">No data yet.</p>
1407
+ } @else {
1408
+ <svg
1409
+ class="block w-full max-w-full"
1410
+ [style.height.px]="height()"
1411
+ [attr.viewBox]="'0 0 ' + layout().width + ' ' + layout().height"
1412
+ aria-hidden="true"
1413
+ (pointerleave)="tip.set(null)"
1414
+ >
1415
+ @for (tick of layout().ticks; track tick.label + '-' + tick.labelY) {
1416
+ @if (showGrid()) {
1417
+ <line class="ngx-grid" [attr.x1]="tick.x1" [attr.y1]="tick.y1" [attr.x2]="tick.x2" [attr.y2]="tick.y2" />
1418
+ }
1419
+ <text [attr.x]="tick.labelX" [attr.y]="tick.labelY" [attr.text-anchor]="tick.anchor" dominant-baseline="middle">
1420
+ {{ tick.label }}
1421
+ </text>
1422
+ }
1423
+ @if (layout().zero; as zero) {
1424
+ <line class="ngx-zero" [attr.x1]="zero.x1" [attr.y1]="zero.y1" [attr.x2]="zero.x2" [attr.y2]="zero.y2" />
1425
+ }
1426
+ @for (item of layout().series; track item.name) {
1427
+ @if (item.area) {
1428
+ <path [attr.d]="item.area" [attr.fill]="item.color" fill-opacity="0.18" [class.ngx-in]="animate()" />
1429
+ }
1430
+ <path
1431
+ [attr.d]="item.line"
1432
+ fill="none"
1433
+ [attr.stroke]="item.color"
1434
+ stroke-width="2"
1435
+ stroke-linejoin="round"
1436
+ stroke-linecap="round"
1437
+ [class.ngx-in]="animate()"
1438
+ />
1439
+ @for (point of item.points; track point.key) {
1440
+ <circle
1441
+ [attr.cx]="point.x"
1442
+ [attr.cy]="point.y"
1443
+ r="4"
1444
+ [attr.fill]="point.color"
1445
+ class="cursor-pointer"
1446
+ stroke="var(--ngx-surface)"
1447
+ stroke-width="1.5"
1448
+ (pointerenter)="onPoint(point, $event)"
1449
+ />
1450
+ }
1451
+ }
1452
+ @for (label of layout().categories; track label.label + '-' + label.x) {
1453
+ <text [attr.x]="label.x" [attr.y]="label.y" text-anchor="middle" dominant-baseline="middle">{{ label.label }}</text>
1454
+ }
1455
+ </svg>
1456
+ }
1457
+ </ngx-chart-frame>
1458
+ `,
1459
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"]
1460
+ }]
1461
+ }],
1462
+ propDecorators: {
1463
+ data: [{
1464
+ type: i0.Input,
1465
+ args: [{
1466
+ isSignal: true,
1467
+ alias: "data",
1468
+ required: false
1469
+ }]
1470
+ }],
1471
+ series: [{
1472
+ type: i0.Input,
1473
+ args: [{
1474
+ isSignal: true,
1475
+ alias: "series",
1476
+ required: false
1477
+ }]
1478
+ }],
1479
+ categories: [{
1480
+ type: i0.Input,
1481
+ args: [{
1482
+ isSignal: true,
1483
+ alias: "categories",
1484
+ required: false
1485
+ }]
1486
+ }],
1487
+ stacked: [{
1488
+ type: i0.Input,
1489
+ args: [{
1490
+ isSignal: true,
1491
+ alias: "stacked",
1492
+ required: false
1493
+ }]
1494
+ }],
1495
+ height: [{
1496
+ type: i0.Input,
1497
+ args: [{
1498
+ isSignal: true,
1499
+ alias: "height",
1500
+ required: false
1501
+ }]
1502
+ }],
1503
+ showLegend: [{
1504
+ type: i0.Input,
1505
+ args: [{
1506
+ isSignal: true,
1507
+ alias: "showLegend",
1508
+ required: false
1509
+ }]
1510
+ }],
1511
+ showGrid: [{
1512
+ type: i0.Input,
1513
+ args: [{
1514
+ isSignal: true,
1515
+ alias: "showGrid",
1516
+ required: false
1517
+ }]
1518
+ }],
1519
+ format: [{
1520
+ type: i0.Input,
1521
+ args: [{
1522
+ isSignal: true,
1523
+ alias: "format",
1524
+ required: false
1525
+ }]
1526
+ }],
1527
+ currency: [{
1528
+ type: i0.Input,
1529
+ args: [{
1530
+ isSignal: true,
1531
+ alias: "currency",
1532
+ required: false
1533
+ }]
1534
+ }],
1535
+ colors: [{
1536
+ type: i0.Input,
1537
+ args: [{
1538
+ isSignal: true,
1539
+ alias: "colors",
1540
+ required: false
1541
+ }]
1542
+ }],
1543
+ ariaLabel: [{
1544
+ type: i0.Input,
1545
+ args: [{
1546
+ isSignal: true,
1547
+ alias: "ariaLabel",
1548
+ required: false
1549
+ }]
1550
+ }],
1551
+ title: [{
1552
+ type: i0.Input,
1553
+ args: [{
1554
+ isSignal: true,
1555
+ alias: "title",
1556
+ required: false
1557
+ }]
1558
+ }],
1559
+ animate: [{
1560
+ type: i0.Input,
1561
+ args: [{
1562
+ isSignal: true,
1563
+ alias: "animate",
1564
+ required: false
1565
+ }]
1566
+ }]
1567
+ }
1568
+ });
1569
+ var NgxBarChart = class NgxBarChart {
1570
+ data = input(void 0, ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
1571
+ series = input(void 0, ...ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []);
1572
+ categories = input(void 0, ...ngDevMode ? [{ debugName: "categories" }] : /* istanbul ignore next */ []);
1573
+ mode = input("grouped", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
1574
+ orientation = input("vertical", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
1575
+ height = input(320, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
1576
+ showLegend = input(void 0, ...ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []);
1577
+ showGrid = input(true, ...ngDevMode ? [{ debugName: "showGrid" }] : /* istanbul ignore next */ []);
1578
+ showValues = input(false, ...ngDevMode ? [{ debugName: "showValues" }] : /* istanbul ignore next */ []);
1579
+ format = input("number", ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
1580
+ currency = input("USD", ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
1581
+ colors = input(void 0, ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
1582
+ ariaLabel = input("Bar chart", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
1583
+ title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
1584
+ max = input(void 0, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
1585
+ animate = input(true, ...ngDevMode ? [{ debugName: "animate" }] : /* istanbul ignore next */ []);
1586
+ box = chartBox(this.height);
1587
+ tip = signal(null, ...ngDevMode ? [{ debugName: "tip" }] : /* istanbul ignore next */ []);
1588
+ normalized = computed(() => normalizeSeries({
1589
+ data: this.data(),
1590
+ series: this.series(),
1591
+ categories: this.categories()
1592
+ }), ...ngDevMode ? [{ debugName: "normalized" }] : /* istanbul ignore next */ []);
1593
+ layout = computed(() => layoutBars({
1594
+ categories: this.normalized().categories,
1595
+ series: this.normalized().series,
1596
+ pointColors: this.normalized().pointColors,
1597
+ mode: this.mode(),
1598
+ orientation: this.orientation(),
1599
+ width: this.box.width(),
1600
+ height: this.height(),
1601
+ palette: this.colors(),
1602
+ format: resolveFormat(this.format(), this.currency()),
1603
+ showValues: this.showValues(),
1604
+ max: this.max()
1605
+ }), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
1606
+ legendOn = computed(() => this.showLegend() ?? this.layout().legend.length > 1, ...ngDevMode ? [{ debugName: "legendOn" }] : /* istanbul ignore next */ []);
1607
+ headers = computed(() => ["Category", ...this.normalized().series.map((item) => item.name)], ...ngDevMode ? [{ debugName: "headers" }] : /* istanbul ignore next */ []);
1608
+ rows = computed(() => this.normalized().categories.map((category, index) => [category, ...this.normalized().series.map((item) => String(item.data[index] ?? 0))]), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
1609
+ onMark(mark, event) {
1610
+ this.tip.set(tooltipAt(event, mark.category, [{
1611
+ swatch: mark.color,
1612
+ label: mark.series,
1613
+ value: mark.formatted
1614
+ }]));
1615
+ }
1616
+ static ɵfac = i0.ɵɵngDeclareFactory({
1617
+ minVersion: "12.0.0",
1618
+ version: "22.2.3",
1619
+ ngImport: i0,
1620
+ type: NgxBarChart,
1621
+ deps: [],
1622
+ target: i0.ɵɵFactoryTarget.Component
1623
+ });
1624
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1625
+ minVersion: "17.0.0",
1626
+ version: "22.2.3",
1627
+ type: NgxBarChart,
1628
+ isStandalone: true,
1629
+ selector: "ngx-bar-chart",
1630
+ inputs: {
1631
+ data: {
1632
+ classPropertyName: "data",
1633
+ publicName: "data",
1634
+ isSignal: true,
1635
+ isRequired: false,
1636
+ transformFunction: null
1637
+ },
1638
+ series: {
1639
+ classPropertyName: "series",
1640
+ publicName: "series",
1641
+ isSignal: true,
1642
+ isRequired: false,
1643
+ transformFunction: null
1644
+ },
1645
+ categories: {
1646
+ classPropertyName: "categories",
1647
+ publicName: "categories",
1648
+ isSignal: true,
1649
+ isRequired: false,
1650
+ transformFunction: null
1651
+ },
1652
+ mode: {
1653
+ classPropertyName: "mode",
1654
+ publicName: "mode",
1655
+ isSignal: true,
1656
+ isRequired: false,
1657
+ transformFunction: null
1658
+ },
1659
+ orientation: {
1660
+ classPropertyName: "orientation",
1661
+ publicName: "orientation",
1662
+ isSignal: true,
1663
+ isRequired: false,
1664
+ transformFunction: null
1665
+ },
1666
+ height: {
1667
+ classPropertyName: "height",
1668
+ publicName: "height",
1669
+ isSignal: true,
1670
+ isRequired: false,
1671
+ transformFunction: null
1672
+ },
1673
+ showLegend: {
1674
+ classPropertyName: "showLegend",
1675
+ publicName: "showLegend",
1676
+ isSignal: true,
1677
+ isRequired: false,
1678
+ transformFunction: null
1679
+ },
1680
+ showGrid: {
1681
+ classPropertyName: "showGrid",
1682
+ publicName: "showGrid",
1683
+ isSignal: true,
1684
+ isRequired: false,
1685
+ transformFunction: null
1686
+ },
1687
+ showValues: {
1688
+ classPropertyName: "showValues",
1689
+ publicName: "showValues",
1690
+ isSignal: true,
1691
+ isRequired: false,
1692
+ transformFunction: null
1693
+ },
1694
+ format: {
1695
+ classPropertyName: "format",
1696
+ publicName: "format",
1697
+ isSignal: true,
1698
+ isRequired: false,
1699
+ transformFunction: null
1700
+ },
1701
+ currency: {
1702
+ classPropertyName: "currency",
1703
+ publicName: "currency",
1704
+ isSignal: true,
1705
+ isRequired: false,
1706
+ transformFunction: null
1707
+ },
1708
+ colors: {
1709
+ classPropertyName: "colors",
1710
+ publicName: "colors",
1711
+ isSignal: true,
1712
+ isRequired: false,
1713
+ transformFunction: null
1714
+ },
1715
+ ariaLabel: {
1716
+ classPropertyName: "ariaLabel",
1717
+ publicName: "ariaLabel",
1718
+ isSignal: true,
1719
+ isRequired: false,
1720
+ transformFunction: null
1721
+ },
1722
+ title: {
1723
+ classPropertyName: "title",
1724
+ publicName: "title",
1725
+ isSignal: true,
1726
+ isRequired: false,
1727
+ transformFunction: null
1728
+ },
1729
+ max: {
1730
+ classPropertyName: "max",
1731
+ publicName: "max",
1732
+ isSignal: true,
1733
+ isRequired: false,
1734
+ transformFunction: null
1735
+ },
1736
+ animate: {
1737
+ classPropertyName: "animate",
1738
+ publicName: "animate",
1739
+ isSignal: true,
1740
+ isRequired: false,
1741
+ transformFunction: null
1742
+ }
1743
+ },
1744
+ host: { properties: { "style.--ngx-chart-height.px": "height()" } },
1745
+ ngImport: i0,
1746
+ template: `
1747
+ <ngx-chart-frame
1748
+ [title]="title()"
1749
+ [ariaLabel]="ariaLabel()"
1750
+ [legend]="layout().legend"
1751
+ [showLegend]="legendOn()"
1752
+ [tooltip]="tip()"
1753
+ [srHeaders]="headers()"
1754
+ [srRows]="rows()"
1755
+ >
1756
+ @if (layout().empty) {
1757
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">No data yet.</p>
1758
+ } @else {
1759
+ <svg
1760
+ class="block w-full max-w-full"
1761
+ [style.height.px]="height()"
1762
+ [attr.viewBox]="'0 0 ' + layout().width + ' ' + layout().height"
1763
+ aria-hidden="true"
1764
+ (pointerleave)="tip.set(null)"
1765
+ >
1766
+ @for (tick of layout().ticks; track tick.label + '-' + tick.labelX + '-' + tick.labelY) {
1767
+ @if (showGrid()) {
1768
+ <line class="ngx-grid" [attr.x1]="tick.x1" [attr.y1]="tick.y1" [attr.x2]="tick.x2" [attr.y2]="tick.y2" />
1769
+ }
1770
+ <text [attr.x]="tick.labelX" [attr.y]="tick.labelY" [attr.text-anchor]="tick.anchor" dominant-baseline="middle">
1771
+ {{ tick.label }}
1772
+ </text>
1773
+ }
1774
+ @if (layout().zero; as zero) {
1775
+ <line class="ngx-zero" [attr.x1]="zero.x1" [attr.y1]="zero.y1" [attr.x2]="zero.x2" [attr.y2]="zero.y2" />
1776
+ }
1777
+ @for (mark of layout().marks; track mark.key) {
1778
+ <rect
1779
+ [attr.x]="mark.x"
1780
+ [attr.y]="mark.y"
1781
+ [attr.width]="mark.width"
1782
+ [attr.height]="mark.height"
1783
+ [attr.fill]="mark.color"
1784
+ rx="3"
1785
+ class="cursor-pointer"
1786
+ [class.ngx-in]="animate()"
1787
+ [style.animation-delay.ms]="animate() ? $index * 18 : 0"
1788
+ (pointerenter)="onMark(mark, $event)"
1789
+ />
1790
+ @if (mark.showLabel) {
1791
+ <text
1792
+ class="ngx-value"
1793
+ [attr.x]="mark.labelX"
1794
+ [attr.y]="mark.labelY"
1795
+ [attr.text-anchor]="orientation() === 'horizontal' ? 'start' : 'middle'"
1796
+ dominant-baseline="middle"
1797
+ >
1798
+ {{ mark.formatted }}
1799
+ </text>
1800
+ }
1801
+ }
1802
+ @for (label of layout().categories; track label.label + '-' + label.x + '-' + label.y) {
1803
+ <text [attr.x]="label.x" [attr.y]="label.y" [attr.text-anchor]="label.anchor" dominant-baseline="middle">
1804
+ {{ label.label }}
1805
+ </text>
1806
+ }
1807
+ </svg>
1808
+ }
1809
+ </ngx-chart-frame>
1810
+ `,
1811
+ isInline: true,
1812
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"],
1813
+ dependencies: [{
1814
+ kind: "component",
1815
+ type: NgxChartFrame,
1816
+ selector: "ngx-chart-frame",
1817
+ inputs: [
1818
+ "title",
1819
+ "ariaLabel",
1820
+ "legend",
1821
+ "showLegend",
1822
+ "tooltip",
1823
+ "srHeaders",
1824
+ "srRows",
1825
+ "range"
1826
+ ]
1827
+ }],
1828
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
1829
+ });
1830
+ };
1831
+ i0.ɵɵngDeclareClassMetadata({
1832
+ minVersion: "12.0.0",
1833
+ version: "22.2.3",
1834
+ ngImport: i0,
1835
+ type: NgxBarChart,
1836
+ decorators: [{
1837
+ type: Component,
1838
+ args: [{
1839
+ selector: "ngx-bar-chart",
1840
+ changeDetection: ChangeDetectionStrategy.OnPush,
1841
+ imports: [NgxChartFrame],
1842
+ host: { "[style.--ngx-chart-height.px]": "height()" },
1843
+ template: `
1844
+ <ngx-chart-frame
1845
+ [title]="title()"
1846
+ [ariaLabel]="ariaLabel()"
1847
+ [legend]="layout().legend"
1848
+ [showLegend]="legendOn()"
1849
+ [tooltip]="tip()"
1850
+ [srHeaders]="headers()"
1851
+ [srRows]="rows()"
1852
+ >
1853
+ @if (layout().empty) {
1854
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">No data yet.</p>
1855
+ } @else {
1856
+ <svg
1857
+ class="block w-full max-w-full"
1858
+ [style.height.px]="height()"
1859
+ [attr.viewBox]="'0 0 ' + layout().width + ' ' + layout().height"
1860
+ aria-hidden="true"
1861
+ (pointerleave)="tip.set(null)"
1862
+ >
1863
+ @for (tick of layout().ticks; track tick.label + '-' + tick.labelX + '-' + tick.labelY) {
1864
+ @if (showGrid()) {
1865
+ <line class="ngx-grid" [attr.x1]="tick.x1" [attr.y1]="tick.y1" [attr.x2]="tick.x2" [attr.y2]="tick.y2" />
1866
+ }
1867
+ <text [attr.x]="tick.labelX" [attr.y]="tick.labelY" [attr.text-anchor]="tick.anchor" dominant-baseline="middle">
1868
+ {{ tick.label }}
1869
+ </text>
1870
+ }
1871
+ @if (layout().zero; as zero) {
1872
+ <line class="ngx-zero" [attr.x1]="zero.x1" [attr.y1]="zero.y1" [attr.x2]="zero.x2" [attr.y2]="zero.y2" />
1873
+ }
1874
+ @for (mark of layout().marks; track mark.key) {
1875
+ <rect
1876
+ [attr.x]="mark.x"
1877
+ [attr.y]="mark.y"
1878
+ [attr.width]="mark.width"
1879
+ [attr.height]="mark.height"
1880
+ [attr.fill]="mark.color"
1881
+ rx="3"
1882
+ class="cursor-pointer"
1883
+ [class.ngx-in]="animate()"
1884
+ [style.animation-delay.ms]="animate() ? $index * 18 : 0"
1885
+ (pointerenter)="onMark(mark, $event)"
1886
+ />
1887
+ @if (mark.showLabel) {
1888
+ <text
1889
+ class="ngx-value"
1890
+ [attr.x]="mark.labelX"
1891
+ [attr.y]="mark.labelY"
1892
+ [attr.text-anchor]="orientation() === 'horizontal' ? 'start' : 'middle'"
1893
+ dominant-baseline="middle"
1894
+ >
1895
+ {{ mark.formatted }}
1896
+ </text>
1897
+ }
1898
+ }
1899
+ @for (label of layout().categories; track label.label + '-' + label.x + '-' + label.y) {
1900
+ <text [attr.x]="label.x" [attr.y]="label.y" [attr.text-anchor]="label.anchor" dominant-baseline="middle">
1901
+ {{ label.label }}
1902
+ </text>
1903
+ }
1904
+ </svg>
1905
+ }
1906
+ </ngx-chart-frame>
1907
+ `,
1908
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"]
1909
+ }]
1910
+ }],
1911
+ propDecorators: {
1912
+ data: [{
1913
+ type: i0.Input,
1914
+ args: [{
1915
+ isSignal: true,
1916
+ alias: "data",
1917
+ required: false
1918
+ }]
1919
+ }],
1920
+ series: [{
1921
+ type: i0.Input,
1922
+ args: [{
1923
+ isSignal: true,
1924
+ alias: "series",
1925
+ required: false
1926
+ }]
1927
+ }],
1928
+ categories: [{
1929
+ type: i0.Input,
1930
+ args: [{
1931
+ isSignal: true,
1932
+ alias: "categories",
1933
+ required: false
1934
+ }]
1935
+ }],
1936
+ mode: [{
1937
+ type: i0.Input,
1938
+ args: [{
1939
+ isSignal: true,
1940
+ alias: "mode",
1941
+ required: false
1942
+ }]
1943
+ }],
1944
+ orientation: [{
1945
+ type: i0.Input,
1946
+ args: [{
1947
+ isSignal: true,
1948
+ alias: "orientation",
1949
+ required: false
1950
+ }]
1951
+ }],
1952
+ height: [{
1953
+ type: i0.Input,
1954
+ args: [{
1955
+ isSignal: true,
1956
+ alias: "height",
1957
+ required: false
1958
+ }]
1959
+ }],
1960
+ showLegend: [{
1961
+ type: i0.Input,
1962
+ args: [{
1963
+ isSignal: true,
1964
+ alias: "showLegend",
1965
+ required: false
1966
+ }]
1967
+ }],
1968
+ showGrid: [{
1969
+ type: i0.Input,
1970
+ args: [{
1971
+ isSignal: true,
1972
+ alias: "showGrid",
1973
+ required: false
1974
+ }]
1975
+ }],
1976
+ showValues: [{
1977
+ type: i0.Input,
1978
+ args: [{
1979
+ isSignal: true,
1980
+ alias: "showValues",
1981
+ required: false
1982
+ }]
1983
+ }],
1984
+ format: [{
1985
+ type: i0.Input,
1986
+ args: [{
1987
+ isSignal: true,
1988
+ alias: "format",
1989
+ required: false
1990
+ }]
1991
+ }],
1992
+ currency: [{
1993
+ type: i0.Input,
1994
+ args: [{
1995
+ isSignal: true,
1996
+ alias: "currency",
1997
+ required: false
1998
+ }]
1999
+ }],
2000
+ colors: [{
2001
+ type: i0.Input,
2002
+ args: [{
2003
+ isSignal: true,
2004
+ alias: "colors",
2005
+ required: false
2006
+ }]
2007
+ }],
2008
+ ariaLabel: [{
2009
+ type: i0.Input,
2010
+ args: [{
2011
+ isSignal: true,
2012
+ alias: "ariaLabel",
2013
+ required: false
2014
+ }]
2015
+ }],
2016
+ title: [{
2017
+ type: i0.Input,
2018
+ args: [{
2019
+ isSignal: true,
2020
+ alias: "title",
2021
+ required: false
2022
+ }]
2023
+ }],
2024
+ max: [{
2025
+ type: i0.Input,
2026
+ args: [{
2027
+ isSignal: true,
2028
+ alias: "max",
2029
+ required: false
2030
+ }]
2031
+ }],
2032
+ animate: [{
2033
+ type: i0.Input,
2034
+ args: [{
2035
+ isSignal: true,
2036
+ alias: "animate",
2037
+ required: false
2038
+ }]
2039
+ }]
2040
+ }
2041
+ });
2042
+ var NgxPieChart = class NgxPieChart {
2043
+ host = inject(ElementRef);
2044
+ data = input([], ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
2045
+ donut = input(false, ...ngDevMode ? [{ debugName: "donut" }] : /* istanbul ignore next */ []);
2046
+ innerRatio = input(.62, ...ngDevMode ? [{ debugName: "innerRatio" }] : /* istanbul ignore next */ []);
2047
+ height = input(280, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
2048
+ showLegend = input(void 0, ...ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []);
2049
+ format = input("number", ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
2050
+ currency = input("USD", ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
2051
+ colors = input(void 0, ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
2052
+ ariaLabel = input("Pie chart", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
2053
+ title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
2054
+ animate = input(true, ...ngDevMode ? [{ debugName: "animate" }] : /* istanbul ignore next */ []);
2055
+ box = chartBox(this.height);
2056
+ tip = signal(null, ...ngDevMode ? [{ debugName: "tip" }] : /* istanbul ignore next */ []);
2057
+ isDonut = computed(() => this.donut() || this.host.nativeElement.localName === "ngx-donut-chart", ...ngDevMode ? [{ debugName: "isDonut" }] : /* istanbul ignore next */ []);
2058
+ side = computed(() => Math.max(1, Math.min(this.box.width(), this.height())), ...ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []);
2059
+ formatter = computed(() => resolveFormat(this.format(), this.currency()), ...ngDevMode ? [{ debugName: "formatter" }] : /* istanbul ignore next */ []);
2060
+ layout = computed(() => layoutPie({
2061
+ data: this.data(),
2062
+ width: this.side(),
2063
+ height: this.side(),
2064
+ donut: this.isDonut(),
2065
+ innerRatio: this.innerRatio(),
2066
+ palette: this.colors(),
2067
+ format: this.formatter()
2068
+ }), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
2069
+ legendOn = computed(() => this.showLegend() ?? true, ...ngDevMode ? [{ debugName: "legendOn" }] : /* istanbul ignore next */ []);
2070
+ totalLabel = computed(() => this.formatter()(this.layout().total), ...ngDevMode ? [{ debugName: "totalLabel" }] : /* istanbul ignore next */ []);
2071
+ rows = computed(() => this.layout().slices.map((slice) => [
2072
+ slice.label,
2073
+ slice.formatted,
2074
+ slice.percent
2075
+ ]), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
2076
+ onSlice(slice, event) {
2077
+ this.tip.set(tooltipAt(event, slice.label, [{
2078
+ swatch: slice.color,
2079
+ label: slice.percent,
2080
+ value: slice.formatted
2081
+ }]));
2082
+ }
2083
+ static ɵfac = i0.ɵɵngDeclareFactory({
2084
+ minVersion: "12.0.0",
2085
+ version: "22.2.3",
2086
+ ngImport: i0,
2087
+ type: NgxPieChart,
2088
+ deps: [],
2089
+ target: i0.ɵɵFactoryTarget.Component
2090
+ });
2091
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2092
+ minVersion: "17.0.0",
2093
+ version: "22.2.3",
2094
+ type: NgxPieChart,
2095
+ isStandalone: true,
2096
+ selector: "ngx-pie-chart, ngx-donut-chart",
2097
+ inputs: {
2098
+ data: {
2099
+ classPropertyName: "data",
2100
+ publicName: "data",
2101
+ isSignal: true,
2102
+ isRequired: false,
2103
+ transformFunction: null
2104
+ },
2105
+ donut: {
2106
+ classPropertyName: "donut",
2107
+ publicName: "donut",
2108
+ isSignal: true,
2109
+ isRequired: false,
2110
+ transformFunction: null
2111
+ },
2112
+ innerRatio: {
2113
+ classPropertyName: "innerRatio",
2114
+ publicName: "innerRatio",
2115
+ isSignal: true,
2116
+ isRequired: false,
2117
+ transformFunction: null
2118
+ },
2119
+ height: {
2120
+ classPropertyName: "height",
2121
+ publicName: "height",
2122
+ isSignal: true,
2123
+ isRequired: false,
2124
+ transformFunction: null
2125
+ },
2126
+ showLegend: {
2127
+ classPropertyName: "showLegend",
2128
+ publicName: "showLegend",
2129
+ isSignal: true,
2130
+ isRequired: false,
2131
+ transformFunction: null
2132
+ },
2133
+ format: {
2134
+ classPropertyName: "format",
2135
+ publicName: "format",
2136
+ isSignal: true,
2137
+ isRequired: false,
2138
+ transformFunction: null
2139
+ },
2140
+ currency: {
2141
+ classPropertyName: "currency",
2142
+ publicName: "currency",
2143
+ isSignal: true,
2144
+ isRequired: false,
2145
+ transformFunction: null
2146
+ },
2147
+ colors: {
2148
+ classPropertyName: "colors",
2149
+ publicName: "colors",
2150
+ isSignal: true,
2151
+ isRequired: false,
2152
+ transformFunction: null
2153
+ },
2154
+ ariaLabel: {
2155
+ classPropertyName: "ariaLabel",
2156
+ publicName: "ariaLabel",
2157
+ isSignal: true,
2158
+ isRequired: false,
2159
+ transformFunction: null
2160
+ },
2161
+ title: {
2162
+ classPropertyName: "title",
2163
+ publicName: "title",
2164
+ isSignal: true,
2165
+ isRequired: false,
2166
+ transformFunction: null
2167
+ },
2168
+ animate: {
2169
+ classPropertyName: "animate",
2170
+ publicName: "animate",
2171
+ isSignal: true,
2172
+ isRequired: false,
2173
+ transformFunction: null
2174
+ }
2175
+ },
2176
+ host: { properties: { "style.--ngx-chart-height.px": "height()" } },
2177
+ ngImport: i0,
2178
+ template: `
2179
+ <ngx-chart-frame
2180
+ [title]="title()"
2181
+ [ariaLabel]="ariaLabel()"
2182
+ [legend]="layout().legend"
2183
+ [showLegend]="legendOn()"
2184
+ [tooltip]="tip()"
2185
+ [srHeaders]="['Category', 'Value', 'Share']"
2186
+ [srRows]="rows()"
2187
+ >
2188
+ @if (layout().empty) {
2189
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">No data yet.</p>
2190
+ } @else {
2191
+ <div class="ngx-square" [style.width.px]="side()" [style.height.px]="side()">
2192
+ <svg class="h-full w-full" [attr.viewBox]="'0 0 ' + side() + ' ' + side()" aria-hidden="true" (pointerleave)="tip.set(null)">
2193
+ @for (slice of layout().slices; track slice.key) {
2194
+ <path
2195
+ [attr.d]="slice.path"
2196
+ [attr.fill]="slice.color"
2197
+ class="cursor-pointer"
2198
+ [class.ngx-in]="animate()"
2199
+ stroke="var(--ngx-surface)"
2200
+ stroke-width="1"
2201
+ (pointerenter)="onSlice(slice, $event)"
2202
+ />
2203
+ }
2204
+ </svg>
2205
+ @if (isDonut()) {
2206
+ <div class="pointer-events-none absolute inset-0 flex flex-col items-center justify-center">
2207
+ <span class="text-xs">Total</span>
2208
+ <span class="font-display text-2xl font-medium text-foreground">{{ totalLabel() }}</span>
2209
+ </div>
2210
+ }
2211
+ </div>
2212
+ }
2213
+ </ngx-chart-frame>
2214
+ `,
2215
+ isInline: true,
2216
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"],
2217
+ dependencies: [{
2218
+ kind: "component",
2219
+ type: NgxChartFrame,
2220
+ selector: "ngx-chart-frame",
2221
+ inputs: [
2222
+ "title",
2223
+ "ariaLabel",
2224
+ "legend",
2225
+ "showLegend",
2226
+ "tooltip",
2227
+ "srHeaders",
2228
+ "srRows",
2229
+ "range"
2230
+ ]
2231
+ }],
2232
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
2233
+ });
2234
+ };
2235
+ i0.ɵɵngDeclareClassMetadata({
2236
+ minVersion: "12.0.0",
2237
+ version: "22.2.3",
2238
+ ngImport: i0,
2239
+ type: NgxPieChart,
2240
+ decorators: [{
2241
+ type: Component,
2242
+ args: [{
2243
+ selector: "ngx-pie-chart, ngx-donut-chart",
2244
+ changeDetection: ChangeDetectionStrategy.OnPush,
2245
+ imports: [NgxChartFrame],
2246
+ host: { "[style.--ngx-chart-height.px]": "height()" },
2247
+ template: `
2248
+ <ngx-chart-frame
2249
+ [title]="title()"
2250
+ [ariaLabel]="ariaLabel()"
2251
+ [legend]="layout().legend"
2252
+ [showLegend]="legendOn()"
2253
+ [tooltip]="tip()"
2254
+ [srHeaders]="['Category', 'Value', 'Share']"
2255
+ [srRows]="rows()"
2256
+ >
2257
+ @if (layout().empty) {
2258
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">No data yet.</p>
2259
+ } @else {
2260
+ <div class="ngx-square" [style.width.px]="side()" [style.height.px]="side()">
2261
+ <svg class="h-full w-full" [attr.viewBox]="'0 0 ' + side() + ' ' + side()" aria-hidden="true" (pointerleave)="tip.set(null)">
2262
+ @for (slice of layout().slices; track slice.key) {
2263
+ <path
2264
+ [attr.d]="slice.path"
2265
+ [attr.fill]="slice.color"
2266
+ class="cursor-pointer"
2267
+ [class.ngx-in]="animate()"
2268
+ stroke="var(--ngx-surface)"
2269
+ stroke-width="1"
2270
+ (pointerenter)="onSlice(slice, $event)"
2271
+ />
2272
+ }
2273
+ </svg>
2274
+ @if (isDonut()) {
2275
+ <div class="pointer-events-none absolute inset-0 flex flex-col items-center justify-center">
2276
+ <span class="text-xs">Total</span>
2277
+ <span class="font-display text-2xl font-medium text-foreground">{{ totalLabel() }}</span>
2278
+ </div>
2279
+ }
2280
+ </div>
2281
+ }
2282
+ </ngx-chart-frame>
2283
+ `,
2284
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"]
2285
+ }]
2286
+ }],
2287
+ propDecorators: {
2288
+ data: [{
2289
+ type: i0.Input,
2290
+ args: [{
2291
+ isSignal: true,
2292
+ alias: "data",
2293
+ required: false
2294
+ }]
2295
+ }],
2296
+ donut: [{
2297
+ type: i0.Input,
2298
+ args: [{
2299
+ isSignal: true,
2300
+ alias: "donut",
2301
+ required: false
2302
+ }]
2303
+ }],
2304
+ innerRatio: [{
2305
+ type: i0.Input,
2306
+ args: [{
2307
+ isSignal: true,
2308
+ alias: "innerRatio",
2309
+ required: false
2310
+ }]
2311
+ }],
2312
+ height: [{
2313
+ type: i0.Input,
2314
+ args: [{
2315
+ isSignal: true,
2316
+ alias: "height",
2317
+ required: false
2318
+ }]
2319
+ }],
2320
+ showLegend: [{
2321
+ type: i0.Input,
2322
+ args: [{
2323
+ isSignal: true,
2324
+ alias: "showLegend",
2325
+ required: false
2326
+ }]
2327
+ }],
2328
+ format: [{
2329
+ type: i0.Input,
2330
+ args: [{
2331
+ isSignal: true,
2332
+ alias: "format",
2333
+ required: false
2334
+ }]
2335
+ }],
2336
+ currency: [{
2337
+ type: i0.Input,
2338
+ args: [{
2339
+ isSignal: true,
2340
+ alias: "currency",
2341
+ required: false
2342
+ }]
2343
+ }],
2344
+ colors: [{
2345
+ type: i0.Input,
2346
+ args: [{
2347
+ isSignal: true,
2348
+ alias: "colors",
2349
+ required: false
2350
+ }]
2351
+ }],
2352
+ ariaLabel: [{
2353
+ type: i0.Input,
2354
+ args: [{
2355
+ isSignal: true,
2356
+ alias: "ariaLabel",
2357
+ required: false
2358
+ }]
2359
+ }],
2360
+ title: [{
2361
+ type: i0.Input,
2362
+ args: [{
2363
+ isSignal: true,
2364
+ alias: "title",
2365
+ required: false
2366
+ }]
2367
+ }],
2368
+ animate: [{
2369
+ type: i0.Input,
2370
+ args: [{
2371
+ isSignal: true,
2372
+ alias: "animate",
2373
+ required: false
2374
+ }]
2375
+ }]
2376
+ }
2377
+ });
2378
+ var NgxGaugeChart = class NgxGaugeChart {
2379
+ value = input(0, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
2380
+ min = input(0, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
2381
+ max = input(100, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
2382
+ label = input(void 0, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
2383
+ height = input(220, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
2384
+ format = input("number", ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
2385
+ currency = input("USD", ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
2386
+ color = input(void 0, ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
2387
+ ariaLabel = input("Gauge chart", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
2388
+ title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
2389
+ animate = input(true, ...ngDevMode ? [{ debugName: "animate" }] : /* istanbul ignore next */ []);
2390
+ box = chartBox(this.height);
2391
+ formatter = computed(() => resolveFormat(this.format(), this.currency()), ...ngDevMode ? [{ debugName: "formatter" }] : /* istanbul ignore next */ []);
2392
+ formatted = computed(() => this.formatter()(this.value()), ...ngDevMode ? [{ debugName: "formatted" }] : /* istanbul ignore next */ []);
2393
+ layout = computed(() => layoutGauge({
2394
+ value: this.value(),
2395
+ min: this.min(),
2396
+ max: this.max(),
2397
+ width: this.box.width(),
2398
+ height: this.height(),
2399
+ color: this.color()
2400
+ }), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
2401
+ static ɵfac = i0.ɵɵngDeclareFactory({
2402
+ minVersion: "12.0.0",
2403
+ version: "22.2.3",
2404
+ ngImport: i0,
2405
+ type: NgxGaugeChart,
2406
+ deps: [],
2407
+ target: i0.ɵɵFactoryTarget.Component
2408
+ });
2409
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2410
+ minVersion: "17.0.0",
2411
+ version: "22.2.3",
2412
+ type: NgxGaugeChart,
2413
+ isStandalone: true,
2414
+ selector: "ngx-gauge-chart",
2415
+ inputs: {
2416
+ value: {
2417
+ classPropertyName: "value",
2418
+ publicName: "value",
2419
+ isSignal: true,
2420
+ isRequired: false,
2421
+ transformFunction: null
2422
+ },
2423
+ min: {
2424
+ classPropertyName: "min",
2425
+ publicName: "min",
2426
+ isSignal: true,
2427
+ isRequired: false,
2428
+ transformFunction: null
2429
+ },
2430
+ max: {
2431
+ classPropertyName: "max",
2432
+ publicName: "max",
2433
+ isSignal: true,
2434
+ isRequired: false,
2435
+ transformFunction: null
2436
+ },
2437
+ label: {
2438
+ classPropertyName: "label",
2439
+ publicName: "label",
2440
+ isSignal: true,
2441
+ isRequired: false,
2442
+ transformFunction: null
2443
+ },
2444
+ height: {
2445
+ classPropertyName: "height",
2446
+ publicName: "height",
2447
+ isSignal: true,
2448
+ isRequired: false,
2449
+ transformFunction: null
2450
+ },
2451
+ format: {
2452
+ classPropertyName: "format",
2453
+ publicName: "format",
2454
+ isSignal: true,
2455
+ isRequired: false,
2456
+ transformFunction: null
2457
+ },
2458
+ currency: {
2459
+ classPropertyName: "currency",
2460
+ publicName: "currency",
2461
+ isSignal: true,
2462
+ isRequired: false,
2463
+ transformFunction: null
2464
+ },
2465
+ color: {
2466
+ classPropertyName: "color",
2467
+ publicName: "color",
2468
+ isSignal: true,
2469
+ isRequired: false,
2470
+ transformFunction: null
2471
+ },
2472
+ ariaLabel: {
2473
+ classPropertyName: "ariaLabel",
2474
+ publicName: "ariaLabel",
2475
+ isSignal: true,
2476
+ isRequired: false,
2477
+ transformFunction: null
2478
+ },
2479
+ title: {
2480
+ classPropertyName: "title",
2481
+ publicName: "title",
2482
+ isSignal: true,
2483
+ isRequired: false,
2484
+ transformFunction: null
2485
+ },
2486
+ animate: {
2487
+ classPropertyName: "animate",
2488
+ publicName: "animate",
2489
+ isSignal: true,
2490
+ isRequired: false,
2491
+ transformFunction: null
2492
+ }
2493
+ },
2494
+ host: { properties: { "style.--ngx-chart-height.px": "height()" } },
2495
+ ngImport: i0,
2496
+ template: `
2497
+ <ngx-chart-frame
2498
+ [title]="title()"
2499
+ [ariaLabel]="ariaLabel()"
2500
+ [srHeaders]="['Label', 'Value']"
2501
+ [srRows]="[[label() || ariaLabel(), formatted()]]"
2502
+ >
2503
+ <div class="relative w-full" [style.height.px]="height()">
2504
+ <svg class="h-full w-full" [attr.viewBox]="'0 0 ' + layout().width + ' ' + layout().height" aria-hidden="true">
2505
+ <path [attr.d]="layout().track" fill="none" stroke="var(--ngx-track)" stroke-width="14" stroke-linecap="round" />
2506
+ @if (layout().valuePath) {
2507
+ <path
2508
+ [attr.d]="layout().valuePath"
2509
+ fill="none"
2510
+ [attr.stroke]="layout().color"
2511
+ stroke-width="14"
2512
+ stroke-linecap="round"
2513
+ [class.ngx-in]="animate()"
2514
+ />
2515
+ }
2516
+ </svg>
2517
+ <div
2518
+ class="pointer-events-none absolute flex -translate-x-1/2 -translate-y-1/2 flex-col items-center"
2519
+ [style.left.%]="(layout().labelX / layout().width) * 100"
2520
+ [style.top.%]="(layout().labelY / layout().height) * 100"
2521
+ >
2522
+ <span class="font-display text-3xl font-medium text-foreground">{{ formatted() }}</span>
2523
+ @if (label()) {
2524
+ <span class="text-xs">{{ label() }}</span>
2525
+ }
2526
+ </div>
2527
+ </div>
2528
+ </ngx-chart-frame>
2529
+ `,
2530
+ isInline: true,
2531
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"],
2532
+ dependencies: [{
2533
+ kind: "component",
2534
+ type: NgxChartFrame,
2535
+ selector: "ngx-chart-frame",
2536
+ inputs: [
2537
+ "title",
2538
+ "ariaLabel",
2539
+ "legend",
2540
+ "showLegend",
2541
+ "tooltip",
2542
+ "srHeaders",
2543
+ "srRows",
2544
+ "range"
2545
+ ]
2546
+ }],
2547
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
2548
+ });
2549
+ };
2550
+ i0.ɵɵngDeclareClassMetadata({
2551
+ minVersion: "12.0.0",
2552
+ version: "22.2.3",
2553
+ ngImport: i0,
2554
+ type: NgxGaugeChart,
2555
+ decorators: [{
2556
+ type: Component,
2557
+ args: [{
2558
+ selector: "ngx-gauge-chart",
2559
+ changeDetection: ChangeDetectionStrategy.OnPush,
2560
+ imports: [NgxChartFrame],
2561
+ host: { "[style.--ngx-chart-height.px]": "height()" },
2562
+ template: `
2563
+ <ngx-chart-frame
2564
+ [title]="title()"
2565
+ [ariaLabel]="ariaLabel()"
2566
+ [srHeaders]="['Label', 'Value']"
2567
+ [srRows]="[[label() || ariaLabel(), formatted()]]"
2568
+ >
2569
+ <div class="relative w-full" [style.height.px]="height()">
2570
+ <svg class="h-full w-full" [attr.viewBox]="'0 0 ' + layout().width + ' ' + layout().height" aria-hidden="true">
2571
+ <path [attr.d]="layout().track" fill="none" stroke="var(--ngx-track)" stroke-width="14" stroke-linecap="round" />
2572
+ @if (layout().valuePath) {
2573
+ <path
2574
+ [attr.d]="layout().valuePath"
2575
+ fill="none"
2576
+ [attr.stroke]="layout().color"
2577
+ stroke-width="14"
2578
+ stroke-linecap="round"
2579
+ [class.ngx-in]="animate()"
2580
+ />
2581
+ }
2582
+ </svg>
2583
+ <div
2584
+ class="pointer-events-none absolute flex -translate-x-1/2 -translate-y-1/2 flex-col items-center"
2585
+ [style.left.%]="(layout().labelX / layout().width) * 100"
2586
+ [style.top.%]="(layout().labelY / layout().height) * 100"
2587
+ >
2588
+ <span class="font-display text-3xl font-medium text-foreground">{{ formatted() }}</span>
2589
+ @if (label()) {
2590
+ <span class="text-xs">{{ label() }}</span>
2591
+ }
2592
+ </div>
2593
+ </div>
2594
+ </ngx-chart-frame>
2595
+ `,
2596
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"]
2597
+ }]
2598
+ }],
2599
+ propDecorators: {
2600
+ value: [{
2601
+ type: i0.Input,
2602
+ args: [{
2603
+ isSignal: true,
2604
+ alias: "value",
2605
+ required: false
2606
+ }]
2607
+ }],
2608
+ min: [{
2609
+ type: i0.Input,
2610
+ args: [{
2611
+ isSignal: true,
2612
+ alias: "min",
2613
+ required: false
2614
+ }]
2615
+ }],
2616
+ max: [{
2617
+ type: i0.Input,
2618
+ args: [{
2619
+ isSignal: true,
2620
+ alias: "max",
2621
+ required: false
2622
+ }]
2623
+ }],
2624
+ label: [{
2625
+ type: i0.Input,
2626
+ args: [{
2627
+ isSignal: true,
2628
+ alias: "label",
2629
+ required: false
2630
+ }]
2631
+ }],
2632
+ height: [{
2633
+ type: i0.Input,
2634
+ args: [{
2635
+ isSignal: true,
2636
+ alias: "height",
2637
+ required: false
2638
+ }]
2639
+ }],
2640
+ format: [{
2641
+ type: i0.Input,
2642
+ args: [{
2643
+ isSignal: true,
2644
+ alias: "format",
2645
+ required: false
2646
+ }]
2647
+ }],
2648
+ currency: [{
2649
+ type: i0.Input,
2650
+ args: [{
2651
+ isSignal: true,
2652
+ alias: "currency",
2653
+ required: false
2654
+ }]
2655
+ }],
2656
+ color: [{
2657
+ type: i0.Input,
2658
+ args: [{
2659
+ isSignal: true,
2660
+ alias: "color",
2661
+ required: false
2662
+ }]
2663
+ }],
2664
+ ariaLabel: [{
2665
+ type: i0.Input,
2666
+ args: [{
2667
+ isSignal: true,
2668
+ alias: "ariaLabel",
2669
+ required: false
2670
+ }]
2671
+ }],
2672
+ title: [{
2673
+ type: i0.Input,
2674
+ args: [{
2675
+ isSignal: true,
2676
+ alias: "title",
2677
+ required: false
2678
+ }]
2679
+ }],
2680
+ animate: [{
2681
+ type: i0.Input,
2682
+ args: [{
2683
+ isSignal: true,
2684
+ alias: "animate",
2685
+ required: false
2686
+ }]
2687
+ }]
2688
+ }
2689
+ });
2690
+ var NgxHeatmap = class NgxHeatmap {
2691
+ xLabels = input([], ...ngDevMode ? [{ debugName: "xLabels" }] : /* istanbul ignore next */ []);
2692
+ yLabels = input([], ...ngDevMode ? [{ debugName: "yLabels" }] : /* istanbul ignore next */ []);
2693
+ data = input([], ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
2694
+ height = input(280, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
2695
+ format = input("number", ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
2696
+ currency = input("USD", ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
2697
+ ariaLabel = input("Heatmap", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
2698
+ title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
2699
+ box = chartBox(this.height);
2700
+ tip = signal(null, ...ngDevMode ? [{ debugName: "tip" }] : /* istanbul ignore next */ []);
2701
+ formatter = computed(() => resolveFormat(this.format(), this.currency()), ...ngDevMode ? [{ debugName: "formatter" }] : /* istanbul ignore next */ []);
2702
+ layout = computed(() => layoutHeatmap({
2703
+ xLabels: this.xLabels(),
2704
+ yLabels: this.yLabels(),
2705
+ data: this.data(),
2706
+ width: this.box.width(),
2707
+ height: this.height(),
2708
+ format: this.formatter()
2709
+ }), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
2710
+ range = computed(() => this.layout().empty ? void 0 : {
2711
+ min: this.formatter()(this.layout().min),
2712
+ max: this.formatter()(this.layout().max)
2713
+ }, ...ngDevMode ? [{ debugName: "range" }] : /* istanbul ignore next */ []);
2714
+ headers = computed(() => ["", ...this.xLabels()], ...ngDevMode ? [{ debugName: "headers" }] : /* istanbul ignore next */ []);
2715
+ rows = computed(() => this.yLabels().map((label, row) => [label, ...(this.data()[row] ?? []).map((value) => this.formatter()(value))]), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
2716
+ fill(t) {
2717
+ return `color-mix(in oklab, var(--ngx-2) ${Math.round(t * 100)}%, var(--ngx-track))`;
2718
+ }
2719
+ onCell(cell, event) {
2720
+ this.tip.set(tooltipAt(event, `${cell.ylabel} · ${cell.xlabel}`, [{
2721
+ swatch: "var(--ngx-2)",
2722
+ label: "Value",
2723
+ value: cell.formatted
2724
+ }]));
2725
+ }
2726
+ static ɵfac = i0.ɵɵngDeclareFactory({
2727
+ minVersion: "12.0.0",
2728
+ version: "22.2.3",
2729
+ ngImport: i0,
2730
+ type: NgxHeatmap,
2731
+ deps: [],
2732
+ target: i0.ɵɵFactoryTarget.Component
2733
+ });
2734
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2735
+ minVersion: "17.0.0",
2736
+ version: "22.2.3",
2737
+ type: NgxHeatmap,
2738
+ isStandalone: true,
2739
+ selector: "ngx-heatmap",
2740
+ inputs: {
2741
+ xLabels: {
2742
+ classPropertyName: "xLabels",
2743
+ publicName: "xLabels",
2744
+ isSignal: true,
2745
+ isRequired: false,
2746
+ transformFunction: null
2747
+ },
2748
+ yLabels: {
2749
+ classPropertyName: "yLabels",
2750
+ publicName: "yLabels",
2751
+ isSignal: true,
2752
+ isRequired: false,
2753
+ transformFunction: null
2754
+ },
2755
+ data: {
2756
+ classPropertyName: "data",
2757
+ publicName: "data",
2758
+ isSignal: true,
2759
+ isRequired: false,
2760
+ transformFunction: null
2761
+ },
2762
+ height: {
2763
+ classPropertyName: "height",
2764
+ publicName: "height",
2765
+ isSignal: true,
2766
+ isRequired: false,
2767
+ transformFunction: null
2768
+ },
2769
+ format: {
2770
+ classPropertyName: "format",
2771
+ publicName: "format",
2772
+ isSignal: true,
2773
+ isRequired: false,
2774
+ transformFunction: null
2775
+ },
2776
+ currency: {
2777
+ classPropertyName: "currency",
2778
+ publicName: "currency",
2779
+ isSignal: true,
2780
+ isRequired: false,
2781
+ transformFunction: null
2782
+ },
2783
+ ariaLabel: {
2784
+ classPropertyName: "ariaLabel",
2785
+ publicName: "ariaLabel",
2786
+ isSignal: true,
2787
+ isRequired: false,
2788
+ transformFunction: null
2789
+ },
2790
+ title: {
2791
+ classPropertyName: "title",
2792
+ publicName: "title",
2793
+ isSignal: true,
2794
+ isRequired: false,
2795
+ transformFunction: null
2796
+ }
2797
+ },
2798
+ host: { properties: { "style.--ngx-chart-height.px": "height()" } },
2799
+ ngImport: i0,
2800
+ template: `
2801
+ <ngx-chart-frame
2802
+ [title]="title()"
2803
+ [ariaLabel]="ariaLabel()"
2804
+ [tooltip]="tip()"
2805
+ [range]="range()"
2806
+ [srHeaders]="headers()"
2807
+ [srRows]="rows()"
2808
+ >
2809
+ @if (layout().empty) {
2810
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">No data yet.</p>
2811
+ } @else {
2812
+ <svg
2813
+ class="block w-full max-w-full"
2814
+ [style.height.px]="height()"
2815
+ [attr.viewBox]="'0 0 ' + layout().width + ' ' + layout().height"
2816
+ aria-hidden="true"
2817
+ (pointerleave)="tip.set(null)"
2818
+ >
2819
+ @for (cell of layout().cells; track cell.key) {
2820
+ <rect
2821
+ [attr.x]="cell.x"
2822
+ [attr.y]="cell.y"
2823
+ [attr.width]="cell.width"
2824
+ [attr.height]="cell.height"
2825
+ rx="4"
2826
+ [attr.fill]="fill(cell.t)"
2827
+ class="cursor-pointer"
2828
+ (pointerenter)="onCell(cell, $event)"
2829
+ />
2830
+ }
2831
+ @for (label of layout().xLabels; track label.label + '-' + label.x) {
2832
+ <text [attr.x]="label.x" [attr.y]="label.y" text-anchor="middle" dominant-baseline="middle">{{ label.label }}</text>
2833
+ }
2834
+ @for (label of layout().yLabels; track label.label + '-' + label.y) {
2835
+ <text [attr.x]="label.x" [attr.y]="label.y" text-anchor="end" dominant-baseline="middle">{{ label.label }}</text>
2836
+ }
2837
+ </svg>
2838
+ }
2839
+ </ngx-chart-frame>
2840
+ `,
2841
+ isInline: true,
2842
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"],
2843
+ dependencies: [{
2844
+ kind: "component",
2845
+ type: NgxChartFrame,
2846
+ selector: "ngx-chart-frame",
2847
+ inputs: [
2848
+ "title",
2849
+ "ariaLabel",
2850
+ "legend",
2851
+ "showLegend",
2852
+ "tooltip",
2853
+ "srHeaders",
2854
+ "srRows",
2855
+ "range"
2856
+ ]
2857
+ }],
2858
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
2859
+ });
2860
+ };
2861
+ i0.ɵɵngDeclareClassMetadata({
2862
+ minVersion: "12.0.0",
2863
+ version: "22.2.3",
2864
+ ngImport: i0,
2865
+ type: NgxHeatmap,
2866
+ decorators: [{
2867
+ type: Component,
2868
+ args: [{
2869
+ selector: "ngx-heatmap",
2870
+ changeDetection: ChangeDetectionStrategy.OnPush,
2871
+ imports: [NgxChartFrame],
2872
+ host: { "[style.--ngx-chart-height.px]": "height()" },
2873
+ template: `
2874
+ <ngx-chart-frame
2875
+ [title]="title()"
2876
+ [ariaLabel]="ariaLabel()"
2877
+ [tooltip]="tip()"
2878
+ [range]="range()"
2879
+ [srHeaders]="headers()"
2880
+ [srRows]="rows()"
2881
+ >
2882
+ @if (layout().empty) {
2883
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">No data yet.</p>
2884
+ } @else {
2885
+ <svg
2886
+ class="block w-full max-w-full"
2887
+ [style.height.px]="height()"
2888
+ [attr.viewBox]="'0 0 ' + layout().width + ' ' + layout().height"
2889
+ aria-hidden="true"
2890
+ (pointerleave)="tip.set(null)"
2891
+ >
2892
+ @for (cell of layout().cells; track cell.key) {
2893
+ <rect
2894
+ [attr.x]="cell.x"
2895
+ [attr.y]="cell.y"
2896
+ [attr.width]="cell.width"
2897
+ [attr.height]="cell.height"
2898
+ rx="4"
2899
+ [attr.fill]="fill(cell.t)"
2900
+ class="cursor-pointer"
2901
+ (pointerenter)="onCell(cell, $event)"
2902
+ />
2903
+ }
2904
+ @for (label of layout().xLabels; track label.label + '-' + label.x) {
2905
+ <text [attr.x]="label.x" [attr.y]="label.y" text-anchor="middle" dominant-baseline="middle">{{ label.label }}</text>
2906
+ }
2907
+ @for (label of layout().yLabels; track label.label + '-' + label.y) {
2908
+ <text [attr.x]="label.x" [attr.y]="label.y" text-anchor="end" dominant-baseline="middle">{{ label.label }}</text>
2909
+ }
2910
+ </svg>
2911
+ }
2912
+ </ngx-chart-frame>
2913
+ `,
2914
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"]
2915
+ }]
2916
+ }],
2917
+ propDecorators: {
2918
+ xLabels: [{
2919
+ type: i0.Input,
2920
+ args: [{
2921
+ isSignal: true,
2922
+ alias: "xLabels",
2923
+ required: false
2924
+ }]
2925
+ }],
2926
+ yLabels: [{
2927
+ type: i0.Input,
2928
+ args: [{
2929
+ isSignal: true,
2930
+ alias: "yLabels",
2931
+ required: false
2932
+ }]
2933
+ }],
2934
+ data: [{
2935
+ type: i0.Input,
2936
+ args: [{
2937
+ isSignal: true,
2938
+ alias: "data",
2939
+ required: false
2940
+ }]
2941
+ }],
2942
+ height: [{
2943
+ type: i0.Input,
2944
+ args: [{
2945
+ isSignal: true,
2946
+ alias: "height",
2947
+ required: false
2948
+ }]
2949
+ }],
2950
+ format: [{
2951
+ type: i0.Input,
2952
+ args: [{
2953
+ isSignal: true,
2954
+ alias: "format",
2955
+ required: false
2956
+ }]
2957
+ }],
2958
+ currency: [{
2959
+ type: i0.Input,
2960
+ args: [{
2961
+ isSignal: true,
2962
+ alias: "currency",
2963
+ required: false
2964
+ }]
2965
+ }],
2966
+ ariaLabel: [{
2967
+ type: i0.Input,
2968
+ args: [{
2969
+ isSignal: true,
2970
+ alias: "ariaLabel",
2971
+ required: false
2972
+ }]
2973
+ }],
2974
+ title: [{
2975
+ type: i0.Input,
2976
+ args: [{
2977
+ isSignal: true,
2978
+ alias: "title",
2979
+ required: false
2980
+ }]
2981
+ }]
2982
+ }
2983
+ });
2984
+ var NgxRadarChart = class NgxRadarChart {
2985
+ series = input([], ...ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []);
2986
+ categories = input([], ...ngDevMode ? [{ debugName: "categories" }] : /* istanbul ignore next */ []);
2987
+ height = input(320, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
2988
+ showLegend = input(void 0, ...ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []);
2989
+ format = input("number", ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
2990
+ currency = input("USD", ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
2991
+ colors = input(void 0, ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
2992
+ ariaLabel = input("Radar chart", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
2993
+ title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
2994
+ animate = input(true, ...ngDevMode ? [{ debugName: "animate" }] : /* istanbul ignore next */ []);
2995
+ box = chartBox(this.height);
2996
+ tip = signal(null, ...ngDevMode ? [{ debugName: "tip" }] : /* istanbul ignore next */ []);
2997
+ side = computed(() => Math.max(1, Math.min(this.box.width(), this.height())), ...ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []);
2998
+ normalized = computed(() => normalizeSeries({
2999
+ series: this.series(),
3000
+ categories: this.categories()
3001
+ }), ...ngDevMode ? [{ debugName: "normalized" }] : /* istanbul ignore next */ []);
3002
+ layout = computed(() => layoutRadar({
3003
+ categories: this.normalized().categories,
3004
+ series: this.normalized().series,
3005
+ width: this.side(),
3006
+ height: this.side(),
3007
+ palette: this.colors(),
3008
+ format: resolveFormat(this.format(), this.currency())
3009
+ }), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
3010
+ legendOn = computed(() => this.showLegend() ?? this.layout().legend.length > 0, ...ngDevMode ? [{ debugName: "legendOn" }] : /* istanbul ignore next */ []);
3011
+ headers = computed(() => ["Axis", ...this.normalized().series.map((item) => item.name)], ...ngDevMode ? [{ debugName: "headers" }] : /* istanbul ignore next */ []);
3012
+ rows = computed(() => this.normalized().categories.map((category, index) => [category, ...this.normalized().series.map((item) => String(item.data[index] ?? 0))]), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
3013
+ onPoint(point, event) {
3014
+ this.tip.set(tooltipAt(event, point.axis, [{
3015
+ swatch: point.color,
3016
+ label: point.series,
3017
+ value: point.formatted
3018
+ }]));
3019
+ }
3020
+ static ɵfac = i0.ɵɵngDeclareFactory({
3021
+ minVersion: "12.0.0",
3022
+ version: "22.2.3",
3023
+ ngImport: i0,
3024
+ type: NgxRadarChart,
3025
+ deps: [],
3026
+ target: i0.ɵɵFactoryTarget.Component
3027
+ });
3028
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3029
+ minVersion: "17.0.0",
3030
+ version: "22.2.3",
3031
+ type: NgxRadarChart,
3032
+ isStandalone: true,
3033
+ selector: "ngx-radar-chart",
3034
+ inputs: {
3035
+ series: {
3036
+ classPropertyName: "series",
3037
+ publicName: "series",
3038
+ isSignal: true,
3039
+ isRequired: false,
3040
+ transformFunction: null
3041
+ },
3042
+ categories: {
3043
+ classPropertyName: "categories",
3044
+ publicName: "categories",
3045
+ isSignal: true,
3046
+ isRequired: false,
3047
+ transformFunction: null
3048
+ },
3049
+ height: {
3050
+ classPropertyName: "height",
3051
+ publicName: "height",
3052
+ isSignal: true,
3053
+ isRequired: false,
3054
+ transformFunction: null
3055
+ },
3056
+ showLegend: {
3057
+ classPropertyName: "showLegend",
3058
+ publicName: "showLegend",
3059
+ isSignal: true,
3060
+ isRequired: false,
3061
+ transformFunction: null
3062
+ },
3063
+ format: {
3064
+ classPropertyName: "format",
3065
+ publicName: "format",
3066
+ isSignal: true,
3067
+ isRequired: false,
3068
+ transformFunction: null
3069
+ },
3070
+ currency: {
3071
+ classPropertyName: "currency",
3072
+ publicName: "currency",
3073
+ isSignal: true,
3074
+ isRequired: false,
3075
+ transformFunction: null
3076
+ },
3077
+ colors: {
3078
+ classPropertyName: "colors",
3079
+ publicName: "colors",
3080
+ isSignal: true,
3081
+ isRequired: false,
3082
+ transformFunction: null
3083
+ },
3084
+ ariaLabel: {
3085
+ classPropertyName: "ariaLabel",
3086
+ publicName: "ariaLabel",
3087
+ isSignal: true,
3088
+ isRequired: false,
3089
+ transformFunction: null
3090
+ },
3091
+ title: {
3092
+ classPropertyName: "title",
3093
+ publicName: "title",
3094
+ isSignal: true,
3095
+ isRequired: false,
3096
+ transformFunction: null
3097
+ },
3098
+ animate: {
3099
+ classPropertyName: "animate",
3100
+ publicName: "animate",
3101
+ isSignal: true,
3102
+ isRequired: false,
3103
+ transformFunction: null
3104
+ }
3105
+ },
3106
+ host: { properties: { "style.--ngx-chart-height.px": "height()" } },
3107
+ ngImport: i0,
3108
+ template: `
3109
+ <ngx-chart-frame
3110
+ [title]="title()"
3111
+ [ariaLabel]="ariaLabel()"
3112
+ [legend]="layout().legend"
3113
+ [showLegend]="legendOn()"
3114
+ [tooltip]="tip()"
3115
+ [srHeaders]="headers()"
3116
+ [srRows]="rows()"
3117
+ >
3118
+ @if (layout().empty) {
3119
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">Add at least three axes.</p>
3120
+ } @else {
3121
+ <div class="ngx-square" [style.width.px]="side()" [style.height.px]="side()">
3122
+ <svg class="h-full w-full" [attr.viewBox]="'0 0 ' + side() + ' ' + side()" aria-hidden="true" (pointerleave)="tip.set(null)">
3123
+ @for (ring of layout().rings; track $index) {
3124
+ <path [attr.d]="ring" fill="none" class="ngx-grid" />
3125
+ }
3126
+ @for (spoke of layout().spokes; track $index) {
3127
+ <line class="ngx-grid" [attr.x1]="spoke.x1" [attr.y1]="spoke.y1" [attr.x2]="spoke.x2" [attr.y2]="spoke.y2" />
3128
+ }
3129
+ @for (item of layout().series; track item.name) {
3130
+ <path [attr.d]="item.polygon" [attr.fill]="item.color" fill-opacity="0.16" [attr.stroke]="item.color" stroke-width="2" [class.ngx-in]="animate()" />
3131
+ @for (point of item.points; track point.key) {
3132
+ <circle
3133
+ [attr.cx]="point.x"
3134
+ [attr.cy]="point.y"
3135
+ r="3.5"
3136
+ [attr.fill]="point.color"
3137
+ class="cursor-pointer"
3138
+ (pointerenter)="onPoint(point, $event)"
3139
+ />
3140
+ }
3141
+ }
3142
+ @for (axis of layout().axes; track axis.label + '-' + axis.x) {
3143
+ <text [attr.x]="axis.x" [attr.y]="axis.y" [attr.text-anchor]="axis.anchor" dominant-baseline="middle">{{ axis.label }}</text>
3144
+ }
3145
+ </svg>
3146
+ </div>
3147
+ }
3148
+ </ngx-chart-frame>
3149
+ `,
3150
+ isInline: true,
3151
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"],
3152
+ dependencies: [{
3153
+ kind: "component",
3154
+ type: NgxChartFrame,
3155
+ selector: "ngx-chart-frame",
3156
+ inputs: [
3157
+ "title",
3158
+ "ariaLabel",
3159
+ "legend",
3160
+ "showLegend",
3161
+ "tooltip",
3162
+ "srHeaders",
3163
+ "srRows",
3164
+ "range"
3165
+ ]
3166
+ }],
3167
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
3168
+ });
3169
+ };
3170
+ i0.ɵɵngDeclareClassMetadata({
3171
+ minVersion: "12.0.0",
3172
+ version: "22.2.3",
3173
+ ngImport: i0,
3174
+ type: NgxRadarChart,
3175
+ decorators: [{
3176
+ type: Component,
3177
+ args: [{
3178
+ selector: "ngx-radar-chart",
3179
+ changeDetection: ChangeDetectionStrategy.OnPush,
3180
+ imports: [NgxChartFrame],
3181
+ host: { "[style.--ngx-chart-height.px]": "height()" },
3182
+ template: `
3183
+ <ngx-chart-frame
3184
+ [title]="title()"
3185
+ [ariaLabel]="ariaLabel()"
3186
+ [legend]="layout().legend"
3187
+ [showLegend]="legendOn()"
3188
+ [tooltip]="tip()"
3189
+ [srHeaders]="headers()"
3190
+ [srRows]="rows()"
3191
+ >
3192
+ @if (layout().empty) {
3193
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">Add at least three axes.</p>
3194
+ } @else {
3195
+ <div class="ngx-square" [style.width.px]="side()" [style.height.px]="side()">
3196
+ <svg class="h-full w-full" [attr.viewBox]="'0 0 ' + side() + ' ' + side()" aria-hidden="true" (pointerleave)="tip.set(null)">
3197
+ @for (ring of layout().rings; track $index) {
3198
+ <path [attr.d]="ring" fill="none" class="ngx-grid" />
3199
+ }
3200
+ @for (spoke of layout().spokes; track $index) {
3201
+ <line class="ngx-grid" [attr.x1]="spoke.x1" [attr.y1]="spoke.y1" [attr.x2]="spoke.x2" [attr.y2]="spoke.y2" />
3202
+ }
3203
+ @for (item of layout().series; track item.name) {
3204
+ <path [attr.d]="item.polygon" [attr.fill]="item.color" fill-opacity="0.16" [attr.stroke]="item.color" stroke-width="2" [class.ngx-in]="animate()" />
3205
+ @for (point of item.points; track point.key) {
3206
+ <circle
3207
+ [attr.cx]="point.x"
3208
+ [attr.cy]="point.y"
3209
+ r="3.5"
3210
+ [attr.fill]="point.color"
3211
+ class="cursor-pointer"
3212
+ (pointerenter)="onPoint(point, $event)"
3213
+ />
3214
+ }
3215
+ }
3216
+ @for (axis of layout().axes; track axis.label + '-' + axis.x) {
3217
+ <text [attr.x]="axis.x" [attr.y]="axis.y" [attr.text-anchor]="axis.anchor" dominant-baseline="middle">{{ axis.label }}</text>
3218
+ }
3219
+ </svg>
3220
+ </div>
3221
+ }
3222
+ </ngx-chart-frame>
3223
+ `,
3224
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"]
3225
+ }]
3226
+ }],
3227
+ propDecorators: {
3228
+ series: [{
3229
+ type: i0.Input,
3230
+ args: [{
3231
+ isSignal: true,
3232
+ alias: "series",
3233
+ required: false
3234
+ }]
3235
+ }],
3236
+ categories: [{
3237
+ type: i0.Input,
3238
+ args: [{
3239
+ isSignal: true,
3240
+ alias: "categories",
3241
+ required: false
3242
+ }]
3243
+ }],
3244
+ height: [{
3245
+ type: i0.Input,
3246
+ args: [{
3247
+ isSignal: true,
3248
+ alias: "height",
3249
+ required: false
3250
+ }]
3251
+ }],
3252
+ showLegend: [{
3253
+ type: i0.Input,
3254
+ args: [{
3255
+ isSignal: true,
3256
+ alias: "showLegend",
3257
+ required: false
3258
+ }]
3259
+ }],
3260
+ format: [{
3261
+ type: i0.Input,
3262
+ args: [{
3263
+ isSignal: true,
3264
+ alias: "format",
3265
+ required: false
3266
+ }]
3267
+ }],
3268
+ currency: [{
3269
+ type: i0.Input,
3270
+ args: [{
3271
+ isSignal: true,
3272
+ alias: "currency",
3273
+ required: false
3274
+ }]
3275
+ }],
3276
+ colors: [{
3277
+ type: i0.Input,
3278
+ args: [{
3279
+ isSignal: true,
3280
+ alias: "colors",
3281
+ required: false
3282
+ }]
3283
+ }],
3284
+ ariaLabel: [{
3285
+ type: i0.Input,
3286
+ args: [{
3287
+ isSignal: true,
3288
+ alias: "ariaLabel",
3289
+ required: false
3290
+ }]
3291
+ }],
3292
+ title: [{
3293
+ type: i0.Input,
3294
+ args: [{
3295
+ isSignal: true,
3296
+ alias: "title",
3297
+ required: false
3298
+ }]
3299
+ }],
3300
+ animate: [{
3301
+ type: i0.Input,
3302
+ args: [{
3303
+ isSignal: true,
3304
+ alias: "animate",
3305
+ required: false
3306
+ }]
3307
+ }]
3308
+ }
3309
+ });
3310
+ var NgxScatterChart = class NgxScatterChart {
3311
+ series = input([], ...ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []);
3312
+ height = input(320, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
3313
+ showLegend = input(void 0, ...ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []);
3314
+ showGrid = input(true, ...ngDevMode ? [{ debugName: "showGrid" }] : /* istanbul ignore next */ []);
3315
+ format = input("number", ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
3316
+ currency = input("USD", ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
3317
+ colors = input(void 0, ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
3318
+ ariaLabel = input("Scatter chart", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
3319
+ title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
3320
+ animate = input(true, ...ngDevMode ? [{ debugName: "animate" }] : /* istanbul ignore next */ []);
3321
+ box = chartBox(this.height);
3322
+ tip = signal(null, ...ngDevMode ? [{ debugName: "tip" }] : /* istanbul ignore next */ []);
3323
+ layout = computed(() => layoutScatter({
3324
+ series: this.series(),
3325
+ width: this.box.width(),
3326
+ height: this.height(),
3327
+ palette: this.colors(),
3328
+ format: resolveFormat(this.format(), this.currency())
3329
+ }), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
3330
+ legendOn = computed(() => this.showLegend() ?? this.layout().legend.length > 1, ...ngDevMode ? [{ debugName: "legendOn" }] : /* istanbul ignore next */ []);
3331
+ rows = computed(() => this.layout().points.map((point) => [
3332
+ point.label,
3333
+ point.formattedX,
3334
+ point.formattedY
3335
+ ]), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
3336
+ onPoint(point, event) {
3337
+ this.tip.set(tooltipAt(event, point.label, [{
3338
+ swatch: point.color,
3339
+ label: point.series,
3340
+ value: `${point.formattedX}, ${point.formattedY}`
3341
+ }]));
3342
+ }
3343
+ static ɵfac = i0.ɵɵngDeclareFactory({
3344
+ minVersion: "12.0.0",
3345
+ version: "22.2.3",
3346
+ ngImport: i0,
3347
+ type: NgxScatterChart,
3348
+ deps: [],
3349
+ target: i0.ɵɵFactoryTarget.Component
3350
+ });
3351
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3352
+ minVersion: "17.0.0",
3353
+ version: "22.2.3",
3354
+ type: NgxScatterChart,
3355
+ isStandalone: true,
3356
+ selector: "ngx-scatter-chart",
3357
+ inputs: {
3358
+ series: {
3359
+ classPropertyName: "series",
3360
+ publicName: "series",
3361
+ isSignal: true,
3362
+ isRequired: false,
3363
+ transformFunction: null
3364
+ },
3365
+ height: {
3366
+ classPropertyName: "height",
3367
+ publicName: "height",
3368
+ isSignal: true,
3369
+ isRequired: false,
3370
+ transformFunction: null
3371
+ },
3372
+ showLegend: {
3373
+ classPropertyName: "showLegend",
3374
+ publicName: "showLegend",
3375
+ isSignal: true,
3376
+ isRequired: false,
3377
+ transformFunction: null
3378
+ },
3379
+ showGrid: {
3380
+ classPropertyName: "showGrid",
3381
+ publicName: "showGrid",
3382
+ isSignal: true,
3383
+ isRequired: false,
3384
+ transformFunction: null
3385
+ },
3386
+ format: {
3387
+ classPropertyName: "format",
3388
+ publicName: "format",
3389
+ isSignal: true,
3390
+ isRequired: false,
3391
+ transformFunction: null
3392
+ },
3393
+ currency: {
3394
+ classPropertyName: "currency",
3395
+ publicName: "currency",
3396
+ isSignal: true,
3397
+ isRequired: false,
3398
+ transformFunction: null
3399
+ },
3400
+ colors: {
3401
+ classPropertyName: "colors",
3402
+ publicName: "colors",
3403
+ isSignal: true,
3404
+ isRequired: false,
3405
+ transformFunction: null
3406
+ },
3407
+ ariaLabel: {
3408
+ classPropertyName: "ariaLabel",
3409
+ publicName: "ariaLabel",
3410
+ isSignal: true,
3411
+ isRequired: false,
3412
+ transformFunction: null
3413
+ },
3414
+ title: {
3415
+ classPropertyName: "title",
3416
+ publicName: "title",
3417
+ isSignal: true,
3418
+ isRequired: false,
3419
+ transformFunction: null
3420
+ },
3421
+ animate: {
3422
+ classPropertyName: "animate",
3423
+ publicName: "animate",
3424
+ isSignal: true,
3425
+ isRequired: false,
3426
+ transformFunction: null
3427
+ }
3428
+ },
3429
+ host: { properties: { "style.--ngx-chart-height.px": "height()" } },
3430
+ ngImport: i0,
3431
+ template: `
3432
+ <ngx-chart-frame
3433
+ [title]="title()"
3434
+ [ariaLabel]="ariaLabel()"
3435
+ [legend]="layout().legend"
3436
+ [showLegend]="legendOn()"
3437
+ [tooltip]="tip()"
3438
+ [srHeaders]="['Series', 'X', 'Y']"
3439
+ [srRows]="rows()"
3440
+ >
3441
+ @if (layout().empty) {
3442
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">No data yet.</p>
3443
+ } @else {
3444
+ <svg
3445
+ class="block w-full max-w-full"
3446
+ [style.height.px]="height()"
3447
+ [attr.viewBox]="'0 0 ' + layout().width + ' ' + layout().height"
3448
+ aria-hidden="true"
3449
+ (pointerleave)="tip.set(null)"
3450
+ >
3451
+ @for (tick of layout().ticksY; track tick.label + '-' + tick.labelY) {
3452
+ @if (showGrid()) {
3453
+ <line class="ngx-grid" [attr.x1]="tick.x1" [attr.y1]="tick.y1" [attr.x2]="tick.x2" [attr.y2]="tick.y2" />
3454
+ }
3455
+ <text [attr.x]="tick.labelX" [attr.y]="tick.labelY" text-anchor="end" dominant-baseline="middle">{{ tick.label }}</text>
3456
+ }
3457
+ @for (tick of layout().ticksX; track tick.label + '-' + tick.labelX) {
3458
+ @if (showGrid()) {
3459
+ <line class="ngx-grid" [attr.x1]="tick.x1" [attr.y1]="tick.y1" [attr.x2]="tick.x2" [attr.y2]="tick.y2" />
3460
+ }
3461
+ <text [attr.x]="tick.labelX" [attr.y]="tick.labelY" text-anchor="middle" dominant-baseline="middle">{{ tick.label }}</text>
3462
+ }
3463
+ @for (point of layout().points; track point.key) {
3464
+ <circle
3465
+ [attr.cx]="point.cx"
3466
+ [attr.cy]="point.cy"
3467
+ r="5"
3468
+ [attr.fill]="point.color"
3469
+ class="cursor-pointer"
3470
+ stroke="var(--ngx-surface)"
3471
+ stroke-width="1.5"
3472
+ [class.ngx-in]="animate()"
3473
+ (pointerenter)="onPoint(point, $event)"
3474
+ />
3475
+ }
3476
+ </svg>
3477
+ }
3478
+ </ngx-chart-frame>
3479
+ `,
3480
+ isInline: true,
3481
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"],
3482
+ dependencies: [{
3483
+ kind: "component",
3484
+ type: NgxChartFrame,
3485
+ selector: "ngx-chart-frame",
3486
+ inputs: [
3487
+ "title",
3488
+ "ariaLabel",
3489
+ "legend",
3490
+ "showLegend",
3491
+ "tooltip",
3492
+ "srHeaders",
3493
+ "srRows",
3494
+ "range"
3495
+ ]
3496
+ }],
3497
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
3498
+ });
3499
+ };
3500
+ i0.ɵɵngDeclareClassMetadata({
3501
+ minVersion: "12.0.0",
3502
+ version: "22.2.3",
3503
+ ngImport: i0,
3504
+ type: NgxScatterChart,
3505
+ decorators: [{
3506
+ type: Component,
3507
+ args: [{
3508
+ selector: "ngx-scatter-chart",
3509
+ changeDetection: ChangeDetectionStrategy.OnPush,
3510
+ imports: [NgxChartFrame],
3511
+ host: { "[style.--ngx-chart-height.px]": "height()" },
3512
+ template: `
3513
+ <ngx-chart-frame
3514
+ [title]="title()"
3515
+ [ariaLabel]="ariaLabel()"
3516
+ [legend]="layout().legend"
3517
+ [showLegend]="legendOn()"
3518
+ [tooltip]="tip()"
3519
+ [srHeaders]="['Series', 'X', 'Y']"
3520
+ [srRows]="rows()"
3521
+ >
3522
+ @if (layout().empty) {
3523
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">No data yet.</p>
3524
+ } @else {
3525
+ <svg
3526
+ class="block w-full max-w-full"
3527
+ [style.height.px]="height()"
3528
+ [attr.viewBox]="'0 0 ' + layout().width + ' ' + layout().height"
3529
+ aria-hidden="true"
3530
+ (pointerleave)="tip.set(null)"
3531
+ >
3532
+ @for (tick of layout().ticksY; track tick.label + '-' + tick.labelY) {
3533
+ @if (showGrid()) {
3534
+ <line class="ngx-grid" [attr.x1]="tick.x1" [attr.y1]="tick.y1" [attr.x2]="tick.x2" [attr.y2]="tick.y2" />
3535
+ }
3536
+ <text [attr.x]="tick.labelX" [attr.y]="tick.labelY" text-anchor="end" dominant-baseline="middle">{{ tick.label }}</text>
3537
+ }
3538
+ @for (tick of layout().ticksX; track tick.label + '-' + tick.labelX) {
3539
+ @if (showGrid()) {
3540
+ <line class="ngx-grid" [attr.x1]="tick.x1" [attr.y1]="tick.y1" [attr.x2]="tick.x2" [attr.y2]="tick.y2" />
3541
+ }
3542
+ <text [attr.x]="tick.labelX" [attr.y]="tick.labelY" text-anchor="middle" dominant-baseline="middle">{{ tick.label }}</text>
3543
+ }
3544
+ @for (point of layout().points; track point.key) {
3545
+ <circle
3546
+ [attr.cx]="point.cx"
3547
+ [attr.cy]="point.cy"
3548
+ r="5"
3549
+ [attr.fill]="point.color"
3550
+ class="cursor-pointer"
3551
+ stroke="var(--ngx-surface)"
3552
+ stroke-width="1.5"
3553
+ [class.ngx-in]="animate()"
3554
+ (pointerenter)="onPoint(point, $event)"
3555
+ />
3556
+ }
3557
+ </svg>
3558
+ }
3559
+ </ngx-chart-frame>
3560
+ `,
3561
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"]
3562
+ }]
3563
+ }],
3564
+ propDecorators: {
3565
+ series: [{
3566
+ type: i0.Input,
3567
+ args: [{
3568
+ isSignal: true,
3569
+ alias: "series",
3570
+ required: false
3571
+ }]
3572
+ }],
3573
+ height: [{
3574
+ type: i0.Input,
3575
+ args: [{
3576
+ isSignal: true,
3577
+ alias: "height",
3578
+ required: false
3579
+ }]
3580
+ }],
3581
+ showLegend: [{
3582
+ type: i0.Input,
3583
+ args: [{
3584
+ isSignal: true,
3585
+ alias: "showLegend",
3586
+ required: false
3587
+ }]
3588
+ }],
3589
+ showGrid: [{
3590
+ type: i0.Input,
3591
+ args: [{
3592
+ isSignal: true,
3593
+ alias: "showGrid",
3594
+ required: false
3595
+ }]
3596
+ }],
3597
+ format: [{
3598
+ type: i0.Input,
3599
+ args: [{
3600
+ isSignal: true,
3601
+ alias: "format",
3602
+ required: false
3603
+ }]
3604
+ }],
3605
+ currency: [{
3606
+ type: i0.Input,
3607
+ args: [{
3608
+ isSignal: true,
3609
+ alias: "currency",
3610
+ required: false
3611
+ }]
3612
+ }],
3613
+ colors: [{
3614
+ type: i0.Input,
3615
+ args: [{
3616
+ isSignal: true,
3617
+ alias: "colors",
3618
+ required: false
3619
+ }]
3620
+ }],
3621
+ ariaLabel: [{
3622
+ type: i0.Input,
3623
+ args: [{
3624
+ isSignal: true,
3625
+ alias: "ariaLabel",
3626
+ required: false
3627
+ }]
3628
+ }],
3629
+ title: [{
3630
+ type: i0.Input,
3631
+ args: [{
3632
+ isSignal: true,
3633
+ alias: "title",
3634
+ required: false
3635
+ }]
3636
+ }],
3637
+ animate: [{
3638
+ type: i0.Input,
3639
+ args: [{
3640
+ isSignal: true,
3641
+ alias: "animate",
3642
+ required: false
3643
+ }]
3644
+ }]
3645
+ }
3646
+ });
3647
+ var NgxSparkline = class NgxSparkline {
3648
+ data = input([], ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
3649
+ height = input(56, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
3650
+ fill = input(true, ...ngDevMode ? [{ debugName: "fill" }] : /* istanbul ignore next */ []);
3651
+ format = input("number", ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
3652
+ currency = input("USD", ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
3653
+ color = input(void 0, ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
3654
+ ariaLabel = input("Sparkline", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
3655
+ title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
3656
+ box = chartBox(this.height);
3657
+ tip = signal(null, ...ngDevMode ? [{ debugName: "tip" }] : /* istanbul ignore next */ []);
3658
+ formatter = computed(() => resolveFormat(this.format(), this.currency()), ...ngDevMode ? [{ debugName: "formatter" }] : /* istanbul ignore next */ []);
3659
+ layout = computed(() => layoutSparkline({
3660
+ data: this.data(),
3661
+ width: this.box.width(),
3662
+ height: this.height(),
3663
+ format: this.formatter(),
3664
+ color: this.color()
3665
+ }), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
3666
+ rows = computed(() => this.data().map((value, index) => [String(index + 1), this.formatter()(value)]), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
3667
+ onEnter(event) {
3668
+ const last = this.layout().last;
3669
+ if (!last) return;
3670
+ this.tip.set(tooltipAt(event, this.ariaLabel(), [{
3671
+ swatch: this.layout().color,
3672
+ label: "Latest",
3673
+ value: last.formatted
3674
+ }]));
3675
+ }
3676
+ static ɵfac = i0.ɵɵngDeclareFactory({
3677
+ minVersion: "12.0.0",
3678
+ version: "22.2.3",
3679
+ ngImport: i0,
3680
+ type: NgxSparkline,
3681
+ deps: [],
3682
+ target: i0.ɵɵFactoryTarget.Component
3683
+ });
3684
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3685
+ minVersion: "17.0.0",
3686
+ version: "22.2.3",
3687
+ type: NgxSparkline,
3688
+ isStandalone: true,
3689
+ selector: "ngx-sparkline",
3690
+ inputs: {
3691
+ data: {
3692
+ classPropertyName: "data",
3693
+ publicName: "data",
3694
+ isSignal: true,
3695
+ isRequired: false,
3696
+ transformFunction: null
3697
+ },
3698
+ height: {
3699
+ classPropertyName: "height",
3700
+ publicName: "height",
3701
+ isSignal: true,
3702
+ isRequired: false,
3703
+ transformFunction: null
3704
+ },
3705
+ fill: {
3706
+ classPropertyName: "fill",
3707
+ publicName: "fill",
3708
+ isSignal: true,
3709
+ isRequired: false,
3710
+ transformFunction: null
3711
+ },
3712
+ format: {
3713
+ classPropertyName: "format",
3714
+ publicName: "format",
3715
+ isSignal: true,
3716
+ isRequired: false,
3717
+ transformFunction: null
3718
+ },
3719
+ currency: {
3720
+ classPropertyName: "currency",
3721
+ publicName: "currency",
3722
+ isSignal: true,
3723
+ isRequired: false,
3724
+ transformFunction: null
3725
+ },
3726
+ color: {
3727
+ classPropertyName: "color",
3728
+ publicName: "color",
3729
+ isSignal: true,
3730
+ isRequired: false,
3731
+ transformFunction: null
3732
+ },
3733
+ ariaLabel: {
3734
+ classPropertyName: "ariaLabel",
3735
+ publicName: "ariaLabel",
3736
+ isSignal: true,
3737
+ isRequired: false,
3738
+ transformFunction: null
3739
+ },
3740
+ title: {
3741
+ classPropertyName: "title",
3742
+ publicName: "title",
3743
+ isSignal: true,
3744
+ isRequired: false,
3745
+ transformFunction: null
3746
+ }
3747
+ },
3748
+ host: { properties: { "style.--ngx-chart-height.px": "height()" } },
3749
+ ngImport: i0,
3750
+ template: `
3751
+ <ngx-chart-frame [title]="title()" [ariaLabel]="ariaLabel()" [tooltip]="tip()" [srHeaders]="['Index', 'Value']" [srRows]="rows()">
3752
+ @if (layout().empty) {
3753
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">No data yet.</p>
3754
+ } @else {
3755
+ <svg
3756
+ class="block w-full max-w-full"
3757
+ [style.height.px]="height()"
3758
+ [attr.viewBox]="'0 0 ' + layout().width + ' ' + layout().height"
3759
+ aria-hidden="true"
3760
+ (pointerleave)="tip.set(null)"
3761
+ (pointerenter)="onEnter($event)"
3762
+ >
3763
+ @if (fill() && layout().area) {
3764
+ <path [attr.d]="layout().area" [attr.fill]="layout().color" fill-opacity="0.16" />
3765
+ }
3766
+ <path [attr.d]="layout().line" fill="none" [attr.stroke]="layout().color" stroke-width="2" stroke-linejoin="round" stroke-linecap="round" />
3767
+ @if (layout().last; as last) {
3768
+ <circle [attr.cx]="last.x" [attr.cy]="last.y" r="3" [attr.fill]="layout().color" />
3769
+ }
3770
+ </svg>
3771
+ }
3772
+ </ngx-chart-frame>
3773
+ `,
3774
+ isInline: true,
3775
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"],
3776
+ dependencies: [{
3777
+ kind: "component",
3778
+ type: NgxChartFrame,
3779
+ selector: "ngx-chart-frame",
3780
+ inputs: [
3781
+ "title",
3782
+ "ariaLabel",
3783
+ "legend",
3784
+ "showLegend",
3785
+ "tooltip",
3786
+ "srHeaders",
3787
+ "srRows",
3788
+ "range"
3789
+ ]
3790
+ }],
3791
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
3792
+ });
3793
+ };
3794
+ i0.ɵɵngDeclareClassMetadata({
3795
+ minVersion: "12.0.0",
3796
+ version: "22.2.3",
3797
+ ngImport: i0,
3798
+ type: NgxSparkline,
3799
+ decorators: [{
3800
+ type: Component,
3801
+ args: [{
3802
+ selector: "ngx-sparkline",
3803
+ changeDetection: ChangeDetectionStrategy.OnPush,
3804
+ imports: [NgxChartFrame],
3805
+ host: { "[style.--ngx-chart-height.px]": "height()" },
3806
+ template: `
3807
+ <ngx-chart-frame [title]="title()" [ariaLabel]="ariaLabel()" [tooltip]="tip()" [srHeaders]="['Index', 'Value']" [srRows]="rows()">
3808
+ @if (layout().empty) {
3809
+ <p class="flex items-center justify-center text-sm" [style.height.px]="height()">No data yet.</p>
3810
+ } @else {
3811
+ <svg
3812
+ class="block w-full max-w-full"
3813
+ [style.height.px]="height()"
3814
+ [attr.viewBox]="'0 0 ' + layout().width + ' ' + layout().height"
3815
+ aria-hidden="true"
3816
+ (pointerleave)="tip.set(null)"
3817
+ (pointerenter)="onEnter($event)"
3818
+ >
3819
+ @if (fill() && layout().area) {
3820
+ <path [attr.d]="layout().area" [attr.fill]="layout().color" fill-opacity="0.16" />
3821
+ }
3822
+ <path [attr.d]="layout().line" fill="none" [attr.stroke]="layout().color" stroke-width="2" stroke-linejoin="round" stroke-linecap="round" />
3823
+ @if (layout().last; as last) {
3824
+ <circle [attr.cx]="last.x" [attr.cy]="last.y" r="3" [attr.fill]="layout().color" />
3825
+ }
3826
+ </svg>
3827
+ }
3828
+ </ngx-chart-frame>
3829
+ `,
3830
+ styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"]
3831
+ }]
3832
+ }],
3833
+ propDecorators: {
3834
+ data: [{
3835
+ type: i0.Input,
3836
+ args: [{
3837
+ isSignal: true,
3838
+ alias: "data",
3839
+ required: false
3840
+ }]
3841
+ }],
3842
+ height: [{
3843
+ type: i0.Input,
3844
+ args: [{
3845
+ isSignal: true,
3846
+ alias: "height",
3847
+ required: false
3848
+ }]
3849
+ }],
3850
+ fill: [{
3851
+ type: i0.Input,
3852
+ args: [{
3853
+ isSignal: true,
3854
+ alias: "fill",
3855
+ required: false
3856
+ }]
3857
+ }],
3858
+ format: [{
3859
+ type: i0.Input,
3860
+ args: [{
3861
+ isSignal: true,
3862
+ alias: "format",
3863
+ required: false
3864
+ }]
3865
+ }],
3866
+ currency: [{
3867
+ type: i0.Input,
3868
+ args: [{
3869
+ isSignal: true,
3870
+ alias: "currency",
3871
+ required: false
3872
+ }]
3873
+ }],
3874
+ color: [{
3875
+ type: i0.Input,
3876
+ args: [{
3877
+ isSignal: true,
3878
+ alias: "color",
3879
+ required: false
3880
+ }]
3881
+ }],
3882
+ ariaLabel: [{
3883
+ type: i0.Input,
3884
+ args: [{
3885
+ isSignal: true,
3886
+ alias: "ariaLabel",
3887
+ required: false
3888
+ }]
3889
+ }],
3890
+ title: [{
3891
+ type: i0.Input,
3892
+ args: [{
3893
+ isSignal: true,
3894
+ alias: "title",
3895
+ required: false
3896
+ }]
3897
+ }]
3898
+ }
3899
+ });
3900
+ export { NgxLineChart as NgxAreaChart, NgxLineChart, NgxBarChart, NgxPieChart as NgxDonutChart, NgxPieChart, NgxGaugeChart, NgxHeatmap, NgxRadarChart, NgxScatterChart, NgxSparkline, resolveFormat };
3901
+
3902
+ //# sourceMappingURL=codeauradev-ngx-wind-charts.mjs.map