@aquera/nile-visualization 1.5.0 → 1.6.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/dist/src/internal/types/chart-anomaly-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-area-config.type.d.ts +12 -0
- package/dist/src/internal/types/chart-area-negative-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-area-range-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-area-spline-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-bar-config.type.d.ts +12 -0
- package/dist/src/internal/types/chart-bellcurve-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-boxplot-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-bubble-config.type.d.ts +12 -0
- package/dist/src/internal/types/chart-cluster-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-column-config.type.d.ts +12 -0
- package/dist/src/internal/types/chart-column-drilldown-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-column-pyramid-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-column-range-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-donut-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-dumbbell-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-euler-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-fan-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-flame-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-funnel-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-gauge-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-heatmap-config.type.d.ts +12 -0
- package/dist/src/internal/types/chart-histogram-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-line-column-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-line-config.type.d.ts +12 -0
- package/dist/src/internal/types/chart-lollipop-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-map-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-organization-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-pie-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-polygon-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-radar-config.type.d.ts +12 -0
- package/dist/src/internal/types/chart-radial-bar-config.type.d.ts +12 -0
- package/dist/src/internal/types/chart-scatter-config.type.d.ts +12 -0
- package/dist/src/internal/types/chart-spiderweb-config.type.d.ts +12 -0
- package/dist/src/internal/types/chart-spline-config.type.d.ts +12 -0
- package/dist/src/internal/types/chart-stacked-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-timeline-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-trendline-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-variable-pie-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-vector-config.type.d.ts +11 -0
- package/dist/src/internal/types/chart-waterfall-config.type.d.ts +12 -0
- package/dist/src/internal/types/chart-xrange-config.type.d.ts +12 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.css.js +20 -4
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.d.ts +12 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +95 -1
- package/dist/src/nile-area-chart/nile-area-chart.css.js +20 -4
- package/dist/src/nile-area-chart/nile-area-chart.d.ts +13 -0
- package/dist/src/nile-area-chart/nile-area-chart.js +107 -3
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.css.js +20 -4
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.d.ts +12 -0
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +73 -1
- package/dist/src/nile-area-range-chart/nile-area-range-chart.css.js +20 -4
- package/dist/src/nile-area-range-chart/nile-area-range-chart.d.ts +12 -0
- package/dist/src/nile-area-range-chart/nile-area-range-chart.js +73 -1
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.css.js +20 -4
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.d.ts +12 -0
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +73 -1
- package/dist/src/nile-bar-chart/nile-bar-chart.css.js +20 -4
- package/dist/src/nile-bar-chart/nile-bar-chart.d.ts +14 -0
- package/dist/src/nile-bar-chart/nile-bar-chart.js +104 -1
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.css.js +20 -4
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.d.ts +12 -0
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +73 -1
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.css.js +20 -4
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.d.ts +12 -0
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.js +73 -1
- package/dist/src/nile-bubble-chart/nile-bubble-chart.css.js +20 -4
- package/dist/src/nile-bubble-chart/nile-bubble-chart.d.ts +13 -0
- package/dist/src/nile-bubble-chart/nile-bubble-chart.js +107 -3
- package/dist/src/nile-chart/nile-chart-config.d.ts +331 -38
- package/dist/src/nile-chart/nile-chart.d.ts +0 -3
- package/dist/src/nile-chart/nile-chart.js +546 -2
- package/dist/src/nile-cluster-chart/nile-cluster-chart.css.js +20 -4
- package/dist/src/nile-cluster-chart/nile-cluster-chart.d.ts +12 -0
- package/dist/src/nile-cluster-chart/nile-cluster-chart.js +73 -1
- package/dist/src/nile-column-chart/nile-column-chart.css.js +20 -4
- package/dist/src/nile-column-chart/nile-column-chart.d.ts +13 -0
- package/dist/src/nile-column-chart/nile-column-chart.js +107 -3
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.css.js +20 -4
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.d.ts +12 -0
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +73 -1
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.css.js +20 -4
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.d.ts +12 -0
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +73 -1
- package/dist/src/nile-column-range-chart/nile-column-range-chart.css.js +20 -4
- package/dist/src/nile-column-range-chart/nile-column-range-chart.d.ts +12 -0
- package/dist/src/nile-column-range-chart/nile-column-range-chart.js +73 -1
- package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.css.js +10 -0
- package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.d.ts +10 -14
- package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.js +36 -14
- package/dist/src/nile-donut-chart/nile-donut-chart.css.js +20 -4
- package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +12 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.js +99 -2
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.css.js +20 -4
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.d.ts +12 -0
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.js +73 -1
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.css.js +20 -4
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.d.ts +12 -0
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +73 -1
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.css.js +20 -4
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.d.ts +12 -0
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +73 -1
- package/dist/src/nile-euler-chart/nile-euler-chart.css.js +20 -4
- package/dist/src/nile-euler-chart/nile-euler-chart.d.ts +12 -0
- package/dist/src/nile-euler-chart/nile-euler-chart.js +73 -1
- package/dist/src/nile-fan-chart/nile-fan-chart.css.js +20 -4
- package/dist/src/nile-fan-chart/nile-fan-chart.d.ts +12 -0
- package/dist/src/nile-fan-chart/nile-fan-chart.js +73 -1
- package/dist/src/nile-flame-chart/nile-flame-chart.css.js +20 -4
- package/dist/src/nile-flame-chart/nile-flame-chart.d.ts +12 -0
- package/dist/src/nile-flame-chart/nile-flame-chart.js +73 -1
- package/dist/src/nile-funnel-chart/nile-funnel-chart.css.js +20 -4
- package/dist/src/nile-funnel-chart/nile-funnel-chart.d.ts +12 -0
- package/dist/src/nile-funnel-chart/nile-funnel-chart.js +73 -1
- package/dist/src/nile-gauge-chart/nile-gauge-chart.css.js +20 -4
- package/dist/src/nile-gauge-chart/nile-gauge-chart.d.ts +12 -0
- package/dist/src/nile-gauge-chart/nile-gauge-chart.js +95 -2
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.css.js +20 -4
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +13 -0
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +79 -2
- package/dist/src/nile-histogram-chart/nile-histogram-chart.css.js +20 -4
- package/dist/src/nile-histogram-chart/nile-histogram-chart.d.ts +12 -0
- package/dist/src/nile-histogram-chart/nile-histogram-chart.js +73 -1
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.css.js +20 -4
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.d.ts +12 -0
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +73 -1
- package/dist/src/nile-kpi-chart/nile-kpi-chart.css.d.ts +1 -1
- package/dist/src/nile-kpi-chart/nile-kpi-chart.css.js +54 -33
- package/dist/src/nile-kpi-chart/nile-kpi-chart.d.ts +121 -1
- package/dist/src/nile-kpi-chart/nile-kpi-chart.js +366 -52
- package/dist/src/nile-line-chart/nile-line-chart.css.js +20 -4
- package/dist/src/nile-line-chart/nile-line-chart.d.ts +13 -0
- package/dist/src/nile-line-chart/nile-line-chart.js +103 -3
- package/dist/src/nile-line-column-chart/nile-line-column-chart.css.js +20 -4
- package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +12 -0
- package/dist/src/nile-line-column-chart/nile-line-column-chart.js +73 -1
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.css.js +20 -4
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.d.ts +12 -0
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +73 -1
- package/dist/src/nile-map-chart/nile-map-chart.css.js +20 -4
- package/dist/src/nile-map-chart/nile-map-chart.d.ts +12 -0
- package/dist/src/nile-map-chart/nile-map-chart.js +95 -1
- package/dist/src/nile-organization-chart/nile-organization-chart.css.js +20 -4
- package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +12 -0
- package/dist/src/nile-organization-chart/nile-organization-chart.js +73 -1
- package/dist/src/nile-pie-chart/nile-pie-chart.css.js +20 -4
- package/dist/src/nile-pie-chart/nile-pie-chart.d.ts +12 -0
- package/dist/src/nile-pie-chart/nile-pie-chart.js +95 -1
- package/dist/src/nile-polygon-chart/nile-polygon-chart.css.js +20 -4
- package/dist/src/nile-polygon-chart/nile-polygon-chart.d.ts +12 -0
- package/dist/src/nile-polygon-chart/nile-polygon-chart.js +73 -1
- package/dist/src/nile-radar-chart/nile-radar-chart.css.js +20 -4
- package/dist/src/nile-radar-chart/nile-radar-chart.d.ts +13 -0
- package/dist/src/nile-radar-chart/nile-radar-chart.js +103 -3
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.css.js +20 -4
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.d.ts +13 -0
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +79 -1
- package/dist/src/nile-scatter-chart/nile-scatter-chart.css.js +20 -4
- package/dist/src/nile-scatter-chart/nile-scatter-chart.d.ts +13 -0
- package/dist/src/nile-scatter-chart/nile-scatter-chart.js +103 -3
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.css.js +20 -4
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.d.ts +13 -0
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.js +79 -1
- package/dist/src/nile-spline-chart/nile-spline-chart.css.js +20 -4
- package/dist/src/nile-spline-chart/nile-spline-chart.d.ts +13 -0
- package/dist/src/nile-spline-chart/nile-spline-chart.js +103 -3
- package/dist/src/nile-stacked-chart/nile-stacked-chart.css.js +20 -4
- package/dist/src/nile-stacked-chart/nile-stacked-chart.d.ts +12 -0
- package/dist/src/nile-stacked-chart/nile-stacked-chart.js +73 -1
- package/dist/src/nile-timeline-chart/nile-timeline-chart.css.js +20 -4
- package/dist/src/nile-timeline-chart/nile-timeline-chart.d.ts +13 -1
- package/dist/src/nile-timeline-chart/nile-timeline-chart.js +73 -1
- package/dist/src/nile-trendline-chart/nile-trendline-chart.css.js +20 -4
- package/dist/src/nile-trendline-chart/nile-trendline-chart.d.ts +12 -0
- package/dist/src/nile-trendline-chart/nile-trendline-chart.js +95 -1
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.css.js +20 -4
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.d.ts +12 -0
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +73 -1
- package/dist/src/nile-vector-chart/nile-vector-chart.css.js +20 -4
- package/dist/src/nile-vector-chart/nile-vector-chart.d.ts +12 -0
- package/dist/src/nile-vector-chart/nile-vector-chart.js +73 -1
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.css.js +20 -4
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.d.ts +13 -0
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +103 -4
- package/dist/src/nile-xrange-chart/nile-xrange-chart.css.js +20 -4
- package/dist/src/nile-xrange-chart/nile-xrange-chart.d.ts +13 -0
- package/dist/src/nile-xrange-chart/nile-xrange-chart.js +79 -1
- package/package.json +1 -1
|
@@ -20,6 +20,40 @@ let NileColumnPyramidChart = class NileColumnPyramidChart extends NileElement {
|
|
|
20
20
|
this.options = {};
|
|
21
21
|
this.loading = false;
|
|
22
22
|
this.height = '400px';
|
|
23
|
+
// ── Container styling ──
|
|
24
|
+
this.chartBg = '';
|
|
25
|
+
this.chartBorderRadius = '';
|
|
26
|
+
this.chartBorder = '';
|
|
27
|
+
this.chartShadow = '';
|
|
28
|
+
this.chartPadding = '';
|
|
29
|
+
this.chartMinHeight = '';
|
|
30
|
+
// ── Loading ──
|
|
31
|
+
this.loadingText = 'Loading...';
|
|
32
|
+
this.loadingColor = '';
|
|
33
|
+
this.loadingFontSize = '';
|
|
34
|
+
this.loadingFontFamily = '';
|
|
35
|
+
this.loadingBg = '';
|
|
36
|
+
}
|
|
37
|
+
_syncCssVars() {
|
|
38
|
+
const set = (prop, val) => {
|
|
39
|
+
const s = typeof val === 'number'
|
|
40
|
+
? (Number.isFinite(val) ? `${val}px` : '')
|
|
41
|
+
: String(val ?? '').trim();
|
|
42
|
+
if (s)
|
|
43
|
+
this.style.setProperty(prop, s);
|
|
44
|
+
else
|
|
45
|
+
this.style.removeProperty(prop);
|
|
46
|
+
};
|
|
47
|
+
set('--nile-chart-bg', this.chartBg);
|
|
48
|
+
set('--nile-chart-border-radius', this.chartBorderRadius);
|
|
49
|
+
set('--nile-chart-border', this.chartBorder);
|
|
50
|
+
set('--nile-chart-shadow', this.chartShadow);
|
|
51
|
+
set('--nile-chart-padding', this.chartPadding);
|
|
52
|
+
set('--nile-chart-min-height', this.chartMinHeight);
|
|
53
|
+
set('--nile-chart-loading-color', this.loadingColor);
|
|
54
|
+
set('--nile-chart-loading-font-size', this.loadingFontSize);
|
|
55
|
+
set('--nile-chart-loading-font-family', this.loadingFontFamily);
|
|
56
|
+
set('--nile-chart-loading-bg', this.loadingBg);
|
|
23
57
|
}
|
|
24
58
|
applyConfig(cfg) {
|
|
25
59
|
applySeparatedChartConfig(this, cfg);
|
|
@@ -36,6 +70,7 @@ let NileColumnPyramidChart = class NileColumnPyramidChart extends NileElement {
|
|
|
36
70
|
this.resizeObserver = null;
|
|
37
71
|
}
|
|
38
72
|
firstUpdated() {
|
|
73
|
+
this._syncCssVars();
|
|
39
74
|
this.initChart();
|
|
40
75
|
this.setupResizeObserver();
|
|
41
76
|
}
|
|
@@ -44,6 +79,10 @@ let NileColumnPyramidChart = class NileColumnPyramidChart extends NileElement {
|
|
|
44
79
|
this.applyConfig(this.config);
|
|
45
80
|
return;
|
|
46
81
|
}
|
|
82
|
+
const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
|
|
83
|
+
'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
|
|
84
|
+
if (cssVarProps.some(p => changedProperties.has(p)))
|
|
85
|
+
this._syncCssVars();
|
|
47
86
|
const props = ['data', 'categories', 'chartTitle', 'chartSubtitle', 'options', 'height', 'loading'];
|
|
48
87
|
if (!props.some(p => changedProperties.has(p)))
|
|
49
88
|
return;
|
|
@@ -115,7 +154,7 @@ let NileColumnPyramidChart = class NileColumnPyramidChart extends NileElement {
|
|
|
115
154
|
}
|
|
116
155
|
render() {
|
|
117
156
|
if (this.loading) {
|
|
118
|
-
return html `<div class="chart-loading" style="height:${this.height}"
|
|
157
|
+
return html `<div class="chart-loading" style="height:${this.height}">${this.loadingText}</div>`;
|
|
119
158
|
}
|
|
120
159
|
return html `<div class="chart-container"></div>`;
|
|
121
160
|
}
|
|
@@ -148,6 +187,39 @@ __decorate([
|
|
|
148
187
|
__decorate([
|
|
149
188
|
property({ type: String })
|
|
150
189
|
], NileColumnPyramidChart.prototype, "height", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
property({ type: String, attribute: 'chart-bg' })
|
|
192
|
+
], NileColumnPyramidChart.prototype, "chartBg", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
property({ type: String, attribute: 'chart-border-radius' })
|
|
195
|
+
], NileColumnPyramidChart.prototype, "chartBorderRadius", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
property({ type: String, attribute: 'chart-border' })
|
|
198
|
+
], NileColumnPyramidChart.prototype, "chartBorder", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
property({ type: String, attribute: 'chart-shadow' })
|
|
201
|
+
], NileColumnPyramidChart.prototype, "chartShadow", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
property({ type: String, attribute: 'chart-padding' })
|
|
204
|
+
], NileColumnPyramidChart.prototype, "chartPadding", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
property({ type: String, attribute: 'chart-min-height' })
|
|
207
|
+
], NileColumnPyramidChart.prototype, "chartMinHeight", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
property({ type: String, attribute: 'loading-text' })
|
|
210
|
+
], NileColumnPyramidChart.prototype, "loadingText", void 0);
|
|
211
|
+
__decorate([
|
|
212
|
+
property({ type: String, attribute: 'loading-color' })
|
|
213
|
+
], NileColumnPyramidChart.prototype, "loadingColor", void 0);
|
|
214
|
+
__decorate([
|
|
215
|
+
property({ type: String, attribute: 'loading-font-size' })
|
|
216
|
+
], NileColumnPyramidChart.prototype, "loadingFontSize", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
property({ type: String, attribute: 'loading-font-family' })
|
|
219
|
+
], NileColumnPyramidChart.prototype, "loadingFontFamily", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
property({ type: String, attribute: 'loading-bg' })
|
|
222
|
+
], NileColumnPyramidChart.prototype, "loadingBg", void 0);
|
|
151
223
|
NileColumnPyramidChart = __decorate([
|
|
152
224
|
customElement('nile-column-pyramid-chart')
|
|
153
225
|
], NileColumnPyramidChart);
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
export const styles = css `
|
|
3
3
|
:host {
|
|
4
|
+
--nile-chart-min-height: var(--nile-height-200px, var(--ng-height-200px));
|
|
5
|
+
--nile-chart-bg: transparent;
|
|
6
|
+
--nile-chart-border-radius: 0;
|
|
7
|
+
--nile-chart-border: none;
|
|
8
|
+
--nile-chart-shadow: none;
|
|
9
|
+
--nile-chart-padding: 0;
|
|
10
|
+
--nile-chart-loading-color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
11
|
+
--nile-chart-loading-font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
|
|
12
|
+
--nile-chart-loading-font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
13
|
+
--nile-chart-loading-bg: transparent;
|
|
4
14
|
display: block;
|
|
5
15
|
width: 100%;
|
|
6
16
|
position: relative;
|
|
@@ -12,7 +22,12 @@ export const styles = css `
|
|
|
12
22
|
|
|
13
23
|
.chart-container {
|
|
14
24
|
width: 100%;
|
|
15
|
-
min-height: var(--nile-
|
|
25
|
+
min-height: var(--nile-chart-min-height);
|
|
26
|
+
background: var(--nile-chart-bg);
|
|
27
|
+
border-radius: var(--nile-chart-border-radius);
|
|
28
|
+
border: var(--nile-chart-border);
|
|
29
|
+
box-shadow: var(--nile-chart-shadow);
|
|
30
|
+
padding: var(--nile-chart-padding);
|
|
16
31
|
}
|
|
17
32
|
|
|
18
33
|
.chart-loading {
|
|
@@ -20,9 +35,10 @@ export const styles = css `
|
|
|
20
35
|
align-items: center;
|
|
21
36
|
justify-content: center;
|
|
22
37
|
min-height: inherit;
|
|
23
|
-
color: var(--nile-
|
|
24
|
-
font-family: var(--nile-
|
|
25
|
-
font-size: var(--nile-
|
|
38
|
+
color: var(--nile-chart-loading-color);
|
|
39
|
+
font-family: var(--nile-chart-loading-font-family);
|
|
40
|
+
font-size: var(--nile-chart-loading-font-size);
|
|
41
|
+
background: var(--nile-chart-loading-bg);
|
|
26
42
|
}
|
|
27
43
|
`;
|
|
28
44
|
//# sourceMappingURL=nile-column-range-chart.css.js.map
|
|
@@ -22,6 +22,18 @@ export declare class NileColumnRangeChart extends NileElement {
|
|
|
22
22
|
loading: boolean;
|
|
23
23
|
height: string;
|
|
24
24
|
yAxisTitle: string;
|
|
25
|
+
chartBg: string;
|
|
26
|
+
chartBorderRadius: string | number;
|
|
27
|
+
chartBorder: string;
|
|
28
|
+
chartShadow: string;
|
|
29
|
+
chartPadding: string | number;
|
|
30
|
+
chartMinHeight: string | number;
|
|
31
|
+
loadingText: string;
|
|
32
|
+
loadingColor: string;
|
|
33
|
+
loadingFontSize: string | number;
|
|
34
|
+
loadingFontFamily: string;
|
|
35
|
+
loadingBg: string;
|
|
36
|
+
private _syncCssVars;
|
|
25
37
|
private applyConfig;
|
|
26
38
|
connectedCallback(): void;
|
|
27
39
|
disconnectedCallback(): void;
|
|
@@ -21,6 +21,40 @@ let NileColumnRangeChart = class NileColumnRangeChart extends NileElement {
|
|
|
21
21
|
this.loading = false;
|
|
22
22
|
this.height = '400px';
|
|
23
23
|
this.yAxisTitle = '';
|
|
24
|
+
// ── Container styling ──
|
|
25
|
+
this.chartBg = '';
|
|
26
|
+
this.chartBorderRadius = '';
|
|
27
|
+
this.chartBorder = '';
|
|
28
|
+
this.chartShadow = '';
|
|
29
|
+
this.chartPadding = '';
|
|
30
|
+
this.chartMinHeight = '';
|
|
31
|
+
// ── Loading ──
|
|
32
|
+
this.loadingText = 'Loading...';
|
|
33
|
+
this.loadingColor = '';
|
|
34
|
+
this.loadingFontSize = '';
|
|
35
|
+
this.loadingFontFamily = '';
|
|
36
|
+
this.loadingBg = '';
|
|
37
|
+
}
|
|
38
|
+
_syncCssVars() {
|
|
39
|
+
const set = (prop, val) => {
|
|
40
|
+
const s = typeof val === 'number'
|
|
41
|
+
? (Number.isFinite(val) ? `${val}px` : '')
|
|
42
|
+
: String(val ?? '').trim();
|
|
43
|
+
if (s)
|
|
44
|
+
this.style.setProperty(prop, s);
|
|
45
|
+
else
|
|
46
|
+
this.style.removeProperty(prop);
|
|
47
|
+
};
|
|
48
|
+
set('--nile-chart-bg', this.chartBg);
|
|
49
|
+
set('--nile-chart-border-radius', this.chartBorderRadius);
|
|
50
|
+
set('--nile-chart-border', this.chartBorder);
|
|
51
|
+
set('--nile-chart-shadow', this.chartShadow);
|
|
52
|
+
set('--nile-chart-padding', this.chartPadding);
|
|
53
|
+
set('--nile-chart-min-height', this.chartMinHeight);
|
|
54
|
+
set('--nile-chart-loading-color', this.loadingColor);
|
|
55
|
+
set('--nile-chart-loading-font-size', this.loadingFontSize);
|
|
56
|
+
set('--nile-chart-loading-font-family', this.loadingFontFamily);
|
|
57
|
+
set('--nile-chart-loading-bg', this.loadingBg);
|
|
24
58
|
}
|
|
25
59
|
applyConfig(cfg) {
|
|
26
60
|
applySeparatedChartConfig(this, cfg);
|
|
@@ -37,6 +71,7 @@ let NileColumnRangeChart = class NileColumnRangeChart extends NileElement {
|
|
|
37
71
|
this.resizeObserver = null;
|
|
38
72
|
}
|
|
39
73
|
firstUpdated() {
|
|
74
|
+
this._syncCssVars();
|
|
40
75
|
this.initChart();
|
|
41
76
|
this.setupResizeObserver();
|
|
42
77
|
}
|
|
@@ -45,6 +80,10 @@ let NileColumnRangeChart = class NileColumnRangeChart extends NileElement {
|
|
|
45
80
|
this.applyConfig(this.config);
|
|
46
81
|
return;
|
|
47
82
|
}
|
|
83
|
+
const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
|
|
84
|
+
'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
|
|
85
|
+
if (cssVarProps.some(p => changedProperties.has(p)))
|
|
86
|
+
this._syncCssVars();
|
|
48
87
|
const props = [
|
|
49
88
|
'data',
|
|
50
89
|
'categories',
|
|
@@ -126,7 +165,7 @@ let NileColumnRangeChart = class NileColumnRangeChart extends NileElement {
|
|
|
126
165
|
}
|
|
127
166
|
render() {
|
|
128
167
|
if (this.loading) {
|
|
129
|
-
return html `<div class="chart-loading" style="height:${this.height}"
|
|
168
|
+
return html `<div class="chart-loading" style="height:${this.height}">${this.loadingText}</div>`;
|
|
130
169
|
}
|
|
131
170
|
return html `<div class="chart-container"></div>`;
|
|
132
171
|
}
|
|
@@ -162,6 +201,39 @@ __decorate([
|
|
|
162
201
|
__decorate([
|
|
163
202
|
property({ type: String, attribute: 'y-axis-title' })
|
|
164
203
|
], NileColumnRangeChart.prototype, "yAxisTitle", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
property({ type: String, attribute: 'chart-bg' })
|
|
206
|
+
], NileColumnRangeChart.prototype, "chartBg", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
property({ type: String, attribute: 'chart-border-radius' })
|
|
209
|
+
], NileColumnRangeChart.prototype, "chartBorderRadius", void 0);
|
|
210
|
+
__decorate([
|
|
211
|
+
property({ type: String, attribute: 'chart-border' })
|
|
212
|
+
], NileColumnRangeChart.prototype, "chartBorder", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
property({ type: String, attribute: 'chart-shadow' })
|
|
215
|
+
], NileColumnRangeChart.prototype, "chartShadow", void 0);
|
|
216
|
+
__decorate([
|
|
217
|
+
property({ type: String, attribute: 'chart-padding' })
|
|
218
|
+
], NileColumnRangeChart.prototype, "chartPadding", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
property({ type: String, attribute: 'chart-min-height' })
|
|
221
|
+
], NileColumnRangeChart.prototype, "chartMinHeight", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
property({ type: String, attribute: 'loading-text' })
|
|
224
|
+
], NileColumnRangeChart.prototype, "loadingText", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
property({ type: String, attribute: 'loading-color' })
|
|
227
|
+
], NileColumnRangeChart.prototype, "loadingColor", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
property({ type: String, attribute: 'loading-font-size' })
|
|
230
|
+
], NileColumnRangeChart.prototype, "loadingFontSize", void 0);
|
|
231
|
+
__decorate([
|
|
232
|
+
property({ type: String, attribute: 'loading-font-family' })
|
|
233
|
+
], NileColumnRangeChart.prototype, "loadingFontFamily", void 0);
|
|
234
|
+
__decorate([
|
|
235
|
+
property({ type: String, attribute: 'loading-bg' })
|
|
236
|
+
], NileColumnRangeChart.prototype, "loadingBg", void 0);
|
|
165
237
|
NileColumnRangeChart = __decorate([
|
|
166
238
|
customElement('nile-column-range-chart')
|
|
167
239
|
], NileColumnRangeChart);
|
|
@@ -14,11 +14,21 @@ export const styles = css `
|
|
|
14
14
|
width: 100%;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
.dashboard-fluid {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
17
23
|
.dashboard-cell {
|
|
18
24
|
min-height: 0;
|
|
19
25
|
min-width: 0;
|
|
20
26
|
}
|
|
21
27
|
|
|
28
|
+
.dashboard-cell--fluid {
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
}
|
|
31
|
+
|
|
22
32
|
nile-widget-viewer {
|
|
23
33
|
display: block;
|
|
24
34
|
width: 100%;
|
|
@@ -4,30 +4,26 @@ import NileElement from '../internal/nile-element.js';
|
|
|
4
4
|
import type { NileDashboardConfig } from '../internal/types/dashboard-config.type.js';
|
|
5
5
|
import '../nile-widget-viewer/index.js';
|
|
6
6
|
/**
|
|
7
|
-
* Renders a full dashboard
|
|
8
|
-
* with the `layout: { x, y, w, h }` values from its config.
|
|
7
|
+
* Renders a full dashboard of widgets. Supports two layout variants:
|
|
9
8
|
*
|
|
10
|
-
* - `
|
|
11
|
-
*
|
|
9
|
+
* - `grid` (default): positions each widget using CSS Grid with `layout: { x, y, w, h }`.
|
|
10
|
+
* - `x` / `w` → `grid-column: (x+1) / span w`
|
|
11
|
+
* - `y` / `h` → `grid-row: (y+1) / span h`
|
|
12
|
+
* - `fluid`: positions widgets with Flexbox. `x` / `y` are ignored; widgets flow in
|
|
13
|
+
* declaration order and wrap as needed. `w` sets the proportional width (as a fraction
|
|
14
|
+
* of `columns`) and `h` sets the height (in multiples of `cellHeight`).
|
|
12
15
|
*
|
|
13
16
|
* @example
|
|
14
17
|
* ```html
|
|
15
|
-
* <nile-dashboard-viewer columns="12" cell-height="80" gap="8"></nile-dashboard-viewer>
|
|
16
|
-
* ```
|
|
17
|
-
* ```js
|
|
18
|
-
* el.config = {
|
|
19
|
-
* name: 'My Dashboard',
|
|
20
|
-
* widgets: [
|
|
21
|
-
* { type: 'chart', layout: { x: 0, y: 0, w: 6, h: 4 }, nileConfig: { chart: { type: 'pie', data: [...] } } },
|
|
22
|
-
* { type: 'kpi', layout: { x: 0, y: 4, w: 3, h: 2 }, nileConfig: { chart: { type: 'kpi', label: 'Revenue', value: '$1.2M' } } },
|
|
23
|
-
* ]
|
|
24
|
-
* };
|
|
18
|
+
* <nile-dashboard-viewer variant="fluid" columns="12" cell-height="80" gap="8"></nile-dashboard-viewer>
|
|
25
19
|
* ```
|
|
26
20
|
*/
|
|
27
21
|
export declare class NileDashboardViewer extends NileElement {
|
|
28
22
|
static styles: CSSResultGroup;
|
|
29
23
|
/** Dashboard configuration containing all widget configs. */
|
|
30
24
|
config: NileDashboardConfig | null;
|
|
25
|
+
/** Layout variant. `grid` uses x/y/w/h positioning; `fluid` flows widgets with Flexbox. Default: `grid`. */
|
|
26
|
+
variant: 'grid' | 'fluid';
|
|
31
27
|
/** Total number of grid columns. Default: 12. */
|
|
32
28
|
columns: number;
|
|
33
29
|
/** Height of a single grid row in pixels. Default: 80. */
|
|
@@ -5,24 +5,18 @@ import NileElement from '../internal/nile-element.js';
|
|
|
5
5
|
import { styles } from './nile-dashboard-viewer.css.js';
|
|
6
6
|
import '../nile-widget-viewer/index.js';
|
|
7
7
|
/**
|
|
8
|
-
* Renders a full dashboard
|
|
9
|
-
* with the `layout: { x, y, w, h }` values from its config.
|
|
8
|
+
* Renders a full dashboard of widgets. Supports two layout variants:
|
|
10
9
|
*
|
|
11
|
-
* - `
|
|
12
|
-
*
|
|
10
|
+
* - `grid` (default): positions each widget using CSS Grid with `layout: { x, y, w, h }`.
|
|
11
|
+
* - `x` / `w` → `grid-column: (x+1) / span w`
|
|
12
|
+
* - `y` / `h` → `grid-row: (y+1) / span h`
|
|
13
|
+
* - `fluid`: positions widgets with Flexbox. `x` / `y` are ignored; widgets flow in
|
|
14
|
+
* declaration order and wrap as needed. `w` sets the proportional width (as a fraction
|
|
15
|
+
* of `columns`) and `h` sets the height (in multiples of `cellHeight`).
|
|
13
16
|
*
|
|
14
17
|
* @example
|
|
15
18
|
* ```html
|
|
16
|
-
* <nile-dashboard-viewer columns="12" cell-height="80" gap="8"></nile-dashboard-viewer>
|
|
17
|
-
* ```
|
|
18
|
-
* ```js
|
|
19
|
-
* el.config = {
|
|
20
|
-
* name: 'My Dashboard',
|
|
21
|
-
* widgets: [
|
|
22
|
-
* { type: 'chart', layout: { x: 0, y: 0, w: 6, h: 4 }, nileConfig: { chart: { type: 'pie', data: [...] } } },
|
|
23
|
-
* { type: 'kpi', layout: { x: 0, y: 4, w: 3, h: 2 }, nileConfig: { chart: { type: 'kpi', label: 'Revenue', value: '$1.2M' } } },
|
|
24
|
-
* ]
|
|
25
|
-
* };
|
|
19
|
+
* <nile-dashboard-viewer variant="fluid" columns="12" cell-height="80" gap="8"></nile-dashboard-viewer>
|
|
26
20
|
* ```
|
|
27
21
|
*/
|
|
28
22
|
let NileDashboardViewer = class NileDashboardViewer extends NileElement {
|
|
@@ -30,6 +24,8 @@ let NileDashboardViewer = class NileDashboardViewer extends NileElement {
|
|
|
30
24
|
super(...arguments);
|
|
31
25
|
/** Dashboard configuration containing all widget configs. */
|
|
32
26
|
this.config = null;
|
|
27
|
+
/** Layout variant. `grid` uses x/y/w/h positioning; `fluid` flows widgets with Flexbox. Default: `grid`. */
|
|
28
|
+
this.variant = 'grid';
|
|
33
29
|
/** Total number of grid columns. Default: 12. */
|
|
34
30
|
this.columns = 12;
|
|
35
31
|
/** Height of a single grid row in pixels. Default: 80. */
|
|
@@ -40,6 +36,29 @@ let NileDashboardViewer = class NileDashboardViewer extends NileElement {
|
|
|
40
36
|
render() {
|
|
41
37
|
if (!this.config?.widgets?.length)
|
|
42
38
|
return nothing;
|
|
39
|
+
if (this.variant === 'fluid') {
|
|
40
|
+
return html `
|
|
41
|
+
<div class="dashboard-fluid" style="gap: ${this.gap}px;">
|
|
42
|
+
${this.config.widgets.map((widget) => {
|
|
43
|
+
const { w, h } = widget.layout;
|
|
44
|
+
const widthPct = (Math.min(w, this.columns) / this.columns) * 100;
|
|
45
|
+
const basis = `calc(${widthPct}% - ${this.gap}px)`;
|
|
46
|
+
return html `
|
|
47
|
+
<div
|
|
48
|
+
class="dashboard-cell dashboard-cell--fluid"
|
|
49
|
+
style="
|
|
50
|
+
flex: 1 1 ${basis};
|
|
51
|
+
max-width: ${widthPct}%;
|
|
52
|
+
min-height: ${h * this.cellHeight}px;
|
|
53
|
+
"
|
|
54
|
+
>
|
|
55
|
+
<nile-widget-viewer .config=${widget}></nile-widget-viewer>
|
|
56
|
+
</div>
|
|
57
|
+
`;
|
|
58
|
+
})}
|
|
59
|
+
</div>
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
43
62
|
return html `
|
|
44
63
|
<div
|
|
45
64
|
class="dashboard-grid"
|
|
@@ -68,6 +87,9 @@ NileDashboardViewer.styles = styles;
|
|
|
68
87
|
__decorate([
|
|
69
88
|
property({ type: Object })
|
|
70
89
|
], NileDashboardViewer.prototype, "config", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
property({ type: String })
|
|
92
|
+
], NileDashboardViewer.prototype, "variant", void 0);
|
|
71
93
|
__decorate([
|
|
72
94
|
property({ type: Number })
|
|
73
95
|
], NileDashboardViewer.prototype, "columns", void 0);
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
export const styles = css `
|
|
3
3
|
:host {
|
|
4
|
+
--nile-chart-min-height: var(--nile-height-200px, var(--ng-height-200px));
|
|
5
|
+
--nile-chart-bg: transparent;
|
|
6
|
+
--nile-chart-border-radius: 0;
|
|
7
|
+
--nile-chart-border: none;
|
|
8
|
+
--nile-chart-shadow: none;
|
|
9
|
+
--nile-chart-padding: 0;
|
|
10
|
+
--nile-chart-loading-color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
11
|
+
--nile-chart-loading-font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
|
|
12
|
+
--nile-chart-loading-font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
13
|
+
--nile-chart-loading-bg: transparent;
|
|
4
14
|
display: block;
|
|
5
15
|
width: 100%;
|
|
6
16
|
position: relative;
|
|
@@ -12,7 +22,12 @@ export const styles = css `
|
|
|
12
22
|
|
|
13
23
|
.chart-container {
|
|
14
24
|
width: 100%;
|
|
15
|
-
min-height: var(--nile-
|
|
25
|
+
min-height: var(--nile-chart-min-height);
|
|
26
|
+
background: var(--nile-chart-bg);
|
|
27
|
+
border-radius: var(--nile-chart-border-radius);
|
|
28
|
+
border: var(--nile-chart-border);
|
|
29
|
+
box-shadow: var(--nile-chart-shadow);
|
|
30
|
+
padding: var(--nile-chart-padding);
|
|
16
31
|
}
|
|
17
32
|
|
|
18
33
|
.chart-loading {
|
|
@@ -20,9 +35,10 @@ export const styles = css `
|
|
|
20
35
|
align-items: center;
|
|
21
36
|
justify-content: center;
|
|
22
37
|
min-height: inherit;
|
|
23
|
-
color: var(--nile-
|
|
24
|
-
font-family: var(--nile-
|
|
25
|
-
font-size: var(--nile-
|
|
38
|
+
color: var(--nile-chart-loading-color);
|
|
39
|
+
font-family: var(--nile-chart-loading-font-family);
|
|
40
|
+
font-size: var(--nile-chart-loading-font-size);
|
|
41
|
+
background: var(--nile-chart-loading-bg);
|
|
26
42
|
}
|
|
27
43
|
`;
|
|
28
44
|
//# sourceMappingURL=nile-donut-chart.css.js.map
|
|
@@ -29,6 +29,18 @@ export declare class NileDonutChart extends NileElement {
|
|
|
29
29
|
height: string;
|
|
30
30
|
showDataLabels: boolean;
|
|
31
31
|
showLegend: boolean;
|
|
32
|
+
chartBg: string;
|
|
33
|
+
chartBorderRadius: string | number;
|
|
34
|
+
chartBorder: string;
|
|
35
|
+
chartShadow: string;
|
|
36
|
+
chartPadding: string | number;
|
|
37
|
+
chartMinHeight: string | number;
|
|
38
|
+
loadingText: string;
|
|
39
|
+
loadingColor: string;
|
|
40
|
+
loadingFontSize: string | number;
|
|
41
|
+
loadingFontFamily: string;
|
|
42
|
+
loadingBg: string;
|
|
43
|
+
private _syncCssVars;
|
|
32
44
|
/** Apply { chart, aq } config to individual properties. */
|
|
33
45
|
private applyConfig;
|
|
34
46
|
connectedCallback(): void;
|
|
@@ -25,6 +25,40 @@ let NileDonutChart = class NileDonutChart extends NileElement {
|
|
|
25
25
|
this.height = '400px';
|
|
26
26
|
this.showDataLabels = true;
|
|
27
27
|
this.showLegend = true;
|
|
28
|
+
// ── Container styling ──
|
|
29
|
+
this.chartBg = '';
|
|
30
|
+
this.chartBorderRadius = '';
|
|
31
|
+
this.chartBorder = '';
|
|
32
|
+
this.chartShadow = '';
|
|
33
|
+
this.chartPadding = '';
|
|
34
|
+
this.chartMinHeight = '';
|
|
35
|
+
// ── Loading ──
|
|
36
|
+
this.loadingText = 'Loading...';
|
|
37
|
+
this.loadingColor = '';
|
|
38
|
+
this.loadingFontSize = '';
|
|
39
|
+
this.loadingFontFamily = '';
|
|
40
|
+
this.loadingBg = '';
|
|
41
|
+
}
|
|
42
|
+
_syncCssVars() {
|
|
43
|
+
const set = (prop, val) => {
|
|
44
|
+
const s = typeof val === 'number'
|
|
45
|
+
? (Number.isFinite(val) ? `${val}px` : '')
|
|
46
|
+
: String(val ?? '').trim();
|
|
47
|
+
if (s)
|
|
48
|
+
this.style.setProperty(prop, s);
|
|
49
|
+
else
|
|
50
|
+
this.style.removeProperty(prop);
|
|
51
|
+
};
|
|
52
|
+
set('--nile-chart-bg', this.chartBg);
|
|
53
|
+
set('--nile-chart-border-radius', this.chartBorderRadius);
|
|
54
|
+
set('--nile-chart-border', this.chartBorder);
|
|
55
|
+
set('--nile-chart-shadow', this.chartShadow);
|
|
56
|
+
set('--nile-chart-padding', this.chartPadding);
|
|
57
|
+
set('--nile-chart-min-height', this.chartMinHeight);
|
|
58
|
+
set('--nile-chart-loading-color', this.loadingColor);
|
|
59
|
+
set('--nile-chart-loading-font-size', this.loadingFontSize);
|
|
60
|
+
set('--nile-chart-loading-font-family', this.loadingFontFamily);
|
|
61
|
+
set('--nile-chart-loading-bg', this.loadingBg);
|
|
28
62
|
}
|
|
29
63
|
/** Apply { chart, aq } config to individual properties. */
|
|
30
64
|
applyConfig(cfg) {
|
|
@@ -49,6 +83,28 @@ let NileDonutChart = class NileDonutChart extends NileElement {
|
|
|
49
83
|
this.showDataLabels = donut.showDataLabels;
|
|
50
84
|
if (donut.showLegend !== undefined)
|
|
51
85
|
this.showLegend = donut.showLegend;
|
|
86
|
+
if (donut.chartBg !== undefined)
|
|
87
|
+
this.chartBg = donut.chartBg;
|
|
88
|
+
if (donut.chartBorderRadius !== undefined)
|
|
89
|
+
this.chartBorderRadius = donut.chartBorderRadius;
|
|
90
|
+
if (donut.chartBorder !== undefined)
|
|
91
|
+
this.chartBorder = donut.chartBorder;
|
|
92
|
+
if (donut.chartShadow !== undefined)
|
|
93
|
+
this.chartShadow = donut.chartShadow;
|
|
94
|
+
if (donut.chartPadding !== undefined)
|
|
95
|
+
this.chartPadding = donut.chartPadding;
|
|
96
|
+
if (donut.chartMinHeight !== undefined)
|
|
97
|
+
this.chartMinHeight = donut.chartMinHeight;
|
|
98
|
+
if (donut.loadingText !== undefined)
|
|
99
|
+
this.loadingText = donut.loadingText;
|
|
100
|
+
if (donut.loadingColor !== undefined)
|
|
101
|
+
this.loadingColor = donut.loadingColor;
|
|
102
|
+
if (donut.loadingFontSize !== undefined)
|
|
103
|
+
this.loadingFontSize = donut.loadingFontSize;
|
|
104
|
+
if (donut.loadingFontFamily !== undefined)
|
|
105
|
+
this.loadingFontFamily = donut.loadingFontFamily;
|
|
106
|
+
if (donut.loadingBg !== undefined)
|
|
107
|
+
this.loadingBg = donut.loadingBg;
|
|
52
108
|
}
|
|
53
109
|
if (aq) {
|
|
54
110
|
if (aq.chartTitle)
|
|
@@ -68,12 +124,20 @@ let NileDonutChart = class NileDonutChart extends NileElement {
|
|
|
68
124
|
this.resizeObserver?.disconnect();
|
|
69
125
|
this.resizeObserver = null;
|
|
70
126
|
}
|
|
71
|
-
firstUpdated() {
|
|
127
|
+
firstUpdated() {
|
|
128
|
+
this._syncCssVars();
|
|
129
|
+
this.initChart();
|
|
130
|
+
this.setupResizeObserver();
|
|
131
|
+
}
|
|
72
132
|
updated(changedProperties) {
|
|
73
133
|
if (changedProperties.has('config') && this.config) {
|
|
74
134
|
this.applyConfig(this.config);
|
|
75
135
|
return;
|
|
76
136
|
}
|
|
137
|
+
const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
|
|
138
|
+
'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
|
|
139
|
+
if (cssVarProps.some(p => changedProperties.has(p)))
|
|
140
|
+
this._syncCssVars();
|
|
77
141
|
const props = ['data', 'chartTitle', 'chartSubtitle', 'options', 'height', 'seriesName', 'innerSize', 'semiCircle', 'loading', 'showDataLabels', 'showLegend'];
|
|
78
142
|
if (!props.some(p => changedProperties.has(p)))
|
|
79
143
|
return;
|
|
@@ -138,7 +202,7 @@ let NileDonutChart = class NileDonutChart extends NileElement {
|
|
|
138
202
|
} }
|
|
139
203
|
render() {
|
|
140
204
|
if (this.loading)
|
|
141
|
-
return html `<div class="chart-loading" style="height:${this.height}"
|
|
205
|
+
return html `<div class="chart-loading" style="height:${this.height}">${this.loadingText}</div>`;
|
|
142
206
|
return html `<div class="chart-container"></div>`;
|
|
143
207
|
}
|
|
144
208
|
};
|
|
@@ -182,6 +246,39 @@ __decorate([
|
|
|
182
246
|
__decorate([
|
|
183
247
|
property({ type: Boolean, attribute: 'show-legend' })
|
|
184
248
|
], NileDonutChart.prototype, "showLegend", void 0);
|
|
249
|
+
__decorate([
|
|
250
|
+
property({ type: String, attribute: 'chart-bg' })
|
|
251
|
+
], NileDonutChart.prototype, "chartBg", void 0);
|
|
252
|
+
__decorate([
|
|
253
|
+
property({ type: String, attribute: 'chart-border-radius' })
|
|
254
|
+
], NileDonutChart.prototype, "chartBorderRadius", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
property({ type: String, attribute: 'chart-border' })
|
|
257
|
+
], NileDonutChart.prototype, "chartBorder", void 0);
|
|
258
|
+
__decorate([
|
|
259
|
+
property({ type: String, attribute: 'chart-shadow' })
|
|
260
|
+
], NileDonutChart.prototype, "chartShadow", void 0);
|
|
261
|
+
__decorate([
|
|
262
|
+
property({ type: String, attribute: 'chart-padding' })
|
|
263
|
+
], NileDonutChart.prototype, "chartPadding", void 0);
|
|
264
|
+
__decorate([
|
|
265
|
+
property({ type: String, attribute: 'chart-min-height' })
|
|
266
|
+
], NileDonutChart.prototype, "chartMinHeight", void 0);
|
|
267
|
+
__decorate([
|
|
268
|
+
property({ type: String, attribute: 'loading-text' })
|
|
269
|
+
], NileDonutChart.prototype, "loadingText", void 0);
|
|
270
|
+
__decorate([
|
|
271
|
+
property({ type: String, attribute: 'loading-color' })
|
|
272
|
+
], NileDonutChart.prototype, "loadingColor", void 0);
|
|
273
|
+
__decorate([
|
|
274
|
+
property({ type: String, attribute: 'loading-font-size' })
|
|
275
|
+
], NileDonutChart.prototype, "loadingFontSize", void 0);
|
|
276
|
+
__decorate([
|
|
277
|
+
property({ type: String, attribute: 'loading-font-family' })
|
|
278
|
+
], NileDonutChart.prototype, "loadingFontFamily", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
property({ type: String, attribute: 'loading-bg' })
|
|
281
|
+
], NileDonutChart.prototype, "loadingBg", void 0);
|
|
185
282
|
NileDonutChart = __decorate([
|
|
186
283
|
customElement('nile-donut-chart')
|
|
187
284
|
], NileDonutChart);
|