@aquera/nile-visualization 0.1.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 (121) hide show
  1. package/dist/src/index.d.ts +35 -0
  2. package/dist/src/index.js +20 -0
  3. package/dist/src/internal/chart-adapters.d.ts +11 -0
  4. package/dist/src/internal/chart-adapters.js +159 -0
  5. package/dist/src/internal/highcharts-provider.d.ts +14 -0
  6. package/dist/src/internal/highcharts-provider.js +56 -0
  7. package/dist/src/internal/nile-element.d.ts +8 -0
  8. package/dist/src/internal/nile-element.js +21 -0
  9. package/dist/src/internal/utils.d.ts +1 -0
  10. package/dist/src/internal/utils.js +23 -0
  11. package/dist/src/nile-ai-panel/index.d.ts +1 -0
  12. package/dist/src/nile-ai-panel/index.js +2 -0
  13. package/dist/src/nile-ai-panel/nile-ai-panel.css.d.ts +1 -0
  14. package/dist/src/nile-ai-panel/nile-ai-panel.css.js +73 -0
  15. package/dist/src/nile-ai-panel/nile-ai-panel.d.ts +29 -0
  16. package/dist/src/nile-ai-panel/nile-ai-panel.js +98 -0
  17. package/dist/src/nile-ai-sender/index.d.ts +1 -0
  18. package/dist/src/nile-ai-sender/index.js +2 -0
  19. package/dist/src/nile-ai-sender/nile-ai-sender.css.d.ts +1 -0
  20. package/dist/src/nile-ai-sender/nile-ai-sender.css.js +71 -0
  21. package/dist/src/nile-ai-sender/nile-ai-sender.d.ts +20 -0
  22. package/dist/src/nile-ai-sender/nile-ai-sender.js +77 -0
  23. package/dist/src/nile-anomaly-chart/index.d.ts +2 -0
  24. package/dist/src/nile-anomaly-chart/index.js +2 -0
  25. package/dist/src/nile-anomaly-chart/nile-anomaly-chart.css.d.ts +1 -0
  26. package/dist/src/nile-anomaly-chart/nile-anomaly-chart.css.js +28 -0
  27. package/dist/src/nile-anomaly-chart/nile-anomaly-chart.d.ts +59 -0
  28. package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +268 -0
  29. package/dist/src/nile-area-chart/index.d.ts +2 -0
  30. package/dist/src/nile-area-chart/index.js +2 -0
  31. package/dist/src/nile-area-chart/nile-area-chart.css.d.ts +1 -0
  32. package/dist/src/nile-area-chart/nile-area-chart.css.js +28 -0
  33. package/dist/src/nile-area-chart/nile-area-chart.d.ts +37 -0
  34. package/dist/src/nile-area-chart/nile-area-chart.js +122 -0
  35. package/dist/src/nile-bar-chart/index.d.ts +2 -0
  36. package/dist/src/nile-bar-chart/index.js +2 -0
  37. package/dist/src/nile-bar-chart/nile-bar-chart.css.d.ts +1 -0
  38. package/dist/src/nile-bar-chart/nile-bar-chart.css.js +28 -0
  39. package/dist/src/nile-bar-chart/nile-bar-chart.d.ts +44 -0
  40. package/dist/src/nile-bar-chart/nile-bar-chart.js +185 -0
  41. package/dist/src/nile-bubble-chart/index.d.ts +2 -0
  42. package/dist/src/nile-bubble-chart/index.js +2 -0
  43. package/dist/src/nile-bubble-chart/nile-bubble-chart.css.d.ts +1 -0
  44. package/dist/src/nile-bubble-chart/nile-bubble-chart.css.js +28 -0
  45. package/dist/src/nile-bubble-chart/nile-bubble-chart.d.ts +36 -0
  46. package/dist/src/nile-bubble-chart/nile-bubble-chart.js +123 -0
  47. package/dist/src/nile-chart/index.d.ts +3 -0
  48. package/dist/src/nile-chart/index.js +3 -0
  49. package/dist/src/nile-chart/nile-chart-config.d.ts +58 -0
  50. package/dist/src/nile-chart/nile-chart-config.js +2 -0
  51. package/dist/src/nile-chart/nile-chart.css.d.ts +1 -0
  52. package/dist/src/nile-chart/nile-chart.css.js +298 -0
  53. package/dist/src/nile-chart/nile-chart.d.ts +51 -0
  54. package/dist/src/nile-chart/nile-chart.js +303 -0
  55. package/dist/src/nile-column-chart/index.d.ts +2 -0
  56. package/dist/src/nile-column-chart/index.js +2 -0
  57. package/dist/src/nile-column-chart/nile-column-chart.css.d.ts +1 -0
  58. package/dist/src/nile-column-chart/nile-column-chart.css.js +28 -0
  59. package/dist/src/nile-column-chart/nile-column-chart.d.ts +36 -0
  60. package/dist/src/nile-column-chart/nile-column-chart.js +118 -0
  61. package/dist/src/nile-donut-chart/index.d.ts +2 -0
  62. package/dist/src/nile-donut-chart/index.js +2 -0
  63. package/dist/src/nile-donut-chart/nile-donut-chart.css.d.ts +1 -0
  64. package/dist/src/nile-donut-chart/nile-donut-chart.css.js +28 -0
  65. package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +40 -0
  66. package/dist/src/nile-donut-chart/nile-donut-chart.js +131 -0
  67. package/dist/src/nile-gauge-chart/index.d.ts +2 -0
  68. package/dist/src/nile-gauge-chart/index.js +2 -0
  69. package/dist/src/nile-gauge-chart/nile-gauge-chart.css.d.ts +1 -0
  70. package/dist/src/nile-gauge-chart/nile-gauge-chart.css.js +28 -0
  71. package/dist/src/nile-gauge-chart/nile-gauge-chart.d.ts +38 -0
  72. package/dist/src/nile-gauge-chart/nile-gauge-chart.js +149 -0
  73. package/dist/src/nile-kpi-chart/index.d.ts +2 -0
  74. package/dist/src/nile-kpi-chart/index.js +2 -0
  75. package/dist/src/nile-kpi-chart/nile-kpi-chart.css.d.ts +1 -0
  76. package/dist/src/nile-kpi-chart/nile-kpi-chart.css.js +165 -0
  77. package/dist/src/nile-kpi-chart/nile-kpi-chart.d.ts +80 -0
  78. package/dist/src/nile-kpi-chart/nile-kpi-chart.js +335 -0
  79. package/dist/src/nile-line-chart/index.d.ts +2 -0
  80. package/dist/src/nile-line-chart/index.js +2 -0
  81. package/dist/src/nile-line-chart/nile-line-chart.css.d.ts +1 -0
  82. package/dist/src/nile-line-chart/nile-line-chart.css.js +28 -0
  83. package/dist/src/nile-line-chart/nile-line-chart.d.ts +36 -0
  84. package/dist/src/nile-line-chart/nile-line-chart.js +115 -0
  85. package/dist/src/nile-pie-chart/index.d.ts +2 -0
  86. package/dist/src/nile-pie-chart/index.js +2 -0
  87. package/dist/src/nile-pie-chart/nile-pie-chart.css.d.ts +1 -0
  88. package/dist/src/nile-pie-chart/nile-pie-chart.css.js +28 -0
  89. package/dist/src/nile-pie-chart/nile-pie-chart.d.ts +48 -0
  90. package/dist/src/nile-pie-chart/nile-pie-chart.js +197 -0
  91. package/dist/src/nile-radar-chart/index.d.ts +2 -0
  92. package/dist/src/nile-radar-chart/index.js +2 -0
  93. package/dist/src/nile-radar-chart/nile-radar-chart.css.d.ts +1 -0
  94. package/dist/src/nile-radar-chart/nile-radar-chart.css.js +28 -0
  95. package/dist/src/nile-radar-chart/nile-radar-chart.d.ts +36 -0
  96. package/dist/src/nile-radar-chart/nile-radar-chart.js +137 -0
  97. package/dist/src/nile-scatter-chart/index.d.ts +2 -0
  98. package/dist/src/nile-scatter-chart/index.js +2 -0
  99. package/dist/src/nile-scatter-chart/nile-scatter-chart.css.d.ts +1 -0
  100. package/dist/src/nile-scatter-chart/nile-scatter-chart.css.js +28 -0
  101. package/dist/src/nile-scatter-chart/nile-scatter-chart.d.ts +36 -0
  102. package/dist/src/nile-scatter-chart/nile-scatter-chart.js +124 -0
  103. package/dist/src/nile-spline-chart/index.d.ts +2 -0
  104. package/dist/src/nile-spline-chart/index.js +2 -0
  105. package/dist/src/nile-spline-chart/nile-spline-chart.css.d.ts +1 -0
  106. package/dist/src/nile-spline-chart/nile-spline-chart.css.js +28 -0
  107. package/dist/src/nile-spline-chart/nile-spline-chart.d.ts +36 -0
  108. package/dist/src/nile-spline-chart/nile-spline-chart.js +118 -0
  109. package/dist/src/nile-trendline-chart/index.d.ts +2 -0
  110. package/dist/src/nile-trendline-chart/index.js +2 -0
  111. package/dist/src/nile-trendline-chart/nile-trendline-chart.css.d.ts +1 -0
  112. package/dist/src/nile-trendline-chart/nile-trendline-chart.css.js +28 -0
  113. package/dist/src/nile-trendline-chart/nile-trendline-chart.d.ts +59 -0
  114. package/dist/src/nile-trendline-chart/nile-trendline-chart.js +246 -0
  115. package/dist/src/nile-waterfall-chart/index.d.ts +2 -0
  116. package/dist/src/nile-waterfall-chart/index.js +2 -0
  117. package/dist/src/nile-waterfall-chart/nile-waterfall-chart.css.d.ts +1 -0
  118. package/dist/src/nile-waterfall-chart/nile-waterfall-chart.css.js +28 -0
  119. package/dist/src/nile-waterfall-chart/nile-waterfall-chart.d.ts +37 -0
  120. package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +137 -0
  121. package/package.json +62 -0
@@ -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-bar-chart.css.js.map
@@ -0,0 +1,44 @@
1
+ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
2
+ import type Highcharts from 'highcharts';
3
+ import NileElement from '../internal/nile-element.js';
4
+ export interface BarChartSeriesData {
5
+ name: string;
6
+ data: number[];
7
+ color?: string;
8
+ }
9
+ export declare class NileBarChart extends NileElement {
10
+ static styles: CSSResultGroup;
11
+ private _hc;
12
+ private chart;
13
+ private resizeObserver;
14
+ private chartContainer;
15
+ /** The chart title displayed above the chart. */
16
+ chartTitle: string;
17
+ /** The subtitle displayed below the title. */
18
+ chartSubtitle: string;
19
+ /** Array of series data objects. Each object has a name, data array, and optional color. */
20
+ data: BarChartSeriesData[];
21
+ /** X-axis category labels. */
22
+ categories: string[];
23
+ /** Deep-merge override object for full Highcharts options. */
24
+ options: Highcharts.Options;
25
+ /** Whether to show a loading indicator instead of the chart. */
26
+ loading: boolean;
27
+ /** CSS height for the chart container. */
28
+ height: string;
29
+ /** Y-axis title text. */
30
+ yAxisTitle: string;
31
+ disconnectedCallback(): void;
32
+ protected firstUpdated(): void;
33
+ protected updated(changedProperties: PropertyValues): void;
34
+ private setupResizeObserver;
35
+ private buildOptions;
36
+ private initChart;
37
+ private destroyChart;
38
+ render(): TemplateResult;
39
+ }
40
+ declare global {
41
+ interface HTMLElementTagNameMap {
42
+ 'nile-bar-chart': NileBarChart;
43
+ }
44
+ }
@@ -0,0 +1,185 @@
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 { getHighcharts } from '../internal/highcharts-provider.js';
6
+ import { deepMerge } from '../internal/utils.js';
7
+ import { styles } from './nile-bar-chart.css.js';
8
+ let NileBarChart = class NileBarChart extends NileElement {
9
+ constructor() {
10
+ super(...arguments);
11
+ this._hc = null;
12
+ this.chart = null;
13
+ this.resizeObserver = null;
14
+ /** The chart title displayed above the chart. */
15
+ this.chartTitle = '';
16
+ /** The subtitle displayed below the title. */
17
+ this.chartSubtitle = '';
18
+ /** Array of series data objects. Each object has a name, data array, and optional color. */
19
+ this.data = [];
20
+ /** X-axis category labels. */
21
+ this.categories = [];
22
+ /** Deep-merge override object for full Highcharts options. */
23
+ this.options = {};
24
+ /** Whether to show a loading indicator instead of the chart. */
25
+ this.loading = false;
26
+ /** CSS height for the chart container. */
27
+ this.height = '400px';
28
+ /** Y-axis title text. */
29
+ this.yAxisTitle = '';
30
+ }
31
+ disconnectedCallback() {
32
+ super.disconnectedCallback();
33
+ this.destroyChart();
34
+ this.resizeObserver?.disconnect();
35
+ this.resizeObserver = null;
36
+ }
37
+ firstUpdated() {
38
+ this.initChart();
39
+ this.setupResizeObserver();
40
+ }
41
+ updated(changedProperties) {
42
+ const chartProps = [
43
+ 'data',
44
+ 'categories',
45
+ 'chartTitle',
46
+ 'chartSubtitle',
47
+ 'options',
48
+ 'height',
49
+ 'yAxisTitle',
50
+ 'loading',
51
+ ];
52
+ const needsUpdate = chartProps.some(p => changedProperties.has(p));
53
+ if (!needsUpdate)
54
+ return;
55
+ if (this.loading) {
56
+ this.destroyChart();
57
+ return;
58
+ }
59
+ if (this.chart) {
60
+ this.chart.update(this.buildOptions(), true, true);
61
+ }
62
+ else {
63
+ this.initChart();
64
+ }
65
+ }
66
+ setupResizeObserver() {
67
+ if (!this.chartContainer)
68
+ return;
69
+ this.resizeObserver = new ResizeObserver(() => {
70
+ this.chart?.reflow();
71
+ });
72
+ this.resizeObserver.observe(this.chartContainer);
73
+ }
74
+ buildOptions() {
75
+ const self = this;
76
+ const defaults = {
77
+ chart: {
78
+ type: 'bar',
79
+ height: this.height,
80
+ },
81
+ title: {
82
+ text: this.chartTitle || undefined,
83
+ },
84
+ subtitle: {
85
+ text: this.chartSubtitle || undefined,
86
+ },
87
+ xAxis: {
88
+ categories: this.categories,
89
+ title: { text: undefined },
90
+ },
91
+ yAxis: {
92
+ min: 0,
93
+ title: { text: this.yAxisTitle || undefined },
94
+ },
95
+ tooltip: {
96
+ valueSuffix: '',
97
+ },
98
+ plotOptions: {
99
+ bar: {
100
+ dataLabels: {
101
+ enabled: false,
102
+ },
103
+ },
104
+ series: {
105
+ cursor: 'pointer',
106
+ point: {
107
+ events: {
108
+ click() {
109
+ self.emit('nile-chart-click', {
110
+ point: this,
111
+ category: this.category,
112
+ value: this.y,
113
+ seriesName: this.series.name,
114
+ });
115
+ },
116
+ },
117
+ },
118
+ },
119
+ },
120
+ series: this.data.map(s => ({
121
+ type: 'bar',
122
+ name: s.name,
123
+ data: s.data,
124
+ color: s.color,
125
+ })),
126
+ credits: {
127
+ enabled: false,
128
+ },
129
+ };
130
+ return deepMerge(defaults, this.options);
131
+ }
132
+ async initChart() {
133
+ if (this.loading || !this.chartContainer)
134
+ return;
135
+ if (!this._hc)
136
+ this._hc = await getHighcharts();
137
+ this.chart = this._hc.chart(this.chartContainer, this.buildOptions());
138
+ this.emit('nile-chart-ready', { chart: this.chart });
139
+ }
140
+ destroyChart() {
141
+ if (this.chart) {
142
+ this.chart.destroy();
143
+ this.chart = null;
144
+ }
145
+ }
146
+ render() {
147
+ if (this.loading) {
148
+ return html `<div class="chart-loading" style="height:${this.height}">Loading...</div>`;
149
+ }
150
+ return html `<div class="chart-container"></div>`;
151
+ }
152
+ };
153
+ NileBarChart.styles = styles;
154
+ __decorate([
155
+ query('.chart-container')
156
+ ], NileBarChart.prototype, "chartContainer", void 0);
157
+ __decorate([
158
+ property({ type: String, attribute: 'chart-title' })
159
+ ], NileBarChart.prototype, "chartTitle", void 0);
160
+ __decorate([
161
+ property({ type: String, attribute: 'chart-subtitle' })
162
+ ], NileBarChart.prototype, "chartSubtitle", void 0);
163
+ __decorate([
164
+ property({ type: Array })
165
+ ], NileBarChart.prototype, "data", void 0);
166
+ __decorate([
167
+ property({ type: Array })
168
+ ], NileBarChart.prototype, "categories", void 0);
169
+ __decorate([
170
+ property({ type: Object })
171
+ ], NileBarChart.prototype, "options", void 0);
172
+ __decorate([
173
+ property({ type: Boolean, reflect: true })
174
+ ], NileBarChart.prototype, "loading", void 0);
175
+ __decorate([
176
+ property({ type: String })
177
+ ], NileBarChart.prototype, "height", void 0);
178
+ __decorate([
179
+ property({ type: String, attribute: 'y-axis-title' })
180
+ ], NileBarChart.prototype, "yAxisTitle", void 0);
181
+ NileBarChart = __decorate([
182
+ customElement('nile-bar-chart')
183
+ ], NileBarChart);
184
+ export { NileBarChart };
185
+ //# sourceMappingURL=nile-bar-chart.js.map
@@ -0,0 +1,2 @@
1
+ export { NileBubbleChart } from './nile-bubble-chart.js';
2
+ export type { BubbleChartSeriesData } from './nile-bubble-chart.js';
@@ -0,0 +1,2 @@
1
+ export { NileBubbleChart } from './nile-bubble-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-bubble-chart.css.js.map
@@ -0,0 +1,36 @@
1
+ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
2
+ import type Highcharts from 'highcharts';
3
+ import NileElement from '../internal/nile-element.js';
4
+ export interface BubbleChartSeriesData {
5
+ name: string;
6
+ data: [number, number, number][];
7
+ color?: string;
8
+ }
9
+ export declare class NileBubbleChart extends NileElement {
10
+ static styles: CSSResultGroup;
11
+ private _hc;
12
+ private chart;
13
+ private resizeObserver;
14
+ private chartContainer;
15
+ chartTitle: string;
16
+ chartSubtitle: string;
17
+ data: BubbleChartSeriesData[];
18
+ options: Highcharts.Options;
19
+ loading: boolean;
20
+ height: string;
21
+ xAxisTitle: string;
22
+ yAxisTitle: string;
23
+ disconnectedCallback(): void;
24
+ protected firstUpdated(): void;
25
+ protected updated(changedProperties: PropertyValues): void;
26
+ private setupResizeObserver;
27
+ private buildOptions;
28
+ private initChart;
29
+ private destroyChart;
30
+ render(): TemplateResult;
31
+ }
32
+ declare global {
33
+ interface HTMLElementTagNameMap {
34
+ 'nile-bubble-chart': NileBubbleChart;
35
+ }
36
+ }
@@ -0,0 +1,123 @@
1
+ import { __decorate } from "tslib";
2
+ import { customElement, property, query } from 'lit/decorators.js';
3
+ import { html } from 'lit';
4
+ import { getHighcharts } from '../internal/highcharts-provider.js';
5
+ import NileElement from '../internal/nile-element.js';
6
+ import { deepMerge } from '../internal/utils.js';
7
+ import { styles } from './nile-bubble-chart.css.js';
8
+ let NileBubbleChart = class NileBubbleChart extends NileElement {
9
+ constructor() {
10
+ super(...arguments);
11
+ this._hc = null;
12
+ this.chart = null;
13
+ this.resizeObserver = null;
14
+ this.chartTitle = '';
15
+ this.chartSubtitle = '';
16
+ this.data = [];
17
+ this.options = {};
18
+ this.loading = false;
19
+ this.height = '400px';
20
+ this.xAxisTitle = '';
21
+ this.yAxisTitle = '';
22
+ }
23
+ disconnectedCallback() {
24
+ super.disconnectedCallback();
25
+ this.destroyChart();
26
+ this.resizeObserver?.disconnect();
27
+ this.resizeObserver = null;
28
+ }
29
+ firstUpdated() { this.initChart(); this.setupResizeObserver(); }
30
+ updated(changedProperties) {
31
+ const props = ['data', 'chartTitle', 'chartSubtitle', 'options', 'height', 'xAxisTitle', 'yAxisTitle', 'loading'];
32
+ if (!props.some(p => changedProperties.has(p)))
33
+ return;
34
+ if (this.loading) {
35
+ this.destroyChart();
36
+ return;
37
+ }
38
+ if (this.chart) {
39
+ this.chart.update(this.buildOptions(), true, true);
40
+ }
41
+ else {
42
+ this.initChart();
43
+ }
44
+ }
45
+ setupResizeObserver() {
46
+ if (!this.chartContainer)
47
+ return;
48
+ this.resizeObserver = new ResizeObserver(() => { this.chart?.reflow(); });
49
+ this.resizeObserver.observe(this.chartContainer);
50
+ }
51
+ buildOptions() {
52
+ const self = this;
53
+ return deepMerge({
54
+ chart: { type: 'bubble', height: this.height, zoomType: 'xy' },
55
+ title: { text: this.chartTitle || undefined },
56
+ subtitle: { text: this.chartSubtitle || undefined },
57
+ xAxis: { title: { text: this.xAxisTitle || undefined } },
58
+ yAxis: { title: { text: this.yAxisTitle || undefined } },
59
+ tooltip: {
60
+ useHTML: true,
61
+ headerFormat: '<table>',
62
+ pointFormat: '<tr><th colspan="2"><b>{series.name}</b></th></tr><tr><td>x:</td><td>{point.x}</td></tr><tr><td>y:</td><td>{point.y}</td></tr><tr><td>size:</td><td>{point.z}</td></tr>',
63
+ footerFormat: '</table>',
64
+ },
65
+ plotOptions: {
66
+ bubble: { minSize: 8, maxSize: 60 },
67
+ series: { cursor: 'pointer', point: { events: { click() { self.emit('nile-chart-click', { point: this, x: this.x, y: this.y, z: this.z, seriesName: this.series.name }); } } } },
68
+ },
69
+ series: this.data.map(s => ({ type: 'bubble', name: s.name, data: s.data, color: s.color })),
70
+ credits: { enabled: false },
71
+ }, this.options);
72
+ }
73
+ async initChart() {
74
+ if (this.loading || !this.chartContainer)
75
+ return;
76
+ if (!this._hc)
77
+ this._hc = await getHighcharts();
78
+ this.chart = this._hc.chart(this.chartContainer, this.buildOptions());
79
+ this.emit('nile-chart-ready', { chart: this.chart });
80
+ }
81
+ destroyChart() { if (this.chart) {
82
+ this.chart.destroy();
83
+ this.chart = null;
84
+ } }
85
+ render() {
86
+ if (this.loading)
87
+ return html `<div class="chart-loading" style="height:${this.height}">Loading...</div>`;
88
+ return html `<div class="chart-container"></div>`;
89
+ }
90
+ };
91
+ NileBubbleChart.styles = styles;
92
+ __decorate([
93
+ query('.chart-container')
94
+ ], NileBubbleChart.prototype, "chartContainer", void 0);
95
+ __decorate([
96
+ property({ type: String, attribute: 'chart-title' })
97
+ ], NileBubbleChart.prototype, "chartTitle", void 0);
98
+ __decorate([
99
+ property({ type: String, attribute: 'chart-subtitle' })
100
+ ], NileBubbleChart.prototype, "chartSubtitle", void 0);
101
+ __decorate([
102
+ property({ type: Array })
103
+ ], NileBubbleChart.prototype, "data", void 0);
104
+ __decorate([
105
+ property({ type: Object })
106
+ ], NileBubbleChart.prototype, "options", void 0);
107
+ __decorate([
108
+ property({ type: Boolean, reflect: true })
109
+ ], NileBubbleChart.prototype, "loading", void 0);
110
+ __decorate([
111
+ property({ type: String })
112
+ ], NileBubbleChart.prototype, "height", void 0);
113
+ __decorate([
114
+ property({ type: String, attribute: 'x-axis-title' })
115
+ ], NileBubbleChart.prototype, "xAxisTitle", void 0);
116
+ __decorate([
117
+ property({ type: String, attribute: 'y-axis-title' })
118
+ ], NileBubbleChart.prototype, "yAxisTitle", void 0);
119
+ NileBubbleChart = __decorate([
120
+ customElement('nile-bubble-chart')
121
+ ], NileBubbleChart);
122
+ export { NileBubbleChart };
123
+ //# sourceMappingURL=nile-bubble-chart.js.map
@@ -0,0 +1,3 @@
1
+ export { NileChart } from './nile-chart.js';
2
+ export type { NileChartConfig, NileBarChartConfig, NilePieChartConfig, NileTrendlineChartConfig, NileAnomalyChartConfig, ChartType, SwitchAggregation, NileAiConfig, } from './nile-chart-config.js';
3
+ export { convertConfig, registerAdapter } from '../internal/chart-adapters.js';
@@ -0,0 +1,3 @@
1
+ export { NileChart } from './nile-chart.js';
2
+ export { convertConfig, registerAdapter } from '../internal/chart-adapters.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,58 @@
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
+ export type ChartType = 'bar' | 'pie' | 'trendline' | 'anomaly';
7
+ export type SwitchAggregation = 'by-category' | 'by-series' | 'flatten';
8
+ export interface NileAiConfig {
9
+ /** Show the AI chat icon on the chart. Default: false. */
10
+ enabled?: boolean;
11
+ /** Placeholder text for the chat input. */
12
+ placeholder?: string;
13
+ /** Initial assistant message shown when the chat panel opens. */
14
+ welcomeMessage?: string;
15
+ }
16
+ export interface NileChartConfigBase {
17
+ chartTitle?: string;
18
+ chartSubtitle?: string;
19
+ height?: string;
20
+ loading?: boolean;
21
+ options?: Options;
22
+ summary?: string;
23
+ toggleLabel?: string;
24
+ /** Chart types the user can switch to. Shows type-switch UI when set. */
25
+ switchableTypes?: ChartType[];
26
+ /** How to aggregate bar data when converting to pie. Default: 'by-category'. */
27
+ switchAggregation?: SwitchAggregation;
28
+ /** AI chat configuration. When ai.enabled is true, shows the allsearch icon. */
29
+ ai?: NileAiConfig;
30
+ }
31
+ export interface NileBarChartConfig extends NileChartConfigBase {
32
+ type: 'bar';
33
+ data: BarChartSeriesData[];
34
+ categories?: string[];
35
+ yAxisTitle?: string;
36
+ }
37
+ export interface NilePieChartConfig extends NileChartConfigBase {
38
+ type: 'pie';
39
+ data: PieChartSeriesData[];
40
+ seriesName?: string;
41
+ showDataLabels?: boolean;
42
+ showLegend?: boolean;
43
+ }
44
+ export interface NileTrendlineChartConfig extends NileChartConfigBase {
45
+ type: 'trendline';
46
+ data: TrendlineSeriesData[];
47
+ categories?: string[];
48
+ yAxisTitle?: string;
49
+ forecast?: ForecastConfig;
50
+ }
51
+ export interface NileAnomalyChartConfig extends NileChartConfigBase {
52
+ type: 'anomaly';
53
+ data: AnomalySeriesData[];
54
+ categories?: string[];
55
+ yAxisTitle?: string;
56
+ anomaly?: AnomalyConfig;
57
+ }
58
+ export type NileChartConfig = NileBarChartConfig | NilePieChartConfig | NileTrendlineChartConfig | NileAnomalyChartConfig;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=nile-chart-config.js.map
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;