@aquera/nile-visualization 2.9.27 → 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.
Files changed (128) hide show
  1. package/README.md +8 -0
  2. package/dist/src/index.d.ts +5 -0
  3. package/dist/src/index.js +4 -0
  4. package/dist/src/internal/chart-events.d.ts +92 -0
  5. package/dist/src/internal/chart-events.js +291 -0
  6. package/dist/src/internal/chart-runtime.d.ts +41 -0
  7. package/dist/src/internal/chart-runtime.js +30 -0
  8. package/dist/src/internal/dashboard-adapters.d.ts +4 -0
  9. package/dist/src/internal/dashboard-adapters.js +9 -3
  10. package/dist/src/internal/highcharts-provider.js +3 -0
  11. package/dist/src/internal/nile-chart-base.d.ts +43 -0
  12. package/dist/src/internal/nile-chart-base.js +67 -0
  13. package/dist/src/internal/resolve-widget-kind.d.ts +10 -0
  14. package/dist/src/internal/resolve-widget-kind.js +16 -0
  15. package/dist/src/internal/responsive-defaults.d.ts +32 -0
  16. package/dist/src/internal/responsive-defaults.js +255 -0
  17. package/dist/src/internal/types/highcharts-passthrough.type.d.ts +80 -0
  18. package/dist/src/internal/types/highcharts-passthrough.type.js +24 -0
  19. package/dist/src/internal/types/index.d.ts +2 -0
  20. package/dist/src/internal/types/index.js +1 -1
  21. package/dist/src/internal/types/widget-config.type.d.ts +14 -3
  22. package/dist/src/nile-anomaly-chart/nile-anomaly-chart.d.ts +2 -0
  23. package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +8 -1
  24. package/dist/src/nile-area-chart/nile-area-chart.d.ts +1 -0
  25. package/dist/src/nile-area-chart/nile-area-chart.js +7 -1
  26. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.d.ts +1 -0
  27. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +7 -1
  28. package/dist/src/nile-area-range-chart/nile-area-range-chart.d.ts +1 -0
  29. package/dist/src/nile-area-range-chart/nile-area-range-chart.js +7 -1
  30. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.d.ts +1 -0
  31. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +7 -1
  32. package/dist/src/nile-bar-chart/nile-bar-chart.d.ts +2 -0
  33. package/dist/src/nile-bar-chart/nile-bar-chart.js +8 -1
  34. package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.d.ts +1 -0
  35. package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +7 -1
  36. package/dist/src/nile-boxplot-chart/nile-boxplot-chart.d.ts +1 -0
  37. package/dist/src/nile-boxplot-chart/nile-boxplot-chart.js +7 -1
  38. package/dist/src/nile-bubble-chart/nile-bubble-chart.d.ts +1 -0
  39. package/dist/src/nile-bubble-chart/nile-bubble-chart.js +7 -1
  40. package/dist/src/nile-chart/nile-chart-config.d.ts +2 -2
  41. package/dist/src/nile-chart/nile-chart.css.js +7 -1
  42. package/dist/src/nile-chart/nile-chart.d.ts +59 -0
  43. package/dist/src/nile-chart/nile-chart.js +176 -3
  44. package/dist/src/nile-cluster-chart/nile-cluster-chart.d.ts +1 -0
  45. package/dist/src/nile-cluster-chart/nile-cluster-chart.js +7 -1
  46. package/dist/src/nile-column-chart/nile-column-chart.d.ts +1 -0
  47. package/dist/src/nile-column-chart/nile-column-chart.js +7 -1
  48. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.d.ts +1 -0
  49. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +8 -1
  50. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.d.ts +1 -0
  51. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +7 -1
  52. package/dist/src/nile-column-range-chart/nile-column-range-chart.d.ts +1 -0
  53. package/dist/src/nile-column-range-chart/nile-column-range-chart.js +7 -1
  54. package/dist/src/nile-dashboard-builder/gridstack-css.d.ts +1 -0
  55. package/dist/src/nile-dashboard-builder/gridstack-css.js +6 -0
  56. package/dist/src/nile-dashboard-builder/index.d.ts +1 -0
  57. package/dist/src/nile-dashboard-builder/index.js +2 -0
  58. package/dist/src/nile-dashboard-builder/nile-dashboard-builder.css.d.ts +1 -0
  59. package/dist/src/nile-dashboard-builder/nile-dashboard-builder.css.js +96 -0
  60. package/dist/src/nile-dashboard-builder/nile-dashboard-builder.d.ts +177 -0
  61. package/dist/src/nile-dashboard-builder/nile-dashboard-builder.js +499 -0
  62. package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +1 -0
  63. package/dist/src/nile-donut-chart/nile-donut-chart.js +7 -1
  64. package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.d.ts +1 -0
  65. package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.js +7 -1
  66. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.d.ts +1 -0
  67. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +7 -1
  68. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.d.ts +1 -0
  69. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +7 -1
  70. package/dist/src/nile-euler-chart/nile-euler-chart.d.ts +1 -0
  71. package/dist/src/nile-euler-chart/nile-euler-chart.js +7 -1
  72. package/dist/src/nile-fan-chart/nile-fan-chart.d.ts +1 -0
  73. package/dist/src/nile-fan-chart/nile-fan-chart.js +7 -1
  74. package/dist/src/nile-flame-chart/nile-flame-chart.d.ts +1 -0
  75. package/dist/src/nile-flame-chart/nile-flame-chart.js +7 -1
  76. package/dist/src/nile-funnel-chart/nile-funnel-chart.d.ts +1 -0
  77. package/dist/src/nile-funnel-chart/nile-funnel-chart.js +7 -1
  78. package/dist/src/nile-gauge-chart/nile-gauge-chart.d.ts +20 -0
  79. package/dist/src/nile-gauge-chart/nile-gauge-chart.js +80 -4
  80. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +1 -0
  81. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +7 -1
  82. package/dist/src/nile-histogram-chart/nile-histogram-chart.d.ts +1 -0
  83. package/dist/src/nile-histogram-chart/nile-histogram-chart.js +7 -1
  84. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.d.ts +1 -0
  85. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +7 -1
  86. package/dist/src/nile-line-chart/nile-line-chart.d.ts +1 -0
  87. package/dist/src/nile-line-chart/nile-line-chart.js +7 -1
  88. package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +1 -0
  89. package/dist/src/nile-line-column-chart/nile-line-column-chart.js +7 -1
  90. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.d.ts +1 -0
  91. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +7 -1
  92. package/dist/src/nile-map-chart/nile-map-chart.d.ts +23 -3
  93. package/dist/src/nile-map-chart/nile-map-chart.js +52 -12
  94. package/dist/src/nile-master-detail-chart/nile-master-detail-chart.css.js +13 -1
  95. package/dist/src/nile-master-detail-chart/nile-master-detail-chart.d.ts +1 -0
  96. package/dist/src/nile-master-detail-chart/nile-master-detail-chart.js +48 -4
  97. package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +1 -0
  98. package/dist/src/nile-organization-chart/nile-organization-chart.js +7 -1
  99. package/dist/src/nile-pie-chart/nile-pie-chart.d.ts +2 -0
  100. package/dist/src/nile-pie-chart/nile-pie-chart.js +8 -1
  101. package/dist/src/nile-polygon-chart/nile-polygon-chart.d.ts +1 -0
  102. package/dist/src/nile-polygon-chart/nile-polygon-chart.js +7 -1
  103. package/dist/src/nile-radar-chart/nile-radar-chart.d.ts +1 -0
  104. package/dist/src/nile-radar-chart/nile-radar-chart.js +7 -1
  105. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.d.ts +1 -0
  106. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +7 -1
  107. package/dist/src/nile-scatter-chart/nile-scatter-chart.d.ts +1 -0
  108. package/dist/src/nile-scatter-chart/nile-scatter-chart.js +7 -1
  109. package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.d.ts +1 -0
  110. package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.js +7 -1
  111. package/dist/src/nile-spline-chart/nile-spline-chart.d.ts +1 -0
  112. package/dist/src/nile-spline-chart/nile-spline-chart.js +7 -1
  113. package/dist/src/nile-stacked-chart/nile-stacked-chart.d.ts +1 -0
  114. package/dist/src/nile-stacked-chart/nile-stacked-chart.js +7 -1
  115. package/dist/src/nile-timeline-chart/nile-timeline-chart.d.ts +1 -0
  116. package/dist/src/nile-timeline-chart/nile-timeline-chart.js +7 -1
  117. package/dist/src/nile-trendline-chart/nile-trendline-chart.d.ts +2 -0
  118. package/dist/src/nile-trendline-chart/nile-trendline-chart.js +8 -1
  119. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.d.ts +1 -0
  120. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +7 -1
  121. package/dist/src/nile-vector-chart/nile-vector-chart.d.ts +1 -0
  122. package/dist/src/nile-vector-chart/nile-vector-chart.js +7 -1
  123. package/dist/src/nile-waterfall-chart/nile-waterfall-chart.d.ts +1 -0
  124. package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +7 -1
  125. package/dist/src/nile-widget-viewer/nile-widget-viewer.js +6 -6
  126. package/dist/src/nile-xrange-chart/nile-xrange-chart.d.ts +1 -0
  127. package/dist/src/nile-xrange-chart/nile-xrange-chart.js +7 -1
  128. package/package.json +7 -6
@@ -4,11 +4,13 @@ import { customElement, property, query, state } from 'lit/decorators.js';
4
4
  import { html, nothing } from 'lit';
5
5
  import NileElement from '../internal/nile-element.js';
6
6
  import { styles, tooltipCss, injectGlobalChartMenuOverrides } from './nile-chart.css.js';
7
+ import { HIGHCHARTS_PASSTHROUGH_KEYS } from '../internal/types/index.js';
7
8
  import { nileChartConfig } from './nile-chart-config-builder.js';
8
9
  import { renderChartSkeleton } from './nile-chart-skeleton.js';
9
10
  import { convertConfig } from '../internal/chart-adapters.js';
10
11
  import { deepMerge } from '../internal/utils.js';
11
12
  import { initNileChartExporting, getHighcharts } from '../internal/highcharts-provider.js';
13
+ import { getAxisExtremes, setAxisExtremes, } from '../internal/chart-runtime.js';
12
14
  import { resolveColorPaletteColors } from '../internal/color-palettes/index.js';
13
15
  initNileChartExporting();
14
16
  import '../nile-bar-chart/index.js';
@@ -179,6 +181,19 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
179
181
  this.noHeader = false;
180
182
  this.noPadding = false;
181
183
  this.appearance = null;
184
+ /**
185
+ * Opt-in double-tap-to-minimize gesture. Double-tap the header to hide it —
186
+ * the plot expands to fill the freed space; double-tap the chart again to
187
+ * bring the header back. Off by default.
188
+ */
189
+ this.minimizeOnDoubleTap = false;
190
+ /**
191
+ * Minimized state — header hidden and body padding removed so the plot fills
192
+ * the card. Reflected as the `minimized` attribute; set it directly to control
193
+ * minimize programmatically, or let the double-tap gesture toggle it when
194
+ * `minimizeOnDoubleTap` is on. Emits `nile-chart-minimize` on every change.
195
+ */
196
+ this.minimized = false;
182
197
  /**
183
198
  * When set, fills `chart.type` if the config omits it (same values as `chart.type`, e.g. `stacked`, `pie`).
184
199
  * Usage: `<nile-chart chart-type="pie" />` plus `config.chart` with series data only.
@@ -223,8 +238,40 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
223
238
  }
224
239
  }
225
240
  };
241
+ this._readyResolvers = [];
242
+ this._extremesDisposers = [];
226
243
  this.handleChartReady = (e) => {
227
244
  this._hcChart = e.detail?.chart ?? null;
245
+ if (this._hcChart) {
246
+ const resolvers = this._readyResolvers;
247
+ this._readyResolvers = [];
248
+ resolvers.forEach((resolve) => resolve(this._hcChart));
249
+ void this._wireExtremesEvents();
250
+ }
251
+ };
252
+ /**
253
+ * Double-tap gesture (opt-in via `minimizeOnDoubleTap`): toggle the minimized
254
+ * state. When the header is showing, only a double-tap ON the header
255
+ * minimizes; when it's hidden, a double-tap anywhere restores it.
256
+ */
257
+ this._onDoubleTap = (event) => {
258
+ if (!this.minimizeOnDoubleTap)
259
+ return;
260
+ if (this.minimized) {
261
+ this.minimized = false; // header is gone — any double-tap restores it
262
+ this.emit('nile-chart-minimize', { minimized: false });
263
+ return;
264
+ }
265
+ const onHeader = event.composedPath().some(el => {
266
+ if (!(el instanceof Element))
267
+ return false;
268
+ const part = el.getAttribute?.('part') || '';
269
+ return el.classList?.contains('nile-chart-header') || part.split(/\s+/).includes('header');
270
+ });
271
+ if (onHeader) {
272
+ this.minimized = true;
273
+ this.emit('nile-chart-minimize', { minimized: true });
274
+ }
228
275
  };
229
276
  this.resolvedConfig = null;
230
277
  // Reveal the full text when a title/subtitle is truncated. Accepts any Event
@@ -247,6 +294,51 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
247
294
  get aiEnabled() {
248
295
  return this.resolvedConfig?.ai?.enabled === true || !!this.effectiveSummary;
249
296
  }
297
+ /**
298
+ * Re-emit Highcharts' `afterSetExtremes` (fired on zoom/pan/navigator) as the
299
+ * `nile-extremes-change` Nile event, so consumers can sync a shared range
300
+ * across panels. Uses `Highcharts.addEvent`, which stacks on top of any
301
+ * handler the consumer already set — it never overrides existing behavior.
302
+ */
303
+ async _wireExtremesEvents() {
304
+ this._teardownExtremesEvents();
305
+ const chart = this._hcChart;
306
+ if (!chart?.xAxis?.length)
307
+ return;
308
+ const HC = await getHighcharts();
309
+ const addEvent = HC?.addEvent;
310
+ if (typeof addEvent !== 'function')
311
+ return;
312
+ // Chart may have been swapped out while awaiting; bail if so.
313
+ if (this._hcChart !== chart)
314
+ return;
315
+ chart.xAxis.forEach((axis, index) => {
316
+ const dispose = addEvent(axis, 'afterSetExtremes', (ev) => {
317
+ this.emit('nile-extremes-change', {
318
+ min: ev.min,
319
+ max: ev.max,
320
+ dataMin: ev.dataMin,
321
+ dataMax: ev.dataMax,
322
+ axis: index,
323
+ dimension: 'x',
324
+ trigger: ev.trigger ?? 'api',
325
+ });
326
+ });
327
+ if (typeof dispose === 'function')
328
+ this._extremesDisposers.push(dispose);
329
+ });
330
+ }
331
+ _teardownExtremesEvents() {
332
+ this._extremesDisposers.forEach((dispose) => {
333
+ try {
334
+ dispose();
335
+ }
336
+ catch {
337
+ /* axis already destroyed */
338
+ }
339
+ });
340
+ this._extremesDisposers = [];
341
+ }
250
342
  connectedCallback() {
251
343
  super.connectedCallback();
252
344
  ensureHeaderTooltipStyles();
@@ -258,6 +350,7 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
258
350
  this._headerTipEl = tip;
259
351
  document.addEventListener('click', this.handleOutsideClick);
260
352
  this.addEventListener('nile-chart-ready', this.handleChartReady);
353
+ this.addEventListener('dblclick', this._onDoubleTap);
261
354
  initNileChartExporting();
262
355
  // Pick up config set before element upgrade (e.g. Angular ngAfterViewInit)
263
356
  if (this.config && !this.resolvedConfig) {
@@ -270,10 +363,13 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
270
363
  super.disconnectedCallback();
271
364
  document.removeEventListener('click', this.handleOutsideClick);
272
365
  this.removeEventListener('nile-chart-ready', this.handleChartReady);
366
+ this.removeEventListener('dblclick', this._onDoubleTap);
273
367
  this._headerTipEl?.remove();
274
368
  this._headerTipEl = null;
275
369
  this._headerResizeObs?.disconnect();
276
370
  this._headerResizeObs = null;
371
+ this._teardownExtremesEvents();
372
+ this._readyResolvers = [];
277
373
  }
278
374
  mergeChartTypeFromAttr(chart) {
279
375
  const t = this.chartTypeAttr?.trim();
@@ -300,8 +396,11 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
300
396
  // appearance="minimal" on filter charts implies a header-less compact layout.
301
397
  const minimalFilter = resolved.type === 'filter' && resolved.appearance === 'minimal';
302
398
  const cfgNoHeader = resolved.noHeader === true || minimalFilter;
303
- if (cfgNoHeader && !this.noHeader)
304
- this.noHeader = true;
399
+ // Keep noHeader in sync with the config both ways (like noPadding below) —
400
+ // a one-way latch here would leave the header hidden after the config
401
+ // clears noHeader again.
402
+ if (this.noHeader !== cfgNoHeader)
403
+ this.noHeader = cfgNoHeader;
305
404
  if (this.noPadding !== (resolved.noPadding === true))
306
405
  this.noPadding = resolved.noPadding === true;
307
406
  if (resolved.appearance && this.appearance !== resolved.appearance)
@@ -336,6 +435,52 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
336
435
  this.aiPanel.addAssistantMessage(text);
337
436
  }
338
437
  }
438
+ /**
439
+ * The underlying `Highcharts.Chart` instance for the currently rendered chart,
440
+ * or `null` until it's ready. Use this to reach any native Highcharts API
441
+ * (`series.setData`, `mapView.fitToBounds`, etc.). Read-only.
442
+ */
443
+ get chart() {
444
+ return this._hcChart;
445
+ }
446
+ /**
447
+ * Resolves with the `Highcharts.Chart` instance once it's ready (immediately if
448
+ * it already exists). On a chart-type switch a new instance is created; this
449
+ * resolves with the current-or-next instance.
450
+ */
451
+ whenReady() {
452
+ if (this._hcChart)
453
+ return Promise.resolve(this._hcChart);
454
+ return new Promise((resolve) => {
455
+ this._readyResolvers.push(resolve);
456
+ });
457
+ }
458
+ /**
459
+ * Read the current extremes of an axis (default: primary x-axis). Returns
460
+ * `null` when the chart isn't ready or the axis doesn't exist (e.g. pie/gauge).
461
+ */
462
+ getExtremes(axis = 0, dimension = 'x') {
463
+ return getAxisExtremes(this._hcChart, axis, dimension);
464
+ }
465
+ /**
466
+ * Set the extremes (zoom/pan range) of an axis — useful for syncing a shared
467
+ * range across panels in response to `nile-extremes-change`. Safe no-op if the
468
+ * chart isn't ready or the axis doesn't exist. Pass `null` to reset a bound.
469
+ */
470
+ setExtremes(min, max, opts = {}) {
471
+ setAxisExtremes(this._hcChart, min, max, opts);
472
+ }
473
+ /**
474
+ * Force the chart to re-read inherited styles/CSS variables and redraw. Call
475
+ * this after your app toggles light/dark theme. Safe no-op until the chart is
476
+ * ready.
477
+ */
478
+ refreshTheme() {
479
+ const chart = this._hcChart;
480
+ if (!chart?.update)
481
+ return;
482
+ chart.update({}, true, false);
483
+ }
339
484
  handleAiSend(e) {
340
485
  e.stopPropagation();
341
486
  this.emit('nile-chart-ai-send', {
@@ -428,6 +573,8 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
428
573
  return false;
429
574
  }
430
575
  shouldShowHeader() {
576
+ if (this.minimized)
577
+ return false;
431
578
  if (this.noHeader)
432
579
  return false;
433
580
  if (this.resolvedConfig?.noHeader === true)
@@ -704,13 +851,33 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
704
851
  if (Object.keys(chart).length)
705
852
  spacingOptions.chart = chart;
706
853
  }
854
+ // First-class Highcharts passthrough fields (responsive, tooltip, xAxis,
855
+ // yAxis, plotOptions, …). Each maps 1:1 to the identically-named top-level
856
+ // Highcharts option and applies to every chart type. Only include keys the
857
+ // caller actually set, so we never inject `undefined` into the merge.
858
+ const passthroughOptions = {};
859
+ for (const key of HIGHCHARTS_PASSTHROUGH_KEYS) {
860
+ const value = config[key];
861
+ if (value !== undefined)
862
+ passthroughOptions[key] = value;
863
+ }
864
+ // Responsiveness is built in, but the RULES belong to the chart element we
865
+ // render, not to us: it knows its own axis shape, so it picks the matching
866
+ // default set (see responsive-defaults). We just forward the consumer's
867
+ // `responsive` value verbatim through `options` — the passthrough loop above
868
+ // already copied it. An object's `rules` are appended to the element's
869
+ // defaults (so they win at matching breakpoints), and `responsive: false`
870
+ // reaches the element as the opt-out sentinel it strips before Highcharts
871
+ // ever sees it. Nothing to do here.
707
872
  const cfgData = config.data;
708
873
  const dataCount = Array.isArray(cfgData) ? cfgData.length : undefined;
709
874
  const hasExplicitColors = Array.isArray(config.options?.colors);
710
875
  const paletteCfg = config.colorPalette ?? (hasExplicitColors ? undefined : { theme: 'default' });
711
876
  const paletteColors = resolveColorPaletteColors(paletteCfg, dataCount);
712
877
  const paletteOptions = paletteColors ? { colors: paletteColors } : {};
713
- const mergedOptions = deepMerge(deepMerge(deepMerge(deepMerge(deepMerge(config.options ?? {}, legendOptions), spacingOptions), paletteOptions), noTitle), this.buildExportingOptions());
878
+ // Precedence (later wins): raw options → passthrough fields → legend →
879
+ // spacing → palette → title suppression → exporting.
880
+ const mergedOptions = deepMerge(deepMerge(deepMerge(deepMerge(deepMerge(deepMerge(config.options ?? {}, passthroughOptions), legendOptions), spacingOptions), paletteOptions), noTitle), this.buildExportingOptions());
714
881
  switch (config.type) {
715
882
  case 'bar':
716
883
  return html `<nile-bar-chart
@@ -2003,6 +2170,12 @@ __decorate([
2003
2170
  __decorate([
2004
2171
  property({ type: String, reflect: true })
2005
2172
  ], NileChart.prototype, "appearance", void 0);
2173
+ __decorate([
2174
+ property({ type: Boolean, reflect: true, attribute: 'minimize-on-double-tap' })
2175
+ ], NileChart.prototype, "minimizeOnDoubleTap", void 0);
2176
+ __decorate([
2177
+ property({ type: Boolean, reflect: true })
2178
+ ], NileChart.prototype, "minimized", void 0);
2006
2179
  __decorate([
2007
2180
  property({ type: String, attribute: 'chart-type' })
2008
2181
  ], NileChart.prototype, "chartTypeAttr", void 0);
@@ -21,6 +21,7 @@ export declare class NileClusterChart extends NileElement {
21
21
  data: ClusterChartSeriesData[];
22
22
  categories: string[];
23
23
  options: Highcharts.Options;
24
+ noResponsive: boolean;
24
25
  loading: boolean;
25
26
  height: string;
26
27
  yAxisTitle: string;
@@ -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-cluster-chart.css.js';
9
10
  let NileClusterChart = class NileClusterChart extends NileElement {
10
11
  constructor() {
@@ -19,6 +20,7 @@ let NileClusterChart = class NileClusterChart extends NileElement {
19
20
  this.data = [];
20
21
  this.categories = [];
21
22
  this.options = {};
23
+ this.noResponsive = false;
22
24
  this.loading = false;
23
25
  this.height = '400px';
24
26
  this.yAxisTitle = '';
@@ -127,7 +129,7 @@ let NileClusterChart = class NileClusterChart extends NileElement {
127
129
  }
128
130
  buildOptions() {
129
131
  const self = this;
130
- return deepMerge({
132
+ const merged = deepMerge({
131
133
  chart: { type: 'column', ...(this.height ? { height: this.height } : {}) },
132
134
  title: { text: this.chartTitle || undefined },
133
135
  subtitle: { text: this.chartSubtitle || undefined },
@@ -168,6 +170,7 @@ let NileClusterChart = class NileClusterChart extends NileElement {
168
170
  })),
169
171
  credits: { enabled: false },
170
172
  }, this.options);
173
+ return withResponsiveDefaults(merged, 'cluster', this.noResponsive);
171
174
  }
172
175
  async initChart() {
173
176
  if (this.loading || !this.chartContainer)
@@ -212,6 +215,9 @@ __decorate([
212
215
  __decorate([
213
216
  property({ type: Object })
214
217
  ], NileClusterChart.prototype, "options", void 0);
218
+ __decorate([
219
+ property({ type: Boolean, attribute: 'no-responsive' })
220
+ ], NileClusterChart.prototype, "noResponsive", void 0);
215
221
  __decorate([
216
222
  property({ type: Boolean, reflect: true })
217
223
  ], NileClusterChart.prototype, "loading", void 0);
@@ -20,6 +20,7 @@ export declare class NileColumnChart extends NileElement {
20
20
  data: ColumnChartSeriesData[];
21
21
  categories: string[];
22
22
  options: Highcharts.Options;
23
+ noResponsive: boolean;
23
24
  loading: boolean;
24
25
  height: string;
25
26
  yAxisTitle: string;
@@ -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-column-chart.css.js';
8
9
  let NileColumnChart = class NileColumnChart extends NileElement {
9
10
  constructor() {
@@ -18,6 +19,7 @@ let NileColumnChart = class NileColumnChart extends NileElement {
18
19
  this.data = [];
19
20
  this.categories = [];
20
21
  this.options = {};
22
+ this.noResponsive = false;
21
23
  this.loading = false;
22
24
  this.height = '400px';
23
25
  this.yAxisTitle = '';
@@ -155,7 +157,7 @@ let NileColumnChart = class NileColumnChart extends NileElement {
155
157
  }
156
158
  buildOptions() {
157
159
  const self = this;
158
- return deepMerge({
160
+ const merged = deepMerge({
159
161
  chart: { type: 'column', ...(this.height ? { height: this.height } : {}) },
160
162
  title: { text: this.chartTitle || undefined },
161
163
  subtitle: { text: this.chartSubtitle || undefined },
@@ -170,6 +172,7 @@ let NileColumnChart = class NileColumnChart extends NileElement {
170
172
  legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
171
173
  credits: { enabled: false },
172
174
  }, this.options);
175
+ return withResponsiveDefaults(merged, 'column', this.noResponsive);
173
176
  }
174
177
  async initChart() {
175
178
  if (this.loading || !this.chartContainer)
@@ -211,6 +214,9 @@ __decorate([
211
214
  __decorate([
212
215
  property({ type: Object })
213
216
  ], NileColumnChart.prototype, "options", void 0);
217
+ __decorate([
218
+ property({ type: Boolean, attribute: 'no-responsive' })
219
+ ], NileColumnChart.prototype, "noResponsive", void 0);
214
220
  __decorate([
215
221
  property({ type: Boolean, reflect: true })
216
222
  ], NileColumnChart.prototype, "loading", void 0);
@@ -43,6 +43,7 @@ export declare class NileColumnDrilldownChart extends NileElement {
43
43
  seriesName: string;
44
44
  yAxisTitle: string;
45
45
  options: Highcharts.Options;
46
+ noResponsive: boolean;
46
47
  loading: boolean;
47
48
  height: string;
48
49
  chartBg: string;
@@ -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-column-drilldown-chart.css.js';
9
10
  import { tooltipCss } from '../nile-chart/nile-chart.css.js';
10
11
  let _bcTooltipStylesInjected = false;
@@ -38,6 +39,7 @@ let NileColumnDrilldownChart = class NileColumnDrilldownChart extends NileElemen
38
39
  this.seriesName = '';
39
40
  this.yAxisTitle = '';
40
41
  this.options = {};
42
+ this.noResponsive = false;
41
43
  this.loading = false;
42
44
  this.height = '400px';
43
45
  // ── Container styling ──
@@ -295,10 +297,11 @@ let NileColumnDrilldownChart = class NileColumnDrilldownChart extends NileElemen
295
297
  })),
296
298
  breadcrumbs: deepMerge(defaultBreadcrumbs, this.drilldown?.breadcrumbs ?? {}),
297
299
  };
298
- return deepMerge({
300
+ const merged = deepMerge({
299
301
  chart: { type: 'column', ...(this.height ? { height: this.height } : {}),
300
302
  events: {
301
303
  render() {
304
+ self.emit('nile-chart-render', { chart: this });
302
305
  self.syncBreadcrumbCollapse(this);
303
306
  self.applyBreadcrumbTooltips(this);
304
307
  },
@@ -339,6 +342,7 @@ let NileColumnDrilldownChart = class NileColumnDrilldownChart extends NileElemen
339
342
  drilldown,
340
343
  credits: { enabled: false },
341
344
  }, this.options);
345
+ return withResponsiveDefaults(merged, 'columnDrilldown', this.noResponsive);
342
346
  }
343
347
  async initChart() {
344
348
  if (this.loading || !this.chartContainer)
@@ -389,6 +393,9 @@ __decorate([
389
393
  __decorate([
390
394
  property({ type: Object })
391
395
  ], NileColumnDrilldownChart.prototype, "options", void 0);
396
+ __decorate([
397
+ property({ type: Boolean, attribute: 'no-responsive' })
398
+ ], NileColumnDrilldownChart.prototype, "noResponsive", void 0);
392
399
  __decorate([
393
400
  property({ type: Boolean, reflect: true })
394
401
  ], NileColumnDrilldownChart.prototype, "loading", void 0);
@@ -20,6 +20,7 @@ export declare class NileColumnPyramidChart extends NileElement {
20
20
  data: ColumnPyramidSeriesData[];
21
21
  categories: string[];
22
22
  options: Highcharts.Options;
23
+ noResponsive: boolean;
23
24
  loading: boolean;
24
25
  height: string;
25
26
  chartBg: string;
@@ -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-column-pyramid-chart.css.js';
9
10
  let NileColumnPyramidChart = class NileColumnPyramidChart extends NileElement {
10
11
  constructor() {
@@ -18,6 +19,7 @@ let NileColumnPyramidChart = class NileColumnPyramidChart extends NileElement {
18
19
  this.data = [];
19
20
  this.categories = [];
20
21
  this.options = {};
22
+ this.noResponsive = false;
21
23
  this.loading = false;
22
24
  this.height = '400px';
23
25
  // ── Container styling ──
@@ -110,7 +112,7 @@ let NileColumnPyramidChart = class NileColumnPyramidChart extends NileElement {
110
112
  }
111
113
  buildOptions() {
112
114
  const self = this;
113
- return deepMerge({
115
+ const merged = deepMerge({
114
116
  chart: { type: 'columnpyramid', ...(this.height ? { height: this.height } : {}) },
115
117
  title: { text: this.chartTitle || undefined },
116
118
  subtitle: { text: this.chartSubtitle || undefined },
@@ -143,6 +145,7 @@ let NileColumnPyramidChart = class NileColumnPyramidChart extends NileElement {
143
145
  legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
144
146
  credits: { enabled: false },
145
147
  }, this.options);
148
+ return withResponsiveDefaults(merged, 'columnPyramid', this.noResponsive);
146
149
  }
147
150
  async initChart() {
148
151
  if (this.loading || !this.chartContainer)
@@ -187,6 +190,9 @@ __decorate([
187
190
  __decorate([
188
191
  property({ type: Object })
189
192
  ], NileColumnPyramidChart.prototype, "options", void 0);
193
+ __decorate([
194
+ property({ type: Boolean, attribute: 'no-responsive' })
195
+ ], NileColumnPyramidChart.prototype, "noResponsive", void 0);
190
196
  __decorate([
191
197
  property({ type: Boolean, reflect: true })
192
198
  ], NileColumnPyramidChart.prototype, "loading", void 0);
@@ -20,6 +20,7 @@ export declare class NileColumnRangeChart extends NileElement {
20
20
  data: ColumnRangeSeriesData[];
21
21
  categories: string[];
22
22
  options: Highcharts.Options;
23
+ noResponsive: boolean;
23
24
  loading: boolean;
24
25
  height: string;
25
26
  yAxisTitle: string;
@@ -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-column-range-chart.css.js';
9
10
  let NileColumnRangeChart = class NileColumnRangeChart extends NileElement {
10
11
  constructor() {
@@ -18,6 +19,7 @@ let NileColumnRangeChart = class NileColumnRangeChart extends NileElement {
18
19
  this.data = [];
19
20
  this.categories = [];
20
21
  this.options = {};
22
+ this.noResponsive = false;
21
23
  this.loading = false;
22
24
  this.height = '400px';
23
25
  this.yAxisTitle = '';
@@ -120,7 +122,7 @@ let NileColumnRangeChart = class NileColumnRangeChart extends NileElement {
120
122
  }
121
123
  buildOptions() {
122
124
  const self = this;
123
- return deepMerge({
125
+ const merged = deepMerge({
124
126
  chart: { ...(this.height ? { height: this.height } : {}) },
125
127
  title: { text: this.chartTitle || undefined },
126
128
  subtitle: { text: this.chartSubtitle || undefined },
@@ -154,6 +156,7 @@ let NileColumnRangeChart = class NileColumnRangeChart extends NileElement {
154
156
  legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
155
157
  credits: { enabled: false },
156
158
  }, this.options);
159
+ return withResponsiveDefaults(merged, 'columnRange', this.noResponsive);
157
160
  }
158
161
  async initChart() {
159
162
  if (this.loading || !this.chartContainer)
@@ -198,6 +201,9 @@ __decorate([
198
201
  __decorate([
199
202
  property({ type: Object })
200
203
  ], NileColumnRangeChart.prototype, "options", void 0);
204
+ __decorate([
205
+ property({ type: Boolean, attribute: 'no-responsive' })
206
+ ], NileColumnRangeChart.prototype, "noResponsive", void 0);
201
207
  __decorate([
202
208
  property({ type: Boolean, reflect: true })
203
209
  ], NileColumnRangeChart.prototype, "loading", void 0);
@@ -0,0 +1 @@
1
+ export declare const gridstackCss: import("lit").CSSResult;
@@ -0,0 +1,6 @@
1
+ // gridstack CSS inlined so it can be injected into the component's shadow root.
2
+ // Source: gridstack@12.6.0 dist/gridstack.min.css
3
+ // Re-paste from node_modules/gridstack/dist/gridstack.min.css when bumping the gridstack version.
4
+ import { unsafeCSS } from 'lit';
5
+ export const gridstackCss = unsafeCSS(`.grid-stack{position:relative}.grid-stack-rtl{direction:ltr}.grid-stack-rtl>.grid-stack-item{direction:rtl}.grid-stack-placeholder>.placeholder-content{background-color:rgba(0,0,0,.1);margin:0;position:absolute;width:auto;z-index:0!important}.grid-stack>.grid-stack-item{position:absolute;padding:0;top:0;width:var(--gs-column-width);height:var(--gs-cell-height)}.grid-stack>.grid-stack-item>.grid-stack-item-content{margin:0;position:absolute;width:auto;overflow-x:hidden;overflow-y:auto}.grid-stack>.grid-stack-item.size-to-content:not(.size-to-content-max)>.grid-stack-item-content{overflow-y:hidden}.grid-stack:not(.grid-stack-rtl)>.grid-stack-item{left:0}.grid-stack.grid-stack-rtl>.grid-stack-item{right:0}.grid-stack>.grid-stack-item>.grid-stack-item-content,.grid-stack>.grid-stack-placeholder>.placeholder-content{top:var(--gs-item-margin-top);right:var(--gs-item-margin-right);bottom:var(--gs-item-margin-bottom);left:var(--gs-item-margin-left)}.grid-stack-item>.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.grid-stack-item.ui-resizable-autohide>.ui-resizable-handle,.grid-stack-item.ui-resizable-disabled>.ui-resizable-handle{display:none}.grid-stack-item>.ui-resizable-ne,.grid-stack-item>.ui-resizable-nw,.grid-stack-item>.ui-resizable-se,.grid-stack-item>.ui-resizable-sw{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="%23666" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 20 20"><path d="m10 3 2 2H8l2-2v14l-2-2h4l-2 2"/></svg>');background-repeat:no-repeat;background-position:center}.grid-stack-item>.ui-resizable-ne{transform:rotate(45deg)}.grid-stack-item>.ui-resizable-sw{transform:rotate(45deg)}.grid-stack-item>.ui-resizable-nw{transform:rotate(-45deg)}.grid-stack-item>.ui-resizable-se{transform:rotate(-45deg)}.grid-stack-item>.ui-resizable-nw{cursor:nw-resize;width:20px;height:20px;top:var(--gs-item-margin-top);left:var(--gs-item-margin-left)}.grid-stack-item>.ui-resizable-n{cursor:n-resize;height:10px;top:var(--gs-item-margin-top);left:25px;right:25px}.grid-stack-item>.ui-resizable-ne{cursor:ne-resize;width:20px;height:20px;top:var(--gs-item-margin-top);right:var(--gs-item-margin-right)}.grid-stack-item>.ui-resizable-e{cursor:e-resize;width:10px;top:15px;bottom:15px;right:var(--gs-item-margin-right)}.grid-stack-item>.ui-resizable-se{cursor:se-resize;width:20px;height:20px;bottom:var(--gs-item-margin-bottom);right:var(--gs-item-margin-right)}.grid-stack-item>.ui-resizable-s{cursor:s-resize;height:10px;left:25px;bottom:var(--gs-item-margin-bottom);right:25px}.grid-stack-item>.ui-resizable-sw{cursor:sw-resize;width:20px;height:20px;bottom:var(--gs-item-margin-bottom);left:var(--gs-item-margin-left)}.grid-stack-item>.ui-resizable-w{cursor:w-resize;width:10px;top:15px;bottom:15px;left:var(--gs-item-margin-left)}.grid-stack-item.ui-draggable-dragging>.ui-resizable-handle{display:none!important}.grid-stack-item.ui-draggable-dragging{will-change:left,right,top}.grid-stack-item.ui-resizable-resizing{will-change:width,height}.ui-draggable-dragging,.ui-resizable-resizing{z-index:10000}.ui-draggable-dragging>.grid-stack-item-content,.ui-resizable-resizing>.grid-stack-item-content{box-shadow:1px 4px 6px rgba(0,0,0,.2);opacity:.8}.grid-stack-animate,.grid-stack-animate .grid-stack-item{transition:left .3s,right .3s,top .3s,height .3s,width .3s}.grid-stack-animate .grid-stack-item.grid-stack-placeholder,.grid-stack-animate .grid-stack-item.ui-draggable-dragging,.grid-stack-animate .grid-stack-item.ui-resizable-resizing{transition:left 0s,right 0s,top 0s,height 0s,width 0s}.grid-stack>.grid-stack-item[gs-y="0"]{top:0}.grid-stack:not(.grid-stack-rtl)>.grid-stack-item[gs-x="0"]{left:0}.grid-stack.grid-stack-rtl>.grid-stack-item[gs-x="0"]{right:0}`);
6
+ //# sourceMappingURL=gridstack-css.js.map
@@ -0,0 +1 @@
1
+ export { NileDashboardBuilder } from './nile-dashboard-builder.js';
@@ -0,0 +1,2 @@
1
+ export { NileDashboardBuilder } from './nile-dashboard-builder.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,96 @@
1
+ import { css } from 'lit';
2
+ export const styles = css `
3
+ :host {
4
+ display: block;
5
+ width: 100%;
6
+ }
7
+
8
+ :host([hidden]) {
9
+ display: none;
10
+ }
11
+
12
+ .grid-stack {
13
+ width: 100%;
14
+ min-height: var(--nile-dashboard-builder-min-height, var(--ng-spacing-20));
15
+ }
16
+
17
+ /* Grid-line overlay: one continuous line per cell boundary, using gridstack's
18
+ own layout variables so lines track the actual cells at any columns /
19
+ cell-height / gap. Shown when the gridlines attribute is present. */
20
+ :host([gridlines]) .grid-stack {
21
+ --_gl: var(--nile-dashboard-builder-grid-line, var(--ng-color-blue-200));
22
+ --_bw: var(--ng-border-width-1);
23
+ background-image:
24
+ linear-gradient(to right, var(--_gl) var(--_bw), transparent var(--_bw)),
25
+ linear-gradient(to bottom, var(--_gl) var(--_bw), transparent var(--_bw));
26
+ background-size: var(--gs-column-width) 100%, 100% var(--gs-cell-height);
27
+ background-repeat: repeat;
28
+ /* Close the right/bottom edges (the repeating lines only mark cell starts). */
29
+ box-shadow: inset 0 0 0 var(--_bw) var(--_gl);
30
+ }
31
+
32
+ /* Resize handles: keep the full hit areas and resize cursors, but render no
33
+ arrow icons — resizing works by grabbing an edge/corner directly. */
34
+ .grid-stack-item > .ui-resizable-handle {
35
+ background-image: none;
36
+ }
37
+
38
+ /* The cell wrapper hosts the widget viewer + the remove control. */
39
+ .nile-builder-cell {
40
+ position: relative;
41
+ width: 100%;
42
+ height: 100%;
43
+ }
44
+
45
+ /* Widgets fill the cell (gridstack absolutely-positions the content box). */
46
+ .nile-builder-cell > nile-widget-viewer {
47
+ display: block;
48
+ width: 100%;
49
+ height: 100%;
50
+ }
51
+ .nile-builder-remove {
52
+ position: absolute;
53
+ top: var(--ng-spacing-1);
54
+ right: var(--ng-spacing-1);
55
+ z-index: 2;
56
+ display: inline-flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ width: var(--ng-spacing-6);
60
+ height: var(--ng-spacing-6);
61
+ padding: var(--ng-spacing-0);
62
+ line-height: 1;
63
+ border: none;
64
+ border-radius: var(--ng-radius-xs);
65
+ cursor: pointer;
66
+ background: var(--ng-color-base-transparent);
67
+ color: var(--ng-colors-fg-primary-900);
68
+ transition: background var(--ng-transition-duration-fast) ease;
69
+ }
70
+
71
+ .nile-builder-remove:hover {
72
+ background: var(--ng-colors-bg-secondary);
73
+ }
74
+
75
+ @media (hover: hover) {
76
+ :host([remove-visibility='hover']) .nile-builder-remove {
77
+ opacity: 0;
78
+ transition:
79
+ opacity var(--ng-transition-duration-fast) ease,
80
+ background var(--ng-transition-duration-fast) ease;
81
+ }
82
+
83
+ :host([remove-visibility='hover']) .nile-builder-cell:hover .nile-builder-remove,
84
+ :host([remove-visibility='hover']) .nile-builder-remove:focus {
85
+ opacity: 1;
86
+ }
87
+ }
88
+
89
+ /* Hide the remove affordance when the builder is locked. display:none also
90
+ takes it out of the focus order, so this wins over the hover mode above
91
+ regardless of pointer type. */
92
+ :host(:not([editable])) .nile-builder-remove {
93
+ display: none;
94
+ }
95
+ `;
96
+ //# sourceMappingURL=nile-dashboard-builder.css.js.map