@aquera/nile-visualization 0.2.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 (170) hide show
  1. package/dist/src/index.d.ts +37 -1
  2. package/dist/src/index.js +19 -0
  3. package/dist/src/internal/chart-adapters.js +86 -0
  4. package/dist/src/internal/highcharts-provider.js +72 -0
  5. package/dist/src/internal/types/all-chart-config.type.d.ts +2 -4
  6. package/dist/src/internal/types/chart-area-config.type.d.ts +4 -0
  7. package/dist/src/internal/types/chart-area-negative-config.type.d.ts +13 -0
  8. package/dist/src/internal/types/chart-area-negative-config.type.js +2 -0
  9. package/dist/src/internal/types/chart-area-range-config.type.d.ts +12 -0
  10. package/dist/src/internal/types/chart-area-range-config.type.js +2 -0
  11. package/dist/src/internal/types/chart-area-spline-config.type.d.ts +13 -0
  12. package/dist/src/internal/types/chart-area-spline-config.type.js +2 -0
  13. package/dist/src/internal/types/chart-column-drilldown-config.type.d.ts +13 -0
  14. package/dist/src/internal/types/chart-column-drilldown-config.type.js +2 -0
  15. package/dist/src/internal/types/chart-column-pyramid-config.type.d.ts +11 -0
  16. package/dist/src/internal/types/chart-column-pyramid-config.type.js +2 -0
  17. package/dist/src/internal/types/chart-column-range-config.type.d.ts +12 -0
  18. package/dist/src/internal/types/chart-column-range-config.type.js +2 -0
  19. package/dist/src/internal/types/chart-config.type.d.ts +3 -2
  20. package/dist/src/internal/types/chart-donut-config.type.d.ts +2 -0
  21. package/dist/src/internal/types/chart-dumbbell-lower-config.type.d.ts +5 -0
  22. package/dist/src/internal/types/chart-dumbbell-lower-config.type.js +2 -0
  23. package/dist/src/internal/types/chart-dumbbell-upper-config.type.d.ts +5 -0
  24. package/dist/src/internal/types/chart-dumbbell-upper-config.type.js +2 -0
  25. package/dist/src/internal/types/chart-euler-config.type.d.ts +10 -0
  26. package/dist/src/internal/types/chart-euler-config.type.js +2 -0
  27. package/dist/src/internal/types/chart-heatmap-config.type.d.ts +19 -0
  28. package/dist/src/internal/types/chart-heatmap-config.type.js +2 -0
  29. package/dist/src/internal/types/chart-line-column-config.type.d.ts +14 -0
  30. package/dist/src/internal/types/chart-line-column-config.type.js +2 -0
  31. package/dist/src/internal/types/chart-lollipop-config.type.d.ts +11 -0
  32. package/dist/src/internal/types/chart-lollipop-config.type.js +2 -0
  33. package/dist/src/internal/types/chart-organization-config.type.d.ts +13 -0
  34. package/dist/src/internal/types/chart-organization-config.type.js +2 -0
  35. package/dist/src/internal/types/chart-polygon-config.type.d.ts +12 -0
  36. package/dist/src/internal/types/chart-polygon-config.type.js +2 -0
  37. package/dist/src/internal/types/chart-radial-bar-config.type.d.ts +16 -0
  38. package/dist/src/internal/types/chart-radial-bar-config.type.js +2 -0
  39. package/dist/src/internal/types/chart-variable-pie-config.type.d.ts +13 -0
  40. package/dist/src/internal/types/chart-variable-pie-config.type.js +2 -0
  41. package/dist/src/internal/types/chart-vector-config.type.d.ts +13 -0
  42. package/dist/src/internal/types/chart-vector-config.type.js +2 -0
  43. package/dist/src/internal/types/chart-xrange-config.type.d.ts +13 -0
  44. package/dist/src/internal/types/chart-xrange-config.type.js +2 -0
  45. package/dist/src/internal/types/index.d.ts +19 -1
  46. package/dist/src/internal/types/primitive-chart-config.type.d.ts +20 -1
  47. package/dist/src/nile-area-negative-chart/index.d.ts +2 -0
  48. package/dist/src/nile-area-negative-chart/index.js +2 -0
  49. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.css.d.ts +1 -0
  50. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.css.js +28 -0
  51. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.d.ts +42 -0
  52. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +178 -0
  53. package/dist/src/nile-area-range-chart/index.d.ts +2 -0
  54. package/dist/src/nile-area-range-chart/index.js +2 -0
  55. package/dist/src/nile-area-range-chart/nile-area-range-chart.css.d.ts +1 -0
  56. package/dist/src/nile-area-range-chart/nile-area-range-chart.css.js +28 -0
  57. package/dist/src/nile-area-range-chart/nile-area-range-chart.d.ts +41 -0
  58. package/dist/src/nile-area-range-chart/nile-area-range-chart.js +173 -0
  59. package/dist/src/nile-area-spline-chart/index.d.ts +2 -0
  60. package/dist/src/nile-area-spline-chart/index.js +2 -0
  61. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.css.d.ts +1 -0
  62. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.css.js +28 -0
  63. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.d.ts +41 -0
  64. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +174 -0
  65. package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +3 -1
  66. package/dist/src/nile-chart/index.d.ts +1 -1
  67. package/dist/src/nile-chart/nile-chart-config.d.ts +36 -96
  68. package/dist/src/nile-chart/nile-chart.css.js +1 -1
  69. package/dist/src/nile-chart/nile-chart.d.ts +36 -0
  70. package/dist/src/nile-chart/nile-chart.js +412 -5
  71. package/dist/src/nile-column-drilldown-chart/index.d.ts +2 -0
  72. package/dist/src/nile-column-drilldown-chart/index.js +2 -0
  73. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.css.d.ts +1 -0
  74. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.css.js +28 -0
  75. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.d.ts +49 -0
  76. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +186 -0
  77. package/dist/src/nile-column-pyramid-chart/index.d.ts +2 -0
  78. package/dist/src/nile-column-pyramid-chart/index.js +2 -0
  79. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.css.d.ts +1 -0
  80. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.css.js +28 -0
  81. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.d.ts +39 -0
  82. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +155 -0
  83. package/dist/src/nile-column-range-chart/index.d.ts +2 -0
  84. package/dist/src/nile-column-range-chart/index.js +2 -0
  85. package/dist/src/nile-column-range-chart/nile-column-range-chart.css.d.ts +1 -0
  86. package/dist/src/nile-column-range-chart/nile-column-range-chart.css.js +28 -0
  87. package/dist/src/nile-column-range-chart/nile-column-range-chart.d.ts +40 -0
  88. package/dist/src/nile-column-range-chart/nile-column-range-chart.js +169 -0
  89. package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +2 -0
  90. package/dist/src/nile-donut-chart/nile-donut-chart.js +16 -1
  91. package/dist/src/nile-dumbbell-lower-chart/index.d.ts +1 -0
  92. package/dist/src/nile-dumbbell-lower-chart/index.js +2 -0
  93. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.css.d.ts +1 -0
  94. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.css.js +28 -0
  95. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.d.ts +40 -0
  96. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +214 -0
  97. package/dist/src/nile-dumbbell-upper-chart/index.d.ts +1 -0
  98. package/dist/src/nile-dumbbell-upper-chart/index.js +2 -0
  99. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.css.d.ts +1 -0
  100. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.css.js +28 -0
  101. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.d.ts +40 -0
  102. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +214 -0
  103. package/dist/src/nile-euler-chart/index.d.ts +2 -0
  104. package/dist/src/nile-euler-chart/index.js +2 -0
  105. package/dist/src/nile-euler-chart/nile-euler-chart.css.d.ts +1 -0
  106. package/dist/src/nile-euler-chart/nile-euler-chart.css.js +28 -0
  107. package/dist/src/nile-euler-chart/nile-euler-chart.d.ts +38 -0
  108. package/dist/src/nile-euler-chart/nile-euler-chart.js +149 -0
  109. package/dist/src/nile-heatmap-chart/index.d.ts +2 -0
  110. package/dist/src/nile-heatmap-chart/index.js +2 -0
  111. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.css.d.ts +1 -0
  112. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.css.js +28 -0
  113. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +49 -0
  114. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +259 -0
  115. package/dist/src/nile-histogram-chart/nile-histogram-chart.js +3 -1
  116. package/dist/src/nile-inverted-area-chart/index.d.ts +2 -0
  117. package/dist/src/nile-inverted-area-chart/index.js +2 -0
  118. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.css.d.ts +1 -0
  119. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.css.js +28 -0
  120. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.d.ts +40 -0
  121. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +173 -0
  122. package/dist/src/nile-line-column-chart/index.d.ts +2 -0
  123. package/dist/src/nile-line-column-chart/index.js +2 -0
  124. package/dist/src/nile-line-column-chart/nile-line-column-chart.css.d.ts +1 -0
  125. package/dist/src/nile-line-column-chart/nile-line-column-chart.css.js +28 -0
  126. package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +42 -0
  127. package/dist/src/nile-line-column-chart/nile-line-column-chart.js +205 -0
  128. package/dist/src/nile-lollipop-chart/index.d.ts +2 -0
  129. package/dist/src/nile-lollipop-chart/index.js +2 -0
  130. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.css.d.ts +1 -0
  131. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.css.js +28 -0
  132. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.d.ts +39 -0
  133. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +174 -0
  134. package/dist/src/nile-organization-chart/index.d.ts +2 -0
  135. package/dist/src/nile-organization-chart/index.js +2 -0
  136. package/dist/src/nile-organization-chart/nile-organization-chart.css.d.ts +1 -0
  137. package/dist/src/nile-organization-chart/nile-organization-chart.css.js +28 -0
  138. package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +57 -0
  139. package/dist/src/nile-organization-chart/nile-organization-chart.js +206 -0
  140. package/dist/src/nile-polygon-chart/index.d.ts +2 -0
  141. package/dist/src/nile-polygon-chart/index.js +2 -0
  142. package/dist/src/nile-polygon-chart/nile-polygon-chart.css.d.ts +1 -0
  143. package/dist/src/nile-polygon-chart/nile-polygon-chart.css.js +28 -0
  144. package/dist/src/nile-polygon-chart/nile-polygon-chart.d.ts +41 -0
  145. package/dist/src/nile-polygon-chart/nile-polygon-chart.js +167 -0
  146. package/dist/src/nile-radial-bar-chart/index.d.ts +2 -0
  147. package/dist/src/nile-radial-bar-chart/index.js +2 -0
  148. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.css.d.ts +1 -0
  149. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.css.js +28 -0
  150. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.d.ts +42 -0
  151. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +191 -0
  152. package/dist/src/nile-variable-pie-chart/index.d.ts +2 -0
  153. package/dist/src/nile-variable-pie-chart/index.js +2 -0
  154. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.css.d.ts +1 -0
  155. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.css.js +28 -0
  156. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.d.ts +42 -0
  157. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +180 -0
  158. package/dist/src/nile-vector-chart/index.d.ts +2 -0
  159. package/dist/src/nile-vector-chart/index.js +2 -0
  160. package/dist/src/nile-vector-chart/nile-vector-chart.css.d.ts +1 -0
  161. package/dist/src/nile-vector-chart/nile-vector-chart.css.js +28 -0
  162. package/dist/src/nile-vector-chart/nile-vector-chart.d.ts +44 -0
  163. package/dist/src/nile-vector-chart/nile-vector-chart.js +181 -0
  164. package/dist/src/nile-xrange-chart/index.d.ts +2 -0
  165. package/dist/src/nile-xrange-chart/index.js +2 -0
  166. package/dist/src/nile-xrange-chart/nile-xrange-chart.css.d.ts +1 -0
  167. package/dist/src/nile-xrange-chart/nile-xrange-chart.css.js +28 -0
  168. package/dist/src/nile-xrange-chart/nile-xrange-chart.d.ts +44 -0
  169. package/dist/src/nile-xrange-chart/nile-xrange-chart.js +193 -0
  170. package/package.json +4 -1
@@ -0,0 +1,41 @@
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
+ export interface AreaSplineSeriesData {
6
+ name: string;
7
+ data: number[];
8
+ color?: string;
9
+ }
10
+ export declare class NileAreaSplineChart extends NileElement {
11
+ static styles: CSSResultGroup;
12
+ private _hc;
13
+ private chart;
14
+ private resizeObserver;
15
+ private chartContainer;
16
+ config: SeparatedChartConfigInputType | null;
17
+ chartTitle: string;
18
+ chartSubtitle: string;
19
+ data: AreaSplineSeriesData[];
20
+ categories: string[];
21
+ options: Highcharts.Options;
22
+ loading: boolean;
23
+ height: string;
24
+ yAxisTitle: string;
25
+ stacked: boolean;
26
+ private applyConfig;
27
+ connectedCallback(): void;
28
+ disconnectedCallback(): void;
29
+ protected firstUpdated(): void;
30
+ protected updated(changedProperties: PropertyValues): void;
31
+ private setupResizeObserver;
32
+ private buildOptions;
33
+ private initChart;
34
+ private destroyChart;
35
+ render(): TemplateResult;
36
+ }
37
+ declare global {
38
+ interface HTMLElementTagNameMap {
39
+ 'nile-area-spline-chart': NileAreaSplineChart;
40
+ }
41
+ }
@@ -0,0 +1,174 @@
1
+ import { __decorate } from "tslib";
2
+ import { customElement, property, query } from 'lit/decorators.js';
3
+ import { html } from 'lit';
4
+ import NileElement from '../internal/nile-element.js';
5
+ import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
6
+ import { getHighcharts } from '../internal/highcharts-provider.js';
7
+ import { deepMerge } from '../internal/utils.js';
8
+ import { styles } from './nile-area-spline-chart.css.js';
9
+ let NileAreaSplineChart = class NileAreaSplineChart extends NileElement {
10
+ constructor() {
11
+ super(...arguments);
12
+ this._hc = null;
13
+ this.chart = null;
14
+ this.resizeObserver = null;
15
+ this.config = null;
16
+ this.chartTitle = '';
17
+ this.chartSubtitle = '';
18
+ this.data = [];
19
+ this.categories = [];
20
+ this.options = {};
21
+ this.loading = false;
22
+ this.height = '400px';
23
+ this.yAxisTitle = '';
24
+ this.stacked = false;
25
+ }
26
+ applyConfig(cfg) {
27
+ applySeparatedChartConfig(this, cfg);
28
+ }
29
+ connectedCallback() {
30
+ super.connectedCallback();
31
+ if (this.config)
32
+ this.applyConfig(this.config);
33
+ }
34
+ disconnectedCallback() {
35
+ super.disconnectedCallback();
36
+ this.destroyChart();
37
+ this.resizeObserver?.disconnect();
38
+ this.resizeObserver = null;
39
+ }
40
+ firstUpdated() {
41
+ this.initChart();
42
+ this.setupResizeObserver();
43
+ }
44
+ updated(changedProperties) {
45
+ if (changedProperties.has('config') && this.config) {
46
+ this.applyConfig(this.config);
47
+ return;
48
+ }
49
+ const props = [
50
+ 'data',
51
+ 'categories',
52
+ 'chartTitle',
53
+ 'chartSubtitle',
54
+ 'options',
55
+ 'height',
56
+ 'yAxisTitle',
57
+ 'stacked',
58
+ 'loading',
59
+ ];
60
+ if (!props.some(p => changedProperties.has(p)))
61
+ return;
62
+ if (this.loading) {
63
+ this.destroyChart();
64
+ return;
65
+ }
66
+ if (this.chart) {
67
+ this.chart.update(this.buildOptions(), true, true);
68
+ }
69
+ else {
70
+ this.initChart();
71
+ }
72
+ }
73
+ setupResizeObserver() {
74
+ if (!this.chartContainer)
75
+ return;
76
+ this.resizeObserver = new ResizeObserver(() => this.chart?.reflow());
77
+ this.resizeObserver.observe(this.chartContainer);
78
+ }
79
+ buildOptions() {
80
+ const self = this;
81
+ return deepMerge({
82
+ chart: { type: 'areaspline', height: this.height },
83
+ title: { text: this.chartTitle || undefined },
84
+ subtitle: { text: this.chartSubtitle || undefined },
85
+ xAxis: { categories: this.categories },
86
+ yAxis: { title: { text: this.yAxisTitle || undefined } },
87
+ tooltip: { shared: true },
88
+ plotOptions: {
89
+ areaspline: { stacking: this.stacked ? 'normal' : undefined, fillOpacity: 0.25 },
90
+ series: {
91
+ cursor: 'pointer',
92
+ point: {
93
+ events: {
94
+ click() {
95
+ self.emit('nile-chart-click', {
96
+ point: this,
97
+ category: this.category,
98
+ value: this.y,
99
+ seriesName: this.series.name,
100
+ });
101
+ },
102
+ },
103
+ },
104
+ },
105
+ },
106
+ series: this.data.map(s => ({
107
+ type: 'areaspline',
108
+ name: s.name,
109
+ data: s.data,
110
+ color: s.color,
111
+ })),
112
+ credits: { enabled: false },
113
+ }, this.options);
114
+ }
115
+ async initChart() {
116
+ if (this.loading || !this.chartContainer)
117
+ return;
118
+ if (!this._hc)
119
+ this._hc = await getHighcharts();
120
+ this.chart = this._hc.chart(this.chartContainer, this.buildOptions());
121
+ this.emit('nile-chart-ready', { chart: this.chart });
122
+ }
123
+ destroyChart() {
124
+ if (this.chart) {
125
+ this.chart.destroy();
126
+ this.chart = null;
127
+ }
128
+ }
129
+ render() {
130
+ if (this.loading) {
131
+ return html `<div class="chart-loading" style="height:${this.height}">Loading...</div>`;
132
+ }
133
+ return html `<div class="chart-container"></div>`;
134
+ }
135
+ };
136
+ NileAreaSplineChart.styles = styles;
137
+ __decorate([
138
+ query('.chart-container')
139
+ ], NileAreaSplineChart.prototype, "chartContainer", void 0);
140
+ __decorate([
141
+ property({ type: Object })
142
+ ], NileAreaSplineChart.prototype, "config", void 0);
143
+ __decorate([
144
+ property({ type: String, attribute: 'chart-title' })
145
+ ], NileAreaSplineChart.prototype, "chartTitle", void 0);
146
+ __decorate([
147
+ property({ type: String, attribute: 'chart-subtitle' })
148
+ ], NileAreaSplineChart.prototype, "chartSubtitle", void 0);
149
+ __decorate([
150
+ property({ type: Array })
151
+ ], NileAreaSplineChart.prototype, "data", void 0);
152
+ __decorate([
153
+ property({ type: Array })
154
+ ], NileAreaSplineChart.prototype, "categories", void 0);
155
+ __decorate([
156
+ property({ type: Object })
157
+ ], NileAreaSplineChart.prototype, "options", void 0);
158
+ __decorate([
159
+ property({ type: Boolean, reflect: true })
160
+ ], NileAreaSplineChart.prototype, "loading", void 0);
161
+ __decorate([
162
+ property({ type: String })
163
+ ], NileAreaSplineChart.prototype, "height", void 0);
164
+ __decorate([
165
+ property({ type: String, attribute: 'y-axis-title' })
166
+ ], NileAreaSplineChart.prototype, "yAxisTitle", void 0);
167
+ __decorate([
168
+ property({ type: Boolean })
169
+ ], NileAreaSplineChart.prototype, "stacked", void 0);
170
+ NileAreaSplineChart = __decorate([
171
+ customElement('nile-area-spline-chart')
172
+ ], NileAreaSplineChart);
173
+ export { NileAreaSplineChart };
174
+ //# sourceMappingURL=nile-area-spline-chart.js.map
@@ -100,7 +100,9 @@ let NileBellcurveChart = class NileBellcurveChart extends NileElement {
100
100
  const self = this;
101
101
  // Bell curve derives mean & σ from the **y** values of the base series (see Highcharts docs).
102
102
  // Do not use [x, 0] — that makes every y zero and collapses the curve.
103
- const scatterData = this.data.map(v => [v, v]);
103
+ // Highcharts #15: scatter x must be ascending; raw samples are often unsorted.
104
+ const sorted = [...this.data].sort((a, b) => a - b);
105
+ const scatterData = sorted.map(v => [v, v]);
104
106
  const pts = this.pointsInInterval > 0 ? this.pointsInInterval : 40;
105
107
  const iv = this.intervals > 0 ? this.intervals : 3;
106
108
  return deepMerge({
@@ -2,4 +2,4 @@ export { NileChart } from './nile-chart.js';
2
2
  export type { NileChartConfig, NileBarChartConfig, NilePieChartConfig, NileTrendlineChartConfig, NileAnomalyChartConfig, NileLineChartConfig, NileAreaChartConfig, NileColumnChartConfig, NileDonutChartConfig, NileScatterChartConfig, NileBubbleChartConfig, NileSplineChartConfig, NileRadarChartConfig, NileGaugeChartConfig, NileWaterfallChartConfig, ChartType, SwitchAggregation, NileAiConfig, } from './nile-chart-config.js';
3
3
  export { convertConfig, registerAdapter } from '../internal/chart-adapters.js';
4
4
  export { nileChartConfig } from './nile-chart-config-builder.js';
5
- export type { AiConfigType, SwitchableConfigType, AqConfigType, ChartBarConfigType, ChartPieConfigType, ChartTrendlineConfigType, ChartAnomalyConfigType, ChartLineConfigType, ChartAreaConfigType, ChartColumnConfigType, ChartDonutConfigType, ChartScatterConfigType, ChartBubbleConfigType, ChartSplineConfigType, ChartRadarConfigType, ChartGaugeConfigType, ChartWaterfallConfigType, ChartClusterConfigType, ChartStackedConfigType, ChartHistogramConfigType, ChartBellcurveConfigType, ChartBoxplotConfigType, ChartTimelineConfigType, ChartDumbbellConfigType, ChartFanConfigType, ChartFunnelConfigType, ChartFlameConfigType, ChartSpiderwebConfigType, ChartKpiPropsType, PrimitiveChartConfigType, SeparatedChartConfigInputType, AllChartConfigType, ChartConfigType, NileChartConfigInputType, ChartAiPanelPayload, ChartAiSenderPayload, NileAiPanelConfigInputType, NileAiSenderConfigInputType, } from '../internal/types/index.js';
5
+ export type { AiConfigType, SwitchableConfigType, AqConfigType, ChartBarConfigType, ChartPieConfigType, ChartTrendlineConfigType, ChartAnomalyConfigType, ChartLineConfigType, ChartAreaConfigType, ChartInvertedAreaConfigType, ChartColumnConfigType, ChartDonutConfigType, ChartScatterConfigType, ChartBubbleConfigType, ChartSplineConfigType, ChartRadarConfigType, ChartGaugeConfigType, ChartWaterfallConfigType, ChartClusterConfigType, ChartStackedConfigType, ChartHistogramConfigType, ChartBellcurveConfigType, ChartBoxplotConfigType, ChartTimelineConfigType, ChartDumbbellConfigType, ChartDumbbellLowerConfigType, ChartDumbbellUpperConfigType, ChartColumnPyramidConfigType, ChartLollipopConfigType, ChartAreaSplineConfigType, ChartAreaNegativeConfigType, ChartAreaRangeConfigType, ChartColumnRangeConfigType, ChartColumnDrilldownConfigType, ChartRadialBarConfigType, ChartVariablePieConfigType, ChartEulerConfigType, ChartPolygonConfigType, ChartVectorConfigType, ChartXrangeConfigType, ChartFanConfigType, ChartFunnelConfigType, ChartOrganizationConfigType, ChartLineColumnConfigType, ChartHeatmapConfigType, ChartFlameConfigType, ChartSpiderwebConfigType, ChartKpiPropsType, PrimitiveChartConfigType, SeparatedChartConfigInputType, AllChartConfigType, ChartConfigType, NileChartConfigInputType, ChartAiPanelPayload, ChartAiSenderPayload, NileAiPanelConfigInputType, NileAiSenderConfigInputType, } from '../internal/types/index.js';
@@ -1,19 +1,6 @@
1
- import type { Options } from 'highcharts';
2
- import type { BarChartSeriesData } from '../nile-bar-chart/nile-bar-chart.js';
3
- import type { PieChartSeriesData } from '../nile-pie-chart/nile-pie-chart.js';
4
- import type { TrendlineSeriesData, ForecastConfig } from '../nile-trendline-chart/nile-trendline-chart.js';
5
- import type { AnomalySeriesData, AnomalyConfig } from '../nile-anomaly-chart/nile-anomaly-chart.js';
6
- import type { LineChartSeriesData } from '../nile-line-chart/nile-line-chart.js';
7
- import type { AreaChartSeriesData } from '../nile-area-chart/nile-area-chart.js';
8
- import type { ColumnChartSeriesData } from '../nile-column-chart/nile-column-chart.js';
9
- import type { DonutChartSeriesData } from '../nile-donut-chart/nile-donut-chart.js';
10
- import type { ScatterChartSeriesData } from '../nile-scatter-chart/nile-scatter-chart.js';
11
- import type { BubbleChartSeriesData } from '../nile-bubble-chart/nile-bubble-chart.js';
12
- import type { SplineChartSeriesData } from '../nile-spline-chart/nile-spline-chart.js';
13
- import type { RadarChartSeriesData } from '../nile-radar-chart/nile-radar-chart.js';
14
- import type { GaugeBand } from '../nile-gauge-chart/nile-gauge-chart.js';
15
- import type { WaterfallDataPoint } from '../nile-waterfall-chart/nile-waterfall-chart.js';
16
- export type ChartType = 'bar' | 'pie' | 'trendline' | 'anomaly' | 'line' | 'area' | 'column' | 'donut' | 'scatter' | 'bubble' | 'spline' | 'radar' | 'gauge' | 'waterfall';
1
+ import type { ChartConfigType } from '../internal/types/chart-config.type.js';
2
+ /** Every supported `chart.type` value for `<nile-chart>`. */
3
+ export type ChartType = ChartConfigType['type'];
17
4
  export type SwitchAggregation = 'by-category' | 'by-series' | 'flatten';
18
5
  export interface NileAiConfig {
19
6
  /** Show the AI chat icon on the chart. Default: false. */
@@ -23,110 +10,63 @@ export interface NileAiConfig {
23
10
  /** Initial assistant message shown when the chat panel opens. */
24
11
  welcomeMessage?: string;
25
12
  }
13
+ /** Fields merged from `aq` (and shared card chrome) onto `chart` for `<nile-chart>`. */
26
14
  export interface NileChartConfigBase {
27
15
  chartTitle?: string;
28
16
  chartSubtitle?: string;
29
17
  height?: string;
30
18
  loading?: boolean;
31
- options?: Options;
19
+ options?: import('highcharts').Options;
32
20
  summary?: string;
33
21
  toggleLabel?: string;
34
22
  /** Chart types the user can switch to. Shows type-switch UI when set. */
35
23
  switchableTypes?: ChartType[];
36
- /** How to aggregate bar data when converting to pie. Default: 'by-category'. */
24
+ /** How to aggregate bar-like data when converting to pie. Default: 'by-category'. */
37
25
  switchAggregation?: SwitchAggregation;
38
26
  /** AI chat configuration. When ai.enabled is true, shows the allsearch icon. */
39
27
  ai?: NileAiConfig;
40
28
  }
41
- export interface NileBarChartConfig extends NileChartConfigBase {
29
+ /** Flat config for `<nile-chart>` after merging `chart` + `aq`. */
30
+ export type NileChartConfig = ChartConfigType & NileChartConfigBase;
31
+ export type NileBarChartConfig = Extract<NileChartConfig, {
42
32
  type: 'bar';
43
- data: BarChartSeriesData[];
44
- categories?: string[];
45
- yAxisTitle?: string;
46
- }
47
- export interface NilePieChartConfig extends NileChartConfigBase {
33
+ }>;
34
+ export type NilePieChartConfig = Extract<NileChartConfig, {
48
35
  type: 'pie';
49
- data: PieChartSeriesData[];
50
- seriesName?: string;
51
- showDataLabels?: boolean;
52
- showLegend?: boolean;
53
- }
54
- export interface NileTrendlineChartConfig extends NileChartConfigBase {
36
+ }>;
37
+ export type NileTrendlineChartConfig = Extract<NileChartConfig, {
55
38
  type: 'trendline';
56
- data: TrendlineSeriesData[];
57
- categories?: string[];
58
- yAxisTitle?: string;
59
- forecast?: ForecastConfig;
60
- }
61
- export interface NileAnomalyChartConfig extends NileChartConfigBase {
39
+ }>;
40
+ export type NileAnomalyChartConfig = Extract<NileChartConfig, {
62
41
  type: 'anomaly';
63
- data: AnomalySeriesData[];
64
- categories?: string[];
65
- yAxisTitle?: string;
66
- anomaly?: AnomalyConfig;
67
- }
68
- export interface NileLineChartConfig extends NileChartConfigBase {
42
+ }>;
43
+ export type NileLineChartConfig = Extract<NileChartConfig, {
69
44
  type: 'line';
70
- data: LineChartSeriesData[];
71
- categories?: string[];
72
- yAxisTitle?: string;
73
- }
74
- export interface NileAreaChartConfig extends NileChartConfigBase {
45
+ }>;
46
+ export type NileAreaChartConfig = Extract<NileChartConfig, {
75
47
  type: 'area';
76
- data: AreaChartSeriesData[];
77
- categories?: string[];
78
- yAxisTitle?: string;
79
- stacked?: boolean;
80
- }
81
- export interface NileColumnChartConfig extends NileChartConfigBase {
48
+ }>;
49
+ export type NileColumnChartConfig = Extract<NileChartConfig, {
82
50
  type: 'column';
83
- data: ColumnChartSeriesData[];
84
- categories?: string[];
85
- yAxisTitle?: string;
86
- }
87
- export interface NileDonutChartConfig extends NileChartConfigBase {
51
+ }>;
52
+ export type NileDonutChartConfig = Extract<NileChartConfig, {
88
53
  type: 'donut';
89
- data: DonutChartSeriesData[];
90
- seriesName?: string;
91
- innerSize?: string;
92
- showDataLabels?: boolean;
93
- showLegend?: boolean;
94
- }
95
- export interface NileScatterChartConfig extends NileChartConfigBase {
54
+ }>;
55
+ export type NileScatterChartConfig = Extract<NileChartConfig, {
96
56
  type: 'scatter';
97
- data: ScatterChartSeriesData[];
98
- xAxisTitle?: string;
99
- yAxisTitle?: string;
100
- }
101
- export interface NileBubbleChartConfig extends NileChartConfigBase {
57
+ }>;
58
+ export type NileBubbleChartConfig = Extract<NileChartConfig, {
102
59
  type: 'bubble';
103
- data: BubbleChartSeriesData[];
104
- xAxisTitle?: string;
105
- yAxisTitle?: string;
106
- }
107
- export interface NileSplineChartConfig extends NileChartConfigBase {
60
+ }>;
61
+ export type NileSplineChartConfig = Extract<NileChartConfig, {
108
62
  type: 'spline';
109
- data: SplineChartSeriesData[];
110
- categories?: string[];
111
- yAxisTitle?: string;
112
- }
113
- export interface NileRadarChartConfig extends NileChartConfigBase {
63
+ }>;
64
+ export type NileRadarChartConfig = Extract<NileChartConfig, {
114
65
  type: 'radar';
115
- data: RadarChartSeriesData[];
116
- categories?: string[];
117
- showArea?: boolean;
118
- }
119
- export interface NileGaugeChartConfig extends NileChartConfigBase {
66
+ }>;
67
+ export type NileGaugeChartConfig = Extract<NileChartConfig, {
120
68
  type: 'gauge';
121
- value: number;
122
- min?: number;
123
- max?: number;
124
- suffix?: string;
125
- bands?: GaugeBand[];
126
- }
127
- export interface NileWaterfallChartConfig extends NileChartConfigBase {
69
+ }>;
70
+ export type NileWaterfallChartConfig = Extract<NileChartConfig, {
128
71
  type: 'waterfall';
129
- data: WaterfallDataPoint[];
130
- yAxisTitle?: string;
131
- }
132
- export type NileChartConfig = NileBarChartConfig | NilePieChartConfig | NileTrendlineChartConfig | NileAnomalyChartConfig | NileLineChartConfig | NileAreaChartConfig | NileColumnChartConfig | NileDonutChartConfig | NileScatterChartConfig | NileBubbleChartConfig | NileSplineChartConfig | NileRadarChartConfig | NileGaugeChartConfig | NileWaterfallChartConfig;
72
+ }>;
@@ -13,7 +13,7 @@ export const styles = css `
13
13
  /* ── Unified Card Container ── */
14
14
 
15
15
  .chart-card {
16
- background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
16
+ background: var(--nile-colors-white-base, var(--ng-colors-bg-quaternary-alt));
17
17
  border: var(--nile-border-width-1, var(--ng-stroke-width-1)) solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
18
18
  border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-xl));
19
19
  box-shadow: var(--nile-box-shadow-3, var(--ng-shadow-sm));
@@ -16,11 +16,46 @@ import '../nile-spline-chart/index.js';
16
16
  import '../nile-radar-chart/index.js';
17
17
  import '../nile-gauge-chart/index.js';
18
18
  import '../nile-waterfall-chart/index.js';
19
+ import '../nile-cluster-chart/index.js';
20
+ import '../nile-stacked-chart/index.js';
21
+ import '../nile-histogram-chart/index.js';
22
+ import '../nile-bellcurve-chart/index.js';
23
+ import '../nile-boxplot-chart/index.js';
24
+ import '../nile-timeline-chart/index.js';
25
+ import '../nile-dumbbell-chart/index.js';
26
+ import '../nile-dumbbell-lower-chart/index.js';
27
+ import '../nile-dumbbell-upper-chart/index.js';
28
+ import '../nile-fan-chart/index.js';
29
+ import '../nile-funnel-chart/index.js';
30
+ import '../nile-organization-chart/index.js';
31
+ import '../nile-line-column-chart/index.js';
32
+ import '../nile-heatmap-chart/index.js';
33
+ import '../nile-flame-chart/index.js';
34
+ import '../nile-spiderweb-chart/index.js';
35
+ import '../nile-column-pyramid-chart/index.js';
36
+ import '../nile-lollipop-chart/index.js';
37
+ import '../nile-inverted-area-chart/index.js';
38
+ import '../nile-area-spline-chart/index.js';
39
+ import '../nile-area-negative-chart/index.js';
40
+ import '../nile-area-range-chart/index.js';
41
+ import '../nile-column-range-chart/index.js';
42
+ import '../nile-column-drilldown-chart/index.js';
43
+ import '../nile-radial-bar-chart/index.js';
44
+ import '../nile-variable-pie-chart/index.js';
45
+ import '../nile-euler-chart/index.js';
46
+ import '../nile-polygon-chart/index.js';
47
+ import '../nile-vector-chart/index.js';
48
+ import '../nile-xrange-chart/index.js';
19
49
  import '../nile-ai-panel/index.js';
20
50
  export declare class NileChart extends NileElement {
21
51
  static styles: CSSResultGroup;
22
52
  /** Full chart configuration. Accepts flat NileChartConfig or separated { chart, aq } input. */
23
53
  config: NileChartConfig | NileChartConfigInputType | null;
54
+ /**
55
+ * When set, fills `chart.type` if the config omits it (same values as `chart.type`, e.g. `stacked`, `pie`).
56
+ * Usage: `<nile-chart chart-type="pie" />` plus `config.chart` with series data only.
57
+ */
58
+ chartTypeAttr: string;
24
59
  /** The summary/insight text displayed in the overlay (fallback when config is not set). */
25
60
  summary: string;
26
61
  /** Label for the toggle button (fallback when config is not set). */
@@ -38,6 +73,7 @@ export declare class NileChart extends NileElement {
38
73
  private handleOutsideClick;
39
74
  connectedCallback(): void;
40
75
  disconnectedCallback(): void;
76
+ private mergeChartTypeFromAttr;
41
77
  /** Resolve { chart, aq } input to flat NileChartConfig. */
42
78
  private resolveConfig;
43
79
  private resolvedConfig;