@aquera/nile-visualization 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/src/nile-anomaly-chart/nile-anomaly-chart.d.ts +4 -0
  2. package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +12 -0
  3. package/dist/src/nile-area-chart/nile-area-chart.d.ts +2 -0
  4. package/dist/src/nile-area-chart/nile-area-chart.js +6 -1
  5. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.d.ts +4 -0
  6. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +12 -0
  7. package/dist/src/nile-area-range-chart/nile-area-range-chart.d.ts +4 -0
  8. package/dist/src/nile-area-range-chart/nile-area-range-chart.js +12 -0
  9. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.d.ts +4 -0
  10. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +12 -0
  11. package/dist/src/nile-bar-chart/nile-bar-chart.d.ts +2 -0
  12. package/dist/src/nile-bar-chart/nile-bar-chart.js +9 -1
  13. package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.d.ts +2 -0
  14. package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +6 -1
  15. package/dist/src/nile-boxplot-chart/nile-boxplot-chart.d.ts +2 -0
  16. package/dist/src/nile-boxplot-chart/nile-boxplot-chart.js +6 -1
  17. package/dist/src/nile-bubble-chart/nile-bubble-chart.d.ts +2 -0
  18. package/dist/src/nile-bubble-chart/nile-bubble-chart.js +6 -1
  19. package/dist/src/nile-chart/nile-chart-config.d.ts +8 -4
  20. package/dist/src/nile-chart/nile-chart.css.js +13 -15
  21. package/dist/src/nile-chart/nile-chart.js +103 -33
  22. package/dist/src/nile-cluster-chart/nile-cluster-chart.d.ts +2 -0
  23. package/dist/src/nile-cluster-chart/nile-cluster-chart.js +6 -1
  24. package/dist/src/nile-column-chart/nile-column-chart.d.ts +2 -0
  25. package/dist/src/nile-column-chart/nile-column-chart.js +6 -1
  26. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.d.ts +4 -0
  27. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +12 -1
  28. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.d.ts +4 -0
  29. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +13 -1
  30. package/dist/src/nile-column-range-chart/nile-column-range-chart.d.ts +4 -0
  31. package/dist/src/nile-column-range-chart/nile-column-range-chart.js +12 -0
  32. package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +2 -0
  33. package/dist/src/nile-donut-chart/nile-donut-chart.js +6 -0
  34. package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.d.ts +3 -0
  35. package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.js +6 -1
  36. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.d.ts +3 -0
  37. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +6 -1
  38. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.d.ts +3 -0
  39. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +6 -1
  40. package/dist/src/nile-euler-chart/nile-euler-chart.d.ts +4 -0
  41. package/dist/src/nile-euler-chart/nile-euler-chart.js +13 -1
  42. package/dist/src/nile-fan-chart/nile-fan-chart.d.ts +3 -0
  43. package/dist/src/nile-fan-chart/nile-fan-chart.js +6 -1
  44. package/dist/src/nile-flame-chart/nile-flame-chart.d.ts +4 -0
  45. package/dist/src/nile-flame-chart/nile-flame-chart.js +12 -1
  46. package/dist/src/nile-funnel-chart/nile-funnel-chart.d.ts +4 -0
  47. package/dist/src/nile-funnel-chart/nile-funnel-chart.js +12 -1
  48. package/dist/src/nile-gauge-chart/nile-gauge-chart.d.ts +4 -0
  49. package/dist/src/nile-gauge-chart/nile-gauge-chart.js +13 -1
  50. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +2 -0
  51. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +6 -1
  52. package/dist/src/nile-histogram-chart/nile-histogram-chart.d.ts +2 -0
  53. package/dist/src/nile-histogram-chart/nile-histogram-chart.js +6 -1
  54. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.d.ts +4 -0
  55. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +12 -0
  56. package/dist/src/nile-kpi-chart/nile-kpi-chart.d.ts +10 -0
  57. package/dist/src/nile-kpi-chart/nile-kpi-chart.js +36 -5
  58. package/dist/src/nile-line-chart/nile-line-chart.d.ts +2 -0
  59. package/dist/src/nile-line-chart/nile-line-chart.js +6 -1
  60. package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +4 -0
  61. package/dist/src/nile-line-column-chart/nile-line-column-chart.js +12 -1
  62. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.d.ts +4 -0
  63. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +13 -2
  64. package/dist/src/nile-map-chart/nile-map-chart.d.ts +4 -0
  65. package/dist/src/nile-map-chart/nile-map-chart.js +12 -3
  66. package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +4 -0
  67. package/dist/src/nile-organization-chart/nile-organization-chart.js +12 -0
  68. package/dist/src/nile-pie-chart/nile-pie-chart.d.ts +53 -0
  69. package/dist/src/nile-pie-chart/nile-pie-chart.js +9 -0
  70. package/dist/src/nile-polygon-chart/nile-polygon-chart.d.ts +4 -0
  71. package/dist/src/nile-polygon-chart/nile-polygon-chart.js +12 -0
  72. package/dist/src/nile-radar-chart/nile-radar-chart.d.ts +2 -0
  73. package/dist/src/nile-radar-chart/nile-radar-chart.js +6 -1
  74. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.d.ts +2 -0
  75. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +6 -1
  76. package/dist/src/nile-scatter-chart/nile-scatter-chart.d.ts +2 -0
  77. package/dist/src/nile-scatter-chart/nile-scatter-chart.js +6 -1
  78. package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.d.ts +2 -0
  79. package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.js +6 -1
  80. package/dist/src/nile-spline-chart/nile-spline-chart.d.ts +2 -0
  81. package/dist/src/nile-spline-chart/nile-spline-chart.js +6 -1
  82. package/dist/src/nile-stacked-chart/nile-stacked-chart.d.ts +2 -0
  83. package/dist/src/nile-stacked-chart/nile-stacked-chart.js +6 -1
  84. package/dist/src/nile-timeline-chart/nile-timeline-chart.d.ts +3 -0
  85. package/dist/src/nile-timeline-chart/nile-timeline-chart.js +6 -1
  86. package/dist/src/nile-trendline-chart/nile-trendline-chart.d.ts +4 -0
  87. package/dist/src/nile-trendline-chart/nile-trendline-chart.js +12 -0
  88. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.d.ts +2 -0
  89. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +6 -1
  90. package/dist/src/nile-vector-chart/nile-vector-chart.d.ts +4 -0
  91. package/dist/src/nile-vector-chart/nile-vector-chart.js +12 -0
  92. package/dist/src/nile-waterfall-chart/nile-waterfall-chart.d.ts +2 -0
  93. package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +6 -1
  94. package/dist/src/nile-xrange-chart/nile-xrange-chart.d.ts +2 -0
  95. package/dist/src/nile-xrange-chart/nile-xrange-chart.js +6 -1
  96. package/package.json +1 -1
@@ -2,6 +2,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
2
2
  import type Highcharts from 'highcharts';
3
3
  import NileElement from '../internal/nile-element.js';
4
4
  import type { SeparatedChartConfigInputType } from '../internal/types/index.js';
5
+ import type { LegendConfig } from '../nile-pie-chart/nile-pie-chart.js';
5
6
  export interface InvertedAreaChartSeriesData {
6
7
  name: string;
7
8
  data: number[];
@@ -34,6 +35,9 @@ export declare class NileInvertedAreaChart extends NileElement {
34
35
  loadingFontSize: string | number;
35
36
  loadingFontFamily: string;
36
37
  loadingBg: string;
38
+ showLegend: boolean;
39
+ /** Full legend configuration — all Highcharts legend options in one object. */
40
+ legend: LegendConfig | null;
37
41
  private _syncCssVars;
38
42
  connectedCallback(): void;
39
43
  disconnectedCallback(): void;
@@ -35,6 +35,9 @@ let NileInvertedAreaChart = class NileInvertedAreaChart extends NileElement {
35
35
  this.loadingFontSize = '';
36
36
  this.loadingFontFamily = '';
37
37
  this.loadingBg = '';
38
+ this.showLegend = true;
39
+ /** Full legend configuration — all Highcharts legend options in one object. */
40
+ this.legend = null;
38
41
  }
39
42
  _syncCssVars() {
40
43
  const set = (prop, val) => {
@@ -88,6 +91,8 @@ let NileInvertedAreaChart = class NileInvertedAreaChart extends NileElement {
88
91
  'yAxisTitle',
89
92
  'stacked',
90
93
  'loading',
94
+ 'showLegend',
95
+ 'legend',
91
96
  ];
92
97
  const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
93
98
  'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
@@ -147,6 +152,7 @@ let NileInvertedAreaChart = class NileInvertedAreaChart extends NileElement {
147
152
  data: s.data,
148
153
  color: s.color,
149
154
  })),
155
+ legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
150
156
  credits: { enabled: false },
151
157
  }, this.options);
152
158
  }
@@ -238,6 +244,12 @@ __decorate([
238
244
  __decorate([
239
245
  property({ type: String, attribute: 'loading-bg' })
240
246
  ], NileInvertedAreaChart.prototype, "loadingBg", void 0);
247
+ __decorate([
248
+ property({ type: Boolean, attribute: 'show-legend' })
249
+ ], NileInvertedAreaChart.prototype, "showLegend", void 0);
250
+ __decorate([
251
+ property({ type: Object })
252
+ ], NileInvertedAreaChart.prototype, "legend", void 0);
241
253
  NileInvertedAreaChart = __decorate([
242
254
  customElement('nile-inverted-area-chart')
243
255
  ], NileInvertedAreaChart);
@@ -6,6 +6,7 @@ export type TrendDirection = 'up' | 'down' | 'neutral';
6
6
  export type KpiVariant = 'default' | 'card' | 'gauge' | 'accent';
7
7
  export type SparklineType = 'area' | 'line';
8
8
  export type KpiValueFormat = 'auto' | 'K' | 'M' | 'B' | 'T' | 'none';
9
+ export type KpiNumberSystem = 'indian' | 'international';
9
10
  /** `chart` slice for `<nile-kpi-chart>.config` (discriminated by `type: 'kpi'`). */
10
11
  export interface ChartKpiSeparatedPayload {
11
12
  type: 'kpi';
@@ -101,6 +102,11 @@ export interface ChartKpiSeparatedPayload {
101
102
  * (L, g, m, Pa, Hz, B, etc.). For non-unit suffix text (%, /day), use `suffix` instead.
102
103
  */
103
104
  unit?: string;
105
+ /**
106
+ * Number system for formatting. 'indian' uses Indian grouping (1,00,000) and L/Cr abbreviations.
107
+ * 'international' (default) uses standard grouping (100,000) and K/M/B/T abbreviations.
108
+ */
109
+ numberSystem?: KpiNumberSystem;
104
110
  }
105
111
  /** Separated `{ chart, aq }` input for `<nile-kpi-chart>`. */
106
112
  export interface NileKpiConfigInputType {
@@ -235,6 +241,8 @@ export declare class NileKpiChart extends NileElement {
235
241
  precision: number | null;
236
242
  /** BCP 47 locale for number formatting, e.g. 'en-IN'. Defaults to browser locale. */
237
243
  locale: string;
244
+ /** Number system: 'indian' (1,00,000 / L / Cr) or 'international' (100,000 / K / M / B / T). */
245
+ numberSystem: KpiNumberSystem;
238
246
  /**
239
247
  * Set by nile-chart: skip host border/shadow (variant card/gauge) so the parent chart-card is the only frame.
240
248
  */
@@ -245,6 +253,8 @@ export declare class NileKpiChart extends NileElement {
245
253
  private _syncCssVars;
246
254
  private formatCssLength;
247
255
  private parseNumericValue;
256
+ private get _effectiveNumberSystem();
257
+ private get _effectiveLocale();
248
258
  private formatTooltipNumber;
249
259
  private inferSparklineTooltipScale;
250
260
  private getTooltipContent;
@@ -134,6 +134,8 @@ let NileKpiChart = class NileKpiChart extends NileElement {
134
134
  this.precision = null;
135
135
  /** BCP 47 locale for number formatting, e.g. 'en-IN'. Defaults to browser locale. */
136
136
  this.locale = '';
137
+ /** Number system: 'indian' (1,00,000 / L / Cr) or 'international' (100,000 / K / M / B / T). */
138
+ this.numberSystem = 'international';
137
139
  /**
138
140
  * Set by nile-chart: skip host border/shadow (variant card/gauge) so the parent chart-card is the only frame.
139
141
  */
@@ -279,9 +281,22 @@ let NileKpiChart = class NileKpiChart extends NileElement {
279
281
  const n = Number(cleaned);
280
282
  return Number.isFinite(n) ? n : null;
281
283
  }
284
+ get _effectiveNumberSystem() {
285
+ if (this.numberSystem === 'indian') {
286
+ const p = (this.prefix ?? '').trim();
287
+ if (p === '₹' || /^Rs\.?\s*$/i.test(p) || /^INR\s*$/i.test(p))
288
+ return 'indian';
289
+ }
290
+ return 'international';
291
+ }
292
+ get _effectiveLocale() {
293
+ if (this.locale)
294
+ return this.locale;
295
+ return this._effectiveNumberSystem === 'indian' ? 'en-IN' : undefined;
296
+ }
282
297
  formatTooltipNumber(n) {
283
298
  const maxFractionDigits = Number.isInteger(n) ? 0 : 6;
284
- const grouped = new Intl.NumberFormat(this.locale || undefined, {
299
+ const grouped = new Intl.NumberFormat(this._effectiveLocale, {
285
300
  useGrouping: true,
286
301
  minimumFractionDigits: 0,
287
302
  maximumFractionDigits: maxFractionDigits,
@@ -320,16 +335,16 @@ let NileKpiChart = class NileKpiChart extends NileElement {
320
335
  const abs = Math.abs(raw);
321
336
  const sign = raw < 0 ? '-' : '';
322
337
  const maxFrac = Number.isInteger(raw) ? 0 : 6;
323
- const tooltipLocale = this.locale || undefined;
324
- const displayLocale = this.locale || undefined;
325
- const full = `${new Intl.NumberFormat(tooltipLocale, {
338
+ const effectiveLocale = this._effectiveLocale;
339
+ const full = `${new Intl.NumberFormat(effectiveLocale, {
326
340
  useGrouping: true, minimumFractionDigits: 0, maximumFractionDigits: maxFrac,
327
341
  }).format(raw)}${baseUnit}`;
328
- const display0 = `${new Intl.NumberFormat(displayLocale, {
342
+ const display0 = `${new Intl.NumberFormat(effectiveLocale, {
329
343
  useGrouping: true, minimumFractionDigits: 0, maximumFractionDigits: maxFrac,
330
344
  }).format(raw)}${baseUnit}`;
331
345
  if (fmt === 'none')
332
346
  return { display: display0, full, abbreviated: false };
347
+ const isIndian = this._effectiveNumberSystem === 'indian';
333
348
  let divisor = 0;
334
349
  let magnitude = '';
335
350
  if (fmt === 'K') {
@@ -348,6 +363,17 @@ let NileKpiChart = class NileKpiChart extends NileElement {
348
363
  divisor = 1e12;
349
364
  magnitude = 'T';
350
365
  }
366
+ else if (isIndian) {
367
+ // Indian: Crore (1e7) then Lakh (1e5)
368
+ if (abs >= 1e7) {
369
+ divisor = 1e7;
370
+ magnitude = 'Cr';
371
+ }
372
+ else if (abs >= 1e5) {
373
+ divisor = 1e5;
374
+ magnitude = 'L';
375
+ }
376
+ }
351
377
  else {
352
378
  if (abs >= 1e12) {
353
379
  divisor = 1e12;
@@ -519,6 +545,8 @@ let NileKpiChart = class NileKpiChart extends NileElement {
519
545
  this.locale = c.locale;
520
546
  if (c.unit !== undefined)
521
547
  this.unit = c.unit;
548
+ if (c.numberSystem !== undefined)
549
+ this.numberSystem = c.numberSystem;
522
550
  if ('height' in c) {
523
551
  const h = this.formatCssLength(c.height);
524
552
  if (h) {
@@ -1042,6 +1070,9 @@ __decorate([
1042
1070
  __decorate([
1043
1071
  property({ type: String })
1044
1072
  ], NileKpiChart.prototype, "locale", void 0);
1073
+ __decorate([
1074
+ property({ type: String, attribute: 'number-system' })
1075
+ ], NileKpiChart.prototype, "numberSystem", void 0);
1045
1076
  __decorate([
1046
1077
  property({ type: Boolean, reflect: true, attribute: 'embed-in-nile-chart' })
1047
1078
  ], NileKpiChart.prototype, "embedInNileChart", void 0);
@@ -24,6 +24,8 @@ export declare class NileLineChart extends NileElement {
24
24
  height: string;
25
25
  yAxisTitle: string;
26
26
  showLegend: boolean;
27
+ /** Full legend configuration — all Highcharts legend options in one object. */
28
+ legend: import('../nile-pie-chart/nile-pie-chart.js').LegendConfig | null;
27
29
  chartBg: string;
28
30
  chartBorderRadius: string | number;
29
31
  chartBorder: string;
@@ -22,6 +22,8 @@ let NileLineChart = class NileLineChart extends NileElement {
22
22
  this.height = '400px';
23
23
  this.yAxisTitle = '';
24
24
  this.showLegend = true;
25
+ /** Full legend configuration — all Highcharts legend options in one object. */
26
+ this.legend = null;
25
27
  // ── Container styling ──
26
28
  this.chartBg = '';
27
29
  this.chartBorderRadius = '';
@@ -158,7 +160,7 @@ let NileLineChart = class NileLineChart extends NileElement {
158
160
  tooltip: { shared: true },
159
161
  plotOptions: { series: { cursor: 'pointer', point: { events: { click() { self.emit('nile-chart-click', { point: this, category: this.category, value: this.y, seriesName: this.series.name }); } } } } },
160
162
  series: this.data.map(s => ({ type: 'line', name: s.name, data: s.data, color: s.color })),
161
- legend: { enabled: this.showLegend },
163
+ legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
162
164
  credits: { enabled: false },
163
165
  }, this.options);
164
166
  }
@@ -214,6 +216,9 @@ __decorate([
214
216
  __decorate([
215
217
  property({ type: Boolean, attribute: 'show-legend' })
216
218
  ], NileLineChart.prototype, "showLegend", void 0);
219
+ __decorate([
220
+ property({ type: Object })
221
+ ], NileLineChart.prototype, "legend", void 0);
217
222
  __decorate([
218
223
  property({ type: String, attribute: 'chart-bg' })
219
224
  ], NileLineChart.prototype, "chartBg", void 0);
@@ -2,6 +2,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
2
2
  import type Highcharts from 'highcharts';
3
3
  import NileElement from '../internal/nile-element.js';
4
4
  import type { SeparatedChartConfigInputType } from '../internal/types/separated-chart-config-input.type.js';
5
+ import type { LegendConfig } from '../nile-pie-chart/nile-pie-chart.js';
5
6
  export interface LineColumnSeriesPart {
6
7
  name: string;
7
8
  data: number[];
@@ -35,6 +36,9 @@ export declare class NileLineColumnChart extends NileElement {
35
36
  loadingFontSize: string | number;
36
37
  loadingFontFamily: string;
37
38
  loadingBg: string;
39
+ showLegend: boolean;
40
+ /** Full legend configuration — all Highcharts legend options in one object. */
41
+ legend: LegendConfig | null;
38
42
  private _syncCssVars;
39
43
  private applyConfig;
40
44
  connectedCallback(): void;
@@ -36,6 +36,9 @@ let NileLineColumnChart = class NileLineColumnChart extends NileElement {
36
36
  this.loadingFontSize = '';
37
37
  this.loadingFontFamily = '';
38
38
  this.loadingBg = '';
39
+ this.showLegend = true;
40
+ /** Full legend configuration — all Highcharts legend options in one object. */
41
+ this.legend = null;
39
42
  }
40
43
  _syncCssVars() {
41
44
  const set = (prop, val) => {
@@ -93,6 +96,8 @@ let NileLineColumnChart = class NileLineColumnChart extends NileElement {
93
96
  'options',
94
97
  'height',
95
98
  'loading',
99
+ 'showLegend',
100
+ 'legend',
96
101
  ];
97
102
  const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
98
103
  'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
@@ -140,7 +145,7 @@ let NileLineColumnChart = class NileLineColumnChart extends NileElement {
140
145
  },
141
146
  ],
142
147
  tooltip: { shared: true },
143
- legend: { enabled: true },
148
+ legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
144
149
  plotOptions: {
145
150
  column: { borderRadius: 2 },
146
151
  series: {
@@ -270,6 +275,12 @@ __decorate([
270
275
  __decorate([
271
276
  property({ type: String, attribute: 'loading-bg' })
272
277
  ], NileLineColumnChart.prototype, "loadingBg", void 0);
278
+ __decorate([
279
+ property({ type: Boolean, attribute: 'show-legend' })
280
+ ], NileLineColumnChart.prototype, "showLegend", void 0);
281
+ __decorate([
282
+ property({ type: Object })
283
+ ], NileLineColumnChart.prototype, "legend", void 0);
273
284
  NileLineColumnChart = __decorate([
274
285
  customElement('nile-line-column-chart')
275
286
  ], NileLineColumnChart);
@@ -2,6 +2,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
2
2
  import type Highcharts from 'highcharts';
3
3
  import NileElement from '../internal/nile-element.js';
4
4
  import type { SeparatedChartConfigInputType } from '../internal/types/separated-chart-config-input.type.js';
5
+ import type { LegendConfig } from '../nile-pie-chart/nile-pie-chart.js';
5
6
  export interface LollipopSeriesData {
6
7
  name: string;
7
8
  data: number[];
@@ -32,6 +33,9 @@ export declare class NileLollipopChart extends NileElement {
32
33
  loadingFontSize: string | number;
33
34
  loadingFontFamily: string;
34
35
  loadingBg: string;
36
+ showLegend: boolean;
37
+ /** Full legend configuration — all Highcharts legend options in one object. */
38
+ legend: LegendConfig | null;
35
39
  private _syncCssVars;
36
40
  private applyConfig;
37
41
  connectedCallback(): void;
@@ -33,6 +33,9 @@ let NileLollipopChart = class NileLollipopChart extends NileElement {
33
33
  this.loadingFontSize = '';
34
34
  this.loadingFontFamily = '';
35
35
  this.loadingBg = '';
36
+ this.showLegend = true;
37
+ /** Full legend configuration — all Highcharts legend options in one object. */
38
+ this.legend = null;
36
39
  }
37
40
  _syncCssVars() {
38
41
  const set = (prop, val) => {
@@ -79,7 +82,9 @@ let NileLollipopChart = class NileLollipopChart extends NileElement {
79
82
  this.applyConfig(this.config);
80
83
  return;
81
84
  }
82
- const props = ['data', 'categories', 'chartTitle', 'chartSubtitle', 'options', 'height', 'loading'];
85
+ const props = ['data', 'categories', 'chartTitle', 'chartSubtitle', 'options', 'height', 'loading',
86
+ 'showLegend',
87
+ 'legend'];
83
88
  const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
84
89
  'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
85
90
  if (cssVarProps.some(p => changedProperties.has(p)))
@@ -132,7 +137,7 @@ let NileLollipopChart = class NileLollipopChart extends NileElement {
132
137
  subtitle: { text: this.chartSubtitle || undefined },
133
138
  xAxis: { categories: this.categories },
134
139
  yAxis: { title: { text: undefined }, min: 0 },
135
- legend: { enabled: this.data.length > 1 },
140
+ legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
136
141
  tooltip: { shared: true },
137
142
  plotOptions: {
138
143
  column: { grouping: false, pointPadding: 0.12 },
@@ -239,6 +244,12 @@ __decorate([
239
244
  __decorate([
240
245
  property({ type: String, attribute: 'loading-bg' })
241
246
  ], NileLollipopChart.prototype, "loadingBg", void 0);
247
+ __decorate([
248
+ property({ type: Boolean, attribute: 'show-legend' })
249
+ ], NileLollipopChart.prototype, "showLegend", void 0);
250
+ __decorate([
251
+ property({ type: Object })
252
+ ], NileLollipopChart.prototype, "legend", void 0);
242
253
  NileLollipopChart = __decorate([
243
254
  customElement('nile-lollipop-chart')
244
255
  ], NileLollipopChart);
@@ -2,6 +2,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
2
2
  import type Highcharts from 'highcharts';
3
3
  import NileElement from '../internal/nile-element.js';
4
4
  import type { NileChartConfigInputType } from '../internal/types/index.js';
5
+ import type { LegendConfig } from '../nile-pie-chart/nile-pie-chart.js';
5
6
  export interface MapChartDataPoint {
6
7
  /** Highcharts map key matching the map topology (e.g. 'us-ca'). */
7
8
  'hc-key'?: string;
@@ -66,6 +67,9 @@ export declare class NileMapChart extends NileElement {
66
67
  loadingFontSize: string | number;
67
68
  loadingFontFamily: string;
68
69
  loadingBg: string;
70
+ showLegend: boolean;
71
+ /** Full legend configuration — all Highcharts legend options in one object. */
72
+ legend: LegendConfig | null;
69
73
  private _syncCssVars;
70
74
  /** Apply { chart, aq } config to individual properties. */
71
75
  private applyConfig;
@@ -63,6 +63,9 @@ let NileMapChart = class NileMapChart extends NileElement {
63
63
  this.loadingFontSize = '';
64
64
  this.loadingFontFamily = '';
65
65
  this.loadingBg = '';
66
+ this.showLegend = true;
67
+ /** Full legend configuration — all Highcharts legend options in one object. */
68
+ this.legend = null;
66
69
  }
67
70
  _syncCssVars() {
68
71
  const set = (prop, val) => {
@@ -176,6 +179,8 @@ let NileMapChart = class NileMapChart extends NileElement {
176
179
  'chartSubtitle',
177
180
  'options',
178
181
  'height',
182
+ 'showLegend',
183
+ 'legend',
179
184
  'loading',
180
185
  'zoom',
181
186
  'seriesType',
@@ -217,9 +222,7 @@ let NileMapChart = class NileMapChart extends NileElement {
217
222
  colorAxis: {
218
223
  min: 0,
219
224
  },
220
- legend: {
221
- enabled: true,
222
- },
225
+ legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
223
226
  mapNavigation: {
224
227
  enabled: this.zoom,
225
228
  enableMouseWheelZoom: this.zoom,
@@ -350,6 +353,12 @@ __decorate([
350
353
  __decorate([
351
354
  property({ type: String, attribute: 'loading-bg' })
352
355
  ], NileMapChart.prototype, "loadingBg", void 0);
356
+ __decorate([
357
+ property({ type: Boolean, attribute: 'show-legend' })
358
+ ], NileMapChart.prototype, "showLegend", void 0);
359
+ __decorate([
360
+ property({ type: Object })
361
+ ], NileMapChart.prototype, "legend", void 0);
353
362
  NileMapChart = __decorate([
354
363
  customElement('nile-map-chart')
355
364
  ], NileMapChart);
@@ -2,6 +2,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
2
2
  import type Highcharts from 'highcharts';
3
3
  import NileElement from '../internal/nile-element.js';
4
4
  import type { SeparatedChartConfigInputType } from '../internal/types/separated-chart-config-input.type.js';
5
+ import type { LegendConfig } from '../nile-pie-chart/nile-pie-chart.js';
5
6
  /** Directed edge: reporting line from `from` to `to` (node ids). */
6
7
  export interface OrgChartLink {
7
8
  from: string;
@@ -50,6 +51,9 @@ export declare class NileOrganizationChart extends NileElement {
50
51
  loadingFontSize: string | number;
51
52
  loadingFontFamily: string;
52
53
  loadingBg: string;
54
+ showLegend: boolean;
55
+ /** Full legend configuration — all Highcharts legend options in one object. */
56
+ legend: LegendConfig | null;
53
57
  private _syncCssVars;
54
58
  private applyConfig;
55
59
  connectedCallback(): void;
@@ -40,6 +40,9 @@ let NileOrganizationChart = class NileOrganizationChart extends NileElement {
40
40
  this.loadingFontSize = '';
41
41
  this.loadingFontFamily = '';
42
42
  this.loadingBg = '';
43
+ this.showLegend = true;
44
+ /** Full legend configuration — all Highcharts legend options in one object. */
45
+ this.legend = null;
43
46
  }
44
47
  _syncCssVars() {
45
48
  const set = (prop, val) => {
@@ -96,6 +99,8 @@ let NileOrganizationChart = class NileOrganizationChart extends NileElement {
96
99
  'seriesName',
97
100
  'inverted',
98
101
  'loading',
102
+ 'showLegend',
103
+ 'legend',
99
104
  ];
100
105
  const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
101
106
  'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
@@ -180,6 +185,7 @@ let NileOrganizationChart = class NileOrganizationChart extends NileElement {
180
185
  nodes: nodeOpts,
181
186
  },
182
187
  ],
188
+ legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
183
189
  credits: { enabled: false },
184
190
  }, this.options);
185
191
  }
@@ -271,6 +277,12 @@ __decorate([
271
277
  __decorate([
272
278
  property({ type: String, attribute: 'loading-bg' })
273
279
  ], NileOrganizationChart.prototype, "loadingBg", void 0);
280
+ __decorate([
281
+ property({ type: Boolean, attribute: 'show-legend' })
282
+ ], NileOrganizationChart.prototype, "showLegend", void 0);
283
+ __decorate([
284
+ property({ type: Object })
285
+ ], NileOrganizationChart.prototype, "legend", void 0);
274
286
  NileOrganizationChart = __decorate([
275
287
  customElement('nile-organization-chart')
276
288
  ], NileOrganizationChart);
@@ -9,6 +9,57 @@ export interface PieChartSeriesData {
9
9
  sliced?: boolean;
10
10
  selected?: boolean;
11
11
  }
12
+ export interface LegendNavigationConfig {
13
+ activeColor?: string;
14
+ animation?: boolean | {
15
+ duration?: number;
16
+ };
17
+ arrowSize?: number;
18
+ enabled?: boolean;
19
+ inactiveColor?: string;
20
+ style?: Record<string, string | number>;
21
+ }
22
+ export interface LegendConfig {
23
+ /** Show or hide the legend (maps to Highcharts `enabled`). */
24
+ show?: boolean;
25
+ layout?: 'horizontal' | 'vertical';
26
+ align?: 'left' | 'center' | 'right';
27
+ verticalAlign?: 'top' | 'middle' | 'bottom';
28
+ navigation?: LegendNavigationConfig;
29
+ backgroundColor?: string;
30
+ borderColor?: string;
31
+ borderRadius?: number;
32
+ borderWidth?: number;
33
+ floating?: boolean;
34
+ itemDistance?: number;
35
+ itemHiddenStyle?: Record<string, string | number>;
36
+ itemHoverStyle?: Record<string, string | number>;
37
+ itemMarginBottom?: number;
38
+ itemMarginTop?: number;
39
+ itemStyle?: Record<string, string | number>;
40
+ itemWidth?: number;
41
+ labelFormat?: string;
42
+ lineHeight?: number;
43
+ margin?: number;
44
+ maxHeight?: number;
45
+ maxWidth?: number;
46
+ padding?: number;
47
+ reversed?: boolean;
48
+ rtl?: boolean;
49
+ squareSymbol?: boolean;
50
+ symbolHeight?: number;
51
+ symbolPadding?: number;
52
+ symbolRadius?: number;
53
+ symbolWidth?: number;
54
+ title?: {
55
+ text?: string;
56
+ style?: Record<string, string | number>;
57
+ };
58
+ useHTML?: boolean;
59
+ width?: number;
60
+ x?: number;
61
+ y?: number;
62
+ }
12
63
  export declare class NilePieChart extends NileElement {
13
64
  static styles: CSSResultGroup;
14
65
  private _hc;
@@ -35,6 +86,8 @@ export declare class NilePieChart extends NileElement {
35
86
  showDataLabels: boolean;
36
87
  /** Whether to enable the legend. */
37
88
  showLegend: boolean;
89
+ /** Full legend configuration — all Highcharts legend options in one object. */
90
+ legend: LegendConfig | null;
38
91
  chartBg: string;
39
92
  chartBorderRadius: string | number;
40
93
  chartBorder: string;
@@ -31,6 +31,8 @@ let NilePieChart = class NilePieChart extends NileElement {
31
31
  this.showDataLabels = true;
32
32
  /** Whether to enable the legend. */
33
33
  this.showLegend = true;
34
+ /** Full legend configuration — all Highcharts legend options in one object. */
35
+ this.legend = null;
34
36
  // ── Container styling ──
35
37
  this.chartBg = '';
36
38
  this.chartBorderRadius = '';
@@ -231,6 +233,10 @@ let NilePieChart = class NilePieChart extends NileElement {
231
233
  })),
232
234
  },
233
235
  ],
236
+ legend: (() => {
237
+ const { show, ...rest } = this.legend ?? {};
238
+ return { enabled: show ?? this.showLegend, ...rest };
239
+ })(),
234
240
  credits: {
235
241
  enabled: false,
236
242
  },
@@ -292,6 +298,9 @@ __decorate([
292
298
  __decorate([
293
299
  property({ type: Boolean, attribute: 'show-legend' })
294
300
  ], NilePieChart.prototype, "showLegend", void 0);
301
+ __decorate([
302
+ property({ type: Object })
303
+ ], NilePieChart.prototype, "legend", void 0);
295
304
  __decorate([
296
305
  property({ type: String, attribute: 'chart-bg' })
297
306
  ], NilePieChart.prototype, "chartBg", void 0);
@@ -2,6 +2,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
2
2
  import type Highcharts from 'highcharts';
3
3
  import NileElement from '../internal/nile-element.js';
4
4
  import type { SeparatedChartConfigInputType } from '../internal/types/separated-chart-config-input.type.js';
5
+ import type { LegendConfig } from '../nile-pie-chart/nile-pie-chart.js';
5
6
  export interface PolygonSeriesConfig {
6
7
  name: string;
7
8
  data: [number, number][];
@@ -34,6 +35,9 @@ export declare class NilePolygonChart extends NileElement {
34
35
  loadingFontSize: string | number;
35
36
  loadingFontFamily: string;
36
37
  loadingBg: string;
38
+ showLegend: boolean;
39
+ /** Full legend configuration — all Highcharts legend options in one object. */
40
+ legend: LegendConfig | null;
37
41
  private _syncCssVars;
38
42
  private applyConfig;
39
43
  connectedCallback(): void;
@@ -34,6 +34,9 @@ let NilePolygonChart = class NilePolygonChart extends NileElement {
34
34
  this.loadingFontSize = '';
35
35
  this.loadingFontFamily = '';
36
36
  this.loadingBg = '';
37
+ this.showLegend = true;
38
+ /** Full legend configuration — all Highcharts legend options in one object. */
39
+ this.legend = null;
37
40
  }
38
41
  _syncCssVars() {
39
42
  const set = (prop, val) => {
@@ -89,6 +92,8 @@ let NilePolygonChart = class NilePolygonChart extends NileElement {
89
92
  'options',
90
93
  'height',
91
94
  'loading',
95
+ 'showLegend',
96
+ 'legend',
92
97
  ];
93
98
  const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
94
99
  'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
@@ -144,6 +149,7 @@ let NilePolygonChart = class NilePolygonChart extends NileElement {
144
149
  color: s.color,
145
150
  lineWidth: s.lineWidth,
146
151
  })),
152
+ legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
147
153
  credits: { enabled: false },
148
154
  }, this.options);
149
155
  }
@@ -232,6 +238,12 @@ __decorate([
232
238
  __decorate([
233
239
  property({ type: String, attribute: 'loading-bg' })
234
240
  ], NilePolygonChart.prototype, "loadingBg", void 0);
241
+ __decorate([
242
+ property({ type: Boolean, attribute: 'show-legend' })
243
+ ], NilePolygonChart.prototype, "showLegend", void 0);
244
+ __decorate([
245
+ property({ type: Object })
246
+ ], NilePolygonChart.prototype, "legend", void 0);
235
247
  NilePolygonChart = __decorate([
236
248
  customElement('nile-polygon-chart')
237
249
  ], NilePolygonChart);
@@ -24,6 +24,8 @@ export declare class NileRadarChart extends NileElement {
24
24
  height: string;
25
25
  showArea: boolean;
26
26
  showLegend: boolean;
27
+ /** Full legend configuration — all Highcharts legend options in one object. */
28
+ legend: import('../nile-pie-chart/nile-pie-chart.js').LegendConfig | null;
27
29
  chartBg: string;
28
30
  chartBorderRadius: string | number;
29
31
  chartBorder: string;
@@ -22,6 +22,8 @@ let NileRadarChart = class NileRadarChart extends NileElement {
22
22
  this.height = '400px';
23
23
  this.showArea = false;
24
24
  this.showLegend = true;
25
+ /** Full legend configuration — all Highcharts legend options in one object. */
26
+ this.legend = null;
25
27
  // ── Container styling ──
26
28
  this.chartBg = '';
27
29
  this.chartBorderRadius = '';
@@ -180,7 +182,7 @@ let NileRadarChart = class NileRadarChart extends NileElement {
180
182
  color: s.color,
181
183
  pointPlacement: 'on',
182
184
  })),
183
- legend: { enabled: this.showLegend },
185
+ legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
184
186
  credits: { enabled: false },
185
187
  }, this.options);
186
188
  }
@@ -236,6 +238,9 @@ __decorate([
236
238
  __decorate([
237
239
  property({ type: Boolean, attribute: 'show-legend' })
238
240
  ], NileRadarChart.prototype, "showLegend", void 0);
241
+ __decorate([
242
+ property({ type: Object })
243
+ ], NileRadarChart.prototype, "legend", void 0);
239
244
  __decorate([
240
245
  property({ type: String, attribute: 'chart-bg' })
241
246
  ], NileRadarChart.prototype, "chartBg", void 0);