@aquera/nile-visualization 1.7.0 → 1.8.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/dashboard-adapters.d.ts +1 -0
- package/dist/src/internal/dashboard-adapters.js +11 -1
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.css.js +2 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +1 -1
- package/dist/src/nile-area-chart/nile-area-chart.css.js +2 -0
- package/dist/src/nile-area-chart/nile-area-chart.js +1 -1
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.css.js +2 -0
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +1 -1
- package/dist/src/nile-area-range-chart/nile-area-range-chart.css.js +2 -0
- package/dist/src/nile-area-range-chart/nile-area-range-chart.js +1 -1
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.css.js +2 -0
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +1 -1
- package/dist/src/nile-bar-chart/nile-bar-chart.css.js +2 -0
- package/dist/src/nile-bar-chart/nile-bar-chart.js +1 -1
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.css.js +2 -0
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +1 -1
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.css.js +2 -0
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.js +1 -1
- package/dist/src/nile-bubble-chart/nile-bubble-chart.css.js +2 -0
- package/dist/src/nile-bubble-chart/nile-bubble-chart.js +1 -1
- package/dist/src/nile-chart/nile-chart.css.js +22 -0
- package/dist/src/nile-chart/nile-chart.js +45 -45
- package/dist/src/nile-cluster-chart/nile-cluster-chart.css.js +2 -0
- package/dist/src/nile-cluster-chart/nile-cluster-chart.js +1 -1
- package/dist/src/nile-column-chart/nile-column-chart.css.js +2 -0
- package/dist/src/nile-column-chart/nile-column-chart.js +1 -1
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.css.js +2 -0
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +1 -1
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.css.js +2 -0
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +1 -1
- package/dist/src/nile-column-range-chart/nile-column-range-chart.css.js +2 -0
- package/dist/src/nile-column-range-chart/nile-column-range-chart.js +1 -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 +15 -6
- package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.js +47 -6
- package/dist/src/nile-donut-chart/nile-donut-chart.css.js +2 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.js +1 -1
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.css.js +2 -0
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.js +1 -1
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.css.js +2 -0
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +1 -1
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.css.js +2 -0
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +1 -1
- package/dist/src/nile-euler-chart/nile-euler-chart.css.js +2 -0
- package/dist/src/nile-euler-chart/nile-euler-chart.js +1 -1
- package/dist/src/nile-fan-chart/nile-fan-chart.css.js +2 -0
- package/dist/src/nile-fan-chart/nile-fan-chart.js +1 -1
- package/dist/src/nile-flame-chart/nile-flame-chart.css.js +2 -0
- package/dist/src/nile-flame-chart/nile-flame-chart.js +1 -1
- package/dist/src/nile-funnel-chart/nile-funnel-chart.css.js +2 -0
- package/dist/src/nile-funnel-chart/nile-funnel-chart.js +1 -1
- package/dist/src/nile-gauge-chart/nile-gauge-chart.css.js +2 -0
- package/dist/src/nile-gauge-chart/nile-gauge-chart.js +1 -1
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.css.js +2 -0
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +1 -1
- package/dist/src/nile-histogram-chart/nile-histogram-chart.css.js +2 -0
- package/dist/src/nile-histogram-chart/nile-histogram-chart.js +1 -1
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.css.js +2 -0
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +1 -1
- package/dist/src/nile-kpi-chart/nile-kpi-chart.css.js +7 -0
- package/dist/src/nile-line-chart/nile-line-chart.css.js +2 -0
- package/dist/src/nile-line-chart/nile-line-chart.js +1 -1
- package/dist/src/nile-line-column-chart/nile-line-column-chart.css.js +2 -0
- package/dist/src/nile-line-column-chart/nile-line-column-chart.js +1 -1
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.css.js +2 -0
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +1 -1
- package/dist/src/nile-map-chart/nile-map-chart.css.js +2 -0
- package/dist/src/nile-map-chart/nile-map-chart.js +1 -1
- package/dist/src/nile-organization-chart/nile-organization-chart.css.js +2 -0
- package/dist/src/nile-organization-chart/nile-organization-chart.js +1 -1
- package/dist/src/nile-pie-chart/nile-pie-chart.css.js +2 -0
- package/dist/src/nile-pie-chart/nile-pie-chart.js +1 -1
- package/dist/src/nile-polygon-chart/nile-polygon-chart.css.js +2 -0
- package/dist/src/nile-polygon-chart/nile-polygon-chart.js +1 -1
- package/dist/src/nile-radar-chart/nile-radar-chart.css.js +2 -0
- package/dist/src/nile-radar-chart/nile-radar-chart.js +1 -1
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.css.js +2 -0
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +1 -1
- package/dist/src/nile-scatter-chart/nile-scatter-chart.css.js +2 -0
- package/dist/src/nile-scatter-chart/nile-scatter-chart.js +1 -1
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.css.js +2 -0
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.js +1 -1
- package/dist/src/nile-spline-chart/nile-spline-chart.css.js +2 -0
- package/dist/src/nile-spline-chart/nile-spline-chart.js +1 -1
- package/dist/src/nile-stacked-chart/nile-stacked-chart.css.js +2 -0
- package/dist/src/nile-stacked-chart/nile-stacked-chart.js +1 -1
- package/dist/src/nile-timeline-chart/nile-timeline-chart.css.js +2 -0
- package/dist/src/nile-timeline-chart/nile-timeline-chart.js +1 -1
- package/dist/src/nile-trendline-chart/nile-trendline-chart.css.js +2 -0
- package/dist/src/nile-trendline-chart/nile-trendline-chart.js +1 -1
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.css.js +2 -0
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +1 -1
- package/dist/src/nile-vector-chart/nile-vector-chart.css.js +2 -0
- package/dist/src/nile-vector-chart/nile-vector-chart.js +1 -1
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.css.js +2 -0
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +1 -1
- package/dist/src/nile-widget-viewer/nile-widget-viewer.d.ts +4 -0
- package/dist/src/nile-widget-viewer/nile-widget-viewer.js +18 -2
- package/dist/src/nile-xrange-chart/nile-xrange-chart.css.js +2 -0
- package/dist/src/nile-xrange-chart/nile-xrange-chart.js +1 -1
- package/package.json +1 -1
|
@@ -5,18 +5,22 @@ 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 of widgets. Supports
|
|
8
|
+
* Renders a full dashboard of widgets. Supports three layout variants:
|
|
9
9
|
*
|
|
10
10
|
* - `grid` (default): positions each widget using CSS Grid with `layout: { x, y, w, h }`.
|
|
11
11
|
* - `x` / `w` → `grid-column: (x+1) / span w`
|
|
12
12
|
* - `y` / `h` → `grid-row: (y+1) / span h`
|
|
13
13
|
* - `fluid`: positions widgets with Flexbox. `x` / `y` are ignored; widgets flow in
|
|
14
|
-
* declaration order and wrap as needed.
|
|
15
|
-
*
|
|
14
|
+
* declaration order and wrap as needed.
|
|
15
|
+
* - `absolute`: pixel-faithful replacement for angular-gridster2's output. Each
|
|
16
|
+
* widget is `position: absolute` with computed `left`/`top`/`width`/`height`.
|
|
17
|
+
* Horizontal values are `calc()` of `100%` so the layout reflows with the
|
|
18
|
+
* container (no JS measurement required). Spacing between cells matches CSS
|
|
19
|
+
* `gap` (no outer margin), so the layout is pixel-identical to the `grid` variant.
|
|
16
20
|
*
|
|
17
21
|
* @example
|
|
18
22
|
* ```html
|
|
19
|
-
* <nile-dashboard-viewer variant="
|
|
23
|
+
* <nile-dashboard-viewer variant="absolute" columns="12" cell-height="80" gap="8"></nile-dashboard-viewer>
|
|
20
24
|
* ```
|
|
21
25
|
*/
|
|
22
26
|
let NileDashboardViewer = class NileDashboardViewer extends NileElement {
|
|
@@ -24,7 +28,12 @@ let NileDashboardViewer = class NileDashboardViewer extends NileElement {
|
|
|
24
28
|
super(...arguments);
|
|
25
29
|
/** Dashboard configuration containing all widget configs. */
|
|
26
30
|
this.config = null;
|
|
27
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Layout variant.
|
|
33
|
+
* - `grid` uses CSS Grid with x/y/w/h positioning (default).
|
|
34
|
+
* - `fluid` flows widgets with Flexbox.
|
|
35
|
+
* - `absolute` mirrors angular-gridster2 (position:absolute with calc widths).
|
|
36
|
+
*/
|
|
28
37
|
this.variant = 'grid';
|
|
29
38
|
/** Total number of grid columns. Default: 12. */
|
|
30
39
|
this.columns = 12;
|
|
@@ -49,7 +58,39 @@ let NileDashboardViewer = class NileDashboardViewer extends NileElement {
|
|
|
49
58
|
style="
|
|
50
59
|
flex: 1 1 ${basis};
|
|
51
60
|
max-width: ${widthPct}%;
|
|
52
|
-
|
|
61
|
+
height: ${h * this.cellHeight}px;
|
|
62
|
+
"
|
|
63
|
+
>
|
|
64
|
+
<nile-widget-viewer .config=${widget}></nile-widget-viewer>
|
|
65
|
+
</div>
|
|
66
|
+
`;
|
|
67
|
+
})}
|
|
68
|
+
</div>
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
if (this.variant === 'absolute') {
|
|
72
|
+
const C = this.columns;
|
|
73
|
+
const rH = this.cellHeight;
|
|
74
|
+
const m = this.gap;
|
|
75
|
+
const maxRow = this.config.widgets.reduce((acc, widget) => Math.max(acc, widget.layout.y + widget.layout.h), 0);
|
|
76
|
+
const containerH = maxRow > 0 ? maxRow * rH + (maxRow - 1) * m : 0;
|
|
77
|
+
const colExpr = `(100% - ${(C - 1) * m}px) / ${C}`;
|
|
78
|
+
return html `
|
|
79
|
+
<div class="dashboard-absolute" style="height: ${containerH}px;">
|
|
80
|
+
${this.config.widgets.map((widget) => {
|
|
81
|
+
const { x, y, w, h } = widget.layout;
|
|
82
|
+
const leftStyle = `calc(${colExpr} * ${x} + ${x * m}px)`;
|
|
83
|
+
const widthStyle = `calc(${colExpr} * ${w} + ${(w - 1) * m}px)`;
|
|
84
|
+
const topPx = y * (rH + m);
|
|
85
|
+
const heightPx = h * rH + (h - 1) * m;
|
|
86
|
+
return html `
|
|
87
|
+
<div
|
|
88
|
+
class="dashboard-cell dashboard-cell--absolute"
|
|
89
|
+
style="
|
|
90
|
+
left: ${leftStyle};
|
|
91
|
+
top: ${topPx}px;
|
|
92
|
+
width: ${widthStyle};
|
|
93
|
+
height: ${heightPx}px;
|
|
53
94
|
"
|
|
54
95
|
>
|
|
55
96
|
<nile-widget-viewer .config=${widget}></nile-widget-viewer>
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -161,7 +161,7 @@ let NileDonutChart = class NileDonutChart extends NileElement {
|
|
|
161
161
|
buildOptions() {
|
|
162
162
|
const self = this;
|
|
163
163
|
return deepMerge({
|
|
164
|
-
chart: { type: 'pie', height: this.height },
|
|
164
|
+
chart: { type: 'pie', ...(this.height ? { height: this.height } : {}) },
|
|
165
165
|
title: { text: this.chartTitle || undefined },
|
|
166
166
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
167
167
|
tooltip: { pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -130,7 +130,7 @@ let NileDumbbellChart = class NileDumbbellChart extends NileElement {
|
|
|
130
130
|
return deepMerge({
|
|
131
131
|
chart: {
|
|
132
132
|
type: 'dumbbell',
|
|
133
|
-
height: this.height,
|
|
133
|
+
...(this.height ? { height: this.height } : {}),
|
|
134
134
|
inverted: this.horizontal,
|
|
135
135
|
},
|
|
136
136
|
title: { text: this.chartTitle || undefined },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -126,7 +126,7 @@ let NileDumbbellLowerChart = class NileDumbbellLowerChart extends NileElement {
|
|
|
126
126
|
return deepMerge({
|
|
127
127
|
chart: {
|
|
128
128
|
type: 'dumbbell',
|
|
129
|
-
height: this.height,
|
|
129
|
+
...(this.height ? { height: this.height } : {}),
|
|
130
130
|
inverted: this.horizontal,
|
|
131
131
|
},
|
|
132
132
|
title: { text: this.chartTitle || undefined },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -126,7 +126,7 @@ let NileDumbbellUpperChart = class NileDumbbellUpperChart extends NileElement {
|
|
|
126
126
|
return deepMerge({
|
|
127
127
|
chart: {
|
|
128
128
|
type: 'dumbbell',
|
|
129
|
-
height: this.height,
|
|
129
|
+
...(this.height ? { height: this.height } : {}),
|
|
130
130
|
inverted: this.horizontal,
|
|
131
131
|
},
|
|
132
132
|
title: { text: this.chartTitle || undefined },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -105,7 +105,7 @@ let NileEulerChart = class NileEulerChart extends NileElement {
|
|
|
105
105
|
buildOptions() {
|
|
106
106
|
const self = this;
|
|
107
107
|
return deepMerge({
|
|
108
|
-
chart: { height: this.height },
|
|
108
|
+
chart: { ...(this.height ? { height: this.height } : {}) },
|
|
109
109
|
title: { text: this.chartTitle || undefined },
|
|
110
110
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
111
111
|
tooltip: { headerFormat: '', pointFormat: '{point.name}: <b>{point.value}</b>' },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -174,7 +174,7 @@ let NileFanChart = class NileFanChart extends NileElement {
|
|
|
174
174
|
}));
|
|
175
175
|
return deepMerge({
|
|
176
176
|
chart: {
|
|
177
|
-
height: this.height,
|
|
177
|
+
...(this.height ? { height: this.height } : {}),
|
|
178
178
|
zoomType: 'x',
|
|
179
179
|
},
|
|
180
180
|
title: { text: this.chartTitle || undefined },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -186,7 +186,7 @@ let NileFlameChart = class NileFlameChart extends NileElement {
|
|
|
186
186
|
const titleText = this.chartTitle ||
|
|
187
187
|
(isSunburst ? 'Sunburst' : this.layout === 'icicle' ? 'Icicle chart' : 'Flame chart');
|
|
188
188
|
return deepMerge({
|
|
189
|
-
chart: { inverted: !isSunburst, height: this.height },
|
|
189
|
+
chart: { inverted: !isSunburst, ...(this.height ? { height: this.height } : {}) },
|
|
190
190
|
title: { text: titleText, align: 'left' },
|
|
191
191
|
subtitle: { text: this.chartSubtitle || undefined, align: 'left' },
|
|
192
192
|
legend: { enabled: false },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -120,7 +120,7 @@ let NileFunnelChart = class NileFunnelChart extends NileElement {
|
|
|
120
120
|
buildOptions() {
|
|
121
121
|
const self = this;
|
|
122
122
|
return deepMerge({
|
|
123
|
-
chart: { type: 'funnel', height: this.height },
|
|
123
|
+
chart: { type: 'funnel', ...(this.height ? { height: this.height } : {}) },
|
|
124
124
|
title: { text: this.chartTitle || undefined },
|
|
125
125
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
126
126
|
tooltip: {
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -152,7 +152,7 @@ let NileGaugeChart = class NileGaugeChart extends NileElement {
|
|
|
152
152
|
}
|
|
153
153
|
buildOptions() {
|
|
154
154
|
return deepMerge({
|
|
155
|
-
chart: { type: 'gauge', height: this.height },
|
|
155
|
+
chart: { type: 'gauge', ...(this.height ? { height: this.height } : {}) },
|
|
156
156
|
title: { text: this.chartTitle || undefined },
|
|
157
157
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
158
158
|
pane: {
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -153,7 +153,7 @@ let NileHeatmapChart = class NileHeatmapChart extends NileElement {
|
|
|
153
153
|
const cMax = this.colorMax ?? ext.max;
|
|
154
154
|
const seriesData = this.data.map(c => [c.x, c.y, c.value]);
|
|
155
155
|
return deepMerge({
|
|
156
|
-
chart: { type: 'heatmap', height: this.height },
|
|
156
|
+
chart: { type: 'heatmap', ...(this.height ? { height: this.height } : {}) },
|
|
157
157
|
title: { text: this.chartTitle || undefined },
|
|
158
158
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
159
159
|
xAxis: { categories: this.xCategories, title: { text: undefined } },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -155,7 +155,7 @@ let NileHistogramChart = class NileHistogramChart extends NileElement {
|
|
|
155
155
|
const sorted = [...this.data].sort((a, b) => a - b);
|
|
156
156
|
const scatterData = sorted.map(x => [x, 0]);
|
|
157
157
|
return deepMerge({
|
|
158
|
-
chart: { height: this.height },
|
|
158
|
+
chart: { ...(this.height ? { height: this.height } : {}) },
|
|
159
159
|
title: { text: this.chartTitle || undefined },
|
|
160
160
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
161
161
|
legend: { enabled: this.showLegend },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -117,7 +117,7 @@ let NileInvertedAreaChart = class NileInvertedAreaChart extends NileElement {
|
|
|
117
117
|
buildOptions() {
|
|
118
118
|
const self = this;
|
|
119
119
|
return deepMerge({
|
|
120
|
-
chart: { type: 'area', inverted: true, height: this.height },
|
|
120
|
+
chart: { type: 'area', inverted: true, ...(this.height ? { height: this.height } : {}) },
|
|
121
121
|
title: { text: this.chartTitle || undefined },
|
|
122
122
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
123
123
|
xAxis: { categories: this.categories },
|
|
@@ -67,6 +67,13 @@ export const styles = css `
|
|
|
67
67
|
display: none;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/* Fit-to-container mode (set by nile-widget-viewer) — fills the allotted
|
|
71
|
+
cell so the KPI card never overflows and overlaps neighbors. The .kpi
|
|
72
|
+
element is already flex:1, so it stretches with the host. */
|
|
73
|
+
:host([fit]) {
|
|
74
|
+
height: 100%;
|
|
75
|
+
}
|
|
76
|
+
|
|
70
77
|
/* Card / gauge chrome on the host when used alone (inside nile-chart, embed-in-nile-chart skips this). */
|
|
71
78
|
:host([variant='card']:not([embed-in-nile-chart])),
|
|
72
79
|
:host([variant='gauge']:not([embed-in-nile-chart])) {
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -150,7 +150,7 @@ let NileLineChart = class NileLineChart extends NileElement {
|
|
|
150
150
|
buildOptions() {
|
|
151
151
|
const self = this;
|
|
152
152
|
return deepMerge({
|
|
153
|
-
chart: { type: 'line', height: this.height },
|
|
153
|
+
chart: { type: 'line', ...(this.height ? { height: this.height } : {}) },
|
|
154
154
|
title: { text: this.chartTitle || undefined },
|
|
155
155
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
156
156
|
xAxis: { categories: this.categories },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -124,7 +124,7 @@ let NileLineColumnChart = class NileLineColumnChart extends NileElement {
|
|
|
124
124
|
const col = this.columnSeries;
|
|
125
125
|
const line = this.lineSeries;
|
|
126
126
|
return deepMerge({
|
|
127
|
-
chart: { height: this.height },
|
|
127
|
+
chart: { ...(this.height ? { height: this.height } : {}) },
|
|
128
128
|
title: { text: this.chartTitle || undefined },
|
|
129
129
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
130
130
|
xAxis: { categories: this.categories, crosshair: true },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -127,7 +127,7 @@ let NileLollipopChart = class NileLollipopChart extends NileElement {
|
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
return deepMerge({
|
|
130
|
-
chart: { height: this.height },
|
|
130
|
+
chart: { ...(this.height ? { height: this.height } : {}) },
|
|
131
131
|
title: { text: this.chartTitle || undefined },
|
|
132
132
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
133
133
|
xAxis: { categories: this.categories },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -206,7 +206,7 @@ let NileMapChart = class NileMapChart extends NileElement {
|
|
|
206
206
|
const self = this;
|
|
207
207
|
const defaults = {
|
|
208
208
|
chart: {
|
|
209
|
-
height: this.height,
|
|
209
|
+
...(this.height ? { height: this.height } : {}),
|
|
210
210
|
},
|
|
211
211
|
title: {
|
|
212
212
|
text: this.chartTitle || undefined,
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -139,7 +139,7 @@ let NileOrganizationChart = class NileOrganizationChart extends NileElement {
|
|
|
139
139
|
});
|
|
140
140
|
return deepMerge({
|
|
141
141
|
chart: {
|
|
142
|
-
height: this.height,
|
|
142
|
+
...(this.height ? { height: this.height } : {}),
|
|
143
143
|
inverted: this.inverted,
|
|
144
144
|
},
|
|
145
145
|
title: { text: this.chartTitle || undefined },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -116,7 +116,7 @@ let NilePolygonChart = class NilePolygonChart extends NileElement {
|
|
|
116
116
|
buildOptions() {
|
|
117
117
|
const self = this;
|
|
118
118
|
return deepMerge({
|
|
119
|
-
chart: { height: this.height },
|
|
119
|
+
chart: { ...(this.height ? { height: this.height } : {}) },
|
|
120
120
|
title: { text: this.chartTitle || undefined },
|
|
121
121
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
122
122
|
xAxis: { title: { text: this.xAxisTitle || undefined } },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -151,7 +151,7 @@ let NileRadarChart = class NileRadarChart extends NileElement {
|
|
|
151
151
|
const self = this;
|
|
152
152
|
const seriesType = this.showArea ? 'area' : 'line';
|
|
153
153
|
return deepMerge({
|
|
154
|
-
chart: { polar: true, type: seriesType, height: this.height },
|
|
154
|
+
chart: { polar: true, type: seriesType, ...(this.height ? { height: this.height } : {}) },
|
|
155
155
|
title: { text: this.chartTitle || undefined },
|
|
156
156
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
157
157
|
pane: { size: '80%' },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|