@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
@@ -18,6 +18,8 @@ let NileDonutChart = class NileDonutChart extends NileElement {
18
18
  this.data = [];
19
19
  this.seriesName = '';
20
20
  this.innerSize = '50%';
21
+ /** Renders a 180° arc (semi-circle) suitable for KPI-style gauges. */
22
+ this.semiCircle = false;
21
23
  this.options = {};
22
24
  this.loading = false;
23
25
  this.height = '400px';
@@ -35,6 +37,8 @@ let NileDonutChart = class NileDonutChart extends NileElement {
35
37
  this.seriesName = donut.seriesName;
36
38
  if (donut.innerSize)
37
39
  this.innerSize = donut.innerSize;
40
+ if (donut.semiCircle !== undefined)
41
+ this.semiCircle = donut.semiCircle;
38
42
  if (donut.height)
39
43
  this.height = donut.height;
40
44
  if (donut.loading !== undefined)
@@ -70,7 +74,7 @@ let NileDonutChart = class NileDonutChart extends NileElement {
70
74
  this.applyConfig(this.config);
71
75
  return;
72
76
  }
73
- const props = ['data', 'chartTitle', 'chartSubtitle', 'options', 'height', 'seriesName', 'innerSize', 'loading', 'showDataLabels', 'showLegend'];
77
+ const props = ['data', 'chartTitle', 'chartSubtitle', 'options', 'height', 'seriesName', 'innerSize', 'semiCircle', 'loading', 'showDataLabels', 'showLegend'];
74
78
  if (!props.some(p => changedProperties.has(p)))
75
79
  return;
76
80
  if (this.loading) {
@@ -101,6 +105,14 @@ let NileDonutChart = class NileDonutChart extends NileElement {
101
105
  plotOptions: {
102
106
  pie: {
103
107
  innerSize: this.innerSize,
108
+ ...(this.semiCircle
109
+ ? {
110
+ startAngle: -90,
111
+ endAngle: 90,
112
+ center: ['50%', '80%'],
113
+ size: '120%',
114
+ }
115
+ : {}),
104
116
  allowPointSelect: true,
105
117
  cursor: 'pointer',
106
118
  dataLabels: { enabled: this.showDataLabels, format: '<b>{point.name}</b>: {point.percentage:.1f} %' },
@@ -152,6 +164,9 @@ __decorate([
152
164
  __decorate([
153
165
  property({ type: String, attribute: 'inner-size' })
154
166
  ], NileDonutChart.prototype, "innerSize", void 0);
167
+ __decorate([
168
+ property({ type: Boolean, attribute: 'semi-circle' })
169
+ ], NileDonutChart.prototype, "semiCircle", void 0);
155
170
  __decorate([
156
171
  property({ type: Object })
157
172
  ], NileDonutChart.prototype, "options", void 0);
@@ -0,0 +1 @@
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
+ }
@@ -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-upper-chart.css.js';
9
+ let NileDumbbellUpperChart = class NileDumbbellUpperChart 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: 4, lineWidth: 2, lineColor: '#ffffff' },
108
+ marker: { radius: 10, 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
+ NileDumbbellUpperChart.styles = styles;
168
+ __decorate([
169
+ query('.chart-container')
170
+ ], NileDumbbellUpperChart.prototype, "chartContainer", void 0);
171
+ __decorate([
172
+ property({ type: Object })
173
+ ], NileDumbbellUpperChart.prototype, "config", void 0);
174
+ __decorate([
175
+ property({ type: String, attribute: 'chart-title' })
176
+ ], NileDumbbellUpperChart.prototype, "chartTitle", void 0);
177
+ __decorate([
178
+ property({ type: String, attribute: 'chart-subtitle' })
179
+ ], NileDumbbellUpperChart.prototype, "chartSubtitle", void 0);
180
+ __decorate([
181
+ property({ type: Array })
182
+ ], NileDumbbellUpperChart.prototype, "data", void 0);
183
+ __decorate([
184
+ property({ type: Object })
185
+ ], NileDumbbellUpperChart.prototype, "options", void 0);
186
+ __decorate([
187
+ property({ type: Boolean, reflect: true })
188
+ ], NileDumbbellUpperChart.prototype, "loading", void 0);
189
+ __decorate([
190
+ property({ type: String })
191
+ ], NileDumbbellUpperChart.prototype, "height", void 0);
192
+ __decorate([
193
+ property({ type: String, attribute: 'y-axis-title' })
194
+ ], NileDumbbellUpperChart.prototype, "yAxisTitle", void 0);
195
+ __decorate([
196
+ property({ type: String, attribute: 'series-name' })
197
+ ], NileDumbbellUpperChart.prototype, "seriesName", void 0);
198
+ __decorate([
199
+ property({ type: String, attribute: 'low-marker-color' })
200
+ ], NileDumbbellUpperChart.prototype, "lowMarkerColor", void 0);
201
+ __decorate([
202
+ property({ type: String, attribute: 'connector-color' })
203
+ ], NileDumbbellUpperChart.prototype, "connectorColor", void 0);
204
+ __decorate([
205
+ property({ type: Boolean, attribute: 'show-legend' })
206
+ ], NileDumbbellUpperChart.prototype, "showLegend", void 0);
207
+ __decorate([
208
+ property({ type: Boolean, reflect: true, attribute: 'horizontal' })
209
+ ], NileDumbbellUpperChart.prototype, "horizontal", void 0);
210
+ NileDumbbellUpperChart = __decorate([
211
+ customElement('nile-dumbbell-upper-chart')
212
+ ], NileDumbbellUpperChart);
213
+ export { NileDumbbellUpperChart };
214
+ //# sourceMappingURL=nile-dumbbell-upper-chart.js.map
@@ -0,0 +1,2 @@
1
+ export { NileEulerChart } from './nile-euler-chart.js';
2
+ export type { EulerVennDataPoint } from './nile-euler-chart.js';
@@ -0,0 +1,2 @@
1
+ export { NileEulerChart } from './nile-euler-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-euler-chart.css.js.map