@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
|
@@ -26,6 +26,40 @@ let NileStackedChart = class NileStackedChart extends NileElement {
|
|
|
26
26
|
/** `normal` = stacked values; `percent` = 100% proportional stacks. */
|
|
27
27
|
this.stackMode = 'normal';
|
|
28
28
|
this.pointPadding = 0.05;
|
|
29
|
+
// ── Container styling ──
|
|
30
|
+
this.chartBg = '';
|
|
31
|
+
this.chartBorderRadius = '';
|
|
32
|
+
this.chartBorder = '';
|
|
33
|
+
this.chartShadow = '';
|
|
34
|
+
this.chartPadding = '';
|
|
35
|
+
this.chartMinHeight = '';
|
|
36
|
+
// ── Loading ──
|
|
37
|
+
this.loadingText = 'Loading...';
|
|
38
|
+
this.loadingColor = '';
|
|
39
|
+
this.loadingFontSize = '';
|
|
40
|
+
this.loadingFontFamily = '';
|
|
41
|
+
this.loadingBg = '';
|
|
42
|
+
}
|
|
43
|
+
_syncCssVars() {
|
|
44
|
+
const set = (prop, val) => {
|
|
45
|
+
const s = typeof val === 'number'
|
|
46
|
+
? (Number.isFinite(val) ? `${val}px` : '')
|
|
47
|
+
: String(val ?? '').trim();
|
|
48
|
+
if (s)
|
|
49
|
+
this.style.setProperty(prop, s);
|
|
50
|
+
else
|
|
51
|
+
this.style.removeProperty(prop);
|
|
52
|
+
};
|
|
53
|
+
set('--nile-chart-bg', this.chartBg);
|
|
54
|
+
set('--nile-chart-border-radius', this.chartBorderRadius);
|
|
55
|
+
set('--nile-chart-border', this.chartBorder);
|
|
56
|
+
set('--nile-chart-shadow', this.chartShadow);
|
|
57
|
+
set('--nile-chart-padding', this.chartPadding);
|
|
58
|
+
set('--nile-chart-min-height', this.chartMinHeight);
|
|
59
|
+
set('--nile-chart-loading-color', this.loadingColor);
|
|
60
|
+
set('--nile-chart-loading-font-size', this.loadingFontSize);
|
|
61
|
+
set('--nile-chart-loading-font-family', this.loadingFontFamily);
|
|
62
|
+
set('--nile-chart-loading-bg', this.loadingBg);
|
|
29
63
|
}
|
|
30
64
|
/** Apply `{ chart, aq }` config to individual properties. */
|
|
31
65
|
applyConfig(cfg) {
|
|
@@ -43,6 +77,7 @@ let NileStackedChart = class NileStackedChart extends NileElement {
|
|
|
43
77
|
this.resizeObserver = null;
|
|
44
78
|
}
|
|
45
79
|
firstUpdated() {
|
|
80
|
+
this._syncCssVars();
|
|
46
81
|
this.initChart();
|
|
47
82
|
this.setupResizeObserver();
|
|
48
83
|
}
|
|
@@ -64,6 +99,10 @@ let NileStackedChart = class NileStackedChart extends NileElement {
|
|
|
64
99
|
'stackMode',
|
|
65
100
|
'pointPadding',
|
|
66
101
|
];
|
|
102
|
+
const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
|
|
103
|
+
'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
|
|
104
|
+
if (cssVarProps.some(p => changedProperties.has(p)))
|
|
105
|
+
this._syncCssVars();
|
|
67
106
|
if (!props.some(p => changedProperties.has(p)))
|
|
68
107
|
return;
|
|
69
108
|
if (this.loading) {
|
|
@@ -164,7 +203,7 @@ let NileStackedChart = class NileStackedChart extends NileElement {
|
|
|
164
203
|
}
|
|
165
204
|
render() {
|
|
166
205
|
if (this.loading) {
|
|
167
|
-
return html `<div class="chart-loading" style="height:${this.height}"
|
|
206
|
+
return html `<div class="chart-loading" style="height:${this.height}">${this.loadingText}</div>`;
|
|
168
207
|
}
|
|
169
208
|
return html `<div class="chart-container"></div>`;
|
|
170
209
|
}
|
|
@@ -209,6 +248,39 @@ __decorate([
|
|
|
209
248
|
__decorate([
|
|
210
249
|
property({ type: Number, attribute: 'point-padding' })
|
|
211
250
|
], NileStackedChart.prototype, "pointPadding", void 0);
|
|
251
|
+
__decorate([
|
|
252
|
+
property({ type: String, attribute: 'chart-bg' })
|
|
253
|
+
], NileStackedChart.prototype, "chartBg", void 0);
|
|
254
|
+
__decorate([
|
|
255
|
+
property({ type: String, attribute: 'chart-border-radius' })
|
|
256
|
+
], NileStackedChart.prototype, "chartBorderRadius", void 0);
|
|
257
|
+
__decorate([
|
|
258
|
+
property({ type: String, attribute: 'chart-border' })
|
|
259
|
+
], NileStackedChart.prototype, "chartBorder", void 0);
|
|
260
|
+
__decorate([
|
|
261
|
+
property({ type: String, attribute: 'chart-shadow' })
|
|
262
|
+
], NileStackedChart.prototype, "chartShadow", void 0);
|
|
263
|
+
__decorate([
|
|
264
|
+
property({ type: String, attribute: 'chart-padding' })
|
|
265
|
+
], NileStackedChart.prototype, "chartPadding", void 0);
|
|
266
|
+
__decorate([
|
|
267
|
+
property({ type: String, attribute: 'chart-min-height' })
|
|
268
|
+
], NileStackedChart.prototype, "chartMinHeight", void 0);
|
|
269
|
+
__decorate([
|
|
270
|
+
property({ type: String, attribute: 'loading-text' })
|
|
271
|
+
], NileStackedChart.prototype, "loadingText", void 0);
|
|
272
|
+
__decorate([
|
|
273
|
+
property({ type: String, attribute: 'loading-color' })
|
|
274
|
+
], NileStackedChart.prototype, "loadingColor", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
property({ type: String, attribute: 'loading-font-size' })
|
|
277
|
+
], NileStackedChart.prototype, "loadingFontSize", void 0);
|
|
278
|
+
__decorate([
|
|
279
|
+
property({ type: String, attribute: 'loading-font-family' })
|
|
280
|
+
], NileStackedChart.prototype, "loadingFontFamily", void 0);
|
|
281
|
+
__decorate([
|
|
282
|
+
property({ type: String, attribute: 'loading-bg' })
|
|
283
|
+
], NileStackedChart.prototype, "loadingBg", void 0);
|
|
212
284
|
NileStackedChart = __decorate([
|
|
213
285
|
customElement('nile-stacked-chart')
|
|
214
286
|
], NileStackedChart);
|
|
@@ -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-timeline-chart.css.js.map
|
|
@@ -6,7 +6,7 @@ export interface TimelineEvent {
|
|
|
6
6
|
/** Shown on axis / tooltip header (e.g. date string). */
|
|
7
7
|
name: string;
|
|
8
8
|
/** Short label on the timeline. */
|
|
9
|
-
label
|
|
9
|
+
label?: string;
|
|
10
10
|
/** Longer copy; tooltip uses this by default. */
|
|
11
11
|
description?: string;
|
|
12
12
|
/** Unix timestamp (ms) when `datetime-axis` is true; omit for evenly spaced events. */
|
|
@@ -38,6 +38,18 @@ export declare class NileTimelineChart extends NileElement {
|
|
|
38
38
|
/** Alternate data-label sides along the line. */
|
|
39
39
|
alternateLabels: boolean;
|
|
40
40
|
showLegend: boolean;
|
|
41
|
+
chartBg: string;
|
|
42
|
+
chartBorderRadius: string | number;
|
|
43
|
+
chartBorder: string;
|
|
44
|
+
chartShadow: string;
|
|
45
|
+
chartPadding: string | number;
|
|
46
|
+
chartMinHeight: string | number;
|
|
47
|
+
loadingText: string;
|
|
48
|
+
loadingColor: string;
|
|
49
|
+
loadingFontSize: string | number;
|
|
50
|
+
loadingFontFamily: string;
|
|
51
|
+
loadingBg: string;
|
|
52
|
+
private _syncCssVars;
|
|
41
53
|
/** Apply `{ chart, aq }` config to individual properties. */
|
|
42
54
|
private applyConfig;
|
|
43
55
|
connectedCallback(): void;
|
|
@@ -31,6 +31,40 @@ let NileTimelineChart = class NileTimelineChart extends NileElement {
|
|
|
31
31
|
/** Alternate data-label sides along the line. */
|
|
32
32
|
this.alternateLabels = true;
|
|
33
33
|
this.showLegend = false;
|
|
34
|
+
// ── Container styling ──
|
|
35
|
+
this.chartBg = '';
|
|
36
|
+
this.chartBorderRadius = '';
|
|
37
|
+
this.chartBorder = '';
|
|
38
|
+
this.chartShadow = '';
|
|
39
|
+
this.chartPadding = '';
|
|
40
|
+
this.chartMinHeight = '';
|
|
41
|
+
// ── Loading ──
|
|
42
|
+
this.loadingText = 'Loading...';
|
|
43
|
+
this.loadingColor = '';
|
|
44
|
+
this.loadingFontSize = '';
|
|
45
|
+
this.loadingFontFamily = '';
|
|
46
|
+
this.loadingBg = '';
|
|
47
|
+
}
|
|
48
|
+
_syncCssVars() {
|
|
49
|
+
const set = (prop, val) => {
|
|
50
|
+
const s = typeof val === 'number'
|
|
51
|
+
? (Number.isFinite(val) ? `${val}px` : '')
|
|
52
|
+
: String(val ?? '').trim();
|
|
53
|
+
if (s)
|
|
54
|
+
this.style.setProperty(prop, s);
|
|
55
|
+
else
|
|
56
|
+
this.style.removeProperty(prop);
|
|
57
|
+
};
|
|
58
|
+
set('--nile-chart-bg', this.chartBg);
|
|
59
|
+
set('--nile-chart-border-radius', this.chartBorderRadius);
|
|
60
|
+
set('--nile-chart-border', this.chartBorder);
|
|
61
|
+
set('--nile-chart-shadow', this.chartShadow);
|
|
62
|
+
set('--nile-chart-padding', this.chartPadding);
|
|
63
|
+
set('--nile-chart-min-height', this.chartMinHeight);
|
|
64
|
+
set('--nile-chart-loading-color', this.loadingColor);
|
|
65
|
+
set('--nile-chart-loading-font-size', this.loadingFontSize);
|
|
66
|
+
set('--nile-chart-loading-font-family', this.loadingFontFamily);
|
|
67
|
+
set('--nile-chart-loading-bg', this.loadingBg);
|
|
34
68
|
}
|
|
35
69
|
/** Apply `{ chart, aq }` config to individual properties. */
|
|
36
70
|
applyConfig(cfg) {
|
|
@@ -48,6 +82,7 @@ let NileTimelineChart = class NileTimelineChart extends NileElement {
|
|
|
48
82
|
this.resizeObserver = null;
|
|
49
83
|
}
|
|
50
84
|
firstUpdated() {
|
|
85
|
+
this._syncCssVars();
|
|
51
86
|
this.initChart();
|
|
52
87
|
this.setupResizeObserver();
|
|
53
88
|
}
|
|
@@ -69,6 +104,10 @@ let NileTimelineChart = class NileTimelineChart extends NileElement {
|
|
|
69
104
|
'showLegend',
|
|
70
105
|
'loading',
|
|
71
106
|
];
|
|
107
|
+
const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
|
|
108
|
+
'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
|
|
109
|
+
if (cssVarProps.some(p => changedProperties.has(p)))
|
|
110
|
+
this._syncCssVars();
|
|
72
111
|
if (!props.some(p => changedProperties.has(p)))
|
|
73
112
|
return;
|
|
74
113
|
if (this.loading) {
|
|
@@ -187,7 +226,7 @@ let NileTimelineChart = class NileTimelineChart extends NileElement {
|
|
|
187
226
|
}
|
|
188
227
|
render() {
|
|
189
228
|
if (this.loading) {
|
|
190
|
-
return html `<div class="chart-loading" style="height:${this.height}"
|
|
229
|
+
return html `<div class="chart-loading" style="height:${this.height}">${this.loadingText}</div>`;
|
|
191
230
|
}
|
|
192
231
|
return html `<div class="chart-container"></div>`;
|
|
193
232
|
}
|
|
@@ -232,6 +271,39 @@ __decorate([
|
|
|
232
271
|
__decorate([
|
|
233
272
|
property({ type: Boolean, attribute: 'show-legend' })
|
|
234
273
|
], NileTimelineChart.prototype, "showLegend", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
property({ type: String, attribute: 'chart-bg' })
|
|
276
|
+
], NileTimelineChart.prototype, "chartBg", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
property({ type: String, attribute: 'chart-border-radius' })
|
|
279
|
+
], NileTimelineChart.prototype, "chartBorderRadius", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
property({ type: String, attribute: 'chart-border' })
|
|
282
|
+
], NileTimelineChart.prototype, "chartBorder", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
property({ type: String, attribute: 'chart-shadow' })
|
|
285
|
+
], NileTimelineChart.prototype, "chartShadow", void 0);
|
|
286
|
+
__decorate([
|
|
287
|
+
property({ type: String, attribute: 'chart-padding' })
|
|
288
|
+
], NileTimelineChart.prototype, "chartPadding", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
property({ type: String, attribute: 'chart-min-height' })
|
|
291
|
+
], NileTimelineChart.prototype, "chartMinHeight", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
property({ type: String, attribute: 'loading-text' })
|
|
294
|
+
], NileTimelineChart.prototype, "loadingText", void 0);
|
|
295
|
+
__decorate([
|
|
296
|
+
property({ type: String, attribute: 'loading-color' })
|
|
297
|
+
], NileTimelineChart.prototype, "loadingColor", void 0);
|
|
298
|
+
__decorate([
|
|
299
|
+
property({ type: String, attribute: 'loading-font-size' })
|
|
300
|
+
], NileTimelineChart.prototype, "loadingFontSize", void 0);
|
|
301
|
+
__decorate([
|
|
302
|
+
property({ type: String, attribute: 'loading-font-family' })
|
|
303
|
+
], NileTimelineChart.prototype, "loadingFontFamily", void 0);
|
|
304
|
+
__decorate([
|
|
305
|
+
property({ type: String, attribute: 'loading-bg' })
|
|
306
|
+
], NileTimelineChart.prototype, "loadingBg", void 0);
|
|
235
307
|
NileTimelineChart = __decorate([
|
|
236
308
|
customElement('nile-timeline-chart')
|
|
237
309
|
], NileTimelineChart);
|
|
@@ -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-trendline-chart.css.js.map
|
|
@@ -41,6 +41,18 @@ export declare class NileTrendlineChart extends NileElement {
|
|
|
41
41
|
height: string;
|
|
42
42
|
/** Y-axis title text. */
|
|
43
43
|
yAxisTitle: string;
|
|
44
|
+
chartBg: string;
|
|
45
|
+
chartBorderRadius: string | number;
|
|
46
|
+
chartBorder: string;
|
|
47
|
+
chartShadow: string;
|
|
48
|
+
chartPadding: string | number;
|
|
49
|
+
chartMinHeight: string | number;
|
|
50
|
+
loadingText: string;
|
|
51
|
+
loadingColor: string;
|
|
52
|
+
loadingFontSize: string | number;
|
|
53
|
+
loadingFontFamily: string;
|
|
54
|
+
loadingBg: string;
|
|
55
|
+
private _syncCssVars;
|
|
44
56
|
/** Apply { chart, aq } config to individual properties. */
|
|
45
57
|
private applyConfig;
|
|
46
58
|
connectedCallback(): void;
|
|
@@ -31,6 +31,40 @@ let NileTrendlineChart = class NileTrendlineChart extends NileElement {
|
|
|
31
31
|
this.height = '400px';
|
|
32
32
|
/** Y-axis title text. */
|
|
33
33
|
this.yAxisTitle = '';
|
|
34
|
+
// ── Container styling ──
|
|
35
|
+
this.chartBg = '';
|
|
36
|
+
this.chartBorderRadius = '';
|
|
37
|
+
this.chartBorder = '';
|
|
38
|
+
this.chartShadow = '';
|
|
39
|
+
this.chartPadding = '';
|
|
40
|
+
this.chartMinHeight = '';
|
|
41
|
+
// ── Loading ──
|
|
42
|
+
this.loadingText = 'Loading...';
|
|
43
|
+
this.loadingColor = '';
|
|
44
|
+
this.loadingFontSize = '';
|
|
45
|
+
this.loadingFontFamily = '';
|
|
46
|
+
this.loadingBg = '';
|
|
47
|
+
}
|
|
48
|
+
_syncCssVars() {
|
|
49
|
+
const set = (prop, val) => {
|
|
50
|
+
const s = typeof val === 'number'
|
|
51
|
+
? (Number.isFinite(val) ? `${val}px` : '')
|
|
52
|
+
: String(val ?? '').trim();
|
|
53
|
+
if (s)
|
|
54
|
+
this.style.setProperty(prop, s);
|
|
55
|
+
else
|
|
56
|
+
this.style.removeProperty(prop);
|
|
57
|
+
};
|
|
58
|
+
set('--nile-chart-bg', this.chartBg);
|
|
59
|
+
set('--nile-chart-border-radius', this.chartBorderRadius);
|
|
60
|
+
set('--nile-chart-border', this.chartBorder);
|
|
61
|
+
set('--nile-chart-shadow', this.chartShadow);
|
|
62
|
+
set('--nile-chart-padding', this.chartPadding);
|
|
63
|
+
set('--nile-chart-min-height', this.chartMinHeight);
|
|
64
|
+
set('--nile-chart-loading-color', this.loadingColor);
|
|
65
|
+
set('--nile-chart-loading-font-size', this.loadingFontSize);
|
|
66
|
+
set('--nile-chart-loading-font-family', this.loadingFontFamily);
|
|
67
|
+
set('--nile-chart-loading-bg', this.loadingBg);
|
|
34
68
|
}
|
|
35
69
|
/** Apply { chart, aq } config to individual properties. */
|
|
36
70
|
applyConfig(cfg) {
|
|
@@ -49,6 +83,28 @@ let NileTrendlineChart = class NileTrendlineChart extends NileElement {
|
|
|
49
83
|
this.loading = trend.loading;
|
|
50
84
|
if (trend.options)
|
|
51
85
|
this.options = trend.options;
|
|
86
|
+
if (trend.chartBg !== undefined)
|
|
87
|
+
this.chartBg = trend.chartBg;
|
|
88
|
+
if (trend.chartBorderRadius !== undefined)
|
|
89
|
+
this.chartBorderRadius = trend.chartBorderRadius;
|
|
90
|
+
if (trend.chartBorder !== undefined)
|
|
91
|
+
this.chartBorder = trend.chartBorder;
|
|
92
|
+
if (trend.chartShadow !== undefined)
|
|
93
|
+
this.chartShadow = trend.chartShadow;
|
|
94
|
+
if (trend.chartPadding !== undefined)
|
|
95
|
+
this.chartPadding = trend.chartPadding;
|
|
96
|
+
if (trend.chartMinHeight !== undefined)
|
|
97
|
+
this.chartMinHeight = trend.chartMinHeight;
|
|
98
|
+
if (trend.loadingText !== undefined)
|
|
99
|
+
this.loadingText = trend.loadingText;
|
|
100
|
+
if (trend.loadingColor !== undefined)
|
|
101
|
+
this.loadingColor = trend.loadingColor;
|
|
102
|
+
if (trend.loadingFontSize !== undefined)
|
|
103
|
+
this.loadingFontSize = trend.loadingFontSize;
|
|
104
|
+
if (trend.loadingFontFamily !== undefined)
|
|
105
|
+
this.loadingFontFamily = trend.loadingFontFamily;
|
|
106
|
+
if (trend.loadingBg !== undefined)
|
|
107
|
+
this.loadingBg = trend.loadingBg;
|
|
52
108
|
if (trend.forecast)
|
|
53
109
|
this.forecast = trend.forecast;
|
|
54
110
|
}
|
|
@@ -71,6 +127,7 @@ let NileTrendlineChart = class NileTrendlineChart extends NileElement {
|
|
|
71
127
|
this.resizeObserver = null;
|
|
72
128
|
}
|
|
73
129
|
firstUpdated() {
|
|
130
|
+
this._syncCssVars();
|
|
74
131
|
this.initChart();
|
|
75
132
|
this.setupResizeObserver();
|
|
76
133
|
}
|
|
@@ -79,6 +136,10 @@ let NileTrendlineChart = class NileTrendlineChart extends NileElement {
|
|
|
79
136
|
this.applyConfig(this.config);
|
|
80
137
|
return;
|
|
81
138
|
}
|
|
139
|
+
const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
|
|
140
|
+
'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
|
|
141
|
+
if (cssVarProps.some(p => changedProperties.has(p)))
|
|
142
|
+
this._syncCssVars();
|
|
82
143
|
const chartProps = [
|
|
83
144
|
'data',
|
|
84
145
|
'categories',
|
|
@@ -241,7 +302,7 @@ let NileTrendlineChart = class NileTrendlineChart extends NileElement {
|
|
|
241
302
|
}
|
|
242
303
|
render() {
|
|
243
304
|
if (this.loading) {
|
|
244
|
-
return html `<div class="chart-loading" style="height:${this.height}"
|
|
305
|
+
return html `<div class="chart-loading" style="height:${this.height}">${this.loadingText}</div>`;
|
|
245
306
|
}
|
|
246
307
|
return html `<div class="chart-container"></div>`;
|
|
247
308
|
}
|
|
@@ -280,6 +341,39 @@ __decorate([
|
|
|
280
341
|
__decorate([
|
|
281
342
|
property({ type: String, attribute: 'y-axis-title' })
|
|
282
343
|
], NileTrendlineChart.prototype, "yAxisTitle", void 0);
|
|
344
|
+
__decorate([
|
|
345
|
+
property({ type: String, attribute: 'chart-bg' })
|
|
346
|
+
], NileTrendlineChart.prototype, "chartBg", void 0);
|
|
347
|
+
__decorate([
|
|
348
|
+
property({ type: String, attribute: 'chart-border-radius' })
|
|
349
|
+
], NileTrendlineChart.prototype, "chartBorderRadius", void 0);
|
|
350
|
+
__decorate([
|
|
351
|
+
property({ type: String, attribute: 'chart-border' })
|
|
352
|
+
], NileTrendlineChart.prototype, "chartBorder", void 0);
|
|
353
|
+
__decorate([
|
|
354
|
+
property({ type: String, attribute: 'chart-shadow' })
|
|
355
|
+
], NileTrendlineChart.prototype, "chartShadow", void 0);
|
|
356
|
+
__decorate([
|
|
357
|
+
property({ type: String, attribute: 'chart-padding' })
|
|
358
|
+
], NileTrendlineChart.prototype, "chartPadding", void 0);
|
|
359
|
+
__decorate([
|
|
360
|
+
property({ type: String, attribute: 'chart-min-height' })
|
|
361
|
+
], NileTrendlineChart.prototype, "chartMinHeight", void 0);
|
|
362
|
+
__decorate([
|
|
363
|
+
property({ type: String, attribute: 'loading-text' })
|
|
364
|
+
], NileTrendlineChart.prototype, "loadingText", void 0);
|
|
365
|
+
__decorate([
|
|
366
|
+
property({ type: String, attribute: 'loading-color' })
|
|
367
|
+
], NileTrendlineChart.prototype, "loadingColor", void 0);
|
|
368
|
+
__decorate([
|
|
369
|
+
property({ type: String, attribute: 'loading-font-size' })
|
|
370
|
+
], NileTrendlineChart.prototype, "loadingFontSize", void 0);
|
|
371
|
+
__decorate([
|
|
372
|
+
property({ type: String, attribute: 'loading-font-family' })
|
|
373
|
+
], NileTrendlineChart.prototype, "loadingFontFamily", void 0);
|
|
374
|
+
__decorate([
|
|
375
|
+
property({ type: String, attribute: 'loading-bg' })
|
|
376
|
+
], NileTrendlineChart.prototype, "loadingBg", void 0);
|
|
283
377
|
NileTrendlineChart = __decorate([
|
|
284
378
|
customElement('nile-trendline-chart')
|
|
285
379
|
], NileTrendlineChart);
|
|
@@ -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-variable-pie-chart.css.js.map
|
|
@@ -24,6 +24,18 @@ export declare class NileVariablePieChart extends NileElement {
|
|
|
24
24
|
options: Highcharts.Options;
|
|
25
25
|
loading: boolean;
|
|
26
26
|
height: string;
|
|
27
|
+
chartBg: string;
|
|
28
|
+
chartBorderRadius: string | number;
|
|
29
|
+
chartBorder: string;
|
|
30
|
+
chartShadow: string;
|
|
31
|
+
chartPadding: string | number;
|
|
32
|
+
chartMinHeight: string | number;
|
|
33
|
+
loadingText: string;
|
|
34
|
+
loadingColor: string;
|
|
35
|
+
loadingFontSize: string | number;
|
|
36
|
+
loadingFontFamily: string;
|
|
37
|
+
loadingBg: string;
|
|
38
|
+
private _syncCssVars;
|
|
27
39
|
private applyConfig;
|
|
28
40
|
connectedCallback(): void;
|
|
29
41
|
disconnectedCallback(): void;
|
|
@@ -22,6 +22,40 @@ let NileVariablePieChart = class NileVariablePieChart extends NileElement {
|
|
|
22
22
|
this.options = {};
|
|
23
23
|
this.loading = false;
|
|
24
24
|
this.height = '400px';
|
|
25
|
+
// ── Container styling ──
|
|
26
|
+
this.chartBg = '';
|
|
27
|
+
this.chartBorderRadius = '';
|
|
28
|
+
this.chartBorder = '';
|
|
29
|
+
this.chartShadow = '';
|
|
30
|
+
this.chartPadding = '';
|
|
31
|
+
this.chartMinHeight = '';
|
|
32
|
+
// ── Loading ──
|
|
33
|
+
this.loadingText = 'Loading...';
|
|
34
|
+
this.loadingColor = '';
|
|
35
|
+
this.loadingFontSize = '';
|
|
36
|
+
this.loadingFontFamily = '';
|
|
37
|
+
this.loadingBg = '';
|
|
38
|
+
}
|
|
39
|
+
_syncCssVars() {
|
|
40
|
+
const set = (prop, val) => {
|
|
41
|
+
const s = typeof val === 'number'
|
|
42
|
+
? (Number.isFinite(val) ? `${val}px` : '')
|
|
43
|
+
: String(val ?? '').trim();
|
|
44
|
+
if (s)
|
|
45
|
+
this.style.setProperty(prop, s);
|
|
46
|
+
else
|
|
47
|
+
this.style.removeProperty(prop);
|
|
48
|
+
};
|
|
49
|
+
set('--nile-chart-bg', this.chartBg);
|
|
50
|
+
set('--nile-chart-border-radius', this.chartBorderRadius);
|
|
51
|
+
set('--nile-chart-border', this.chartBorder);
|
|
52
|
+
set('--nile-chart-shadow', this.chartShadow);
|
|
53
|
+
set('--nile-chart-padding', this.chartPadding);
|
|
54
|
+
set('--nile-chart-min-height', this.chartMinHeight);
|
|
55
|
+
set('--nile-chart-loading-color', this.loadingColor);
|
|
56
|
+
set('--nile-chart-loading-font-size', this.loadingFontSize);
|
|
57
|
+
set('--nile-chart-loading-font-family', this.loadingFontFamily);
|
|
58
|
+
set('--nile-chart-loading-bg', this.loadingBg);
|
|
25
59
|
}
|
|
26
60
|
applyConfig(cfg) {
|
|
27
61
|
applySeparatedChartConfig(this, cfg);
|
|
@@ -38,6 +72,7 @@ let NileVariablePieChart = class NileVariablePieChart extends NileElement {
|
|
|
38
72
|
this.resizeObserver = null;
|
|
39
73
|
}
|
|
40
74
|
firstUpdated() {
|
|
75
|
+
this._syncCssVars();
|
|
41
76
|
this.initChart();
|
|
42
77
|
this.setupResizeObserver();
|
|
43
78
|
}
|
|
@@ -57,6 +92,10 @@ let NileVariablePieChart = class NileVariablePieChart extends NileElement {
|
|
|
57
92
|
'height',
|
|
58
93
|
'loading',
|
|
59
94
|
];
|
|
95
|
+
const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
|
|
96
|
+
'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
|
|
97
|
+
if (cssVarProps.some(p => changedProperties.has(p)))
|
|
98
|
+
this._syncCssVars();
|
|
60
99
|
if (!props.some(p => changedProperties.has(p)))
|
|
61
100
|
return;
|
|
62
101
|
if (this.loading) {
|
|
@@ -134,7 +173,7 @@ let NileVariablePieChart = class NileVariablePieChart extends NileElement {
|
|
|
134
173
|
}
|
|
135
174
|
render() {
|
|
136
175
|
if (this.loading) {
|
|
137
|
-
return html `<div class="chart-loading" style="height:${this.height}"
|
|
176
|
+
return html `<div class="chart-loading" style="height:${this.height}">${this.loadingText}</div>`;
|
|
138
177
|
}
|
|
139
178
|
return html `<div class="chart-container"></div>`;
|
|
140
179
|
}
|
|
@@ -173,6 +212,39 @@ __decorate([
|
|
|
173
212
|
__decorate([
|
|
174
213
|
property({ type: String })
|
|
175
214
|
], NileVariablePieChart.prototype, "height", void 0);
|
|
215
|
+
__decorate([
|
|
216
|
+
property({ type: String, attribute: 'chart-bg' })
|
|
217
|
+
], NileVariablePieChart.prototype, "chartBg", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
property({ type: String, attribute: 'chart-border-radius' })
|
|
220
|
+
], NileVariablePieChart.prototype, "chartBorderRadius", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
property({ type: String, attribute: 'chart-border' })
|
|
223
|
+
], NileVariablePieChart.prototype, "chartBorder", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
property({ type: String, attribute: 'chart-shadow' })
|
|
226
|
+
], NileVariablePieChart.prototype, "chartShadow", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
property({ type: String, attribute: 'chart-padding' })
|
|
229
|
+
], NileVariablePieChart.prototype, "chartPadding", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
property({ type: String, attribute: 'chart-min-height' })
|
|
232
|
+
], NileVariablePieChart.prototype, "chartMinHeight", void 0);
|
|
233
|
+
__decorate([
|
|
234
|
+
property({ type: String, attribute: 'loading-text' })
|
|
235
|
+
], NileVariablePieChart.prototype, "loadingText", void 0);
|
|
236
|
+
__decorate([
|
|
237
|
+
property({ type: String, attribute: 'loading-color' })
|
|
238
|
+
], NileVariablePieChart.prototype, "loadingColor", void 0);
|
|
239
|
+
__decorate([
|
|
240
|
+
property({ type: String, attribute: 'loading-font-size' })
|
|
241
|
+
], NileVariablePieChart.prototype, "loadingFontSize", void 0);
|
|
242
|
+
__decorate([
|
|
243
|
+
property({ type: String, attribute: 'loading-font-family' })
|
|
244
|
+
], NileVariablePieChart.prototype, "loadingFontFamily", void 0);
|
|
245
|
+
__decorate([
|
|
246
|
+
property({ type: String, attribute: 'loading-bg' })
|
|
247
|
+
], NileVariablePieChart.prototype, "loadingBg", void 0);
|
|
176
248
|
NileVariablePieChart = __decorate([
|
|
177
249
|
customElement('nile-variable-pie-chart')
|
|
178
250
|
], NileVariablePieChart);
|