@aquera/nile-visualization 2.9.30 → 2.9.32
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 +14 -0
- package/dist/src/index.d.ts +7 -8
- package/dist/src/index.js +2 -3
- package/dist/src/internal/base/forecastable-chart.d.ts +59 -0
- package/dist/src/internal/base/forecastable-chart.js +149 -0
- package/dist/src/internal/{nile-chart-base.d.ts → base/nile-chart-base.d.ts} +1 -1
- package/dist/src/internal/{nile-chart-base.js → base/nile-chart-base.js} +1 -1
- package/dist/src/internal/echarts/echarts-provider.d.ts +28 -0
- package/dist/src/internal/echarts/echarts-provider.js +59 -0
- package/dist/src/internal/echarts/echarts-theme.d.ts +23 -0
- package/dist/src/internal/echarts/echarts-theme.js +91 -0
- package/dist/src/internal/echarts/index.d.ts +8 -0
- package/dist/src/internal/echarts/index.js +8 -0
- package/dist/src/internal/echarts/translate-config.d.ts +41 -0
- package/dist/src/internal/echarts/translate-config.js +460 -0
- package/dist/src/internal/types/aq-config.type.d.ts +2 -0
- package/dist/src/internal/types/chart-area-config.type.d.ts +4 -2
- package/dist/src/internal/types/chart-area-spline-config.type.d.ts +4 -2
- package/dist/src/internal/types/chart-column-config.type.d.ts +3 -2
- package/dist/src/internal/types/chart-line-config.type.d.ts +3 -2
- package/dist/src/internal/types/chart-spline-config.type.d.ts +3 -2
- package/dist/src/internal/types/index.d.ts +0 -1
- package/dist/src/internal/types/primitive-chart-config.type.d.ts +1 -2
- package/dist/src/internal/{chart-adapters.d.ts → utils/chart-adapters.d.ts} +1 -1
- package/dist/src/internal/{chart-adapters.js → utils/chart-adapters.js} +15 -3
- package/dist/src/internal/utils/chart-forecast.d.ts +126 -0
- package/dist/src/internal/utils/chart-forecast.js +297 -0
- package/dist/src/internal/{dashboard-adapters.d.ts → utils/dashboard-adapters.d.ts} +1 -1
- package/dist/src/internal/{utils.js → utils/deep-merge.js} +1 -1
- package/dist/src/internal/{resolve-widget-kind.d.ts → utils/resolve-widget-kind.d.ts} +1 -1
- package/dist/src/internal/utils/separated-chart-config.d.ts +13 -0
- package/dist/src/internal/utils/separated-chart-config.js +30 -0
- package/dist/src/nile-ai-panel/nile-ai-panel.d.ts +1 -1
- package/dist/src/nile-ai-panel/nile-ai-panel.js +1 -1
- package/dist/src/nile-ai-sender/nile-ai-sender.d.ts +1 -1
- package/dist/src/nile-ai-sender/nile-ai-sender.js +1 -1
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.d.ts +1 -1
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +4 -4
- package/dist/src/nile-area-chart/nile-area-chart.d.ts +7 -6
- package/dist/src/nile-area-chart/nile-area-chart.js +37 -24
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.d.ts +1 -1
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +5 -5
- package/dist/src/nile-area-range-chart/nile-area-range-chart.d.ts +1 -1
- package/dist/src/nile-area-range-chart/nile-area-range-chart.js +5 -5
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.d.ts +10 -4
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +38 -27
- package/dist/src/nile-bar-chart/nile-bar-chart.d.ts +3 -3
- package/dist/src/nile-bar-chart/nile-bar-chart.js +4 -4
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.d.ts +3 -2
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +5 -5
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.d.ts +3 -2
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.js +5 -5
- package/dist/src/nile-bubble-chart/nile-bubble-chart.d.ts +3 -3
- package/dist/src/nile-bubble-chart/nile-bubble-chart.js +4 -4
- package/dist/src/nile-chart/index.d.ts +2 -2
- package/dist/src/nile-chart/index.js +1 -1
- package/dist/src/nile-chart/nile-chart-config.d.ts +23 -32
- package/dist/src/nile-chart/nile-chart.css.js +6 -1
- package/dist/src/nile-chart/nile-chart.d.ts +15 -8
- package/dist/src/nile-chart/nile-chart.js +128 -61
- package/dist/src/nile-chart/nile-chart.smoke.test.d.ts +1 -0
- package/dist/src/nile-chart/nile-chart.smoke.test.js +87 -0
- package/dist/src/nile-chart-list/nile-chart-list.d.ts +1 -1
- package/dist/src/nile-chart-list/nile-chart-list.js +1 -1
- package/dist/src/nile-chart-message/nile-chart-message.d.ts +1 -1
- package/dist/src/nile-chart-message/nile-chart-message.js +1 -1
- package/dist/src/nile-cluster-chart/nile-cluster-chart.d.ts +3 -2
- package/dist/src/nile-cluster-chart/nile-cluster-chart.js +5 -5
- package/dist/src/nile-column-chart/nile-column-chart.d.ts +13 -6
- package/dist/src/nile-column-chart/nile-column-chart.js +43 -24
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.d.ts +1 -1
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +5 -5
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.d.ts +1 -1
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +5 -5
- package/dist/src/nile-column-range-chart/nile-column-range-chart.d.ts +1 -1
- package/dist/src/nile-column-range-chart/nile-column-range-chart.js +5 -5
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.d.ts +1 -1
- package/dist/src/nile-dashboard-builder/nile-dashboard-builder.js +2 -2
- package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.d.ts +1 -1
- package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.js +1 -1
- package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +3 -3
- package/dist/src/nile-donut-chart/nile-donut-chart.js +4 -4
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.d.ts +1 -1
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.js +5 -5
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.d.ts +1 -1
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +5 -5
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.d.ts +1 -1
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +5 -5
- package/dist/src/nile-euler-chart/nile-euler-chart.d.ts +1 -1
- package/dist/src/nile-euler-chart/nile-euler-chart.js +5 -5
- package/dist/src/nile-executive-summary/nile-executive-summary.d.ts +1 -1
- package/dist/src/nile-executive-summary/nile-executive-summary.js +1 -1
- package/dist/src/nile-fan-chart/nile-fan-chart.d.ts +1 -1
- package/dist/src/nile-fan-chart/nile-fan-chart.js +5 -5
- package/dist/src/nile-filter-chart/nile-filter-chart.d.ts +1 -1
- package/dist/src/nile-filter-chart/nile-filter-chart.js +1 -1
- package/dist/src/nile-flame-chart/nile-flame-chart.d.ts +1 -1
- package/dist/src/nile-flame-chart/nile-flame-chart.js +5 -5
- package/dist/src/nile-funnel-chart/nile-funnel-chart.d.ts +1 -1
- package/dist/src/nile-funnel-chart/nile-funnel-chart.js +5 -5
- package/dist/src/nile-gauge-chart/nile-gauge-chart.d.ts +1 -1
- package/dist/src/nile-gauge-chart/nile-gauge-chart.js +4 -4
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +3 -2
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +5 -5
- package/dist/src/nile-histogram-chart/nile-histogram-chart.d.ts +3 -2
- package/dist/src/nile-histogram-chart/nile-histogram-chart.js +5 -5
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.d.ts +1 -1
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +5 -5
- package/dist/src/nile-kpi-chart/nile-kpi-chart.css.js +41 -0
- package/dist/src/nile-kpi-chart/nile-kpi-chart.d.ts +31 -1
- package/dist/src/nile-kpi-chart/nile-kpi-chart.js +73 -3
- package/dist/src/nile-line-chart/nile-line-chart.d.ts +12 -6
- package/dist/src/nile-line-chart/nile-line-chart.js +44 -24
- package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +1 -1
- package/dist/src/nile-line-column-chart/nile-line-column-chart.js +5 -5
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.d.ts +1 -1
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +5 -5
- package/dist/src/nile-map-chart/nile-map-chart.d.ts +2 -2
- package/dist/src/nile-map-chart/nile-map-chart.js +4 -4
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.d.ts +1 -1
- package/dist/src/nile-master-detail-chart/nile-master-detail-chart.js +5 -5
- package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +1 -1
- package/dist/src/nile-organization-chart/nile-organization-chart.js +5 -5
- package/dist/src/nile-pie-chart/nile-pie-chart.d.ts +1 -1
- package/dist/src/nile-pie-chart/nile-pie-chart.js +4 -4
- package/dist/src/nile-polygon-chart/nile-polygon-chart.d.ts +1 -1
- package/dist/src/nile-polygon-chart/nile-polygon-chart.js +5 -5
- package/dist/src/nile-radar-chart/nile-radar-chart.d.ts +3 -3
- package/dist/src/nile-radar-chart/nile-radar-chart.js +4 -4
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.d.ts +3 -2
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +5 -5
- package/dist/src/nile-scatter-chart/nile-scatter-chart.d.ts +3 -3
- package/dist/src/nile-scatter-chart/nile-scatter-chart.js +4 -4
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.d.ts +3 -2
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.js +5 -5
- package/dist/src/nile-spline-chart/nile-spline-chart.d.ts +8 -6
- package/dist/src/nile-spline-chart/nile-spline-chart.js +36 -24
- package/dist/src/nile-stacked-chart/nile-stacked-chart.d.ts +3 -2
- package/dist/src/nile-stacked-chart/nile-stacked-chart.js +5 -5
- package/dist/src/nile-timeline-chart/nile-timeline-chart.d.ts +1 -1
- package/dist/src/nile-timeline-chart/nile-timeline-chart.js +5 -5
- package/dist/src/nile-trendline-chart/nile-trendline-chart.d.ts +1 -1
- package/dist/src/nile-trendline-chart/nile-trendline-chart.js +4 -4
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.d.ts +3 -2
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +5 -5
- package/dist/src/nile-vector-chart/nile-vector-chart.d.ts +1 -1
- package/dist/src/nile-vector-chart/nile-vector-chart.js +5 -5
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.d.ts +3 -3
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +4 -4
- package/dist/src/nile-widget-viewer/nile-widget-viewer.css.js +6 -2
- package/dist/src/nile-widget-viewer/nile-widget-viewer.d.ts +1 -1
- package/dist/src/nile-widget-viewer/nile-widget-viewer.js +2 -2
- package/dist/src/nile-xrange-chart/nile-xrange-chart.d.ts +3 -2
- package/dist/src/nile-xrange-chart/nile-xrange-chart.js +5 -5
- package/package.json +10 -6
- package/dist/src/internal/separated-chart-config.d.ts +0 -5
- package/dist/src/internal/separated-chart-config.js +0 -16
- package/dist/src/internal/types/chart-forecast-config.type.d.ts +0 -35
- package/dist/src/internal/types/chart-forecast-config.type.js +0 -2
- package/dist/src/nile-forecast-chart/index.d.ts +0 -2
- package/dist/src/nile-forecast-chart/index.js +0 -2
- package/dist/src/nile-forecast-chart/nile-forecast-chart.css.d.ts +0 -1
- package/dist/src/nile-forecast-chart/nile-forecast-chart.css.js +0 -46
- package/dist/src/nile-forecast-chart/nile-forecast-chart.d.ts +0 -90
- package/dist/src/nile-forecast-chart/nile-forecast-chart.js +0 -551
- /package/dist/src/internal/{nile-element.d.ts → base/nile-element.d.ts} +0 -0
- /package/dist/src/internal/{nile-element.js → base/nile-element.js} +0 -0
- /package/dist/src/internal/{chart-events.d.ts → utils/chart-events.d.ts} +0 -0
- /package/dist/src/internal/{chart-events.js → utils/chart-events.js} +0 -0
- /package/dist/src/internal/{chart-runtime.d.ts → utils/chart-runtime.d.ts} +0 -0
- /package/dist/src/internal/{chart-runtime.js → utils/chart-runtime.js} +0 -0
- /package/dist/src/internal/{dashboard-adapters.js → utils/dashboard-adapters.js} +0 -0
- /package/dist/src/internal/{utils.d.ts → utils/deep-merge.d.ts} +0 -0
- /package/dist/src/internal/{highcharts-provider.d.ts → utils/highcharts-provider.d.ts} +0 -0
- /package/dist/src/internal/{highcharts-provider.js → utils/highcharts-provider.js} +0 -0
- /package/dist/src/internal/{resolve-widget-kind.js → utils/resolve-widget-kind.js} +0 -0
- /package/dist/src/internal/{responsive-defaults.d.ts → utils/responsive-defaults.d.ts} +0 -0
- /package/dist/src/internal/{responsive-defaults.js → utils/responsive-defaults.js} +0 -0
|
@@ -15,7 +15,7 @@ import type { SplineChartSeriesData } from '../nile-spline-chart/nile-spline-cha
|
|
|
15
15
|
import type { RadarChartSeriesData } from '../nile-radar-chart/nile-radar-chart.js';
|
|
16
16
|
import type { GaugeBand } from '../nile-gauge-chart/nile-gauge-chart.js';
|
|
17
17
|
import type { WaterfallDataPoint } from '../nile-waterfall-chart/nile-waterfall-chart.js';
|
|
18
|
-
import type {
|
|
18
|
+
import type { ForecastConfigFields, ForecastSeriesInput } from '../internal/utils/chart-forecast.js';
|
|
19
19
|
import type { KpiVariant, KpiValueFormat, KpiNumberSystem, SparklineType, TrendDirection } from '../nile-kpi-chart/nile-kpi-chart.js';
|
|
20
20
|
import type { MapChartDataPoint } from '../nile-map-chart/nile-map-chart.js';
|
|
21
21
|
import type { StatusLightConfig } from '../nile-chart-message/nile-chart-message.js';
|
|
@@ -97,9 +97,11 @@ export interface NileChartConfigBase extends HighchartsPassthroughConfig {
|
|
|
97
97
|
subtitleFontSize?: string | number;
|
|
98
98
|
noHeader?: boolean;
|
|
99
99
|
noPadding?: boolean;
|
|
100
|
+
/** Remove the `border-bottom` divider under the header (maps to the `no-border` attribute). */
|
|
101
|
+
noBorder?: boolean;
|
|
100
102
|
height?: string;
|
|
101
103
|
loading?: boolean;
|
|
102
|
-
options?:
|
|
104
|
+
options?: HighchartsOptions;
|
|
103
105
|
summary?: string;
|
|
104
106
|
toggleLabel?: string;
|
|
105
107
|
switchableTypes?: ChartType[];
|
|
@@ -134,22 +136,23 @@ export interface NilePieChartConfig extends NileChartConfigBase {
|
|
|
134
136
|
seriesName?: string;
|
|
135
137
|
showDataLabels?: boolean;
|
|
136
138
|
}
|
|
137
|
-
export interface NileLineChartConfig extends NileChartConfigBase {
|
|
139
|
+
export interface NileLineChartConfig extends NileChartConfigBase, ForecastConfigFields {
|
|
138
140
|
type: 'line';
|
|
139
|
-
data: LineChartSeriesData
|
|
141
|
+
data: Array<LineChartSeriesData | ForecastSeriesInput>;
|
|
140
142
|
categories?: string[];
|
|
141
143
|
yAxisTitle?: string;
|
|
142
144
|
}
|
|
143
|
-
export interface NileAreaChartConfig extends NileChartConfigBase {
|
|
145
|
+
export interface NileAreaChartConfig extends NileChartConfigBase, ForecastConfigFields {
|
|
144
146
|
type: 'area';
|
|
145
|
-
data: AreaChartSeriesData
|
|
147
|
+
data: Array<AreaChartSeriesData | ForecastSeriesInput>;
|
|
146
148
|
categories?: string[];
|
|
147
149
|
yAxisTitle?: string;
|
|
148
150
|
stacked?: boolean;
|
|
151
|
+
fillOpacity?: number;
|
|
149
152
|
}
|
|
150
|
-
export interface NileColumnChartConfig extends NileChartConfigBase {
|
|
153
|
+
export interface NileColumnChartConfig extends NileChartConfigBase, ForecastConfigFields {
|
|
151
154
|
type: 'column';
|
|
152
|
-
data: ColumnChartSeriesData
|
|
155
|
+
data: Array<ColumnChartSeriesData | ForecastSeriesInput>;
|
|
153
156
|
categories?: string[];
|
|
154
157
|
yAxisTitle?: string;
|
|
155
158
|
}
|
|
@@ -173,9 +176,9 @@ export interface NileBubbleChartConfig extends NileChartConfigBase {
|
|
|
173
176
|
xAxisTitle?: string;
|
|
174
177
|
yAxisTitle?: string;
|
|
175
178
|
}
|
|
176
|
-
export interface NileSplineChartConfig extends NileChartConfigBase {
|
|
179
|
+
export interface NileSplineChartConfig extends NileChartConfigBase, ForecastConfigFields {
|
|
177
180
|
type: 'spline';
|
|
178
|
-
data: SplineChartSeriesData
|
|
181
|
+
data: Array<SplineChartSeriesData | ForecastSeriesInput>;
|
|
179
182
|
categories?: string[];
|
|
180
183
|
yAxisTitle?: string;
|
|
181
184
|
}
|
|
@@ -333,12 +336,13 @@ export interface NileInvertedAreaChartConfig extends NileChartConfigBase {
|
|
|
333
336
|
yAxisTitle?: string;
|
|
334
337
|
stacked?: boolean;
|
|
335
338
|
}
|
|
336
|
-
export interface NileAreaSplineChartConfig extends NileChartConfigBase {
|
|
339
|
+
export interface NileAreaSplineChartConfig extends NileChartConfigBase, ForecastConfigFields {
|
|
337
340
|
type: 'areaSpline';
|
|
338
|
-
data: AreaSplineSeriesData
|
|
341
|
+
data: Array<AreaSplineSeriesData | ForecastSeriesInput>;
|
|
339
342
|
categories?: string[];
|
|
340
343
|
yAxisTitle?: string;
|
|
341
344
|
stacked?: boolean;
|
|
345
|
+
fillOpacity?: number;
|
|
342
346
|
}
|
|
343
347
|
export interface NileAreaNegativeChartConfig extends NileChartConfigBase {
|
|
344
348
|
type: 'areaNegative';
|
|
@@ -410,7 +414,7 @@ export interface NileMasterDetailChartConfig extends NileChartConfigBase {
|
|
|
410
414
|
detailTitle?: string;
|
|
411
415
|
masterTitle?: string;
|
|
412
416
|
maskFill?: string;
|
|
413
|
-
masterOptions?:
|
|
417
|
+
masterOptions?: HighchartsOptions;
|
|
414
418
|
}
|
|
415
419
|
export interface NileFanChartConfig extends NileChartConfigBase {
|
|
416
420
|
type: 'fan';
|
|
@@ -422,24 +426,6 @@ export interface NileFanChartConfig extends NileChartConfigBase {
|
|
|
422
426
|
forecastStartIndex?: number;
|
|
423
427
|
forecastBandLabel?: string;
|
|
424
428
|
}
|
|
425
|
-
export interface NileForecastChartConfig extends NileChartConfigBase {
|
|
426
|
-
type: 'forecast';
|
|
427
|
-
data: ForecastSeriesData[];
|
|
428
|
-
forecastData?: ForecastSeriesData[];
|
|
429
|
-
forecastStart?: number | null;
|
|
430
|
-
forecastDashStyle?: ForecastDashStyle;
|
|
431
|
-
zoom?: boolean;
|
|
432
|
-
showNowLine?: boolean;
|
|
433
|
-
nowLabel?: string;
|
|
434
|
-
nowLineColor?: string;
|
|
435
|
-
forecastBandLabel?: string;
|
|
436
|
-
forecastBandColor?: string;
|
|
437
|
-
xAxisTitle?: string;
|
|
438
|
-
yAxisTitle?: string;
|
|
439
|
-
secondaryAxisTitle?: string;
|
|
440
|
-
secondaryAxisMin?: number | null;
|
|
441
|
-
timezone?: string;
|
|
442
|
-
}
|
|
443
429
|
export interface NileFunnelChartConfig extends NileChartConfigBase {
|
|
444
430
|
type: 'funnel';
|
|
445
431
|
data: FunnelDataPoint[];
|
|
@@ -521,6 +507,10 @@ export interface NileKpiChartConfig extends NileChartConfigBase {
|
|
|
521
507
|
trendValue?: number | null;
|
|
522
508
|
trendDirection?: TrendDirection;
|
|
523
509
|
trendLabel?: string;
|
|
510
|
+
forecastValue?: number | null;
|
|
511
|
+
forecastLabel?: string;
|
|
512
|
+
forecastApprox?: boolean;
|
|
513
|
+
forecastColor?: string;
|
|
524
514
|
trendUpColor?: string;
|
|
525
515
|
trendDownColor?: string;
|
|
526
516
|
trendNeutralColor?: string;
|
|
@@ -573,6 +563,7 @@ export interface NileKpiChartConfig extends NileChartConfigBase {
|
|
|
573
563
|
}
|
|
574
564
|
export type { FilterOption, FilterControl } from '../nile-filter-chart/nile-filter-chart.js';
|
|
575
565
|
import type { FilterControl } from '../nile-filter-chart/nile-filter-chart.js';
|
|
566
|
+
import type { Options as HighchartsOptions } from 'highcharts';
|
|
576
567
|
export interface NileFilterChartConfig extends NileChartConfigBase {
|
|
577
568
|
type: 'filter';
|
|
578
569
|
controls: FilterControl[];
|
|
@@ -596,4 +587,4 @@ export interface NileListChartConfig extends NileChartConfigBase {
|
|
|
596
587
|
markerColor?: string;
|
|
597
588
|
allowHtml?: boolean;
|
|
598
589
|
}
|
|
599
|
-
export type NileChartConfig = NileBarChartConfig | NilePieChartConfig | NileLineChartConfig | NileAreaChartConfig | NileColumnChartConfig | NileDonutChartConfig | NileScatterChartConfig | NileBubbleChartConfig | NileSplineChartConfig | NileRadarChartConfig | NileGaugeChartConfig | NileWaterfallChartConfig | NileMapChartConfig | NileGridChartConfig | NileTrendlineChartConfig | NileAnomalyChartConfig | NileHistogramChartConfig | NileBellcurveChartConfig | NileBoxplotChartConfig | NileStackedChartConfig | NileClusterChartConfig | NileColumnPyramidChartConfig | NileColumnRangeChartConfig | NileColumnDrilldownChartConfig | NileLollipopChartConfig | NileInvertedAreaChartConfig | NileAreaSplineChartConfig | NileAreaNegativeChartConfig | NileAreaRangeChartConfig | NileDumbbellChartConfig | NileDumbbellLowerChartConfig | NileDumbbellUpperChartConfig | NileRadialBarChartConfig | NileSpiderwebChartConfig | NileTimelineChartConfig | NileMasterDetailChartConfig | NileFanChartConfig |
|
|
590
|
+
export type NileChartConfig = NileBarChartConfig | NilePieChartConfig | NileLineChartConfig | NileAreaChartConfig | NileColumnChartConfig | NileDonutChartConfig | NileScatterChartConfig | NileBubbleChartConfig | NileSplineChartConfig | NileRadarChartConfig | NileGaugeChartConfig | NileWaterfallChartConfig | NileMapChartConfig | NileGridChartConfig | NileTrendlineChartConfig | NileAnomalyChartConfig | NileHistogramChartConfig | NileBellcurveChartConfig | NileBoxplotChartConfig | NileStackedChartConfig | NileClusterChartConfig | NileColumnPyramidChartConfig | NileColumnRangeChartConfig | NileColumnDrilldownChartConfig | NileLollipopChartConfig | NileInvertedAreaChartConfig | NileAreaSplineChartConfig | NileAreaNegativeChartConfig | NileAreaRangeChartConfig | NileDumbbellChartConfig | NileDumbbellLowerChartConfig | NileDumbbellUpperChartConfig | NileRadialBarChartConfig | NileSpiderwebChartConfig | NileTimelineChartConfig | NileMasterDetailChartConfig | NileFanChartConfig | NileFunnelChartConfig | NileOrganizationChartConfig | NileHeatmapChartConfig | NileFlameChartConfig | NileVariablePieChartConfig | NileEulerChartConfig | NilePolygonChartConfig | NileVectorChartConfig | NileXrangeChartConfig | NileLineColumnChartConfig | NileKpiChartConfig | NileFilterChartConfig | NileMessageChartConfig | NileListChartConfig;
|
|
@@ -155,6 +155,12 @@ export const styles = css `
|
|
|
155
155
|
padding: var(--nile-spacing-xl, var(--ng-spacing-xl)) var(--nile-spacing-3xl, var(--ng-spacing-3xl)) var(--nile-spacing-lg, var(--ng-spacing-lg));
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
/* no-border - drop the divider between the header and the plot. The header
|
|
159
|
+
keeps its padding; only the 1px rule goes, so the card reads as one surface. */
|
|
160
|
+
:host([no-border]) .nile-chart-header {
|
|
161
|
+
border-bottom: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
158
164
|
.nile-chart-header-titles {
|
|
159
165
|
display: flex;
|
|
160
166
|
flex-direction: column;
|
|
@@ -219,7 +225,6 @@ export const styles = css `
|
|
|
219
225
|
align-self: center;
|
|
220
226
|
}
|
|
221
227
|
|
|
222
|
-
|
|
223
228
|
/* ── Card Body ── */
|
|
224
229
|
|
|
225
230
|
.nile-chart-wrapper {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
-
import NileElement from '../internal/nile-element.js';
|
|
2
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
3
3
|
import type { NileChartConfig, NileChartMenuConfig } from './nile-chart-config.js';
|
|
4
4
|
import type { NileChartConfigInputType } from '../internal/types/index.js';
|
|
5
|
-
import { type ChartExtremes, type SetExtremesOptions } from '../internal/chart-runtime.js';
|
|
5
|
+
import { type ChartExtremes, type SetExtremesOptions } from '../internal/utils/chart-runtime.js';
|
|
6
6
|
import '../nile-bar-chart/index.js';
|
|
7
7
|
import '../nile-pie-chart/index.js';
|
|
8
8
|
import '../nile-trendline-chart/index.js';
|
|
@@ -29,7 +29,6 @@ import '../nile-dumbbell-chart/index.js';
|
|
|
29
29
|
import '../nile-dumbbell-lower-chart/index.js';
|
|
30
30
|
import '../nile-dumbbell-upper-chart/index.js';
|
|
31
31
|
import '../nile-fan-chart/index.js';
|
|
32
|
-
import '../nile-forecast-chart/index.js';
|
|
33
32
|
import '../nile-funnel-chart/index.js';
|
|
34
33
|
import '../nile-organization-chart/index.js';
|
|
35
34
|
import '../nile-line-column-chart/index.js';
|
|
@@ -103,7 +102,15 @@ export declare class NileChart extends NileElement {
|
|
|
103
102
|
loading: boolean;
|
|
104
103
|
noHeader: boolean;
|
|
105
104
|
noPadding: boolean;
|
|
105
|
+
noBorder: boolean;
|
|
106
106
|
appearance: string | null;
|
|
107
|
+
/**
|
|
108
|
+
* Chart engine (NILE-005, ECHARTS-MIGRATION.md). Default 'highcharts'.
|
|
109
|
+
* 'echarts' renders migrated types via the ECharts engine; types not yet
|
|
110
|
+
* migrated log a warning and fall back to Highcharts automatically, so a
|
|
111
|
+
* flipped flag can never blank a chart.
|
|
112
|
+
*/
|
|
113
|
+
engine: 'highcharts' | 'echarts';
|
|
107
114
|
/**
|
|
108
115
|
* Opt-in double-tap-to-minimize gesture. Double-tap the header to hide it —
|
|
109
116
|
* the plot expands to fill the freed space; double-tap the chart again to
|
|
@@ -145,15 +152,10 @@ export declare class NileChart extends NileElement {
|
|
|
145
152
|
private hasHeaderActionsSlot;
|
|
146
153
|
private aiPanel;
|
|
147
154
|
private masterDetailChart;
|
|
148
|
-
private forecastChart;
|
|
149
155
|
/** True while the inner master-detail chart is zoomed — drives the header
|
|
150
156
|
* "Reset zoom" button. Reflected from the chart's `nile-master-detail-zoom`. */
|
|
151
157
|
private masterZoomed;
|
|
152
158
|
private onMasterZoom;
|
|
153
|
-
/** True while the inner forecast chart is zoomed — drives the same header
|
|
154
|
-
* "Reset zoom" button. Reflected from the chart's `nile-forecast-zoom`. */
|
|
155
|
-
private forecastZoomed;
|
|
156
|
-
private onForecastZoom;
|
|
157
159
|
/** Reset-zoom lives in the header for every chart type that supports zoom. */
|
|
158
160
|
private get showResetZoom();
|
|
159
161
|
private resetActiveZoom;
|
|
@@ -249,6 +251,11 @@ export declare class NileChart extends NileElement {
|
|
|
249
251
|
private _syncHeaderTruncationA11y;
|
|
250
252
|
private renderHeader;
|
|
251
253
|
private renderAiPanel;
|
|
254
|
+
private _echart;
|
|
255
|
+
private _echartsFallback;
|
|
256
|
+
private _echartsResizeObs;
|
|
257
|
+
private _disposeEcharts;
|
|
258
|
+
private _initEcharts;
|
|
252
259
|
private renderChartContent;
|
|
253
260
|
private renderSkeleton;
|
|
254
261
|
render(): TemplateResult;
|
|
@@ -2,15 +2,16 @@ var NileChart_1;
|
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
3
|
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
4
4
|
import { html, nothing } from 'lit';
|
|
5
|
-
import NileElement from '../internal/nile-element.js';
|
|
5
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
6
6
|
import { styles, tooltipCss, injectGlobalChartMenuOverrides } from './nile-chart.css.js';
|
|
7
7
|
import { HIGHCHARTS_PASSTHROUGH_KEYS } from '../internal/types/index.js';
|
|
8
8
|
import { nileChartConfig } from './nile-chart-config-builder.js';
|
|
9
9
|
import { renderChartSkeleton } from './nile-chart-skeleton.js';
|
|
10
|
-
import { convertConfig } from '../internal/chart-adapters.js';
|
|
11
|
-
import { deepMerge } from '../internal/utils.js';
|
|
12
|
-
import { initNileChartExporting, getHighcharts } from '../internal/highcharts-provider.js';
|
|
13
|
-
import {
|
|
10
|
+
import { convertConfig } from '../internal/utils/chart-adapters.js';
|
|
11
|
+
import { deepMerge } from '../internal/utils/deep-merge.js';
|
|
12
|
+
import { initNileChartExporting, getHighcharts } from '../internal/utils/highcharts-provider.js';
|
|
13
|
+
import { getECharts, translateToECharts, EngineNotMigratedError, ECHARTS_MIGRATED_TYPES } from '../internal/echarts/index.js';
|
|
14
|
+
import { getAxisExtremes, setAxisExtremes, } from '../internal/utils/chart-runtime.js';
|
|
14
15
|
import { resolveColorPaletteColors } from '../internal/color-palettes/index.js';
|
|
15
16
|
initNileChartExporting();
|
|
16
17
|
import '../nile-bar-chart/index.js';
|
|
@@ -39,7 +40,6 @@ import '../nile-dumbbell-chart/index.js';
|
|
|
39
40
|
import '../nile-dumbbell-lower-chart/index.js';
|
|
40
41
|
import '../nile-dumbbell-upper-chart/index.js';
|
|
41
42
|
import '../nile-fan-chart/index.js';
|
|
42
|
-
import '../nile-forecast-chart/index.js';
|
|
43
43
|
import '../nile-funnel-chart/index.js';
|
|
44
44
|
import '../nile-organization-chart/index.js';
|
|
45
45
|
import '../nile-line-column-chart/index.js';
|
|
@@ -65,7 +65,6 @@ import '../nile-filter-chart/index.js';
|
|
|
65
65
|
import '../nile-chart-message/nile-chart-message.js';
|
|
66
66
|
import '../nile-chart-list/nile-chart-list.js';
|
|
67
67
|
import '../nile-ai-panel/index.js';
|
|
68
|
-
import { FORECAST_NOW_LINE_COLOR } from '../nile-forecast-chart/nile-forecast-chart.js';
|
|
69
68
|
const CORE_CHART_LABELS = {
|
|
70
69
|
bar: 'Bar',
|
|
71
70
|
pie: 'Pie',
|
|
@@ -182,7 +181,15 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
182
181
|
this.loading = false;
|
|
183
182
|
this.noHeader = false;
|
|
184
183
|
this.noPadding = false;
|
|
184
|
+
this.noBorder = false;
|
|
185
185
|
this.appearance = null;
|
|
186
|
+
/**
|
|
187
|
+
* Chart engine (NILE-005, ECHARTS-MIGRATION.md). Default 'highcharts'.
|
|
188
|
+
* 'echarts' renders migrated types via the ECharts engine; types not yet
|
|
189
|
+
* migrated log a warning and fall back to Highcharts automatically, so a
|
|
190
|
+
* flipped flag can never blank a chart.
|
|
191
|
+
*/
|
|
192
|
+
this.engine = 'highcharts';
|
|
186
193
|
/**
|
|
187
194
|
* Opt-in double-tap-to-minimize gesture. Double-tap the header to hide it —
|
|
188
195
|
* the plot expands to fill the freed space; double-tap the chart again to
|
|
@@ -225,9 +232,6 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
225
232
|
/** True while the inner master-detail chart is zoomed — drives the header
|
|
226
233
|
* "Reset zoom" button. Reflected from the chart's `nile-master-detail-zoom`. */
|
|
227
234
|
this.masterZoomed = false;
|
|
228
|
-
/** True while the inner forecast chart is zoomed — drives the same header
|
|
229
|
-
* "Reset zoom" button. Reflected from the chart's `nile-forecast-zoom`. */
|
|
230
|
-
this.forecastZoomed = false;
|
|
231
235
|
this.handleOutsideClick = (e) => {
|
|
232
236
|
const path = e.composedPath();
|
|
233
237
|
if (!path.includes(this)) {
|
|
@@ -288,25 +292,23 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
288
292
|
const rect = el.getBoundingClientRect();
|
|
289
293
|
this._showHeaderTip(el.textContent ?? '', rect.left + rect.width / 2, rect.top);
|
|
290
294
|
};
|
|
295
|
+
// ── ECharts engine path (NILE-005) ──────────────────────────────
|
|
296
|
+
this._echart = null;
|
|
297
|
+
this._echartsFallback = false;
|
|
298
|
+
this._echartsResizeObs = null;
|
|
291
299
|
}
|
|
292
300
|
onMasterZoom(e) {
|
|
293
301
|
this.masterZoomed = !!e.detail?.zoomed;
|
|
294
302
|
}
|
|
295
|
-
onForecastZoom(e) {
|
|
296
|
-
this.forecastZoomed = !!e.detail?.zoomed;
|
|
297
|
-
}
|
|
298
303
|
/** Reset-zoom lives in the header for every chart type that supports zoom. */
|
|
299
304
|
get showResetZoom() {
|
|
300
305
|
const type = this.activeType ?? this.resolvedConfig?.type;
|
|
301
|
-
return
|
|
302
|
-
|| (this.forecastZoomed && type === 'forecast');
|
|
306
|
+
return this.masterZoomed && type === 'master-detail';
|
|
303
307
|
}
|
|
304
308
|
resetActiveZoom() {
|
|
305
309
|
const type = this.activeType ?? this.resolvedConfig?.type;
|
|
306
310
|
if (type === 'master-detail')
|
|
307
311
|
this.masterDetailChart?.resetZoom();
|
|
308
|
-
else if (type === 'forecast')
|
|
309
|
-
this.forecastChart?.resetZoom();
|
|
310
312
|
}
|
|
311
313
|
get effectiveSummary() {
|
|
312
314
|
return this.resolvedConfig?.summary ?? this.summary;
|
|
@@ -390,6 +392,7 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
390
392
|
this._headerResizeObs?.disconnect();
|
|
391
393
|
this._headerResizeObs = null;
|
|
392
394
|
this._teardownExtremesEvents();
|
|
395
|
+
this._disposeEcharts();
|
|
393
396
|
this._readyResolvers = [];
|
|
394
397
|
}
|
|
395
398
|
mergeChartTypeFromAttr(chart) {
|
|
@@ -409,6 +412,11 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
409
412
|
return this.mergeChartTypeFromAttr({ ...input });
|
|
410
413
|
}
|
|
411
414
|
updated(changedProperties) {
|
|
415
|
+
if (changedProperties.has('engine')) {
|
|
416
|
+
this._echartsFallback = false; // re-evaluate on every engine flip
|
|
417
|
+
if (this.engine !== 'echarts')
|
|
418
|
+
this._disposeEcharts();
|
|
419
|
+
}
|
|
412
420
|
if ((changedProperties.has('config') || changedProperties.has('chartTypeAttr')) && this.config) {
|
|
413
421
|
this.resolvedConfig = this.resolveConfig(this.config);
|
|
414
422
|
this.activeType = this.resolvedConfig.type;
|
|
@@ -424,6 +432,8 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
424
432
|
this.noHeader = cfgNoHeader;
|
|
425
433
|
if (this.noPadding !== (resolved.noPadding === true))
|
|
426
434
|
this.noPadding = resolved.noPadding === true;
|
|
435
|
+
if (this.noBorder !== (resolved.noBorder === true))
|
|
436
|
+
this.noBorder = resolved.noBorder === true;
|
|
427
437
|
if (resolved.appearance && this.appearance !== resolved.appearance)
|
|
428
438
|
this.appearance = resolved.appearance;
|
|
429
439
|
}
|
|
@@ -516,10 +526,9 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
516
526
|
const converted = convertConfig(this.resolvedConfig, toType);
|
|
517
527
|
this.activeType = toType;
|
|
518
528
|
this.activeConfig = converted;
|
|
519
|
-
// Leaving master-detail
|
|
520
|
-
//
|
|
529
|
+
// Leaving master-detail drops any active zoom, and with it the header
|
|
530
|
+
// reset button.
|
|
521
531
|
this.masterZoomed = false;
|
|
522
|
-
this.forecastZoomed = false;
|
|
523
532
|
this.closeMenu();
|
|
524
533
|
this.emit('nile-chart-type-change', {
|
|
525
534
|
fromType,
|
|
@@ -848,8 +857,55 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
848
857
|
</div>
|
|
849
858
|
`;
|
|
850
859
|
}
|
|
860
|
+
_disposeEcharts() {
|
|
861
|
+
this._echartsResizeObs?.disconnect();
|
|
862
|
+
this._echartsResizeObs = null;
|
|
863
|
+
try {
|
|
864
|
+
this._echart?.dispose?.();
|
|
865
|
+
}
|
|
866
|
+
catch { /* already disposed */ }
|
|
867
|
+
this._echart = null;
|
|
868
|
+
}
|
|
869
|
+
async _initEcharts(config) {
|
|
870
|
+
await this.updateComplete;
|
|
871
|
+
const host = this.shadowRoot?.querySelector('.nile-echarts-host');
|
|
872
|
+
if (!host)
|
|
873
|
+
return;
|
|
874
|
+
try {
|
|
875
|
+
const echarts = await getECharts();
|
|
876
|
+
if (!this.shadowRoot?.contains(host))
|
|
877
|
+
return; // re-rendered while loading
|
|
878
|
+
this._disposeEcharts();
|
|
879
|
+
this._echart = echarts.init(host, 'nile');
|
|
880
|
+
this._echart.setOption(translateToECharts(config));
|
|
881
|
+
this._echartsResizeObs = new ResizeObserver(() => this._echart?.resize());
|
|
882
|
+
this._echartsResizeObs.observe(host);
|
|
883
|
+
this.emit('nile-chart-ready', { chart: this._echart, engine: 'echarts' });
|
|
884
|
+
}
|
|
885
|
+
catch (err) {
|
|
886
|
+
const why = err instanceof EngineNotMigratedError ? err.message : String(err);
|
|
887
|
+
// eslint-disable-next-line no-console
|
|
888
|
+
console.warn(`[nile-chart] echarts engine failed (${why}) — falling back to Highcharts.`);
|
|
889
|
+
this._disposeEcharts();
|
|
890
|
+
this._echartsFallback = true;
|
|
891
|
+
this.requestUpdate();
|
|
892
|
+
}
|
|
893
|
+
}
|
|
851
894
|
renderChartContent() {
|
|
852
895
|
const config = this.activeConfig;
|
|
896
|
+
if (this.engine === 'echarts' && !this._echartsFallback) {
|
|
897
|
+
if (ECHARTS_MIGRATED_TYPES.includes(config.type)) {
|
|
898
|
+
void this._initEcharts(config);
|
|
899
|
+
return html `<div
|
|
900
|
+
class="nile-echarts-host"
|
|
901
|
+
part="echarts-host"
|
|
902
|
+
style="width:100%;height:${config.height ?? '400px'}"
|
|
903
|
+
></div>`;
|
|
904
|
+
}
|
|
905
|
+
// eslint-disable-next-line no-console
|
|
906
|
+
console.warn(`[nile-chart] engine="echarts": type "${config.type}" is not on the ECharts engine yet — rendering via Highcharts (waves: ECHARTS-MIGRATION.md).`);
|
|
907
|
+
this._echartsFallback = true;
|
|
908
|
+
}
|
|
853
909
|
// Suppress inner Highcharts title/subtitle — the card header shows them
|
|
854
910
|
const noTitle = { title: { text: undefined }, subtitle: { text: undefined } };
|
|
855
911
|
// Translate config.legend → Highcharts legend options and merge early so every
|
|
@@ -996,6 +1052,14 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
996
1052
|
.categories=${config.categories ?? []}
|
|
997
1053
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
998
1054
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1055
|
+
.secondaryAxisTitle=${config.secondaryAxisTitle ?? ''}
|
|
1056
|
+
.secondaryAxisMin=${config.secondaryAxisMin ?? null}
|
|
1057
|
+
.enableForecasting=${config.enableForecasting ?? false}
|
|
1058
|
+
.projection=${config.projection ?? null}
|
|
1059
|
+
.lineWidth=${config.lineWidth ?? null}
|
|
1060
|
+
.showMarkers=${config.showMarkers ?? false}
|
|
1061
|
+
.valueSuffix=${config.valueSuffix ?? ''}
|
|
1062
|
+
.xAxisTitle=${config.xAxisTitle ?? ''}
|
|
999
1063
|
.showLegend=${config.legend?.show ?? true}
|
|
1000
1064
|
.legend=${config.legend ?? null}
|
|
1001
1065
|
.options=${mergedOptions}
|
|
@@ -1018,6 +1082,15 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
1018
1082
|
.categories=${config.categories ?? []}
|
|
1019
1083
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1020
1084
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1085
|
+
.secondaryAxisTitle=${config.secondaryAxisTitle ?? ''}
|
|
1086
|
+
.secondaryAxisMin=${config.secondaryAxisMin ?? null}
|
|
1087
|
+
.enableForecasting=${config.enableForecasting ?? false}
|
|
1088
|
+
.projection=${config.projection ?? null}
|
|
1089
|
+
.lineWidth=${config.lineWidth ?? null}
|
|
1090
|
+
.showMarkers=${config.showMarkers ?? false}
|
|
1091
|
+
.valueSuffix=${config.valueSuffix ?? ''}
|
|
1092
|
+
.xAxisTitle=${config.xAxisTitle ?? ''}
|
|
1093
|
+
.fillOpacity=${config.fillOpacity ?? null}
|
|
1021
1094
|
.stacked=${config.stacked ?? false}
|
|
1022
1095
|
.showLegend=${config.legend?.show ?? true}
|
|
1023
1096
|
.legend=${config.legend ?? null}
|
|
@@ -1041,6 +1114,14 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
1041
1114
|
.categories=${config.categories ?? []}
|
|
1042
1115
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1043
1116
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1117
|
+
.secondaryAxisTitle=${config.secondaryAxisTitle ?? ''}
|
|
1118
|
+
.secondaryAxisMin=${config.secondaryAxisMin ?? null}
|
|
1119
|
+
.enableForecasting=${config.enableForecasting ?? false}
|
|
1120
|
+
.projection=${config.projection ?? null}
|
|
1121
|
+
.lineWidth=${config.lineWidth ?? null}
|
|
1122
|
+
.showMarkers=${config.showMarkers ?? false}
|
|
1123
|
+
.valueSuffix=${config.valueSuffix ?? ''}
|
|
1124
|
+
.xAxisTitle=${config.xAxisTitle ?? ''}
|
|
1044
1125
|
.showLegend=${config.legend?.show ?? true}
|
|
1045
1126
|
.legend=${config.legend ?? null}
|
|
1046
1127
|
.options=${mergedOptions}
|
|
@@ -1131,6 +1212,14 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
1131
1212
|
.categories=${config.categories ?? []}
|
|
1132
1213
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1133
1214
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1215
|
+
.secondaryAxisTitle=${config.secondaryAxisTitle ?? ''}
|
|
1216
|
+
.secondaryAxisMin=${config.secondaryAxisMin ?? null}
|
|
1217
|
+
.enableForecasting=${config.enableForecasting ?? false}
|
|
1218
|
+
.projection=${config.projection ?? null}
|
|
1219
|
+
.lineWidth=${config.lineWidth ?? null}
|
|
1220
|
+
.showMarkers=${config.showMarkers ?? false}
|
|
1221
|
+
.valueSuffix=${config.valueSuffix ?? ''}
|
|
1222
|
+
.xAxisTitle=${config.xAxisTitle ?? ''}
|
|
1134
1223
|
.showLegend=${config.legend?.show ?? true}
|
|
1135
1224
|
.legend=${config.legend ?? null}
|
|
1136
1225
|
.options=${mergedOptions}
|
|
@@ -1529,41 +1618,6 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
1529
1618
|
.loadingFontFamily=${config.loadingFontFamily ?? ''}
|
|
1530
1619
|
.loadingBg=${config.loadingBg ?? ''}
|
|
1531
1620
|
></nile-fan-chart>`;
|
|
1532
|
-
case 'forecast':
|
|
1533
|
-
return html `<nile-forecast-chart
|
|
1534
|
-
.data=${config.data}
|
|
1535
|
-
.forecastData=${config.forecastData ?? []}
|
|
1536
|
-
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1537
|
-
.forecastStart=${config.forecastStart ?? null}
|
|
1538
|
-
.forecastDashStyle=${config.forecastDashStyle ?? 'Dot'}
|
|
1539
|
-
.zoom=${config.zoom ?? true}
|
|
1540
|
-
@nile-forecast-zoom=${(e) => this.onForecastZoom(e)}
|
|
1541
|
-
.showNowLine=${config.showNowLine ?? true}
|
|
1542
|
-
.nowLabel=${config.nowLabel ?? 'Now'}
|
|
1543
|
-
.nowLineColor=${config.nowLineColor ?? FORECAST_NOW_LINE_COLOR}
|
|
1544
|
-
.forecastBandLabel=${config.forecastBandLabel ?? ''}
|
|
1545
|
-
.forecastBandColor=${config.forecastBandColor ?? ''}
|
|
1546
|
-
.xAxisTitle=${config.xAxisTitle ?? ''}
|
|
1547
|
-
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1548
|
-
.secondaryAxisTitle=${config.secondaryAxisTitle ?? ''}
|
|
1549
|
-
.secondaryAxisMin=${config.secondaryAxisMin ?? null}
|
|
1550
|
-
.timezone=${config.timezone ?? ''}
|
|
1551
|
-
.showLegend=${config.legend?.show ?? true}
|
|
1552
|
-
.legend=${config.legend ?? null}
|
|
1553
|
-
.options=${mergedOptions}
|
|
1554
|
-
.loading=${config.loading ?? false}
|
|
1555
|
-
.chartBg=${config.chartBg ?? ''}
|
|
1556
|
-
.chartBorderRadius=${config.chartBorderRadius ?? ''}
|
|
1557
|
-
.chartBorder=${config.chartBorder ?? ''}
|
|
1558
|
-
.chartShadow=${config.chartShadow ?? ''}
|
|
1559
|
-
.chartPadding=${config.chartPadding ?? ''}
|
|
1560
|
-
.chartMinHeight=${config.chartMinHeight ?? ''}
|
|
1561
|
-
.loadingText=${config.loadingText ?? 'Loading...'}
|
|
1562
|
-
.loadingColor=${config.loadingColor ?? ''}
|
|
1563
|
-
.loadingFontSize=${config.loadingFontSize ?? ''}
|
|
1564
|
-
.loadingFontFamily=${config.loadingFontFamily ?? ''}
|
|
1565
|
-
.loadingBg=${config.loadingBg ?? ''}
|
|
1566
|
-
></nile-forecast-chart>`;
|
|
1567
1621
|
case 'funnel':
|
|
1568
1622
|
return html `<nile-funnel-chart
|
|
1569
1623
|
.data=${config.data}
|
|
@@ -1777,6 +1831,15 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
1777
1831
|
.categories=${config.categories ?? []}
|
|
1778
1832
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1779
1833
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1834
|
+
.secondaryAxisTitle=${config.secondaryAxisTitle ?? ''}
|
|
1835
|
+
.secondaryAxisMin=${config.secondaryAxisMin ?? null}
|
|
1836
|
+
.enableForecasting=${config.enableForecasting ?? false}
|
|
1837
|
+
.projection=${config.projection ?? null}
|
|
1838
|
+
.lineWidth=${config.lineWidth ?? null}
|
|
1839
|
+
.showMarkers=${config.showMarkers ?? false}
|
|
1840
|
+
.valueSuffix=${config.valueSuffix ?? ''}
|
|
1841
|
+
.xAxisTitle=${config.xAxisTitle ?? ''}
|
|
1842
|
+
.fillOpacity=${config.fillOpacity ?? null}
|
|
1780
1843
|
.stacked=${config.stacked ?? false}
|
|
1781
1844
|
.showLegend=${config.legend?.show ?? true}
|
|
1782
1845
|
.legend=${config.legend ?? null}
|
|
@@ -2035,6 +2098,10 @@ let NileChart = NileChart_1 = class NileChart extends NileElement {
|
|
|
2035
2098
|
trendValue: k.trendValue,
|
|
2036
2099
|
trendDirection: k.trendDirection,
|
|
2037
2100
|
trendLabel: k.trendLabel,
|
|
2101
|
+
forecastValue: k.forecastValue,
|
|
2102
|
+
forecastLabel: k.forecastLabel,
|
|
2103
|
+
forecastApprox: k.forecastApprox,
|
|
2104
|
+
forecastColor: k.forecastColor,
|
|
2038
2105
|
trendUpColor: k.trendUpColor,
|
|
2039
2106
|
trendDownColor: k.trendDownColor,
|
|
2040
2107
|
trendNeutralColor: k.trendNeutralColor,
|
|
@@ -2225,9 +2292,15 @@ __decorate([
|
|
|
2225
2292
|
__decorate([
|
|
2226
2293
|
property({ type: Boolean, reflect: true, attribute: 'no-padding' })
|
|
2227
2294
|
], NileChart.prototype, "noPadding", void 0);
|
|
2295
|
+
__decorate([
|
|
2296
|
+
property({ type: Boolean, reflect: true, attribute: 'no-border' })
|
|
2297
|
+
], NileChart.prototype, "noBorder", void 0);
|
|
2228
2298
|
__decorate([
|
|
2229
2299
|
property({ type: String, reflect: true })
|
|
2230
2300
|
], NileChart.prototype, "appearance", void 0);
|
|
2301
|
+
__decorate([
|
|
2302
|
+
property({ type: String, reflect: true })
|
|
2303
|
+
], NileChart.prototype, "engine", void 0);
|
|
2231
2304
|
__decorate([
|
|
2232
2305
|
property({ type: Boolean, reflect: true, attribute: 'minimize-on-double-tap' })
|
|
2233
2306
|
], NileChart.prototype, "minimizeOnDoubleTap", void 0);
|
|
@@ -2270,15 +2343,9 @@ __decorate([
|
|
|
2270
2343
|
__decorate([
|
|
2271
2344
|
query('nile-master-detail-chart')
|
|
2272
2345
|
], NileChart.prototype, "masterDetailChart", void 0);
|
|
2273
|
-
__decorate([
|
|
2274
|
-
query('nile-forecast-chart')
|
|
2275
|
-
], NileChart.prototype, "forecastChart", void 0);
|
|
2276
2346
|
__decorate([
|
|
2277
2347
|
state()
|
|
2278
2348
|
], NileChart.prototype, "masterZoomed", void 0);
|
|
2279
|
-
__decorate([
|
|
2280
|
-
state()
|
|
2281
|
-
], NileChart.prototype, "forecastZoomed", void 0);
|
|
2282
2349
|
NileChart = NileChart_1 = __decorate([
|
|
2283
2350
|
customElement('nile-chart')
|
|
2284
2351
|
], NileChart);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './nile-chart';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NILE-001 smoke suite — nile-chart (house style: see nile-elements tests).
|
|
3
|
+
* Gate item AC-5: run on a dev machine via `yarn workspace @aquera/nile-visualization test`.
|
|
4
|
+
* Deep per-chart-type coverage (incl. ECharts translator parity) is NILE-003.
|
|
5
|
+
*/
|
|
6
|
+
import { expect, fixture, html } from '@open-wc/testing';
|
|
7
|
+
import './nile-chart';
|
|
8
|
+
describe('NileChart (smoke)', () => {
|
|
9
|
+
it('1. is defined', () => { expect(customElements.get('nile-chart')).to.exist; });
|
|
10
|
+
it('2. renders', async () => { const el = await fixture(html `<nile-chart></nile-chart>`); expect(el).to.exist; });
|
|
11
|
+
it('3. shadow root open', async () => { const el = await fixture(html `<nile-chart></nile-chart>`); expect(el.shadowRoot).to.not.be.null; });
|
|
12
|
+
it('4. tag name', async () => { const el = await fixture(html `<nile-chart></nile-chart>`); expect(el.tagName.toLowerCase()).to.equal('nile-chart'); });
|
|
13
|
+
it('5. accepts a line config without throwing', async () => {
|
|
14
|
+
const el = await fixture(html `<nile-chart></nile-chart>`);
|
|
15
|
+
el.config = { chart: { type: 'line', data: [{ name: 'A', data: [1, 2, 3] }], categories: ['x', 'y', 'z'] } };
|
|
16
|
+
await el.updateComplete;
|
|
17
|
+
expect(el.isConnected).to.be.true;
|
|
18
|
+
});
|
|
19
|
+
it('6. removal disconnects', async () => { const el = await fixture(html `<nile-chart></nile-chart>`); el.remove(); expect(el.isConnected).to.be.false; });
|
|
20
|
+
describe('no-border', () => {
|
|
21
|
+
// Assigning `config` syncs noBorder/noHeader/noPadding from inside `updated()`,
|
|
22
|
+
// which schedules a second update — so one `updateComplete` is not enough for
|
|
23
|
+
// either the reflected attribute or the freshly-rendered header to be there.
|
|
24
|
+
const settle = async (el) => {
|
|
25
|
+
await el.updateComplete;
|
|
26
|
+
await el.updateComplete;
|
|
27
|
+
await new Promise(requestAnimationFrame);
|
|
28
|
+
};
|
|
29
|
+
// The header divider is token-valued. No token stylesheet is loaded in the
|
|
30
|
+
// test page, so an unresolved var() makes the whole `border-bottom` shorthand
|
|
31
|
+
// invalid and the style computes to `none` regardless of this flag — which
|
|
32
|
+
// would make the default case pass for the wrong reason. Supply the tokens on
|
|
33
|
+
// the host (custom properties inherit into the shadow root) so `solid` vs
|
|
34
|
+
// `none` measures the `no-border` rule and nothing else.
|
|
35
|
+
const withTokens = (el) => {
|
|
36
|
+
el.style.setProperty('--nile-border-width-1', '1px');
|
|
37
|
+
el.style.setProperty('--nile-colors-neutral-400', '#e6e9eb');
|
|
38
|
+
return el;
|
|
39
|
+
};
|
|
40
|
+
const headerBorder = (el) => {
|
|
41
|
+
const header = el.shadowRoot.querySelector('.nile-chart-header');
|
|
42
|
+
expect(header, 'header should be rendered').to.exist;
|
|
43
|
+
return getComputedStyle(header).borderBottomStyle;
|
|
44
|
+
};
|
|
45
|
+
const lineConfig = (extra = {}) => ({
|
|
46
|
+
chart: { type: 'line', data: [{ name: 'A', data: [1, 2, 3] }], categories: ['x', 'y', 'z'] },
|
|
47
|
+
aq: { chartTitle: 'T', ...extra },
|
|
48
|
+
});
|
|
49
|
+
it('7. defaults to off and keeps the header divider', async () => {
|
|
50
|
+
const el = withTokens(await fixture(html `<nile-chart></nile-chart>`));
|
|
51
|
+
el.config = lineConfig();
|
|
52
|
+
await settle(el);
|
|
53
|
+
expect(el.noBorder).to.be.false;
|
|
54
|
+
expect(el.hasAttribute('no-border')).to.be.false;
|
|
55
|
+
expect(headerBorder(el)).to.equal('solid');
|
|
56
|
+
});
|
|
57
|
+
it('8. removes the header border-bottom when set', async () => {
|
|
58
|
+
const el = withTokens(await fixture(html `<nile-chart no-border></nile-chart>`));
|
|
59
|
+
el.config = lineConfig({ noBorder: true });
|
|
60
|
+
await settle(el);
|
|
61
|
+
expect(el.noBorder).to.be.true;
|
|
62
|
+
expect(headerBorder(el)).to.equal('none');
|
|
63
|
+
});
|
|
64
|
+
it('9. reflects the attribute when set as a property', async () => {
|
|
65
|
+
const el = await fixture(html `<nile-chart></nile-chart>`);
|
|
66
|
+
el.noBorder = true;
|
|
67
|
+
await el.updateComplete;
|
|
68
|
+
expect(el.hasAttribute('no-border')).to.be.true;
|
|
69
|
+
el.noBorder = false;
|
|
70
|
+
await el.updateComplete;
|
|
71
|
+
expect(el.hasAttribute('no-border')).to.be.false;
|
|
72
|
+
});
|
|
73
|
+
it('10. picks noBorder up from the config, both ways', async () => {
|
|
74
|
+
const el = await fixture(html `<nile-chart></nile-chart>`);
|
|
75
|
+
el.config = lineConfig({ noBorder: true });
|
|
76
|
+
await settle(el);
|
|
77
|
+
expect(el.noBorder).to.be.true;
|
|
78
|
+
expect(el.hasAttribute('no-border')).to.be.true;
|
|
79
|
+
// A config that omits noBorder clears it again (same as noHeader/noPadding).
|
|
80
|
+
el.config = lineConfig();
|
|
81
|
+
await settle(el);
|
|
82
|
+
expect(el.noBorder).to.be.false;
|
|
83
|
+
expect(el.hasAttribute('no-border')).to.be.false;
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=nile-chart.smoke.test.js.map
|