@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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
3
3
|
import { html } from 'lit';
|
|
4
|
-
import NileElement from '../internal/nile-element.js';
|
|
5
|
-
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
6
|
-
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
7
|
-
import { deepMerge } from '../internal/utils.js';
|
|
8
|
-
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
4
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
5
|
+
import { applySeparatedChartConfig } from '../internal/utils/separated-chart-config.js';
|
|
6
|
+
import { getHighcharts } from '../internal/utils/highcharts-provider.js';
|
|
7
|
+
import { deepMerge } from '../internal/utils/deep-merge.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/utils/responsive-defaults.js';
|
|
9
9
|
import { styles } from './nile-flame-chart.css.js';
|
|
10
10
|
function registerFlameSeriesTypeIfNeeded(H) {
|
|
11
11
|
const types = H.seriesTypes;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import type Highcharts from 'highcharts';
|
|
3
|
-
import NileElement from '../internal/nile-element.js';
|
|
3
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
4
4
|
import type { SeparatedChartConfigInputType } from '../internal/types/separated-chart-config-input.type.js';
|
|
5
5
|
import type { LegendConfig } from '../internal/types/index.js';
|
|
6
6
|
export interface FunnelDataPoint {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
3
3
|
import { html } from 'lit';
|
|
4
|
-
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
5
|
-
import NileElement from '../internal/nile-element.js';
|
|
6
|
-
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
|
-
import { deepMerge } from '../internal/utils.js';
|
|
8
|
-
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
4
|
+
import { getHighcharts } from '../internal/utils/highcharts-provider.js';
|
|
5
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
6
|
+
import { applySeparatedChartConfig } from '../internal/utils/separated-chart-config.js';
|
|
7
|
+
import { deepMerge } from '../internal/utils/deep-merge.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/utils/responsive-defaults.js';
|
|
9
9
|
import { styles } from './nile-funnel-chart.css.js';
|
|
10
10
|
let NileFunnelChart = class NileFunnelChart extends NileElement {
|
|
11
11
|
constructor() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import type Highcharts from 'highcharts';
|
|
3
|
-
import NileElement from '../internal/nile-element.js';
|
|
3
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
4
4
|
import type { NileChartConfigInputType } from '../internal/types/index.js';
|
|
5
5
|
import type { LegendConfig } from '../internal/types/index.js';
|
|
6
6
|
export interface GaugeBand {
|
|
@@ -2,10 +2,10 @@ var NileGaugeChart_1;
|
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
3
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
4
4
|
import { html } from 'lit';
|
|
5
|
-
import NileElement from '../internal/nile-element.js';
|
|
6
|
-
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
7
|
-
import { deepMerge } from '../internal/utils.js';
|
|
8
|
-
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
5
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
6
|
+
import { getHighcharts } from '../internal/utils/highcharts-provider.js';
|
|
7
|
+
import { deepMerge } from '../internal/utils/deep-merge.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/utils/responsive-defaults.js';
|
|
9
9
|
import { styles } from './nile-gauge-chart.css.js';
|
|
10
10
|
let NileGaugeChart = NileGaugeChart_1 = class NileGaugeChart extends NileElement {
|
|
11
11
|
constructor() {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import type Highcharts from 'highcharts';
|
|
3
|
-
import NileElement from '../internal/nile-element.js';
|
|
3
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
4
4
|
import type { SeparatedChartConfigInputType } from '../internal/types/separated-chart-config-input.type.js';
|
|
5
|
+
import type { LegendConfig } from '../internal/types/index.js';
|
|
5
6
|
/** One cell: x/y are 0-based indices into `xCategories` / `yCategories`. */
|
|
6
7
|
export interface HeatmapCell {
|
|
7
8
|
x: number;
|
|
@@ -33,7 +34,7 @@ export declare class NileHeatmapChart extends NileElement {
|
|
|
33
34
|
showDataLabels: boolean;
|
|
34
35
|
showLegend: boolean;
|
|
35
36
|
/** Full legend configuration — all Highcharts legend options in one object. */
|
|
36
|
-
legend:
|
|
37
|
+
legend: LegendConfig | null;
|
|
37
38
|
chartBg: string;
|
|
38
39
|
chartBorderRadius: string | number;
|
|
39
40
|
chartBorder: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
3
3
|
import { html } from 'lit';
|
|
4
|
-
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
5
|
-
import NileElement from '../internal/nile-element.js';
|
|
6
|
-
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
|
-
import { deepMerge } from '../internal/utils.js';
|
|
8
|
-
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
4
|
+
import { getHighcharts } from '../internal/utils/highcharts-provider.js';
|
|
5
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
6
|
+
import { applySeparatedChartConfig } from '../internal/utils/separated-chart-config.js';
|
|
7
|
+
import { deepMerge } from '../internal/utils/deep-merge.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/utils/responsive-defaults.js';
|
|
9
9
|
import { styles } from './nile-heatmap-chart.css.js';
|
|
10
10
|
let NileHeatmapChart = class NileHeatmapChart extends NileElement {
|
|
11
11
|
constructor() {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import type Highcharts from 'highcharts';
|
|
3
|
-
import NileElement from '../internal/nile-element.js';
|
|
3
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
4
4
|
import type { SeparatedChartConfigInputType } from '../internal/types/separated-chart-config-input.type.js';
|
|
5
|
+
import type { LegendConfig } from '../internal/types/index.js';
|
|
5
6
|
/** One raw measurement per entry; each is placed in a histogram bin. */
|
|
6
7
|
export type HistogramSamples = number[];
|
|
7
8
|
export declare class NileHistogramChart extends NileElement {
|
|
@@ -35,7 +36,7 @@ export declare class NileHistogramChart extends NileElement {
|
|
|
35
36
|
binWidth: number;
|
|
36
37
|
showLegend: boolean;
|
|
37
38
|
/** Full legend configuration — all Highcharts legend options in one object. */
|
|
38
|
-
legend:
|
|
39
|
+
legend: LegendConfig | null;
|
|
39
40
|
chartBg: string;
|
|
40
41
|
chartBorderRadius: string | number;
|
|
41
42
|
chartBorder: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
3
3
|
import { html } from 'lit';
|
|
4
|
-
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
5
|
-
import NileElement from '../internal/nile-element.js';
|
|
6
|
-
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
|
-
import { deepMerge } from '../internal/utils.js';
|
|
8
|
-
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
4
|
+
import { getHighcharts } from '../internal/utils/highcharts-provider.js';
|
|
5
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
6
|
+
import { applySeparatedChartConfig } from '../internal/utils/separated-chart-config.js';
|
|
7
|
+
import { deepMerge } from '../internal/utils/deep-merge.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/utils/responsive-defaults.js';
|
|
9
9
|
import { styles } from './nile-histogram-chart.css.js';
|
|
10
10
|
/** Stable id linking the hidden source series to the histogram series. */
|
|
11
11
|
const HISTOGRAM_BASE_ID = 'nile-histogram-base';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import type Highcharts from 'highcharts';
|
|
3
|
-
import NileElement from '../internal/nile-element.js';
|
|
3
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
4
4
|
import type { SeparatedChartConfigInputType } from '../internal/types/index.js';
|
|
5
5
|
import type { LegendConfig } from '../internal/types/index.js';
|
|
6
6
|
export interface InvertedAreaChartSeriesData {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
3
3
|
import { html } from 'lit';
|
|
4
|
-
import NileElement from '../internal/nile-element.js';
|
|
5
|
-
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
6
|
-
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
7
|
-
import { deepMerge } from '../internal/utils.js';
|
|
8
|
-
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
4
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
5
|
+
import { applySeparatedChartConfig } from '../internal/utils/separated-chart-config.js';
|
|
6
|
+
import { getHighcharts } from '../internal/utils/highcharts-provider.js';
|
|
7
|
+
import { deepMerge } from '../internal/utils/deep-merge.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/utils/responsive-defaults.js';
|
|
9
9
|
import { styles } from './nile-inverted-area-chart.css';
|
|
10
10
|
let NileInvertedAreaChart = class NileInvertedAreaChart extends NileElement {
|
|
11
11
|
constructor() {
|
|
@@ -66,6 +66,8 @@ export const styles = css `
|
|
|
66
66
|
--nile-kpi-trend-up-color: var(--nile-colors-success-700, var(--ng-color-success-700));
|
|
67
67
|
--nile-kpi-trend-down-color: var(--nile-colors-error-700, var(--ng-color-error-700));
|
|
68
68
|
--nile-kpi-trend-neutral-color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
69
|
+
--nile-kpi-forecast-color: var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600));
|
|
70
|
+
--nile-kpi-forecast-font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));
|
|
69
71
|
--nile-kpi-description-font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));
|
|
70
72
|
--nile-kpi-description-color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
71
73
|
display: flex;
|
|
@@ -249,6 +251,43 @@ export const styles = css `
|
|
|
249
251
|
height: 100%;
|
|
250
252
|
fill: currentColor;
|
|
251
253
|
}
|
|
254
|
+
.kpi-forecast {
|
|
255
|
+
display: inline-flex;
|
|
256
|
+
align-items: center;
|
|
257
|
+
gap: var(--nile-spacing-xs, var(--ng-spacing-xs));
|
|
258
|
+
max-width: 100%;
|
|
259
|
+
margin: 0;
|
|
260
|
+
font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
261
|
+
font-size: var(--nile-kpi-forecast-font-size);
|
|
262
|
+
font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));
|
|
263
|
+
color: var(--nile-kpi-forecast-color);
|
|
264
|
+
line-height: 1.5;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.kpi-forecast-glyph {
|
|
268
|
+
display: inline-flex;
|
|
269
|
+
flex: 0 0 auto;
|
|
270
|
+
width: var(--nile-width-12px, 12px);
|
|
271
|
+
height: var(--nile-height-12px, 12px);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.kpi-forecast-glyph svg {
|
|
275
|
+
width: 100%;
|
|
276
|
+
height: 100%;
|
|
277
|
+
fill: currentColor;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.kpi-forecast-value {
|
|
281
|
+
flex: 0 0 auto;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.kpi-forecast-label {
|
|
285
|
+
flex: 0 1 auto;
|
|
286
|
+
min-width: 0;
|
|
287
|
+
overflow: hidden;
|
|
288
|
+
text-overflow: ellipsis;
|
|
289
|
+
white-space: nowrap;
|
|
290
|
+
}
|
|
252
291
|
|
|
253
292
|
.kpi-description {
|
|
254
293
|
display: block;
|
|
@@ -294,6 +333,7 @@ export const styles = css `
|
|
|
294
333
|
:host {
|
|
295
334
|
--nile-kpi-prefix-suffix-font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
|
|
296
335
|
--nile-kpi-description-font-size: var(--nile-type-scale-1, var(--ng-font-size-text-xs));
|
|
336
|
+
--nile-kpi-forecast-font-size: var(--nile-type-scale-1, var(--ng-font-size-text-xs));
|
|
297
337
|
}
|
|
298
338
|
|
|
299
339
|
.kpi-sparkline {
|
|
@@ -312,6 +352,7 @@ export const styles = css `
|
|
|
312
352
|
hide everything except the value and trend. */
|
|
313
353
|
@container (max-height: 50px) and (max-width: 319.98px) {
|
|
314
354
|
.kpi-label,
|
|
355
|
+
.kpi-forecast,
|
|
315
356
|
.kpi-description,
|
|
316
357
|
.kpi-sparkline {
|
|
317
358
|
display: none;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import type Highcharts from 'highcharts';
|
|
3
|
-
import NileElement from '../internal/nile-element.js';
|
|
3
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
4
4
|
import type { AqConfigType } from '../internal/types/aq-config.type.js';
|
|
5
5
|
export type TrendDirection = 'up' | 'down' | 'neutral';
|
|
6
6
|
export type KpiVariant = 'default' | 'card' | 'gauge' | 'accent';
|
|
@@ -18,6 +18,10 @@ export interface ChartKpiSeparatedPayload {
|
|
|
18
18
|
trendValue?: number | null;
|
|
19
19
|
trendDirection?: TrendDirection;
|
|
20
20
|
trendLabel?: string;
|
|
21
|
+
forecastValue?: number | null;
|
|
22
|
+
forecastLabel?: string;
|
|
23
|
+
forecastApprox?: boolean;
|
|
24
|
+
forecastColor?: string;
|
|
21
25
|
description?: string;
|
|
22
26
|
sparkline?: number[];
|
|
23
27
|
sparklineColor?: string;
|
|
@@ -159,6 +163,27 @@ export declare class NileKpiChart extends NileElement {
|
|
|
159
163
|
trendDirection: TrendDirection;
|
|
160
164
|
/** Trend context label (e.g. "vs last month"). */
|
|
161
165
|
trendLabel: string;
|
|
166
|
+
/**
|
|
167
|
+
* A projected value for this KPI, shown on its own line under the number as
|
|
168
|
+
* `~1,058 in 6 mo`. `null` (the default) renders nothing, so a tile without a
|
|
169
|
+
* projection is unchanged.
|
|
170
|
+
*
|
|
171
|
+
* Supplied, never derived — same contract as the forecast-capable charts. It
|
|
172
|
+
* is formatted with the tile's own `valueFormat` / `numberSystem` and carries
|
|
173
|
+
* the tile's `prefix` / `suffix`, so `2.8%` projects as `~3.1%` rather than a
|
|
174
|
+
* bare number.
|
|
175
|
+
*/
|
|
176
|
+
forecastValue: number | null;
|
|
177
|
+
/** The horizon, e.g. `'in 6 mo'` or `'next quarter'`. Truncates before the number does. */
|
|
178
|
+
forecastLabel: string;
|
|
179
|
+
/**
|
|
180
|
+
* Prefix the projected value with `~`. On by default: the value is modelled,
|
|
181
|
+
* and an unqualified number reads as measured. Turn it off when the projection
|
|
182
|
+
* is a commitment (a plan or a target) rather than an estimate.
|
|
183
|
+
*/
|
|
184
|
+
forecastApprox: boolean;
|
|
185
|
+
/** Overrides the accent color of the forecast line. */
|
|
186
|
+
forecastColor: string;
|
|
162
187
|
/** Description shown below the value. */
|
|
163
188
|
description: string;
|
|
164
189
|
/** Sparkline data points. When provided, a Highcharts mini area chart renders below the value. */
|
|
@@ -296,6 +321,11 @@ export declare class NileKpiChart extends NileElement {
|
|
|
296
321
|
private _onTrendKeydown;
|
|
297
322
|
private _onTipLeave;
|
|
298
323
|
private renderTrend;
|
|
324
|
+
/**
|
|
325
|
+
* The projected-value line. Rendered only when `forecastValue` is set, so a
|
|
326
|
+
* tile with no projection keeps exactly the layout it had.
|
|
327
|
+
*/
|
|
328
|
+
private renderForecast;
|
|
299
329
|
render(): TemplateResult;
|
|
300
330
|
}
|
|
301
331
|
declare global {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
3
3
|
import { html, nothing } from 'lit';
|
|
4
|
-
import NileElement from '../internal/nile-element.js';
|
|
5
|
-
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
4
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
5
|
+
import { getHighcharts } from '../internal/utils/highcharts-provider.js';
|
|
6
6
|
import { styles, tooltipCss } from './nile-kpi-chart.css.js';
|
|
7
7
|
// Inject tooltip styles into document.head once per page load.
|
|
8
8
|
let _tooltipStylesInjected = false;
|
|
@@ -46,6 +46,28 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
46
46
|
this.trendDirection = 'neutral';
|
|
47
47
|
/** Trend context label (e.g. "vs last month"). */
|
|
48
48
|
this.trendLabel = '';
|
|
49
|
+
// ── Forecast ──
|
|
50
|
+
/**
|
|
51
|
+
* A projected value for this KPI, shown on its own line under the number as
|
|
52
|
+
* `~1,058 in 6 mo`. `null` (the default) renders nothing, so a tile without a
|
|
53
|
+
* projection is unchanged.
|
|
54
|
+
*
|
|
55
|
+
* Supplied, never derived — same contract as the forecast-capable charts. It
|
|
56
|
+
* is formatted with the tile's own `valueFormat` / `numberSystem` and carries
|
|
57
|
+
* the tile's `prefix` / `suffix`, so `2.8%` projects as `~3.1%` rather than a
|
|
58
|
+
* bare number.
|
|
59
|
+
*/
|
|
60
|
+
this.forecastValue = null;
|
|
61
|
+
/** The horizon, e.g. `'in 6 mo'` or `'next quarter'`. Truncates before the number does. */
|
|
62
|
+
this.forecastLabel = '';
|
|
63
|
+
/**
|
|
64
|
+
* Prefix the projected value with `~`. On by default: the value is modelled,
|
|
65
|
+
* and an unqualified number reads as measured. Turn it off when the projection
|
|
66
|
+
* is a commitment (a plan or a target) rather than an estimate.
|
|
67
|
+
*/
|
|
68
|
+
this.forecastApprox = true;
|
|
69
|
+
/** Overrides the accent color of the forecast line. */
|
|
70
|
+
this.forecastColor = '';
|
|
49
71
|
/** Description shown below the value. */
|
|
50
72
|
this.description = '';
|
|
51
73
|
/** Sparkline data points. When provided, a Highcharts mini area chart renders below the value. */
|
|
@@ -304,6 +326,7 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
304
326
|
set('--nile-kpi-description-font-size', len(this.descriptionFontSize));
|
|
305
327
|
set('--nile-kpi-prefix-suffix-color', this.prefixSuffixColor);
|
|
306
328
|
set('--nile-kpi-prefix-suffix-font-size', len(this.prefixSuffixFontSize));
|
|
329
|
+
set('--nile-kpi-forecast-color', this.forecastColor);
|
|
307
330
|
set('--nile-kpi-trend-up-color', this.trendUpColor);
|
|
308
331
|
set('--nile-kpi-trend-down-color', this.trendDownColor);
|
|
309
332
|
set('--nile-kpi-trend-neutral-color', this.trendNeutralColor);
|
|
@@ -493,6 +516,14 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
493
516
|
this.trendDirection = c.trendDirection;
|
|
494
517
|
if (c.trendLabel !== undefined)
|
|
495
518
|
this.trendLabel = c.trendLabel;
|
|
519
|
+
if (c.forecastValue !== undefined)
|
|
520
|
+
this.forecastValue = c.forecastValue;
|
|
521
|
+
if (c.forecastLabel !== undefined)
|
|
522
|
+
this.forecastLabel = c.forecastLabel;
|
|
523
|
+
if (c.forecastApprox !== undefined)
|
|
524
|
+
this.forecastApprox = c.forecastApprox;
|
|
525
|
+
if (c.forecastColor !== undefined)
|
|
526
|
+
this.forecastColor = c.forecastColor;
|
|
496
527
|
if (c.description !== undefined)
|
|
497
528
|
this.description = c.description;
|
|
498
529
|
if (c.sparkline !== undefined)
|
|
@@ -673,7 +704,7 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
673
704
|
const cssVarProps = ['accentColor', 'cardBackground', 'cardBorderColor', 'cardBorderWidth', 'cardBorderRadius',
|
|
674
705
|
'cardShadow', 'cardShadowHover', 'cardPaddingVertical', 'cardPaddingHorizontal', 'contentGap',
|
|
675
706
|
'labelColor', 'labelFontSize', 'labelFontWeight', 'descriptionColor', 'descriptionFontSize',
|
|
676
|
-
'prefixSuffixColor', 'prefixSuffixFontSize', 'trendUpColor', 'trendDownColor', 'trendNeutralColor',
|
|
707
|
+
'prefixSuffixColor', 'prefixSuffixFontSize', 'trendUpColor', 'trendDownColor', 'trendNeutralColor', 'forecastColor',
|
|
677
708
|
'valueColor', 'valueFontSize'];
|
|
678
709
|
if (cssVarProps.some(p => changedProperties.has(p))) {
|
|
679
710
|
this._syncCssVars();
|
|
@@ -1048,6 +1079,31 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
1048
1079
|
</span>
|
|
1049
1080
|
`;
|
|
1050
1081
|
}
|
|
1082
|
+
/**
|
|
1083
|
+
* The projected-value line. Rendered only when `forecastValue` is set, so a
|
|
1084
|
+
* tile with no projection keeps exactly the layout it had.
|
|
1085
|
+
*/
|
|
1086
|
+
renderForecast() {
|
|
1087
|
+
if (this.forecastValue === null || this.forecastValue === undefined)
|
|
1088
|
+
return nothing;
|
|
1089
|
+
const fmt = this.formatValue(this.forecastValue);
|
|
1090
|
+
const shown = fmt ? fmt.display : String(this.forecastValue);
|
|
1091
|
+
const approx = this.forecastApprox ? '~' : '';
|
|
1092
|
+
// The full (unabbreviated) number goes in the aria label, since `display`
|
|
1093
|
+
// may be a 1.1M-style abbreviation a screen reader would read badly.
|
|
1094
|
+
const spoken = `Forecast ${approx ? 'approximately ' : ''}${this.prefix ?? ''}${fmt ? fmt.full : shown}${this.suffix ?? ''}`
|
|
1095
|
+
+ (this.forecastLabel ? ` ${this.forecastLabel}` : '');
|
|
1096
|
+
return html `
|
|
1097
|
+
<p class="kpi-forecast" part="forecast" aria-label=${spoken}>
|
|
1098
|
+
<span class="kpi-forecast-glyph" aria-hidden="true">
|
|
1099
|
+
<svg viewBox="0 0 12 12"><path d="M6 0l1.1 3.4L10.5 4.5 7.1 5.6 6 9 4.9 5.6 1.5 4.5 4.9 3.4z"/></svg>
|
|
1100
|
+
</span>
|
|
1101
|
+
<span class="kpi-forecast-value"
|
|
1102
|
+
>${approx}${this.prefix ? html `<span class="kpi-prefix">${this.prefix}</span>` : nothing}${shown}${this.suffix ? html `<span class="kpi-suffix">${this.suffix}</span>` : nothing}</span
|
|
1103
|
+
>${this.forecastLabel ? html `<span class="kpi-forecast-label">${this.forecastLabel}</span>` : nothing}
|
|
1104
|
+
</p>
|
|
1105
|
+
`;
|
|
1106
|
+
}
|
|
1051
1107
|
render() {
|
|
1052
1108
|
if (this.loading) {
|
|
1053
1109
|
return html `<div class="chart-loading">${this.loadingText}</div>`;
|
|
@@ -1104,6 +1160,8 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
1104
1160
|
|
|
1105
1161
|
${isGauge ? this.renderTrend() : nothing}
|
|
1106
1162
|
|
|
1163
|
+
${this.renderForecast()}
|
|
1164
|
+
|
|
1107
1165
|
${this.description ? html `<p
|
|
1108
1166
|
class="kpi-description"
|
|
1109
1167
|
tabindex="0"
|
|
@@ -1156,6 +1214,18 @@ __decorate([
|
|
|
1156
1214
|
__decorate([
|
|
1157
1215
|
property({ type: String, attribute: 'trend-label' })
|
|
1158
1216
|
], NileKpiChart.prototype, "trendLabel", void 0);
|
|
1217
|
+
__decorate([
|
|
1218
|
+
property({ type: Number, attribute: 'forecast-value' })
|
|
1219
|
+
], NileKpiChart.prototype, "forecastValue", void 0);
|
|
1220
|
+
__decorate([
|
|
1221
|
+
property({ type: String, attribute: 'forecast-label' })
|
|
1222
|
+
], NileKpiChart.prototype, "forecastLabel", void 0);
|
|
1223
|
+
__decorate([
|
|
1224
|
+
property({ type: Boolean, attribute: 'forecast-approx' })
|
|
1225
|
+
], NileKpiChart.prototype, "forecastApprox", void 0);
|
|
1226
|
+
__decorate([
|
|
1227
|
+
property({ type: String, attribute: 'forecast-color' })
|
|
1228
|
+
], NileKpiChart.prototype, "forecastColor", void 0);
|
|
1159
1229
|
__decorate([
|
|
1160
1230
|
property({ type: String })
|
|
1161
1231
|
], NileKpiChart.prototype, "description", void 0);
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import type Highcharts from 'highcharts';
|
|
3
|
-
import
|
|
4
|
-
import type {
|
|
3
|
+
import NileForecastableChart from '../internal/base/forecastable-chart.js';
|
|
4
|
+
import type { ForecastSeriesInput } from '../internal/utils/chart-forecast.js';
|
|
5
|
+
import type { LegendConfig, NileChartConfigInputType } from '../internal/types/index.js';
|
|
5
6
|
export interface LineChartSeriesData {
|
|
6
7
|
name: string;
|
|
7
8
|
data: number[];
|
|
8
9
|
color?: string;
|
|
9
10
|
}
|
|
10
|
-
export declare class NileLineChart extends
|
|
11
|
+
export declare class NileLineChart extends NileForecastableChart {
|
|
12
|
+
/** The series type every entry in `data` defaults to. */
|
|
13
|
+
protected chartSeriesType: "line";
|
|
11
14
|
static styles: CSSResultGroup;
|
|
12
15
|
private _hc;
|
|
13
|
-
private chart;
|
|
14
16
|
private resizeObserver;
|
|
15
17
|
private chartContainer;
|
|
16
18
|
/** Full chart configuration. Accepts separated { chart, aq } input. */
|
|
17
19
|
config: NileChartConfigInputType | null;
|
|
18
20
|
chartTitle: string;
|
|
19
21
|
chartSubtitle: string;
|
|
20
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Series. Plain `{ name, data }` entries, or — with `enableForecasting` —
|
|
24
|
+
* forecast entries carrying `actual` / `projected` / `interval`.
|
|
25
|
+
*/
|
|
26
|
+
data: Array<LineChartSeriesData | ForecastSeriesInput>;
|
|
21
27
|
categories: string[];
|
|
22
28
|
options: Highcharts.Options;
|
|
23
29
|
noResponsive: boolean;
|
|
@@ -26,7 +32,7 @@ export declare class NileLineChart extends NileElement {
|
|
|
26
32
|
yAxisTitle: string;
|
|
27
33
|
showLegend: boolean;
|
|
28
34
|
/** Full legend configuration — all Highcharts legend options in one object. */
|
|
29
|
-
legend:
|
|
35
|
+
legend: LegendConfig | null;
|
|
30
36
|
chartBg: string;
|
|
31
37
|
chartBorderRadius: string | number;
|
|
32
38
|
chartBorder: string;
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
3
3
|
import { html } from 'lit';
|
|
4
|
-
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
5
|
-
import
|
|
6
|
-
import { deepMerge } from '../internal/utils.js';
|
|
7
|
-
import {
|
|
4
|
+
import { getHighcharts } from '../internal/utils/highcharts-provider.js';
|
|
5
|
+
import NileForecastableChart from '../internal/base/forecastable-chart.js';
|
|
6
|
+
import { deepMerge } from '../internal/utils/deep-merge.js';
|
|
7
|
+
import { normalizeChartConfig } from '../internal/utils/separated-chart-config.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/utils/responsive-defaults.js';
|
|
8
9
|
import { styles } from './nile-line-chart.css.js';
|
|
9
|
-
let NileLineChart = class NileLineChart extends
|
|
10
|
+
let NileLineChart = class NileLineChart extends NileForecastableChart {
|
|
10
11
|
constructor() {
|
|
11
12
|
super(...arguments);
|
|
13
|
+
/** The series type every entry in `data` defaults to. */
|
|
14
|
+
this.chartSeriesType = 'line';
|
|
12
15
|
this._hc = null;
|
|
13
|
-
this.chart = null;
|
|
14
16
|
this.resizeObserver = null;
|
|
15
17
|
/** Full chart configuration. Accepts separated { chart, aq } input. */
|
|
16
18
|
this.config = null;
|
|
17
19
|
this.chartTitle = '';
|
|
18
20
|
this.chartSubtitle = '';
|
|
21
|
+
/**
|
|
22
|
+
* Series. Plain `{ name, data }` entries, or — with `enableForecasting` —
|
|
23
|
+
* forecast entries carrying `actual` / `projected` / `interval`.
|
|
24
|
+
*/
|
|
19
25
|
this.data = [];
|
|
20
26
|
this.categories = [];
|
|
21
27
|
this.options = {};
|
|
@@ -63,7 +69,9 @@ let NileLineChart = class NileLineChart extends NileElement {
|
|
|
63
69
|
}
|
|
64
70
|
/** Apply { chart, aq } config to individual properties. */
|
|
65
71
|
applyConfig(cfg) {
|
|
66
|
-
|
|
72
|
+
// Accepts the flat `<nile-chart>` shape as well as `{ chart, aq }` —
|
|
73
|
+
// the flat form used to render nothing at all, silently.
|
|
74
|
+
const { chart: c, aq } = normalizeChartConfig(cfg);
|
|
67
75
|
if (c) {
|
|
68
76
|
const line = c;
|
|
69
77
|
if (line.data)
|
|
@@ -72,6 +80,7 @@ let NileLineChart = class NileLineChart extends NileElement {
|
|
|
72
80
|
this.categories = line.categories;
|
|
73
81
|
if (line.yAxisTitle)
|
|
74
82
|
this.yAxisTitle = line.yAxisTitle;
|
|
83
|
+
this.applyForecastableConfig(line);
|
|
75
84
|
if (line.height)
|
|
76
85
|
this.height = line.height;
|
|
77
86
|
if (line.loading !== undefined)
|
|
@@ -127,7 +136,7 @@ let NileLineChart = class NileLineChart extends NileElement {
|
|
|
127
136
|
this.applyConfig(this.config);
|
|
128
137
|
return;
|
|
129
138
|
}
|
|
130
|
-
const props = ['data', 'categories', 'chartTitle', 'chartSubtitle', 'options', 'height', 'yAxisTitle', 'loading', 'showLegend'];
|
|
139
|
+
const props = ['data', 'categories', 'chartTitle', 'chartSubtitle', 'options', 'height', 'yAxisTitle', 'loading', 'showLegend', ...NileForecastableChart.FORECASTABLE_PROPS];
|
|
131
140
|
const cssVarProps = ['chartBg', 'chartBorderRadius', 'chartBorder', 'chartShadow', 'chartPadding', 'chartMinHeight',
|
|
132
141
|
'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
|
|
133
142
|
if (cssVarProps.some(p => changedProperties.has(p)))
|
|
@@ -138,12 +147,11 @@ let NileLineChart = class NileLineChart extends NileElement {
|
|
|
138
147
|
this.destroyChart();
|
|
139
148
|
return;
|
|
140
149
|
}
|
|
141
|
-
if (this.chart) {
|
|
142
|
-
this.chart.update(this.buildOptions(), true, true);
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
150
|
+
if (!this.chart) {
|
|
145
151
|
this.initChart();
|
|
152
|
+
return;
|
|
146
153
|
}
|
|
154
|
+
this.updateChart(this.chart, changedProperties, r => this.buildOptions(r));
|
|
147
155
|
}
|
|
148
156
|
setupResizeObserver() {
|
|
149
157
|
if (!this.chartContainer)
|
|
@@ -151,17 +159,28 @@ let NileLineChart = class NileLineChart extends NileElement {
|
|
|
151
159
|
this.resizeObserver = new ResizeObserver(() => { this.chart?.reflow(); });
|
|
152
160
|
this.resizeObserver.observe(this.chartContainer);
|
|
153
161
|
}
|
|
154
|
-
buildOptions() {
|
|
162
|
+
buildOptions(retract = false) {
|
|
155
163
|
const self = this;
|
|
164
|
+
// Always non-null: with no projection the overlay's empty arrays are what
|
|
165
|
+
// clear a previous one, since `chart.update()` leaves an omitted key in place.
|
|
166
|
+
const overlay = this.forecastOverlay(retract);
|
|
156
167
|
const merged = deepMerge({
|
|
157
|
-
chart: {
|
|
168
|
+
chart: {
|
|
169
|
+
type: this.chartSeriesType,
|
|
170
|
+
...(this.height ? { height: this.height } : {}),
|
|
171
|
+
},
|
|
158
172
|
title: { text: this.chartTitle || undefined },
|
|
159
173
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
160
|
-
xAxis: {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
174
|
+
xAxis: {
|
|
175
|
+
categories: this.categories,
|
|
176
|
+
title: { text: this.xAxisTitle || undefined },
|
|
177
|
+
plotLines: overlay.plotLines,
|
|
178
|
+
plotBands: overlay.plotBands,
|
|
179
|
+
},
|
|
180
|
+
yAxis: this.forecastYAxis({ title: { text: this.yAxisTitle || undefined } }, overlay.hasSecondaryAxis),
|
|
181
|
+
tooltip: { shared: true, ...overlay.tooltip },
|
|
182
|
+
plotOptions: { series: { cursor: 'pointer', point: { events: { click() { self.emit('nile-chart-click', { point: this, category: this.category, value: this.y, seriesName: this.series.name, forecast: self.isForecastPoint(this.x, overlay.boundary) }); } } } } },
|
|
183
|
+
series: this.forecastSeries(overlay),
|
|
165
184
|
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
166
185
|
credits: { enabled: false },
|
|
167
186
|
}, this.options);
|
|
@@ -172,12 +191,13 @@ let NileLineChart = class NileLineChart extends NileElement {
|
|
|
172
191
|
return;
|
|
173
192
|
if (!this._hc)
|
|
174
193
|
this._hc = await getHighcharts();
|
|
175
|
-
this.
|
|
176
|
-
this.
|
|
194
|
+
this._chart = this._hc.chart(this.chartContainer, this.buildOptions());
|
|
195
|
+
this._notifyChartReady();
|
|
196
|
+
this.emit('nile-chart-ready', { chart: this._chart });
|
|
177
197
|
}
|
|
178
|
-
destroyChart() { if (this.
|
|
179
|
-
this.
|
|
180
|
-
this.
|
|
198
|
+
destroyChart() { if (this._chart) {
|
|
199
|
+
this._chart.destroy();
|
|
200
|
+
this._clearChart();
|
|
181
201
|
} }
|
|
182
202
|
render() {
|
|
183
203
|
if (this.loading)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import type Highcharts from 'highcharts';
|
|
3
|
-
import NileElement from '../internal/nile-element.js';
|
|
3
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
4
4
|
import type { SeparatedChartConfigInputType } from '../internal/types/separated-chart-config-input.type.js';
|
|
5
5
|
import type { LegendConfig } from '../internal/types/index.js';
|
|
6
6
|
export interface LineColumnSeriesPart {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
3
3
|
import { html } from 'lit';
|
|
4
|
-
import { getHighcharts } from '../internal/highcharts-provider.js';
|
|
5
|
-
import NileElement from '../internal/nile-element.js';
|
|
6
|
-
import { applySeparatedChartConfig } from '../internal/separated-chart-config.js';
|
|
7
|
-
import { deepMerge } from '../internal/utils.js';
|
|
8
|
-
import { withResponsiveDefaults } from '../internal/responsive-defaults.js';
|
|
4
|
+
import { getHighcharts } from '../internal/utils/highcharts-provider.js';
|
|
5
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
6
|
+
import { applySeparatedChartConfig } from '../internal/utils/separated-chart-config.js';
|
|
7
|
+
import { deepMerge } from '../internal/utils/deep-merge.js';
|
|
8
|
+
import { withResponsiveDefaults } from '../internal/utils/responsive-defaults.js';
|
|
9
9
|
import { styles } from './nile-line-column-chart.css.js';
|
|
10
10
|
let NileLineColumnChart = class NileLineColumnChart extends NileElement {
|
|
11
11
|
constructor() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
2
|
import type Highcharts from 'highcharts';
|
|
3
|
-
import NileElement from '../internal/nile-element.js';
|
|
3
|
+
import NileElement from '../internal/base/nile-element.js';
|
|
4
4
|
import type { SeparatedChartConfigInputType } from '../internal/types/separated-chart-config-input.type.js';
|
|
5
5
|
import type { LegendConfig } from '../internal/types/index.js';
|
|
6
6
|
export interface LollipopSeriesData {
|