@aquera/nile-visualization 2.9.27 → 2.9.29
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.
- package/README.md +8 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +4 -0
- package/dist/src/internal/chart-events.d.ts +92 -0
- package/dist/src/internal/chart-events.js +291 -0
- package/dist/src/internal/chart-runtime.d.ts +41 -0
- package/dist/src/internal/chart-runtime.js +30 -0
- package/dist/src/internal/dashboard-adapters.d.ts +4 -0
- package/dist/src/internal/dashboard-adapters.js +9 -3
- package/dist/src/internal/highcharts-provider.js +3 -0
- package/dist/src/internal/nile-chart-base.d.ts +43 -0
- package/dist/src/internal/nile-chart-base.js +67 -0
- package/dist/src/internal/resolve-widget-kind.d.ts +10 -0
- package/dist/src/internal/resolve-widget-kind.js +16 -0
- package/dist/src/internal/responsive-defaults.d.ts +32 -0
- package/dist/src/internal/responsive-defaults.js +255 -0
- package/dist/src/internal/types/highcharts-passthrough.type.d.ts +80 -0
- package/dist/src/internal/types/highcharts-passthrough.type.js +24 -0
- package/dist/src/internal/types/index.d.ts +2 -0
- package/dist/src/internal/types/index.js +1 -1
- package/dist/src/internal/types/widget-config.type.d.ts +14 -3
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.d.ts +2 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +8 -1
- package/dist/src/nile-area-chart/nile-area-chart.d.ts +1 -0
- package/dist/src/nile-area-chart/nile-area-chart.js +7 -1
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.d.ts +1 -0
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +7 -1
- package/dist/src/nile-area-range-chart/nile-area-range-chart.d.ts +1 -0
- package/dist/src/nile-area-range-chart/nile-area-range-chart.js +7 -1
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.d.ts +1 -0
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +7 -1
- package/dist/src/nile-bar-chart/nile-bar-chart.d.ts +2 -0
- package/dist/src/nile-bar-chart/nile-bar-chart.js +8 -1
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.d.ts +1 -0
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +7 -1
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.d.ts +1 -0
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.js +7 -1
- package/dist/src/nile-bubble-chart/nile-bubble-chart.d.ts +1 -0
- package/dist/src/nile-bubble-chart/nile-bubble-chart.js +7 -1
- package/dist/src/nile-chart/nile-chart-config.d.ts +2 -2
- package/dist/src/nile-chart/nile-chart.css.js +7 -1
- package/dist/src/nile-chart/nile-chart.d.ts +59 -0
- package/dist/src/nile-chart/nile-chart.js +176 -3
- package/dist/src/nile-cluster-chart/nile-cluster-chart.d.ts +1 -0
- package/dist/src/nile-cluster-chart/nile-cluster-chart.js +7 -1
- package/dist/src/nile-column-chart/nile-column-chart.d.ts +1 -0
- package/dist/src/nile-column-chart/nile-column-chart.js +7 -1
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.d.ts +1 -0
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +8 -1
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.d.ts +1 -0
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +7 -1
- package/dist/src/nile-column-range-chart/nile-column-range-chart.d.ts +1 -0
- package/dist/src/nile-column-range-chart/nile-column-range-chart.js +7 -1
- package/dist/src/nile-dashboard-builder/gridstack-css.d.ts +1 -0
- package/dist/src/nile-dashboard-builder/gridstack-css.js +6 -0
- package/dist/src/nile-dashboard-builder/index.d.ts +1 -0
- package/dist/src/nile-dashboard-builder/index.js +2 -0
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.css.d.ts +1 -0
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.css.js +96 -0
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.d.ts +177 -0
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.js +499 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +1 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.js +7 -1
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.d.ts +1 -0
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.js +7 -1
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.d.ts +1 -0
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +7 -1
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.d.ts +1 -0
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +7 -1
- package/dist/src/nile-euler-chart/nile-euler-chart.d.ts +1 -0
- package/dist/src/nile-euler-chart/nile-euler-chart.js +7 -1
- package/dist/src/nile-fan-chart/nile-fan-chart.d.ts +1 -0
- package/dist/src/nile-fan-chart/nile-fan-chart.js +7 -1
- package/dist/src/nile-flame-chart/nile-flame-chart.d.ts +1 -0
- package/dist/src/nile-flame-chart/nile-flame-chart.js +7 -1
- package/dist/src/nile-funnel-chart/nile-funnel-chart.d.ts +1 -0
- package/dist/src/nile-funnel-chart/nile-funnel-chart.js +7 -1
- package/dist/src/nile-gauge-chart/nile-gauge-chart.d.ts +20 -0
- package/dist/src/nile-gauge-chart/nile-gauge-chart.js +80 -4
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +1 -0
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +7 -1
- package/dist/src/nile-histogram-chart/nile-histogram-chart.d.ts +1 -0
- package/dist/src/nile-histogram-chart/nile-histogram-chart.js +7 -1
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.d.ts +1 -0
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +7 -1
- package/dist/src/nile-line-chart/nile-line-chart.d.ts +1 -0
- package/dist/src/nile-line-chart/nile-line-chart.js +7 -1
- package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +1 -0
- package/dist/src/nile-line-column-chart/nile-line-column-chart.js +7 -1
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.d.ts +1 -0
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +7 -1
- package/dist/src/nile-map-chart/nile-map-chart.d.ts +23 -3
- package/dist/src/nile-map-chart/nile-map-chart.js +52 -12
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.css.js +13 -1
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.d.ts +1 -0
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.js +48 -4
- package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +1 -0
- package/dist/src/nile-organization-chart/nile-organization-chart.js +7 -1
- package/dist/src/nile-pie-chart/nile-pie-chart.d.ts +2 -0
- package/dist/src/nile-pie-chart/nile-pie-chart.js +8 -1
- package/dist/src/nile-polygon-chart/nile-polygon-chart.d.ts +1 -0
- package/dist/src/nile-polygon-chart/nile-polygon-chart.js +7 -1
- package/dist/src/nile-radar-chart/nile-radar-chart.d.ts +1 -0
- package/dist/src/nile-radar-chart/nile-radar-chart.js +7 -1
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.d.ts +1 -0
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +7 -1
- package/dist/src/nile-scatter-chart/nile-scatter-chart.d.ts +1 -0
- package/dist/src/nile-scatter-chart/nile-scatter-chart.js +7 -1
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.d.ts +1 -0
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.js +7 -1
- package/dist/src/nile-spline-chart/nile-spline-chart.d.ts +1 -0
- package/dist/src/nile-spline-chart/nile-spline-chart.js +7 -1
- package/dist/src/nile-stacked-chart/nile-stacked-chart.d.ts +1 -0
- package/dist/src/nile-stacked-chart/nile-stacked-chart.js +7 -1
- package/dist/src/nile-timeline-chart/nile-timeline-chart.d.ts +1 -0
- package/dist/src/nile-timeline-chart/nile-timeline-chart.js +7 -1
- package/dist/src/nile-trendline-chart/nile-trendline-chart.d.ts +2 -0
- package/dist/src/nile-trendline-chart/nile-trendline-chart.js +8 -1
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.d.ts +1 -0
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +7 -1
- package/dist/src/nile-vector-chart/nile-vector-chart.d.ts +1 -0
- package/dist/src/nile-vector-chart/nile-vector-chart.js +7 -1
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.d.ts +1 -0
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +7 -1
- package/dist/src/nile-widget-viewer/nile-widget-viewer.js +6 -6
- package/dist/src/nile-xrange-chart/nile-xrange-chart.d.ts +1 -0
- package/dist/src/nile-xrange-chart/nile-xrange-chart.js +7 -1
- package/package.json +7 -6
|
@@ -4,6 +4,7 @@ import { html } from 'lit';
|
|
|
4
4
|
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { deepMerge } from '../internal/utils.js';
|
|
7
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
7
8
|
import { styles } from './nile-donut-chart.css.js';
|
|
8
9
|
let NileDonutChart = class NileDonutChart extends NileElement {
|
|
9
10
|
constructor() {
|
|
@@ -21,6 +22,7 @@ let NileDonutChart = class NileDonutChart extends NileElement {
|
|
|
21
22
|
/** Renders a 180° arc (semi-circle) suitable for KPI-style gauges. */
|
|
22
23
|
this.semiCircle = false;
|
|
23
24
|
this.options = {};
|
|
25
|
+
this.noResponsive = false;
|
|
24
26
|
this.loading = false;
|
|
25
27
|
this.height = '400px';
|
|
26
28
|
this.showDataLabels = true;
|
|
@@ -162,7 +164,7 @@ let NileDonutChart = class NileDonutChart extends NileElement {
|
|
|
162
164
|
}
|
|
163
165
|
buildOptions() {
|
|
164
166
|
const self = this;
|
|
165
|
-
|
|
167
|
+
const merged = deepMerge({
|
|
166
168
|
chart: { type: 'pie', ...(this.height ? { height: this.height } : {}) },
|
|
167
169
|
title: { text: this.chartTitle || undefined },
|
|
168
170
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
@@ -190,6 +192,7 @@ let NileDonutChart = class NileDonutChart extends NileElement {
|
|
|
190
192
|
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
191
193
|
credits: { enabled: false },
|
|
192
194
|
}, this.options);
|
|
195
|
+
return withResponsiveDefaults(merged, 'donut', this.noResponsive);
|
|
193
196
|
}
|
|
194
197
|
async initChart() {
|
|
195
198
|
if (this.loading || !this.chartContainer)
|
|
@@ -237,6 +240,9 @@ __decorate([
|
|
|
237
240
|
__decorate([
|
|
238
241
|
property({ type: Object })
|
|
239
242
|
], NileDonutChart.prototype, "options", void 0);
|
|
243
|
+
__decorate([
|
|
244
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
245
|
+
], NileDonutChart.prototype, "noResponsive", void 0);
|
|
240
246
|
__decorate([
|
|
241
247
|
property({ type: Boolean, reflect: true })
|
|
242
248
|
], NileDonutChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-dumbbell-chart.css.js';
|
|
9
10
|
let NileDumbbellChart = class NileDumbbellChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -18,6 +19,7 @@ let NileDumbbellChart = class NileDumbbellChart extends NileElement {
|
|
|
18
19
|
this.chartSubtitle = '';
|
|
19
20
|
this.data = [];
|
|
20
21
|
this.options = {};
|
|
22
|
+
this.noResponsive = false;
|
|
21
23
|
this.loading = false;
|
|
22
24
|
this.height = '400px';
|
|
23
25
|
this.yAxisTitle = '';
|
|
@@ -129,7 +131,7 @@ let NileDumbbellChart = class NileDumbbellChart extends NileElement {
|
|
|
129
131
|
}
|
|
130
132
|
buildOptions() {
|
|
131
133
|
const self = this;
|
|
132
|
-
|
|
134
|
+
const merged = deepMerge({
|
|
133
135
|
chart: {
|
|
134
136
|
type: 'dumbbell',
|
|
135
137
|
...(this.height ? { height: this.height } : {}),
|
|
@@ -186,6 +188,7 @@ let NileDumbbellChart = class NileDumbbellChart extends NileElement {
|
|
|
186
188
|
],
|
|
187
189
|
credits: { enabled: false },
|
|
188
190
|
}, this.options);
|
|
191
|
+
return withResponsiveDefaults(merged, 'dumbbell', this.noResponsive);
|
|
189
192
|
}
|
|
190
193
|
async initChart() {
|
|
191
194
|
if (this.loading || !this.chartContainer)
|
|
@@ -227,6 +230,9 @@ __decorate([
|
|
|
227
230
|
__decorate([
|
|
228
231
|
property({ type: Object })
|
|
229
232
|
], NileDumbbellChart.prototype, "options", void 0);
|
|
233
|
+
__decorate([
|
|
234
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
235
|
+
], NileDumbbellChart.prototype, "noResponsive", void 0);
|
|
230
236
|
__decorate([
|
|
231
237
|
property({ type: Boolean, reflect: true })
|
|
232
238
|
], NileDumbbellChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-dumbbell-lower-chart.css.js';
|
|
9
10
|
let NileDumbbellLowerChart = class NileDumbbellLowerChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -17,6 +18,7 @@ let NileDumbbellLowerChart = class NileDumbbellLowerChart extends NileElement {
|
|
|
17
18
|
this.chartSubtitle = '';
|
|
18
19
|
this.data = [];
|
|
19
20
|
this.options = {};
|
|
21
|
+
this.noResponsive = false;
|
|
20
22
|
this.loading = false;
|
|
21
23
|
this.height = '400px';
|
|
22
24
|
this.yAxisTitle = '';
|
|
@@ -125,7 +127,7 @@ let NileDumbbellLowerChart = class NileDumbbellLowerChart extends NileElement {
|
|
|
125
127
|
}
|
|
126
128
|
buildOptions() {
|
|
127
129
|
const self = this;
|
|
128
|
-
|
|
130
|
+
const merged = deepMerge({
|
|
129
131
|
chart: {
|
|
130
132
|
type: 'dumbbell',
|
|
131
133
|
...(this.height ? { height: this.height } : {}),
|
|
@@ -183,6 +185,7 @@ let NileDumbbellLowerChart = class NileDumbbellLowerChart extends NileElement {
|
|
|
183
185
|
],
|
|
184
186
|
credits: { enabled: false },
|
|
185
187
|
}, this.options);
|
|
188
|
+
return withResponsiveDefaults(merged, 'dumbbellLower', this.noResponsive);
|
|
186
189
|
}
|
|
187
190
|
async initChart() {
|
|
188
191
|
if (this.loading || !this.chartContainer)
|
|
@@ -224,6 +227,9 @@ __decorate([
|
|
|
224
227
|
__decorate([
|
|
225
228
|
property({ type: Object })
|
|
226
229
|
], NileDumbbellLowerChart.prototype, "options", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
232
|
+
], NileDumbbellLowerChart.prototype, "noResponsive", void 0);
|
|
227
233
|
__decorate([
|
|
228
234
|
property({ type: Boolean, reflect: true })
|
|
229
235
|
], NileDumbbellLowerChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-dumbbell-upper-chart.css.js';
|
|
9
10
|
let NileDumbbellUpperChart = class NileDumbbellUpperChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -17,6 +18,7 @@ let NileDumbbellUpperChart = class NileDumbbellUpperChart extends NileElement {
|
|
|
17
18
|
this.chartSubtitle = '';
|
|
18
19
|
this.data = [];
|
|
19
20
|
this.options = {};
|
|
21
|
+
this.noResponsive = false;
|
|
20
22
|
this.loading = false;
|
|
21
23
|
this.height = '400px';
|
|
22
24
|
this.yAxisTitle = '';
|
|
@@ -125,7 +127,7 @@ let NileDumbbellUpperChart = class NileDumbbellUpperChart extends NileElement {
|
|
|
125
127
|
}
|
|
126
128
|
buildOptions() {
|
|
127
129
|
const self = this;
|
|
128
|
-
|
|
130
|
+
const merged = deepMerge({
|
|
129
131
|
chart: {
|
|
130
132
|
type: 'dumbbell',
|
|
131
133
|
...(this.height ? { height: this.height } : {}),
|
|
@@ -183,6 +185,7 @@ let NileDumbbellUpperChart = class NileDumbbellUpperChart extends NileElement {
|
|
|
183
185
|
],
|
|
184
186
|
credits: { enabled: false },
|
|
185
187
|
}, this.options);
|
|
188
|
+
return withResponsiveDefaults(merged, 'dumbbellUpper', this.noResponsive);
|
|
186
189
|
}
|
|
187
190
|
async initChart() {
|
|
188
191
|
if (this.loading || !this.chartContainer)
|
|
@@ -224,6 +227,9 @@ __decorate([
|
|
|
224
227
|
__decorate([
|
|
225
228
|
property({ type: Object })
|
|
226
229
|
], NileDumbbellUpperChart.prototype, "options", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
232
|
+
], NileDumbbellUpperChart.prototype, "noResponsive", void 0);
|
|
227
233
|
__decorate([
|
|
228
234
|
property({ type: Boolean, reflect: true })
|
|
229
235
|
], NileDumbbellUpperChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import NileElement from '../internal/nile-element.js';
|
|
|
5
5
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
6
6
|
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-euler-chart.css.js';
|
|
9
10
|
let NileEulerChart = class NileEulerChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -17,6 +18,7 @@ let NileEulerChart = class NileEulerChart extends NileElement {
|
|
|
17
18
|
this.chartSubtitle = '';
|
|
18
19
|
this.data = [];
|
|
19
20
|
this.options = {};
|
|
21
|
+
this.noResponsive = false;
|
|
20
22
|
this.loading = false;
|
|
21
23
|
this.height = '400px';
|
|
22
24
|
// ── Container styling ──
|
|
@@ -109,7 +111,7 @@ let NileEulerChart = class NileEulerChart extends NileElement {
|
|
|
109
111
|
}
|
|
110
112
|
buildOptions() {
|
|
111
113
|
const self = this;
|
|
112
|
-
|
|
114
|
+
const merged = deepMerge({
|
|
113
115
|
chart: { ...(this.height ? { height: this.height } : {}) },
|
|
114
116
|
title: { text: this.chartTitle || undefined },
|
|
115
117
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
@@ -140,6 +142,7 @@ let NileEulerChart = class NileEulerChart extends NileElement {
|
|
|
140
142
|
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
141
143
|
credits: { enabled: false },
|
|
142
144
|
}, this.options);
|
|
145
|
+
return withResponsiveDefaults(merged, 'euler', this.noResponsive);
|
|
143
146
|
}
|
|
144
147
|
async initChart() {
|
|
145
148
|
if (this.loading || !this.chartContainer)
|
|
@@ -181,6 +184,9 @@ __decorate([
|
|
|
181
184
|
__decorate([
|
|
182
185
|
property({ type: Object })
|
|
183
186
|
], NileEulerChart.prototype, "options", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
189
|
+
], NileEulerChart.prototype, "noResponsive", void 0);
|
|
184
190
|
__decorate([
|
|
185
191
|
property({ type: Boolean, reflect: true })
|
|
186
192
|
], NileEulerChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-fan-chart.css.js';
|
|
9
10
|
const DEFAULT_BAND_COLORS = ['#93c5fd', '#60a5fa', '#3b82f6'];
|
|
10
11
|
let NileFanChart = class NileFanChart extends NileElement {
|
|
@@ -20,6 +21,7 @@ let NileFanChart = class NileFanChart extends NileElement {
|
|
|
20
21
|
this.lineData = [];
|
|
21
22
|
this.bands = [];
|
|
22
23
|
this.options = {};
|
|
24
|
+
this.noResponsive = false;
|
|
23
25
|
this.loading = false;
|
|
24
26
|
this.height = '400px';
|
|
25
27
|
this.yAxisTitle = '';
|
|
@@ -174,7 +176,7 @@ let NileFanChart = class NileFanChart extends NileElement {
|
|
|
174
176
|
zIndex: i,
|
|
175
177
|
states: { inactive: { enabled: false } },
|
|
176
178
|
}));
|
|
177
|
-
|
|
179
|
+
const merged = deepMerge({
|
|
178
180
|
chart: {
|
|
179
181
|
...(this.height ? { height: this.height } : {}),
|
|
180
182
|
zoomType: 'x',
|
|
@@ -223,6 +225,7 @@ let NileFanChart = class NileFanChart extends NileElement {
|
|
|
223
225
|
],
|
|
224
226
|
credits: { enabled: false },
|
|
225
227
|
}, this.options);
|
|
228
|
+
return withResponsiveDefaults(merged, 'fan', this.noResponsive);
|
|
226
229
|
}
|
|
227
230
|
async initChart() {
|
|
228
231
|
if (this.loading || !this.chartContainer)
|
|
@@ -267,6 +270,9 @@ __decorate([
|
|
|
267
270
|
__decorate([
|
|
268
271
|
property({ type: Object })
|
|
269
272
|
], NileFanChart.prototype, "options", void 0);
|
|
273
|
+
__decorate([
|
|
274
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
275
|
+
], NileFanChart.prototype, "noResponsive", void 0);
|
|
270
276
|
__decorate([
|
|
271
277
|
property({ type: Boolean, reflect: true })
|
|
272
278
|
], NileFanChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import NileElement from '../internal/nile-element.js';
|
|
|
5
5
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
6
6
|
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-flame-chart.css.js';
|
|
9
10
|
function registerFlameSeriesTypeIfNeeded(H) {
|
|
10
11
|
const types = H.seriesTypes;
|
|
@@ -44,6 +45,7 @@ let NileFlameChart = class NileFlameChart extends NileElement {
|
|
|
44
45
|
this.sunburstData = [];
|
|
45
46
|
this.layout = 'flame';
|
|
46
47
|
this.options = {};
|
|
48
|
+
this.noResponsive = false;
|
|
47
49
|
this.loading = false;
|
|
48
50
|
this.height = '480px';
|
|
49
51
|
// ── Container styling ──
|
|
@@ -190,7 +192,7 @@ let NileFlameChart = class NileFlameChart extends NileElement {
|
|
|
190
192
|
};
|
|
191
193
|
const titleText = this.chartTitle ||
|
|
192
194
|
(isSunburst ? 'Sunburst' : this.layout === 'icicle' ? 'Icicle chart' : 'Flame chart');
|
|
193
|
-
|
|
195
|
+
const merged = deepMerge({
|
|
194
196
|
chart: { inverted: !isSunburst, ...(this.height ? { height: this.height } : {}) },
|
|
195
197
|
title: { text: titleText, align: 'left' },
|
|
196
198
|
subtitle: { text: this.chartSubtitle || undefined, align: 'left' },
|
|
@@ -294,6 +296,7 @@ let NileFlameChart = class NileFlameChart extends NileElement {
|
|
|
294
296
|
],
|
|
295
297
|
credits: { enabled: false },
|
|
296
298
|
}, this.options);
|
|
299
|
+
return withResponsiveDefaults(merged, 'flame', this.noResponsive);
|
|
297
300
|
}
|
|
298
301
|
async initChart() {
|
|
299
302
|
if (this.loading || !this.chartContainer)
|
|
@@ -342,6 +345,9 @@ __decorate([
|
|
|
342
345
|
__decorate([
|
|
343
346
|
property({ type: Object })
|
|
344
347
|
], NileFlameChart.prototype, "options", void 0);
|
|
348
|
+
__decorate([
|
|
349
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
350
|
+
], NileFlameChart.prototype, "noResponsive", void 0);
|
|
345
351
|
__decorate([
|
|
346
352
|
property({ type: Boolean, reflect: true })
|
|
347
353
|
], NileFlameChart.prototype, "loading", void 0);
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-funnel-chart.css.js';
|
|
9
10
|
let NileFunnelChart = class NileFunnelChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -18,6 +19,7 @@ let NileFunnelChart = class NileFunnelChart extends NileElement {
|
|
|
18
19
|
this.chartSubtitle = '';
|
|
19
20
|
this.data = [];
|
|
20
21
|
this.options = {};
|
|
22
|
+
this.noResponsive = false;
|
|
21
23
|
this.loading = false;
|
|
22
24
|
this.height = '400px';
|
|
23
25
|
this.seriesName = '';
|
|
@@ -124,7 +126,7 @@ let NileFunnelChart = class NileFunnelChart extends NileElement {
|
|
|
124
126
|
}
|
|
125
127
|
buildOptions() {
|
|
126
128
|
const self = this;
|
|
127
|
-
|
|
129
|
+
const merged = deepMerge({
|
|
128
130
|
chart: { type: 'funnel', ...(this.height ? { height: this.height } : {}) },
|
|
129
131
|
title: { text: this.chartTitle || undefined },
|
|
130
132
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
@@ -173,6 +175,7 @@ let NileFunnelChart = class NileFunnelChart extends NileElement {
|
|
|
173
175
|
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
174
176
|
credits: { enabled: false },
|
|
175
177
|
}, this.options);
|
|
178
|
+
return withResponsiveDefaults(merged, 'funnel', this.noResponsive);
|
|
176
179
|
}
|
|
177
180
|
async initChart() {
|
|
178
181
|
if (this.loading || !this.chartContainer)
|
|
@@ -214,6 +217,9 @@ __decorate([
|
|
|
214
217
|
__decorate([
|
|
215
218
|
property({ type: Object })
|
|
216
219
|
], NileFunnelChart.prototype, "options", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
222
|
+
], NileFunnelChart.prototype, "noResponsive", void 0);
|
|
217
223
|
__decorate([
|
|
218
224
|
property({ type: Boolean, reflect: true })
|
|
219
225
|
], NileFunnelChart.prototype, "loading", void 0);
|
|
@@ -24,6 +24,7 @@ export declare class NileGaugeChart extends NileElement {
|
|
|
24
24
|
suffix: string;
|
|
25
25
|
bands: GaugeBand[];
|
|
26
26
|
options: Highcharts.Options;
|
|
27
|
+
noResponsive: boolean;
|
|
27
28
|
loading: boolean;
|
|
28
29
|
height: string;
|
|
29
30
|
chartBg: string;
|
|
@@ -48,6 +49,25 @@ export declare class NileGaugeChart extends NileElement {
|
|
|
48
49
|
protected firstUpdated(): void;
|
|
49
50
|
protected updated(changedProperties: PropertyValues): void;
|
|
50
51
|
private setupResizeObserver;
|
|
52
|
+
/**
|
|
53
|
+
* Keep the value number legible and clear of the arc/needle on a small/short
|
|
54
|
+
* gauge. Runs on every chart render:
|
|
55
|
+
* - scales the value font to the rendered size (capped at 20px, so normal
|
|
56
|
+
* sizes keep their original look);
|
|
57
|
+
* - on small gauges, MOVES the value straight down from the pane centre into
|
|
58
|
+
* the empty bottom wedge. The dial (startAngle -150 / endAngle 150 by
|
|
59
|
+
* default) leaves a 60° gap pointing straight down, and the needle only ever
|
|
60
|
+
* sweeps the arc span — so a label placed on the wedge's axis never collides
|
|
61
|
+
* with either the coloured arc or the needle, and reads cleanly. The wedge's
|
|
62
|
+
* real half-angle is read back off the pane, so a custom start/end angle is
|
|
63
|
+
* respected too; a dial with no gap at all opts out.
|
|
64
|
+
*
|
|
65
|
+
* Styling/positioning the EXISTING SVG label via `.css()` / `.attr()` does NOT
|
|
66
|
+
* force a redraw, so there is no render loop (unlike `point.update`). The
|
|
67
|
+
* `render` event fires at the end of `chart.render()` — after Highcharts has
|
|
68
|
+
* placed the label — so our overrides land last and are reapplied each render.
|
|
69
|
+
*/
|
|
70
|
+
private static _scaleValueLabel;
|
|
51
71
|
private buildOptions;
|
|
52
72
|
private initChart;
|
|
53
73
|
private destroyChart;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
var NileGaugeChart_1;
|
|
1
2
|
import { __decorate } from "tslib";
|
|
2
3
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
3
4
|
import { html } from 'lit';
|
|
4
5
|
import NileElement from '../internal/nile-element.js';
|
|
5
6
|
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
6
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
7
9
|
import { styles } from './nile-gauge-chart.css.js';
|
|
8
|
-
let NileGaugeChart = class NileGaugeChart extends NileElement {
|
|
10
|
+
let NileGaugeChart = NileGaugeChart_1 = class NileGaugeChart extends NileElement {
|
|
9
11
|
constructor() {
|
|
10
12
|
super(...arguments);
|
|
11
13
|
this._hc = null;
|
|
@@ -21,6 +23,7 @@ let NileGaugeChart = class NileGaugeChart extends NileElement {
|
|
|
21
23
|
this.suffix = '';
|
|
22
24
|
this.bands = [];
|
|
23
25
|
this.options = {};
|
|
26
|
+
this.noResponsive = false;
|
|
24
27
|
this.loading = false;
|
|
25
28
|
this.height = '280px';
|
|
26
29
|
// ── Container styling ──
|
|
@@ -155,9 +158,78 @@ let NileGaugeChart = class NileGaugeChart extends NileElement {
|
|
|
155
158
|
this.resizeObserver = new ResizeObserver(() => { this.chart?.reflow(); });
|
|
156
159
|
this.resizeObserver.observe(this.chartContainer);
|
|
157
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Keep the value number legible and clear of the arc/needle on a small/short
|
|
163
|
+
* gauge. Runs on every chart render:
|
|
164
|
+
* - scales the value font to the rendered size (capped at 20px, so normal
|
|
165
|
+
* sizes keep their original look);
|
|
166
|
+
* - on small gauges, MOVES the value straight down from the pane centre into
|
|
167
|
+
* the empty bottom wedge. The dial (startAngle -150 / endAngle 150 by
|
|
168
|
+
* default) leaves a 60° gap pointing straight down, and the needle only ever
|
|
169
|
+
* sweeps the arc span — so a label placed on the wedge's axis never collides
|
|
170
|
+
* with either the coloured arc or the needle, and reads cleanly. The wedge's
|
|
171
|
+
* real half-angle is read back off the pane, so a custom start/end angle is
|
|
172
|
+
* respected too; a dial with no gap at all opts out.
|
|
173
|
+
*
|
|
174
|
+
* Styling/positioning the EXISTING SVG label via `.css()` / `.attr()` does NOT
|
|
175
|
+
* force a redraw, so there is no render loop (unlike `point.update`). The
|
|
176
|
+
* `render` event fires at the end of `chart.render()` — after Highcharts has
|
|
177
|
+
* placed the label — so our overrides land last and are reapplied each render.
|
|
178
|
+
*/
|
|
179
|
+
static _scaleValueLabel(chart) {
|
|
180
|
+
const point = chart.series?.[0]?.points?.[0];
|
|
181
|
+
const label = point?.dataLabel;
|
|
182
|
+
if (!label)
|
|
183
|
+
return;
|
|
184
|
+
const minDim = Math.min(chart.chartWidth, chart.chartHeight);
|
|
185
|
+
let size = Math.max(11, Math.min(20, Math.round(minDim * 0.12)));
|
|
186
|
+
label.css({ fontSize: `${size}px` });
|
|
187
|
+
// Only reposition when the gauge is genuinely small; at normal sizes leave
|
|
188
|
+
// Highcharts' default (near-centre) placement untouched.
|
|
189
|
+
if (minDim >= 200)
|
|
190
|
+
return;
|
|
191
|
+
const pane = chart.pane?.[0];
|
|
192
|
+
const center = pane?.center;
|
|
193
|
+
if (!center)
|
|
194
|
+
return;
|
|
195
|
+
const [cx, cy, diameter] = center;
|
|
196
|
+
const radius = (diameter ?? 0) / 2;
|
|
197
|
+
if (!radius)
|
|
198
|
+
return;
|
|
199
|
+
// How wide the empty bottom wedge actually is, from the pane's own angles
|
|
200
|
+
// (default -150…150 → a 60° gap, so 30° either side of straight-down). A dial
|
|
201
|
+
// that sweeps the full circle has no wedge to move into — leave it centred.
|
|
202
|
+
const startAngle = pane.options?.startAngle ?? -150;
|
|
203
|
+
const endAngle = pane.options?.endAngle ?? 150;
|
|
204
|
+
const halfAngleDeg = (360 - Math.abs(endAngle - startAngle)) / 2;
|
|
205
|
+
if (halfAngleDeg <= 0)
|
|
206
|
+
return;
|
|
207
|
+
// The wedge is a triangle, not a slot: its usable width GROWS with depth.
|
|
208
|
+
// Sitting the label too shallow is what makes a wide number clip the arc's
|
|
209
|
+
// lower tips. Push it most of the way out, then shrink the font if the number
|
|
210
|
+
// is still wider than the wedge is at that depth.
|
|
211
|
+
const depth = radius * 0.62;
|
|
212
|
+
const halfWedge = depth * Math.tan((halfAngleDeg * Math.PI) / 180);
|
|
213
|
+
let bbox = label.getBBox();
|
|
214
|
+
if (bbox.width > halfWedge * 2 && bbox.width > 0) {
|
|
215
|
+
size = Math.max(9, Math.floor((size * halfWedge * 2) / bbox.width));
|
|
216
|
+
label.css({ fontSize: `${size}px` });
|
|
217
|
+
bbox = label.getBBox();
|
|
218
|
+
}
|
|
219
|
+
// Centre the number on the wedge axis, and keep it inside the SVG.
|
|
220
|
+
const x = cx - bbox.width / 2;
|
|
221
|
+
const y = Math.min(cy + depth - bbox.height / 2, chart.chartHeight - bbox.height);
|
|
222
|
+
label.attr({ x, y });
|
|
223
|
+
}
|
|
158
224
|
buildOptions() {
|
|
159
|
-
|
|
160
|
-
chart: {
|
|
225
|
+
const merged = deepMerge({
|
|
226
|
+
chart: {
|
|
227
|
+
type: 'gauge',
|
|
228
|
+
...(this.height ? { height: this.height } : {}),
|
|
229
|
+
events: {
|
|
230
|
+
render() { NileGaugeChart_1._scaleValueLabel(this); },
|
|
231
|
+
},
|
|
232
|
+
},
|
|
161
233
|
title: { text: this.chartTitle || undefined },
|
|
162
234
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
163
235
|
pane: {
|
|
@@ -195,6 +267,7 @@ let NileGaugeChart = class NileGaugeChart extends NileElement {
|
|
|
195
267
|
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
196
268
|
credits: { enabled: false },
|
|
197
269
|
}, this.options);
|
|
270
|
+
return withResponsiveDefaults(merged, 'gauge', this.noResponsive);
|
|
198
271
|
}
|
|
199
272
|
async initChart() {
|
|
200
273
|
if (this.loading || !this.chartContainer)
|
|
@@ -245,6 +318,9 @@ __decorate([
|
|
|
245
318
|
__decorate([
|
|
246
319
|
property({ type: Object })
|
|
247
320
|
], NileGaugeChart.prototype, "options", void 0);
|
|
321
|
+
__decorate([
|
|
322
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
323
|
+
], NileGaugeChart.prototype, "noResponsive", void 0);
|
|
248
324
|
__decorate([
|
|
249
325
|
property({ type: Boolean, reflect: true })
|
|
250
326
|
], NileGaugeChart.prototype, "loading", void 0);
|
|
@@ -290,7 +366,7 @@ __decorate([
|
|
|
290
366
|
__decorate([
|
|
291
367
|
property({ type: Object })
|
|
292
368
|
], NileGaugeChart.prototype, "legend", void 0);
|
|
293
|
-
NileGaugeChart = __decorate([
|
|
369
|
+
NileGaugeChart = NileGaugeChart_1 = __decorate([
|
|
294
370
|
customElement('nile-gauge-chart')
|
|
295
371
|
], NileGaugeChart);
|
|
296
372
|
export { NileGaugeChart };
|
|
@@ -5,6 +5,7 @@ import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
|
5
5
|
import NileElement from '../internal/nile-element.js';
|
|
6
6
|
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
7
|
import { deepMerge } from '../internal/utils.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-heatmap-chart.css.js';
|
|
9
10
|
let NileHeatmapChart = class NileHeatmapChart extends NileElement {
|
|
10
11
|
constructor() {
|
|
@@ -25,6 +26,7 @@ let NileHeatmapChart = class NileHeatmapChart extends NileElement {
|
|
|
25
26
|
this.maxColor = '#1e40af';
|
|
26
27
|
this.colorAxisTitle = '';
|
|
27
28
|
this.options = {};
|
|
29
|
+
this.noResponsive = false;
|
|
28
30
|
this.loading = false;
|
|
29
31
|
this.height = '400px';
|
|
30
32
|
this.showDataLabels = true;
|
|
@@ -154,7 +156,7 @@ let NileHeatmapChart = class NileHeatmapChart extends NileElement {
|
|
|
154
156
|
const cMin = this.colorMin ?? ext.min;
|
|
155
157
|
const cMax = this.colorMax ?? ext.max;
|
|
156
158
|
const seriesData = this.data.map(c => [c.x, c.y, c.value]);
|
|
157
|
-
|
|
159
|
+
const merged = deepMerge({
|
|
158
160
|
chart: { type: 'heatmap', ...(this.height ? { height: this.height } : {}) },
|
|
159
161
|
title: { text: this.chartTitle || undefined },
|
|
160
162
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
@@ -221,6 +223,7 @@ let NileHeatmapChart = class NileHeatmapChart extends NileElement {
|
|
|
221
223
|
],
|
|
222
224
|
credits: { enabled: false },
|
|
223
225
|
}, this.options);
|
|
226
|
+
return withResponsiveDefaults(merged, 'heatmap', this.noResponsive);
|
|
224
227
|
}
|
|
225
228
|
async initChart() {
|
|
226
229
|
if (this.loading || !this.chartContainer)
|
|
@@ -286,6 +289,9 @@ __decorate([
|
|
|
286
289
|
__decorate([
|
|
287
290
|
property({ type: Object })
|
|
288
291
|
], NileHeatmapChart.prototype, "options", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
property({ type: Boolean, attribute: 'no-responsive' })
|
|
294
|
+
], NileHeatmapChart.prototype, "noResponsive", void 0);
|
|
289
295
|
__decorate([
|
|
290
296
|
property({ type: Boolean, reflect: true })
|
|
291
297
|
], NileHeatmapChart.prototype, "loading", void 0);
|
|
@@ -17,6 +17,7 @@ export declare class NileHistogramChart extends NileElement {
|
|
|
17
17
|
/** Raw numeric observations; each value is binned into the histogram. */
|
|
18
18
|
data: HistogramSamples;
|
|
19
19
|
options: Highcharts.Options;
|
|
20
|
+
noResponsive: boolean;
|
|
20
21
|
loading: boolean;
|
|
21
22
|
height: string;
|
|
22
23
|
xAxisTitle: string;
|