@aquera/nile-visualization 2.9.28 → 2.9.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +2 -0
- package/dist/src/internal/chart-events.d.ts +92 -0
- package/dist/src/internal/chart-events.js +291 -0
- package/dist/src/internal/chart-runtime.d.ts +41 -0
- package/dist/src/internal/chart-runtime.js +30 -0
- package/dist/src/internal/highcharts-provider.js +2 -0
- package/dist/src/internal/nile-chart-base.d.ts +43 -0
- package/dist/src/internal/nile-chart-base.js +67 -0
- package/dist/src/internal/resolve-widget-kind.d.ts +10 -0
- package/dist/src/internal/resolve-widget-kind.js +16 -0
- package/dist/src/internal/responsive-defaults.d.ts +32 -0
- package/dist/src/internal/responsive-defaults.js +255 -0
- package/dist/src/internal/types/highcharts-passthrough.type.d.ts +80 -0
- package/dist/src/internal/types/highcharts-passthrough.type.js +24 -0
- package/dist/src/internal/types/index.d.ts +2 -0
- package/dist/src/internal/types/index.js +1 -1
- package/dist/src/internal/types/widget-config.type.d.ts +14 -3
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.d.ts +2 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +8 -1
- package/dist/src/nile-area-chart/nile-area-chart.d.ts +1 -0
- package/dist/src/nile-area-chart/nile-area-chart.js +7 -1
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.d.ts +1 -0
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +7 -1
- package/dist/src/nile-area-range-chart/nile-area-range-chart.d.ts +1 -0
- package/dist/src/nile-area-range-chart/nile-area-range-chart.js +7 -1
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.d.ts +1 -0
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +7 -1
- package/dist/src/nile-bar-chart/nile-bar-chart.d.ts +2 -0
- package/dist/src/nile-bar-chart/nile-bar-chart.js +8 -1
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.d.ts +1 -0
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +7 -1
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.d.ts +1 -0
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.js +7 -1
- package/dist/src/nile-bubble-chart/nile-bubble-chart.d.ts +1 -0
- package/dist/src/nile-bubble-chart/nile-bubble-chart.js +7 -1
- package/dist/src/nile-chart/nile-chart-config.d.ts +2 -2
- package/dist/src/nile-chart/nile-chart.css.js +3 -1
- package/dist/src/nile-chart/nile-chart.d.ts +59 -0
- package/dist/src/nile-chart/nile-chart.js +176 -3
- package/dist/src/nile-cluster-chart/nile-cluster-chart.d.ts +1 -0
- package/dist/src/nile-cluster-chart/nile-cluster-chart.js +7 -1
- package/dist/src/nile-column-chart/nile-column-chart.d.ts +1 -0
- package/dist/src/nile-column-chart/nile-column-chart.js +7 -1
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.d.ts +1 -0
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +8 -1
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.d.ts +1 -0
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +7 -1
- package/dist/src/nile-column-range-chart/nile-column-range-chart.d.ts +1 -0
- package/dist/src/nile-column-range-chart/nile-column-range-chart.js +7 -1
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.css.js +24 -8
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.d.ts +111 -0
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.js +188 -6
- package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +1 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.js +7 -1
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.d.ts +1 -0
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.js +7 -1
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.d.ts +1 -0
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +7 -1
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.d.ts +1 -0
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +7 -1
- package/dist/src/nile-euler-chart/nile-euler-chart.d.ts +1 -0
- package/dist/src/nile-euler-chart/nile-euler-chart.js +7 -1
- package/dist/src/nile-fan-chart/nile-fan-chart.d.ts +1 -0
- package/dist/src/nile-fan-chart/nile-fan-chart.js +7 -1
- package/dist/src/nile-flame-chart/nile-flame-chart.d.ts +1 -0
- package/dist/src/nile-flame-chart/nile-flame-chart.js +7 -1
- package/dist/src/nile-funnel-chart/nile-funnel-chart.d.ts +1 -0
- package/dist/src/nile-funnel-chart/nile-funnel-chart.js +7 -1
- package/dist/src/nile-gauge-chart/nile-gauge-chart.d.ts +20 -0
- package/dist/src/nile-gauge-chart/nile-gauge-chart.js +80 -4
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +1 -0
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +7 -1
- package/dist/src/nile-histogram-chart/nile-histogram-chart.d.ts +1 -0
- package/dist/src/nile-histogram-chart/nile-histogram-chart.js +7 -1
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.d.ts +1 -0
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +7 -1
- package/dist/src/nile-line-chart/nile-line-chart.d.ts +1 -0
- package/dist/src/nile-line-chart/nile-line-chart.js +7 -1
- package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +1 -0
- package/dist/src/nile-line-column-chart/nile-line-column-chart.js +7 -1
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.d.ts +1 -0
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +7 -1
- package/dist/src/nile-map-chart/nile-map-chart.d.ts +23 -3
- package/dist/src/nile-map-chart/nile-map-chart.js +52 -12
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.css.js +13 -1
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.d.ts +1 -0
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.js +48 -4
- package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +1 -0
- package/dist/src/nile-organization-chart/nile-organization-chart.js +7 -1
- package/dist/src/nile-pie-chart/nile-pie-chart.d.ts +2 -0
- package/dist/src/nile-pie-chart/nile-pie-chart.js +8 -1
- package/dist/src/nile-polygon-chart/nile-polygon-chart.d.ts +1 -0
- package/dist/src/nile-polygon-chart/nile-polygon-chart.js +7 -1
- package/dist/src/nile-radar-chart/nile-radar-chart.d.ts +1 -0
- package/dist/src/nile-radar-chart/nile-radar-chart.js +7 -1
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.d.ts +1 -0
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +7 -1
- package/dist/src/nile-scatter-chart/nile-scatter-chart.d.ts +1 -0
- package/dist/src/nile-scatter-chart/nile-scatter-chart.js +7 -1
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.d.ts +1 -0
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.js +7 -1
- package/dist/src/nile-spline-chart/nile-spline-chart.d.ts +1 -0
- package/dist/src/nile-spline-chart/nile-spline-chart.js +7 -1
- package/dist/src/nile-stacked-chart/nile-stacked-chart.d.ts +1 -0
- package/dist/src/nile-stacked-chart/nile-stacked-chart.js +7 -1
- package/dist/src/nile-timeline-chart/nile-timeline-chart.d.ts +1 -0
- package/dist/src/nile-timeline-chart/nile-timeline-chart.js +7 -1
- package/dist/src/nile-trendline-chart/nile-trendline-chart.d.ts +2 -0
- package/dist/src/nile-trendline-chart/nile-trendline-chart.js +8 -1
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.d.ts +1 -0
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +7 -1
- package/dist/src/nile-vector-chart/nile-vector-chart.d.ts +1 -0
- package/dist/src/nile-vector-chart/nile-vector-chart.js +7 -1
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.d.ts +1 -0
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +7 -1
- package/dist/src/nile-widget-viewer/nile-widget-viewer.js +6 -6
- package/dist/src/nile-xrange-chart/nile-xrange-chart.d.ts +1 -0
- package/dist/src/nile-xrange-chart/nile-xrange-chart.js +7 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { GridStack } from 'gridstack';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { styles } from './nile-dashboard-builder.css.js';
|
|
7
7
|
import { gridstackCss } from './gridstack-css.js';
|
|
8
|
+
import { resolveWidgetKind } from '../internal/resolve-widget-kind.js';
|
|
8
9
|
import '../nile-widget-viewer/index.js';
|
|
9
10
|
let NileDashboardBuilder = class NileDashboardBuilder extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -17,16 +18,124 @@ let NileDashboardBuilder = class NileDashboardBuilder extends NileElement {
|
|
|
17
18
|
this.cellHeight = 72;
|
|
18
19
|
/** Gap between cells in pixels. Default: 8. */
|
|
19
20
|
this.gap = 8;
|
|
21
|
+
/**
|
|
22
|
+
* Minimum number of rows the grid keeps, so an empty or sparsely-filled
|
|
23
|
+
* dashboard still presents a drop target instead of collapsing. Set `0` to
|
|
24
|
+
* let the grid shrink to its content. Default: 4.
|
|
25
|
+
*/
|
|
20
26
|
this.minRows = 4;
|
|
21
27
|
/** Minimum widget width in columns (gridster `minItemCols`). Default: 2. */
|
|
22
28
|
this.minW = 2;
|
|
23
29
|
/** Minimum widget height in rows (gridster `minItemRows`). Default: 2. */
|
|
24
30
|
this.minH = 2;
|
|
31
|
+
/**
|
|
32
|
+
* Comma-separated list of edges and corners a widget can be resized from,
|
|
33
|
+
* passed straight to gridstack's `resizable.handles`.
|
|
34
|
+
*
|
|
35
|
+
* The default is seven of the eight positions: `ne` is left out because the
|
|
36
|
+
* remove control (✕) sits in that corner and would compete with the handle
|
|
37
|
+
* for the same few pixels. Add it back if you set `remove-visibility` such
|
|
38
|
+
* that the corner is free.
|
|
39
|
+
*
|
|
40
|
+
* Default: `'n,e,s,w,se,sw,nw'`.
|
|
41
|
+
*/
|
|
25
42
|
this.resizeHandles = 'n,e,s,w,se,sw,nw';
|
|
43
|
+
/**
|
|
44
|
+
* Whether widgets stay where they are dropped rather than being pulled up to
|
|
45
|
+
* close vertical gaps (gridstack's float mode). `false` compacts the grid
|
|
46
|
+
* upward after every change. Default: `true`.
|
|
47
|
+
*/
|
|
26
48
|
this.float = true;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the dashboard can be modified. `false` makes the grid static — no
|
|
51
|
+
* dragging or resizing — and hides every remove control regardless of
|
|
52
|
+
* `remove-visibility`. Reflected, so it can be styled via `:host([editable])`.
|
|
53
|
+
* Default: `true`.
|
|
54
|
+
*/
|
|
27
55
|
this.editable = true;
|
|
56
|
+
/**
|
|
57
|
+
* Whether to paint the cell-boundary overlay behind the widgets, which makes
|
|
58
|
+
* the drop targets legible while arranging. Reflected as the `gridlines`
|
|
59
|
+
* attribute. Default: `true`.
|
|
60
|
+
*/
|
|
28
61
|
this.gridLines = true;
|
|
62
|
+
/**
|
|
63
|
+
* Overrides the grid-line color with any CSS color. Empty means fall back to
|
|
64
|
+
* the `--nile-dashboard-builder-grid-line` custom property, and then to
|
|
65
|
+
* `--ng-color-blue-200`. Only has a visible effect while `gridLines` is on.
|
|
66
|
+
* Default: `''`.
|
|
67
|
+
*/
|
|
29
68
|
this.gridLineColor = '';
|
|
69
|
+
/**
|
|
70
|
+
* When the per-widget remove control (✕) is shown.
|
|
71
|
+
*
|
|
72
|
+
* - `'hover'` (default) — revealed when the pointer enters the widget, keeping
|
|
73
|
+
* the tiles clean at rest. It also appears on keyboard focus, and stays
|
|
74
|
+
* permanently visible on touch devices, which cannot hover.
|
|
75
|
+
* - `'always'` — always visible.
|
|
76
|
+
*
|
|
77
|
+
* Orthogonal to `editable`: a non-editable builder never shows the control,
|
|
78
|
+
* whatever this is set to.
|
|
79
|
+
*/
|
|
80
|
+
this.removeVisibility = 'hover';
|
|
81
|
+
/**
|
|
82
|
+
* Maximum number of rows the grid will accept, capping how tall a dashboard
|
|
83
|
+
* can grow. `0` means unlimited, which is the default — widgets can be placed
|
|
84
|
+
* or dragged arbitrarily far down. Default: 0.
|
|
85
|
+
*/
|
|
86
|
+
this.maxRow = 0;
|
|
87
|
+
/**
|
|
88
|
+
* Responsive column behaviour: pick the column count from the available width
|
|
89
|
+
* instead of pinning it to `columns`. Either give a `columnWidth` to target,
|
|
90
|
+
* or explicit `breakpoints`.
|
|
91
|
+
*
|
|
92
|
+
* Note that gridstack requires matching CSS for column counts other than the
|
|
93
|
+
* default, so this needs styling support to be useful.
|
|
94
|
+
*
|
|
95
|
+
* Supplying only a `columnWidth` is safe here — the missing `breakpoints`
|
|
96
|
+
* array is filled in before it reaches gridstack, which would otherwise
|
|
97
|
+
* throw on that combination.
|
|
98
|
+
*
|
|
99
|
+
* Applied at initialization only — changing it later has no effect.
|
|
100
|
+
*/
|
|
101
|
+
this.columnOpts = null;
|
|
102
|
+
/**
|
|
103
|
+
* Only render widgets once they scroll into view. Worth turning on for
|
|
104
|
+
* dashboards with many widgets, since every widget otherwise mounts a live
|
|
105
|
+
* chart up front.
|
|
106
|
+
*
|
|
107
|
+
* Applied at initialization only — changing it later has no effect.
|
|
108
|
+
* Default: `false`.
|
|
109
|
+
*/
|
|
110
|
+
this.lazyLoad = false;
|
|
111
|
+
/**
|
|
112
|
+
* Stops widgets animating to their new position when the layout reflows.
|
|
113
|
+
*
|
|
114
|
+
* Named for what it turns off rather than on, because `animate` is already
|
|
115
|
+
* `HTMLElement.prototype.animate` and cannot be shadowed by a property.
|
|
116
|
+
* Default: `false`.
|
|
117
|
+
*/
|
|
118
|
+
this.disableAnimation = false;
|
|
119
|
+
/**
|
|
120
|
+
* Prevents widgets from being dragged while still allowing resize. Finer
|
|
121
|
+
* grained than `editable`, which disables both at once; when `editable` is
|
|
122
|
+
* `false` nothing is draggable regardless of this. Default: `false`.
|
|
123
|
+
*/
|
|
124
|
+
this.disableDrag = false;
|
|
125
|
+
/**
|
|
126
|
+
* Prevents widgets from being resized while still allowing drag. Finer
|
|
127
|
+
* grained than `editable`, which disables both at once; when `editable` is
|
|
128
|
+
* `false` nothing is resizable regardless of this. Default: `false`.
|
|
129
|
+
*/
|
|
130
|
+
this.disableResize = false;
|
|
131
|
+
/**
|
|
132
|
+
* Keeps resize handles permanently visible rather than revealing them on
|
|
133
|
+
* hover. Useful on touch devices, which cannot hover.
|
|
134
|
+
*
|
|
135
|
+
* Applied at initialization only — changing it later has no effect.
|
|
136
|
+
* Default: `false`.
|
|
137
|
+
*/
|
|
138
|
+
this.alwaysShowResizeHandle = false;
|
|
30
139
|
/** id -> the `.grid-stack-item` element hosting that widget. */
|
|
31
140
|
this.itemEls = new Map();
|
|
32
141
|
/** id -> the latest widget config (used to rebuild config on layout change). */
|
|
@@ -47,8 +156,27 @@ let NileDashboardBuilder = class NileDashboardBuilder extends NileElement {
|
|
|
47
156
|
float: this.float,
|
|
48
157
|
staticGrid: !this.editable,
|
|
49
158
|
minRow: this.minRows || undefined,
|
|
50
|
-
//
|
|
51
|
-
|
|
159
|
+
// 0 means "no cap" to us; gridstack wants the key absent for that.
|
|
160
|
+
maxRow: this.maxRow || undefined,
|
|
161
|
+
lazyLoad: this.lazyLoad,
|
|
162
|
+
animate: !this.disableAnimation,
|
|
163
|
+
disableDrag: this.disableDrag,
|
|
164
|
+
disableResize: this.disableResize,
|
|
165
|
+
alwaysShowResizeHandle: this.alwaysShowResizeHandle,
|
|
166
|
+
// Only forwarded when set — passing `columnOpts: undefined` would
|
|
167
|
+
// override gridstack's own default handling.
|
|
168
|
+
//
|
|
169
|
+
// `breakpoints` is always supplied, even empty: gridstack 13.0.0 tests
|
|
170
|
+
// `!columnWidth && !breakpoints?.length` but then reads
|
|
171
|
+
// `breakpoints.length` unguarded in the else branch, so a columnOpts
|
|
172
|
+
// carrying only a columnWidth — which its own docs call valid — throws
|
|
173
|
+
// inside the GridStack constructor.
|
|
174
|
+
...(this.columnOpts
|
|
175
|
+
? { columnOpts: { breakpoints: [], ...this.columnOpts } }
|
|
176
|
+
: {}),
|
|
177
|
+
// Resize handles (configurable via `resize-handles`); the default covers
|
|
178
|
+
// seven of the eight positions, omitting `ne` where the remove control
|
|
179
|
+
// sits. See the `resizeHandles` docs.
|
|
52
180
|
resizable: { handles: this.resizeHandles },
|
|
53
181
|
}, this.gridEl);
|
|
54
182
|
this.grid.on('change', () => {
|
|
@@ -71,6 +199,22 @@ let NileDashboardBuilder = class NileDashboardBuilder extends NileElement {
|
|
|
71
199
|
this.grid.float(this.float);
|
|
72
200
|
if (changed.has('editable'))
|
|
73
201
|
this.grid.setStatic(!this.editable);
|
|
202
|
+
if (changed.has('disableAnimation'))
|
|
203
|
+
this.grid.setAnimation(!this.disableAnimation);
|
|
204
|
+
if (changed.has('maxRow')) {
|
|
205
|
+
// gridstack exposes no setter for this, and the engine keeps its own
|
|
206
|
+
// copy, so both have to be updated to take effect live.
|
|
207
|
+
this.grid.opts.maxRow = this.maxRow || undefined;
|
|
208
|
+
this.grid.engine.maxRow = this.maxRow || 0;
|
|
209
|
+
}
|
|
210
|
+
// These run after `editable` on purpose: setStatic() re-enables move and
|
|
211
|
+
// resize wholesale, so it would otherwise clobber the finer-grained flags.
|
|
212
|
+
if (changed.has('disableDrag') || changed.has('editable')) {
|
|
213
|
+
this.grid.enableMove(this.editable && !this.disableDrag);
|
|
214
|
+
}
|
|
215
|
+
if (changed.has('disableResize') || changed.has('editable')) {
|
|
216
|
+
this.grid.enableResize(this.editable && !this.disableResize);
|
|
217
|
+
}
|
|
74
218
|
}
|
|
75
219
|
if (changed.has('gridLineColor')) {
|
|
76
220
|
if (this.gridLineColor) {
|
|
@@ -177,8 +321,14 @@ let NileDashboardBuilder = class NileDashboardBuilder extends NileElement {
|
|
|
177
321
|
const remove = document.createElement('button');
|
|
178
322
|
remove.className = 'nile-builder-remove';
|
|
179
323
|
remove.type = 'button';
|
|
180
|
-
remove.
|
|
324
|
+
remove.setAttribute('aria-label', 'Remove widget');
|
|
181
325
|
remove.title = 'Remove widget';
|
|
326
|
+
// The ✕ is the nile-glyph "close" icon (registered by the host app, as with
|
|
327
|
+
// the other nile-glyph usages in this package).
|
|
328
|
+
const removeIcon = document.createElement('nile-glyph');
|
|
329
|
+
removeIcon.setAttribute('name', 'close');
|
|
330
|
+
removeIcon.setAttribute('size', '16');
|
|
331
|
+
remove.appendChild(removeIcon);
|
|
182
332
|
remove.addEventListener('click', (e) => {
|
|
183
333
|
e.stopPropagation();
|
|
184
334
|
this.requestRemoveWidget(widget.id);
|
|
@@ -191,16 +341,16 @@ let NileDashboardBuilder = class NileDashboardBuilder extends NileElement {
|
|
|
191
341
|
const widgets = this.normalizeWidgets(this.config);
|
|
192
342
|
const maxY = widgets.reduce((m, w) => Math.max(m, w.layout.y + w.layout.h), 0);
|
|
193
343
|
const id = `nile-w-${++this.idCounter}`;
|
|
344
|
+
// The widget kind is carried by `nileConfig.chart.type` and inferred by the
|
|
345
|
+
// viewer (see `resolveWidgetKind`), so no top-level `type` is written here.
|
|
194
346
|
const widget = type === 'kpi'
|
|
195
347
|
? {
|
|
196
348
|
id,
|
|
197
|
-
type: 'kpi',
|
|
198
349
|
layout: { x: 0, y: maxY, w: 3, h: 2 },
|
|
199
350
|
nileConfig: { chart: { type: 'kpi', variant: 'card', label: 'New KPI', value: '0' } },
|
|
200
351
|
}
|
|
201
352
|
: {
|
|
202
353
|
id,
|
|
203
|
-
type: 'chart',
|
|
204
354
|
layout: { x: 0, y: maxY, w: 6, h: 3 },
|
|
205
355
|
nileConfig: {
|
|
206
356
|
chart: {
|
|
@@ -264,7 +414,15 @@ let NileDashboardBuilder = class NileDashboardBuilder extends NileElement {
|
|
|
264
414
|
signature(widgets) {
|
|
265
415
|
return JSON.stringify([...widgets]
|
|
266
416
|
.sort((a, b) => a.id.localeCompare(b.id))
|
|
267
|
-
.map((w) => [
|
|
417
|
+
.map((w) => [
|
|
418
|
+
w.id,
|
|
419
|
+
resolveWidgetKind(w),
|
|
420
|
+
w.layout.x,
|
|
421
|
+
w.layout.y,
|
|
422
|
+
w.layout.w,
|
|
423
|
+
w.layout.h,
|
|
424
|
+
w.nileConfig,
|
|
425
|
+
]));
|
|
268
426
|
}
|
|
269
427
|
render() {
|
|
270
428
|
return html `<div class="grid-stack"></div>`;
|
|
@@ -307,6 +465,30 @@ __decorate([
|
|
|
307
465
|
__decorate([
|
|
308
466
|
property({ attribute: 'grid-line-color' })
|
|
309
467
|
], NileDashboardBuilder.prototype, "gridLineColor", void 0);
|
|
468
|
+
__decorate([
|
|
469
|
+
property({ type: String, reflect: true, attribute: 'remove-visibility' })
|
|
470
|
+
], NileDashboardBuilder.prototype, "removeVisibility", void 0);
|
|
471
|
+
__decorate([
|
|
472
|
+
property({ type: Number, attribute: 'max-row' })
|
|
473
|
+
], NileDashboardBuilder.prototype, "maxRow", void 0);
|
|
474
|
+
__decorate([
|
|
475
|
+
property({ type: Object, attribute: 'column-opts' })
|
|
476
|
+
], NileDashboardBuilder.prototype, "columnOpts", void 0);
|
|
477
|
+
__decorate([
|
|
478
|
+
property({ type: Boolean, attribute: 'lazy-load' })
|
|
479
|
+
], NileDashboardBuilder.prototype, "lazyLoad", void 0);
|
|
480
|
+
__decorate([
|
|
481
|
+
property({ type: Boolean, attribute: 'disable-animation' })
|
|
482
|
+
], NileDashboardBuilder.prototype, "disableAnimation", void 0);
|
|
483
|
+
__decorate([
|
|
484
|
+
property({ type: Boolean, attribute: 'disable-drag' })
|
|
485
|
+
], NileDashboardBuilder.prototype, "disableDrag", void 0);
|
|
486
|
+
__decorate([
|
|
487
|
+
property({ type: Boolean, attribute: 'disable-resize' })
|
|
488
|
+
], NileDashboardBuilder.prototype, "disableResize", void 0);
|
|
489
|
+
__decorate([
|
|
490
|
+
property({ type: Boolean, attribute: 'always-show-resize-handle' })
|
|
491
|
+
], NileDashboardBuilder.prototype, "alwaysShowResizeHandle", void 0);
|
|
310
492
|
__decorate([
|
|
311
493
|
query('.grid-stack')
|
|
312
494
|
], NileDashboardBuilder.prototype, "gridEl", void 0);
|
|
@@ -25,6 +25,7 @@ export declare class NileDonutChart extends NileElement {
|
|
|
25
25
|
/** Renders a 180° arc (semi-circle) suitable for KPI-style gauges. */
|
|
26
26
|
semiCircle: boolean;
|
|
27
27
|
options: Highcharts.Options;
|
|
28
|
+
noResponsive: boolean;
|
|
28
29
|
loading: boolean;
|
|
29
30
|
height: string;
|
|
30
31
|
showDataLabels: boolean;
|
|
@@ -4,6 +4,7 @@ import { html } from 'lit';
|
|
|
4
4
|
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { deepMerge } from '../internal/utils.js';
|
|
7
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
7
8
|
import { styles } from './nile-donut-chart.css.js';
|
|
8
9
|
let NileDonutChart = class NileDonutChart extends NileElement {
|
|
9
10
|
constructor() {
|
|
@@ -21,6 +22,7 @@ let NileDonutChart = class NileDonutChart extends NileElement {
|
|
|
21
22
|
/** Renders a 180° arc (semi-circle) suitable for KPI-style gauges. */
|
|
22
23
|
this.semiCircle = false;
|
|
23
24
|
this.options = {};
|
|
25
|
+
this.noResponsive = false;
|
|
24
26
|
this.loading = false;
|
|
25
27
|
this.height = '400px';
|
|
26
28
|
this.showDataLabels = true;
|
|
@@ -162,7 +164,7 @@ let NileDonutChart = class NileDonutChart extends NileElement {
|
|
|
162
164
|
}
|
|
163
165
|
buildOptions() {
|
|
164
166
|
const self = this;
|
|
165
|
-
|
|
167
|
+
const merged = deepMerge({
|
|
166
168
|
chart: { type: 'pie', ...(this.height ? { height: this.height } : {}) },
|
|
167
169
|
title: { text: this.chartTitle || undefined },
|
|
168
170
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
@@ -190,6 +192,7 @@ let NileDonutChart = class NileDonutChart extends NileElement {
|
|
|
190
192
|
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
191
193
|
credits: { enabled: false },
|
|
192
194
|
}, this.options);
|
|
195
|
+
return withResponsiveDefaults(merged, 'donut', this.noResponsive);
|
|
193
196
|
}
|
|
194
197
|
async initChart() {
|
|
195
198
|
if (this.loading || !this.chartContainer)
|
|
@@ -237,6 +240,9 @@ __decorate([
|
|
|
237
240
|
__decorate([
|
|
238
241
|
property({ type: Object })
|
|
239
242
|
], NileDonutChart.prototype, "options", void 0);
|
|
243
|
+
__decorate([
|
|
244
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
245
|
+
], NileDonutChart.prototype, "noResponsive", void 0);
|
|
240
246
|
__decorate([
|
|
241
247
|
property({ type: Boolean, reflect: true })
|
|
242
248
|
], NileDonutChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-dumbbell-chart.css.js';
|
|
9
10
|
let NileDumbbellChart = class NileDumbbellChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -18,6 +19,7 @@ let NileDumbbellChart = class NileDumbbellChart extends NileElement {
|
|
|
18
19
|
this.chartSubtitle = '';
|
|
19
20
|
this.data = [];
|
|
20
21
|
this.options = {};
|
|
22
|
+
this.noResponsive = false;
|
|
21
23
|
this.loading = false;
|
|
22
24
|
this.height = '400px';
|
|
23
25
|
this.yAxisTitle = '';
|
|
@@ -129,7 +131,7 @@ let NileDumbbellChart = class NileDumbbellChart extends NileElement {
|
|
|
129
131
|
}
|
|
130
132
|
buildOptions() {
|
|
131
133
|
const self = this;
|
|
132
|
-
|
|
134
|
+
const merged = deepMerge({
|
|
133
135
|
chart: {
|
|
134
136
|
type: 'dumbbell',
|
|
135
137
|
...(this.height ? { height: this.height } : {}),
|
|
@@ -186,6 +188,7 @@ let NileDumbbellChart = class NileDumbbellChart extends NileElement {
|
|
|
186
188
|
],
|
|
187
189
|
credits: { enabled: false },
|
|
188
190
|
}, this.options);
|
|
191
|
+
return withResponsiveDefaults(merged, 'dumbbell', this.noResponsive);
|
|
189
192
|
}
|
|
190
193
|
async initChart() {
|
|
191
194
|
if (this.loading || !this.chartContainer)
|
|
@@ -227,6 +230,9 @@ __decorate([
|
|
|
227
230
|
__decorate([
|
|
228
231
|
property({ type: Object })
|
|
229
232
|
], NileDumbbellChart.prototype, "options", void 0);
|
|
233
|
+
__decorate([
|
|
234
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
235
|
+
], NileDumbbellChart.prototype, "noResponsive", void 0);
|
|
230
236
|
__decorate([
|
|
231
237
|
property({ type: Boolean, reflect: true })
|
|
232
238
|
], NileDumbbellChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-dumbbell-lower-chart.css.js';
|
|
9
10
|
let NileDumbbellLowerChart = class NileDumbbellLowerChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -17,6 +18,7 @@ let NileDumbbellLowerChart = class NileDumbbellLowerChart extends NileElement {
|
|
|
17
18
|
this.chartSubtitle = '';
|
|
18
19
|
this.data = [];
|
|
19
20
|
this.options = {};
|
|
21
|
+
this.noResponsive = false;
|
|
20
22
|
this.loading = false;
|
|
21
23
|
this.height = '400px';
|
|
22
24
|
this.yAxisTitle = '';
|
|
@@ -125,7 +127,7 @@ let NileDumbbellLowerChart = class NileDumbbellLowerChart extends NileElement {
|
|
|
125
127
|
}
|
|
126
128
|
buildOptions() {
|
|
127
129
|
const self = this;
|
|
128
|
-
|
|
130
|
+
const merged = deepMerge({
|
|
129
131
|
chart: {
|
|
130
132
|
type: 'dumbbell',
|
|
131
133
|
...(this.height ? { height: this.height } : {}),
|
|
@@ -183,6 +185,7 @@ let NileDumbbellLowerChart = class NileDumbbellLowerChart extends NileElement {
|
|
|
183
185
|
],
|
|
184
186
|
credits: { enabled: false },
|
|
185
187
|
}, this.options);
|
|
188
|
+
return withResponsiveDefaults(merged, 'dumbbellLower', this.noResponsive);
|
|
186
189
|
}
|
|
187
190
|
async initChart() {
|
|
188
191
|
if (this.loading || !this.chartContainer)
|
|
@@ -224,6 +227,9 @@ __decorate([
|
|
|
224
227
|
__decorate([
|
|
225
228
|
property({ type: Object })
|
|
226
229
|
], NileDumbbellLowerChart.prototype, "options", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
232
|
+
], NileDumbbellLowerChart.prototype, "noResponsive", void 0);
|
|
227
233
|
__decorate([
|
|
228
234
|
property({ type: Boolean, reflect: true })
|
|
229
235
|
], NileDumbbellLowerChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-dumbbell-upper-chart.css.js';
|
|
9
10
|
let NileDumbbellUpperChart = class NileDumbbellUpperChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -17,6 +18,7 @@ let NileDumbbellUpperChart = class NileDumbbellUpperChart extends NileElement {
|
|
|
17
18
|
this.chartSubtitle = '';
|
|
18
19
|
this.data = [];
|
|
19
20
|
this.options = {};
|
|
21
|
+
this.noResponsive = false;
|
|
20
22
|
this.loading = false;
|
|
21
23
|
this.height = '400px';
|
|
22
24
|
this.yAxisTitle = '';
|
|
@@ -125,7 +127,7 @@ let NileDumbbellUpperChart = class NileDumbbellUpperChart extends NileElement {
|
|
|
125
127
|
}
|
|
126
128
|
buildOptions() {
|
|
127
129
|
const self = this;
|
|
128
|
-
|
|
130
|
+
const merged = deepMerge({
|
|
129
131
|
chart: {
|
|
130
132
|
type: 'dumbbell',
|
|
131
133
|
...(this.height ? { height: this.height } : {}),
|
|
@@ -183,6 +185,7 @@ let NileDumbbellUpperChart = class NileDumbbellUpperChart extends NileElement {
|
|
|
183
185
|
],
|
|
184
186
|
credits: { enabled: false },
|
|
185
187
|
}, this.options);
|
|
188
|
+
return withResponsiveDefaults(merged, 'dumbbellUpper', this.noResponsive);
|
|
186
189
|
}
|
|
187
190
|
async initChart() {
|
|
188
191
|
if (this.loading || !this.chartContainer)
|
|
@@ -224,6 +227,9 @@ __decorate([
|
|
|
224
227
|
__decorate([
|
|
225
228
|
property({ type: Object })
|
|
226
229
|
], NileDumbbellUpperChart.prototype, "options", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
232
|
+
], NileDumbbellUpperChart.prototype, "noResponsive", void 0);
|
|
227
233
|
__decorate([
|
|
228
234
|
property({ type: Boolean, reflect: true })
|
|
229
235
|
], NileDumbbellUpperChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import NileElement from '../internal/nile-element.js';
|
|
|
5
5
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
6
6
|
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-euler-chart.css.js';
|
|
9
10
|
let NileEulerChart = class NileEulerChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -17,6 +18,7 @@ let NileEulerChart = class NileEulerChart extends NileElement {
|
|
|
17
18
|
this.chartSubtitle = '';
|
|
18
19
|
this.data = [];
|
|
19
20
|
this.options = {};
|
|
21
|
+
this.noResponsive = false;
|
|
20
22
|
this.loading = false;
|
|
21
23
|
this.height = '400px';
|
|
22
24
|
// ── Container styling ──
|
|
@@ -109,7 +111,7 @@ let NileEulerChart = class NileEulerChart extends NileElement {
|
|
|
109
111
|
}
|
|
110
112
|
buildOptions() {
|
|
111
113
|
const self = this;
|
|
112
|
-
|
|
114
|
+
const merged = deepMerge({
|
|
113
115
|
chart: { ...(this.height ? { height: this.height } : {}) },
|
|
114
116
|
title: { text: this.chartTitle || undefined },
|
|
115
117
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
@@ -140,6 +142,7 @@ let NileEulerChart = class NileEulerChart extends NileElement {
|
|
|
140
142
|
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
141
143
|
credits: { enabled: false },
|
|
142
144
|
}, this.options);
|
|
145
|
+
return withResponsiveDefaults(merged, 'euler', this.noResponsive);
|
|
143
146
|
}
|
|
144
147
|
async initChart() {
|
|
145
148
|
if (this.loading || !this.chartContainer)
|
|
@@ -181,6 +184,9 @@ __decorate([
|
|
|
181
184
|
__decorate([
|
|
182
185
|
property({ type: Object })
|
|
183
186
|
], NileEulerChart.prototype, "options", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
189
|
+
], NileEulerChart.prototype, "noResponsive", void 0);
|
|
184
190
|
__decorate([
|
|
185
191
|
property({ type: Boolean, reflect: true })
|
|
186
192
|
], NileEulerChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-fan-chart.css.js';
|
|
9
10
|
const DEFAULT_BAND_COLORS = ['#93c5fd', '#60a5fa', '#3b82f6'];
|
|
10
11
|
let NileFanChart = class NileFanChart extends NileElement {
|
|
@@ -20,6 +21,7 @@ let NileFanChart = class NileFanChart extends NileElement {
|
|
|
20
21
|
this.lineData = [];
|
|
21
22
|
this.bands = [];
|
|
22
23
|
this.options = {};
|
|
24
|
+
this.noResponsive = false;
|
|
23
25
|
this.loading = false;
|
|
24
26
|
this.height = '400px';
|
|
25
27
|
this.yAxisTitle = '';
|
|
@@ -174,7 +176,7 @@ let NileFanChart = class NileFanChart extends NileElement {
|
|
|
174
176
|
zIndex: i,
|
|
175
177
|
states: { inactive: { enabled: false } },
|
|
176
178
|
}));
|
|
177
|
-
|
|
179
|
+
const merged = deepMerge({
|
|
178
180
|
chart: {
|
|
179
181
|
...(this.height ? { height: this.height } : {}),
|
|
180
182
|
zoomType: 'x',
|
|
@@ -223,6 +225,7 @@ let NileFanChart = class NileFanChart extends NileElement {
|
|
|
223
225
|
],
|
|
224
226
|
credits: { enabled: false },
|
|
225
227
|
}, this.options);
|
|
228
|
+
return withResponsiveDefaults(merged, 'fan', this.noResponsive);
|
|
226
229
|
}
|
|
227
230
|
async initChart() {
|
|
228
231
|
if (this.loading || !this.chartContainer)
|
|
@@ -267,6 +270,9 @@ __decorate([
|
|
|
267
270
|
__decorate([
|
|
268
271
|
property({ type: Object })
|
|
269
272
|
], NileFanChart.prototype, "options", void 0);
|
|
273
|
+
__decorate([
|
|
274
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
275
|
+
], NileFanChart.prototype, "noResponsive", void 0);
|
|
270
276
|
__decorate([
|
|
271
277
|
property({ type: Boolean, reflect: true })
|
|
272
278
|
], NileFanChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import NileElement from '../internal/nile-element.js';
|
|
|
5
5
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
6
6
|
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-flame-chart.css.js';
|
|
9
10
|
function registerFlameSeriesTypeIfNeeded(H) {
|
|
10
11
|
const types = H.seriesTypes;
|
|
@@ -44,6 +45,7 @@ let NileFlameChart = class NileFlameChart extends NileElement {
|
|
|
44
45
|
this.sunburstData = [];
|
|
45
46
|
this.layout = 'flame';
|
|
46
47
|
this.options = {};
|
|
48
|
+
this.noResponsive = false;
|
|
47
49
|
this.loading = false;
|
|
48
50
|
this.height = '480px';
|
|
49
51
|
// ── Container styling ──
|
|
@@ -190,7 +192,7 @@ let NileFlameChart = class NileFlameChart extends NileElement {
|
|
|
190
192
|
};
|
|
191
193
|
const titleText = this.chartTitle ||
|
|
192
194
|
(isSunburst ? 'Sunburst' : this.layout === 'icicle' ? 'Icicle chart' : 'Flame chart');
|
|
193
|
-
|
|
195
|
+
const merged = deepMerge({
|
|
194
196
|
chart: { inverted: !isSunburst, ...(this.height ? { height: this.height } : {}) },
|
|
195
197
|
title: { text: titleText, align: 'left' },
|
|
196
198
|
subtitle: { text: this.chartSubtitle || undefined, align: 'left' },
|
|
@@ -294,6 +296,7 @@ let NileFlameChart = class NileFlameChart extends NileElement {
|
|
|
294
296
|
],
|
|
295
297
|
credits: { enabled: false },
|
|
296
298
|
}, this.options);
|
|
299
|
+
return withResponsiveDefaults(merged, 'flame', this.noResponsive);
|
|
297
300
|
}
|
|
298
301
|
async initChart() {
|
|
299
302
|
if (this.loading || !this.chartContainer)
|
|
@@ -342,6 +345,9 @@ __decorate([
|
|
|
342
345
|
__decorate([
|
|
343
346
|
property({ type: Object })
|
|
344
347
|
], NileFlameChart.prototype, "options", void 0);
|
|
348
|
+
__decorate([
|
|
349
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
350
|
+
], NileFlameChart.prototype, "noResponsive", void 0);
|
|
345
351
|
__decorate([
|
|
346
352
|
property({ type: Boolean, reflect: true })
|
|
347
353
|
], NileFlameChart.prototype, "loading", void 0);
|