@siemens/native-charts-ng 49.13.0 → 51.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/fesm2022/siemens-native-charts-ng-gauge.mjs +32 -22
- package/fesm2022/siemens-native-charts-ng-gauge.mjs.map +1 -1
- package/fesm2022/siemens-native-charts-ng-microchart-bar.mjs +13 -9
- package/fesm2022/siemens-native-charts-ng-microchart-bar.mjs.map +1 -1
- package/fesm2022/siemens-native-charts-ng-microchart-donut.mjs +18 -12
- package/fesm2022/siemens-native-charts-ng-microchart-donut.mjs.map +1 -1
- package/fesm2022/siemens-native-charts-ng-microchart-line.mjs +29 -17
- package/fesm2022/siemens-native-charts-ng-microchart-line.mjs.map +1 -1
- package/fesm2022/siemens-native-charts-ng-microchart-progress.mjs +11 -8
- package/fesm2022/siemens-native-charts-ng-microchart-progress.mjs.map +1 -1
- package/fesm2022/siemens-native-charts-ng.mjs +4 -4
- package/package.json +8 -6
- /package/{LICENSE.md → LICENSE} +0 -0
package/README.md
CHANGED
|
@@ -38,10 +38,10 @@ export class DashboardComponent {}
|
|
|
38
38
|
|
|
39
39
|
### Running unit tests
|
|
40
40
|
|
|
41
|
-
Run `
|
|
41
|
+
Run `pnpm run native-charts:test` to perform the unit tests via [Vitest](https://main.vitest.dev/).
|
|
42
42
|
|
|
43
43
|
## License
|
|
44
44
|
|
|
45
45
|
Code and documentation Copyright (c) Siemens 2016 - 2026
|
|
46
46
|
|
|
47
|
-
MIT, see [LICENSE
|
|
47
|
+
MIT, see [LICENSE](LICENSE).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, numberAttribute, booleanAttribute, inject, LOCALE_ID,
|
|
2
|
+
import { input, numberAttribute, booleanAttribute, inject, LOCALE_ID, Component } from '@angular/core';
|
|
3
3
|
import { makeArc, polarToCartesian, valueToRelativeAngle, relativeValueToRelativeAngle, makeLine } from '@siemens/native-charts-ng/utils';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -12,92 +12,101 @@ class SiNChartGaugeComponent {
|
|
|
12
12
|
*
|
|
13
13
|
* @defaultValue -90
|
|
14
14
|
*/
|
|
15
|
-
startAngle = input(-90, { ...(ngDevMode ? { debugName: "startAngle" } : {}), transform: numberAttribute });
|
|
15
|
+
startAngle = input(-90, { ...(ngDevMode ? { debugName: "startAngle" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
16
16
|
/**
|
|
17
17
|
* End angle in degrees
|
|
18
18
|
*
|
|
19
19
|
* @defaultValue 90
|
|
20
20
|
*/
|
|
21
|
-
endAngle = input(90, { ...(ngDevMode ? { debugName: "endAngle" } : {}), transform: numberAttribute });
|
|
21
|
+
endAngle = input(90, { ...(ngDevMode ? { debugName: "endAngle" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
22
22
|
/**
|
|
23
23
|
* Min value, can be negative
|
|
24
24
|
*
|
|
25
25
|
* @defaultValue -100
|
|
26
26
|
*/
|
|
27
|
-
min = input(-100, { ...(ngDevMode ? { debugName: "min" } : {}), transform: numberAttribute });
|
|
27
|
+
min = input(-100, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
28
28
|
/**
|
|
29
29
|
* Max value, can be negative
|
|
30
30
|
*
|
|
31
31
|
* @defaultValue 100
|
|
32
32
|
*/
|
|
33
|
-
max = input(100, { ...(ngDevMode ? { debugName: "max" } : {}), transform: numberAttribute });
|
|
33
|
+
max = input(100, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
34
34
|
/**
|
|
35
35
|
* Display mode: `sum` to sum up multiple series or `single` for a single value with optional
|
|
36
36
|
* segmented display.
|
|
37
37
|
*
|
|
38
38
|
* @defaultValue 'sum'
|
|
39
39
|
*/
|
|
40
|
-
mode = input('sum',
|
|
40
|
+
mode = input('sum', /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
41
42
|
/**
|
|
42
43
|
* The series for the chart.
|
|
43
44
|
*
|
|
44
45
|
* @defaultValue []
|
|
45
46
|
*/
|
|
46
|
-
series = input([],
|
|
47
|
+
series = input([], /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []));
|
|
47
49
|
/**
|
|
48
50
|
* Colored segments.
|
|
49
51
|
*
|
|
50
52
|
* @defaultValue []
|
|
51
53
|
*/
|
|
52
|
-
segments = input([],
|
|
54
|
+
segments = input([], /* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "segments" }] : /* istanbul ignore next */ []));
|
|
53
56
|
/**
|
|
54
57
|
* Unit
|
|
55
58
|
*
|
|
56
59
|
* @defaultValue ''
|
|
57
60
|
*/
|
|
58
|
-
unit = input('',
|
|
61
|
+
unit = input('', /* @ts-ignore */
|
|
62
|
+
...(ngDevMode ? [{ debugName: "unit" }] : /* istanbul ignore next */ []));
|
|
59
63
|
/**
|
|
60
64
|
* Min number of decimals.
|
|
61
65
|
* Possible values are from 0 to 100.
|
|
62
66
|
* @defaultValue 0
|
|
63
67
|
*/
|
|
64
|
-
minNumberOfDecimals = input(0,
|
|
68
|
+
minNumberOfDecimals = input(0, /* @ts-ignore */
|
|
69
|
+
...(ngDevMode ? [{ debugName: "minNumberOfDecimals" }] : /* istanbul ignore next */ []));
|
|
65
70
|
/**
|
|
66
71
|
* Max number of decimals.
|
|
67
72
|
* Possible values are from 0 to 100.
|
|
68
73
|
* @defaultValue 2
|
|
69
74
|
*/
|
|
70
|
-
maxNumberOfDecimals = input(2,
|
|
75
|
+
maxNumberOfDecimals = input(2, /* @ts-ignore */
|
|
76
|
+
...(ngDevMode ? [{ debugName: "maxNumberOfDecimals" }] : /* istanbul ignore next */ []));
|
|
71
77
|
/**
|
|
72
78
|
* Number of decimals on the axis.
|
|
73
79
|
* Possible values are from 0 to 100.
|
|
74
80
|
* @defaultValue 0
|
|
75
81
|
*/
|
|
76
|
-
axisNumberOfDecimals = input(0,
|
|
82
|
+
axisNumberOfDecimals = input(0, /* @ts-ignore */
|
|
83
|
+
...(ngDevMode ? [{ debugName: "axisNumberOfDecimals" }] : /* istanbul ignore next */ []));
|
|
77
84
|
/**
|
|
78
85
|
* Custom formatter for axis labels.
|
|
79
86
|
* Takes precedence when specified, i.e. number of decimals needs
|
|
80
87
|
* to be set by the user using this formatter.
|
|
81
88
|
*/
|
|
82
|
-
axisLabelFormatter = input(
|
|
89
|
+
axisLabelFormatter = input(/* @ts-ignore */
|
|
90
|
+
...(ngDevMode ? [undefined, { debugName: "axisLabelFormatter" }] : /* istanbul ignore next */ []));
|
|
83
91
|
/**
|
|
84
92
|
* Custom formatter for value.
|
|
85
93
|
* Takes precedence when specified, i.e. number of decimals needs
|
|
86
94
|
* to be set by the user using this formatter.
|
|
87
95
|
*/
|
|
88
|
-
valueFormatter = input(
|
|
96
|
+
valueFormatter = input(/* @ts-ignore */
|
|
97
|
+
...(ngDevMode ? [undefined, { debugName: "valueFormatter" }] : /* istanbul ignore next */ []));
|
|
89
98
|
/**
|
|
90
99
|
* Whether to show ticks
|
|
91
100
|
*
|
|
92
101
|
* @defaultValue true
|
|
93
102
|
*/
|
|
94
|
-
showTicks = input(true, { ...(ngDevMode ? { debugName: "showTicks" } : {}), transform: booleanAttribute });
|
|
103
|
+
showTicks = input(true, { ...(ngDevMode ? { debugName: "showTicks" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
95
104
|
/**
|
|
96
105
|
* Whether to show the legend
|
|
97
106
|
*
|
|
98
107
|
* @defaultValue true
|
|
99
108
|
*/
|
|
100
|
-
showLegend = input(true, { ...(ngDevMode ? { debugName: "showLegend" } : {}), transform: booleanAttribute });
|
|
109
|
+
showLegend = input(true, { ...(ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
101
110
|
/**
|
|
102
111
|
* Legend position:
|
|
103
112
|
* - `column`: chart and legend form a column, i.e. the legend is below the chart.
|
|
@@ -107,13 +116,14 @@ class SiNChartGaugeComponent {
|
|
|
107
116
|
*
|
|
108
117
|
* @defaultValue 'row'
|
|
109
118
|
*/
|
|
110
|
-
legendPosition = input('row',
|
|
119
|
+
legendPosition = input('row', /* @ts-ignore */
|
|
120
|
+
...(ngDevMode ? [{ debugName: "legendPosition" }] : /* istanbul ignore next */ []));
|
|
111
121
|
/**
|
|
112
122
|
* Whether to show range start/end labels on the outside of the ring
|
|
113
123
|
*
|
|
114
124
|
* @defaultValue false
|
|
115
125
|
*/
|
|
116
|
-
showRangeLabelsOutside = input(false, { ...(ngDevMode ? { debugName: "showRangeLabelsOutside" } : {}), transform: booleanAttribute });
|
|
126
|
+
showRangeLabelsOutside = input(false, { ...(ngDevMode ? { debugName: "showRangeLabelsOutside" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
117
127
|
dim = { width: 100, height: 60 };
|
|
118
128
|
center = { x: 50, y: 50 };
|
|
119
129
|
radius = 40;
|
|
@@ -299,12 +309,12 @@ class SiNChartGaugeComponent {
|
|
|
299
309
|
containAngle(angle) {
|
|
300
310
|
return Math.max(this.startAngle(), Math.min(this.endAngle(), angle));
|
|
301
311
|
}
|
|
302
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
303
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
312
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiNChartGaugeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
313
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: SiNChartGaugeComponent, isStandalone: true, selector: "si-nchart-gauge", inputs: { startAngle: { classPropertyName: "startAngle", publicName: "startAngle", isSignal: true, isRequired: false, transformFunction: null }, endAngle: { classPropertyName: "endAngle", publicName: "endAngle", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: false, transformFunction: null }, segments: { classPropertyName: "segments", publicName: "segments", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, minNumberOfDecimals: { classPropertyName: "minNumberOfDecimals", publicName: "minNumberOfDecimals", isSignal: true, isRequired: false, transformFunction: null }, maxNumberOfDecimals: { classPropertyName: "maxNumberOfDecimals", publicName: "maxNumberOfDecimals", isSignal: true, isRequired: false, transformFunction: null }, axisNumberOfDecimals: { classPropertyName: "axisNumberOfDecimals", publicName: "axisNumberOfDecimals", isSignal: true, isRequired: false, transformFunction: null }, axisLabelFormatter: { classPropertyName: "axisLabelFormatter", publicName: "axisLabelFormatter", isSignal: true, isRequired: false, transformFunction: null }, valueFormatter: { classPropertyName: "valueFormatter", publicName: "valueFormatter", isSignal: true, isRequired: false, transformFunction: null }, showTicks: { classPropertyName: "showTicks", publicName: "showTicks", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, legendPosition: { classPropertyName: "legendPosition", publicName: "legendPosition", isSignal: true, isRequired: false, transformFunction: null }, showRangeLabelsOutside: { classPropertyName: "showRangeLabelsOutside", publicName: "showRangeLabelsOutside", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "\"legend-\" + legendPosition()" } }, usesOnChanges: true, ngImport: i0, template: "<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"chart\"\n [attr.viewBox]=\"'0 0 ' + dim.width + ' ' + dim.height\"\n [attr.width]=\"dim.width\"\n [attr.height]=\"dim.height\"\n>\n <g class=\"ticks\">\n @for (tick of ticks; track $index) {\n <path [attr.d]=\"tick.path\" />\n }\n </g>\n <g class=\"tick-labels text-secondary\">\n @for (tick of ticks; track $index) {\n <text text-anchor=\"middle\" [attr.x]=\"tick.textPos.x\" [attr.y]=\"tick.textPos.y\">\n {{ tick.label }}\n </text>\n }\n </g>\n <g class=\"segments\">\n @for (seg of internalSegments; track $index) {\n <path [attr.d]=\"seg.path\" [style.stroke]=\"seg.colorVar\" />\n }\n </g>\n <g class=\"background\">\n <path [attr.d]=\"backgroundPath\" />\n </g>\n <g class=\"data\">\n @for (series of internalSeries; track $index) {\n @if (series.path) {\n <path\n [class.highlight]=\"series.highlight\"\n [attr.d]=\"series.path\"\n [attr.data-id]=\"series.series.id\"\n [style.stroke]=\"series.colorVar\"\n (mouseenter)=\"series.highlight = true\"\n (mouseleave)=\"series.highlight = false\"\n />\n }\n }\n </g>\n <text\n class=\"text-body value\"\n x=\"50\"\n y=\"50\"\n text-anchor=\"middle\"\n [attr.dominant-baseline]=\"valignMiddle ? 'middle' : 'auto'\"\n >\n {{ totalSumString }}\n @if (unit()) {\n <tspan class=\"unit\">{{ unit() }}</tspan>\n }\n </text>\n</svg>\n\n@if (showLegend()) {\n <table class=\"legend-table flex-fill\">\n <tbody>\n @for (series of internalSeries; track $index) {\n <tr [attr.data-id]=\"series.series.id\">\n <td>\n <div\n class=\"color\"\n [class.highlight]=\"series.highlight\"\n [style.color]=\"series.colorVar\"\n (mouseenter)=\"series.highlight = true\"\n (mouseleave)=\"series.highlight = false\"\n >\n </div>\n </td>\n <td class=\"value\">{{ series.valueString }}</td>\n <td class=\"name\">\n <div class=\"text-truncate\">{{ series.series.name }}</div>\n @if (series.series.description) {\n <div class=\"descr text-truncate\">{{ series.series.description }}</div>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n}\n", styles: [":host{display:flex}:host.legend-column{flex-direction:column}:host.legend-column .chart{block-size:auto;inline-size:100%;min-block-size:120px;max-block-size:320px}:host.legend-row .chart{block-size:100%;inline-size:auto;min-inline-size:200px}.chart .background,.chart .data{stroke-width:4;fill:none}.chart .background,.chart .ticks{stroke:var(--element-ui-4)}.chart .ticks{stroke-width:.5}.chart .segments{stroke-width:.75;fill:none}.chart .tick-labels,.chart .value{fill:currentColor}.chart .data>.highlight{stroke-width:6}.chart .value{font-size:80%}.chart tspan.unit{font-size:40%}.chart .tick-labels{font-size:25%}.legend-table{border-collapse:collapse;align-self:center}.legend-table td{padding-block:8px;padding-inline:8px}.legend-table .value{text-align:end;white-space:nowrap}.legend-table .name{inline-size:100%;min-inline-size:64px;max-inline-size:0}.legend-table .descr{color:var(--element-text-secondary)}.color{position:relative;flex:0 0 auto;block-size:16px;inline-size:16px}.color:after{content:\"\";position:absolute;inset:2px;background:currentColor;border-radius:50%}.color.highlight:after{inset:0}\n"] });
|
|
304
314
|
}
|
|
305
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
315
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiNChartGaugeComponent, decorators: [{
|
|
306
316
|
type: Component,
|
|
307
|
-
args: [{ selector: 'si-nchart-gauge',
|
|
317
|
+
args: [{ selector: 'si-nchart-gauge', host: {
|
|
308
318
|
'[class]': '"legend-" + legendPosition()'
|
|
309
319
|
}, template: "<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"chart\"\n [attr.viewBox]=\"'0 0 ' + dim.width + ' ' + dim.height\"\n [attr.width]=\"dim.width\"\n [attr.height]=\"dim.height\"\n>\n <g class=\"ticks\">\n @for (tick of ticks; track $index) {\n <path [attr.d]=\"tick.path\" />\n }\n </g>\n <g class=\"tick-labels text-secondary\">\n @for (tick of ticks; track $index) {\n <text text-anchor=\"middle\" [attr.x]=\"tick.textPos.x\" [attr.y]=\"tick.textPos.y\">\n {{ tick.label }}\n </text>\n }\n </g>\n <g class=\"segments\">\n @for (seg of internalSegments; track $index) {\n <path [attr.d]=\"seg.path\" [style.stroke]=\"seg.colorVar\" />\n }\n </g>\n <g class=\"background\">\n <path [attr.d]=\"backgroundPath\" />\n </g>\n <g class=\"data\">\n @for (series of internalSeries; track $index) {\n @if (series.path) {\n <path\n [class.highlight]=\"series.highlight\"\n [attr.d]=\"series.path\"\n [attr.data-id]=\"series.series.id\"\n [style.stroke]=\"series.colorVar\"\n (mouseenter)=\"series.highlight = true\"\n (mouseleave)=\"series.highlight = false\"\n />\n }\n }\n </g>\n <text\n class=\"text-body value\"\n x=\"50\"\n y=\"50\"\n text-anchor=\"middle\"\n [attr.dominant-baseline]=\"valignMiddle ? 'middle' : 'auto'\"\n >\n {{ totalSumString }}\n @if (unit()) {\n <tspan class=\"unit\">{{ unit() }}</tspan>\n }\n </text>\n</svg>\n\n@if (showLegend()) {\n <table class=\"legend-table flex-fill\">\n <tbody>\n @for (series of internalSeries; track $index) {\n <tr [attr.data-id]=\"series.series.id\">\n <td>\n <div\n class=\"color\"\n [class.highlight]=\"series.highlight\"\n [style.color]=\"series.colorVar\"\n (mouseenter)=\"series.highlight = true\"\n (mouseleave)=\"series.highlight = false\"\n >\n </div>\n </td>\n <td class=\"value\">{{ series.valueString }}</td>\n <td class=\"name\">\n <div class=\"text-truncate\">{{ series.series.name }}</div>\n @if (series.series.description) {\n <div class=\"descr text-truncate\">{{ series.series.description }}</div>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n}\n", styles: [":host{display:flex}:host.legend-column{flex-direction:column}:host.legend-column .chart{block-size:auto;inline-size:100%;min-block-size:120px;max-block-size:320px}:host.legend-row .chart{block-size:100%;inline-size:auto;min-inline-size:200px}.chart .background,.chart .data{stroke-width:4;fill:none}.chart .background,.chart .ticks{stroke:var(--element-ui-4)}.chart .ticks{stroke-width:.5}.chart .segments{stroke-width:.75;fill:none}.chart .tick-labels,.chart .value{fill:currentColor}.chart .data>.highlight{stroke-width:6}.chart .value{font-size:80%}.chart tspan.unit{font-size:40%}.chart .tick-labels{font-size:25%}.legend-table{border-collapse:collapse;align-self:center}.legend-table td{padding-block:8px;padding-inline:8px}.legend-table .value{text-align:end;white-space:nowrap}.legend-table .name{inline-size:100%;min-inline-size:64px;max-inline-size:0}.legend-table .descr{color:var(--element-text-secondary)}.color{position:relative;flex:0 0 auto;block-size:16px;inline-size:16px}.color:after{content:\"\";position:absolute;inset:2px;background:currentColor;border-radius:50%}.color.highlight:after{inset:0}\n"] }]
|
|
310
320
|
}], propDecorators: { startAngle: [{ type: i0.Input, args: [{ isSignal: true, alias: "startAngle", required: false }] }], endAngle: [{ type: i0.Input, args: [{ isSignal: true, alias: "endAngle", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: false }] }], segments: [{ type: i0.Input, args: [{ isSignal: true, alias: "segments", required: false }] }], unit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unit", required: false }] }], minNumberOfDecimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "minNumberOfDecimals", required: false }] }], maxNumberOfDecimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxNumberOfDecimals", required: false }] }], axisNumberOfDecimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisNumberOfDecimals", required: false }] }], axisLabelFormatter: [{ type: i0.Input, args: [{ isSignal: true, alias: "axisLabelFormatter", required: false }] }], valueFormatter: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormatter", required: false }] }], showTicks: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTicks", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], legendPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendPosition", required: false }] }], showRangeLabelsOutside: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRangeLabelsOutside", required: false }] }] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siemens-native-charts-ng-gauge.mjs","sources":["../../../../projects/native-charts-ng/gauge/si-nchart-gauge.component.ts","../../../../projects/native-charts-ng/gauge/si-nchart-gauge.component.html","../../../../projects/native-charts-ng/gauge/index.ts","../../../../projects/native-charts-ng/gauge/siemens-native-charts-ng-gauge.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n inject,\n input,\n LOCALE_ID,\n numberAttribute,\n OnChanges,\n OnInit,\n SimpleChanges\n} from '@angular/core';\nimport {\n Coordinate,\n makeArc,\n makeLine,\n polarToCartesian,\n relativeValueToRelativeAngle,\n valueToRelativeAngle\n} from '@siemens/native-charts-ng/utils';\n\n/**\n * One series of the gauge chart.\n */\nexport interface GaugeSeries {\n /** value */\n value: number;\n /** color token */\n colorToken: string;\n /** name displayed in legend */\n name: string;\n /** Optional description line in legend */\n description?: string;\n /** ID exposed as `data-id` */\n id?: string;\n}\n\n/**\n * One segment of the gauge chart. The first segment starts at the `min` value of the gauge\n * chart and ends at `endValue`.\n */\nexport interface GaugeSegment {\n /** color token for this segment. */\n colorToken: string;\n /** end value for this segment, exclusive except for last segment where it's inclusive */\n endValue: number;\n}\n\ninterface InternalSeries {\n series: GaugeSeries;\n path: string;\n colorVar: string;\n valueString: string;\n highlight: boolean;\n}\n\ninterface InternalGaugeSegment {\n segment: GaugeSegment;\n path: string;\n colorVar: string;\n}\n\ninterface Tick {\n path: string;\n label: string;\n textPos: Coordinate;\n}\n\n@Component({\n selector: 'si-nchart-gauge',\n templateUrl: './si-nchart-gauge.component.html',\n styleUrl: './si-nchart-gauge.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': '\"legend-\" + legendPosition()'\n }\n})\nexport class SiNChartGaugeComponent implements OnInit, OnChanges {\n /**\n * Start angle in degrees\n *\n * @defaultValue -90\n */\n readonly startAngle = input(-90, { transform: numberAttribute });\n /**\n * End angle in degrees\n *\n * @defaultValue 90\n */\n readonly endAngle = input(90, { transform: numberAttribute });\n\n /**\n * Min value, can be negative\n *\n * @defaultValue -100\n */\n readonly min = input(-100, { transform: numberAttribute });\n /**\n * Max value, can be negative\n *\n * @defaultValue 100\n */\n readonly max = input(100, { transform: numberAttribute });\n /**\n * Display mode: `sum` to sum up multiple series or `single` for a single value with optional\n * segmented display.\n *\n * @defaultValue 'sum'\n */\n readonly mode = input<'sum' | 'single'>('sum');\n /**\n * The series for the chart.\n *\n * @defaultValue []\n */\n readonly series = input<GaugeSeries[]>([]);\n /**\n * Colored segments.\n *\n * @defaultValue []\n */\n readonly segments = input<GaugeSegment[]>([]);\n /**\n * Unit\n *\n * @defaultValue ''\n */\n readonly unit = input('');\n /**\n * Min number of decimals.\n * Possible values are from 0 to 100.\n * @defaultValue 0\n */\n readonly minNumberOfDecimals = input(0);\n /**\n * Max number of decimals.\n * Possible values are from 0 to 100.\n * @defaultValue 2\n */\n readonly maxNumberOfDecimals = input(2);\n /**\n * Number of decimals on the axis.\n * Possible values are from 0 to 100.\n * @defaultValue 0\n */\n readonly axisNumberOfDecimals = input(0);\n /**\n * Custom formatter for axis labels.\n * Takes precedence when specified, i.e. number of decimals needs\n * to be set by the user using this formatter.\n */\n readonly axisLabelFormatter = input<(val: number) => string>();\n /**\n * Custom formatter for value.\n * Takes precedence when specified, i.e. number of decimals needs\n * to be set by the user using this formatter.\n */\n readonly valueFormatter = input<(val: number) => string>();\n /**\n * Whether to show ticks\n *\n * @defaultValue true\n */\n readonly showTicks = input(true, { transform: booleanAttribute });\n /**\n * Whether to show the legend\n *\n * @defaultValue true\n */\n readonly showLegend = input(true, { transform: booleanAttribute });\n /**\n * Legend position:\n * - `column`: chart and legend form a column, i.e. the legend is below the chart.\n * The chart size is driven by the available width.\n * - `row`: chart and legend form a row, i.e. the legend is besides the chart. The\n * The chart size is driven by the available height.\n *\n * @defaultValue 'row'\n */\n readonly legendPosition = input<'row' | 'column'>('row');\n /**\n * Whether to show range start/end labels on the outside of the ring\n *\n * @defaultValue false\n */\n readonly showRangeLabelsOutside = input(false, { transform: booleanAttribute });\n\n protected dim = { width: 100, height: 60 };\n protected center: Coordinate = { x: 50, y: 50 };\n protected radius = 40;\n protected additionalHeight = 10;\n\n protected backgroundPath = '';\n protected internalSeries: InternalSeries[] = [];\n protected ticks: Tick[] = [];\n protected totalSum = 0;\n protected totalSumString = '0';\n protected valignMiddle = false;\n protected internalSegments: InternalGaugeSegment[] = [];\n\n private locale = inject(LOCALE_ID).toString();\n private numberFormat = new Intl.NumberFormat(this.locale, { maximumFractionDigits: 2 });\n private axisNumberFormat = new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: this.axisNumberOfDecimals(),\n maximumFractionDigits: this.axisNumberOfDecimals()\n });\n\n ngOnChanges(changes: SimpleChanges<this>): void {\n let calc = false;\n if (changes.minNumberOfDecimals || changes.maxNumberOfDecimals) {\n this.numberFormat = new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: this.minNumberOfDecimals(),\n maximumFractionDigits: Math.max(this.minNumberOfDecimals(), this.maxNumberOfDecimals())\n });\n calc = true;\n }\n if (changes.axisNumberOfDecimals) {\n this.axisNumberFormat = new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: this.axisNumberOfDecimals(),\n maximumFractionDigits: this.axisNumberOfDecimals()\n });\n calc = true;\n }\n if (changes.startAngle || changes.endAngle) {\n this.init();\n calc = true;\n }\n if (\n changes.series ||\n changes.min ||\n changes.max ||\n changes.showTicks ||\n changes.showRangeLabelsOutside ||\n changes.segments ||\n changes.axisLabelFormatter ||\n changes.valueFormatter\n ) {\n calc = true;\n }\n if (calc) {\n this.calc();\n }\n }\n\n ngOnInit(): void {\n this.init();\n this.calc();\n }\n\n protected init(): void {\n this.backgroundPath = makeArc(this.center, this.radius, this.startAngle(), this.endAngle());\n\n // auto adjust height\n const maxAngle = Math.max(Math.abs(this.startAngle()), Math.abs(this.endAngle()));\n\n const height = Math.max(50, polarToCartesian(this.center, this.radius, maxAngle).y);\n this.dim.height = height + this.additionalHeight;\n this.valignMiddle = height > 50;\n }\n\n private calc(): void {\n if (this.mode() === 'sum') {\n this.calcSeriesSum();\n } else {\n this.calcSeriesSingle();\n }\n }\n\n private reset(): void {\n this.totalSum = 0;\n this.internalSeries = [];\n this.internalSegments = [];\n this.ticks = [];\n }\n\n private calcSeriesSum(): void {\n this.reset();\n\n const zeroValueAngle =\n this.startAngle() +\n valueToRelativeAngle(this.startAngle(), this.endAngle(), this.min(), this.max(), 0);\n\n this.addTick(this.startAngle(), this.min(), true);\n if (this.min() !== 0) {\n this.addTick(zeroValueAngle, 0, false);\n }\n this.addTick(this.endAngle(), this.max(), true);\n\n let nextPosAngle = zeroValueAngle;\n let nextNegAngle = zeroValueAngle;\n for (const series of this.series()) {\n if (series.value >= 0) {\n nextPosAngle = this.addInternalSeries(nextPosAngle, series, true);\n } else if (series.value < 0) {\n nextNegAngle = this.addInternalSeries(nextNegAngle, series, true, true);\n }\n }\n\n this.totalSumString = this.formatValue(this.totalSum);\n }\n\n private calcSeriesSingle(): void {\n this.reset();\n\n const range = this.max() - this.min();\n let angle = this.startAngle();\n let value = this.min();\n for (const segment of this.segments()) {\n const nextAngle =\n relativeValueToRelativeAngle(\n this.startAngle(),\n this.endAngle(),\n range,\n segment.endValue - value\n ) + angle;\n\n this.internalSegments.push({\n segment,\n colorVar: `var(--${segment.colorToken})`,\n path: makeArc(this.center, this.radius - 3.5, angle, nextAngle)\n });\n\n if (segment.endValue !== this.max()) {\n this.addTick(nextAngle, segment.endValue, false);\n }\n\n angle = nextAngle;\n value = segment.endValue;\n }\n\n this.addTick(this.startAngle(), this.min(), true);\n this.addTick(this.endAngle(), this.max(), true);\n\n const series = this.series()[0];\n if (!series) {\n this.totalSumString = '-';\n return;\n }\n\n const activeSegment = this.segments().find(\n (s, i) => series.value < s.endValue || i == this.segments().length - 1\n );\n this.addInternalSeries(this.startAngle(), series, false, false, activeSegment?.colorToken);\n\n this.totalSumString = this.formatValue(this.totalSum);\n }\n\n private formatValue(value: number): string {\n const formatter = this.valueFormatter();\n return formatter ? formatter(value) : this.numberFormat.format(value);\n }\n\n private addTick(angle: number, title: number, boundary: boolean): void {\n const segmentOffset = this.mode() === 'single' && this.segments().length ? 1.25 : 0;\n const textRadiusOffset =\n boundary && this.showRangeLabelsOutside()\n ? 0\n : this.showTicks()\n ? 10 + segmentOffset\n : 8 + segmentOffset;\n const textPos = polarToCartesian(this.center, this.radius - textRadiusOffset, angle);\n\n if (boundary && this.showRangeLabelsOutside()) {\n textPos.y += 6;\n }\n\n const axisLabelFormatter = this.axisLabelFormatter();\n this.ticks.push({\n path: this.showTicks() ? this.makeTickPath(angle) : '',\n label: axisLabelFormatter ? axisLabelFormatter(title) : this.axisNumberFormat.format(title),\n textPos\n });\n }\n\n private makeTickPath(angle: number): string {\n const startRadius =\n this.mode() === 'single' && this.segments().length ? this.radius - 5.5 : this.radius - 4;\n const start = polarToCartesian(this.center, startRadius, angle);\n const end = polarToCartesian(this.center, this.radius + 2, angle);\n return makeLine(start, end);\n }\n\n private addInternalSeries(\n startAngle: number,\n series: GaugeSeries,\n relative = false,\n reverse = false,\n color?: string\n ): number {\n let nextAngle =\n relativeValueToRelativeAngle(\n this.startAngle(),\n this.endAngle(),\n this.max() - this.min(),\n series.value - (relative ? 0 : this.min())\n ) + startAngle;\n const returnNextAngle = nextAngle;\n\n if (reverse) {\n [startAngle, nextAngle] = [nextAngle, startAngle];\n }\n\n startAngle = this.containAngle(startAngle);\n nextAngle = this.containAngle(nextAngle);\n\n if (startAngle !== nextAngle) {\n this.pushInternalSeries(\n series,\n makeArc(this.center, this.radius, startAngle, nextAngle),\n color\n );\n } else {\n this.pushInternalSeries(series, '', color);\n }\n\n this.totalSum += series.value;\n\n return returnNextAngle;\n }\n\n private pushInternalSeries(series: GaugeSeries, path: string, color?: string): void {\n color ??= series.colorToken;\n this.internalSeries.push({\n series,\n path,\n colorVar: `var(--${color})`,\n valueString: this.numberFormat.format(series.value),\n highlight: false\n });\n }\n\n private containAngle(angle: number): number {\n return Math.max(this.startAngle(), Math.min(this.endAngle(), angle));\n }\n}\n","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"chart\"\n [attr.viewBox]=\"'0 0 ' + dim.width + ' ' + dim.height\"\n [attr.width]=\"dim.width\"\n [attr.height]=\"dim.height\"\n>\n <g class=\"ticks\">\n @for (tick of ticks; track $index) {\n <path [attr.d]=\"tick.path\" />\n }\n </g>\n <g class=\"tick-labels text-secondary\">\n @for (tick of ticks; track $index) {\n <text text-anchor=\"middle\" [attr.x]=\"tick.textPos.x\" [attr.y]=\"tick.textPos.y\">\n {{ tick.label }}\n </text>\n }\n </g>\n <g class=\"segments\">\n @for (seg of internalSegments; track $index) {\n <path [attr.d]=\"seg.path\" [style.stroke]=\"seg.colorVar\" />\n }\n </g>\n <g class=\"background\">\n <path [attr.d]=\"backgroundPath\" />\n </g>\n <g class=\"data\">\n @for (series of internalSeries; track $index) {\n @if (series.path) {\n <path\n [class.highlight]=\"series.highlight\"\n [attr.d]=\"series.path\"\n [attr.data-id]=\"series.series.id\"\n [style.stroke]=\"series.colorVar\"\n (mouseenter)=\"series.highlight = true\"\n (mouseleave)=\"series.highlight = false\"\n />\n }\n }\n </g>\n <text\n class=\"text-body value\"\n x=\"50\"\n y=\"50\"\n text-anchor=\"middle\"\n [attr.dominant-baseline]=\"valignMiddle ? 'middle' : 'auto'\"\n >\n {{ totalSumString }}\n @if (unit()) {\n <tspan class=\"unit\">{{ unit() }}</tspan>\n }\n </text>\n</svg>\n\n@if (showLegend()) {\n <table class=\"legend-table flex-fill\">\n <tbody>\n @for (series of internalSeries; track $index) {\n <tr [attr.data-id]=\"series.series.id\">\n <td>\n <div\n class=\"color\"\n [class.highlight]=\"series.highlight\"\n [style.color]=\"series.colorVar\"\n (mouseenter)=\"series.highlight = true\"\n (mouseleave)=\"series.highlight = false\"\n >\n </div>\n </td>\n <td class=\"value\">{{ series.valueString }}</td>\n <td class=\"name\">\n <div class=\"text-truncate\">{{ series.series.name }}</div>\n @if (series.series.description) {\n <div class=\"descr text-truncate\">{{ series.series.description }}</div>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-nchart-gauge.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;MA8EU,sBAAsB,CAAA;AACjC;;;;AAIG;IACM,UAAU,GAAG,KAAK,CAAC,CAAC,EAAE,uDAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AAChE;;;;AAIG;IACM,QAAQ,GAAG,KAAK,CAAC,EAAE,qDAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AAE7D;;;;AAIG;IACM,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,gDAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AAC1D;;;;AAIG;IACM,GAAG,GAAG,KAAK,CAAC,GAAG,gDAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AACzD;;;;;AAKG;AACM,IAAA,IAAI,GAAG,KAAK,CAAmB,KAAK,gDAAC;AAC9C;;;;AAIG;AACM,IAAA,MAAM,GAAG,KAAK,CAAgB,EAAE,kDAAC;AAC1C;;;;AAIG;AACM,IAAA,QAAQ,GAAG,KAAK,CAAiB,EAAE,oDAAC;AAC7C;;;;AAIG;AACM,IAAA,IAAI,GAAG,KAAK,CAAC,EAAE,gDAAC;AACzB;;;;AAIG;AACM,IAAA,mBAAmB,GAAG,KAAK,CAAC,CAAC,+DAAC;AACvC;;;;AAIG;AACM,IAAA,mBAAmB,GAAG,KAAK,CAAC,CAAC,+DAAC;AACvC;;;;AAIG;AACM,IAAA,oBAAoB,GAAG,KAAK,CAAC,CAAC,gEAAC;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QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,u+ECjFnC,k3EAkFA,EAAA,MAAA,EAAA,CAAA,gmCAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDDa,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBATlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,eAAA,EAGV,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,SAAS,EAAE;AACZ,qBAAA,EAAA,QAAA,EAAA,k3EAAA,EAAA,MAAA,EAAA,CAAA,gmCAAA,CAAA,EAAA;;;AE/EH;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"siemens-native-charts-ng-gauge.mjs","sources":["../../../../projects/native-charts-ng/gauge/si-nchart-gauge.component.ts","../../../../projects/native-charts-ng/gauge/si-nchart-gauge.component.html","../../../../projects/native-charts-ng/gauge/index.ts","../../../../projects/native-charts-ng/gauge/siemens-native-charts-ng-gauge.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport {\n booleanAttribute,\n Component,\n inject,\n input,\n LOCALE_ID,\n numberAttribute,\n OnChanges,\n OnInit,\n SimpleChanges\n} from '@angular/core';\nimport {\n Coordinate,\n makeArc,\n makeLine,\n polarToCartesian,\n relativeValueToRelativeAngle,\n valueToRelativeAngle\n} from '@siemens/native-charts-ng/utils';\n\n/**\n * One series of the gauge chart.\n */\nexport interface GaugeSeries {\n /** value */\n value: number;\n /** color token */\n colorToken: string;\n /** name displayed in legend */\n name: string;\n /** Optional description line in legend */\n description?: string;\n /** ID exposed as `data-id` */\n id?: string;\n}\n\n/**\n * One segment of the gauge chart. The first segment starts at the `min` value of the gauge\n * chart and ends at `endValue`.\n */\nexport interface GaugeSegment {\n /** color token for this segment. */\n colorToken: string;\n /** end value for this segment, exclusive except for last segment where it's inclusive */\n endValue: number;\n}\n\ninterface InternalSeries {\n series: GaugeSeries;\n path: string;\n colorVar: string;\n valueString: string;\n highlight: boolean;\n}\n\ninterface InternalGaugeSegment {\n segment: GaugeSegment;\n path: string;\n colorVar: string;\n}\n\ninterface Tick {\n path: string;\n label: string;\n textPos: Coordinate;\n}\n\n@Component({\n selector: 'si-nchart-gauge',\n templateUrl: './si-nchart-gauge.component.html',\n styleUrl: './si-nchart-gauge.component.scss',\n host: {\n '[class]': '\"legend-\" + legendPosition()'\n }\n})\nexport class SiNChartGaugeComponent implements OnInit, OnChanges {\n /**\n * Start angle in degrees\n *\n * @defaultValue -90\n */\n readonly startAngle = input(-90, { transform: numberAttribute });\n /**\n * End angle in degrees\n *\n * @defaultValue 90\n */\n readonly endAngle = input(90, { transform: numberAttribute });\n\n /**\n * Min value, can be negative\n *\n * @defaultValue -100\n */\n readonly min = input(-100, { transform: numberAttribute });\n /**\n * Max value, can be negative\n *\n * @defaultValue 100\n */\n readonly max = input(100, { transform: numberAttribute });\n /**\n * Display mode: `sum` to sum up multiple series or `single` for a single value with optional\n * segmented display.\n *\n * @defaultValue 'sum'\n */\n readonly mode = input<'sum' | 'single'>('sum');\n /**\n * The series for the chart.\n *\n * @defaultValue []\n */\n readonly series = input<GaugeSeries[]>([]);\n /**\n * Colored segments.\n *\n * @defaultValue []\n */\n readonly segments = input<GaugeSegment[]>([]);\n /**\n * Unit\n *\n * @defaultValue ''\n */\n readonly unit = input('');\n /**\n * Min number of decimals.\n * Possible values are from 0 to 100.\n * @defaultValue 0\n */\n readonly minNumberOfDecimals = input(0);\n /**\n * Max number of decimals.\n * Possible values are from 0 to 100.\n * @defaultValue 2\n */\n readonly maxNumberOfDecimals = input(2);\n /**\n * Number of decimals on the axis.\n * Possible values are from 0 to 100.\n * @defaultValue 0\n */\n readonly axisNumberOfDecimals = input(0);\n /**\n * Custom formatter for axis labels.\n * Takes precedence when specified, i.e. number of decimals needs\n * to be set by the user using this formatter.\n */\n readonly axisLabelFormatter = input<(val: number) => string>();\n /**\n * Custom formatter for value.\n * Takes precedence when specified, i.e. number of decimals needs\n * to be set by the user using this formatter.\n */\n readonly valueFormatter = input<(val: number) => string>();\n /**\n * Whether to show ticks\n *\n * @defaultValue true\n */\n readonly showTicks = input(true, { transform: booleanAttribute });\n /**\n * Whether to show the legend\n *\n * @defaultValue true\n */\n readonly showLegend = input(true, { transform: booleanAttribute });\n /**\n * Legend position:\n * - `column`: chart and legend form a column, i.e. the legend is below the chart.\n * The chart size is driven by the available width.\n * - `row`: chart and legend form a row, i.e. the legend is besides the chart. The\n * The chart size is driven by the available height.\n *\n * @defaultValue 'row'\n */\n readonly legendPosition = input<'row' | 'column'>('row');\n /**\n * Whether to show range start/end labels on the outside of the ring\n *\n * @defaultValue false\n */\n readonly showRangeLabelsOutside = input(false, { transform: booleanAttribute });\n\n protected dim = { width: 100, height: 60 };\n protected center: Coordinate = { x: 50, y: 50 };\n protected radius = 40;\n protected additionalHeight = 10;\n\n protected backgroundPath = '';\n protected internalSeries: InternalSeries[] = [];\n protected ticks: Tick[] = [];\n protected totalSum = 0;\n protected totalSumString = '0';\n protected valignMiddle = false;\n protected internalSegments: InternalGaugeSegment[] = [];\n\n private locale = inject(LOCALE_ID).toString();\n private numberFormat = new Intl.NumberFormat(this.locale, { maximumFractionDigits: 2 });\n private axisNumberFormat = new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: this.axisNumberOfDecimals(),\n maximumFractionDigits: this.axisNumberOfDecimals()\n });\n\n ngOnChanges(changes: SimpleChanges<this>): void {\n let calc = false;\n if (changes.minNumberOfDecimals || changes.maxNumberOfDecimals) {\n this.numberFormat = new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: this.minNumberOfDecimals(),\n maximumFractionDigits: Math.max(this.minNumberOfDecimals(), this.maxNumberOfDecimals())\n });\n calc = true;\n }\n if (changes.axisNumberOfDecimals) {\n this.axisNumberFormat = new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: this.axisNumberOfDecimals(),\n maximumFractionDigits: this.axisNumberOfDecimals()\n });\n calc = true;\n }\n if (changes.startAngle || changes.endAngle) {\n this.init();\n calc = true;\n }\n if (\n changes.series ||\n changes.min ||\n changes.max ||\n changes.showTicks ||\n changes.showRangeLabelsOutside ||\n changes.segments ||\n changes.axisLabelFormatter ||\n changes.valueFormatter\n ) {\n calc = true;\n }\n if (calc) {\n this.calc();\n }\n }\n\n ngOnInit(): void {\n this.init();\n this.calc();\n }\n\n protected init(): void {\n this.backgroundPath = makeArc(this.center, this.radius, this.startAngle(), this.endAngle());\n\n // auto adjust height\n const maxAngle = Math.max(Math.abs(this.startAngle()), Math.abs(this.endAngle()));\n\n const height = Math.max(50, polarToCartesian(this.center, this.radius, maxAngle).y);\n this.dim.height = height + this.additionalHeight;\n this.valignMiddle = height > 50;\n }\n\n private calc(): void {\n if (this.mode() === 'sum') {\n this.calcSeriesSum();\n } else {\n this.calcSeriesSingle();\n }\n }\n\n private reset(): void {\n this.totalSum = 0;\n this.internalSeries = [];\n this.internalSegments = [];\n this.ticks = [];\n }\n\n private calcSeriesSum(): void {\n this.reset();\n\n const zeroValueAngle =\n this.startAngle() +\n valueToRelativeAngle(this.startAngle(), this.endAngle(), this.min(), this.max(), 0);\n\n this.addTick(this.startAngle(), this.min(), true);\n if (this.min() !== 0) {\n this.addTick(zeroValueAngle, 0, false);\n }\n this.addTick(this.endAngle(), this.max(), true);\n\n let nextPosAngle = zeroValueAngle;\n let nextNegAngle = zeroValueAngle;\n for (const series of this.series()) {\n if (series.value >= 0) {\n nextPosAngle = this.addInternalSeries(nextPosAngle, series, true);\n } else if (series.value < 0) {\n nextNegAngle = this.addInternalSeries(nextNegAngle, series, true, true);\n }\n }\n\n this.totalSumString = this.formatValue(this.totalSum);\n }\n\n private calcSeriesSingle(): void {\n this.reset();\n\n const range = this.max() - this.min();\n let angle = this.startAngle();\n let value = this.min();\n for (const segment of this.segments()) {\n const nextAngle =\n relativeValueToRelativeAngle(\n this.startAngle(),\n this.endAngle(),\n range,\n segment.endValue - value\n ) + angle;\n\n this.internalSegments.push({\n segment,\n colorVar: `var(--${segment.colorToken})`,\n path: makeArc(this.center, this.radius - 3.5, angle, nextAngle)\n });\n\n if (segment.endValue !== this.max()) {\n this.addTick(nextAngle, segment.endValue, false);\n }\n\n angle = nextAngle;\n value = segment.endValue;\n }\n\n this.addTick(this.startAngle(), this.min(), true);\n this.addTick(this.endAngle(), this.max(), true);\n\n const series = this.series()[0];\n if (!series) {\n this.totalSumString = '-';\n return;\n }\n\n const activeSegment = this.segments().find(\n (s, i) => series.value < s.endValue || i == this.segments().length - 1\n );\n this.addInternalSeries(this.startAngle(), series, false, false, activeSegment?.colorToken);\n\n this.totalSumString = this.formatValue(this.totalSum);\n }\n\n private formatValue(value: number): string {\n const formatter = this.valueFormatter();\n return formatter ? formatter(value) : this.numberFormat.format(value);\n }\n\n private addTick(angle: number, title: number, boundary: boolean): void {\n const segmentOffset = this.mode() === 'single' && this.segments().length ? 1.25 : 0;\n const textRadiusOffset =\n boundary && this.showRangeLabelsOutside()\n ? 0\n : this.showTicks()\n ? 10 + segmentOffset\n : 8 + segmentOffset;\n const textPos = polarToCartesian(this.center, this.radius - textRadiusOffset, angle);\n\n if (boundary && this.showRangeLabelsOutside()) {\n textPos.y += 6;\n }\n\n const axisLabelFormatter = this.axisLabelFormatter();\n this.ticks.push({\n path: this.showTicks() ? this.makeTickPath(angle) : '',\n label: axisLabelFormatter ? axisLabelFormatter(title) : this.axisNumberFormat.format(title),\n textPos\n });\n }\n\n private makeTickPath(angle: number): string {\n const startRadius =\n this.mode() === 'single' && this.segments().length ? this.radius - 5.5 : this.radius - 4;\n const start = polarToCartesian(this.center, startRadius, angle);\n const end = polarToCartesian(this.center, this.radius + 2, angle);\n return makeLine(start, end);\n }\n\n private addInternalSeries(\n startAngle: number,\n series: GaugeSeries,\n relative = false,\n reverse = false,\n color?: string\n ): number {\n let nextAngle =\n relativeValueToRelativeAngle(\n this.startAngle(),\n this.endAngle(),\n this.max() - this.min(),\n series.value - (relative ? 0 : this.min())\n ) + startAngle;\n const returnNextAngle = nextAngle;\n\n if (reverse) {\n [startAngle, nextAngle] = [nextAngle, startAngle];\n }\n\n startAngle = this.containAngle(startAngle);\n nextAngle = this.containAngle(nextAngle);\n\n if (startAngle !== nextAngle) {\n this.pushInternalSeries(\n series,\n makeArc(this.center, this.radius, startAngle, nextAngle),\n color\n );\n } else {\n this.pushInternalSeries(series, '', color);\n }\n\n this.totalSum += series.value;\n\n return returnNextAngle;\n }\n\n private pushInternalSeries(series: GaugeSeries, path: string, color?: string): void {\n color ??= series.colorToken;\n this.internalSeries.push({\n series,\n path,\n colorVar: `var(--${color})`,\n valueString: this.numberFormat.format(series.value),\n highlight: false\n });\n }\n\n private containAngle(angle: number): number {\n return Math.max(this.startAngle(), Math.min(this.endAngle(), angle));\n }\n}\n","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"chart\"\n [attr.viewBox]=\"'0 0 ' + dim.width + ' ' + dim.height\"\n [attr.width]=\"dim.width\"\n [attr.height]=\"dim.height\"\n>\n <g class=\"ticks\">\n @for (tick of ticks; track $index) {\n <path [attr.d]=\"tick.path\" />\n }\n </g>\n <g class=\"tick-labels text-secondary\">\n @for (tick of ticks; track $index) {\n <text text-anchor=\"middle\" [attr.x]=\"tick.textPos.x\" [attr.y]=\"tick.textPos.y\">\n {{ tick.label }}\n </text>\n }\n </g>\n <g class=\"segments\">\n @for (seg of internalSegments; track $index) {\n <path [attr.d]=\"seg.path\" [style.stroke]=\"seg.colorVar\" />\n }\n </g>\n <g class=\"background\">\n <path [attr.d]=\"backgroundPath\" />\n </g>\n <g class=\"data\">\n @for (series of internalSeries; track $index) {\n @if (series.path) {\n <path\n [class.highlight]=\"series.highlight\"\n [attr.d]=\"series.path\"\n [attr.data-id]=\"series.series.id\"\n [style.stroke]=\"series.colorVar\"\n (mouseenter)=\"series.highlight = true\"\n (mouseleave)=\"series.highlight = false\"\n />\n }\n }\n </g>\n <text\n class=\"text-body value\"\n x=\"50\"\n y=\"50\"\n text-anchor=\"middle\"\n [attr.dominant-baseline]=\"valignMiddle ? 'middle' : 'auto'\"\n >\n {{ totalSumString }}\n @if (unit()) {\n <tspan class=\"unit\">{{ unit() }}</tspan>\n }\n </text>\n</svg>\n\n@if (showLegend()) {\n <table class=\"legend-table flex-fill\">\n <tbody>\n @for (series of internalSeries; track $index) {\n <tr [attr.data-id]=\"series.series.id\">\n <td>\n <div\n class=\"color\"\n [class.highlight]=\"series.highlight\"\n [style.color]=\"series.colorVar\"\n (mouseenter)=\"series.highlight = true\"\n (mouseleave)=\"series.highlight = false\"\n >\n </div>\n </td>\n <td class=\"value\">{{ series.valueString }}</td>\n <td class=\"name\">\n <div class=\"text-truncate\">{{ series.series.name }}</div>\n @if (series.series.description) {\n <div class=\"descr text-truncate\">{{ series.series.description }}</div>\n }\n </td>\n </tr>\n }\n </tbody>\n </table>\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-nchart-gauge.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;MA4EU,sBAAsB,CAAA;AACjC;;;;AAIG;IACM,UAAU,GAAG,KAAK,CAAC,CAAC,EAAE,kFAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AAChE;;;;AAIG;IACM,QAAQ,GAAG,KAAK,CAAC,EAAE,gFAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AAE7D;;;;AAIG;IACM,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,2EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AAC1D;;;;AAIG;IACM,GAAG,GAAG,KAAK,CAAC,GAAG,2EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AACzD;;;;;AAKG;IACM,IAAI,GAAG,KAAK,CAAmB,KAAK;6EAAC;AAC9C;;;;AAIG;IACM,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IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,u+EC/EnC,k3EAkFA,EAAA,MAAA,EAAA,CAAA,gmCAAA,CAAA,EAAA,CAAA;;2FDHa,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBARlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,IAAA,EAGrB;AACJ,wBAAA,SAAS,EAAE;AACZ,qBAAA,EAAA,QAAA,EAAA,k3EAAA,EAAA,MAAA,EAAA,CAAA,gmCAAA,CAAA,EAAA;;;AE7EH;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed,
|
|
2
|
+
import { input, computed, Component } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Copyright (c) Siemens 2016 - 2026
|
|
@@ -7,9 +7,11 @@ import { input, computed, ChangeDetectionStrategy, Component } from '@angular/co
|
|
|
7
7
|
*/
|
|
8
8
|
class SiMicrochartBarComponent {
|
|
9
9
|
/** @defaultValue 64 */
|
|
10
|
-
width = input(64,
|
|
10
|
+
width = input(64, /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
11
12
|
/** @defaultValue 24 */
|
|
12
|
-
height = input(24,
|
|
13
|
+
height = input(24, /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
13
15
|
/**
|
|
14
16
|
* Microchart bar series.
|
|
15
17
|
* Example series can be:
|
|
@@ -18,7 +20,8 @@ class SiMicrochartBarComponent {
|
|
|
18
20
|
* Series: MicrochartBarSeries = { values: [2, 4, 5, 3, 5, 7, 7, 9, 11, 10, 12, 9], colorToken: 'element-data-7'};
|
|
19
21
|
* ```
|
|
20
22
|
*/
|
|
21
|
-
series = input.required(
|
|
23
|
+
series = input.required(/* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []));
|
|
22
25
|
barWidth = 4;
|
|
23
26
|
internalSeries = computed(() => {
|
|
24
27
|
const series = this.series();
|
|
@@ -36,13 +39,14 @@ class SiMicrochartBarComponent {
|
|
|
36
39
|
return { top, height, colorToken };
|
|
37
40
|
});
|
|
38
41
|
return int;
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
static
|
|
42
|
+
}, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "internalSeries" }] : /* istanbul ignore next */ []));
|
|
44
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiMicrochartBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
45
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: SiMicrochartBarComponent, isStandalone: true, selector: "si-microchart-bar", inputs: { width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"py-2\" [style.width.px]=\"width()\" [style.height.px]=\"height()\">\n <div class=\"position-relative h-100\">\n @for (item of internalSeries(); track $index) {\n <div\n class=\"position-absolute\"\n [style.height.%]=\"item.height\"\n [style.top.%]=\"item.top\"\n [style.left.px]=\"$index * (barWidth + 1)\"\n [style.width.px]=\"barWidth\"\n [style.backgroundColor]=\"'var(--' + item.colorToken + ')'\"\n ></div>\n }\n </div>\n</div>\n" });
|
|
42
46
|
}
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiMicrochartBarComponent, decorators: [{
|
|
44
48
|
type: Component,
|
|
45
|
-
args: [{ selector: 'si-microchart-bar',
|
|
49
|
+
args: [{ selector: 'si-microchart-bar', template: "<div class=\"py-2\" [style.width.px]=\"width()\" [style.height.px]=\"height()\">\n <div class=\"position-relative h-100\">\n @for (item of internalSeries(); track $index) {\n <div\n class=\"position-absolute\"\n [style.height.%]=\"item.height\"\n [style.top.%]=\"item.top\"\n [style.left.px]=\"$index * (barWidth + 1)\"\n [style.width.px]=\"barWidth\"\n [style.backgroundColor]=\"'var(--' + item.colorToken + ')'\"\n ></div>\n }\n </div>\n</div>\n" }]
|
|
46
50
|
}], propDecorators: { width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: true }] }] } });
|
|
47
51
|
|
|
48
52
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siemens-native-charts-ng-microchart-bar.mjs","sources":["../../../../projects/native-charts-ng/microchart-bar/si-microchart-bar.component.ts","../../../../projects/native-charts-ng/microchart-bar/si-microchart-bar.component.html","../../../../projects/native-charts-ng/microchart-bar/index.ts","../../../../projects/native-charts-ng/microchart-bar/siemens-native-charts-ng-microchart-bar.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport {
|
|
1
|
+
{"version":3,"file":"siemens-native-charts-ng-microchart-bar.mjs","sources":["../../../../projects/native-charts-ng/microchart-bar/si-microchart-bar.component.ts","../../../../projects/native-charts-ng/microchart-bar/si-microchart-bar.component.html","../../../../projects/native-charts-ng/microchart-bar/index.ts","../../../../projects/native-charts-ng/microchart-bar/siemens-native-charts-ng-microchart-bar.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Component, computed, input } from '@angular/core';\n\nexport interface MicrochartBarSeries {\n /* Series values */\n values: number[];\n /**\n * Use a data-color. See: {@link https://element.siemens.io/fundamentals/colors/data-visualization-colors/#tokens}\n *\n * @example \"element-data-10\"\n */\n colorToken: string;\n /**\n * Color token for negative values\n */\n negativeColorToken?: string;\n}\n\ninterface SeriesInternal {\n top: number;\n height: number;\n colorToken: string;\n}\n\n@Component({\n selector: 'si-microchart-bar',\n templateUrl: './si-microchart-bar.component.html'\n})\nexport class SiMicrochartBarComponent {\n /** @defaultValue 64 */\n readonly width = input<number>(64);\n /** @defaultValue 24 */\n readonly height = input<number>(24);\n /**\n * Microchart bar series.\n * Example series can be:\n * @example\n * ```ts\n * Series: MicrochartBarSeries = { values: [2, 4, 5, 3, 5, 7, 7, 9, 11, 10, 12, 9], colorToken: 'element-data-7'};\n * ```\n */\n readonly series = input.required<MicrochartBarSeries>();\n\n protected barWidth = 4;\n\n protected readonly internalSeries = computed<SeriesInternal[]>(() => {\n const series = this.series();\n const maxValue = Math.max(...series.values, 1);\n const minValue = Math.min(...series.values, 0);\n const allNegative = maxValue <= 0;\n const allPositive = minValue >= 0;\n const range = Math.abs(maxValue) + Math.abs(minValue);\n const zeroPosition = allNegative ? 0 : allPositive ? 100 : (Math.abs(maxValue) / range) * 100;\n\n const maxRange = allNegative ? Math.abs(minValue) : allPositive ? maxValue : range;\n\n const int = series.values.map<SeriesInternal>(value => {\n const height = (Math.abs(value) / maxRange) * 100;\n const top = value >= 0 ? zeroPosition - height : zeroPosition;\n const colorToken =\n value < 0 && series.negativeColorToken ? series.negativeColorToken : series.colorToken;\n return { top, height, colorToken };\n });\n\n return int;\n });\n}\n","<div class=\"py-2\" [style.width.px]=\"width()\" [style.height.px]=\"height()\">\n <div class=\"position-relative h-100\">\n @for (item of internalSeries(); track $index) {\n <div\n class=\"position-absolute\"\n [style.height.%]=\"item.height\"\n [style.top.%]=\"item.top\"\n [style.left.px]=\"$index * (barWidth + 1)\"\n [style.width.px]=\"barWidth\"\n [style.backgroundColor]=\"'var(--' + item.colorToken + ')'\"\n ></div>\n }\n </div>\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-microchart-bar.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;;AAGG;MA4BU,wBAAwB,CAAA;;IAE1B,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;;IAEzB,MAAM,GAAG,KAAK,CAAS,EAAE;+EAAC;AACnC;;;;;;;AAOG;IACM,MAAM,GAAG,KAAK,CAAC,QAAQ;+EAAuB;IAE7C,QAAQ,GAAG,CAAC;AAEH,IAAA,cAAc,GAAG,QAAQ,CAAmB,MAAK;AAClE,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;AAC5B,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9C,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9C,QAAA,MAAM,WAAW,GAAG,QAAQ,IAAI,CAAC;AACjC,QAAA,MAAM,WAAW,GAAG,QAAQ,IAAI,CAAC;AACjC,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;AACrD,QAAA,MAAM,YAAY,GAAG,WAAW,GAAG,CAAC,GAAG,WAAW,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,KAAK,IAAI,GAAG;QAE7F,MAAM,QAAQ,GAAG,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,WAAW,GAAG,QAAQ,GAAG,KAAK;QAElF,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAiB,KAAK,IAAG;AACpD,YAAA,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,QAAQ,IAAI,GAAG;AACjD,YAAA,MAAM,GAAG,GAAG,KAAK,IAAI,CAAC,GAAG,YAAY,GAAG,MAAM,GAAG,YAAY;YAC7D,MAAM,UAAU,GACd,KAAK,GAAG,CAAC,IAAI,MAAM,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,GAAG,MAAM,CAAC,UAAU;AACxF,YAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE;AACpC,QAAA,CAAC,CAAC;AAEF,QAAA,OAAO,GAAG;IACZ,CAAC;uFAAC;uGArCS,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,scC/BrC,6fAcA,EAAA,CAAA;;2FDiBa,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,SAAS;+BACE,mBAAmB,EAAA,QAAA,EAAA,6fAAA,EAAA;;;AE5B/B;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, numberAttribute, computed,
|
|
2
|
+
import { input, numberAttribute, computed, Component } from '@angular/core';
|
|
3
3
|
import { makeArc, valueToRelativeAngle } from '@siemens/native-charts-ng/utils';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -18,13 +18,15 @@ class SiMicrochartDonutComponent {
|
|
|
18
18
|
* ```
|
|
19
19
|
* @defaultValue []
|
|
20
20
|
*/
|
|
21
|
-
series = input.required(
|
|
21
|
+
series = input.required(/* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []));
|
|
22
23
|
/**
|
|
23
24
|
* Radius of donut. The radius is calculated from center of the donut to the mid point of the arc.
|
|
24
25
|
* @defaultValue 7.5
|
|
25
26
|
*/
|
|
26
|
-
radius = input(7.5, { ...(ngDevMode ? { debugName: "radius" } : {}), transform: numberAttribute });
|
|
27
|
-
arcThickness = computed(() => 0.7 * this.radius(),
|
|
27
|
+
radius = input(7.5, { ...(ngDevMode ? { debugName: "radius" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
28
|
+
arcThickness = computed(() => 0.7 * this.radius(), /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "arcThickness" }] : /* istanbul ignore next */ []));
|
|
28
30
|
dim = computed(() => {
|
|
29
31
|
// Keeping the viewbox width and height only enough to fit the donut.
|
|
30
32
|
// The radius is calculated from center of the donut to the mid point of the arc.
|
|
@@ -34,8 +36,10 @@ class SiMicrochartDonutComponent {
|
|
|
34
36
|
const arcThickness = this.arcThickness();
|
|
35
37
|
const size = 2 * radius + arcThickness + this.bufferSpace;
|
|
36
38
|
return { width: size, height: size };
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
+
}, /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "dim" }] : /* istanbul ignore next */ []));
|
|
41
|
+
backgroundPath = computed(() => makeArc(this.center(), this.radius(), this.startAngle, this.endAngle), /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "backgroundPath" }] : /* istanbul ignore next */ []));
|
|
39
43
|
center = computed(() => {
|
|
40
44
|
// Once we have the viewbox dimensions, getting the donut at the center by
|
|
41
45
|
// calculating correct coordinates
|
|
@@ -44,7 +48,8 @@ class SiMicrochartDonutComponent {
|
|
|
44
48
|
x: d.width / 2,
|
|
45
49
|
y: d.height / 2
|
|
46
50
|
};
|
|
47
|
-
},
|
|
51
|
+
}, /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "center" }] : /* istanbul ignore next */ []));
|
|
48
53
|
min = 0;
|
|
49
54
|
max = 100;
|
|
50
55
|
startAngle = 0;
|
|
@@ -63,7 +68,8 @@ class SiMicrochartDonutComponent {
|
|
|
63
68
|
}
|
|
64
69
|
}
|
|
65
70
|
return result;
|
|
66
|
-
},
|
|
71
|
+
}, /* @ts-ignore */
|
|
72
|
+
...(ngDevMode ? [{ debugName: "internalSeries" }] : /* istanbul ignore next */ []));
|
|
67
73
|
toInternalSeries(startAngle, series, color) {
|
|
68
74
|
let nextAngle = valueToRelativeAngle(this.startAngle, this.endAngle, this.min, this.max, series.valuePercent) + startAngle;
|
|
69
75
|
startAngle = this.containAngle(startAngle);
|
|
@@ -79,12 +85,12 @@ class SiMicrochartDonutComponent {
|
|
|
79
85
|
containAngle(angle) {
|
|
80
86
|
return Math.max(this.startAngle, Math.min(this.endAngle, angle));
|
|
81
87
|
}
|
|
82
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
83
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
88
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiMicrochartDonutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
89
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: SiMicrochartDonutComponent, isStandalone: true, selector: "si-microchart-donut", inputs: { series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: true, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"chart\"\n [attr.viewBox]=\"'0 0 ' + dim().width + ' ' + dim().height\"\n [attr.width]=\"dim().width\"\n [attr.height]=\"dim().height\"\n>\n <g class=\"background\">\n <path [attr.d]=\"backgroundPath()\" [style.stroke-width]=\"arcThickness()\" />\n </g>\n <g class=\"data\">\n @for (series of internalSeries(); track $index) {\n @if (series?.path) {\n <path\n [attr.d]=\"series.path\"\n [attr.data-id]=\"series.series.id\"\n [style.stroke]=\"series.colorVar\"\n [style.stroke-width]=\"arcThickness()\"\n />\n }\n }\n </g>\n</svg>\n", styles: [".chart .background,.chart .data{fill:none}.chart .background{stroke:var(--element-ui-4)}\n"] });
|
|
84
90
|
}
|
|
85
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiMicrochartDonutComponent, decorators: [{
|
|
86
92
|
type: Component,
|
|
87
|
-
args: [{ selector: 'si-microchart-donut',
|
|
93
|
+
args: [{ selector: 'si-microchart-donut', template: "<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"chart\"\n [attr.viewBox]=\"'0 0 ' + dim().width + ' ' + dim().height\"\n [attr.width]=\"dim().width\"\n [attr.height]=\"dim().height\"\n>\n <g class=\"background\">\n <path [attr.d]=\"backgroundPath()\" [style.stroke-width]=\"arcThickness()\" />\n </g>\n <g class=\"data\">\n @for (series of internalSeries(); track $index) {\n @if (series?.path) {\n <path\n [attr.d]=\"series.path\"\n [attr.data-id]=\"series.series.id\"\n [style.stroke]=\"series.colorVar\"\n [style.stroke-width]=\"arcThickness()\"\n />\n }\n }\n </g>\n</svg>\n", styles: [".chart .background,.chart .data{fill:none}.chart .background{stroke:var(--element-ui-4)}\n"] }]
|
|
88
94
|
}], propDecorators: { series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: true }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }] } });
|
|
89
95
|
|
|
90
96
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siemens-native-charts-ng-microchart-donut.mjs","sources":["../../../../projects/native-charts-ng/microchart-donut/si-microchart-donut.component.ts","../../../../projects/native-charts-ng/microchart-donut/si-microchart-donut.component.html","../../../../projects/native-charts-ng/microchart-donut/index.ts","../../../../projects/native-charts-ng/microchart-donut/siemens-native-charts-ng-microchart-donut.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport {
|
|
1
|
+
{"version":3,"file":"siemens-native-charts-ng-microchart-donut.mjs","sources":["../../../../projects/native-charts-ng/microchart-donut/si-microchart-donut.component.ts","../../../../projects/native-charts-ng/microchart-donut/si-microchart-donut.component.html","../../../../projects/native-charts-ng/microchart-donut/index.ts","../../../../projects/native-charts-ng/microchart-donut/siemens-native-charts-ng-microchart-donut.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Component, computed, input, numberAttribute } from '@angular/core';\nimport { Coordinate, makeArc, valueToRelativeAngle } from '@siemens/native-charts-ng/utils';\n\n/**\n * One series of the microchart donut.\n */\nexport interface MicrochartDonutSeries {\n /** value in percent */\n valuePercent: number;\n /**\n * Use a data-color. See: {@link https://element.siemens.io/fundamentals/colors/data-visualization-colors/#tokens}\n *\n * @example \"element-data-10\"\n */\n colorToken: string;\n /** ID exposed as `data-id` */\n id?: string;\n}\n\ninterface InternalSeries {\n series: MicrochartDonutSeries;\n path: string;\n colorVar: string;\n}\n\n@Component({\n selector: 'si-microchart-donut',\n templateUrl: './si-microchart-donut.component.html',\n styleUrl: './si-microchart-donut.component.scss'\n})\nexport class SiMicrochartDonutComponent {\n /**\n * Microchart donut series. Can also be an array representing multiple series.\n * Each series, in case of multiple, forms section of the arc, in percentage\n * of the respective value.\n * Example series can be:\n * @example\n * ```ts\n * Series: MicrochartDonutSeries[] = [{ valuePercent: 40, colorToken: 'element-data-4' }];\n * ```\n * @defaultValue []\n */\n readonly series = input.required<MicrochartDonutSeries[]>();\n /**\n * Radius of donut. The radius is calculated from center of the donut to the mid point of the arc.\n * @defaultValue 7.5\n */\n readonly radius = input(7.5, { transform: numberAttribute });\n\n protected readonly arcThickness = computed(() => 0.7 * this.radius());\n protected readonly dim = computed(() => {\n // Keeping the viewbox width and height only enough to fit the donut.\n // The radius is calculated from center of the donut to the mid point of the arc.\n // Hence half the arc thicknes on both side needs to be added (equals full arc thickness)\n // The buffer space is added because the svg donut gets cropped on certain Os + browser configuration.\n const radius = this.radius();\n const arcThickness = this.arcThickness();\n const size = 2 * radius + arcThickness + this.bufferSpace;\n return { width: size, height: size };\n });\n\n protected readonly backgroundPath = computed(() =>\n makeArc(this.center(), this.radius(), this.startAngle, this.endAngle)\n );\n\n private readonly center = computed<Coordinate>(() => {\n // Once we have the viewbox dimensions, getting the donut at the center by\n // calculating correct coordinates\n const d = this.dim();\n return {\n x: d.width / 2,\n y: d.height / 2\n };\n });\n private readonly min = 0;\n private readonly max = 100;\n private readonly startAngle = 0;\n private readonly endAngle = 360;\n private readonly bufferSpace = 4;\n\n protected readonly internalSeries = computed(() => {\n const inputSeries = this.series();\n const result: InternalSeries[] = [];\n let nextPosAngle = 0;\n\n for (const series of inputSeries) {\n // Does not add series if percent is 0 or less\n if (series.valuePercent > 0) {\n const { nextAngle, internal } = this.toInternalSeries(nextPosAngle, series);\n result.push(internal);\n nextPosAngle = nextAngle;\n }\n }\n return result;\n });\n\n private toInternalSeries(\n startAngle: number,\n series: MicrochartDonutSeries,\n color?: string\n ): { nextAngle: number; internal: InternalSeries } {\n let nextAngle =\n valueToRelativeAngle(\n this.startAngle,\n this.endAngle,\n this.min,\n this.max,\n series.valuePercent\n ) + startAngle;\n\n startAngle = this.containAngle(startAngle);\n nextAngle = this.containAngle(nextAngle);\n\n color ??= series.colorToken;\n const internal: InternalSeries = {\n series,\n path: makeArc(this.center(), this.radius(), startAngle, nextAngle),\n colorVar: `var(--${color})`\n };\n return { nextAngle, internal };\n }\n\n private containAngle(angle: number): number {\n return Math.max(this.startAngle, Math.min(this.endAngle, angle));\n }\n}\n","<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"chart\"\n [attr.viewBox]=\"'0 0 ' + dim().width + ' ' + dim().height\"\n [attr.width]=\"dim().width\"\n [attr.height]=\"dim().height\"\n>\n <g class=\"background\">\n <path [attr.d]=\"backgroundPath()\" [style.stroke-width]=\"arcThickness()\" />\n </g>\n <g class=\"data\">\n @for (series of internalSeries(); track $index) {\n @if (series?.path) {\n <path\n [attr.d]=\"series.path\"\n [attr.data-id]=\"series.series.id\"\n [style.stroke]=\"series.colorVar\"\n [style.stroke-width]=\"arcThickness()\"\n />\n }\n }\n </g>\n</svg>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-microchart-donut.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;MA+BU,0BAA0B,CAAA;AACrC;;;;;;;;;;AAUG;IACM,MAAM,GAAG,KAAK,CAAC,QAAQ;+EAA2B;AAC3D;;;AAGG;IACM,MAAM,GAAG,KAAK,CAAC,GAAG,8EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;IAEzC,YAAY,GAAG,QAAQ,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE;qFAAC;AAClD,IAAA,GAAG,GAAG,QAAQ,CAAC,MAAK;;;;;AAKrC,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;AAC5B,QAAA,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE;QACxC,MAAM,IAAI,GAAG,CAAC,GAAG,MAAM,GAAG,YAAY,GAAG,IAAI,CAAC,WAAW;QACzD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACtC,CAAC;4EAAC;I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ular/core';
|
|
3
3
|
import { makePolyline } from '@siemens/native-charts-ng/utils';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -15,41 +15,50 @@ class SiMicrochartLineComponent {
|
|
|
15
15
|
* Series: MicrochartLineSeries = { values: [2, 3, 6, 5, 4, 7, 8], colorToken: 'element-data-10' };
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
series = input.required(
|
|
18
|
+
series = input.required(/* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []));
|
|
19
20
|
/** @defaultValue 64 */
|
|
20
|
-
width = input(64,
|
|
21
|
+
width = input(64, /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
21
23
|
/** @defaultValue 24 */
|
|
22
|
-
height = input(24,
|
|
24
|
+
height = input(24, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
23
26
|
/**
|
|
24
27
|
* Display circular markers at each data point on the line.
|
|
25
28
|
* When enabled, markers help highlight individual values and improve readability.
|
|
26
29
|
*
|
|
27
30
|
* @defaultValue false
|
|
28
31
|
*/
|
|
29
|
-
showMarkers = input(false,
|
|
32
|
+
showMarkers = input(false, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "showMarkers" }] : /* istanbul ignore next */ []));
|
|
30
34
|
/**
|
|
31
35
|
* Sets whether the area under the chart line should be filled.
|
|
32
36
|
*
|
|
33
37
|
* @defaultValue false
|
|
34
38
|
*/
|
|
35
|
-
showArea = input(false,
|
|
39
|
+
showArea = input(false, /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "showArea" }] : /* istanbul ignore next */ []));
|
|
36
41
|
/**
|
|
37
42
|
* Line width in pixels.
|
|
38
43
|
*
|
|
39
44
|
* @defaultValue 2
|
|
40
45
|
*/
|
|
41
|
-
lineWidth = input(2,
|
|
46
|
+
lineWidth = input(2, /* @ts-ignore */
|
|
47
|
+
...(ngDevMode ? [{ debugName: "lineWidth" }] : /* istanbul ignore next */ []));
|
|
42
48
|
/**
|
|
43
49
|
* Marker color token. If not provided, uses the series color token.
|
|
44
50
|
* Use a data-color. See: {@link https://element.siemens.io/fundamentals/colors/data-visualization-colors/#tokens}
|
|
45
51
|
*
|
|
46
52
|
* @example "element-data-2"
|
|
47
53
|
*/
|
|
48
|
-
markerColor = input(
|
|
49
|
-
|
|
54
|
+
markerColor = input(/* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [undefined, { debugName: "markerColor" }] : /* istanbul ignore next */ []));
|
|
56
|
+
markerRadius = computed(() => this.lineWidth(), /* @ts-ignore */
|
|
57
|
+
...(ngDevMode ? [{ debugName: "markerRadius" }] : /* istanbul ignore next */ []));
|
|
50
58
|
viewBox = computed(() => {
|
|
51
59
|
return `0 0 ${this.width()} ${this.height()}`;
|
|
52
|
-
},
|
|
60
|
+
}, /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "viewBox" }] : /* istanbul ignore next */ []));
|
|
53
62
|
path = computed(() => {
|
|
54
63
|
const series = this.series();
|
|
55
64
|
if (!series || series.values.length < 2) {
|
|
@@ -57,14 +66,16 @@ class SiMicrochartLineComponent {
|
|
|
57
66
|
}
|
|
58
67
|
const points = this.mapToCoordinates(series.values);
|
|
59
68
|
return makePolyline(points);
|
|
60
|
-
},
|
|
69
|
+
}, /* @ts-ignore */
|
|
70
|
+
...(ngDevMode ? [{ debugName: "path" }] : /* istanbul ignore next */ []));
|
|
61
71
|
markerPoints = computed(() => {
|
|
62
72
|
const series = this.series();
|
|
63
73
|
if (series?.values.length === 0) {
|
|
64
74
|
return [];
|
|
65
75
|
}
|
|
66
76
|
return this.mapToCoordinates(series.values);
|
|
67
|
-
},
|
|
77
|
+
}, /* @ts-ignore */
|
|
78
|
+
...(ngDevMode ? [{ debugName: "markerPoints" }] : /* istanbul ignore next */ []));
|
|
68
79
|
areaPath = computed(() => {
|
|
69
80
|
const series = this.series();
|
|
70
81
|
if (!series || series.values.length < 2) {
|
|
@@ -77,7 +88,8 @@ class SiMicrochartLineComponent {
|
|
|
77
88
|
});
|
|
78
89
|
path += `L ${points[points.length - 1].x} ${this.height()} Z`;
|
|
79
90
|
return path;
|
|
80
|
-
},
|
|
91
|
+
}, /* @ts-ignore */
|
|
92
|
+
...(ngDevMode ? [{ debugName: "areaPath" }] : /* istanbul ignore next */ []));
|
|
81
93
|
static instanceCounter = 0;
|
|
82
94
|
gradientId = `gradient-line-${SiMicrochartLineComponent.instanceCounter++}`;
|
|
83
95
|
mapToCoordinates(values) {
|
|
@@ -96,12 +108,12 @@ class SiMicrochartLineComponent {
|
|
|
96
108
|
y: this.height() - verticalMargin - (value - min) * scaleY
|
|
97
109
|
}));
|
|
98
110
|
}
|
|
99
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
100
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
111
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiMicrochartLineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
112
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: SiMicrochartLineComponent, isStandalone: true, selector: "si-microchart-line", inputs: { series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: true, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, showArea: { classPropertyName: "showArea", publicName: "showArea", isSignal: true, isRequired: false, transformFunction: null }, lineWidth: { classPropertyName: "lineWidth", publicName: "lineWidth", isSignal: true, isRequired: false, transformFunction: null }, markerColor: { classPropertyName: "markerColor", publicName: "markerColor", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<svg [attr.width]=\"width()\" [attr.height]=\"height()\" [attr.viewBox]=\"viewBox()\">\n @if (showArea()) {\n <defs>\n <linearGradient x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\" [attr.id]=\"gradientId\">\n <stop [attr.stop-color]=\"'var(--' + series().colorToken + ')'\" />\n <stop\n offset=\"1\"\n stop-opacity=\"0\"\n [attr.stop-color]=\"'var(--' + series().colorToken + ')'\"\n />\n </linearGradient>\n </defs>\n <path stroke=\"none\" [attr.d]=\"areaPath()\" [attr.fill]=\"'url(#' + gradientId + ')'\" />\n }\n <path\n fill=\"none\"\n [attr.d]=\"path()\"\n [attr.stroke]=\"'var(--' + series().colorToken + ')'\"\n [attr.stroke-width]=\"lineWidth()\"\n />\n @if (showMarkers()) {\n @for (point of markerPoints(); track point.x) {\n <circle\n [attr.cx]=\"point.x\"\n [attr.cy]=\"point.y\"\n [attr.r]=\"markerRadius()\"\n [attr.fill]=\"'var(--' + (markerColor() ?? series().colorToken) + ')'\"\n />\n }\n }\n</svg>\n" });
|
|
101
113
|
}
|
|
102
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiMicrochartLineComponent, decorators: [{
|
|
103
115
|
type: Component,
|
|
104
|
-
args: [{ selector: 'si-microchart-line',
|
|
116
|
+
args: [{ selector: 'si-microchart-line', template: "<svg [attr.width]=\"width()\" [attr.height]=\"height()\" [attr.viewBox]=\"viewBox()\">\n @if (showArea()) {\n <defs>\n <linearGradient x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\" [attr.id]=\"gradientId\">\n <stop [attr.stop-color]=\"'var(--' + series().colorToken + ')'\" />\n <stop\n offset=\"1\"\n stop-opacity=\"0\"\n [attr.stop-color]=\"'var(--' + series().colorToken + ')'\"\n />\n </linearGradient>\n </defs>\n <path stroke=\"none\" [attr.d]=\"areaPath()\" [attr.fill]=\"'url(#' + gradientId + ')'\" />\n }\n <path\n fill=\"none\"\n [attr.d]=\"path()\"\n [attr.stroke]=\"'var(--' + series().colorToken + ')'\"\n [attr.stroke-width]=\"lineWidth()\"\n />\n @if (showMarkers()) {\n @for (point of markerPoints(); track point.x) {\n <circle\n [attr.cx]=\"point.x\"\n [attr.cy]=\"point.y\"\n [attr.r]=\"markerRadius()\"\n [attr.fill]=\"'var(--' + (markerColor() ?? series().colorToken) + ')'\"\n />\n }\n }\n</svg>\n" }]
|
|
105
117
|
}], propDecorators: { series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: true }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], showArea: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArea", required: false }] }], lineWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "lineWidth", required: false }] }], markerColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "markerColor", required: false }] }] } });
|
|
106
118
|
|
|
107
119
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siemens-native-charts-ng-microchart-line.mjs","sources":["../../../../projects/native-charts-ng/microchart-line/si-microchart-line.component.ts","../../../../projects/native-charts-ng/microchart-line/si-microchart-line.component.html","../../../../projects/native-charts-ng/microchart-line/index.ts","../../../../projects/native-charts-ng/microchart-line/siemens-native-charts-ng-microchart-line.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport {
|
|
1
|
+
{"version":3,"file":"siemens-native-charts-ng-microchart-line.mjs","sources":["../../../../projects/native-charts-ng/microchart-line/si-microchart-line.component.ts","../../../../projects/native-charts-ng/microchart-line/si-microchart-line.component.html","../../../../projects/native-charts-ng/microchart-line/index.ts","../../../../projects/native-charts-ng/microchart-line/siemens-native-charts-ng-microchart-line.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Component, computed, input } from '@angular/core';\nimport { Coordinate, makePolyline } from '@siemens/native-charts-ng/utils';\n\nexport interface MicrochartLineSeries {\n /** Series values */\n values: number[];\n /**\n * Use a data-color. See: {@link https://element.siemens.io/fundamentals/colors/data-visualization-colors/#tokens}\n *\n * @example \"element-data-10\"\n */\n colorToken: string;\n}\n\n@Component({\n selector: 'si-microchart-line',\n templateUrl: './si-microchart-line.component.html'\n})\nexport class SiMicrochartLineComponent {\n /**\n * Microchart line series.\n * Example series can be:\n * @example\n * ```ts\n * Series: MicrochartLineSeries = { values: [2, 3, 6, 5, 4, 7, 8], colorToken: 'element-data-10' };\n * ```\n */\n readonly series = input.required<MicrochartLineSeries>();\n /** @defaultValue 64 */\n readonly width = input<number>(64);\n /** @defaultValue 24 */\n readonly height = input<number>(24);\n /**\n * Display circular markers at each data point on the line.\n * When enabled, markers help highlight individual values and improve readability.\n *\n * @defaultValue false\n */\n readonly showMarkers = input<boolean>(false);\n /**\n * Sets whether the area under the chart line should be filled.\n *\n * @defaultValue false\n */\n readonly showArea = input<boolean>(false);\n /**\n * Line width in pixels.\n *\n * @defaultValue 2\n */\n readonly lineWidth = input<number>(2);\n /**\n * Marker color token. If not provided, uses the series color token.\n * Use a data-color. See: {@link https://element.siemens.io/fundamentals/colors/data-visualization-colors/#tokens}\n *\n * @example \"element-data-2\"\n */\n readonly markerColor = input<string>();\n\n protected readonly markerRadius = computed(() => this.lineWidth());\n protected readonly viewBox = computed(() => {\n return `0 0 ${this.width()} ${this.height()}`;\n });\n\n protected readonly path = computed(() => {\n const series = this.series();\n if (!series || series.values.length < 2) {\n return '';\n }\n const points = this.mapToCoordinates(series.values);\n return makePolyline(points);\n });\n\n protected readonly markerPoints = computed(() => {\n const series = this.series();\n if (series?.values.length === 0) {\n return [];\n }\n return this.mapToCoordinates(series.values);\n });\n\n protected readonly areaPath = computed(() => {\n const series = this.series();\n if (!series || series.values.length < 2) {\n return '';\n }\n const points = this.mapToCoordinates(series.values);\n\n let path = `M ${points[0].x} ${this.height()}`;\n points.forEach(point => {\n path += `L ${point.x} ${point.y}`;\n });\n path += `L ${points[points.length - 1].x} ${this.height()} Z`;\n\n return path;\n });\n\n private static instanceCounter = 0;\n protected readonly gradientId = `gradient-line-${SiMicrochartLineComponent.instanceCounter++}`;\n\n private mapToCoordinates(values: number[]): Coordinate[] {\n const max = Math.max(...values);\n const min = Math.min(...values);\n\n // Calculate available space, accounting for marker radius or line width\n // This helps avoid the markers on the edges or the edges of the line getting cropped.\n const horizontalMargin = this.showMarkers() ? this.markerRadius() : this.lineWidth() / 2;\n const verticalMargin = this.showMarkers() ? this.markerRadius() : this.lineWidth() / 2;\n\n const availableWidth = this.width() - horizontalMargin * 2;\n const availableHeight = this.height() - verticalMargin * 2;\n\n const scaleX = values.length > 1 ? availableWidth / (values.length - 1) : 0;\n const scaleY = max !== min ? availableHeight / (max - min) : 1;\n\n return values.map((value, i) => ({\n x: horizontalMargin + i * scaleX,\n y: this.height() - verticalMargin - (value - min) * scaleY\n }));\n }\n}\n","<svg [attr.width]=\"width()\" [attr.height]=\"height()\" [attr.viewBox]=\"viewBox()\">\n @if (showArea()) {\n <defs>\n <linearGradient x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\" [attr.id]=\"gradientId\">\n <stop [attr.stop-color]=\"'var(--' + series().colorToken + ')'\" />\n <stop\n offset=\"1\"\n stop-opacity=\"0\"\n [attr.stop-color]=\"'var(--' + series().colorToken + ')'\"\n />\n </linearGradient>\n </defs>\n <path stroke=\"none\" [attr.d]=\"areaPath()\" [attr.fill]=\"'url(#' + gradientId + ')'\" />\n }\n <path\n fill=\"none\"\n [attr.d]=\"path()\"\n [attr.stroke]=\"'var(--' + series().colorToken + ')'\"\n [attr.stroke-width]=\"lineWidth()\"\n />\n @if (showMarkers()) {\n @for (point of markerPoints(); track point.x) {\n <circle\n [attr.cx]=\"point.x\"\n [attr.cy]=\"point.y\"\n [attr.r]=\"markerRadius()\"\n [attr.fill]=\"'var(--' + (markerColor() ?? series().colorToken) + ')'\"\n />\n }\n }\n</svg>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-microchart-line.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;MAmBU,yBAAyB,CAAA;AACpC;;;;;;;AAOG;IACM,MAAM,GAAG,KAAK,CAAC,QAAQ;+EAAwB;;IAE/C,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;;IAEzB,MAAM,GAAG,KAAK,CAAS,EAAE;+EAAC;AACnC;;;;;AAKG;IACM,WAAW,GAAG,KAAK,CAAU,KAAK;oFAAC;AAC5C;;;;AAIG;IACM,QAAQ,GAAG,KAAK,CAAU,KAAK;iFAAC;AACzC;;;;AAIG;IACM,SAAS,GAAG,KAAK,CAAS,CAAC;kFAAC;AACrC;;;;;AAKG;AACM,IAAA,WAAW,GAAG,KAAK;+FAAU;IAEnB,YAAY,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE;qFAAC;AAC/C,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;QACzC,OAAO,CAAA,IAAA,EAAO,IAAI,CAAC,KAAK,EAAE,CAAA,CAAA,EAAI,IAAI,CAAC,MAAM,EAAE,CAAA,CAAE;IAC/C,CAAC;gFAAC;AAEiB,IAAA,IAAI,GAAG,QAAQ,CAAC,MAAK;AACtC,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;QAC5B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AACvC,YAAA,OAAO,EAAE;QACX;Q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AA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,g+BCtBtC,shCA+BA,EAAA,CAAA;;2FDTa,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAJrC,SAAS;+BACE,oBAAoB,EAAA,QAAA,EAAA,shCAAA,EAAA;;;AEnBhC;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input,
|
|
2
|
+
import { input, Component } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Copyright (c) Siemens 2016 - 2026
|
|
@@ -14,17 +14,20 @@ class SiMicrochartProgressComponent {
|
|
|
14
14
|
* Series: MicrochartProgressSeries = { valuePercent: 80, colorToken: 'element-data-7' };
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
series = input.required(
|
|
17
|
+
series = input.required(/* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []));
|
|
18
19
|
/** @defaultValue 64 */
|
|
19
|
-
barWidth = input(64,
|
|
20
|
+
barWidth = input(64, /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "barWidth" }] : /* istanbul ignore next */ []));
|
|
20
22
|
/** @defaultValue 4 */
|
|
21
|
-
barHeight = input(4,
|
|
22
|
-
|
|
23
|
-
static
|
|
23
|
+
barHeight = input(4, /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "barHeight" }] : /* istanbul ignore next */ []));
|
|
25
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiMicrochartProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
26
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: SiMicrochartProgressComponent, isStandalone: true, selector: "si-microchart-progress", inputs: { series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: true, transformFunction: null }, barWidth: { classPropertyName: "barWidth", publicName: "barWidth", isSignal: true, isRequired: false, transformFunction: null }, barHeight: { classPropertyName: "barHeight", publicName: "barHeight", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "progressbar" }, properties: { "attr.aria-valuenow": "series().valuePercent", "attr.aria-valuemin": "0", "attr.aria-valuemax": "100", "attr.aria-valuetext": "series().valuePercent + \"%\"" } }, ngImport: i0, template: "<div class=\"pb-1 pt-1\" [style.width.px]=\"barWidth()\">\n <div class=\"text-secondary si-body\" aria-hidden=\"true\"> {{ series().valuePercent }}% </div>\n\n <div\n class=\"bar-background w-100\"\n [style.height.px]=\"barHeight()\"\n [style.border-radius.px]=\"barHeight() / 2\"\n >\n <div\n class=\"bar-foreground h-100\"\n [style.width.%]=\"series().valuePercent\"\n [style.backgroundColor]=\"'var(--' + series().colorToken + ')'\"\n [style.height.px]=\"barHeight()\"\n [style.border-radius.px]=\"barHeight() / 2\"\n ></div>\n </div>\n</div>\n", styles: [".bar-background{background-color:var(--element-ui-4)}\n"] });
|
|
24
27
|
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiMicrochartProgressComponent, decorators: [{
|
|
26
29
|
type: Component,
|
|
27
|
-
args: [{ selector: 'si-microchart-progress',
|
|
30
|
+
args: [{ selector: 'si-microchart-progress', host: {
|
|
28
31
|
role: 'progressbar',
|
|
29
32
|
'[attr.aria-valuenow]': 'series().valuePercent',
|
|
30
33
|
'[attr.aria-valuemin]': '0',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siemens-native-charts-ng-microchart-progress.mjs","sources":["../../../../projects/native-charts-ng/microchart-progress/si-microchart-progress.component.ts","../../../../projects/native-charts-ng/microchart-progress/si-microchart-progress.component.html","../../../../projects/native-charts-ng/microchart-progress/index.ts","../../../../projects/native-charts-ng/microchart-progress/siemens-native-charts-ng-microchart-progress.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport {
|
|
1
|
+
{"version":3,"file":"siemens-native-charts-ng-microchart-progress.mjs","sources":["../../../../projects/native-charts-ng/microchart-progress/si-microchart-progress.component.ts","../../../../projects/native-charts-ng/microchart-progress/si-microchart-progress.component.html","../../../../projects/native-charts-ng/microchart-progress/index.ts","../../../../projects/native-charts-ng/microchart-progress/siemens-native-charts-ng-microchart-progress.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { Component, input } from '@angular/core';\n\nexport interface MicrochartProgressSeries {\n /** Value in percent */\n valuePercent: number;\n /**\n * Use a data-color. See: {@link https://element.siemens.io/fundamentals/colors/data-visualization-colors/#tokens}\n *\n * @example \"element-data-10\"\n */\n colorToken: string;\n}\n\n@Component({\n selector: 'si-microchart-progress',\n templateUrl: './si-microchart-progress.component.html',\n styleUrl: './si-microchart-progress.component.scss',\n host: {\n role: 'progressbar',\n '[attr.aria-valuenow]': 'series().valuePercent',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuemax]': '100',\n '[attr.aria-valuetext]': 'series().valuePercent + \"%\"'\n }\n})\nexport class SiMicrochartProgressComponent {\n /**\n * Microchart progress series.\n * Example series can be:\n * @example\n * ```ts\n * Series: MicrochartProgressSeries = { valuePercent: 80, colorToken: 'element-data-7' };\n * ```\n */\n readonly series = input.required<MicrochartProgressSeries>();\n /** @defaultValue 64 */\n readonly barWidth = input<number>(64);\n /** @defaultValue 4 */\n readonly barHeight = input<number>(4);\n}\n","<div class=\"pb-1 pt-1\" [style.width.px]=\"barWidth()\">\n <div class=\"text-secondary si-body\" aria-hidden=\"true\"> {{ series().valuePercent }}% </div>\n\n <div\n class=\"bar-background w-100\"\n [style.height.px]=\"barHeight()\"\n [style.border-radius.px]=\"barHeight() / 2\"\n >\n <div\n class=\"bar-foreground h-100\"\n [style.width.%]=\"series().valuePercent\"\n [style.backgroundColor]=\"'var(--' + series().colorToken + ')'\"\n [style.height.px]=\"barHeight()\"\n [style.border-radius.px]=\"barHeight() / 2\"\n ></div>\n </div>\n</div>\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-microchart-progress.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;;AAGG;MA0BU,6BAA6B,CAAA;AACxC;;;;;;;AAOG;IACM,MAAM,GAAG,KAAK,CAAC,QAAQ;+EAA4B;;IAEnD,QAAQ,GAAG,KAAK,CAAS,EAAE;iFAAC;;IAE5B,SAAS,GAAG,KAAK,CAAS,CAAC;kFAAC;uGAb1B,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA7B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,6BAA6B,6rBC7B1C,ilBAiBA,EAAA,MAAA,EAAA,CAAA,yDAAA,CAAA,EAAA,CAAA;;2FDYa,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAZzC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,wBAAwB,EAAA,IAAA,EAG5B;AACJ,wBAAA,IAAI,EAAE,aAAa;AACnB,wBAAA,sBAAsB,EAAE,uBAAuB;AAC/C,wBAAA,sBAAsB,EAAE,GAAG;AAC3B,wBAAA,sBAAsB,EAAE,KAAK;AAC7B,wBAAA,uBAAuB,EAAE;AAC1B,qBAAA,EAAA,QAAA,EAAA,ilBAAA,EAAA,MAAA,EAAA,CAAA,yDAAA,CAAA,EAAA;;;AE3BH;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
@@ -8,11 +8,11 @@ import { NgModule } from '@angular/core';
|
|
|
8
8
|
* SPDX-License-Identifier: MIT
|
|
9
9
|
*/
|
|
10
10
|
class SiNativeChartsNgModule {
|
|
11
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
12
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
13
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiNativeChartsNgModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
12
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.5", ngImport: i0, type: SiNativeChartsNgModule, imports: [SiNChartGaugeComponent], exports: [SiNChartGaugeComponent] });
|
|
13
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiNativeChartsNgModule, imports: [SiNChartGaugeComponent] });
|
|
14
14
|
}
|
|
15
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiNativeChartsNgModule, decorators: [{
|
|
16
16
|
type: NgModule,
|
|
17
17
|
args: [{
|
|
18
18
|
imports: [SiNChartGaugeComponent],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siemens/native-charts-ng",
|
|
3
3
|
"description": "Element Native charts library.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "51.0.0-rc.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
"homepage": "https://github.com/siemens/element",
|
|
16
16
|
"bugs": "https://github.com/siemens/element/issues/new",
|
|
17
17
|
"publishConfig": {
|
|
18
|
-
"access": "public"
|
|
18
|
+
"access": "public",
|
|
19
|
+
"directory": "../../dist/@siemens/native-charts-ng"
|
|
19
20
|
},
|
|
20
21
|
"peerDependencies": {
|
|
21
|
-
"@angular/common": "
|
|
22
|
-
"@angular/core": "
|
|
23
|
-
"@siemens/element-theme": "
|
|
22
|
+
"@angular/common": "22",
|
|
23
|
+
"@angular/core": "22",
|
|
24
|
+
"@siemens/element-theme": "51.0.0-rc.3"
|
|
24
25
|
},
|
|
25
26
|
"exports": {
|
|
26
27
|
"./docs.json": {
|
|
@@ -63,5 +64,6 @@
|
|
|
63
64
|
"sideEffects": false,
|
|
64
65
|
"dependencies": {
|
|
65
66
|
"tslib": "^2.3.0"
|
|
66
|
-
}
|
|
67
|
+
},
|
|
68
|
+
"readme": "# Element Native Charts\n\nThe Element native chart library for Angular without external dependencies.\n\n## Usage\n\nTo use the Element Native Charts Angular components in your project, add them to your dependencies\nby executing:\n\n```sh\nnpm install --save @siemens/native-charts-ng\n```\n\nElement Native Charts uses standalone components with separate entry points.\nImport components directly from their specific entry points:\n\n```ts\nimport { SiNChartGaugeComponent } from '@siemens/native-charts-ng/gauge';\nimport { SiMicrochartBarComponent } from '@siemens/native-charts-ng/microchart-bar';\nimport { SiMicrochartDonutComponent } from '@siemens/native-charts-ng/microchart-donut';\nimport { SiMicrochartLineComponent } from '@siemens/native-charts-ng/microchart-line';\nimport { SiMicrochartProgressComponent } from '@siemens/native-charts-ng/microchart-progress';\n\n@Component({\n selector: 'app-dashboard',\n imports: [\n SiNChartGaugeComponent,\n SiMicrochartBarComponent\n // ... other components\n ],\n template: `\n <si-nchart-gauge [series]=\"gaugeSeries\" [min]=\"0\" [max]=\"100\" />\n <si-microchart-bar [series]=\"barSeries\" />\n `\n})\nexport class DashboardComponent {}\n```\n\n### Running unit tests\n\nRun `pnpm run native-charts:test` to perform the unit tests via [Vitest](https://main.vitest.dev/).\n\n## License\n\nCode and documentation Copyright (c) Siemens 2016 - 2026\n\nMIT, see [LICENSE](LICENSE).\n"
|
|
67
69
|
}
|
/package/{LICENSE.md → LICENSE}
RENAMED
|
File without changes
|