@aquera/nile-visualization 2.9.28 → 2.9.30
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 +6 -1
- package/dist/src/index.js +3 -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/highcharts-provider.js +2 -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/chart-forecast-config.type.d.ts +35 -0
- package/dist/src/internal/types/chart-forecast-config.type.js +2 -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 +3 -0
- package/dist/src/internal/types/index.js +1 -1
- package/dist/src/internal/types/primitive-chart-config.type.d.ts +2 -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/index.d.ts +1 -1
- package/dist/src/nile-chart/nile-chart-config.d.ts +22 -83
- package/dist/src/nile-chart/nile-chart-skeleton.js +1 -1
- package/dist/src/nile-chart/nile-chart.css.js +3 -1
- package/dist/src/nile-chart/nile-chart.d.ts +68 -0
- package/dist/src/nile-chart/nile-chart.js +244 -7
- 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/nile-dashboard-builder.css.js +24 -8
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.d.ts +111 -0
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.js +188 -6
- 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-filter-chart/nile-filter-chart.d.ts +2 -0
- package/dist/src/nile-filter-chart/nile-filter-chart.js +14 -0
- package/dist/src/nile-filter-chart/utils/prompt.js +31 -6
- package/dist/src/nile-filter-chart/utils/types.d.ts +2 -0
- 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-forecast-chart/index.d.ts +2 -0
- package/dist/src/nile-forecast-chart/index.js +2 -0
- package/dist/src/nile-forecast-chart/nile-forecast-chart.css.d.ts +1 -0
- package/dist/src/nile-forecast-chart/nile-forecast-chart.css.js +46 -0
- package/dist/src/nile-forecast-chart/nile-forecast-chart.d.ts +90 -0
- package/dist/src/nile-forecast-chart/nile-forecast-chart.js +551 -0
- 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 +2 -1
|
@@ -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);
|
|
@@ -29,6 +29,7 @@ export declare class NileFilterChart extends NileElement implements FilterChartH
|
|
|
29
29
|
/** Id of the prompt control whose input currently has focus (drives the
|
|
30
30
|
* nile-dropdown panel open state). null when no prompt is focused. */
|
|
31
31
|
promptFocusedId: string | null;
|
|
32
|
+
promptPickedIds: Set<string>;
|
|
32
33
|
/** Pixel width of each prompt control's bordered field — kept in sync with
|
|
33
34
|
* the rendered `.fc-prompt__field` via a ResizeObserver attached in
|
|
34
35
|
* prompt.ts. Consumed by the suggestion tooltip so its popup matches the
|
|
@@ -75,6 +76,7 @@ export declare class NileFilterChart extends NileElement implements FilterChartH
|
|
|
75
76
|
*/
|
|
76
77
|
submitPrompt(ctrl: NormalizedFilterControl): void;
|
|
77
78
|
setPromptActiveIndex(id: string, idx: number): void;
|
|
79
|
+
setPromptPicked(id: string, picked: boolean): void;
|
|
78
80
|
setPromptFocused(id: string, focused: boolean): void;
|
|
79
81
|
setPromptFieldWidth(id: string, width: number): void;
|
|
80
82
|
private _validateOrClear;
|
|
@@ -46,6 +46,7 @@ let NileFilterChart = NileFilterChart_1 = class NileFilterChart extends NileElem
|
|
|
46
46
|
/** Id of the prompt control whose input currently has focus (drives the
|
|
47
47
|
* nile-dropdown panel open state). null when no prompt is focused. */
|
|
48
48
|
this.promptFocusedId = null;
|
|
49
|
+
this.promptPickedIds = new Set();
|
|
49
50
|
/** Pixel width of each prompt control's bordered field — kept in sync with
|
|
50
51
|
* the rendered `.fc-prompt__field` via a ResizeObserver attached in
|
|
51
52
|
* prompt.ts. Consumed by the suggestion tooltip so its popup matches the
|
|
@@ -155,6 +156,16 @@ let NileFilterChart = NileFilterChart_1 = class NileFilterChart extends NileElem
|
|
|
155
156
|
setPromptActiveIndex(id, idx) {
|
|
156
157
|
this.promptActiveIndex = new Map(this.promptActiveIndex).set(id, idx);
|
|
157
158
|
}
|
|
159
|
+
setPromptPicked(id, picked) {
|
|
160
|
+
if (this.promptPickedIds.has(id) === picked)
|
|
161
|
+
return;
|
|
162
|
+
const next = new Set(this.promptPickedIds);
|
|
163
|
+
if (picked)
|
|
164
|
+
next.add(id);
|
|
165
|
+
else
|
|
166
|
+
next.delete(id);
|
|
167
|
+
this.promptPickedIds = next;
|
|
168
|
+
}
|
|
158
169
|
setPromptFocused(id, focused) {
|
|
159
170
|
if (focused) {
|
|
160
171
|
this.promptFocusedId = id;
|
|
@@ -653,6 +664,9 @@ __decorate([
|
|
|
653
664
|
__decorate([
|
|
654
665
|
state()
|
|
655
666
|
], NileFilterChart.prototype, "promptFocusedId", void 0);
|
|
667
|
+
__decorate([
|
|
668
|
+
state()
|
|
669
|
+
], NileFilterChart.prototype, "promptPickedIds", void 0);
|
|
656
670
|
__decorate([
|
|
657
671
|
state()
|
|
658
672
|
], NileFilterChart.prototype, "promptFieldWidth", void 0);
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import { html, nothing } from 'lit';
|
|
2
2
|
import { live } from 'lit/directives/live.js';
|
|
3
3
|
import { ref } from 'lit/directives/ref.js';
|
|
4
|
+
import { directive, Directive } from 'lit/directive.js';
|
|
4
5
|
// Per-element ResizeObserver bookkeeping. WeakMap so observers are GC'd
|
|
5
6
|
// alongside their elements when the prompt is unmounted.
|
|
6
7
|
const _fieldObservers = new WeakMap();
|
|
8
|
+
class SyncOpenDirective extends Directive {
|
|
9
|
+
render(_open) {
|
|
10
|
+
return nothing;
|
|
11
|
+
}
|
|
12
|
+
update(part, [open]) {
|
|
13
|
+
const el = part.element;
|
|
14
|
+
if (el.open !== open)
|
|
15
|
+
el.open = open;
|
|
16
|
+
return nothing;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const syncOpen = directive(SyncOpenDirective);
|
|
7
20
|
const PUNCT_TOKENS = new Set(['(', ')', '[', ']', ',']);
|
|
8
21
|
/**
|
|
9
22
|
* Splits the input into the tokens analyzePromptCtx reasons about:
|
|
@@ -369,6 +382,7 @@ export function renderPrompt(host, ctrl) {
|
|
|
369
382
|
// Decide what kind of token comes next, then pre-filter the suggestion list
|
|
370
383
|
// to that context. The combobox's own substring filter is bypassed below
|
|
371
384
|
// (via `getSearchText`) so this pre-filter is the single source of truth.
|
|
385
|
+
const justPicked = host.promptPickedIds.has(ctrl.id);
|
|
372
386
|
const ctx = analyzePromptCtx(value, fieldNames, operatorTokens, connectorTokens);
|
|
373
387
|
const candidates = (() => {
|
|
374
388
|
switch (ctx.position) {
|
|
@@ -515,8 +529,17 @@ export function renderPrompt(host, ctrl) {
|
|
|
515
529
|
const tokens = tokenize(value);
|
|
516
530
|
const onInput = (e) => {
|
|
517
531
|
const inputEl = e.target;
|
|
518
|
-
|
|
532
|
+
let next = inputEl.value;
|
|
519
533
|
const atEnd = () => inputEl.selectionStart === inputEl.value.length;
|
|
534
|
+
if (justPicked) {
|
|
535
|
+
const appended = next.startsWith(value) ? next.slice(value.length) : '';
|
|
536
|
+
if (value.length > 0 && appended.length > 0 && !/^\s/.test(appended)) {
|
|
537
|
+
next = `${value} ${appended}`;
|
|
538
|
+
inputEl.value = next;
|
|
539
|
+
inputEl.setSelectionRange(next.length, next.length);
|
|
540
|
+
}
|
|
541
|
+
host.setPromptPicked(ctrl.id, false);
|
|
542
|
+
}
|
|
520
543
|
if (atEnd()) {
|
|
521
544
|
const s = inputEl.selectionStart ?? next.length;
|
|
522
545
|
inputEl.setSelectionRange(s, s);
|
|
@@ -551,7 +574,7 @@ export function renderPrompt(host, ctrl) {
|
|
|
551
574
|
if (tokenLike) {
|
|
552
575
|
const beforeTrimmed = ctx.before.replace(/\s+$/, '');
|
|
553
576
|
const sep = beforeTrimmed.length > 0 ? ' ' : '';
|
|
554
|
-
next = beforeTrimmed + sep + tokenOf(item)
|
|
577
|
+
next = beforeTrimmed + sep + tokenOf(item);
|
|
555
578
|
}
|
|
556
579
|
else if (item.type === 'value') {
|
|
557
580
|
const beforeTrimmed = ctx.before.replace(/\s+$/, '');
|
|
@@ -568,7 +591,7 @@ export function renderPrompt(host, ctrl) {
|
|
|
568
591
|
const inserted = alreadyQuoted || isNumeric || isLiteral
|
|
569
592
|
? raw
|
|
570
593
|
: `"${raw.replace(/"/g, '\\"')}"`;
|
|
571
|
-
next = beforeTrimmed + sep + inserted
|
|
594
|
+
next = beforeTrimmed + sep + inserted;
|
|
572
595
|
}
|
|
573
596
|
else if (item.type === 'function') {
|
|
574
597
|
const beforeTrimmed = ctx.before.replace(/\s+$/, '');
|
|
@@ -587,6 +610,7 @@ export function renderPrompt(host, ctrl) {
|
|
|
587
610
|
// candidate set should start with no row pre-highlighted. Avoids the
|
|
588
611
|
// confusing "stuck on the old index" state after a pick.
|
|
589
612
|
host.setPromptActiveIndex(ctrl.id, -1);
|
|
613
|
+
host.setPromptPicked(ctrl.id, true);
|
|
590
614
|
// Imperatively sync the input for immediate visual feedback.
|
|
591
615
|
inputEl.value = next;
|
|
592
616
|
// Defer focus + caret-to-end to AFTER Lit's microtask-scheduled re-render.
|
|
@@ -609,7 +633,7 @@ export function renderPrompt(host, ctrl) {
|
|
|
609
633
|
};
|
|
610
634
|
const onKeyDown = (e) => {
|
|
611
635
|
const inputEl = e.currentTarget;
|
|
612
|
-
const len = suggestionData.length;
|
|
636
|
+
const len = dropdownOpen ? suggestionData.length : 0;
|
|
613
637
|
// Read fresh from host (don't rely on the closure-captured `activeIdx`,
|
|
614
638
|
// which is from this render — fine in theory but defensive against any
|
|
615
639
|
// Lit re-binding edge case).
|
|
@@ -689,7 +713,7 @@ export function renderPrompt(host, ctrl) {
|
|
|
689
713
|
host.setPromptFocused(ctrl.id, false);
|
|
690
714
|
};
|
|
691
715
|
const isFocused = host.promptFocusedId === ctrl.id;
|
|
692
|
-
const dropdownOpen = isFiltrexMode && isFocused && suggestionData.length > 0;
|
|
716
|
+
const dropdownOpen = isFiltrexMode && isFocused && suggestionData.length > 0 && !justPicked;
|
|
693
717
|
// Clears the prompt value, fires the existing `nile-change` flow (via
|
|
694
718
|
// submitPrompt → _emitChange) and additionally emits a dedicated
|
|
695
719
|
// `nile-clear` event so consumers can distinguish a user-initiated clear
|
|
@@ -699,6 +723,7 @@ export function renderPrompt(host, ctrl) {
|
|
|
699
723
|
host.handlePromptInput(ctrl, '');
|
|
700
724
|
host.submitPrompt(ctrl);
|
|
701
725
|
host.setPromptActiveIndex(ctrl.id, -1);
|
|
726
|
+
host.setPromptPicked(ctrl.id, false);
|
|
702
727
|
host.emit('nile-clear', { id: ctrl.id, source });
|
|
703
728
|
const target = e.currentTarget;
|
|
704
729
|
const root = (target?.getRootNode() ?? document);
|
|
@@ -720,7 +745,7 @@ export function renderPrompt(host, ctrl) {
|
|
|
720
745
|
placement="bottom-start"
|
|
721
746
|
sync="width"
|
|
722
747
|
distance="6"
|
|
723
|
-
|
|
748
|
+
${syncOpen(dropdownOpen)}
|
|
724
749
|
.noOpenOnClick=${true}
|
|
725
750
|
>
|
|
726
751
|
<div
|
|
@@ -250,6 +250,8 @@ export interface FilterChartHost {
|
|
|
250
250
|
submitPrompt(ctrl: NormalizedFilterControl): void;
|
|
251
251
|
/** Set the highlighted suggestion index. Use -1 to clear the highlight. */
|
|
252
252
|
setPromptActiveIndex(id: string, idx: number): void;
|
|
253
|
+
readonly promptPickedIds: ReadonlySet<string>;
|
|
254
|
+
setPromptPicked(id: string, picked: boolean): void;
|
|
253
255
|
/** Mark a prompt control's input as focused / unfocused. */
|
|
254
256
|
setPromptFocused(id: string, focused: boolean): void;
|
|
255
257
|
/** Pixel width of the bordered prompt field, keyed by control id. */
|
|
@@ -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);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
--nile-chart-min-height: var(--nile-height-200px, var(--ng-height-200px));
|
|
5
|
+
--nile-chart-bg: transparent;
|
|
6
|
+
--nile-chart-border-radius: 0;
|
|
7
|
+
--nile-chart-border: none;
|
|
8
|
+
--nile-chart-shadow: none;
|
|
9
|
+
--nile-chart-padding: 0;
|
|
10
|
+
--nile-chart-loading-color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
11
|
+
--nile-chart-loading-font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
|
|
12
|
+
--nile-chart-loading-font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
13
|
+
--nile-chart-loading-bg: transparent;
|
|
14
|
+
display: block;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
position: relative;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([hidden]) {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.chart-container {
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
min-height: var(--nile-chart-min-height);
|
|
28
|
+
background: var(--nile-chart-bg);
|
|
29
|
+
border-radius: var(--nile-chart-border-radius);
|
|
30
|
+
border: var(--nile-chart-border);
|
|
31
|
+
box-shadow: var(--nile-chart-shadow);
|
|
32
|
+
padding: var(--nile-chart-padding);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.chart-loading {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
min-height: inherit;
|
|
40
|
+
color: var(--nile-chart-loading-color);
|
|
41
|
+
font-family: var(--nile-chart-loading-font-family);
|
|
42
|
+
font-size: var(--nile-chart-loading-font-size);
|
|
43
|
+
background: var(--nile-chart-loading-bg);
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
//# sourceMappingURL=nile-forecast-chart.css.js.map
|
|
@@ -0,0 +1,90 @@
|
|
|
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 { LegendConfig } from '../internal/types/index.js';
|
|
6
|
+
export type ForecastPoint = [number, number];
|
|
7
|
+
export type ForecastSeriesType = 'line' | 'spline' | 'area' | 'areaspline' | 'column';
|
|
8
|
+
export type ForecastDashStyle = Highcharts.DashStyleValue;
|
|
9
|
+
export interface ForecastSeriesData {
|
|
10
|
+
name: string;
|
|
11
|
+
data: ForecastPoint[];
|
|
12
|
+
type?: ForecastSeriesType;
|
|
13
|
+
axis?: 'primary' | 'secondary';
|
|
14
|
+
color?: string;
|
|
15
|
+
forecastColor?: string;
|
|
16
|
+
forecastDashStyle?: ForecastDashStyle;
|
|
17
|
+
valueSuffix?: string;
|
|
18
|
+
lineWidth?: number;
|
|
19
|
+
showMarkers?: boolean;
|
|
20
|
+
fillOpacity?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const FORECAST_NOW_LINE_COLOR = "var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600))";
|
|
23
|
+
export declare class NileForecastChart extends NileElement {
|
|
24
|
+
static styles: CSSResultGroup;
|
|
25
|
+
private _hc;
|
|
26
|
+
private chart;
|
|
27
|
+
private resizeObserver;
|
|
28
|
+
private chartContainer;
|
|
29
|
+
config: SeparatedChartConfigInputType | null;
|
|
30
|
+
chartTitle: string;
|
|
31
|
+
chartSubtitle: string;
|
|
32
|
+
data: ForecastSeriesData[];
|
|
33
|
+
forecastData: ForecastSeriesData[];
|
|
34
|
+
options: Highcharts.Options;
|
|
35
|
+
loading: boolean;
|
|
36
|
+
height: string;
|
|
37
|
+
forecastStart: number | null;
|
|
38
|
+
forecastDashStyle: ForecastDashStyle;
|
|
39
|
+
showNowLine: boolean;
|
|
40
|
+
nowLabel: string;
|
|
41
|
+
nowLineColor: string;
|
|
42
|
+
forecastBandLabel: string;
|
|
43
|
+
forecastBandColor: string;
|
|
44
|
+
xAxisTitle: string;
|
|
45
|
+
yAxisTitle: string;
|
|
46
|
+
secondaryAxisTitle: string;
|
|
47
|
+
secondaryAxisMin: number | null;
|
|
48
|
+
timezone: string;
|
|
49
|
+
zoom: boolean;
|
|
50
|
+
showLegend: boolean;
|
|
51
|
+
legend: LegendConfig | null;
|
|
52
|
+
chartBg: string;
|
|
53
|
+
chartBorderRadius: string | number;
|
|
54
|
+
chartBorder: string;
|
|
55
|
+
chartShadow: string;
|
|
56
|
+
chartPadding: string | number;
|
|
57
|
+
chartMinHeight: string | number;
|
|
58
|
+
loadingText: string;
|
|
59
|
+
loadingColor: string;
|
|
60
|
+
loadingFontSize: string | number;
|
|
61
|
+
loadingFontFamily: string;
|
|
62
|
+
loadingBg: string;
|
|
63
|
+
private _syncCssVars;
|
|
64
|
+
private applyConfig;
|
|
65
|
+
connectedCallback(): void;
|
|
66
|
+
disconnectedCallback(): void;
|
|
67
|
+
protected firstUpdated(): void;
|
|
68
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
69
|
+
setForecast(series: ForecastSeriesData[], forecastStart?: number | null): void;
|
|
70
|
+
clearForecast(): void;
|
|
71
|
+
private startFromSetForecast;
|
|
72
|
+
private zoomed;
|
|
73
|
+
private setZoomed;
|
|
74
|
+
private xExtremes;
|
|
75
|
+
resetZoom(): void;
|
|
76
|
+
private observedContainer;
|
|
77
|
+
private syncResizeObserver;
|
|
78
|
+
private resolveSeries;
|
|
79
|
+
private lastTimestamp;
|
|
80
|
+
private buildOptions;
|
|
81
|
+
private initInFlight;
|
|
82
|
+
private initChart;
|
|
83
|
+
private destroyChart;
|
|
84
|
+
render(): TemplateResult;
|
|
85
|
+
}
|
|
86
|
+
declare global {
|
|
87
|
+
interface HTMLElementTagNameMap {
|
|
88
|
+
'nile-forecast-chart': NileForecastChart;
|
|
89
|
+
}
|
|
90
|
+
}
|