@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.
Files changed (121) hide show
  1. package/README.md +4 -0
  2. package/dist/src/index.d.ts +3 -0
  3. package/dist/src/index.js +2 -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/highcharts-provider.js +2 -0
  9. package/dist/src/internal/nile-chart-base.d.ts +43 -0
  10. package/dist/src/internal/nile-chart-base.js +67 -0
  11. package/dist/src/internal/resolve-widget-kind.d.ts +10 -0
  12. package/dist/src/internal/resolve-widget-kind.js +16 -0
  13. package/dist/src/internal/responsive-defaults.d.ts +32 -0
  14. package/dist/src/internal/responsive-defaults.js +255 -0
  15. package/dist/src/internal/types/highcharts-passthrough.type.d.ts +80 -0
  16. package/dist/src/internal/types/highcharts-passthrough.type.js +24 -0
  17. package/dist/src/internal/types/index.d.ts +2 -0
  18. package/dist/src/internal/types/index.js +1 -1
  19. package/dist/src/internal/types/widget-config.type.d.ts +14 -3
  20. package/dist/src/nile-anomaly-chart/nile-anomaly-chart.d.ts +2 -0
  21. package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +8 -1
  22. package/dist/src/nile-area-chart/nile-area-chart.d.ts +1 -0
  23. package/dist/src/nile-area-chart/nile-area-chart.js +7 -1
  24. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.d.ts +1 -0
  25. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +7 -1
  26. package/dist/src/nile-area-range-chart/nile-area-range-chart.d.ts +1 -0
  27. package/dist/src/nile-area-range-chart/nile-area-range-chart.js +7 -1
  28. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.d.ts +1 -0
  29. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +7 -1
  30. package/dist/src/nile-bar-chart/nile-bar-chart.d.ts +2 -0
  31. package/dist/src/nile-bar-chart/nile-bar-chart.js +8 -1
  32. package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.d.ts +1 -0
  33. package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +7 -1
  34. package/dist/src/nile-boxplot-chart/nile-boxplot-chart.d.ts +1 -0
  35. package/dist/src/nile-boxplot-chart/nile-boxplot-chart.js +7 -1
  36. package/dist/src/nile-bubble-chart/nile-bubble-chart.d.ts +1 -0
  37. package/dist/src/nile-bubble-chart/nile-bubble-chart.js +7 -1
  38. package/dist/src/nile-chart/nile-chart-config.d.ts +2 -2
  39. package/dist/src/nile-chart/nile-chart.css.js +3 -1
  40. package/dist/src/nile-chart/nile-chart.d.ts +59 -0
  41. package/dist/src/nile-chart/nile-chart.js +176 -3
  42. package/dist/src/nile-cluster-chart/nile-cluster-chart.d.ts +1 -0
  43. package/dist/src/nile-cluster-chart/nile-cluster-chart.js +7 -1
  44. package/dist/src/nile-column-chart/nile-column-chart.d.ts +1 -0
  45. package/dist/src/nile-column-chart/nile-column-chart.js +7 -1
  46. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.d.ts +1 -0
  47. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +8 -1
  48. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.d.ts +1 -0
  49. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +7 -1
  50. package/dist/src/nile-column-range-chart/nile-column-range-chart.d.ts +1 -0
  51. package/dist/src/nile-column-range-chart/nile-column-range-chart.js +7 -1
  52. package/dist/src/nile-dashboard-builder/nile-dashboard-builder.css.js +24 -8
  53. package/dist/src/nile-dashboard-builder/nile-dashboard-builder.d.ts +111 -0
  54. package/dist/src/nile-dashboard-builder/nile-dashboard-builder.js +188 -6
  55. package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +1 -0
  56. package/dist/src/nile-donut-chart/nile-donut-chart.js +7 -1
  57. package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.d.ts +1 -0
  58. package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.js +7 -1
  59. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.d.ts +1 -0
  60. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +7 -1
  61. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.d.ts +1 -0
  62. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +7 -1
  63. package/dist/src/nile-euler-chart/nile-euler-chart.d.ts +1 -0
  64. package/dist/src/nile-euler-chart/nile-euler-chart.js +7 -1
  65. package/dist/src/nile-fan-chart/nile-fan-chart.d.ts +1 -0
  66. package/dist/src/nile-fan-chart/nile-fan-chart.js +7 -1
  67. package/dist/src/nile-flame-chart/nile-flame-chart.d.ts +1 -0
  68. package/dist/src/nile-flame-chart/nile-flame-chart.js +7 -1
  69. package/dist/src/nile-funnel-chart/nile-funnel-chart.d.ts +1 -0
  70. package/dist/src/nile-funnel-chart/nile-funnel-chart.js +7 -1
  71. package/dist/src/nile-gauge-chart/nile-gauge-chart.d.ts +20 -0
  72. package/dist/src/nile-gauge-chart/nile-gauge-chart.js +80 -4
  73. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +1 -0
  74. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +7 -1
  75. package/dist/src/nile-histogram-chart/nile-histogram-chart.d.ts +1 -0
  76. package/dist/src/nile-histogram-chart/nile-histogram-chart.js +7 -1
  77. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.d.ts +1 -0
  78. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +7 -1
  79. package/dist/src/nile-line-chart/nile-line-chart.d.ts +1 -0
  80. package/dist/src/nile-line-chart/nile-line-chart.js +7 -1
  81. package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +1 -0
  82. package/dist/src/nile-line-column-chart/nile-line-column-chart.js +7 -1
  83. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.d.ts +1 -0
  84. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +7 -1
  85. package/dist/src/nile-map-chart/nile-map-chart.d.ts +23 -3
  86. package/dist/src/nile-map-chart/nile-map-chart.js +52 -12
  87. package/dist/src/nile-master-detail-chart/nile-master-detail-chart.css.js +13 -1
  88. package/dist/src/nile-master-detail-chart/nile-master-detail-chart.d.ts +1 -0
  89. package/dist/src/nile-master-detail-chart/nile-master-detail-chart.js +48 -4
  90. package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +1 -0
  91. package/dist/src/nile-organization-chart/nile-organization-chart.js +7 -1
  92. package/dist/src/nile-pie-chart/nile-pie-chart.d.ts +2 -0
  93. package/dist/src/nile-pie-chart/nile-pie-chart.js +8 -1
  94. package/dist/src/nile-polygon-chart/nile-polygon-chart.d.ts +1 -0
  95. package/dist/src/nile-polygon-chart/nile-polygon-chart.js +7 -1
  96. package/dist/src/nile-radar-chart/nile-radar-chart.d.ts +1 -0
  97. package/dist/src/nile-radar-chart/nile-radar-chart.js +7 -1
  98. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.d.ts +1 -0
  99. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +7 -1
  100. package/dist/src/nile-scatter-chart/nile-scatter-chart.d.ts +1 -0
  101. package/dist/src/nile-scatter-chart/nile-scatter-chart.js +7 -1
  102. package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.d.ts +1 -0
  103. package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.js +7 -1
  104. package/dist/src/nile-spline-chart/nile-spline-chart.d.ts +1 -0
  105. package/dist/src/nile-spline-chart/nile-spline-chart.js +7 -1
  106. package/dist/src/nile-stacked-chart/nile-stacked-chart.d.ts +1 -0
  107. package/dist/src/nile-stacked-chart/nile-stacked-chart.js +7 -1
  108. package/dist/src/nile-timeline-chart/nile-timeline-chart.d.ts +1 -0
  109. package/dist/src/nile-timeline-chart/nile-timeline-chart.js +7 -1
  110. package/dist/src/nile-trendline-chart/nile-trendline-chart.d.ts +2 -0
  111. package/dist/src/nile-trendline-chart/nile-trendline-chart.js +8 -1
  112. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.d.ts +1 -0
  113. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +7 -1
  114. package/dist/src/nile-vector-chart/nile-vector-chart.d.ts +1 -0
  115. package/dist/src/nile-vector-chart/nile-vector-chart.js +7 -1
  116. package/dist/src/nile-waterfall-chart/nile-waterfall-chart.d.ts +1 -0
  117. package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +7 -1
  118. package/dist/src/nile-widget-viewer/nile-widget-viewer.js +6 -6
  119. package/dist/src/nile-xrange-chart/nile-xrange-chart.d.ts +1 -0
  120. package/dist/src/nile-xrange-chart/nile-xrange-chart.js +7 -1
  121. package/package.json +1 -1
@@ -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-area-spline-chart.css.js';
9
10
  let NileAreaSplineChart = class NileAreaSplineChart extends NileElement {
10
11
  constructor() {
@@ -18,6 +19,7 @@ let NileAreaSplineChart = class NileAreaSplineChart 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 = '';
@@ -122,7 +124,7 @@ let NileAreaSplineChart = class NileAreaSplineChart extends NileElement {
122
124
  }
123
125
  buildOptions() {
124
126
  const self = this;
125
- return deepMerge({
127
+ const merged = deepMerge({
126
128
  chart: { type: 'areaspline', ...(this.height ? { height: this.height } : {}) },
127
129
  title: { text: this.chartTitle || undefined },
128
130
  subtitle: { text: this.chartSubtitle || undefined },
@@ -156,6 +158,7 @@ let NileAreaSplineChart = class NileAreaSplineChart extends NileElement {
156
158
  legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
157
159
  credits: { enabled: false },
158
160
  }, this.options);
161
+ return withResponsiveDefaults(merged, 'areaSpline', this.noResponsive);
159
162
  }
160
163
  async initChart() {
161
164
  if (this.loading || !this.chartContainer)
@@ -200,6 +203,9 @@ __decorate([
200
203
  __decorate([
201
204
  property({ type: Object })
202
205
  ], NileAreaSplineChart.prototype, "options", void 0);
206
+ __decorate([
207
+ property({ type: Boolean, attribute: 'no-responsive' })
208
+ ], NileAreaSplineChart.prototype, "noResponsive", void 0);
203
209
  __decorate([
204
210
  property({ type: Boolean, reflect: true })
205
211
  ], NileAreaSplineChart.prototype, "loading", void 0);
@@ -25,6 +25,8 @@ export declare class NileBarChart extends NileElement {
25
25
  categories: string[];
26
26
  /** Deep-merge override object for full Highcharts options. */
27
27
  options: Highcharts.Options;
28
+ /** Opts out of the built-in responsive rules — the chart still reflows, it just keeps its full legend/axis chrome at every size. */
29
+ noResponsive: boolean;
28
30
  /** Whether to show a loading indicator instead of the chart. */
29
31
  loading: boolean;
30
32
  /** CSS height for the chart container. */
@@ -4,6 +4,7 @@ import { html } from 'lit';
4
4
  import NileElement from '../internal/nile-element.js';
5
5
  import { getHighcharts } from '../internal/highcharts-provider.js';
6
6
  import { deepMerge } from '../internal/utils.js';
7
+ import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
7
8
  import { styles } from './nile-bar-chart.css.js';
8
9
  let NileBarChart = class NileBarChart extends NileElement {
9
10
  constructor() {
@@ -23,6 +24,8 @@ let NileBarChart = class NileBarChart extends NileElement {
23
24
  this.categories = [];
24
25
  /** Deep-merge override object for full Highcharts options. */
25
26
  this.options = {};
27
+ /** Opts out of the built-in responsive rules — the chart still reflows, it just keeps its full legend/axis chrome at every size. */
28
+ this.noResponsive = false;
26
29
  /** Whether to show a loading indicator instead of the chart. */
27
30
  this.loading = false;
28
31
  /** CSS height for the chart container. */
@@ -235,7 +238,8 @@ let NileBarChart = class NileBarChart extends NileElement {
235
238
  enabled: false,
236
239
  },
237
240
  };
238
- return deepMerge(defaults, this.options);
241
+ const merged = deepMerge(defaults, this.options);
242
+ return withResponsiveDefaults(merged, 'bar', this.noResponsive);
239
243
  }
240
244
  async initChart() {
241
245
  if (this.loading || !this.chartContainer)
@@ -280,6 +284,9 @@ __decorate([
280
284
  __decorate([
281
285
  property({ type: Object })
282
286
  ], NileBarChart.prototype, "options", void 0);
287
+ __decorate([
288
+ property({ type: Boolean, attribute: 'no-responsive' })
289
+ ], NileBarChart.prototype, "noResponsive", void 0);
283
290
  __decorate([
284
291
  property({ type: Boolean, reflect: true })
285
292
  ], NileBarChart.prototype, "loading", void 0);
@@ -17,6 +17,7 @@ export declare class NileBellcurveChart extends NileElement {
17
17
  /** Raw numeric observations; mean and standard deviation are derived for the fitted curve. */
18
18
  data: BellcurveSamples;
19
19
  options: Highcharts.Options;
20
+ noResponsive: boolean;
20
21
  loading: boolean;
21
22
  height: string;
22
23
  xAxisTitle: 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-bellcurve-chart.css.js';
9
10
  const BELLCURVE_BASE_ID = 'nile-bellcurve-base';
10
11
  let NileBellcurveChart = class NileBellcurveChart extends NileElement {
@@ -20,6 +21,7 @@ let NileBellcurveChart = class NileBellcurveChart extends NileElement {
20
21
  /** Raw numeric observations; mean and standard deviation are derived for the fitted curve. */
21
22
  this.data = [];
22
23
  this.options = {};
24
+ this.noResponsive = false;
23
25
  this.loading = false;
24
26
  this.height = '400px';
25
27
  this.xAxisTitle = '';
@@ -146,7 +148,7 @@ let NileBellcurveChart = class NileBellcurveChart extends NileElement {
146
148
  const scatterData = sorted.map(v => [v, v]);
147
149
  const pts = this.pointsInInterval > 0 ? this.pointsInInterval : 40;
148
150
  const iv = this.intervals > 0 ? this.intervals : 3;
149
- return deepMerge({
151
+ const merged = deepMerge({
150
152
  chart: { ...(this.height ? { height: this.height } : {}) },
151
153
  title: { text: this.chartTitle || undefined },
152
154
  subtitle: { text: this.chartSubtitle || undefined },
@@ -220,6 +222,7 @@ let NileBellcurveChart = class NileBellcurveChart extends NileElement {
220
222
  ],
221
223
  credits: { enabled: false },
222
224
  }, this.options);
225
+ return withResponsiveDefaults(merged, 'bellcurve', this.noResponsive);
223
226
  }
224
227
  async initChart() {
225
228
  if (this.loading || !this.chartContainer)
@@ -261,6 +264,9 @@ __decorate([
261
264
  __decorate([
262
265
  property({ type: Object })
263
266
  ], NileBellcurveChart.prototype, "options", void 0);
267
+ __decorate([
268
+ property({ type: Boolean, attribute: 'no-responsive' })
269
+ ], NileBellcurveChart.prototype, "noResponsive", void 0);
264
270
  __decorate([
265
271
  property({ type: Boolean, reflect: true })
266
272
  ], NileBellcurveChart.prototype, "loading", void 0);
@@ -31,6 +31,7 @@ export declare class NileBoxplotChart extends NileElement {
31
31
  categories: string[];
32
32
  data: BoxplotSeriesData[];
33
33
  options: Highcharts.Options;
34
+ noResponsive: boolean;
34
35
  loading: boolean;
35
36
  height: string;
36
37
  xAxisTitle: 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-boxplot-chart.css.js';
9
10
  let NileBoxplotChart = class NileBoxplotChart extends NileElement {
10
11
  constructor() {
@@ -19,6 +20,7 @@ let NileBoxplotChart = class NileBoxplotChart extends NileElement {
19
20
  this.categories = [];
20
21
  this.data = [];
21
22
  this.options = {};
23
+ this.noResponsive = false;
22
24
  this.loading = false;
23
25
  this.height = '400px';
24
26
  this.xAxisTitle = '';
@@ -157,7 +159,7 @@ let NileBoxplotChart = class NileBoxplotChart extends NileElement {
157
159
  title: { text: this.yAxisTitle || undefined },
158
160
  gridLineWidth: 1,
159
161
  };
160
- return deepMerge({
162
+ const merged = deepMerge({
161
163
  chart: {
162
164
  type: 'boxplot',
163
165
  ...(this.height ? { height: this.height } : {}),
@@ -207,6 +209,7 @@ let NileBoxplotChart = class NileBoxplotChart extends NileElement {
207
209
  series: this.mapSeries(),
208
210
  credits: { enabled: false },
209
211
  }, this.options);
212
+ return withResponsiveDefaults(merged, 'boxplot', this.noResponsive);
210
213
  }
211
214
  async initChart() {
212
215
  if (this.loading || !this.chartContainer)
@@ -251,6 +254,9 @@ __decorate([
251
254
  __decorate([
252
255
  property({ type: Object })
253
256
  ], NileBoxplotChart.prototype, "options", void 0);
257
+ __decorate([
258
+ property({ type: Boolean, attribute: 'no-responsive' })
259
+ ], NileBoxplotChart.prototype, "noResponsive", void 0);
254
260
  __decorate([
255
261
  property({ type: Boolean, reflect: true })
256
262
  ], NileBoxplotChart.prototype, "loading", void 0);
@@ -19,6 +19,7 @@ export declare class NileBubbleChart extends NileElement {
19
19
  chartSubtitle: string;
20
20
  data: BubbleChartSeriesData[];
21
21
  options: Highcharts.Options;
22
+ noResponsive: boolean;
22
23
  loading: boolean;
23
24
  height: string;
24
25
  xAxisTitle: 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-bubble-chart.css.js';
8
9
  let NileBubbleChart = class NileBubbleChart extends NileElement {
9
10
  constructor() {
@@ -17,6 +18,7 @@ let NileBubbleChart = class NileBubbleChart 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.xAxisTitle = '';
@@ -155,7 +157,7 @@ let NileBubbleChart = class NileBubbleChart extends NileElement {
155
157
  }
156
158
  buildOptions() {
157
159
  const self = this;
158
- return deepMerge({
160
+ const merged = deepMerge({
159
161
  chart: { type: 'bubble', ...(this.height ? { height: this.height } : {}), zoomType: 'xy' },
160
162
  title: { text: this.chartTitle || undefined },
161
163
  subtitle: { text: this.chartSubtitle || undefined },
@@ -175,6 +177,7 @@ let NileBubbleChart = class NileBubbleChart extends NileElement {
175
177
  legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
176
178
  credits: { enabled: false },
177
179
  }, this.options);
180
+ return withResponsiveDefaults(merged, 'bubble', this.noResponsive);
178
181
  }
179
182
  async initChart() {
180
183
  if (this.loading || !this.chartContainer)
@@ -213,6 +216,9 @@ __decorate([
213
216
  __decorate([
214
217
  property({ type: Object })
215
218
  ], NileBubbleChart.prototype, "options", void 0);
219
+ __decorate([
220
+ property({ type: Boolean, attribute: 'no-responsive' })
221
+ ], NileBubbleChart.prototype, "noResponsive", void 0);
216
222
  __decorate([
217
223
  property({ type: Boolean, reflect: true })
218
224
  ], NileBubbleChart.prototype, "loading", void 0);
@@ -3,7 +3,7 @@ import type { ChartConfigType } from '../internal/types/chart-config.type.js';
3
3
  export type ChartType = ChartConfigType['type'];
4
4
  import type { BarChartSeriesData } from '../nile-bar-chart/nile-bar-chart.js';
5
5
  import type { PieChartSeriesData } from '../nile-pie-chart/nile-pie-chart.js';
6
- import type { LegendConfig, ChartSpacingConfig } from '../internal/types/index.js';
6
+ import type { LegendConfig, ChartSpacingConfig, HighchartsPassthroughConfig } from '../internal/types/index.js';
7
7
  import type { TrendlineSeriesData, ForecastConfig } from '../nile-trendline-chart/nile-trendline-chart.js';
8
8
  import type { AnomalySeriesData, AnomalyConfig } from '../nile-anomaly-chart/nile-anomaly-chart.js';
9
9
  import type { LineChartSeriesData } from '../nile-line-chart/nile-line-chart.js';
@@ -147,7 +147,7 @@ export interface NileAiConfig {
147
147
  placeholder?: string;
148
148
  welcomeMessage?: string;
149
149
  }
150
- export interface NileChartConfigBase {
150
+ export interface NileChartConfigBase extends HighchartsPassthroughConfig {
151
151
  chartTitle?: string;
152
152
  chartSubtitle?: string;
153
153
  /** Font size for the header title (number → px, or any CSS length string). */
@@ -105,6 +105,7 @@ export const styles = css `
105
105
  :host([fit]) .nile-chart-card {
106
106
  display: flex;
107
107
  flex-direction: column;
108
+ box-sizing: border-box;
108
109
  height: 100%;
109
110
  }
110
111
 
@@ -241,7 +242,8 @@ export const styles = css `
241
242
  padding-top: 0;
242
243
  }
243
244
 
244
- :host([no-padding]) .nile-chart-inner {
245
+ :host([no-padding]) .nile-chart-inner,
246
+ :host([minimized]) .nile-chart-inner {
245
247
  padding: 0;
246
248
  }
247
249
 
@@ -2,6 +2,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
2
2
  import NileElement from '../internal/nile-element.js';
3
3
  import type { NileChartConfig, NileChartMenuConfig } from './nile-chart-config.js';
4
4
  import type { NileChartConfigInputType } from '../internal/types/index.js';
5
+ import { type ChartExtremes, type SetExtremesOptions } from '../internal/chart-runtime.js';
5
6
  import '../nile-bar-chart/index.js';
6
7
  import '../nile-pie-chart/index.js';
7
8
  import '../nile-trendline-chart/index.js';
@@ -102,6 +103,19 @@ export declare class NileChart extends NileElement {
102
103
  noHeader: boolean;
103
104
  noPadding: boolean;
104
105
  appearance: string | null;
106
+ /**
107
+ * Opt-in double-tap-to-minimize gesture. Double-tap the header to hide it —
108
+ * the plot expands to fill the freed space; double-tap the chart again to
109
+ * bring the header back. Off by default.
110
+ */
111
+ minimizeOnDoubleTap: boolean;
112
+ /**
113
+ * Minimized state — header hidden and body padding removed so the plot fills
114
+ * the card. Reflected as the `minimized` attribute; set it directly to control
115
+ * minimize programmatically, or let the double-tap gesture toggle it when
116
+ * `minimizeOnDoubleTap` is on. Emits `nile-chart-minimize` on every change.
117
+ */
118
+ minimized: boolean;
105
119
  /**
106
120
  * When set, fills `chart.type` if the config omits it (same values as `chart.type`, e.g. `stacked`, `pie`).
107
121
  * Usage: `<nile-chart chart-type="pie" />` plus `config.chart` with series data only.
@@ -138,9 +152,25 @@ export declare class NileChart extends NileElement {
138
152
  /** AI panel shows when ai.enabled is true OR when a summary is provided. */
139
153
  private get aiEnabled();
140
154
  private handleOutsideClick;
155
+ private _readyResolvers;
156
+ private _extremesDisposers;
141
157
  private handleChartReady;
158
+ /**
159
+ * Re-emit Highcharts' `afterSetExtremes` (fired on zoom/pan/navigator) as the
160
+ * `nile-extremes-change` Nile event, so consumers can sync a shared range
161
+ * across panels. Uses `Highcharts.addEvent`, which stacks on top of any
162
+ * handler the consumer already set — it never overrides existing behavior.
163
+ */
164
+ private _wireExtremesEvents;
165
+ private _teardownExtremesEvents;
142
166
  connectedCallback(): void;
143
167
  disconnectedCallback(): void;
168
+ /**
169
+ * Double-tap gesture (opt-in via `minimizeOnDoubleTap`): toggle the minimized
170
+ * state. When the header is showing, only a double-tap ON the header
171
+ * minimizes; when it's hidden, a double-tap anywhere restores it.
172
+ */
173
+ private _onDoubleTap;
144
174
  private mergeChartTypeFromAttr;
145
175
  /** Resolve { chart, aq } input to flat NileChartConfig. */
146
176
  private resolveConfig;
@@ -150,6 +180,35 @@ export declare class NileChart extends NileElement {
150
180
  private toggleChat;
151
181
  /** Push an AI response into the chat panel. Call this from your AI handler. */
152
182
  addAiResponse(text: string): void;
183
+ /**
184
+ * The underlying `Highcharts.Chart` instance for the currently rendered chart,
185
+ * or `null` until it's ready. Use this to reach any native Highcharts API
186
+ * (`series.setData`, `mapView.fitToBounds`, etc.). Read-only.
187
+ */
188
+ get chart(): any;
189
+ /**
190
+ * Resolves with the `Highcharts.Chart` instance once it's ready (immediately if
191
+ * it already exists). On a chart-type switch a new instance is created; this
192
+ * resolves with the current-or-next instance.
193
+ */
194
+ whenReady(): Promise<any>;
195
+ /**
196
+ * Read the current extremes of an axis (default: primary x-axis). Returns
197
+ * `null` when the chart isn't ready or the axis doesn't exist (e.g. pie/gauge).
198
+ */
199
+ getExtremes(axis?: number, dimension?: 'x' | 'y'): ChartExtremes | null;
200
+ /**
201
+ * Set the extremes (zoom/pan range) of an axis — useful for syncing a shared
202
+ * range across panels in response to `nile-extremes-change`. Safe no-op if the
203
+ * chart isn't ready or the axis doesn't exist. Pass `null` to reset a bound.
204
+ */
205
+ setExtremes(min: number | null, max: number | null, opts?: SetExtremesOptions): void;
206
+ /**
207
+ * Force the chart to re-read inherited styles/CSS variables and redraw. Call
208
+ * this after your app toggles light/dark theme. Safe no-op until the chart is
209
+ * ready.
210
+ */
211
+ refreshTheme(): void;
153
212
  private handleAiSend;
154
213
  private switchType;
155
214
  private get headerTitle();
@@ -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;