@aquera/nile-visualization 0.3.0 → 0.4.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 (43) hide show
  1. package/dist/src/index.d.ts +7 -1
  2. package/dist/src/index.js +3 -0
  3. package/dist/src/internal/chart-adapters.js +86 -0
  4. package/dist/src/internal/highcharts-provider.js +27 -0
  5. package/dist/src/internal/types/all-chart-config.type.d.ts +2 -4
  6. package/dist/src/internal/types/chart-config.type.d.ts +3 -2
  7. package/dist/src/internal/types/chart-donut-config.type.d.ts +2 -0
  8. package/dist/src/internal/types/chart-heatmap-config.type.d.ts +19 -0
  9. package/dist/src/internal/types/chart-heatmap-config.type.js +2 -0
  10. package/dist/src/internal/types/chart-line-column-config.type.d.ts +14 -0
  11. package/dist/src/internal/types/chart-line-column-config.type.js +2 -0
  12. package/dist/src/internal/types/chart-organization-config.type.d.ts +13 -0
  13. package/dist/src/internal/types/chart-organization-config.type.js +2 -0
  14. package/dist/src/internal/types/index.d.ts +3 -0
  15. package/dist/src/internal/types/primitive-chart-config.type.d.ts +4 -1
  16. package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +3 -1
  17. package/dist/src/nile-chart/index.d.ts +1 -1
  18. package/dist/src/nile-chart/nile-chart-config.d.ts +36 -96
  19. package/dist/src/nile-chart/nile-chart.css.js +1 -1
  20. package/dist/src/nile-chart/nile-chart.d.ts +36 -0
  21. package/dist/src/nile-chart/nile-chart.js +412 -5
  22. package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +2 -0
  23. package/dist/src/nile-donut-chart/nile-donut-chart.js +16 -1
  24. package/dist/src/nile-heatmap-chart/index.d.ts +2 -0
  25. package/dist/src/nile-heatmap-chart/index.js +2 -0
  26. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.css.d.ts +1 -0
  27. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.css.js +28 -0
  28. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +49 -0
  29. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +259 -0
  30. package/dist/src/nile-histogram-chart/nile-histogram-chart.js +3 -1
  31. package/dist/src/nile-line-column-chart/index.d.ts +2 -0
  32. package/dist/src/nile-line-column-chart/index.js +2 -0
  33. package/dist/src/nile-line-column-chart/nile-line-column-chart.css.d.ts +1 -0
  34. package/dist/src/nile-line-column-chart/nile-line-column-chart.css.js +28 -0
  35. package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +42 -0
  36. package/dist/src/nile-line-column-chart/nile-line-column-chart.js +205 -0
  37. package/dist/src/nile-organization-chart/index.d.ts +2 -0
  38. package/dist/src/nile-organization-chart/index.js +2 -0
  39. package/dist/src/nile-organization-chart/nile-organization-chart.css.d.ts +1 -0
  40. package/dist/src/nile-organization-chart/nile-organization-chart.css.js +28 -0
  41. package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +57 -0
  42. package/dist/src/nile-organization-chart/nile-organization-chart.js +206 -0
  43. package/package.json +4 -1
@@ -19,8 +19,38 @@ import '../nile-spline-chart/index.js';
19
19
  import '../nile-radar-chart/index.js';
20
20
  import '../nile-gauge-chart/index.js';
21
21
  import '../nile-waterfall-chart/index.js';
22
+ import '../nile-cluster-chart/index.js';
23
+ import '../nile-stacked-chart/index.js';
24
+ import '../nile-histogram-chart/index.js';
25
+ import '../nile-bellcurve-chart/index.js';
26
+ import '../nile-boxplot-chart/index.js';
27
+ import '../nile-timeline-chart/index.js';
28
+ import '../nile-dumbbell-chart/index.js';
29
+ import '../nile-dumbbell-lower-chart/index.js';
30
+ import '../nile-dumbbell-upper-chart/index.js';
31
+ import '../nile-fan-chart/index.js';
32
+ import '../nile-funnel-chart/index.js';
33
+ import '../nile-organization-chart/index.js';
34
+ import '../nile-line-column-chart/index.js';
35
+ import '../nile-heatmap-chart/index.js';
36
+ import '../nile-flame-chart/index.js';
37
+ import '../nile-spiderweb-chart/index.js';
38
+ import '../nile-column-pyramid-chart/index.js';
39
+ import '../nile-lollipop-chart/index.js';
40
+ import '../nile-inverted-area-chart/index.js';
41
+ import '../nile-area-spline-chart/index.js';
42
+ import '../nile-area-negative-chart/index.js';
43
+ import '../nile-area-range-chart/index.js';
44
+ import '../nile-column-range-chart/index.js';
45
+ import '../nile-column-drilldown-chart/index.js';
46
+ import '../nile-radial-bar-chart/index.js';
47
+ import '../nile-variable-pie-chart/index.js';
48
+ import '../nile-euler-chart/index.js';
49
+ import '../nile-polygon-chart/index.js';
50
+ import '../nile-vector-chart/index.js';
51
+ import '../nile-xrange-chart/index.js';
22
52
  import '../nile-ai-panel/index.js';
23
- const TYPE_LABELS = {
53
+ const CORE_CHART_LABELS = {
24
54
  bar: 'Bar',
25
55
  pie: 'Pie',
26
56
  trendline: 'Trendline',
@@ -35,12 +65,45 @@ const TYPE_LABELS = {
35
65
  radar: 'Radar',
36
66
  gauge: 'Gauge',
37
67
  waterfall: 'Waterfall',
68
+ stacked: 'Stacked column',
69
+ cluster: 'Cluster',
70
+ histogram: 'Histogram',
71
+ bellcurve: 'Bell curve',
72
+ boxplot: 'Box plot',
73
+ timeline: 'Timeline',
74
+ dumbbell: 'Dumbbell',
75
+ fan: 'Fan',
76
+ funnel: 'Funnel',
77
+ organization: 'Organization',
78
+ heatmap: 'Heatmap',
79
+ flame: 'Flame',
80
+ spiderweb: 'Spiderweb',
81
+ euler: 'Euler / Venn',
82
+ polygon: 'Polygon',
83
+ vector: 'Vector',
84
+ xrange: 'X-range',
85
+ lollipop: 'Lollipop',
86
+ 'line-column': 'Line + column',
38
87
  };
88
+ function chartTypeLabel(type) {
89
+ const hit = CORE_CHART_LABELS[type];
90
+ if (hit)
91
+ return hit;
92
+ return String(type)
93
+ .replace(/([a-z])([A-Z])/g, '$1 $2')
94
+ .replace(/-/g, ' ')
95
+ .replace(/\b\w/g, ch => ch.toUpperCase());
96
+ }
39
97
  let NileChart = class NileChart extends NileElement {
40
98
  constructor() {
41
99
  super(...arguments);
42
100
  /** Full chart configuration. Accepts flat NileChartConfig or separated { chart, aq } input. */
43
101
  this.config = null;
102
+ /**
103
+ * When set, fills `chart.type` if the config omits it (same values as `chart.type`, e.g. `stacked`, `pie`).
104
+ * Usage: `<nile-chart chart-type="pie" />` plus `config.chart` with series data only.
105
+ */
106
+ this.chartTypeAttr = '';
44
107
  /** The summary/insight text displayed in the overlay (fallback when config is not set). */
45
108
  this.summary = '';
46
109
  /** Label for the toggle button (fallback when config is not set). */
@@ -83,15 +146,24 @@ let NileChart = class NileChart extends NileElement {
83
146
  super.disconnectedCallback();
84
147
  document.removeEventListener('click', this.handleOutsideClick);
85
148
  }
149
+ mergeChartTypeFromAttr(chart) {
150
+ const t = this.chartTypeAttr?.trim();
151
+ if (t && chart.type == null) {
152
+ return { ...chart, type: t };
153
+ }
154
+ return chart;
155
+ }
86
156
  /** Resolve { chart, aq } input to flat NileChartConfig. */
87
157
  resolveConfig(input) {
88
158
  if ('chart' in input && input.chart) {
89
- return nileChartConfig(input);
159
+ const raw = input;
160
+ const chart = this.mergeChartTypeFromAttr({ ...raw.chart });
161
+ return nileChartConfig({ ...raw, chart });
90
162
  }
91
- return input;
163
+ return this.mergeChartTypeFromAttr({ ...input });
92
164
  }
93
165
  updated(changedProperties) {
94
- if (changedProperties.has('config') && this.config) {
166
+ if ((changedProperties.has('config') || changedProperties.has('chartTypeAttr')) && this.config) {
95
167
  this.resolvedConfig = this.resolveConfig(this.config);
96
168
  this.activeType = this.resolvedConfig.type;
97
169
  this.activeConfig = this.resolvedConfig;
@@ -172,7 +244,7 @@ let NileChart = class NileChart extends NileElement {
172
244
  role="menuitem"
173
245
  @click=${() => this.switchType(type)}
174
246
  >
175
- ${TYPE_LABELS[type] ?? type} Chart
247
+ ${chartTypeLabel(type)} chart
176
248
  </button>
177
249
  `)}
178
250
  </div>
@@ -308,6 +380,7 @@ let NileChart = class NileChart extends NileElement {
308
380
  .seriesName=${config.seriesName ?? ''}
309
381
  .height=${config.height ?? '400px'}
310
382
  .innerSize=${config.innerSize ?? '50%'}
383
+ .semiCircle=${config.semiCircle ?? false}
311
384
  .showDataLabels=${config.showDataLabels ?? true}
312
385
  .showLegend=${config.showLegend ?? true}
313
386
  .options=${mergedOptions}
@@ -368,6 +441,337 @@ let NileChart = class NileChart extends NileElement {
368
441
  .options=${mergedOptions}
369
442
  .loading=${config.loading ?? false}
370
443
  ></nile-waterfall-chart>`;
444
+ case 'stacked':
445
+ return html `<nile-stacked-chart
446
+ .data=${config.data}
447
+ .categories=${config.categories ?? []}
448
+ .height=${config.height ?? '400px'}
449
+ .yAxisTitle=${config.yAxisTitle ?? ''}
450
+ .stackMode=${config.stackMode ?? 'normal'}
451
+ .showLegend=${config.showLegend ?? true}
452
+ .pointPadding=${config.pointPadding ?? 0.05}
453
+ .options=${mergedOptions}
454
+ .loading=${config.loading ?? false}
455
+ ></nile-stacked-chart>`;
456
+ case 'cluster':
457
+ return html `<nile-cluster-chart
458
+ .data=${config.data}
459
+ .categories=${config.categories ?? []}
460
+ .height=${config.height ?? '400px'}
461
+ .yAxisTitle=${config.yAxisTitle ?? ''}
462
+ .showLegend=${config.showLegend ?? true}
463
+ .groupPadding=${config.groupPadding ?? 0.15}
464
+ .pointPadding=${config.pointPadding ?? 0.05}
465
+ .options=${mergedOptions}
466
+ .loading=${config.loading ?? false}
467
+ ></nile-cluster-chart>`;
468
+ case 'histogram':
469
+ return html `<nile-histogram-chart
470
+ .data=${config.data}
471
+ .height=${config.height ?? '400px'}
472
+ .xAxisTitle=${config.xAxisTitle ?? ''}
473
+ .yAxisTitle=${config.yAxisTitle ?? ''}
474
+ .histogramSeriesName=${config.histogramSeriesName ?? ''}
475
+ .sourceSeriesName=${config.sourceSeriesName ?? ''}
476
+ .histogramColor=${config.histogramColor ?? '#3b82f6'}
477
+ .binsNumber=${String(config.binsNumber ?? 'square-root')}
478
+ .binWidth=${config.binWidth ?? 0}
479
+ .showLegend=${config.showLegend ?? true}
480
+ .options=${mergedOptions}
481
+ .loading=${config.loading ?? false}
482
+ ></nile-histogram-chart>`;
483
+ case 'bellcurve':
484
+ return html `<nile-bellcurve-chart
485
+ .data=${config.data}
486
+ .height=${config.height ?? '400px'}
487
+ .xAxisTitle=${config.xAxisTitle ?? ''}
488
+ .yAxisTitle=${config.yAxisTitle ?? ''}
489
+ .bellcurveSeriesName=${config.bellcurveSeriesName ?? ''}
490
+ .sourceSeriesName=${config.sourceSeriesName ?? ''}
491
+ .bellcurveColor=${config.bellcurveColor ?? '#6366f1'}
492
+ .bellcurveFill=${config.bellcurveFill ?? 'rgba(99, 102, 241, 0.2)'}
493
+ .intervals=${config.intervals ?? 3}
494
+ .pointsInInterval=${config.pointsInInterval ?? 40}
495
+ .showLegend=${config.showLegend ?? true}
496
+ .options=${mergedOptions}
497
+ .loading=${config.loading ?? false}
498
+ ></nile-bellcurve-chart>`;
499
+ case 'boxplot':
500
+ return html `<nile-boxplot-chart
501
+ .data=${config.data}
502
+ .categories=${config.categories ?? []}
503
+ .height=${config.height ?? '400px'}
504
+ .xAxisTitle=${config.xAxisTitle ?? ''}
505
+ .yAxisTitle=${config.yAxisTitle ?? ''}
506
+ .horizontal=${config.horizontal ?? false}
507
+ .showLegend=${config.showLegend ?? true}
508
+ .options=${mergedOptions}
509
+ .loading=${config.loading ?? false}
510
+ ></nile-boxplot-chart>`;
511
+ case 'timeline':
512
+ return html `<nile-timeline-chart
513
+ .data=${config.data}
514
+ .height=${config.height ?? '400px'}
515
+ .seriesName=${config.seriesName ?? ''}
516
+ .datetimeAxis=${config.datetimeAxis ?? false}
517
+ .inverted=${config.inverted ?? false}
518
+ .alternateLabels=${config.alternateLabels ?? false}
519
+ .showLegend=${config.showLegend ?? true}
520
+ .options=${mergedOptions}
521
+ .loading=${config.loading ?? false}
522
+ ></nile-timeline-chart>`;
523
+ case 'dumbbell':
524
+ return html `<nile-dumbbell-chart
525
+ .data=${config.data}
526
+ .height=${config.height ?? '400px'}
527
+ .yAxisTitle=${config.yAxisTitle ?? ''}
528
+ .seriesName=${config.seriesName ?? ''}
529
+ .lowMarkerColor=${config.lowMarkerColor ?? ''}
530
+ .connectorColor=${config.connectorColor ?? ''}
531
+ .horizontal=${config.horizontal ?? false}
532
+ .showLegend=${config.showLegend ?? true}
533
+ .options=${mergedOptions}
534
+ .loading=${config.loading ?? false}
535
+ ></nile-dumbbell-chart>`;
536
+ case 'dumbbellLower':
537
+ return html `<nile-dumbbell-lower-chart
538
+ .data=${config.data}
539
+ .height=${config.height ?? '400px'}
540
+ .yAxisTitle=${config.yAxisTitle ?? ''}
541
+ .seriesName=${config.seriesName ?? ''}
542
+ .lowMarkerColor=${config.lowMarkerColor ?? ''}
543
+ .connectorColor=${config.connectorColor ?? ''}
544
+ .horizontal=${config.horizontal ?? false}
545
+ .showLegend=${config.showLegend ?? true}
546
+ .options=${mergedOptions}
547
+ .loading=${config.loading ?? false}
548
+ ></nile-dumbbell-lower-chart>`;
549
+ case 'dumbbellUpper':
550
+ return html `<nile-dumbbell-upper-chart
551
+ .data=${config.data}
552
+ .height=${config.height ?? '400px'}
553
+ .yAxisTitle=${config.yAxisTitle ?? ''}
554
+ .seriesName=${config.seriesName ?? ''}
555
+ .lowMarkerColor=${config.lowMarkerColor ?? ''}
556
+ .connectorColor=${config.connectorColor ?? ''}
557
+ .horizontal=${config.horizontal ?? false}
558
+ .showLegend=${config.showLegend ?? true}
559
+ .options=${mergedOptions}
560
+ .loading=${config.loading ?? false}
561
+ ></nile-dumbbell-upper-chart>`;
562
+ case 'fan':
563
+ return html `<nile-fan-chart
564
+ .lineData=${config.lineData}
565
+ .bands=${config.bands}
566
+ .height=${config.height ?? '400px'}
567
+ .yAxisTitle=${config.yAxisTitle ?? ''}
568
+ .lineSeriesName=${config.lineSeriesName ?? ''}
569
+ .lineColor=${config.lineColor ?? '#1d4ed8'}
570
+ .forecastStartIndex=${config.forecastStartIndex ?? -1}
571
+ .forecastBandLabel=${config.forecastBandLabel ?? ''}
572
+ .showLegend=${config.showLegend ?? false}
573
+ .options=${mergedOptions}
574
+ .loading=${config.loading ?? false}
575
+ ></nile-fan-chart>`;
576
+ case 'funnel':
577
+ return html `<nile-funnel-chart
578
+ .data=${config.data}
579
+ .height=${config.height ?? '400px'}
580
+ .seriesName=${config.seriesName ?? ''}
581
+ .showDataLabels=${config.showDataLabels ?? true}
582
+ .options=${mergedOptions}
583
+ .loading=${config.loading ?? false}
584
+ ></nile-funnel-chart>`;
585
+ case 'organization':
586
+ return html `<nile-organization-chart
587
+ .nodes=${config.nodes}
588
+ .links=${config.links}
589
+ .height=${config.height ?? '480px'}
590
+ .seriesName=${config.seriesName ?? ''}
591
+ .inverted=${config.inverted ?? true}
592
+ .options=${mergedOptions}
593
+ .loading=${config.loading ?? false}
594
+ ></nile-organization-chart>`;
595
+ case 'line-column':
596
+ return html `<nile-line-column-chart
597
+ .categories=${config.categories}
598
+ .columnSeries=${config.columnSeries}
599
+ .lineSeries=${config.lineSeries}
600
+ .height=${config.height ?? '400px'}
601
+ .columnAxisTitle=${config.columnAxisTitle ?? ''}
602
+ .lineAxisTitle=${config.lineAxisTitle ?? ''}
603
+ .options=${mergedOptions}
604
+ .loading=${config.loading ?? false}
605
+ ></nile-line-column-chart>`;
606
+ case 'heatmap':
607
+ return html `<nile-heatmap-chart
608
+ .xCategories=${config.xCategories}
609
+ .yCategories=${config.yCategories}
610
+ .data=${config.data}
611
+ .height=${config.height ?? '400px'}
612
+ .seriesName=${config.seriesName ?? ''}
613
+ .colorMin=${config.colorMin ?? null}
614
+ .colorMax=${config.colorMax ?? null}
615
+ .minColor=${config.minColor ?? '#ffffff'}
616
+ .maxColor=${config.maxColor ?? '#1e40af'}
617
+ .colorAxisTitle=${config.colorAxisTitle ?? ''}
618
+ .showDataLabels=${config.showDataLabels ?? true}
619
+ .options=${mergedOptions}
620
+ .loading=${config.loading ?? false}
621
+ ></nile-heatmap-chart>`;
622
+ case 'flame':
623
+ return html `<nile-flame-chart
624
+ .layout=${config.layout ?? 'flame'}
625
+ .data=${config.data ?? []}
626
+ .sunburstData=${config.sunburstData ?? []}
627
+ .height=${config.height ?? '480px'}
628
+ .options=${mergedOptions}
629
+ .loading=${config.loading ?? false}
630
+ ></nile-flame-chart>`;
631
+ case 'spiderweb':
632
+ return html `<nile-spiderweb-chart
633
+ .data=${config.data}
634
+ .categories=${config.categories ?? []}
635
+ .height=${config.height ?? '400px'}
636
+ .showArea=${config.showArea ?? false}
637
+ .options=${mergedOptions}
638
+ .loading=${config.loading ?? false}
639
+ ></nile-spiderweb-chart>`;
640
+ case 'invertedArea':
641
+ return html `<nile-inverted-area-chart
642
+ .data=${config.data}
643
+ .categories=${config.categories ?? []}
644
+ .height=${config.height ?? '400px'}
645
+ .yAxisTitle=${config.yAxisTitle ?? ''}
646
+ .stacked=${config.stacked ?? false}
647
+ .options=${mergedOptions}
648
+ .loading=${config.loading ?? false}
649
+ ></nile-inverted-area-chart>`;
650
+ case 'columnPyramid':
651
+ return html `<nile-column-pyramid-chart
652
+ .data=${config.data}
653
+ .categories=${config.categories ?? []}
654
+ .height=${config.height ?? '400px'}
655
+ .options=${mergedOptions}
656
+ .loading=${config.loading ?? false}
657
+ ></nile-column-pyramid-chart>`;
658
+ case 'lollipop':
659
+ return html `<nile-lollipop-chart
660
+ .data=${config.data}
661
+ .categories=${config.categories ?? []}
662
+ .height=${config.height ?? '400px'}
663
+ .options=${mergedOptions}
664
+ .loading=${config.loading ?? false}
665
+ ></nile-lollipop-chart>`;
666
+ case 'areaSpline':
667
+ return html `<nile-area-spline-chart
668
+ .data=${config.data}
669
+ .categories=${config.categories ?? []}
670
+ .height=${config.height ?? '400px'}
671
+ .yAxisTitle=${config.yAxisTitle ?? ''}
672
+ .stacked=${config.stacked ?? false}
673
+ .options=${mergedOptions}
674
+ .loading=${config.loading ?? false}
675
+ ></nile-area-spline-chart>`;
676
+ case 'areaNegative':
677
+ return html `<nile-area-negative-chart
678
+ .data=${config.data}
679
+ .categories=${config.categories ?? []}
680
+ .height=${config.height ?? '400px'}
681
+ .yAxisTitle=${config.yAxisTitle ?? ''}
682
+ .threshold=${config.threshold ?? 0}
683
+ .options=${mergedOptions}
684
+ .loading=${config.loading ?? false}
685
+ ></nile-area-negative-chart>`;
686
+ case 'areaRange':
687
+ return html `<nile-area-range-chart
688
+ .data=${config.data}
689
+ .categories=${config.categories ?? []}
690
+ .height=${config.height ?? '400px'}
691
+ .yAxisTitle=${config.yAxisTitle ?? ''}
692
+ .options=${mergedOptions}
693
+ .loading=${config.loading ?? false}
694
+ ></nile-area-range-chart>`;
695
+ case 'columnRange':
696
+ return html `<nile-column-range-chart
697
+ .data=${config.data}
698
+ .categories=${config.categories ?? []}
699
+ .height=${config.height ?? '400px'}
700
+ .yAxisTitle=${config.yAxisTitle ?? ''}
701
+ .options=${mergedOptions}
702
+ .loading=${config.loading ?? false}
703
+ ></nile-column-range-chart>`;
704
+ case 'columnDrilldown':
705
+ return html `<nile-column-drilldown-chart
706
+ .data=${config.data}
707
+ .drilldownSeries=${config.drilldownSeries}
708
+ .height=${config.height ?? '400px'}
709
+ .seriesName=${config.seriesName ?? ''}
710
+ .yAxisTitle=${config.yAxisTitle ?? ''}
711
+ .options=${mergedOptions}
712
+ .loading=${config.loading ?? false}
713
+ ></nile-column-drilldown-chart>`;
714
+ case 'radialBar':
715
+ return html `<nile-radial-bar-chart
716
+ .data=${config.data}
717
+ .categories=${config.categories}
718
+ .height=${config.height ?? '400px'}
719
+ .yAxisTitle=${config.yAxisTitle ?? ''}
720
+ .innerSize=${config.innerSize ?? '28%'}
721
+ .paneSize=${config.paneSize ?? '82%'}
722
+ .options=${mergedOptions}
723
+ .loading=${config.loading ?? false}
724
+ ></nile-radial-bar-chart>`;
725
+ case 'variablePie':
726
+ return html `<nile-variable-pie-chart
727
+ .data=${config.data}
728
+ .height=${config.height ?? '400px'}
729
+ .seriesName=${config.seriesName ?? ''}
730
+ .showDataLabels=${config.showDataLabels ?? true}
731
+ .showLegend=${config.showLegend ?? true}
732
+ .options=${mergedOptions}
733
+ .loading=${config.loading ?? false}
734
+ ></nile-variable-pie-chart>`;
735
+ case 'euler':
736
+ return html `<nile-euler-chart
737
+ .data=${config.data}
738
+ .height=${config.height ?? '400px'}
739
+ .options=${mergedOptions}
740
+ .loading=${config.loading ?? false}
741
+ ></nile-euler-chart>`;
742
+ case 'polygon':
743
+ return html `<nile-polygon-chart
744
+ .series=${config.series}
745
+ .height=${config.height ?? '400px'}
746
+ .xAxisTitle=${config.xAxisTitle ?? ''}
747
+ .yAxisTitle=${config.yAxisTitle ?? ''}
748
+ .options=${mergedOptions}
749
+ .loading=${config.loading ?? false}
750
+ ></nile-polygon-chart>`;
751
+ case 'vector':
752
+ return html `<nile-vector-chart
753
+ .data=${config.data}
754
+ .height=${config.height ?? '400px'}
755
+ .seriesName=${config.seriesName ?? ''}
756
+ .xAxisTitle=${config.xAxisTitle ?? ''}
757
+ .yAxisTitle=${config.yAxisTitle ?? ''}
758
+ .options=${mergedOptions}
759
+ .loading=${config.loading ?? false}
760
+ ></nile-vector-chart>`;
761
+ case 'xrange':
762
+ return html `<nile-xrange-chart
763
+ .data=${config.data}
764
+ .categories=${config.categories}
765
+ .height=${config.height ?? '400px'}
766
+ .seriesName=${config.seriesName ?? ''}
767
+ .datetimeAxis=${config.datetimeAxis ?? false}
768
+ .options=${mergedOptions}
769
+ .loading=${config.loading ?? false}
770
+ ></nile-xrange-chart>`;
771
+ default: {
772
+ const _exhaustive = config;
773
+ return _exhaustive;
774
+ }
371
775
  }
372
776
  }
373
777
  render() {
@@ -402,6 +806,9 @@ NileChart.styles = styles;
402
806
  __decorate([
403
807
  property({ type: Object })
404
808
  ], NileChart.prototype, "config", void 0);
809
+ __decorate([
810
+ property({ type: String, attribute: 'chart-type' })
811
+ ], NileChart.prototype, "chartTypeAttr", void 0);
405
812
  __decorate([
406
813
  property({ type: String })
407
814
  ], NileChart.prototype, "summary", void 0);
@@ -22,6 +22,8 @@ export declare class NileDonutChart extends NileElement {
22
22
  data: DonutChartSeriesData[];
23
23
  seriesName: string;
24
24
  innerSize: string;
25
+ /** Renders a 180° arc (semi-circle) suitable for KPI-style gauges. */
26
+ semiCircle: boolean;
25
27
  options: Highcharts.Options;
26
28
  loading: boolean;
27
29
  height: string;
@@ -18,6 +18,8 @@ let NileDonutChart = class NileDonutChart extends NileElement {
18
18
  this.data = [];
19
19
  this.seriesName = '';
20
20
  this.innerSize = '50%';
21
+ /** Renders a 180° arc (semi-circle) suitable for KPI-style gauges. */
22
+ this.semiCircle = false;
21
23
  this.options = {};
22
24
  this.loading = false;
23
25
  this.height = '400px';
@@ -35,6 +37,8 @@ let NileDonutChart = class NileDonutChart extends NileElement {
35
37
  this.seriesName = donut.seriesName;
36
38
  if (donut.innerSize)
37
39
  this.innerSize = donut.innerSize;
40
+ if (donut.semiCircle !== undefined)
41
+ this.semiCircle = donut.semiCircle;
38
42
  if (donut.height)
39
43
  this.height = donut.height;
40
44
  if (donut.loading !== undefined)
@@ -70,7 +74,7 @@ let NileDonutChart = class NileDonutChart extends NileElement {
70
74
  this.applyConfig(this.config);
71
75
  return;
72
76
  }
73
- const props = ['data', 'chartTitle', 'chartSubtitle', 'options', 'height', 'seriesName', 'innerSize', 'loading', 'showDataLabels', 'showLegend'];
77
+ const props = ['data', 'chartTitle', 'chartSubtitle', 'options', 'height', 'seriesName', 'innerSize', 'semiCircle', 'loading', 'showDataLabels', 'showLegend'];
74
78
  if (!props.some(p => changedProperties.has(p)))
75
79
  return;
76
80
  if (this.loading) {
@@ -101,6 +105,14 @@ let NileDonutChart = class NileDonutChart extends NileElement {
101
105
  plotOptions: {
102
106
  pie: {
103
107
  innerSize: this.innerSize,
108
+ ...(this.semiCircle
109
+ ? {
110
+ startAngle: -90,
111
+ endAngle: 90,
112
+ center: ['50%', '80%'],
113
+ size: '120%',
114
+ }
115
+ : {}),
104
116
  allowPointSelect: true,
105
117
  cursor: 'pointer',
106
118
  dataLabels: { enabled: this.showDataLabels, format: '<b>{point.name}</b>: {point.percentage:.1f} %' },
@@ -152,6 +164,9 @@ __decorate([
152
164
  __decorate([
153
165
  property({ type: String, attribute: 'inner-size' })
154
166
  ], NileDonutChart.prototype, "innerSize", void 0);
167
+ __decorate([
168
+ property({ type: Boolean, attribute: 'semi-circle' })
169
+ ], NileDonutChart.prototype, "semiCircle", void 0);
155
170
  __decorate([
156
171
  property({ type: Object })
157
172
  ], NileDonutChart.prototype, "options", void 0);
@@ -0,0 +1,2 @@
1
+ export { NileHeatmapChart } from './nile-heatmap-chart.js';
2
+ export type { HeatmapCell } from './nile-heatmap-chart.js';
@@ -0,0 +1,2 @@
1
+ export { NileHeatmapChart } from './nile-heatmap-chart.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,28 @@
1
+ import { css } from 'lit';
2
+ export const styles = css `
3
+ :host {
4
+ display: block;
5
+ width: 100%;
6
+ position: relative;
7
+ }
8
+
9
+ :host([hidden]) {
10
+ display: none;
11
+ }
12
+
13
+ .chart-container {
14
+ width: 100%;
15
+ min-height: var(--nile-height-200px, var(--ng-height-200px));
16
+ }
17
+
18
+ .chart-loading {
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ min-height: inherit;
23
+ color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
24
+ font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
25
+ font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
26
+ }
27
+ `;
28
+ //# sourceMappingURL=nile-heatmap-chart.css.js.map
@@ -0,0 +1,49 @@
1
+ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
2
+ import type Highcharts from 'highcharts';
3
+ import NileElement from '../internal/nile-element.js';
4
+ import type { SeparatedChartConfigInputType } from '../internal/types/separated-chart-config-input.type.js';
5
+ /** One cell: x/y are 0-based indices into `xCategories` / `yCategories`. */
6
+ export interface HeatmapCell {
7
+ x: number;
8
+ y: number;
9
+ value: number;
10
+ }
11
+ export declare class NileHeatmapChart extends NileElement {
12
+ static styles: CSSResultGroup;
13
+ private _hc;
14
+ private chart;
15
+ private resizeObserver;
16
+ private chartContainer;
17
+ config: SeparatedChartConfigInputType | null;
18
+ chartTitle: string;
19
+ chartSubtitle: string;
20
+ xCategories: string[];
21
+ yCategories: string[];
22
+ data: HeatmapCell[];
23
+ seriesName: string;
24
+ colorMin: number | null;
25
+ colorMax: number | null;
26
+ minColor: string;
27
+ maxColor: string;
28
+ colorAxisTitle: string;
29
+ options: Highcharts.Options;
30
+ loading: boolean;
31
+ height: string;
32
+ showDataLabels: boolean;
33
+ private applyConfig;
34
+ connectedCallback(): void;
35
+ disconnectedCallback(): void;
36
+ protected firstUpdated(): void;
37
+ protected updated(changedProperties: PropertyValues): void;
38
+ private setupResizeObserver;
39
+ private valueExtent;
40
+ private buildOptions;
41
+ private initChart;
42
+ private destroyChart;
43
+ render(): TemplateResult;
44
+ }
45
+ declare global {
46
+ interface HTMLElementTagNameMap {
47
+ 'nile-heatmap-chart': NileHeatmapChart;
48
+ }
49
+ }