@aquera/nile-visualization 0.2.0 → 0.3.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 (134) hide show
  1. package/dist/src/index.d.ts +31 -1
  2. package/dist/src/index.js +16 -0
  3. package/dist/src/internal/highcharts-provider.js +45 -0
  4. package/dist/src/internal/types/chart-area-config.type.d.ts +4 -0
  5. package/dist/src/internal/types/chart-area-negative-config.type.d.ts +13 -0
  6. package/dist/src/internal/types/chart-area-negative-config.type.js +2 -0
  7. package/dist/src/internal/types/chart-area-range-config.type.d.ts +12 -0
  8. package/dist/src/internal/types/chart-area-range-config.type.js +2 -0
  9. package/dist/src/internal/types/chart-area-spline-config.type.d.ts +13 -0
  10. package/dist/src/internal/types/chart-area-spline-config.type.js +2 -0
  11. package/dist/src/internal/types/chart-column-drilldown-config.type.d.ts +13 -0
  12. package/dist/src/internal/types/chart-column-drilldown-config.type.js +2 -0
  13. package/dist/src/internal/types/chart-column-pyramid-config.type.d.ts +11 -0
  14. package/dist/src/internal/types/chart-column-pyramid-config.type.js +2 -0
  15. package/dist/src/internal/types/chart-column-range-config.type.d.ts +12 -0
  16. package/dist/src/internal/types/chart-column-range-config.type.js +2 -0
  17. package/dist/src/internal/types/chart-dumbbell-lower-config.type.d.ts +5 -0
  18. package/dist/src/internal/types/chart-dumbbell-lower-config.type.js +2 -0
  19. package/dist/src/internal/types/chart-dumbbell-upper-config.type.d.ts +5 -0
  20. package/dist/src/internal/types/chart-dumbbell-upper-config.type.js +2 -0
  21. package/dist/src/internal/types/chart-euler-config.type.d.ts +10 -0
  22. package/dist/src/internal/types/chart-euler-config.type.js +2 -0
  23. package/dist/src/internal/types/chart-lollipop-config.type.d.ts +11 -0
  24. package/dist/src/internal/types/chart-lollipop-config.type.js +2 -0
  25. package/dist/src/internal/types/chart-polygon-config.type.d.ts +12 -0
  26. package/dist/src/internal/types/chart-polygon-config.type.js +2 -0
  27. package/dist/src/internal/types/chart-radial-bar-config.type.d.ts +16 -0
  28. package/dist/src/internal/types/chart-radial-bar-config.type.js +2 -0
  29. package/dist/src/internal/types/chart-variable-pie-config.type.d.ts +13 -0
  30. package/dist/src/internal/types/chart-variable-pie-config.type.js +2 -0
  31. package/dist/src/internal/types/chart-vector-config.type.d.ts +13 -0
  32. package/dist/src/internal/types/chart-vector-config.type.js +2 -0
  33. package/dist/src/internal/types/chart-xrange-config.type.d.ts +13 -0
  34. package/dist/src/internal/types/chart-xrange-config.type.js +2 -0
  35. package/dist/src/internal/types/index.d.ts +16 -1
  36. package/dist/src/internal/types/primitive-chart-config.type.d.ts +17 -1
  37. package/dist/src/nile-area-negative-chart/index.d.ts +2 -0
  38. package/dist/src/nile-area-negative-chart/index.js +2 -0
  39. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.css.d.ts +1 -0
  40. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.css.js +28 -0
  41. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.d.ts +42 -0
  42. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +178 -0
  43. package/dist/src/nile-area-range-chart/index.d.ts +2 -0
  44. package/dist/src/nile-area-range-chart/index.js +2 -0
  45. package/dist/src/nile-area-range-chart/nile-area-range-chart.css.d.ts +1 -0
  46. package/dist/src/nile-area-range-chart/nile-area-range-chart.css.js +28 -0
  47. package/dist/src/nile-area-range-chart/nile-area-range-chart.d.ts +41 -0
  48. package/dist/src/nile-area-range-chart/nile-area-range-chart.js +173 -0
  49. package/dist/src/nile-area-spline-chart/index.d.ts +2 -0
  50. package/dist/src/nile-area-spline-chart/index.js +2 -0
  51. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.css.d.ts +1 -0
  52. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.css.js +28 -0
  53. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.d.ts +41 -0
  54. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +174 -0
  55. package/dist/src/nile-chart/index.d.ts +1 -1
  56. package/dist/src/nile-column-drilldown-chart/index.d.ts +2 -0
  57. package/dist/src/nile-column-drilldown-chart/index.js +2 -0
  58. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.css.d.ts +1 -0
  59. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.css.js +28 -0
  60. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.d.ts +49 -0
  61. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +186 -0
  62. package/dist/src/nile-column-pyramid-chart/index.d.ts +2 -0
  63. package/dist/src/nile-column-pyramid-chart/index.js +2 -0
  64. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.css.d.ts +1 -0
  65. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.css.js +28 -0
  66. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.d.ts +39 -0
  67. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +155 -0
  68. package/dist/src/nile-column-range-chart/index.d.ts +2 -0
  69. package/dist/src/nile-column-range-chart/index.js +2 -0
  70. package/dist/src/nile-column-range-chart/nile-column-range-chart.css.d.ts +1 -0
  71. package/dist/src/nile-column-range-chart/nile-column-range-chart.css.js +28 -0
  72. package/dist/src/nile-column-range-chart/nile-column-range-chart.d.ts +40 -0
  73. package/dist/src/nile-column-range-chart/nile-column-range-chart.js +169 -0
  74. package/dist/src/nile-dumbbell-lower-chart/index.d.ts +1 -0
  75. package/dist/src/nile-dumbbell-lower-chart/index.js +2 -0
  76. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.css.d.ts +1 -0
  77. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.css.js +28 -0
  78. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.d.ts +40 -0
  79. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +214 -0
  80. package/dist/src/nile-dumbbell-upper-chart/index.d.ts +1 -0
  81. package/dist/src/nile-dumbbell-upper-chart/index.js +2 -0
  82. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.css.d.ts +1 -0
  83. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.css.js +28 -0
  84. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.d.ts +40 -0
  85. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +214 -0
  86. package/dist/src/nile-euler-chart/index.d.ts +2 -0
  87. package/dist/src/nile-euler-chart/index.js +2 -0
  88. package/dist/src/nile-euler-chart/nile-euler-chart.css.d.ts +1 -0
  89. package/dist/src/nile-euler-chart/nile-euler-chart.css.js +28 -0
  90. package/dist/src/nile-euler-chart/nile-euler-chart.d.ts +38 -0
  91. package/dist/src/nile-euler-chart/nile-euler-chart.js +149 -0
  92. package/dist/src/nile-inverted-area-chart/index.d.ts +2 -0
  93. package/dist/src/nile-inverted-area-chart/index.js +2 -0
  94. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.css.d.ts +1 -0
  95. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.css.js +28 -0
  96. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.d.ts +40 -0
  97. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +173 -0
  98. package/dist/src/nile-lollipop-chart/index.d.ts +2 -0
  99. package/dist/src/nile-lollipop-chart/index.js +2 -0
  100. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.css.d.ts +1 -0
  101. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.css.js +28 -0
  102. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.d.ts +39 -0
  103. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +174 -0
  104. package/dist/src/nile-polygon-chart/index.d.ts +2 -0
  105. package/dist/src/nile-polygon-chart/index.js +2 -0
  106. package/dist/src/nile-polygon-chart/nile-polygon-chart.css.d.ts +1 -0
  107. package/dist/src/nile-polygon-chart/nile-polygon-chart.css.js +28 -0
  108. package/dist/src/nile-polygon-chart/nile-polygon-chart.d.ts +41 -0
  109. package/dist/src/nile-polygon-chart/nile-polygon-chart.js +167 -0
  110. package/dist/src/nile-radial-bar-chart/index.d.ts +2 -0
  111. package/dist/src/nile-radial-bar-chart/index.js +2 -0
  112. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.css.d.ts +1 -0
  113. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.css.js +28 -0
  114. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.d.ts +42 -0
  115. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +191 -0
  116. package/dist/src/nile-variable-pie-chart/index.d.ts +2 -0
  117. package/dist/src/nile-variable-pie-chart/index.js +2 -0
  118. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.css.d.ts +1 -0
  119. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.css.js +28 -0
  120. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.d.ts +42 -0
  121. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +180 -0
  122. package/dist/src/nile-vector-chart/index.d.ts +2 -0
  123. package/dist/src/nile-vector-chart/index.js +2 -0
  124. package/dist/src/nile-vector-chart/nile-vector-chart.css.d.ts +1 -0
  125. package/dist/src/nile-vector-chart/nile-vector-chart.css.js +28 -0
  126. package/dist/src/nile-vector-chart/nile-vector-chart.d.ts +44 -0
  127. package/dist/src/nile-vector-chart/nile-vector-chart.js +181 -0
  128. package/dist/src/nile-xrange-chart/index.d.ts +2 -0
  129. package/dist/src/nile-xrange-chart/index.js +2 -0
  130. package/dist/src/nile-xrange-chart/nile-xrange-chart.css.d.ts +1 -0
  131. package/dist/src/nile-xrange-chart/nile-xrange-chart.css.js +28 -0
  132. package/dist/src/nile-xrange-chart/nile-xrange-chart.d.ts +44 -0
  133. package/dist/src/nile-xrange-chart/nile-xrange-chart.js +193 -0
  134. package/package.json +1 -1
@@ -0,0 +1,169 @@
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-column-range-chart.css.js';
9
+ let NileColumnRangeChart = class NileColumnRangeChart 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
+ }
25
+ applyConfig(cfg) {
26
+ applySeparatedChartConfig(this, cfg);
27
+ }
28
+ connectedCallback() {
29
+ super.connectedCallback();
30
+ if (this.config)
31
+ this.applyConfig(this.config);
32
+ }
33
+ disconnectedCallback() {
34
+ super.disconnectedCallback();
35
+ this.destroyChart();
36
+ this.resizeObserver?.disconnect();
37
+ this.resizeObserver = null;
38
+ }
39
+ firstUpdated() {
40
+ this.initChart();
41
+ this.setupResizeObserver();
42
+ }
43
+ updated(changedProperties) {
44
+ if (changedProperties.has('config') && this.config) {
45
+ this.applyConfig(this.config);
46
+ return;
47
+ }
48
+ const props = [
49
+ 'data',
50
+ 'categories',
51
+ 'chartTitle',
52
+ 'chartSubtitle',
53
+ 'options',
54
+ 'height',
55
+ 'yAxisTitle',
56
+ 'loading',
57
+ ];
58
+ if (!props.some(p => changedProperties.has(p)))
59
+ return;
60
+ if (this.loading) {
61
+ this.destroyChart();
62
+ return;
63
+ }
64
+ if (this.chart) {
65
+ this.chart.update(this.buildOptions(), true, true);
66
+ }
67
+ else {
68
+ this.initChart();
69
+ }
70
+ }
71
+ setupResizeObserver() {
72
+ if (!this.chartContainer)
73
+ return;
74
+ this.resizeObserver = new ResizeObserver(() => this.chart?.reflow());
75
+ this.resizeObserver.observe(this.chartContainer);
76
+ }
77
+ buildOptions() {
78
+ const self = this;
79
+ return deepMerge({
80
+ chart: { height: this.height },
81
+ title: { text: this.chartTitle || undefined },
82
+ subtitle: { text: this.chartSubtitle || undefined },
83
+ xAxis: { categories: this.categories },
84
+ yAxis: { title: { text: this.yAxisTitle || undefined } },
85
+ tooltip: { shared: true },
86
+ plotOptions: {
87
+ series: {
88
+ cursor: 'pointer',
89
+ point: {
90
+ events: {
91
+ click() {
92
+ self.emit('nile-chart-click', {
93
+ point: this,
94
+ category: this.category,
95
+ low: this.low,
96
+ high: this.high,
97
+ seriesName: this.series.name,
98
+ });
99
+ },
100
+ },
101
+ },
102
+ },
103
+ },
104
+ series: this.data.map(s => ({
105
+ type: 'columnrange',
106
+ name: s.name,
107
+ data: s.data,
108
+ color: s.color,
109
+ })),
110
+ credits: { enabled: false },
111
+ }, this.options);
112
+ }
113
+ async initChart() {
114
+ if (this.loading || !this.chartContainer)
115
+ return;
116
+ if (!this._hc)
117
+ this._hc = await getHighcharts();
118
+ this.chart = this._hc.chart(this.chartContainer, this.buildOptions());
119
+ this.emit('nile-chart-ready', { chart: this.chart });
120
+ }
121
+ destroyChart() {
122
+ if (this.chart) {
123
+ this.chart.destroy();
124
+ this.chart = null;
125
+ }
126
+ }
127
+ render() {
128
+ if (this.loading) {
129
+ return html `<div class="chart-loading" style="height:${this.height}">Loading...</div>`;
130
+ }
131
+ return html `<div class="chart-container"></div>`;
132
+ }
133
+ };
134
+ NileColumnRangeChart.styles = styles;
135
+ __decorate([
136
+ query('.chart-container')
137
+ ], NileColumnRangeChart.prototype, "chartContainer", void 0);
138
+ __decorate([
139
+ property({ type: Object })
140
+ ], NileColumnRangeChart.prototype, "config", void 0);
141
+ __decorate([
142
+ property({ type: String, attribute: 'chart-title' })
143
+ ], NileColumnRangeChart.prototype, "chartTitle", void 0);
144
+ __decorate([
145
+ property({ type: String, attribute: 'chart-subtitle' })
146
+ ], NileColumnRangeChart.prototype, "chartSubtitle", void 0);
147
+ __decorate([
148
+ property({ type: Array })
149
+ ], NileColumnRangeChart.prototype, "data", void 0);
150
+ __decorate([
151
+ property({ type: Array })
152
+ ], NileColumnRangeChart.prototype, "categories", void 0);
153
+ __decorate([
154
+ property({ type: Object })
155
+ ], NileColumnRangeChart.prototype, "options", void 0);
156
+ __decorate([
157
+ property({ type: Boolean, reflect: true })
158
+ ], NileColumnRangeChart.prototype, "loading", void 0);
159
+ __decorate([
160
+ property({ type: String })
161
+ ], NileColumnRangeChart.prototype, "height", void 0);
162
+ __decorate([
163
+ property({ type: String, attribute: 'y-axis-title' })
164
+ ], NileColumnRangeChart.prototype, "yAxisTitle", void 0);
165
+ NileColumnRangeChart = __decorate([
166
+ customElement('nile-column-range-chart')
167
+ ], NileColumnRangeChart);
168
+ export { NileColumnRangeChart };
169
+ //# sourceMappingURL=nile-column-range-chart.js.map
@@ -0,0 +1 @@
1
+ export { NileDumbbellLowerChart } from './nile-dumbbell-lower-chart.js';
@@ -0,0 +1,2 @@
1
+ export { NileDumbbellLowerChart } from './nile-dumbbell-lower-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-dumbbell-lower-chart.css.js.map
@@ -0,0 +1,40 @@
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
+ import type { DumbbellPoint } from '../nile-dumbbell-chart/nile-dumbbell-chart.js';
6
+ export declare class NileDumbbellLowerChart extends NileElement {
7
+ static styles: CSSResultGroup;
8
+ private _hc;
9
+ private chart;
10
+ private resizeObserver;
11
+ private chartContainer;
12
+ config: SeparatedChartConfigInputType | null;
13
+ chartTitle: string;
14
+ chartSubtitle: string;
15
+ data: DumbbellPoint[];
16
+ options: Highcharts.Options;
17
+ loading: boolean;
18
+ height: string;
19
+ yAxisTitle: string;
20
+ seriesName: string;
21
+ lowMarkerColor: string;
22
+ connectorColor: string;
23
+ showLegend: boolean;
24
+ horizontal: boolean;
25
+ private applyConfig;
26
+ connectedCallback(): void;
27
+ disconnectedCallback(): void;
28
+ protected firstUpdated(): void;
29
+ protected updated(changedProperties: PropertyValues): void;
30
+ private setupResizeObserver;
31
+ private buildOptions;
32
+ private initChart;
33
+ private destroyChart;
34
+ render(): TemplateResult;
35
+ }
36
+ declare global {
37
+ interface HTMLElementTagNameMap {
38
+ 'nile-dumbbell-lower-chart': NileDumbbellLowerChart;
39
+ }
40
+ }
@@ -0,0 +1,214 @@
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-dumbbell-lower-chart.css.js';
9
+ let NileDumbbellLowerChart = class NileDumbbellLowerChart 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.options = {};
20
+ this.loading = false;
21
+ this.height = '400px';
22
+ this.yAxisTitle = '';
23
+ this.seriesName = '';
24
+ this.lowMarkerColor = '#ef4444';
25
+ this.connectorColor = '#94a3b8';
26
+ this.showLegend = false;
27
+ this.horizontal = false;
28
+ }
29
+ applyConfig(cfg) {
30
+ applySeparatedChartConfig(this, cfg);
31
+ }
32
+ connectedCallback() {
33
+ super.connectedCallback();
34
+ if (this.config)
35
+ this.applyConfig(this.config);
36
+ }
37
+ disconnectedCallback() {
38
+ super.disconnectedCallback();
39
+ this.destroyChart();
40
+ this.resizeObserver?.disconnect();
41
+ this.resizeObserver = null;
42
+ }
43
+ firstUpdated() {
44
+ this.initChart();
45
+ this.setupResizeObserver();
46
+ }
47
+ updated(changedProperties) {
48
+ if (changedProperties.has('config') && this.config) {
49
+ this.applyConfig(this.config);
50
+ return;
51
+ }
52
+ const props = [
53
+ 'data',
54
+ 'chartTitle',
55
+ 'chartSubtitle',
56
+ 'options',
57
+ 'height',
58
+ 'yAxisTitle',
59
+ 'seriesName',
60
+ 'lowMarkerColor',
61
+ 'connectorColor',
62
+ 'showLegend',
63
+ 'horizontal',
64
+ 'loading',
65
+ ];
66
+ if (!props.some(p => changedProperties.has(p)))
67
+ return;
68
+ if (this.loading) {
69
+ this.destroyChart();
70
+ return;
71
+ }
72
+ if (this.chart) {
73
+ this.chart.update(this.buildOptions(), true, true);
74
+ }
75
+ else {
76
+ this.initChart();
77
+ }
78
+ }
79
+ setupResizeObserver() {
80
+ if (!this.chartContainer)
81
+ return;
82
+ this.resizeObserver = new ResizeObserver(() => this.chart?.reflow());
83
+ this.resizeObserver.observe(this.chartContainer);
84
+ }
85
+ buildOptions() {
86
+ const self = this;
87
+ return deepMerge({
88
+ chart: {
89
+ type: 'dumbbell',
90
+ height: this.height,
91
+ inverted: this.horizontal,
92
+ },
93
+ title: { text: this.chartTitle || undefined },
94
+ subtitle: { text: this.chartSubtitle || undefined },
95
+ legend: { enabled: this.showLegend },
96
+ xAxis: { type: 'category' },
97
+ yAxis: { title: { text: this.yAxisTitle || undefined } },
98
+ tooltip: {
99
+ shared: true,
100
+ pointFormat: '<b>{point.name}</b><br/>Low: <b>{point.low}</b><br/>High: <b>{point.high}</b>',
101
+ },
102
+ plotOptions: {
103
+ dumbbell: {
104
+ lowColor: this.lowMarkerColor,
105
+ connectorColor: this.connectorColor,
106
+ connectorWidth: 2,
107
+ lowMarker: { radius: 10, lineWidth: 2, lineColor: '#ffffff' },
108
+ marker: { radius: 4, lineWidth: 2, lineColor: '#ffffff' },
109
+ cursor: 'pointer',
110
+ point: {
111
+ events: {
112
+ click() {
113
+ self.emit('nile-chart-click', {
114
+ point: this,
115
+ category: this.name,
116
+ low: this.low,
117
+ high: this.high,
118
+ seriesName: this.series.name,
119
+ });
120
+ },
121
+ },
122
+ },
123
+ },
124
+ },
125
+ series: [
126
+ {
127
+ type: 'dumbbell',
128
+ name: this.seriesName || 'Range',
129
+ data: this.data.map(d => {
130
+ const row = {
131
+ name: d.name,
132
+ low: d.low,
133
+ high: d.high,
134
+ };
135
+ if (d.color)
136
+ row.color = d.color;
137
+ if (d.lowColor)
138
+ row.lowColor = d.lowColor;
139
+ return row;
140
+ }),
141
+ },
142
+ ],
143
+ credits: { enabled: false },
144
+ }, this.options);
145
+ }
146
+ async initChart() {
147
+ if (this.loading || !this.chartContainer)
148
+ return;
149
+ if (!this._hc)
150
+ this._hc = await getHighcharts();
151
+ this.chart = this._hc.chart(this.chartContainer, this.buildOptions());
152
+ this.emit('nile-chart-ready', { chart: this.chart });
153
+ }
154
+ destroyChart() {
155
+ if (this.chart) {
156
+ this.chart.destroy();
157
+ this.chart = null;
158
+ }
159
+ }
160
+ render() {
161
+ if (this.loading) {
162
+ return html `<div class="chart-loading" style="height:${this.height}">Loading...</div>`;
163
+ }
164
+ return html `<div class="chart-container"></div>`;
165
+ }
166
+ };
167
+ NileDumbbellLowerChart.styles = styles;
168
+ __decorate([
169
+ query('.chart-container')
170
+ ], NileDumbbellLowerChart.prototype, "chartContainer", void 0);
171
+ __decorate([
172
+ property({ type: Object })
173
+ ], NileDumbbellLowerChart.prototype, "config", void 0);
174
+ __decorate([
175
+ property({ type: String, attribute: 'chart-title' })
176
+ ], NileDumbbellLowerChart.prototype, "chartTitle", void 0);
177
+ __decorate([
178
+ property({ type: String, attribute: 'chart-subtitle' })
179
+ ], NileDumbbellLowerChart.prototype, "chartSubtitle", void 0);
180
+ __decorate([
181
+ property({ type: Array })
182
+ ], NileDumbbellLowerChart.prototype, "data", void 0);
183
+ __decorate([
184
+ property({ type: Object })
185
+ ], NileDumbbellLowerChart.prototype, "options", void 0);
186
+ __decorate([
187
+ property({ type: Boolean, reflect: true })
188
+ ], NileDumbbellLowerChart.prototype, "loading", void 0);
189
+ __decorate([
190
+ property({ type: String })
191
+ ], NileDumbbellLowerChart.prototype, "height", void 0);
192
+ __decorate([
193
+ property({ type: String, attribute: 'y-axis-title' })
194
+ ], NileDumbbellLowerChart.prototype, "yAxisTitle", void 0);
195
+ __decorate([
196
+ property({ type: String, attribute: 'series-name' })
197
+ ], NileDumbbellLowerChart.prototype, "seriesName", void 0);
198
+ __decorate([
199
+ property({ type: String, attribute: 'low-marker-color' })
200
+ ], NileDumbbellLowerChart.prototype, "lowMarkerColor", void 0);
201
+ __decorate([
202
+ property({ type: String, attribute: 'connector-color' })
203
+ ], NileDumbbellLowerChart.prototype, "connectorColor", void 0);
204
+ __decorate([
205
+ property({ type: Boolean, attribute: 'show-legend' })
206
+ ], NileDumbbellLowerChart.prototype, "showLegend", void 0);
207
+ __decorate([
208
+ property({ type: Boolean, reflect: true, attribute: 'horizontal' })
209
+ ], NileDumbbellLowerChart.prototype, "horizontal", void 0);
210
+ NileDumbbellLowerChart = __decorate([
211
+ customElement('nile-dumbbell-lower-chart')
212
+ ], NileDumbbellLowerChart);
213
+ export { NileDumbbellLowerChart };
214
+ //# sourceMappingURL=nile-dumbbell-lower-chart.js.map
@@ -0,0 +1 @@
1
+ export { NileDumbbellUpperChart } from './nile-dumbbell-upper-chart.js';
@@ -0,0 +1,2 @@
1
+ export { NileDumbbellUpperChart } from './nile-dumbbell-upper-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-dumbbell-upper-chart.css.js.map
@@ -0,0 +1,40 @@
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
+ import type { DumbbellPoint } from '../nile-dumbbell-chart/nile-dumbbell-chart.js';
6
+ export declare class NileDumbbellUpperChart extends NileElement {
7
+ static styles: CSSResultGroup;
8
+ private _hc;
9
+ private chart;
10
+ private resizeObserver;
11
+ private chartContainer;
12
+ config: SeparatedChartConfigInputType | null;
13
+ chartTitle: string;
14
+ chartSubtitle: string;
15
+ data: DumbbellPoint[];
16
+ options: Highcharts.Options;
17
+ loading: boolean;
18
+ height: string;
19
+ yAxisTitle: string;
20
+ seriesName: string;
21
+ lowMarkerColor: string;
22
+ connectorColor: string;
23
+ showLegend: boolean;
24
+ horizontal: boolean;
25
+ private applyConfig;
26
+ connectedCallback(): void;
27
+ disconnectedCallback(): void;
28
+ protected firstUpdated(): void;
29
+ protected updated(changedProperties: PropertyValues): void;
30
+ private setupResizeObserver;
31
+ private buildOptions;
32
+ private initChart;
33
+ private destroyChart;
34
+ render(): TemplateResult;
35
+ }
36
+ declare global {
37
+ interface HTMLElementTagNameMap {
38
+ 'nile-dumbbell-upper-chart': NileDumbbellUpperChart;
39
+ }
40
+ }