@codeauradev/ngx-wind-charts 1.0.4 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/codeauradev-ngx-wind-charts-map.mjs +11 -5
- package/fesm2022/codeauradev-ngx-wind-charts-map.mjs.map +1 -1
- package/fesm2022/codeauradev-ngx-wind-charts.mjs +222 -25
- package/fesm2022/codeauradev-ngx-wind-charts.mjs.map +1 -1
- package/ngx-charts.css +39 -0
- package/package.json +1 -1
- package/types/codeauradev-ngx-wind-charts.d.ts +53 -0
|
@@ -178,9 +178,29 @@ function box(width, height, pad) {
|
|
|
178
178
|
height: Math.max(1, height - pad.top - pad.bottom)
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
+
function reserveAxis(pad, xLabel, yLabel) {
|
|
182
|
+
if (yLabel?.trim()) pad.left += 18;
|
|
183
|
+
if (xLabel?.trim()) pad.bottom += 16;
|
|
184
|
+
}
|
|
185
|
+
function axisTitles(plot, xLabel, yLabel) {
|
|
186
|
+
const x = xLabel?.trim();
|
|
187
|
+
const y = yLabel?.trim();
|
|
188
|
+
return {
|
|
189
|
+
xAxis: x ? {
|
|
190
|
+
label: x,
|
|
191
|
+
x: round(plot.left + plot.width / 2),
|
|
192
|
+
y: round(plot.bottom + 34)
|
|
193
|
+
} : null,
|
|
194
|
+
yAxis: y ? {
|
|
195
|
+
label: y,
|
|
196
|
+
x: 12,
|
|
197
|
+
y: round(plot.top + plot.height / 2)
|
|
198
|
+
} : null
|
|
199
|
+
};
|
|
200
|
+
}
|
|
181
201
|
function yTicks(values, format, plot) {
|
|
182
202
|
const y = scale(values[0] ?? 0, values[values.length - 1] ?? 1, plot.bottom, plot.top);
|
|
183
|
-
|
|
203
|
+
const marks = values.map((value) => {
|
|
184
204
|
const py = round(y(value));
|
|
185
205
|
return {
|
|
186
206
|
x1: plot.left,
|
|
@@ -193,6 +213,9 @@ function yTicks(values, format, plot) {
|
|
|
193
213
|
anchor: "end"
|
|
194
214
|
};
|
|
195
215
|
});
|
|
216
|
+
const kept = [];
|
|
217
|
+
for (const tick of marks) if (kept.every((item) => Math.abs(item.labelY - tick.labelY) >= 14)) kept.push(tick);
|
|
218
|
+
return kept.length > 0 ? kept : marks.slice(0, 1);
|
|
196
219
|
}
|
|
197
220
|
function xValueTicks(values, format, plot) {
|
|
198
221
|
const x = scale(values[0] ?? 0, values[values.length - 1] ?? 1, plot.left, plot.right);
|
|
@@ -224,7 +247,19 @@ function layoutBars(input) {
|
|
|
224
247
|
const palette = input.palette ?? DEFAULT_PALETTE;
|
|
225
248
|
const categories = input.categories;
|
|
226
249
|
const series = input.series;
|
|
227
|
-
const
|
|
250
|
+
const stacked = input.mode === "stacked";
|
|
251
|
+
const values = [];
|
|
252
|
+
if (stacked) categories.forEach((_, index) => {
|
|
253
|
+
let positive = 0;
|
|
254
|
+
let negative = 0;
|
|
255
|
+
for (const item of series) {
|
|
256
|
+
const value = num(item.data[index] ?? 0);
|
|
257
|
+
if (value >= 0) positive += value;
|
|
258
|
+
else negative += value;
|
|
259
|
+
}
|
|
260
|
+
values.push(positive, negative);
|
|
261
|
+
});
|
|
262
|
+
else series.forEach((item) => item.data.forEach((value) => values.push(num(value))));
|
|
228
263
|
const empty = categories.length === 0 || series.length === 0;
|
|
229
264
|
const domain = domainOf(values, true, input.max);
|
|
230
265
|
const longest = domain.ticks.reduce((max, tick) => Math.max(max, input.format(tick).length), 2);
|
|
@@ -241,9 +276,15 @@ function layoutBars(input) {
|
|
|
241
276
|
bottom: 28,
|
|
242
277
|
left: Math.min(96, Math.max(40, longest * 7 + 14))
|
|
243
278
|
};
|
|
244
|
-
const width = Math.max(input.width,
|
|
245
|
-
const height = Math.max(input.height,
|
|
279
|
+
const width = Math.max(input.width, 1);
|
|
280
|
+
const height = Math.max(input.height, 1);
|
|
281
|
+
pad.left = Math.min(pad.left, Math.max(16, width * .46));
|
|
282
|
+
pad.right = Math.min(pad.right, Math.max(8, width * .2));
|
|
283
|
+
pad.top = Math.min(pad.top, Math.max(4, height * .16));
|
|
284
|
+
pad.bottom = Math.min(pad.bottom, Math.max(8, height * .34));
|
|
285
|
+
reserveAxis(pad, input.xLabel, input.yLabel);
|
|
246
286
|
const plot = box(width, height, pad);
|
|
287
|
+
const axes = axisTitles(plot, input.xLabel, input.yLabel);
|
|
247
288
|
const legend = series.length > 1 || series.some((item) => item.name !== "Value") ? legendOf(series, palette) : legendOf(series, palette);
|
|
248
289
|
if (empty) return {
|
|
249
290
|
empty: true,
|
|
@@ -253,7 +294,8 @@ function layoutBars(input) {
|
|
|
253
294
|
ticks: [],
|
|
254
295
|
categories: [],
|
|
255
296
|
zero: null,
|
|
256
|
-
legend: []
|
|
297
|
+
legend: [],
|
|
298
|
+
...axes
|
|
257
299
|
};
|
|
258
300
|
const marks = [];
|
|
259
301
|
const mode = input.mode;
|
|
@@ -317,7 +359,8 @@ function layoutBars(input) {
|
|
|
317
359
|
x2: plot.right,
|
|
318
360
|
y2: zeroY
|
|
319
361
|
} : null,
|
|
320
|
-
legend
|
|
362
|
+
legend,
|
|
363
|
+
...axes
|
|
321
364
|
};
|
|
322
365
|
}
|
|
323
366
|
const x = scale(domain.min, domain.max, plot.left, plot.right);
|
|
@@ -377,7 +420,8 @@ function layoutBars(input) {
|
|
|
377
420
|
x2: zeroX,
|
|
378
421
|
y2: plot.bottom
|
|
379
422
|
} : null,
|
|
380
|
-
legend
|
|
423
|
+
legend,
|
|
424
|
+
...axes
|
|
381
425
|
};
|
|
382
426
|
}
|
|
383
427
|
function barMark(category, seriesName, value, format, color, x, y, width, height, showValues, key, horizontal = false) {
|
|
@@ -414,9 +458,11 @@ function layoutTrend(input) {
|
|
|
414
458
|
bottom: 28,
|
|
415
459
|
left: Math.min(96, Math.max(40, longest * 7 + 14))
|
|
416
460
|
};
|
|
461
|
+
reserveAxis(pad, input.xLabel, input.yLabel);
|
|
417
462
|
const width = Math.max(input.width, pad.left + pad.right + 40);
|
|
418
463
|
const height = Math.max(input.height, pad.top + pad.bottom + 40);
|
|
419
464
|
const plot = box(width, height, pad);
|
|
465
|
+
const axes = axisTitles(plot, input.xLabel, input.yLabel);
|
|
420
466
|
if (empty) return {
|
|
421
467
|
empty: true,
|
|
422
468
|
width,
|
|
@@ -427,7 +473,8 @@ function layoutTrend(input) {
|
|
|
427
473
|
zero: null,
|
|
428
474
|
baseline: height,
|
|
429
475
|
fromZero: false,
|
|
430
|
-
legend: []
|
|
476
|
+
legend: [],
|
|
477
|
+
...axes
|
|
431
478
|
};
|
|
432
479
|
const y = scale(domain.min, domain.max, plot.bottom, plot.top);
|
|
433
480
|
const xAt = (index) => {
|
|
@@ -501,7 +548,8 @@ function layoutTrend(input) {
|
|
|
501
548
|
} : null,
|
|
502
549
|
baseline,
|
|
503
550
|
fromZero: domain.min <= 0 && domain.max >= 0,
|
|
504
|
-
legend: legendOf(series, palette)
|
|
551
|
+
legend: legendOf(series, palette),
|
|
552
|
+
...axes
|
|
505
553
|
};
|
|
506
554
|
}
|
|
507
555
|
function layoutPie(input) {
|
|
@@ -650,17 +698,21 @@ function layoutScatter(input) {
|
|
|
650
698
|
ticksX: [],
|
|
651
699
|
ticksY: [],
|
|
652
700
|
points: [],
|
|
653
|
-
legend: []
|
|
701
|
+
legend: [],
|
|
702
|
+
xAxis: null,
|
|
703
|
+
yAxis: null
|
|
654
704
|
};
|
|
655
705
|
const xDomain = domainOf(pointsIn.map((point) => num(point.x)), false);
|
|
656
706
|
const yDomain = domainOf(pointsIn.map((point) => num(point.y)), false);
|
|
657
707
|
const longest = yDomain.ticks.reduce((max, tick) => Math.max(max, input.format(tick).length), 2);
|
|
658
|
-
const
|
|
708
|
+
const pad = {
|
|
659
709
|
top: 16,
|
|
660
710
|
right: 16,
|
|
661
711
|
bottom: 32,
|
|
662
712
|
left: Math.min(96, Math.max(40, longest * 7 + 14))
|
|
663
|
-
}
|
|
713
|
+
};
|
|
714
|
+
reserveAxis(pad, input.xLabel, input.yLabel);
|
|
715
|
+
const plot = box(width, height, pad);
|
|
664
716
|
const x = scale(xDomain.min, xDomain.max, plot.left, plot.right);
|
|
665
717
|
const y = scale(yDomain.min, yDomain.max, plot.bottom, plot.top);
|
|
666
718
|
const points = series.reduce((all, item, seriesIndex) => {
|
|
@@ -685,7 +737,8 @@ function layoutScatter(input) {
|
|
|
685
737
|
ticksX: xValueTicks(xDomain.ticks, input.format, plot),
|
|
686
738
|
ticksY: yTicks(yDomain.ticks, input.format, plot),
|
|
687
739
|
points,
|
|
688
|
-
legend: legendOf(series, palette)
|
|
740
|
+
legend: legendOf(series, palette),
|
|
741
|
+
...axisTitles(plot, input.xLabel, input.yLabel)
|
|
689
742
|
};
|
|
690
743
|
}
|
|
691
744
|
function layoutGauge(input) {
|
|
@@ -962,7 +1015,7 @@ var NgxChartFrame = class NgxChartFrame {
|
|
|
962
1015
|
</figure>
|
|
963
1016
|
`,
|
|
964
1017
|
isInline: true,
|
|
965
|
-
styles: [":host{display:
|
|
1018
|
+
styles: [":host{display:flex;flex-direction:column;box-sizing:border-box;width:100%;max-width:100%;min-width:0;min-height:0;height:100%}\n"],
|
|
966
1019
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
967
1020
|
});
|
|
968
1021
|
};
|
|
@@ -1034,7 +1087,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1034
1087
|
</table>
|
|
1035
1088
|
</figure>
|
|
1036
1089
|
`,
|
|
1037
|
-
styles: [":host{display:
|
|
1090
|
+
styles: [":host{display:flex;flex-direction:column;box-sizing:border-box;width:100%;max-width:100%;min-width:0;min-height:0;height:100%}\n"]
|
|
1038
1091
|
}]
|
|
1039
1092
|
}],
|
|
1040
1093
|
propDecorators: {
|
|
@@ -1141,16 +1194,22 @@ function chartBox(preferred, initialWidth = 640) {
|
|
|
1141
1194
|
const destroyRef = inject(DestroyRef);
|
|
1142
1195
|
const width = signal(initialWidth, ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
|
|
1143
1196
|
const height = signal(Math.max(1, preferred()), ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
|
|
1144
|
-
|
|
1197
|
+
let measure = () => height.set(Math.max(1, preferred()));
|
|
1198
|
+
effect(() => {
|
|
1199
|
+
preferred();
|
|
1200
|
+
measure();
|
|
1201
|
+
});
|
|
1145
1202
|
afterNextRender(() => {
|
|
1146
1203
|
const root = host.nativeElement;
|
|
1147
|
-
|
|
1204
|
+
measure = () => {
|
|
1205
|
+
const preferredH = Math.max(1, preferred());
|
|
1148
1206
|
const nextW = root.clientWidth;
|
|
1149
1207
|
if (nextW > 0) width.set(Math.round(nextW));
|
|
1208
|
+
height.set(preferredH);
|
|
1150
1209
|
};
|
|
1151
1210
|
measure();
|
|
1152
1211
|
if (typeof ResizeObserver === "undefined") return;
|
|
1153
|
-
const observer = new ResizeObserver(measure);
|
|
1212
|
+
const observer = new ResizeObserver(() => measure());
|
|
1154
1213
|
observer.observe(root);
|
|
1155
1214
|
destroyRef.onDestroy(() => observer.disconnect());
|
|
1156
1215
|
});
|
|
@@ -1175,6 +1234,8 @@ var NgxLineChart = class NgxLineChart {
|
|
|
1175
1234
|
colors = input(void 0, ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
|
|
1176
1235
|
ariaLabel = input("Line chart", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
1177
1236
|
title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
1237
|
+
xLabel = input(void 0, ...ngDevMode ? [{ debugName: "xLabel" }] : /* istanbul ignore next */ []);
|
|
1238
|
+
yLabel = input(void 0, ...ngDevMode ? [{ debugName: "yLabel" }] : /* istanbul ignore next */ []);
|
|
1178
1239
|
min = input(void 0, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
|
|
1179
1240
|
animate = input(true, ...ngDevMode ? [{ debugName: "animate" }] : /* istanbul ignore next */ []);
|
|
1180
1241
|
box = chartBox(this.height);
|
|
@@ -1194,7 +1255,9 @@ var NgxLineChart = class NgxLineChart {
|
|
|
1194
1255
|
format: resolveFormat(this.format(), this.currency()),
|
|
1195
1256
|
filled: this.filled(),
|
|
1196
1257
|
stacked: this.stacked(),
|
|
1197
|
-
min: this.min()
|
|
1258
|
+
min: this.min(),
|
|
1259
|
+
xLabel: this.xLabel(),
|
|
1260
|
+
yLabel: this.yLabel()
|
|
1198
1261
|
}), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
1199
1262
|
legendOn = computed(() => this.showLegend() ?? this.layout().legend.length > 1, ...ngDevMode ? [{ debugName: "legendOn" }] : /* istanbul ignore next */ []);
|
|
1200
1263
|
riseOrigin = computed(() => this.layout().baseline / Math.max(this.layout().height, 1) * 100, ...ngDevMode ? [{ debugName: "riseOrigin" }] : /* istanbul ignore next */ []);
|
|
@@ -1315,6 +1378,20 @@ var NgxLineChart = class NgxLineChart {
|
|
|
1315
1378
|
isRequired: false,
|
|
1316
1379
|
transformFunction: null
|
|
1317
1380
|
},
|
|
1381
|
+
xLabel: {
|
|
1382
|
+
classPropertyName: "xLabel",
|
|
1383
|
+
publicName: "xLabel",
|
|
1384
|
+
isSignal: true,
|
|
1385
|
+
isRequired: false,
|
|
1386
|
+
transformFunction: null
|
|
1387
|
+
},
|
|
1388
|
+
yLabel: {
|
|
1389
|
+
classPropertyName: "yLabel",
|
|
1390
|
+
publicName: "yLabel",
|
|
1391
|
+
isSignal: true,
|
|
1392
|
+
isRequired: false,
|
|
1393
|
+
transformFunction: null
|
|
1394
|
+
},
|
|
1318
1395
|
min: {
|
|
1319
1396
|
classPropertyName: "min",
|
|
1320
1397
|
publicName: "min",
|
|
@@ -1420,6 +1497,12 @@ var NgxLineChart = class NgxLineChart {
|
|
|
1420
1497
|
@for (label of layout().categories; track label.label + '-' + label.x) {
|
|
1421
1498
|
<text [attr.x]="label.x" [attr.y]="label.y" text-anchor="middle" dominant-baseline="middle">{{ label.label }}</text>
|
|
1422
1499
|
}
|
|
1500
|
+
@if (layout().yAxis; as axis) {
|
|
1501
|
+
<text class="ngx-axis" [attr.x]="axis.x" [attr.y]="axis.y" text-anchor="middle" dominant-baseline="middle" [attr.transform]="'rotate(-90 ' + axis.x + ' ' + axis.y + ')'">{{ axis.label }}</text>
|
|
1502
|
+
}
|
|
1503
|
+
@if (layout().xAxis; as axis) {
|
|
1504
|
+
<text class="ngx-axis" [attr.x]="axis.x" [attr.y]="axis.y" text-anchor="middle" dominant-baseline="middle">{{ axis.label }}</text>
|
|
1505
|
+
}
|
|
1423
1506
|
</svg>
|
|
1424
1507
|
}
|
|
1425
1508
|
</ngx-chart-frame>
|
|
@@ -1544,6 +1627,12 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1544
1627
|
@for (label of layout().categories; track label.label + '-' + label.x) {
|
|
1545
1628
|
<text [attr.x]="label.x" [attr.y]="label.y" text-anchor="middle" dominant-baseline="middle">{{ label.label }}</text>
|
|
1546
1629
|
}
|
|
1630
|
+
@if (layout().yAxis; as axis) {
|
|
1631
|
+
<text class="ngx-axis" [attr.x]="axis.x" [attr.y]="axis.y" text-anchor="middle" dominant-baseline="middle" [attr.transform]="'rotate(-90 ' + axis.x + ' ' + axis.y + ')'">{{ axis.label }}</text>
|
|
1632
|
+
}
|
|
1633
|
+
@if (layout().xAxis; as axis) {
|
|
1634
|
+
<text class="ngx-axis" [attr.x]="axis.x" [attr.y]="axis.y" text-anchor="middle" dominant-baseline="middle">{{ axis.label }}</text>
|
|
1635
|
+
}
|
|
1547
1636
|
</svg>
|
|
1548
1637
|
}
|
|
1549
1638
|
</ngx-chart-frame>
|
|
@@ -1648,6 +1737,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1648
1737
|
required: false
|
|
1649
1738
|
}]
|
|
1650
1739
|
}],
|
|
1740
|
+
xLabel: [{
|
|
1741
|
+
type: i0.Input,
|
|
1742
|
+
args: [{
|
|
1743
|
+
isSignal: true,
|
|
1744
|
+
alias: "xLabel",
|
|
1745
|
+
required: false
|
|
1746
|
+
}]
|
|
1747
|
+
}],
|
|
1748
|
+
yLabel: [{
|
|
1749
|
+
type: i0.Input,
|
|
1750
|
+
args: [{
|
|
1751
|
+
isSignal: true,
|
|
1752
|
+
alias: "yLabel",
|
|
1753
|
+
required: false
|
|
1754
|
+
}]
|
|
1755
|
+
}],
|
|
1651
1756
|
min: [{
|
|
1652
1757
|
type: i0.Input,
|
|
1653
1758
|
args: [{
|
|
@@ -1681,6 +1786,8 @@ var NgxBarChart = class NgxBarChart {
|
|
|
1681
1786
|
colors = input(void 0, ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
|
|
1682
1787
|
ariaLabel = input("Bar chart", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
1683
1788
|
title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
1789
|
+
xLabel = input(void 0, ...ngDevMode ? [{ debugName: "xLabel" }] : /* istanbul ignore next */ []);
|
|
1790
|
+
yLabel = input(void 0, ...ngDevMode ? [{ debugName: "yLabel" }] : /* istanbul ignore next */ []);
|
|
1684
1791
|
max = input(void 0, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
|
|
1685
1792
|
animate = input(true, ...ngDevMode ? [{ debugName: "animate" }] : /* istanbul ignore next */ []);
|
|
1686
1793
|
box = chartBox(this.height);
|
|
@@ -1701,7 +1808,9 @@ var NgxBarChart = class NgxBarChart {
|
|
|
1701
1808
|
palette: this.colors(),
|
|
1702
1809
|
format: resolveFormat(this.format(), this.currency()),
|
|
1703
1810
|
showValues: this.showValues(),
|
|
1704
|
-
max: this.max()
|
|
1811
|
+
max: this.max(),
|
|
1812
|
+
xLabel: this.xLabel(),
|
|
1813
|
+
yLabel: this.yLabel()
|
|
1705
1814
|
}), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
1706
1815
|
legendOn = computed(() => this.showLegend() ?? this.layout().legend.length > 1, ...ngDevMode ? [{ debugName: "legendOn" }] : /* istanbul ignore next */ []);
|
|
1707
1816
|
headers = computed(() => ["Category", ...this.normalized().series.map((item) => item.name)], ...ngDevMode ? [{ debugName: "headers" }] : /* istanbul ignore next */ []);
|
|
@@ -1826,6 +1935,20 @@ var NgxBarChart = class NgxBarChart {
|
|
|
1826
1935
|
isRequired: false,
|
|
1827
1936
|
transformFunction: null
|
|
1828
1937
|
},
|
|
1938
|
+
xLabel: {
|
|
1939
|
+
classPropertyName: "xLabel",
|
|
1940
|
+
publicName: "xLabel",
|
|
1941
|
+
isSignal: true,
|
|
1942
|
+
isRequired: false,
|
|
1943
|
+
transformFunction: null
|
|
1944
|
+
},
|
|
1945
|
+
yLabel: {
|
|
1946
|
+
classPropertyName: "yLabel",
|
|
1947
|
+
publicName: "yLabel",
|
|
1948
|
+
isSignal: true,
|
|
1949
|
+
isRequired: false,
|
|
1950
|
+
transformFunction: null
|
|
1951
|
+
},
|
|
1829
1952
|
max: {
|
|
1830
1953
|
classPropertyName: "max",
|
|
1831
1954
|
publicName: "max",
|
|
@@ -1881,7 +2004,7 @@ var NgxBarChart = class NgxBarChart {
|
|
|
1881
2004
|
[attr.width]="mark.width"
|
|
1882
2005
|
[attr.height]="mark.height"
|
|
1883
2006
|
[attr.fill]="mark.color"
|
|
1884
|
-
rx="3"
|
|
2007
|
+
[attr.rx]="mode() === 'stacked' ? 0 : 3"
|
|
1885
2008
|
class="cursor-pointer"
|
|
1886
2009
|
[class.ngx-grow-y]="animate() && orientation() !== 'horizontal'"
|
|
1887
2010
|
[class.ngx-grow-x]="animate() && orientation() === 'horizontal'"
|
|
@@ -1911,12 +2034,18 @@ var NgxBarChart = class NgxBarChart {
|
|
|
1911
2034
|
{{ label.label }}
|
|
1912
2035
|
</text>
|
|
1913
2036
|
}
|
|
2037
|
+
@if (layout().yAxis; as axis) {
|
|
2038
|
+
<text class="ngx-axis" [attr.x]="axis.x" [attr.y]="axis.y" text-anchor="middle" dominant-baseline="middle" [attr.transform]="'rotate(-90 ' + axis.x + ' ' + axis.y + ')'">{{ axis.label }}</text>
|
|
2039
|
+
}
|
|
2040
|
+
@if (layout().xAxis; as axis) {
|
|
2041
|
+
<text class="ngx-axis" [attr.x]="axis.x" [attr.y]="axis.y" text-anchor="middle" dominant-baseline="middle">{{ axis.label }}</text>
|
|
2042
|
+
}
|
|
1914
2043
|
</svg>
|
|
1915
2044
|
}
|
|
1916
2045
|
</ngx-chart-frame>
|
|
1917
2046
|
`,
|
|
1918
2047
|
isInline: true,
|
|
1919
|
-
styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"],
|
|
2048
|
+
styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n", ":host{display:block;min-height:var(--ngx-chart-height,320px)}\n"],
|
|
1920
2049
|
dependencies: [{
|
|
1921
2050
|
kind: "component",
|
|
1922
2051
|
type: NgxChartFrame,
|
|
@@ -1985,7 +2114,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1985
2114
|
[attr.width]="mark.width"
|
|
1986
2115
|
[attr.height]="mark.height"
|
|
1987
2116
|
[attr.fill]="mark.color"
|
|
1988
|
-
rx="3"
|
|
2117
|
+
[attr.rx]="mode() === 'stacked' ? 0 : 3"
|
|
1989
2118
|
class="cursor-pointer"
|
|
1990
2119
|
[class.ngx-grow-y]="animate() && orientation() !== 'horizontal'"
|
|
1991
2120
|
[class.ngx-grow-x]="animate() && orientation() === 'horizontal'"
|
|
@@ -2015,11 +2144,17 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2015
2144
|
{{ label.label }}
|
|
2016
2145
|
</text>
|
|
2017
2146
|
}
|
|
2147
|
+
@if (layout().yAxis; as axis) {
|
|
2148
|
+
<text class="ngx-axis" [attr.x]="axis.x" [attr.y]="axis.y" text-anchor="middle" dominant-baseline="middle" [attr.transform]="'rotate(-90 ' + axis.x + ' ' + axis.y + ')'">{{ axis.label }}</text>
|
|
2149
|
+
}
|
|
2150
|
+
@if (layout().xAxis; as axis) {
|
|
2151
|
+
<text class="ngx-axis" [attr.x]="axis.x" [attr.y]="axis.y" text-anchor="middle" dominant-baseline="middle">{{ axis.label }}</text>
|
|
2152
|
+
}
|
|
2018
2153
|
</svg>
|
|
2019
2154
|
}
|
|
2020
2155
|
</ngx-chart-frame>
|
|
2021
2156
|
`,
|
|
2022
|
-
styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n"]
|
|
2157
|
+
styles: [":host{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0}\n", ":host{display:block;min-height:var(--ngx-chart-height,320px)}\n"]
|
|
2023
2158
|
}]
|
|
2024
2159
|
}],
|
|
2025
2160
|
propDecorators: {
|
|
@@ -2135,6 +2270,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2135
2270
|
required: false
|
|
2136
2271
|
}]
|
|
2137
2272
|
}],
|
|
2273
|
+
xLabel: [{
|
|
2274
|
+
type: i0.Input,
|
|
2275
|
+
args: [{
|
|
2276
|
+
isSignal: true,
|
|
2277
|
+
alias: "xLabel",
|
|
2278
|
+
required: false
|
|
2279
|
+
}]
|
|
2280
|
+
}],
|
|
2281
|
+
yLabel: [{
|
|
2282
|
+
type: i0.Input,
|
|
2283
|
+
args: [{
|
|
2284
|
+
isSignal: true,
|
|
2285
|
+
alias: "yLabel",
|
|
2286
|
+
required: false
|
|
2287
|
+
}]
|
|
2288
|
+
}],
|
|
2138
2289
|
max: [{
|
|
2139
2290
|
type: i0.Input,
|
|
2140
2291
|
args: [{
|
|
@@ -3431,6 +3582,8 @@ var NgxScatterChart = class NgxScatterChart {
|
|
|
3431
3582
|
colors = input(void 0, ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
|
|
3432
3583
|
ariaLabel = input("Scatter chart", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
3433
3584
|
title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
3585
|
+
xLabel = input(void 0, ...ngDevMode ? [{ debugName: "xLabel" }] : /* istanbul ignore next */ []);
|
|
3586
|
+
yLabel = input(void 0, ...ngDevMode ? [{ debugName: "yLabel" }] : /* istanbul ignore next */ []);
|
|
3434
3587
|
animate = input(true, ...ngDevMode ? [{ debugName: "animate" }] : /* istanbul ignore next */ []);
|
|
3435
3588
|
box = chartBox(this.height);
|
|
3436
3589
|
tip = signal(null, ...ngDevMode ? [{ debugName: "tip" }] : /* istanbul ignore next */ []);
|
|
@@ -3439,7 +3592,9 @@ var NgxScatterChart = class NgxScatterChart {
|
|
|
3439
3592
|
width: this.box.width(),
|
|
3440
3593
|
height: this.height(),
|
|
3441
3594
|
palette: this.colors(),
|
|
3442
|
-
format: resolveFormat(this.format(), this.currency())
|
|
3595
|
+
format: resolveFormat(this.format(), this.currency()),
|
|
3596
|
+
xLabel: this.xLabel(),
|
|
3597
|
+
yLabel: this.yLabel()
|
|
3443
3598
|
}), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
3444
3599
|
legendOn = computed(() => this.showLegend() ?? this.layout().legend.length > 1, ...ngDevMode ? [{ debugName: "legendOn" }] : /* istanbul ignore next */ []);
|
|
3445
3600
|
rows = computed(() => this.layout().points.map((point) => [
|
|
@@ -3532,6 +3687,20 @@ var NgxScatterChart = class NgxScatterChart {
|
|
|
3532
3687
|
isRequired: false,
|
|
3533
3688
|
transformFunction: null
|
|
3534
3689
|
},
|
|
3690
|
+
xLabel: {
|
|
3691
|
+
classPropertyName: "xLabel",
|
|
3692
|
+
publicName: "xLabel",
|
|
3693
|
+
isSignal: true,
|
|
3694
|
+
isRequired: false,
|
|
3695
|
+
transformFunction: null
|
|
3696
|
+
},
|
|
3697
|
+
yLabel: {
|
|
3698
|
+
classPropertyName: "yLabel",
|
|
3699
|
+
publicName: "yLabel",
|
|
3700
|
+
isSignal: true,
|
|
3701
|
+
isRequired: false,
|
|
3702
|
+
transformFunction: null
|
|
3703
|
+
},
|
|
3535
3704
|
animate: {
|
|
3536
3705
|
classPropertyName: "animate",
|
|
3537
3706
|
publicName: "animate",
|
|
@@ -3574,6 +3743,12 @@ var NgxScatterChart = class NgxScatterChart {
|
|
|
3574
3743
|
}
|
|
3575
3744
|
<text [attr.x]="tick.labelX" [attr.y]="tick.labelY" text-anchor="middle" dominant-baseline="middle">{{ tick.label }}</text>
|
|
3576
3745
|
}
|
|
3746
|
+
@if (layout().yAxis; as axis) {
|
|
3747
|
+
<text class="ngx-axis" [attr.x]="axis.x" [attr.y]="axis.y" text-anchor="middle" dominant-baseline="middle" [attr.transform]="'rotate(-90 ' + axis.x + ' ' + axis.y + ')'">{{ axis.label }}</text>
|
|
3748
|
+
}
|
|
3749
|
+
@if (layout().xAxis; as axis) {
|
|
3750
|
+
<text class="ngx-axis" [attr.x]="axis.x" [attr.y]="axis.y" text-anchor="middle" dominant-baseline="middle">{{ axis.label }}</text>
|
|
3751
|
+
}
|
|
3577
3752
|
@for (point of layout().points; track point.key) {
|
|
3578
3753
|
<circle
|
|
3579
3754
|
[attr.cx]="point.cx"
|
|
@@ -3655,6 +3830,12 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3655
3830
|
}
|
|
3656
3831
|
<text [attr.x]="tick.labelX" [attr.y]="tick.labelY" text-anchor="middle" dominant-baseline="middle">{{ tick.label }}</text>
|
|
3657
3832
|
}
|
|
3833
|
+
@if (layout().yAxis; as axis) {
|
|
3834
|
+
<text class="ngx-axis" [attr.x]="axis.x" [attr.y]="axis.y" text-anchor="middle" dominant-baseline="middle" [attr.transform]="'rotate(-90 ' + axis.x + ' ' + axis.y + ')'">{{ axis.label }}</text>
|
|
3835
|
+
}
|
|
3836
|
+
@if (layout().xAxis; as axis) {
|
|
3837
|
+
<text class="ngx-axis" [attr.x]="axis.x" [attr.y]="axis.y" text-anchor="middle" dominant-baseline="middle">{{ axis.label }}</text>
|
|
3838
|
+
}
|
|
3658
3839
|
@for (point of layout().points; track point.key) {
|
|
3659
3840
|
<circle
|
|
3660
3841
|
[attr.cx]="point.cx"
|
|
@@ -3748,6 +3929,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3748
3929
|
required: false
|
|
3749
3930
|
}]
|
|
3750
3931
|
}],
|
|
3932
|
+
xLabel: [{
|
|
3933
|
+
type: i0.Input,
|
|
3934
|
+
args: [{
|
|
3935
|
+
isSignal: true,
|
|
3936
|
+
alias: "xLabel",
|
|
3937
|
+
required: false
|
|
3938
|
+
}]
|
|
3939
|
+
}],
|
|
3940
|
+
yLabel: [{
|
|
3941
|
+
type: i0.Input,
|
|
3942
|
+
args: [{
|
|
3943
|
+
isSignal: true,
|
|
3944
|
+
alias: "yLabel",
|
|
3945
|
+
required: false
|
|
3946
|
+
}]
|
|
3947
|
+
}],
|
|
3751
3948
|
animate: [{
|
|
3752
3949
|
type: i0.Input,
|
|
3753
3950
|
args: [{
|