@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
@@ -0,0 +1,259 @@
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 { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
7
+ import { deepMerge } from '../internal/utils.js';
8
+ import { styles } from './nile-heatmap-chart.css.js';
9
+ let NileHeatmapChart = class NileHeatmapChart 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.xCategories = [];
19
+ this.yCategories = [];
20
+ this.data = [];
21
+ this.seriesName = '';
22
+ this.colorMin = null;
23
+ this.colorMax = null;
24
+ this.minColor = '#ffffff';
25
+ this.maxColor = '#1e40af';
26
+ this.colorAxisTitle = '';
27
+ this.options = {};
28
+ this.loading = false;
29
+ this.height = '400px';
30
+ this.showDataLabels = true;
31
+ }
32
+ applyConfig(cfg) {
33
+ applySeparatedChartConfig(this, cfg);
34
+ }
35
+ connectedCallback() {
36
+ super.connectedCallback();
37
+ if (this.config)
38
+ this.applyConfig(this.config);
39
+ }
40
+ disconnectedCallback() {
41
+ super.disconnectedCallback();
42
+ this.destroyChart();
43
+ this.resizeObserver?.disconnect();
44
+ this.resizeObserver = null;
45
+ }
46
+ firstUpdated() {
47
+ this.initChart();
48
+ this.setupResizeObserver();
49
+ }
50
+ updated(changedProperties) {
51
+ if (changedProperties.has('config') && this.config) {
52
+ this.applyConfig(this.config);
53
+ return;
54
+ }
55
+ const props = [
56
+ 'xCategories',
57
+ 'yCategories',
58
+ 'data',
59
+ 'chartTitle',
60
+ 'chartSubtitle',
61
+ 'seriesName',
62
+ 'colorMin',
63
+ 'colorMax',
64
+ 'minColor',
65
+ 'maxColor',
66
+ 'colorAxisTitle',
67
+ 'options',
68
+ 'height',
69
+ 'loading',
70
+ 'showDataLabels',
71
+ ];
72
+ if (!props.some(p => changedProperties.has(p)))
73
+ return;
74
+ if (this.loading) {
75
+ this.destroyChart();
76
+ return;
77
+ }
78
+ if (this.chart) {
79
+ this.chart.update(this.buildOptions(), true, true);
80
+ }
81
+ else {
82
+ this.initChart();
83
+ }
84
+ }
85
+ setupResizeObserver() {
86
+ if (!this.chartContainer)
87
+ return;
88
+ this.resizeObserver = new ResizeObserver(() => {
89
+ this.chart?.reflow();
90
+ });
91
+ this.resizeObserver.observe(this.chartContainer);
92
+ }
93
+ valueExtent() {
94
+ if (this.data.length === 0)
95
+ return { min: 0, max: 1 };
96
+ let min = this.data[0].value;
97
+ let max = min;
98
+ for (const c of this.data) {
99
+ if (c.value < min)
100
+ min = c.value;
101
+ if (c.value > max)
102
+ max = c.value;
103
+ }
104
+ if (min === max)
105
+ max = min + 1;
106
+ return { min, max };
107
+ }
108
+ buildOptions() {
109
+ const self = this;
110
+ const ext = this.valueExtent();
111
+ const cMin = this.colorMin ?? ext.min;
112
+ const cMax = this.colorMax ?? ext.max;
113
+ const seriesData = this.data.map(c => [c.x, c.y, c.value]);
114
+ return deepMerge({
115
+ chart: { type: 'heatmap', height: this.height },
116
+ title: { text: this.chartTitle || undefined },
117
+ subtitle: { text: this.chartSubtitle || undefined },
118
+ xAxis: { categories: this.xCategories, title: { text: undefined } },
119
+ yAxis: {
120
+ categories: this.yCategories,
121
+ title: { text: undefined },
122
+ reversed: true,
123
+ },
124
+ colorAxis: {
125
+ min: cMin,
126
+ max: cMax,
127
+ minColor: this.minColor,
128
+ maxColor: this.maxColor,
129
+ title: { text: this.colorAxisTitle || undefined },
130
+ },
131
+ legend: { align: 'right', layout: 'vertical', verticalAlign: 'top' },
132
+ tooltip: {
133
+ formatter() {
134
+ const p = this.point;
135
+ if (!p)
136
+ return false;
137
+ const x = p.x;
138
+ const y = p.y;
139
+ const xCat = self.xCategories[x] ?? String(x);
140
+ const yCat = self.yCategories[y] ?? String(y);
141
+ const val = p.value;
142
+ return `<b>${yCat}</b> · ${xCat}<br/>Value: <b>${val ?? ''}</b>`;
143
+ },
144
+ },
145
+ plotOptions: {
146
+ heatmap: {
147
+ dataLabels: { enabled: this.showDataLabels },
148
+ borderWidth: 1,
149
+ borderColor: '#e2e8f0',
150
+ },
151
+ series: {
152
+ cursor: 'pointer',
153
+ point: {
154
+ events: {
155
+ click() {
156
+ const x = this.x;
157
+ const y = this.y;
158
+ self.emit('nile-chart-click', {
159
+ point: this,
160
+ xCategory: self.xCategories[x],
161
+ yCategory: self.yCategories[y],
162
+ xIndex: x,
163
+ yIndex: y,
164
+ value: this.value,
165
+ seriesName: this.series.name,
166
+ });
167
+ },
168
+ },
169
+ },
170
+ },
171
+ },
172
+ series: [
173
+ {
174
+ type: 'heatmap',
175
+ name: this.seriesName || 'Intensity',
176
+ data: seriesData,
177
+ },
178
+ ],
179
+ credits: { enabled: false },
180
+ }, this.options);
181
+ }
182
+ async initChart() {
183
+ if (this.loading || !this.chartContainer)
184
+ return;
185
+ if (!this._hc)
186
+ this._hc = await getHighcharts();
187
+ this.chart = this._hc.chart(this.chartContainer, this.buildOptions());
188
+ this.emit('nile-chart-ready', { chart: this.chart });
189
+ }
190
+ destroyChart() {
191
+ if (this.chart) {
192
+ this.chart.destroy();
193
+ this.chart = null;
194
+ }
195
+ }
196
+ render() {
197
+ if (this.loading) {
198
+ return html `<div class="chart-loading" style="height:${this.height}">Loading...</div>`;
199
+ }
200
+ return html `<div class="chart-container"></div>`;
201
+ }
202
+ };
203
+ NileHeatmapChart.styles = styles;
204
+ __decorate([
205
+ query('.chart-container')
206
+ ], NileHeatmapChart.prototype, "chartContainer", void 0);
207
+ __decorate([
208
+ property({ type: Object })
209
+ ], NileHeatmapChart.prototype, "config", void 0);
210
+ __decorate([
211
+ property({ type: String, attribute: 'chart-title' })
212
+ ], NileHeatmapChart.prototype, "chartTitle", void 0);
213
+ __decorate([
214
+ property({ type: String, attribute: 'chart-subtitle' })
215
+ ], NileHeatmapChart.prototype, "chartSubtitle", void 0);
216
+ __decorate([
217
+ property({ type: Array })
218
+ ], NileHeatmapChart.prototype, "xCategories", void 0);
219
+ __decorate([
220
+ property({ type: Array })
221
+ ], NileHeatmapChart.prototype, "yCategories", void 0);
222
+ __decorate([
223
+ property({ type: Array })
224
+ ], NileHeatmapChart.prototype, "data", void 0);
225
+ __decorate([
226
+ property({ type: String, attribute: 'series-name' })
227
+ ], NileHeatmapChart.prototype, "seriesName", void 0);
228
+ __decorate([
229
+ property({ type: Number, attribute: 'color-min' })
230
+ ], NileHeatmapChart.prototype, "colorMin", void 0);
231
+ __decorate([
232
+ property({ type: Number, attribute: 'color-max' })
233
+ ], NileHeatmapChart.prototype, "colorMax", void 0);
234
+ __decorate([
235
+ property({ type: String, attribute: 'min-color' })
236
+ ], NileHeatmapChart.prototype, "minColor", void 0);
237
+ __decorate([
238
+ property({ type: String, attribute: 'max-color' })
239
+ ], NileHeatmapChart.prototype, "maxColor", void 0);
240
+ __decorate([
241
+ property({ type: String, attribute: 'color-axis-title' })
242
+ ], NileHeatmapChart.prototype, "colorAxisTitle", void 0);
243
+ __decorate([
244
+ property({ type: Object })
245
+ ], NileHeatmapChart.prototype, "options", void 0);
246
+ __decorate([
247
+ property({ type: Boolean, reflect: true })
248
+ ], NileHeatmapChart.prototype, "loading", void 0);
249
+ __decorate([
250
+ property({ type: String })
251
+ ], NileHeatmapChart.prototype, "height", void 0);
252
+ __decorate([
253
+ property({ type: Boolean, attribute: 'show-data-labels' })
254
+ ], NileHeatmapChart.prototype, "showDataLabels", void 0);
255
+ NileHeatmapChart = __decorate([
256
+ customElement('nile-heatmap-chart')
257
+ ], NileHeatmapChart);
258
+ export { NileHeatmapChart };
259
+ //# sourceMappingURL=nile-heatmap-chart.js.map
@@ -112,7 +112,9 @@ let NileHistogramChart = class NileHistogramChart extends NileElement {
112
112
  buildOptions() {
113
113
  const self = this;
114
114
  const bw = this.binWidth > 0 ? this.binWidth : undefined;
115
- const scatterData = this.data.map(x => [x, 0]);
115
+ // Highcharts #15: line/scatter x values must be ascending; raw samples are often unsorted.
116
+ const sorted = [...this.data].sort((a, b) => a - b);
117
+ const scatterData = sorted.map(x => [x, 0]);
116
118
  return deepMerge({
117
119
  chart: { height: this.height },
118
120
  title: { text: this.chartTitle || undefined },
@@ -0,0 +1,2 @@
1
+ export { NileLineColumnChart } from './nile-line-column-chart.js';
2
+ export type { LineColumnSeriesPart } from './nile-line-column-chart.js';
@@ -0,0 +1,2 @@
1
+ export { NileLineColumnChart } from './nile-line-column-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-line-column-chart.css.js.map
@@ -0,0 +1,42 @@
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 LineColumnSeriesPart {
6
+ name: string;
7
+ data: number[];
8
+ color?: string;
9
+ }
10
+ export declare class NileLineColumnChart 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
+ categories: string[];
20
+ columnSeries: LineColumnSeriesPart;
21
+ lineSeries: LineColumnSeriesPart;
22
+ columnAxisTitle: string;
23
+ lineAxisTitle: string;
24
+ options: Highcharts.Options;
25
+ loading: boolean;
26
+ height: string;
27
+ private applyConfig;
28
+ connectedCallback(): void;
29
+ disconnectedCallback(): void;
30
+ protected firstUpdated(): void;
31
+ protected updated(changedProperties: PropertyValues): void;
32
+ private setupResizeObserver;
33
+ private buildOptions;
34
+ private initChart;
35
+ private destroyChart;
36
+ render(): TemplateResult;
37
+ }
38
+ declare global {
39
+ interface HTMLElementTagNameMap {
40
+ 'nile-line-column-chart': NileLineColumnChart;
41
+ }
42
+ }
@@ -0,0 +1,205 @@
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 { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
7
+ import { deepMerge } from '../internal/utils.js';
8
+ import { styles } from './nile-line-column-chart.css.js';
9
+ let NileLineColumnChart = class NileLineColumnChart 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.categories = [];
19
+ this.columnSeries = { name: '', data: [] };
20
+ this.lineSeries = { name: '', data: [] };
21
+ this.columnAxisTitle = '';
22
+ this.lineAxisTitle = '';
23
+ this.options = {};
24
+ this.loading = false;
25
+ this.height = '400px';
26
+ }
27
+ applyConfig(cfg) {
28
+ applySeparatedChartConfig(this, cfg);
29
+ }
30
+ connectedCallback() {
31
+ super.connectedCallback();
32
+ if (this.config)
33
+ this.applyConfig(this.config);
34
+ }
35
+ disconnectedCallback() {
36
+ super.disconnectedCallback();
37
+ this.destroyChart();
38
+ this.resizeObserver?.disconnect();
39
+ this.resizeObserver = null;
40
+ }
41
+ firstUpdated() {
42
+ this.initChart();
43
+ this.setupResizeObserver();
44
+ }
45
+ updated(changedProperties) {
46
+ if (changedProperties.has('config') && this.config) {
47
+ this.applyConfig(this.config);
48
+ return;
49
+ }
50
+ const props = [
51
+ 'categories',
52
+ 'columnSeries',
53
+ 'lineSeries',
54
+ 'chartTitle',
55
+ 'chartSubtitle',
56
+ 'columnAxisTitle',
57
+ 'lineAxisTitle',
58
+ 'options',
59
+ 'height',
60
+ 'loading',
61
+ ];
62
+ if (!props.some(p => changedProperties.has(p)))
63
+ return;
64
+ if (this.loading) {
65
+ this.destroyChart();
66
+ return;
67
+ }
68
+ if (this.chart) {
69
+ this.chart.update(this.buildOptions(), true, true);
70
+ }
71
+ else {
72
+ this.initChart();
73
+ }
74
+ }
75
+ setupResizeObserver() {
76
+ if (!this.chartContainer)
77
+ return;
78
+ this.resizeObserver = new ResizeObserver(() => {
79
+ this.chart?.reflow();
80
+ });
81
+ this.resizeObserver.observe(this.chartContainer);
82
+ }
83
+ buildOptions() {
84
+ const self = this;
85
+ const col = this.columnSeries;
86
+ const line = this.lineSeries;
87
+ return deepMerge({
88
+ chart: { height: this.height },
89
+ title: { text: this.chartTitle || undefined },
90
+ subtitle: { text: this.chartSubtitle || undefined },
91
+ xAxis: { categories: this.categories, crosshair: true },
92
+ yAxis: [
93
+ {
94
+ title: { text: this.columnAxisTitle || undefined },
95
+ labels: { style: { color: '#64748b' } },
96
+ },
97
+ {
98
+ title: { text: this.lineAxisTitle || undefined },
99
+ opposite: true,
100
+ labels: { style: { color: '#64748b' } },
101
+ },
102
+ ],
103
+ tooltip: { shared: true },
104
+ legend: { enabled: true },
105
+ plotOptions: {
106
+ column: { borderRadius: 2 },
107
+ series: {
108
+ cursor: 'pointer',
109
+ point: {
110
+ events: {
111
+ click() {
112
+ self.emit('nile-chart-click', {
113
+ point: this,
114
+ category: this.category,
115
+ value: this.y,
116
+ seriesName: this.series.name,
117
+ });
118
+ },
119
+ },
120
+ },
121
+ },
122
+ },
123
+ series: [
124
+ {
125
+ type: 'column',
126
+ name: col.name,
127
+ data: col.data,
128
+ color: col.color,
129
+ yAxis: 0,
130
+ },
131
+ {
132
+ type: 'line',
133
+ name: line.name,
134
+ data: line.data,
135
+ color: line.color,
136
+ yAxis: 1,
137
+ marker: { enabled: true, radius: 4 },
138
+ },
139
+ ],
140
+ credits: { enabled: false },
141
+ }, this.options);
142
+ }
143
+ async initChart() {
144
+ if (this.loading || !this.chartContainer)
145
+ return;
146
+ if (!this._hc)
147
+ this._hc = await getHighcharts();
148
+ this.chart = this._hc.chart(this.chartContainer, this.buildOptions());
149
+ this.emit('nile-chart-ready', { chart: this.chart });
150
+ }
151
+ destroyChart() {
152
+ if (this.chart) {
153
+ this.chart.destroy();
154
+ this.chart = null;
155
+ }
156
+ }
157
+ render() {
158
+ if (this.loading) {
159
+ return html `<div class="chart-loading" style="height:${this.height}">Loading...</div>`;
160
+ }
161
+ return html `<div class="chart-container"></div>`;
162
+ }
163
+ };
164
+ NileLineColumnChart.styles = styles;
165
+ __decorate([
166
+ query('.chart-container')
167
+ ], NileLineColumnChart.prototype, "chartContainer", void 0);
168
+ __decorate([
169
+ property({ type: Object })
170
+ ], NileLineColumnChart.prototype, "config", void 0);
171
+ __decorate([
172
+ property({ type: String, attribute: 'chart-title' })
173
+ ], NileLineColumnChart.prototype, "chartTitle", void 0);
174
+ __decorate([
175
+ property({ type: String, attribute: 'chart-subtitle' })
176
+ ], NileLineColumnChart.prototype, "chartSubtitle", void 0);
177
+ __decorate([
178
+ property({ type: Array })
179
+ ], NileLineColumnChart.prototype, "categories", void 0);
180
+ __decorate([
181
+ property({ type: Object })
182
+ ], NileLineColumnChart.prototype, "columnSeries", void 0);
183
+ __decorate([
184
+ property({ type: Object })
185
+ ], NileLineColumnChart.prototype, "lineSeries", void 0);
186
+ __decorate([
187
+ property({ type: String, attribute: 'column-axis-title' })
188
+ ], NileLineColumnChart.prototype, "columnAxisTitle", void 0);
189
+ __decorate([
190
+ property({ type: String, attribute: 'line-axis-title' })
191
+ ], NileLineColumnChart.prototype, "lineAxisTitle", void 0);
192
+ __decorate([
193
+ property({ type: Object })
194
+ ], NileLineColumnChart.prototype, "options", void 0);
195
+ __decorate([
196
+ property({ type: Boolean, reflect: true })
197
+ ], NileLineColumnChart.prototype, "loading", void 0);
198
+ __decorate([
199
+ property({ type: String })
200
+ ], NileLineColumnChart.prototype, "height", void 0);
201
+ NileLineColumnChart = __decorate([
202
+ customElement('nile-line-column-chart')
203
+ ], NileLineColumnChart);
204
+ export { NileLineColumnChart };
205
+ //# sourceMappingURL=nile-line-column-chart.js.map
@@ -0,0 +1,2 @@
1
+ export { NileOrganizationChart } from './nile-organization-chart.js';
2
+ export type { OrgChartLink, OrgChartNode } from './nile-organization-chart.js';
@@ -0,0 +1,2 @@
1
+ export { NileOrganizationChart } from './nile-organization-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-organization-chart.css.js.map
@@ -0,0 +1,57 @@
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
+ /** Directed edge: reporting line from `from` to `to` (node ids). */
6
+ export interface OrgChartLink {
7
+ from: string;
8
+ to: string;
9
+ }
10
+ /** Node card in the org chart (`id` must match link endpoints). */
11
+ export interface OrgChartNode {
12
+ id: string;
13
+ title?: string;
14
+ name?: string;
15
+ description?: string;
16
+ image?: string;
17
+ color?: string;
18
+ /** When set, children hang under this node (Highcharts layout). */
19
+ layout?: 'hanging';
20
+ }
21
+ export declare class NileOrganizationChart extends NileElement {
22
+ static styles: CSSResultGroup;
23
+ private _hc;
24
+ private chart;
25
+ private resizeObserver;
26
+ private chartContainer;
27
+ /** Full chart configuration. Accepts separated `{ chart, aq }` input. */
28
+ config: SeparatedChartConfigInputType | null;
29
+ chartTitle: string;
30
+ chartSubtitle: string;
31
+ nodes: OrgChartNode[];
32
+ links: OrgChartLink[];
33
+ options: Highcharts.Options;
34
+ loading: boolean;
35
+ height: string;
36
+ seriesName: string;
37
+ /**
38
+ * When true (default), the chart flows top-down — typical for org charts in Highcharts.
39
+ * Set false for a horizontal layout.
40
+ */
41
+ inverted: boolean;
42
+ private applyConfig;
43
+ connectedCallback(): void;
44
+ disconnectedCallback(): void;
45
+ protected firstUpdated(): void;
46
+ protected updated(changedProperties: PropertyValues): void;
47
+ private setupResizeObserver;
48
+ private buildOptions;
49
+ private initChart;
50
+ private destroyChart;
51
+ render(): TemplateResult;
52
+ }
53
+ declare global {
54
+ interface HTMLElementTagNameMap {
55
+ 'nile-organization-chart': NileOrganizationChart;
56
+ }
57
+ }