@spike-rabbit/charts-ng 49.0.1 → 49.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +17 -3
- package/cartesian/package.json +4 -0
- package/chart/package.json +4 -0
- package/circle/package.json +4 -0
- package/common/package.json +4 -0
- package/custom-legend/package.json +4 -0
- package/fesm2022/spike-rabbit-charts-ng-cartesian.mjs +383 -0
- package/fesm2022/spike-rabbit-charts-ng-cartesian.mjs.map +1 -0
- package/fesm2022/spike-rabbit-charts-ng-chart.mjs +59 -0
- package/fesm2022/spike-rabbit-charts-ng-chart.mjs.map +1 -0
- package/fesm2022/spike-rabbit-charts-ng-circle.mjs +91 -0
- package/fesm2022/spike-rabbit-charts-ng-circle.mjs.map +1 -0
- package/fesm2022/spike-rabbit-charts-ng-common.mjs +2383 -0
- package/fesm2022/spike-rabbit-charts-ng-common.mjs.map +1 -0
- package/fesm2022/spike-rabbit-charts-ng-custom-legend.mjs +62 -0
- package/fesm2022/spike-rabbit-charts-ng-custom-legend.mjs.map +1 -0
- package/fesm2022/spike-rabbit-charts-ng-gauge.mjs +371 -0
- package/fesm2022/spike-rabbit-charts-ng-gauge.mjs.map +1 -0
- package/fesm2022/spike-rabbit-charts-ng-loading-spinner.mjs +27 -0
- package/fesm2022/spike-rabbit-charts-ng-loading-spinner.mjs.map +1 -0
- package/fesm2022/spike-rabbit-charts-ng-progress-bar.mjs +170 -0
- package/fesm2022/spike-rabbit-charts-ng-progress-bar.mjs.map +1 -0
- package/fesm2022/spike-rabbit-charts-ng-progress.mjs +220 -0
- package/fesm2022/spike-rabbit-charts-ng-progress.mjs.map +1 -0
- package/fesm2022/spike-rabbit-charts-ng-sankey.mjs +52 -0
- package/fesm2022/spike-rabbit-charts-ng-sankey.mjs.map +1 -0
- package/fesm2022/spike-rabbit-charts-ng-sunburst.mjs +52 -0
- package/fesm2022/spike-rabbit-charts-ng-sunburst.mjs.map +1 -0
- package/fesm2022/spike-rabbit-charts-ng.mjs +40 -3527
- package/fesm2022/spike-rabbit-charts-ng.mjs.map +1 -1
- package/gauge/package.json +4 -0
- package/loading-spinner/package.json +4 -0
- package/package.json +58 -12
- package/progress/package.json +4 -0
- package/progress-bar/package.json +4 -0
- package/projects/charts-ng/README.md +17 -3
- package/sankey/package.json +4 -0
- package/sunburst/package.json +4 -0
- package/types/spike-rabbit-charts-ng-cartesian.d.ts +91 -0
- package/types/spike-rabbit-charts-ng-chart.d.ts +9 -0
- package/types/spike-rabbit-charts-ng-circle.d.ts +74 -0
- package/{index.d.ts → types/spike-rabbit-charts-ng-common.d.ts} +102 -431
- package/types/spike-rabbit-charts-ng-custom-legend.d.ts +68 -0
- package/types/spike-rabbit-charts-ng-gauge.d.ts +96 -0
- package/types/spike-rabbit-charts-ng-loading-spinner.d.ts +8 -0
- package/types/spike-rabbit-charts-ng-progress-bar.d.ts +46 -0
- package/types/spike-rabbit-charts-ng-progress.d.ts +57 -0
- package/types/spike-rabbit-charts-ng-sankey.d.ts +19 -0
- package/types/spike-rabbit-charts-ng-sunburst.d.ts +19 -0
- package/types/spike-rabbit-charts-ng.d.ts +35 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { echarts, SiChartBaseComponent } from '@spike-rabbit/charts-ng/common';
|
|
4
|
+
import { SiCustomLegendComponent } from '@spike-rabbit/charts-ng/custom-legend';
|
|
5
|
+
import { SiChartLoadingSpinnerComponent } from '@spike-rabbit/charts-ng/loading-spinner';
|
|
6
|
+
import { BarChart } from 'echarts/charts';
|
|
7
|
+
import { GridComponent } from 'echarts/components';
|
|
8
|
+
import { LegacyGridContainLabel } from 'echarts/features';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
12
|
+
* SPDX-License-Identifier: MIT
|
|
13
|
+
*/
|
|
14
|
+
echarts.use([BarChart, GridComponent, LegacyGridContainLabel]);
|
|
15
|
+
class SiChartProgressBarComponent extends SiChartBaseComponent {
|
|
16
|
+
/** The series for the chart. */
|
|
17
|
+
series = input(/* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [undefined, { debugName: "series" }] : /* istanbul ignore next */ []));
|
|
19
|
+
/** Used to display the label in inline or above the progress-bar. */
|
|
20
|
+
labelPosition = input(/* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [undefined, { debugName: "labelPosition" }] : /* istanbul ignore next */ []));
|
|
22
|
+
maxValue = 100;
|
|
23
|
+
xAxisConfig = { type: 'value', max: this.maxValue };
|
|
24
|
+
yAxis = {
|
|
25
|
+
type: 'category',
|
|
26
|
+
data: [],
|
|
27
|
+
axisLabel: {
|
|
28
|
+
show: true,
|
|
29
|
+
fontSize: 14
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
formatter = new Intl.NumberFormat(undefined, { maximumFractionDigits: 1 });
|
|
33
|
+
labelPositionOption;
|
|
34
|
+
labelPositionOptionForValue;
|
|
35
|
+
labelFormatter(p) {
|
|
36
|
+
return this.formatter.format(this.maxValue - p.value) + ' %';
|
|
37
|
+
}
|
|
38
|
+
themeChanged() {
|
|
39
|
+
this.applyOptions();
|
|
40
|
+
}
|
|
41
|
+
applyOptions() {
|
|
42
|
+
this.showLegend.set(false);
|
|
43
|
+
const grey = this.getThemeCustomValue(['progress', 'grey'], '#E6E6E6');
|
|
44
|
+
const labelColor = this.getThemeCustomValue(['progressBar', 'labelColor'], '#000');
|
|
45
|
+
const itemWidth = this.getThemeCustomValue(['progressBar', 'itemWidth'], 20);
|
|
46
|
+
if (this.labelPosition() === 'top') {
|
|
47
|
+
this.yAxis.axisLabel = false;
|
|
48
|
+
this.labelPositionOption = {
|
|
49
|
+
position: [0, -16],
|
|
50
|
+
formatter: '{b}',
|
|
51
|
+
fontSize: 14,
|
|
52
|
+
color: labelColor,
|
|
53
|
+
show: true
|
|
54
|
+
};
|
|
55
|
+
this.labelPositionOptionForValue = {
|
|
56
|
+
position: ['100%', '-80%'],
|
|
57
|
+
align: 'right',
|
|
58
|
+
show: true,
|
|
59
|
+
formatter: p => this.labelFormatter(p),
|
|
60
|
+
color: labelColor,
|
|
61
|
+
fontWeight: 700
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this.yAxis.axisLabel.show = true;
|
|
66
|
+
this.labelPositionOption = {
|
|
67
|
+
show: false
|
|
68
|
+
};
|
|
69
|
+
this.labelPositionOptionForValue = {
|
|
70
|
+
position: 'right',
|
|
71
|
+
show: true,
|
|
72
|
+
formatter: p => this.labelFormatter(p),
|
|
73
|
+
color: labelColor,
|
|
74
|
+
fontWeight: 700
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
this.actualOptions = {
|
|
78
|
+
series: [],
|
|
79
|
+
xAxis: this.xAxisConfig,
|
|
80
|
+
yAxis: this.yAxis,
|
|
81
|
+
grid: {},
|
|
82
|
+
tooltip: {}
|
|
83
|
+
};
|
|
84
|
+
const categoryAxisOpts = {
|
|
85
|
+
axisLine: { show: false },
|
|
86
|
+
axisTick: { show: false },
|
|
87
|
+
splitLine: { show: false },
|
|
88
|
+
axisLabel: { show: this.yAxis.axisLabel },
|
|
89
|
+
inverse: true
|
|
90
|
+
};
|
|
91
|
+
const valueAxisOpts = {
|
|
92
|
+
axisLabel: { show: false },
|
|
93
|
+
axisLine: { show: false },
|
|
94
|
+
axisTick: { show: false },
|
|
95
|
+
splitLine: { show: false }
|
|
96
|
+
};
|
|
97
|
+
echarts.util.merge(this.actualOptions.yAxis, categoryAxisOpts, true);
|
|
98
|
+
echarts.util.merge(this.actualOptions.xAxis, valueAxisOpts, true);
|
|
99
|
+
this.actualOptions.grid = this.getThemeCustomValue(['progressBar', 'grid'], {});
|
|
100
|
+
const series = this.series();
|
|
101
|
+
if (series) {
|
|
102
|
+
const optionSeries = this.actualOptions.series;
|
|
103
|
+
this.actualOptions.yAxis.data = series.map(item => item.name);
|
|
104
|
+
const dataItem = {
|
|
105
|
+
type: 'bar',
|
|
106
|
+
stack: 'chart',
|
|
107
|
+
z: 3,
|
|
108
|
+
barWidth: itemWidth,
|
|
109
|
+
label: this.labelPositionOption,
|
|
110
|
+
data: series.map(item => item.percent)
|
|
111
|
+
};
|
|
112
|
+
const fillerItem = {
|
|
113
|
+
type: 'bar',
|
|
114
|
+
stack: 'chart',
|
|
115
|
+
silent: true,
|
|
116
|
+
label: this.labelPositionOptionForValue,
|
|
117
|
+
itemStyle: {
|
|
118
|
+
color: grey
|
|
119
|
+
},
|
|
120
|
+
data: series.map(item => this.maxValue - item.percent)
|
|
121
|
+
};
|
|
122
|
+
optionSeries.push(dataItem);
|
|
123
|
+
optionSeries.push(fillerItem);
|
|
124
|
+
}
|
|
125
|
+
this.applyTitles();
|
|
126
|
+
}
|
|
127
|
+
applyDataZoom() { }
|
|
128
|
+
/**
|
|
129
|
+
* Updates single value of a single progress bar.
|
|
130
|
+
*/
|
|
131
|
+
changeSingleValue(valueIndex, value) {
|
|
132
|
+
const optionSeries = this.actualOptions.series;
|
|
133
|
+
optionSeries[0].data[valueIndex] = value;
|
|
134
|
+
optionSeries[1].data[valueIndex] = this.maxValue - value;
|
|
135
|
+
this.updateEChart();
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Updates multiple values of a single progress bar.
|
|
139
|
+
*/
|
|
140
|
+
changeMultiValues(updateValues) {
|
|
141
|
+
const optionSeries = this.actualOptions.series;
|
|
142
|
+
updateValues.forEach(update => {
|
|
143
|
+
const currentDataItem = optionSeries[0].data[update.valueIndex];
|
|
144
|
+
if (!currentDataItem) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
optionSeries[0].data[update.valueIndex] = update.value;
|
|
148
|
+
optionSeries[1].data[update.valueIndex] = this.maxValue - update.value;
|
|
149
|
+
});
|
|
150
|
+
this.updateEChart();
|
|
151
|
+
}
|
|
152
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiChartProgressBarComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
153
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: SiChartProgressBarComponent, isStandalone: true, selector: "si-chart-progress-bar", inputs: { series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "@if (showCustomLegend() && (title() || subTitle())) {\n <div class=\"si-h5 chart-title chart-title-width\" [style.background-color]=\"backgroundColor()\">\n <div class=\"chart-title-text\" [style.color]=\"titleColor()\">{{ title() }}</div>\n @if (subTitle()) {\n <div class=\"si-body\" [style.color]=\"subTitleColor()\">{{ subTitle() }}</div>\n }\n </div>\n}\n\n<div\n #chartContainerWrapper\n class=\"chart-container-wrapper\"\n [class.chart-scroll]=\"containerHeight()\"\n [attr.tabindex]=\"containerHeight() ? '0' : null\"\n>\n <div class=\"chart-container\" [style.height.px]=\"containerHeight()\">\n @if (showCustomLegend()) {\n @for (cl of customLegend; track $index) {\n <si-custom-legend\n #siCustomLegend\n class=\"custom-legend\"\n [style.top.px]=\"cl.top\"\n [title]=\"title()\"\n [subTitle]=\"subTitle()\"\n [customLegend]=\"cl\"\n [style.background-color]=\"backgroundColor()\"\n [titleColor]=\"titleColor()\"\n [subTitleColor]=\"subTitleColor()\"\n [textColor]=\"textColor()\"\n (legendIconClickEvent)=\"handleLegendClick($event)\"\n (legendClickEvent)=\"handleLegendClick($event)\"\n (legendHoverStartEvent)=\"handleLegendHover($event, true)\"\n (legendHoverEndEvent)=\"handleLegendHover($event, false)\"\n />\n }\n }\n <div #chart class=\"echart-container\" [style.height.px]=\"containerHeight()\"></div>\n </div>\n</div>\n@if (externalZoomSlider()) {\n <div\n #externalZoomSlider\n class=\"external-zoom-container\"\n [class.has-time-range-bar]=\"showTimeRangeBar()\"\n [style.--time-bar-height.px]=\"timeBarHeight()\"\n ></div>\n}\n\n@if (showTimeRangeBar() && zoomSlider()) {\n <div\n class=\"time-range-bar\"\n [style.bottom.px]=\"timeBarBottom()\"\n [style.padding-left.px]=\"timeBarLeft()\"\n [style.padding-right.px]=\"timeBarRight()\"\n >\n <ng-content select=\"[slot=timeRangeBar]\" />\n </div>\n}\n\n@if (inProgress()) {\n <div class=\"progress-container\">\n <si-chart-loading-spinner />\n </div>\n}\n", styles: [":host{block-size:100%;position:relative;display:flex!important;flex-direction:column;inline-size:100%}.chart-container-wrapper{display:flex;flex:1 0 0;inline-size:inherit;overflow:hidden}.chart-scroll{overflow-y:auto}.chart-container{position:relative;display:flex;flex:1 0 0;overflow:hidden}.echart-container{flex:1 0 0;inline-size:100%;min-block-size:var(--si-chart-min-height, 200px);overflow:hidden}.custom-legend{position:absolute;z-index:2;inline-size:100%}.chart-title{padding-block:12px 8px;padding-inline-start:24px}.external-zoom-container{display:flex;flex:1 0 0;inline-size:inherit;max-block-size:112px}.external-zoom-container.has-time-range-bar{max-block-size:calc(112px + var(--time-bar-height))}.tooltip-inner{max-inline-size:375px;min-inline-size:375px;color:#162938;font-size:18px;background-color:#162938}.time-range-bar{position:absolute;inset-inline:0;z-index:2}.progress-container{position:absolute;inset:0;pointer-events:none;z-index:100;display:flex;justify-content:center;align-items:center}\n"], dependencies: [{ kind: "component", type: SiCustomLegendComponent, selector: "si-custom-legend", inputs: ["customLegend", "title", "subTitle", "titleColor", "subTitleColor", "textColor"], outputs: ["legendIconClickEvent", "legendClickEvent", "legendHoverStartEvent", "legendHoverEndEvent"] }, { kind: "component", type: SiChartLoadingSpinnerComponent, selector: "si-chart-loading-spinner" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
154
|
+
}
|
|
155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiChartProgressBarComponent, decorators: [{
|
|
156
|
+
type: Component,
|
|
157
|
+
args: [{ selector: 'si-chart-progress-bar', imports: [SiCustomLegendComponent, SiChartLoadingSpinnerComponent], changeDetection: ChangeDetectionStrategy.Eager, template: "@if (showCustomLegend() && (title() || subTitle())) {\n <div class=\"si-h5 chart-title chart-title-width\" [style.background-color]=\"backgroundColor()\">\n <div class=\"chart-title-text\" [style.color]=\"titleColor()\">{{ title() }}</div>\n @if (subTitle()) {\n <div class=\"si-body\" [style.color]=\"subTitleColor()\">{{ subTitle() }}</div>\n }\n </div>\n}\n\n<div\n #chartContainerWrapper\n class=\"chart-container-wrapper\"\n [class.chart-scroll]=\"containerHeight()\"\n [attr.tabindex]=\"containerHeight() ? '0' : null\"\n>\n <div class=\"chart-container\" [style.height.px]=\"containerHeight()\">\n @if (showCustomLegend()) {\n @for (cl of customLegend; track $index) {\n <si-custom-legend\n #siCustomLegend\n class=\"custom-legend\"\n [style.top.px]=\"cl.top\"\n [title]=\"title()\"\n [subTitle]=\"subTitle()\"\n [customLegend]=\"cl\"\n [style.background-color]=\"backgroundColor()\"\n [titleColor]=\"titleColor()\"\n [subTitleColor]=\"subTitleColor()\"\n [textColor]=\"textColor()\"\n (legendIconClickEvent)=\"handleLegendClick($event)\"\n (legendClickEvent)=\"handleLegendClick($event)\"\n (legendHoverStartEvent)=\"handleLegendHover($event, true)\"\n (legendHoverEndEvent)=\"handleLegendHover($event, false)\"\n />\n }\n }\n <div #chart class=\"echart-container\" [style.height.px]=\"containerHeight()\"></div>\n </div>\n</div>\n@if (externalZoomSlider()) {\n <div\n #externalZoomSlider\n class=\"external-zoom-container\"\n [class.has-time-range-bar]=\"showTimeRangeBar()\"\n [style.--time-bar-height.px]=\"timeBarHeight()\"\n ></div>\n}\n\n@if (showTimeRangeBar() && zoomSlider()) {\n <div\n class=\"time-range-bar\"\n [style.bottom.px]=\"timeBarBottom()\"\n [style.padding-left.px]=\"timeBarLeft()\"\n [style.padding-right.px]=\"timeBarRight()\"\n >\n <ng-content select=\"[slot=timeRangeBar]\" />\n </div>\n}\n\n@if (inProgress()) {\n <div class=\"progress-container\">\n <si-chart-loading-spinner />\n </div>\n}\n", styles: [":host{block-size:100%;position:relative;display:flex!important;flex-direction:column;inline-size:100%}.chart-container-wrapper{display:flex;flex:1 0 0;inline-size:inherit;overflow:hidden}.chart-scroll{overflow-y:auto}.chart-container{position:relative;display:flex;flex:1 0 0;overflow:hidden}.echart-container{flex:1 0 0;inline-size:100%;min-block-size:var(--si-chart-min-height, 200px);overflow:hidden}.custom-legend{position:absolute;z-index:2;inline-size:100%}.chart-title{padding-block:12px 8px;padding-inline-start:24px}.external-zoom-container{display:flex;flex:1 0 0;inline-size:inherit;max-block-size:112px}.external-zoom-container.has-time-range-bar{max-block-size:calc(112px + var(--time-bar-height))}.tooltip-inner{max-inline-size:375px;min-inline-size:375px;color:#162938;font-size:18px;background-color:#162938}.time-range-bar{position:absolute;inset-inline:0;z-index:2}.progress-container{position:absolute;inset:0;pointer-events:none;z-index:100;display:flex;justify-content:center;align-items:center}\n"] }]
|
|
158
|
+
}], propDecorators: { series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }] } });
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
162
|
+
* SPDX-License-Identifier: MIT
|
|
163
|
+
*/
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Generated bundle index. Do not edit.
|
|
167
|
+
*/
|
|
168
|
+
|
|
169
|
+
export { SiChartProgressBarComponent };
|
|
170
|
+
//# sourceMappingURL=spike-rabbit-charts-ng-progress-bar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spike-rabbit-charts-ng-progress-bar.mjs","sources":["../../../../projects/charts-ng/progress-bar/si-chart-progress-bar.component.ts","../../../../projects/charts-ng/common/si-chart-base.component.html","../../../../projects/charts-ng/progress-bar/index.ts","../../../../projects/charts-ng/progress-bar/spike-rabbit-charts-ng-progress-bar.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport {\n SiChartBaseComponent,\n echarts,\n BarSeriesOption,\n ChartXAxis,\n ChartYAxis\n} from '@spike-rabbit/charts-ng/common';\nimport { SiCustomLegendComponent } from '@spike-rabbit/charts-ng/custom-legend';\nimport { SiChartLoadingSpinnerComponent } from '@spike-rabbit/charts-ng/loading-spinner';\nimport { BarChart } from 'echarts/charts';\nimport { GridComponent } from 'echarts/components';\nimport { LegacyGridContainLabel } from 'echarts/features';\n\nimport { ProgressBarChartSeries, ProgressBarValueUpdate } from './si-chart-progress-bar.interface';\n\necharts.use([BarChart, GridComponent, LegacyGridContainLabel]);\n\n@Component({\n selector: 'si-chart-progress-bar',\n imports: [SiCustomLegendComponent, SiChartLoadingSpinnerComponent],\n templateUrl: '../common/si-chart-base.component.html',\n styleUrl: '../common/si-chart-base.component.scss',\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class SiChartProgressBarComponent extends SiChartBaseComponent {\n /** The series for the chart. */\n readonly series = input<ProgressBarChartSeries[]>();\n /** Used to display the label in inline or above the progress-bar. */\n readonly labelPosition = input<string>();\n\n private maxValue = 100;\n private xAxisConfig: ChartXAxis = { type: 'value', max: this.maxValue };\n private yAxis: ChartYAxis = {\n type: 'category',\n data: [],\n axisLabel: {\n show: true,\n fontSize: 14\n }\n };\n\n private readonly formatter = new Intl.NumberFormat(undefined, { maximumFractionDigits: 1 });\n private labelPositionOption: BarSeriesOption['label'];\n private labelPositionOptionForValue: BarSeriesOption['label'];\n\n private labelFormatter(p: any): string {\n return this.formatter.format(this.maxValue - p.value) + ' %';\n }\n\n protected override themeChanged(): void {\n this.applyOptions();\n }\n\n protected override applyOptions(): void {\n this.showLegend.set(false);\n const grey = this.getThemeCustomValue(['progress', 'grey'], '#E6E6E6');\n const labelColor = this.getThemeCustomValue(['progressBar', 'labelColor'], '#000');\n const itemWidth = this.getThemeCustomValue(['progressBar', 'itemWidth'], 20);\n\n if (this.labelPosition() === 'top') {\n this.yAxis.axisLabel = false;\n this.labelPositionOption = {\n position: [0, -16],\n formatter: '{b}',\n fontSize: 14,\n color: labelColor,\n show: true\n };\n this.labelPositionOptionForValue = {\n position: ['100%', '-80%'],\n align: 'right',\n show: true,\n formatter: p => this.labelFormatter(p),\n color: labelColor,\n fontWeight: 700\n };\n } else {\n this.yAxis.axisLabel.show = true;\n this.labelPositionOption = {\n show: false\n };\n this.labelPositionOptionForValue = {\n position: 'right',\n show: true,\n formatter: p => this.labelFormatter(p),\n color: labelColor,\n fontWeight: 700\n };\n }\n\n this.actualOptions = {\n series: [],\n xAxis: this.xAxisConfig,\n yAxis: this.yAxis,\n grid: {},\n tooltip: {}\n };\n const categoryAxisOpts = {\n axisLine: { show: false },\n axisTick: { show: false },\n splitLine: { show: false },\n axisLabel: { show: this.yAxis.axisLabel },\n inverse: true\n };\n\n const valueAxisOpts = {\n axisLabel: { show: false },\n axisLine: { show: false },\n axisTick: { show: false },\n splitLine: { show: false }\n };\n\n echarts.util.merge(this.actualOptions.yAxis, categoryAxisOpts, true);\n echarts.util.merge(this.actualOptions.xAxis, valueAxisOpts, true);\n\n this.actualOptions.grid = this.getThemeCustomValue(['progressBar', 'grid'], {});\n\n const series = this.series();\n if (series) {\n const optionSeries = this.actualOptions.series as BarSeriesOption[];\n (this.actualOptions.yAxis as any).data = series.map(item => item.name);\n\n const dataItem: BarSeriesOption = {\n type: 'bar',\n stack: 'chart',\n z: 3,\n barWidth: itemWidth,\n label: this.labelPositionOption,\n data: series.map(item => item.percent)\n };\n\n const fillerItem: BarSeriesOption = {\n type: 'bar',\n stack: 'chart',\n silent: true,\n label: this.labelPositionOptionForValue,\n itemStyle: {\n color: grey\n },\n data: series.map(item => this.maxValue - item.percent)\n };\n\n optionSeries.push(dataItem);\n optionSeries.push(fillerItem);\n }\n\n this.applyTitles();\n }\n\n protected override applyDataZoom(): void {}\n\n /**\n * Updates single value of a single progress bar.\n */\n changeSingleValue(valueIndex: number, value: number): void {\n const optionSeries = this.actualOptions.series as BarSeriesOption[];\n optionSeries[0].data![valueIndex] = value;\n optionSeries[1].data![valueIndex] = this.maxValue - value;\n this.updateEChart();\n }\n\n /**\n * Updates multiple values of a single progress bar.\n */\n changeMultiValues(updateValues: ProgressBarValueUpdate[]): void {\n const optionSeries = this.actualOptions.series as BarSeriesOption[];\n updateValues.forEach(update => {\n const currentDataItem = optionSeries[0].data![update.valueIndex];\n if (!currentDataItem) {\n return;\n }\n optionSeries[0].data![update.valueIndex] = update.value;\n optionSeries[1].data![update.valueIndex] = this.maxValue - update.value;\n });\n\n this.updateEChart();\n }\n}\n","@if (showCustomLegend() && (title() || subTitle())) {\n <div class=\"si-h5 chart-title chart-title-width\" [style.background-color]=\"backgroundColor()\">\n <div class=\"chart-title-text\" [style.color]=\"titleColor()\">{{ title() }}</div>\n @if (subTitle()) {\n <div class=\"si-body\" [style.color]=\"subTitleColor()\">{{ subTitle() }}</div>\n }\n </div>\n}\n\n<div\n #chartContainerWrapper\n class=\"chart-container-wrapper\"\n [class.chart-scroll]=\"containerHeight()\"\n [attr.tabindex]=\"containerHeight() ? '0' : null\"\n>\n <div class=\"chart-container\" [style.height.px]=\"containerHeight()\">\n @if (showCustomLegend()) {\n @for (cl of customLegend; track $index) {\n <si-custom-legend\n #siCustomLegend\n class=\"custom-legend\"\n [style.top.px]=\"cl.top\"\n [title]=\"title()\"\n [subTitle]=\"subTitle()\"\n [customLegend]=\"cl\"\n [style.background-color]=\"backgroundColor()\"\n [titleColor]=\"titleColor()\"\n [subTitleColor]=\"subTitleColor()\"\n [textColor]=\"textColor()\"\n (legendIconClickEvent)=\"handleLegendClick($event)\"\n (legendClickEvent)=\"handleLegendClick($event)\"\n (legendHoverStartEvent)=\"handleLegendHover($event, true)\"\n (legendHoverEndEvent)=\"handleLegendHover($event, false)\"\n />\n }\n }\n <div #chart class=\"echart-container\" [style.height.px]=\"containerHeight()\"></div>\n </div>\n</div>\n@if (externalZoomSlider()) {\n <div\n #externalZoomSlider\n class=\"external-zoom-container\"\n [class.has-time-range-bar]=\"showTimeRangeBar()\"\n [style.--time-bar-height.px]=\"timeBarHeight()\"\n ></div>\n}\n\n@if (showTimeRangeBar() && zoomSlider()) {\n <div\n class=\"time-range-bar\"\n [style.bottom.px]=\"timeBarBottom()\"\n [style.padding-left.px]=\"timeBarLeft()\"\n [style.padding-right.px]=\"timeBarRight()\"\n >\n <ng-content select=\"[slot=timeRangeBar]\" />\n </div>\n}\n\n@if (inProgress()) {\n <div class=\"progress-container\">\n <si-chart-loading-spinner />\n </div>\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-chart-progress-bar.component';\nexport * from './si-chart-progress-bar.interface';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;AAGG;AAiBH,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,aAAa,EAAE,sBAAsB,CAAC,CAAC;AASxD,MAAO,2BAA4B,SAAQ,oBAAoB,CAAA;;AAE1D,IAAA,MAAM,GAAG,KAAK;0FAA4B;;AAE1C,IAAA,aAAa,GAAG,KAAK;iGAAU;IAEhC,QAAQ,GAAG,GAAG;AACd,IAAA,WAAW,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE;AAC/D,IAAA,KAAK,GAAe;AAC1B,QAAA,IAAI,EAAE,UAAU;AAChB,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,QAAQ,EAAE;AACX;KACF;AAEgB,IAAA,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,E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AAA,EAAA,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,aAAA,EAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,UAAA,EAAA,eAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC7BxC,omEAgEA,EAAA,MAAA,EAAA,CAAA,4/BAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDxCY,uBAAuB,+PAAE,8BAA8B,EAAA,QAAA,EAAA,0BAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,KAAA,EAAA,CAAA;;2FAKtD,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAPvC,SAAS;+BACE,uBAAuB,EAAA,OAAA,EACxB,CAAC,uBAAuB,EAAE,8BAA8B,CAAC,EAAA,eAAA,EAGjD,uBAAuB,CAAC,KAAK,EAAA,QAAA,EAAA,omEAAA,EAAA,MAAA,EAAA,CAAA,4/BAAA,CAAA,EAAA;;;AE3BhD;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { echarts, SiChartBaseComponent } from '@spike-rabbit/charts-ng/common';
|
|
4
|
+
import { SiCustomLegendComponent } from '@spike-rabbit/charts-ng/custom-legend';
|
|
5
|
+
import { SiChartLoadingSpinnerComponent } from '@spike-rabbit/charts-ng/loading-spinner';
|
|
6
|
+
import { PieChart } from 'echarts/charts';
|
|
7
|
+
import { LegendComponent } from 'echarts/components';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
11
|
+
* SPDX-License-Identifier: MIT
|
|
12
|
+
*/
|
|
13
|
+
echarts.use([PieChart, LegendComponent]);
|
|
14
|
+
class SiChartProgressComponent extends SiChartBaseComponent {
|
|
15
|
+
/** The series for the chart. */
|
|
16
|
+
series = input(/* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [undefined, { debugName: "series" }] : /* istanbul ignore next */ []));
|
|
18
|
+
/**
|
|
19
|
+
* How big the data can get in degrees.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue 220
|
|
22
|
+
*/
|
|
23
|
+
dataAngle = input(220, /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "dataAngle" }] : /* istanbul ignore next */ []));
|
|
25
|
+
// item width in % radius
|
|
26
|
+
itemWidth;
|
|
27
|
+
// item gap in % radius
|
|
28
|
+
itemGap;
|
|
29
|
+
// base radius of an item
|
|
30
|
+
baseRadius = 98;
|
|
31
|
+
sizeFactor;
|
|
32
|
+
// placement chart in % on canvas
|
|
33
|
+
center;
|
|
34
|
+
// color of disabled part of item
|
|
35
|
+
grey;
|
|
36
|
+
// where the data starts. not very intuitive:
|
|
37
|
+
// 0° is at 3 o'clock, goes counterclockwise, but series drawing goes clockwise
|
|
38
|
+
startAngle;
|
|
39
|
+
afterChartInit() {
|
|
40
|
+
this.chart.on('legendselectchanged', (params) => {
|
|
41
|
+
this.updateRadius(params.selected);
|
|
42
|
+
this.updateEChart();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
themeChanged() {
|
|
46
|
+
this.applyOptions();
|
|
47
|
+
}
|
|
48
|
+
handleSelectionChanged(event) {
|
|
49
|
+
super.handleSelectionChanged(event);
|
|
50
|
+
this.updateRadius(event.selected);
|
|
51
|
+
this.updateEChart();
|
|
52
|
+
}
|
|
53
|
+
applyOptions() {
|
|
54
|
+
this.actualOptions = {
|
|
55
|
+
series: [],
|
|
56
|
+
legend: [
|
|
57
|
+
{
|
|
58
|
+
data: []
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
};
|
|
62
|
+
const dataAngle = this.dataAngle();
|
|
63
|
+
this.startAngle = dataAngle === 360 ? 90 : 270 - (360 - dataAngle) / 2;
|
|
64
|
+
this.itemWidth = this.getThemeCustomValue(['progress', 'itemWidth'], 6);
|
|
65
|
+
this.itemGap = this.getThemeCustomValue(['progress', 'itemGap'], 6);
|
|
66
|
+
this.grey = this.getThemeCustomValue(['progress', 'grey'], '#E6E6E6');
|
|
67
|
+
// a factor to change the size of base radius and center related to
|
|
68
|
+
// dataAngle proportionately
|
|
69
|
+
this.sizeFactor = 1 - Math.sin((((this.dataAngle() - 180) / 2) * Math.PI) / 180);
|
|
70
|
+
this.center = 50 + 25 * this.sizeFactor;
|
|
71
|
+
const seriesValue = this.series();
|
|
72
|
+
if (seriesValue) {
|
|
73
|
+
seriesValue.forEach(series => {
|
|
74
|
+
this.addSeries(series.name, series.percent);
|
|
75
|
+
if (this.showLegend()) {
|
|
76
|
+
this.addLegendItem(series.name);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
this.applyTitles();
|
|
81
|
+
}
|
|
82
|
+
labelFormatter(p) {
|
|
83
|
+
return p.seriesName + '\n' + Math.round((100 / this.dataAngle()) * p.value) + ' %';
|
|
84
|
+
}
|
|
85
|
+
addSeries(name, percent) {
|
|
86
|
+
const optionSeries = this.actualOptions.series;
|
|
87
|
+
const index = optionSeries.length;
|
|
88
|
+
const offset = !this.showCustomLegend() && this.subTitle()
|
|
89
|
+
? this.getThemeCustomValue(['subTitle', 'legend', 'top'], 0)
|
|
90
|
+
: 0;
|
|
91
|
+
const top = !this.sizeFactor ? 32 + offset : Math.floor(offset / 2);
|
|
92
|
+
const bottom = !this.sizeFactor ? undefined : -offset;
|
|
93
|
+
const item = {
|
|
94
|
+
top,
|
|
95
|
+
bottom,
|
|
96
|
+
center: ['50%', this.center + '%'],
|
|
97
|
+
name,
|
|
98
|
+
type: 'pie',
|
|
99
|
+
colorBy: 'series',
|
|
100
|
+
radius: this.calculateRadius(index),
|
|
101
|
+
avoidLabelOverlap: false,
|
|
102
|
+
tooltip: { show: false },
|
|
103
|
+
startAngle: this.startAngle,
|
|
104
|
+
label: {
|
|
105
|
+
show: false,
|
|
106
|
+
formatter: p => this.labelFormatter(p),
|
|
107
|
+
position: 'center'
|
|
108
|
+
},
|
|
109
|
+
labelLine: {
|
|
110
|
+
show: false
|
|
111
|
+
},
|
|
112
|
+
emphasis: {
|
|
113
|
+
label: {
|
|
114
|
+
show: true,
|
|
115
|
+
lineHeight: 30,
|
|
116
|
+
fontSize: '30',
|
|
117
|
+
fontWeight: 'bold'
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
itemStyle: {
|
|
121
|
+
borderWidth: 0
|
|
122
|
+
},
|
|
123
|
+
data: [
|
|
124
|
+
{
|
|
125
|
+
value: 0,
|
|
126
|
+
name: 'v' + index,
|
|
127
|
+
label: {
|
|
128
|
+
lineHeight: 30,
|
|
129
|
+
fontSize: 30,
|
|
130
|
+
color: 'inherit'
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
value: 0,
|
|
135
|
+
name: 'a' + index,
|
|
136
|
+
itemStyle: { color: this.grey },
|
|
137
|
+
emphasis: {
|
|
138
|
+
scale: false,
|
|
139
|
+
itemStyle: { color: this.grey }
|
|
140
|
+
},
|
|
141
|
+
cursor: 'default',
|
|
142
|
+
label: { show: false }
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
value: 0,
|
|
146
|
+
name: 'b' + index,
|
|
147
|
+
itemStyle: { color: 'rgba(0,0,0,0)' },
|
|
148
|
+
cursor: 'default',
|
|
149
|
+
label: { show: false }
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
};
|
|
153
|
+
this.updateData(item, percent);
|
|
154
|
+
optionSeries.push(item);
|
|
155
|
+
}
|
|
156
|
+
updateData(series, percent) {
|
|
157
|
+
const angle = (this.dataAngle() * percent) / 100;
|
|
158
|
+
series.data[0].value = angle;
|
|
159
|
+
series.data[1].value = this.dataAngle() - angle;
|
|
160
|
+
series.data[2].value = 360 - this.dataAngle();
|
|
161
|
+
series.realValue = percent;
|
|
162
|
+
}
|
|
163
|
+
calculateRadius(index) {
|
|
164
|
+
const outerRadius = this.baseRadius - index * (this.itemWidth + this.itemGap);
|
|
165
|
+
const innerRadius = outerRadius - this.itemWidth;
|
|
166
|
+
return [innerRadius + '%', outerRadius + '%'];
|
|
167
|
+
}
|
|
168
|
+
updateRadius(selected) {
|
|
169
|
+
let visibleIndex = 0;
|
|
170
|
+
const optionSeries = this.actualOptions.series;
|
|
171
|
+
optionSeries.forEach(series => {
|
|
172
|
+
if (selected[series.name] === false) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
series.radius = this.calculateRadius(visibleIndex);
|
|
176
|
+
visibleIndex++;
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
applyDataZoom() { }
|
|
180
|
+
/**
|
|
181
|
+
* Update single value of the progress chart.
|
|
182
|
+
*/
|
|
183
|
+
changeSingleValue(index, percent) {
|
|
184
|
+
const optionSeries = this.actualOptions.series;
|
|
185
|
+
this.updateData(optionSeries[index], percent);
|
|
186
|
+
this.updateEChart();
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Update multiple values of the progress chart.
|
|
190
|
+
*/
|
|
191
|
+
changeMultiValues(updateValues) {
|
|
192
|
+
const optionSeries = this.actualOptions.series;
|
|
193
|
+
updateValues.forEach(update => {
|
|
194
|
+
const currentSeries = optionSeries[update.seriesIndex];
|
|
195
|
+
if (!currentSeries) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
this.updateData(currentSeries, update.percent);
|
|
199
|
+
});
|
|
200
|
+
this.updateEChart();
|
|
201
|
+
}
|
|
202
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiChartProgressComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
203
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: SiChartProgressComponent, isStandalone: true, selector: "si-chart-progress", inputs: { series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: false, transformFunction: null }, dataAngle: { classPropertyName: "dataAngle", publicName: "dataAngle", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "@if (showCustomLegend() && (title() || subTitle())) {\n <div class=\"si-h5 chart-title chart-title-width\" [style.background-color]=\"backgroundColor()\">\n <div class=\"chart-title-text\" [style.color]=\"titleColor()\">{{ title() }}</div>\n @if (subTitle()) {\n <div class=\"si-body\" [style.color]=\"subTitleColor()\">{{ subTitle() }}</div>\n }\n </div>\n}\n\n<div\n #chartContainerWrapper\n class=\"chart-container-wrapper\"\n [class.chart-scroll]=\"containerHeight()\"\n [attr.tabindex]=\"containerHeight() ? '0' : null\"\n>\n <div class=\"chart-container\" [style.height.px]=\"containerHeight()\">\n @if (showCustomLegend()) {\n @for (cl of customLegend; track $index) {\n <si-custom-legend\n #siCustomLegend\n class=\"custom-legend\"\n [style.top.px]=\"cl.top\"\n [title]=\"title()\"\n [subTitle]=\"subTitle()\"\n [customLegend]=\"cl\"\n [style.background-color]=\"backgroundColor()\"\n [titleColor]=\"titleColor()\"\n [subTitleColor]=\"subTitleColor()\"\n [textColor]=\"textColor()\"\n (legendIconClickEvent)=\"handleLegendClick($event)\"\n (legendClickEvent)=\"handleLegendClick($event)\"\n (legendHoverStartEvent)=\"handleLegendHover($event, true)\"\n (legendHoverEndEvent)=\"handleLegendHover($event, false)\"\n />\n }\n }\n <div #chart class=\"echart-container\" [style.height.px]=\"containerHeight()\"></div>\n </div>\n</div>\n@if (externalZoomSlider()) {\n <div\n #externalZoomSlider\n class=\"external-zoom-container\"\n [class.has-time-range-bar]=\"showTimeRangeBar()\"\n [style.--time-bar-height.px]=\"timeBarHeight()\"\n ></div>\n}\n\n@if (showTimeRangeBar() && zoomSlider()) {\n <div\n class=\"time-range-bar\"\n [style.bottom.px]=\"timeBarBottom()\"\n [style.padding-left.px]=\"timeBarLeft()\"\n [style.padding-right.px]=\"timeBarRight()\"\n >\n <ng-content select=\"[slot=timeRangeBar]\" />\n </div>\n}\n\n@if (inProgress()) {\n <div class=\"progress-container\">\n <si-chart-loading-spinner />\n </div>\n}\n", styles: [":host{block-size:100%;position:relative;display:flex!important;flex-direction:column;inline-size:100%}.chart-container-wrapper{display:flex;flex:1 0 0;inline-size:inherit;overflow:hidden}.chart-scroll{overflow-y:auto}.chart-container{position:relative;display:flex;flex:1 0 0;overflow:hidden}.echart-container{flex:1 0 0;inline-size:100%;min-block-size:var(--si-chart-min-height, 200px);overflow:hidden}.custom-legend{position:absolute;z-index:2;inline-size:100%}.chart-title{padding-block:12px 8px;padding-inline-start:24px}.external-zoom-container{display:flex;flex:1 0 0;inline-size:inherit;max-block-size:112px}.external-zoom-container.has-time-range-bar{max-block-size:calc(112px + var(--time-bar-height))}.tooltip-inner{max-inline-size:375px;min-inline-size:375px;color:#162938;font-size:18px;background-color:#162938}.time-range-bar{position:absolute;inset-inline:0;z-index:2}.progress-container{position:absolute;inset:0;pointer-events:none;z-index:100;display:flex;justify-content:center;align-items:center}\n"], dependencies: [{ kind: "component", type: SiCustomLegendComponent, selector: "si-custom-legend", inputs: ["customLegend", "title", "subTitle", "titleColor", "subTitleColor", "textColor"], outputs: ["legendIconClickEvent", "legendClickEvent", "legendHoverStartEvent", "legendHoverEndEvent"] }, { kind: "component", type: SiChartLoadingSpinnerComponent, selector: "si-chart-loading-spinner" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
204
|
+
}
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiChartProgressComponent, decorators: [{
|
|
206
|
+
type: Component,
|
|
207
|
+
args: [{ selector: 'si-chart-progress', imports: [SiCustomLegendComponent, SiChartLoadingSpinnerComponent], changeDetection: ChangeDetectionStrategy.Eager, template: "@if (showCustomLegend() && (title() || subTitle())) {\n <div class=\"si-h5 chart-title chart-title-width\" [style.background-color]=\"backgroundColor()\">\n <div class=\"chart-title-text\" [style.color]=\"titleColor()\">{{ title() }}</div>\n @if (subTitle()) {\n <div class=\"si-body\" [style.color]=\"subTitleColor()\">{{ subTitle() }}</div>\n }\n </div>\n}\n\n<div\n #chartContainerWrapper\n class=\"chart-container-wrapper\"\n [class.chart-scroll]=\"containerHeight()\"\n [attr.tabindex]=\"containerHeight() ? '0' : null\"\n>\n <div class=\"chart-container\" [style.height.px]=\"containerHeight()\">\n @if (showCustomLegend()) {\n @for (cl of customLegend; track $index) {\n <si-custom-legend\n #siCustomLegend\n class=\"custom-legend\"\n [style.top.px]=\"cl.top\"\n [title]=\"title()\"\n [subTitle]=\"subTitle()\"\n [customLegend]=\"cl\"\n [style.background-color]=\"backgroundColor()\"\n [titleColor]=\"titleColor()\"\n [subTitleColor]=\"subTitleColor()\"\n [textColor]=\"textColor()\"\n (legendIconClickEvent)=\"handleLegendClick($event)\"\n (legendClickEvent)=\"handleLegendClick($event)\"\n (legendHoverStartEvent)=\"handleLegendHover($event, true)\"\n (legendHoverEndEvent)=\"handleLegendHover($event, false)\"\n />\n }\n }\n <div #chart class=\"echart-container\" [style.height.px]=\"containerHeight()\"></div>\n </div>\n</div>\n@if (externalZoomSlider()) {\n <div\n #externalZoomSlider\n class=\"external-zoom-container\"\n [class.has-time-range-bar]=\"showTimeRangeBar()\"\n [style.--time-bar-height.px]=\"timeBarHeight()\"\n ></div>\n}\n\n@if (showTimeRangeBar() && zoomSlider()) {\n <div\n class=\"time-range-bar\"\n [style.bottom.px]=\"timeBarBottom()\"\n [style.padding-left.px]=\"timeBarLeft()\"\n [style.padding-right.px]=\"timeBarRight()\"\n >\n <ng-content select=\"[slot=timeRangeBar]\" />\n </div>\n}\n\n@if (inProgress()) {\n <div class=\"progress-container\">\n <si-chart-loading-spinner />\n </div>\n}\n", styles: [":host{block-size:100%;position:relative;display:flex!important;flex-direction:column;inline-size:100%}.chart-container-wrapper{display:flex;flex:1 0 0;inline-size:inherit;overflow:hidden}.chart-scroll{overflow-y:auto}.chart-container{position:relative;display:flex;flex:1 0 0;overflow:hidden}.echart-container{flex:1 0 0;inline-size:100%;min-block-size:var(--si-chart-min-height, 200px);overflow:hidden}.custom-legend{position:absolute;z-index:2;inline-size:100%}.chart-title{padding-block:12px 8px;padding-inline-start:24px}.external-zoom-container{display:flex;flex:1 0 0;inline-size:inherit;max-block-size:112px}.external-zoom-container.has-time-range-bar{max-block-size:calc(112px + var(--time-bar-height))}.tooltip-inner{max-inline-size:375px;min-inline-size:375px;color:#162938;font-size:18px;background-color:#162938}.time-range-bar{position:absolute;inset-inline:0;z-index:2}.progress-container{position:absolute;inset:0;pointer-events:none;z-index:100;display:flex;justify-content:center;align-items:center}\n"] }]
|
|
208
|
+
}], propDecorators: { series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: false }] }], dataAngle: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataAngle", required: false }] }] } });
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
212
|
+
* SPDX-License-Identifier: MIT
|
|
213
|
+
*/
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Generated bundle index. Do not edit.
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
export { SiChartProgressComponent };
|
|
220
|
+
//# sourceMappingURL=spike-rabbit-charts-ng-progress.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spike-rabbit-charts-ng-progress.mjs","sources":["../../../../projects/charts-ng/progress/si-chart-progress.component.ts","../../../../projects/charts-ng/common/si-chart-base.component.html","../../../../projects/charts-ng/progress/index.ts","../../../../projects/charts-ng/progress/spike-rabbit-charts-ng-progress.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { SiChartBaseComponent, echarts } from '@spike-rabbit/charts-ng/common';\nimport { SiCustomLegendComponent } from '@spike-rabbit/charts-ng/custom-legend';\nimport { SiChartLoadingSpinnerComponent } from '@spike-rabbit/charts-ng/loading-spinner';\nimport { PieSeriesOption } from 'echarts';\nimport { PieChart } from 'echarts/charts';\nimport { LegendComponent } from 'echarts/components';\n\nimport { ProgressChartSeries, ProgressValueUpdate } from './si-chart-progress.interface';\n\necharts.use([PieChart, LegendComponent]);\n\n@Component({\n selector: 'si-chart-progress',\n imports: [SiCustomLegendComponent, SiChartLoadingSpinnerComponent],\n templateUrl: '../common/si-chart-base.component.html',\n styleUrl: '../common/si-chart-base.component.scss',\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class SiChartProgressComponent extends SiChartBaseComponent {\n /** The series for the chart. */\n readonly series = input<ProgressChartSeries[]>();\n\n /**\n * How big the data can get in degrees.\n *\n * @defaultValue 220\n */\n readonly dataAngle = input(220);\n\n // item width in % radius\n private itemWidth!: number;\n\n // item gap in % radius\n private itemGap!: number;\n\n // base radius of an item\n private baseRadius = 98;\n\n private sizeFactor!: number;\n\n // placement chart in % on canvas\n private center!: number;\n\n // color of disabled part of item\n private grey!: string;\n\n // where the data starts. not very intuitive:\n // 0° is at 3 o'clock, goes counterclockwise, but series drawing goes clockwise\n private startAngle!: number;\n\n protected override afterChartInit(): void {\n this.chart.on('legendselectchanged', (params: any) => {\n this.updateRadius(params.selected);\n this.updateEChart();\n });\n }\n\n protected override themeChanged(): void {\n this.applyOptions();\n }\n\n protected override handleSelectionChanged(event: any): void {\n super.handleSelectionChanged(event);\n this.updateRadius(event.selected);\n this.updateEChart();\n }\n\n protected override applyOptions(): void {\n this.actualOptions = {\n series: [],\n legend: [\n {\n data: []\n }\n ]\n };\n\n const dataAngle = this.dataAngle();\n this.startAngle = dataAngle === 360 ? 90 : 270 - (360 - dataAngle) / 2;\n this.itemWidth = this.getThemeCustomValue(['progress', 'itemWidth'], 6);\n this.itemGap = this.getThemeCustomValue(['progress', 'itemGap'], 6);\n this.grey = this.getThemeCustomValue(['progress', 'grey'], '#E6E6E6');\n\n // a factor to change the size of base radius and center related to\n // dataAngle proportionately\n this.sizeFactor = 1 - Math.sin((((this.dataAngle() - 180) / 2) * Math.PI) / 180);\n this.center = 50 + 25 * this.sizeFactor;\n\n const seriesValue = this.series();\n if (seriesValue) {\n seriesValue.forEach(series => {\n this.addSeries(series.name, series.percent);\n if (this.showLegend()) {\n this.addLegendItem(series.name);\n }\n });\n }\n\n this.applyTitles();\n }\n\n private labelFormatter(p: any): string {\n return p.seriesName + '\\n' + Math.round((100 / this.dataAngle()) * p.value) + ' %';\n }\n\n private addSeries(name: string, percent: number): void {\n const optionSeries = this.actualOptions.series as PieSeriesOption[];\n const index = optionSeries.length;\n\n const offset =\n !this.showCustomLegend() && this.subTitle()\n ? this.getThemeCustomValue(['subTitle', 'legend', 'top'], 0)\n : 0;\n const top = !this.sizeFactor ? 32 + offset : Math.floor(offset / 2);\n const bottom = !this.sizeFactor ? undefined : -offset;\n\n const item: PieSeriesOption = {\n top,\n bottom,\n center: ['50%', this.center + '%'],\n name,\n type: 'pie',\n colorBy: 'series',\n radius: this.calculateRadius(index),\n avoidLabelOverlap: false,\n tooltip: { show: false },\n startAngle: this.startAngle,\n label: {\n show: false,\n formatter: p => this.labelFormatter(p),\n position: 'center'\n },\n labelLine: {\n show: false\n },\n emphasis: {\n label: {\n show: true,\n lineHeight: 30,\n fontSize: '30',\n fontWeight: 'bold'\n }\n },\n itemStyle: {\n borderWidth: 0\n },\n data: [\n {\n value: 0,\n name: 'v' + index,\n label: {\n lineHeight: 30,\n fontSize: 30,\n color: 'inherit'\n }\n },\n {\n value: 0,\n name: 'a' + index,\n itemStyle: { color: this.grey },\n emphasis: {\n scale: false,\n itemStyle: { color: this.grey }\n },\n cursor: 'default',\n label: { show: false }\n },\n {\n value: 0,\n name: 'b' + index,\n itemStyle: { color: 'rgba(0,0,0,0)' },\n cursor: 'default',\n label: { show: false }\n }\n ]\n };\n\n this.updateData(item, percent);\n optionSeries.push(item);\n }\n\n private updateData(series: any, percent: number): void {\n const angle = (this.dataAngle() * percent) / 100;\n series.data[0].value = angle;\n series.data[1].value = this.dataAngle() - angle;\n series.data[2].value = 360 - this.dataAngle();\n series.realValue = percent;\n }\n\n private calculateRadius(index: number): string[] {\n const outerRadius = this.baseRadius - index * (this.itemWidth + this.itemGap);\n const innerRadius = outerRadius - this.itemWidth;\n return [innerRadius + '%', outerRadius + '%'];\n }\n\n private updateRadius(selected: any): void {\n let visibleIndex = 0;\n const optionSeries = this.actualOptions.series as PieSeriesOption[];\n optionSeries.forEach(series => {\n if (selected[series.name!] === false) {\n return;\n }\n series.radius = this.calculateRadius(visibleIndex);\n visibleIndex++;\n });\n }\n\n protected override applyDataZoom(): void {}\n\n /**\n * Update single value of the progress chart.\n */\n changeSingleValue(index: number, percent: number): void {\n const optionSeries = this.actualOptions.series as PieSeriesOption[];\n this.updateData(optionSeries[index], percent);\n this.updateEChart();\n }\n\n /**\n * Update multiple values of the progress chart.\n */\n changeMultiValues(updateValues: ProgressValueUpdate[]): void {\n const optionSeries = this.actualOptions.series as PieSeriesOption[];\n updateValues.forEach(update => {\n const currentSeries = optionSeries[update.seriesIndex];\n if (!currentSeries) {\n return;\n }\n this.updateData(currentSeries, update.percent);\n });\n\n this.updateEChart();\n }\n}\n","@if (showCustomLegend() && (title() || subTitle())) {\n <div class=\"si-h5 chart-title chart-title-width\" [style.background-color]=\"backgroundColor()\">\n <div class=\"chart-title-text\" [style.color]=\"titleColor()\">{{ title() }}</div>\n @if (subTitle()) {\n <div class=\"si-body\" [style.color]=\"subTitleColor()\">{{ subTitle() }}</div>\n }\n </div>\n}\n\n<div\n #chartContainerWrapper\n class=\"chart-container-wrapper\"\n [class.chart-scroll]=\"containerHeight()\"\n [attr.tabindex]=\"containerHeight() ? '0' : null\"\n>\n <div class=\"chart-container\" [style.height.px]=\"containerHeight()\">\n @if (showCustomLegend()) {\n @for (cl of customLegend; track $index) {\n <si-custom-legend\n #siCustomLegend\n class=\"custom-legend\"\n [style.top.px]=\"cl.top\"\n [title]=\"title()\"\n [subTitle]=\"subTitle()\"\n [customLegend]=\"cl\"\n [style.background-color]=\"backgroundColor()\"\n [titleColor]=\"titleColor()\"\n [subTitleColor]=\"subTitleColor()\"\n [textColor]=\"textColor()\"\n (legendIconClickEvent)=\"handleLegendClick($event)\"\n (legendClickEvent)=\"handleLegendClick($event)\"\n (legendHoverStartEvent)=\"handleLegendHover($event, true)\"\n (legendHoverEndEvent)=\"handleLegendHover($event, false)\"\n />\n }\n }\n <div #chart class=\"echart-container\" [style.height.px]=\"containerHeight()\"></div>\n </div>\n</div>\n@if (externalZoomSlider()) {\n <div\n #externalZoomSlider\n class=\"external-zoom-container\"\n [class.has-time-range-bar]=\"showTimeRangeBar()\"\n [style.--time-bar-height.px]=\"timeBarHeight()\"\n ></div>\n}\n\n@if (showTimeRangeBar() && zoomSlider()) {\n <div\n class=\"time-range-bar\"\n [style.bottom.px]=\"timeBarBottom()\"\n [style.padding-left.px]=\"timeBarLeft()\"\n [style.padding-right.px]=\"timeBarRight()\"\n >\n <ng-content select=\"[slot=timeRangeBar]\" />\n </div>\n}\n\n@if (inProgress()) {\n <div class=\"progress-container\">\n <si-chart-loading-spinner />\n </div>\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-chart-progress.component';\nexport * from './si-chart-progress.interface';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;AAGG;AAWH,OAAO,CAAC,GAAG,CAAC,CAAC,QA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AAC,EAAA,eAAA,EAGjD,uBAAuB,CAAC,KAAK,EAAA,QAAA,EAAA,omEAAA,EAAA,MAAA,EAAA,CAAA,4/BAAA,CAAA,EAAA;;;AErBhD;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { echarts, SiChartBaseComponent } from '@spike-rabbit/charts-ng/common';
|
|
4
|
+
import { SiCustomLegendComponent } from '@spike-rabbit/charts-ng/custom-legend';
|
|
5
|
+
import { SiChartLoadingSpinnerComponent } from '@spike-rabbit/charts-ng/loading-spinner';
|
|
6
|
+
import { SankeyChart } from 'echarts/charts';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
10
|
+
* SPDX-License-Identifier: MIT
|
|
11
|
+
*/
|
|
12
|
+
echarts.use([SankeyChart]);
|
|
13
|
+
class SiChartSankeyComponent extends SiChartBaseComponent {
|
|
14
|
+
/** The series for the chart. */
|
|
15
|
+
series = input(/* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [undefined, { debugName: "series" }] : /* istanbul ignore next */ []));
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use `tooltip` instead.
|
|
19
|
+
* @defaultValue false
|
|
20
|
+
*/
|
|
21
|
+
toolTip = input(false, /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "toolTip" }] : /* istanbul ignore next */ []));
|
|
23
|
+
/** @defaultValue false */
|
|
24
|
+
tooltip = input(false, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []));
|
|
26
|
+
applyOptions() {
|
|
27
|
+
const series = this.series();
|
|
28
|
+
this.actualOptions = {
|
|
29
|
+
series: series ? [{ type: 'sankey', ...series }] : [],
|
|
30
|
+
tooltip: { show: this.toolTip() || this.tooltip() }
|
|
31
|
+
};
|
|
32
|
+
this.applyTitles();
|
|
33
|
+
}
|
|
34
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiChartSankeyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
35
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: SiChartSankeyComponent, isStandalone: true, selector: "si-chart-sankey", inputs: { series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: false, transformFunction: null }, toolTip: { classPropertyName: "toolTip", publicName: "toolTip", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "@if (showCustomLegend() && (title() || subTitle())) {\n <div class=\"si-h5 chart-title chart-title-width\" [style.background-color]=\"backgroundColor()\">\n <div class=\"chart-title-text\" [style.color]=\"titleColor()\">{{ title() }}</div>\n @if (subTitle()) {\n <div class=\"si-body\" [style.color]=\"subTitleColor()\">{{ subTitle() }}</div>\n }\n </div>\n}\n\n<div\n #chartContainerWrapper\n class=\"chart-container-wrapper\"\n [class.chart-scroll]=\"containerHeight()\"\n [attr.tabindex]=\"containerHeight() ? '0' : null\"\n>\n <div class=\"chart-container\" [style.height.px]=\"containerHeight()\">\n @if (showCustomLegend()) {\n @for (cl of customLegend; track $index) {\n <si-custom-legend\n #siCustomLegend\n class=\"custom-legend\"\n [style.top.px]=\"cl.top\"\n [title]=\"title()\"\n [subTitle]=\"subTitle()\"\n [customLegend]=\"cl\"\n [style.background-color]=\"backgroundColor()\"\n [titleColor]=\"titleColor()\"\n [subTitleColor]=\"subTitleColor()\"\n [textColor]=\"textColor()\"\n (legendIconClickEvent)=\"handleLegendClick($event)\"\n (legendClickEvent)=\"handleLegendClick($event)\"\n (legendHoverStartEvent)=\"handleLegendHover($event, true)\"\n (legendHoverEndEvent)=\"handleLegendHover($event, false)\"\n />\n }\n }\n <div #chart class=\"echart-container\" [style.height.px]=\"containerHeight()\"></div>\n </div>\n</div>\n@if (externalZoomSlider()) {\n <div\n #externalZoomSlider\n class=\"external-zoom-container\"\n [class.has-time-range-bar]=\"showTimeRangeBar()\"\n [style.--time-bar-height.px]=\"timeBarHeight()\"\n ></div>\n}\n\n@if (showTimeRangeBar() && zoomSlider()) {\n <div\n class=\"time-range-bar\"\n [style.bottom.px]=\"timeBarBottom()\"\n [style.padding-left.px]=\"timeBarLeft()\"\n [style.padding-right.px]=\"timeBarRight()\"\n >\n <ng-content select=\"[slot=timeRangeBar]\" />\n </div>\n}\n\n@if (inProgress()) {\n <div class=\"progress-container\">\n <si-chart-loading-spinner />\n </div>\n}\n", styles: [":host{block-size:100%;position:relative;display:flex!important;flex-direction:column;inline-size:100%}.chart-container-wrapper{display:flex;flex:1 0 0;inline-size:inherit;overflow:hidden}.chart-scroll{overflow-y:auto}.chart-container{position:relative;display:flex;flex:1 0 0;overflow:hidden}.echart-container{flex:1 0 0;inline-size:100%;min-block-size:var(--si-chart-min-height, 200px);overflow:hidden}.custom-legend{position:absolute;z-index:2;inline-size:100%}.chart-title{padding-block:12px 8px;padding-inline-start:24px}.external-zoom-container{display:flex;flex:1 0 0;inline-size:inherit;max-block-size:112px}.external-zoom-container.has-time-range-bar{max-block-size:calc(112px + var(--time-bar-height))}.tooltip-inner{max-inline-size:375px;min-inline-size:375px;color:#162938;font-size:18px;background-color:#162938}.time-range-bar{position:absolute;inset-inline:0;z-index:2}.progress-container{position:absolute;inset:0;pointer-events:none;z-index:100;display:flex;justify-content:center;align-items:center}\n"], dependencies: [{ kind: "component", type: SiCustomLegendComponent, selector: "si-custom-legend", inputs: ["customLegend", "title", "subTitle", "titleColor", "subTitleColor", "textColor"], outputs: ["legendIconClickEvent", "legendClickEvent", "legendHoverStartEvent", "legendHoverEndEvent"] }, { kind: "component", type: SiChartLoadingSpinnerComponent, selector: "si-chart-loading-spinner" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
36
|
+
}
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: SiChartSankeyComponent, decorators: [{
|
|
38
|
+
type: Component,
|
|
39
|
+
args: [{ selector: 'si-chart-sankey', imports: [SiCustomLegendComponent, SiChartLoadingSpinnerComponent], changeDetection: ChangeDetectionStrategy.Eager, template: "@if (showCustomLegend() && (title() || subTitle())) {\n <div class=\"si-h5 chart-title chart-title-width\" [style.background-color]=\"backgroundColor()\">\n <div class=\"chart-title-text\" [style.color]=\"titleColor()\">{{ title() }}</div>\n @if (subTitle()) {\n <div class=\"si-body\" [style.color]=\"subTitleColor()\">{{ subTitle() }}</div>\n }\n </div>\n}\n\n<div\n #chartContainerWrapper\n class=\"chart-container-wrapper\"\n [class.chart-scroll]=\"containerHeight()\"\n [attr.tabindex]=\"containerHeight() ? '0' : null\"\n>\n <div class=\"chart-container\" [style.height.px]=\"containerHeight()\">\n @if (showCustomLegend()) {\n @for (cl of customLegend; track $index) {\n <si-custom-legend\n #siCustomLegend\n class=\"custom-legend\"\n [style.top.px]=\"cl.top\"\n [title]=\"title()\"\n [subTitle]=\"subTitle()\"\n [customLegend]=\"cl\"\n [style.background-color]=\"backgroundColor()\"\n [titleColor]=\"titleColor()\"\n [subTitleColor]=\"subTitleColor()\"\n [textColor]=\"textColor()\"\n (legendIconClickEvent)=\"handleLegendClick($event)\"\n (legendClickEvent)=\"handleLegendClick($event)\"\n (legendHoverStartEvent)=\"handleLegendHover($event, true)\"\n (legendHoverEndEvent)=\"handleLegendHover($event, false)\"\n />\n }\n }\n <div #chart class=\"echart-container\" [style.height.px]=\"containerHeight()\"></div>\n </div>\n</div>\n@if (externalZoomSlider()) {\n <div\n #externalZoomSlider\n class=\"external-zoom-container\"\n [class.has-time-range-bar]=\"showTimeRangeBar()\"\n [style.--time-bar-height.px]=\"timeBarHeight()\"\n ></div>\n}\n\n@if (showTimeRangeBar() && zoomSlider()) {\n <div\n class=\"time-range-bar\"\n [style.bottom.px]=\"timeBarBottom()\"\n [style.padding-left.px]=\"timeBarLeft()\"\n [style.padding-right.px]=\"timeBarRight()\"\n >\n <ng-content select=\"[slot=timeRangeBar]\" />\n </div>\n}\n\n@if (inProgress()) {\n <div class=\"progress-container\">\n <si-chart-loading-spinner />\n </div>\n}\n", styles: [":host{block-size:100%;position:relative;display:flex!important;flex-direction:column;inline-size:100%}.chart-container-wrapper{display:flex;flex:1 0 0;inline-size:inherit;overflow:hidden}.chart-scroll{overflow-y:auto}.chart-container{position:relative;display:flex;flex:1 0 0;overflow:hidden}.echart-container{flex:1 0 0;inline-size:100%;min-block-size:var(--si-chart-min-height, 200px);overflow:hidden}.custom-legend{position:absolute;z-index:2;inline-size:100%}.chart-title{padding-block:12px 8px;padding-inline-start:24px}.external-zoom-container{display:flex;flex:1 0 0;inline-size:inherit;max-block-size:112px}.external-zoom-container.has-time-range-bar{max-block-size:calc(112px + var(--time-bar-height))}.tooltip-inner{max-inline-size:375px;min-inline-size:375px;color:#162938;font-size:18px;background-color:#162938}.time-range-bar{position:absolute;inset-inline:0;z-index:2}.progress-container{position:absolute;inset:0;pointer-events:none;z-index:100;display:flex;justify-content:center;align-items:center}\n"] }]
|
|
40
|
+
}], propDecorators: { series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: false }] }], toolTip: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolTip", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }] } });
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Copyright (c) Siemens 2016 - 2026
|
|
44
|
+
* SPDX-License-Identifier: MIT
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Generated bundle index. Do not edit.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
export { SiChartSankeyComponent };
|
|
52
|
+
//# sourceMappingURL=spike-rabbit-charts-ng-sankey.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spike-rabbit-charts-ng-sankey.mjs","sources":["../../../../projects/charts-ng/sankey/si-chart-sankey.component.ts","../../../../projects/charts-ng/common/si-chart-base.component.html","../../../../projects/charts-ng/sankey/index.ts","../../../../projects/charts-ng/sankey/spike-rabbit-charts-ng-sankey.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { SiChartBaseComponent, SankeySeriesOption, echarts } from '@spike-rabbit/charts-ng/common';\nimport { SiCustomLegendComponent } from '@spike-rabbit/charts-ng/custom-legend';\nimport { SiChartLoadingSpinnerComponent } from '@spike-rabbit/charts-ng/loading-spinner';\nimport { SankeyChart } from 'echarts/charts';\n\necharts.use([SankeyChart]);\n\n@Component({\n selector: 'si-chart-sankey',\n imports: [SiCustomLegendComponent, SiChartLoadingSpinnerComponent],\n templateUrl: '../common/si-chart-base.component.html',\n styleUrl: '../common/si-chart-base.component.scss',\n changeDetection: ChangeDetectionStrategy.Eager\n})\nexport class SiChartSankeyComponent extends SiChartBaseComponent {\n /** The series for the chart. */\n readonly series = input<SankeySeriesOption>();\n /**\n * @deprecated Use `tooltip` instead.\n * @defaultValue false\n */\n readonly toolTip = input(false);\n /** @defaultValue false */\n readonly tooltip = input(false);\n\n protected override applyOptions(): void {\n const series = this.series();\n this.actualOptions = {\n series: series ? [{ type: 'sankey', ...series }] : [],\n tooltip: { show: this.toolTip() || this.tooltip() }\n };\n\n this.applyTitles();\n }\n}\n","@if (showCustomLegend() && (title() || subTitle())) {\n <div class=\"si-h5 chart-title chart-title-width\" [style.background-color]=\"backgroundColor()\">\n <div class=\"chart-title-text\" [style.color]=\"titleColor()\">{{ title() }}</div>\n @if (subTitle()) {\n <div class=\"si-body\" [style.color]=\"subTitleColor()\">{{ subTitle() }}</div>\n }\n </div>\n}\n\n<div\n #chartContainerWrapper\n class=\"chart-container-wrapper\"\n [class.chart-scroll]=\"containerHeight()\"\n [attr.tabindex]=\"containerHeight() ? '0' : null\"\n>\n <div class=\"chart-container\" [style.height.px]=\"containerHeight()\">\n @if (showCustomLegend()) {\n @for (cl of customLegend; track $index) {\n <si-custom-legend\n #siCustomLegend\n class=\"custom-legend\"\n [style.top.px]=\"cl.top\"\n [title]=\"title()\"\n [subTitle]=\"subTitle()\"\n [customLegend]=\"cl\"\n [style.background-color]=\"backgroundColor()\"\n [titleColor]=\"titleColor()\"\n [subTitleColor]=\"subTitleColor()\"\n [textColor]=\"textColor()\"\n (legendIconClickEvent)=\"handleLegendClick($event)\"\n (legendClickEvent)=\"handleLegendClick($event)\"\n (legendHoverStartEvent)=\"handleLegendHover($event, true)\"\n (legendHoverEndEvent)=\"handleLegendHover($event, false)\"\n />\n }\n }\n <div #chart class=\"echart-container\" [style.height.px]=\"containerHeight()\"></div>\n </div>\n</div>\n@if (externalZoomSlider()) {\n <div\n #externalZoomSlider\n class=\"external-zoom-container\"\n [class.has-time-range-bar]=\"showTimeRangeBar()\"\n [style.--time-bar-height.px]=\"timeBarHeight()\"\n ></div>\n}\n\n@if (showTimeRangeBar() && zoomSlider()) {\n <div\n class=\"time-range-bar\"\n [style.bottom.px]=\"timeBarBottom()\"\n [style.padding-left.px]=\"timeBarLeft()\"\n [style.padding-right.px]=\"timeBarRight()\"\n >\n <ng-content select=\"[slot=timeRangeBar]\" />\n </div>\n}\n\n@if (inProgress()) {\n <div class=\"progress-container\">\n <si-chart-loading-spinner />\n </div>\n}\n","/**\n * Copyright (c) Siemens 2016 - 2026\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-chart-sankey.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AAOH,OAAO,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC;AASpB,MAAO,sBAAuB,SAAQ,oBAAoB,CAAA;;AAErD,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