@aquera/nile-visualization 2.9.29 → 2.9.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/README.md +15 -0
  2. package/dist/src/index.d.ts +6 -5
  3. package/dist/src/index.js +2 -2
  4. package/dist/src/internal/base/forecastable-chart.d.ts +59 -0
  5. package/dist/src/internal/base/forecastable-chart.js +149 -0
  6. package/dist/src/internal/{nile-chart-base.d.ts → base/nile-chart-base.d.ts} +1 -1
  7. package/dist/src/internal/{nile-chart-base.js → base/nile-chart-base.js} +1 -1
  8. package/dist/src/internal/types/chart-area-config.type.d.ts +4 -2
  9. package/dist/src/internal/types/chart-area-spline-config.type.d.ts +4 -2
  10. package/dist/src/internal/types/chart-column-config.type.d.ts +3 -2
  11. package/dist/src/internal/types/chart-line-config.type.d.ts +3 -2
  12. package/dist/src/internal/types/chart-spline-config.type.d.ts +3 -2
  13. package/dist/src/internal/{chart-adapters.d.ts → utils/chart-adapters.d.ts} +1 -1
  14. package/dist/src/internal/{chart-adapters.js → utils/chart-adapters.js} +15 -3
  15. package/dist/src/internal/utils/chart-forecast.d.ts +126 -0
  16. package/dist/src/internal/utils/chart-forecast.js +297 -0
  17. package/dist/src/internal/{dashboard-adapters.d.ts → utils/dashboard-adapters.d.ts} +1 -1
  18. package/dist/src/internal/{utils.js → utils/deep-merge.js} +1 -1
  19. package/dist/src/internal/{resolve-widget-kind.d.ts → utils/resolve-widget-kind.d.ts} +1 -1
  20. package/dist/src/internal/utils/separated-chart-config.d.ts +13 -0
  21. package/dist/src/internal/utils/separated-chart-config.js +30 -0
  22. package/dist/src/nile-ai-panel/nile-ai-panel.d.ts +1 -1
  23. package/dist/src/nile-ai-panel/nile-ai-panel.js +1 -1
  24. package/dist/src/nile-ai-sender/nile-ai-sender.d.ts +1 -1
  25. package/dist/src/nile-ai-sender/nile-ai-sender.js +1 -1
  26. package/dist/src/nile-anomaly-chart/nile-anomaly-chart.d.ts +1 -1
  27. package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +4 -4
  28. package/dist/src/nile-area-chart/nile-area-chart.d.ts +7 -6
  29. package/dist/src/nile-area-chart/nile-area-chart.js +37 -24
  30. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.d.ts +1 -1
  31. package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +5 -5
  32. package/dist/src/nile-area-range-chart/nile-area-range-chart.d.ts +1 -1
  33. package/dist/src/nile-area-range-chart/nile-area-range-chart.js +5 -5
  34. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.d.ts +10 -4
  35. package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +38 -27
  36. package/dist/src/nile-bar-chart/nile-bar-chart.d.ts +3 -3
  37. package/dist/src/nile-bar-chart/nile-bar-chart.js +4 -4
  38. package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.d.ts +3 -2
  39. package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +5 -5
  40. package/dist/src/nile-boxplot-chart/nile-boxplot-chart.d.ts +3 -2
  41. package/dist/src/nile-boxplot-chart/nile-boxplot-chart.js +5 -5
  42. package/dist/src/nile-bubble-chart/nile-bubble-chart.d.ts +3 -3
  43. package/dist/src/nile-bubble-chart/nile-bubble-chart.js +4 -4
  44. package/dist/src/nile-chart/index.d.ts +1 -1
  45. package/dist/src/nile-chart/index.js +1 -1
  46. package/dist/src/nile-chart/nile-chart-config.d.ts +20 -92
  47. package/dist/src/nile-chart/nile-chart-skeleton.js +1 -1
  48. package/dist/src/nile-chart/nile-chart.css.js +0 -1
  49. package/dist/src/nile-chart/nile-chart.d.ts +5 -2
  50. package/dist/src/nile-chart/nile-chart.js +66 -9
  51. package/dist/src/nile-chart-list/nile-chart-list.d.ts +1 -1
  52. package/dist/src/nile-chart-list/nile-chart-list.js +1 -1
  53. package/dist/src/nile-chart-message/nile-chart-message.d.ts +1 -1
  54. package/dist/src/nile-chart-message/nile-chart-message.js +1 -1
  55. package/dist/src/nile-cluster-chart/nile-cluster-chart.d.ts +3 -2
  56. package/dist/src/nile-cluster-chart/nile-cluster-chart.js +5 -5
  57. package/dist/src/nile-column-chart/nile-column-chart.d.ts +13 -6
  58. package/dist/src/nile-column-chart/nile-column-chart.js +43 -24
  59. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.d.ts +1 -1
  60. package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +5 -5
  61. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.d.ts +1 -1
  62. package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +5 -5
  63. package/dist/src/nile-column-range-chart/nile-column-range-chart.d.ts +1 -1
  64. package/dist/src/nile-column-range-chart/nile-column-range-chart.js +5 -5
  65. package/dist/src/nile-dashboard-builder/nile-dashboard-builder.d.ts +1 -1
  66. package/dist/src/nile-dashboard-builder/nile-dashboard-builder.js +2 -2
  67. package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.d.ts +1 -1
  68. package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.js +1 -1
  69. package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +3 -3
  70. package/dist/src/nile-donut-chart/nile-donut-chart.js +4 -4
  71. package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.d.ts +1 -1
  72. package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.js +5 -5
  73. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.d.ts +1 -1
  74. package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +5 -5
  75. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.d.ts +1 -1
  76. package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +5 -5
  77. package/dist/src/nile-euler-chart/nile-euler-chart.d.ts +1 -1
  78. package/dist/src/nile-euler-chart/nile-euler-chart.js +5 -5
  79. package/dist/src/nile-executive-summary/nile-executive-summary.d.ts +1 -1
  80. package/dist/src/nile-executive-summary/nile-executive-summary.js +1 -1
  81. package/dist/src/nile-fan-chart/nile-fan-chart.d.ts +1 -1
  82. package/dist/src/nile-fan-chart/nile-fan-chart.js +5 -5
  83. package/dist/src/nile-filter-chart/nile-filter-chart.d.ts +3 -1
  84. package/dist/src/nile-filter-chart/nile-filter-chart.js +15 -1
  85. package/dist/src/nile-filter-chart/utils/prompt.js +31 -6
  86. package/dist/src/nile-filter-chart/utils/types.d.ts +2 -0
  87. package/dist/src/nile-flame-chart/nile-flame-chart.d.ts +1 -1
  88. package/dist/src/nile-flame-chart/nile-flame-chart.js +5 -5
  89. package/dist/src/nile-funnel-chart/nile-funnel-chart.d.ts +1 -1
  90. package/dist/src/nile-funnel-chart/nile-funnel-chart.js +5 -5
  91. package/dist/src/nile-gauge-chart/nile-gauge-chart.d.ts +1 -1
  92. package/dist/src/nile-gauge-chart/nile-gauge-chart.js +4 -4
  93. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +3 -2
  94. package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +5 -5
  95. package/dist/src/nile-histogram-chart/nile-histogram-chart.d.ts +3 -2
  96. package/dist/src/nile-histogram-chart/nile-histogram-chart.js +5 -5
  97. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.d.ts +1 -1
  98. package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +5 -5
  99. package/dist/src/nile-kpi-chart/nile-kpi-chart.css.js +41 -0
  100. package/dist/src/nile-kpi-chart/nile-kpi-chart.d.ts +31 -1
  101. package/dist/src/nile-kpi-chart/nile-kpi-chart.js +73 -3
  102. package/dist/src/nile-line-chart/nile-line-chart.d.ts +12 -6
  103. package/dist/src/nile-line-chart/nile-line-chart.js +44 -24
  104. package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +1 -1
  105. package/dist/src/nile-line-column-chart/nile-line-column-chart.js +5 -5
  106. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.d.ts +1 -1
  107. package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +5 -5
  108. package/dist/src/nile-map-chart/nile-map-chart.d.ts +2 -2
  109. package/dist/src/nile-map-chart/nile-map-chart.js +4 -4
  110. package/dist/src/nile-master-detail-chart/nile-master-detail-chart.d.ts +1 -1
  111. package/dist/src/nile-master-detail-chart/nile-master-detail-chart.js +5 -5
  112. package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +1 -1
  113. package/dist/src/nile-organization-chart/nile-organization-chart.js +5 -5
  114. package/dist/src/nile-pie-chart/nile-pie-chart.d.ts +1 -1
  115. package/dist/src/nile-pie-chart/nile-pie-chart.js +4 -4
  116. package/dist/src/nile-polygon-chart/nile-polygon-chart.d.ts +1 -1
  117. package/dist/src/nile-polygon-chart/nile-polygon-chart.js +5 -5
  118. package/dist/src/nile-radar-chart/nile-radar-chart.d.ts +3 -3
  119. package/dist/src/nile-radar-chart/nile-radar-chart.js +4 -4
  120. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.d.ts +3 -2
  121. package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +5 -5
  122. package/dist/src/nile-scatter-chart/nile-scatter-chart.d.ts +3 -3
  123. package/dist/src/nile-scatter-chart/nile-scatter-chart.js +4 -4
  124. package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.d.ts +3 -2
  125. package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.js +5 -5
  126. package/dist/src/nile-spline-chart/nile-spline-chart.d.ts +8 -6
  127. package/dist/src/nile-spline-chart/nile-spline-chart.js +36 -24
  128. package/dist/src/nile-stacked-chart/nile-stacked-chart.d.ts +3 -2
  129. package/dist/src/nile-stacked-chart/nile-stacked-chart.js +5 -5
  130. package/dist/src/nile-timeline-chart/nile-timeline-chart.d.ts +1 -1
  131. package/dist/src/nile-timeline-chart/nile-timeline-chart.js +5 -5
  132. package/dist/src/nile-trendline-chart/nile-trendline-chart.d.ts +1 -1
  133. package/dist/src/nile-trendline-chart/nile-trendline-chart.js +4 -4
  134. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.d.ts +3 -2
  135. package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +5 -5
  136. package/dist/src/nile-vector-chart/nile-vector-chart.d.ts +1 -1
  137. package/dist/src/nile-vector-chart/nile-vector-chart.js +5 -5
  138. package/dist/src/nile-waterfall-chart/nile-waterfall-chart.d.ts +3 -3
  139. package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +4 -4
  140. package/dist/src/nile-widget-viewer/nile-widget-viewer.css.js +6 -2
  141. package/dist/src/nile-widget-viewer/nile-widget-viewer.d.ts +1 -1
  142. package/dist/src/nile-widget-viewer/nile-widget-viewer.js +2 -2
  143. package/dist/src/nile-xrange-chart/nile-xrange-chart.d.ts +3 -2
  144. package/dist/src/nile-xrange-chart/nile-xrange-chart.js +5 -5
  145. package/package.json +1 -1
  146. package/dist/src/internal/separated-chart-config.d.ts +0 -5
  147. package/dist/src/internal/separated-chart-config.js +0 -16
  148. /package/dist/src/internal/{nile-element.d.ts → base/nile-element.d.ts} +0 -0
  149. /package/dist/src/internal/{nile-element.js → base/nile-element.js} +0 -0
  150. /package/dist/src/internal/{chart-events.d.ts → utils/chart-events.d.ts} +0 -0
  151. /package/dist/src/internal/{chart-events.js → utils/chart-events.js} +0 -0
  152. /package/dist/src/internal/{chart-runtime.d.ts → utils/chart-runtime.d.ts} +0 -0
  153. /package/dist/src/internal/{chart-runtime.js → utils/chart-runtime.js} +0 -0
  154. /package/dist/src/internal/{dashboard-adapters.js → utils/dashboard-adapters.js} +0 -0
  155. /package/dist/src/internal/{utils.d.ts → utils/deep-merge.d.ts} +0 -0
  156. /package/dist/src/internal/{highcharts-provider.d.ts → utils/highcharts-provider.d.ts} +0 -0
  157. /package/dist/src/internal/{highcharts-provider.js → utils/highcharts-provider.js} +0 -0
  158. /package/dist/src/internal/{resolve-widget-kind.js → utils/resolve-widget-kind.js} +0 -0
  159. /package/dist/src/internal/{responsive-defaults.d.ts → utils/responsive-defaults.d.ts} +0 -0
  160. /package/dist/src/internal/{responsive-defaults.js → utils/responsive-defaults.js} +0 -0
package/README.md CHANGED
@@ -36,6 +36,21 @@ To run a local development server that serves the basic demo located in `demo/in
36
36
 
37
37
  In this section, you can find the updates for each release of `nile-visualization`. It's a good practice to maintain detailed release notes to help users and developers understand what changes have been made from one version to another and how these changes might affect their projects.
38
38
 
39
+ #### Version 2.9.31 (August 3, 2026)
40
+ - Nile Charts: **Forecasting moved off the dedicated chart type and onto the ordinary ones.** `<nile-line-chart>`, `<nile-spline-chart>`, `<nile-area-chart>`, `<nile-area-spline-chart>` and `<nile-column-chart>` (and the matching `<nile-chart type="line" | "spline" | "area" | "areaSpline" | "column">`) each take `enableForecasting`, a `projection` config, and series shaped `{ actual, projected, interval }` — all five delegate to one shared util, `internal/chart-forecast.ts`, so the boundary marker, the dashed span, the tinted region and the confidence band are derived identically. Everything is index based: `actual` lines up with the leading `categories` and `projected` continues from where it stops. `projection` carries `start`, `color`, `dashStyle`, `showNowLine`, `nowLabel`, `nowLineColor`, `bandLabel`, `bandColor` and an `interval` block (`name`, `color`, `opacity`, `level`, `label`); per-series `forecastColor`, `forecastDashStyle`, `intervalName`, `intervalColor`, `intervalOpacity`, `intervalLevel` and `intervalLabel` override it. Confidence bands render as an `arearange` pinned to the boundary so the cone opens out of the last measured point, appended after the real series and painted underneath by `zIndex` (so a `chart.update()` that drops a band can't leak its `lineWidth: 0` onto the line), non-interactive with its bounds reaching the tooltip through a `pointFormatter` (`80% CI: 491 – 499`). Columns get no band and no dash — `projection.color` is their only cue, and their whole split (marker, plot band and zone) sits half a category later, since Highcharts assigns a discrete point at exactly the zone value to the next zone and would otherwise recolor the last measured column. `nile-chart-click` now reports `forecast: boolean` on these five charts, and `xAxisTitle` was added to all of them. Turning `enableForecasting` off plots `actual` only — the projection is dropped, not folded into the line — and clears the overlay with it. Gaining or losing a projection animates in both directions: `chart.update()` is passed `FORECAST_UPDATE_ANIMATION`, and because Highcharts morphs a graph path only when the point count is unchanged, the exit runs in two phases (`animateForecastExit`) — the projected values are first pinned to the boundary so the line folds back and the confidence cone closes, then the measured-only series replaces it. A series can take `axis: 'secondary'` to sit on an opposite y-axis (`secondaryAxisTitle`, `secondaryAxisMin`), which is only emitted when some series asks for it, and per-series `type` mixes shapes in one chart — a `column` series inside a `spline` chart keeps column behaviour. Documented in `src/internal/chart-forecast.md`; demo at `demo/forecast.html`, and a migration reference in the same doc (UIF-1316)
41
+ - Nile Forecast Chart: **Removed** `<nile-forecast-chart>`, `<nile-chart type="forecast">`, the `./nile-forecast-chart` package subpath, and the `NileForecastChartConfig` / `ChartForecastConfigType` / `ForecastSeriesData` / `ForecastPoint` types. Use `enableForecasting` on the chart type you actually want; the exported forecast types are now `ForecastSeriesInput`, `ForecastIntervalRange`, `ForecastIntervalConfig`, `ForecastProjectionConfig` and `ForecastConfigFields`. The datetime-axis form is gone — label your categories instead. Converting a forecast `column` config to `bar`, `stacked` or `pie` flattens the projection into the series, since those types can't draw one (UIF-1316)
42
+
43
+ - Nile KPI Chart: Added a projected-value line under the number — `forecastValue` with `forecastLabel` renders as `✦ ~1,058 in 6 mo`, accent-colored and sparkle-marked so a projection can't be mistaken for an actual. It is formatted with the tile's own `valueFormat` / `numberSystem` and carries its `prefix` / `suffix`, so `2.8%` projects as `~3.1%`; `forecastApprox` (default `true`) controls the `~` and `forecastColor` / `--nile-kpi-forecast-color` the accent. `forecastValue: null` (the default) renders nothing, so tiles without a projection are unchanged, and the aria label speaks the unabbreviated number. Exposed as `part="forecast"` and reachable through `<nile-chart type="kpi">`. The sparkline itself is deliberately not forecast-capable — at 48px with a hidden axis there is no room for a boundary marker or confidence band, and the KPI hand-rolls its own sparkline tooltip (UIF-1316)
44
+ - Nile Chart: The forecast boundary label now renders as a dark pill inside the plot instead of loose grey axis text, which was easy to miss and easy to read as an axis tick; it uses `useHTML` (plot-line labels are SVG text with no background box) and sets `pointer-events: none` so it never steals a hover from the series beneath it (UIF-1316)
45
+
46
+ - Nile Charts: A primitive `<nile-*-chart>` now accepts the flat `config` shape that `<nile-chart>` takes, not just the separated `{ chart, aq }` form. Previously the flat form rendered nothing at all and reported nothing — `applyConfig` read `cfg.chart`, got `undefined` and returned — so a config copied from a `<nile-chart>` example silently produced an empty chart. A flat config is unmistakable (`type`/`data` at the top level, no `chart` key), so `normalizeChartConfig` treats it as the chart slice and lifts `chartTitle` / `chartSubtitle` into `aq`. Wired into `nile-line-chart`, `nile-spline-chart`, `nile-area-chart`, `nile-column-chart` and (via `applySeparatedChartConfig`) `nile-area-spline-chart`. `<nile-chart>` already accepted the separated form, so both element kinds now take both shapes and a config can move between them unchanged; the separated form remains the one to prefer, since it keeps header metadata in `aq` separate from the plot config (UIF-1316)
47
+
48
+ - Nile Widget Viewer: Removed display of kpi-chart as block, so that it doesn't render as broken. (UIF-1310)
49
+
50
+ #### Version 2.9.30 (July 28, 2026)
51
+ - Nile Forecast Chart: Added the `forecast` chart type (`<nile-forecast-chart>`) — a datetime series split into a measured half and a projected half. Pass measured series in `data` and projected series in `forecastData` (paired by series `name`), or put the whole timeline in `data` and mark the split with `forecastStart`; with no projection it renders as an ordinary time-series chart, so a chart can gain its forecast later without re-mounting. The projected half is dashed (`forecastDashStyle`, default `Dot`) or, for `column` series, recolored via `forecastColor`, with a labeled boundary marker (`showNowLine`, `nowLabel`, `nowLineColor`) and an optional tinted region (`forecastBandLabel`, `forecastBandColor`). Series support `type` (`line` | `spline` | `area` | `areaspline` | `column`), a secondary y-axis via `axis: 'secondary'` (`secondaryAxisTitle`, `secondaryAxisMin`), `valueSuffix`, `showMarkers`, `lineWidth`, and `fillOpacity`. Set `timezone` (IANA) to align the datetime axis with the boundary. Emits `nile-chart-ready`, `nile-chart-click` (`{ point, x, value, seriesName, forecast }`) and `nile-chart-selection`; exposes `setForecast()`, `clearForecast()`, and `resetZoom()` (UIF-1316)
52
+ - Nile Chart: Drag-to-zoom on the forecast chart (`zoom`, default `true`) uses the header reset-zoom control rather than Highcharts' in-plot reset button — the chart intercepts the selection, applies the extremes itself, and reports `nile-chart-selection`; the header button now serves both `master-detail` and `forecast` (UIF-1316)
53
+
39
54
  #### Version 2.9.29 (July 27, 2026)
40
55
  - Nile Dashboard Builder: Update on Nile Dashboard Builder (UIF-1315)
41
56
  - Nile Chart: Added Responsiveness, APIs and Events to Nile Chart (UIF-1313) (UIF-1312) (UIF-1314)
@@ -1,5 +1,5 @@
1
- export { NileChartEvents } from './internal/chart-events.js';
2
- export type { NileChartEventName } from './internal/chart-events.js';
1
+ export { NileChartEvents } from './internal/utils/chart-events.js';
2
+ export type { NileChartEventName } from './internal/utils/chart-events.js';
3
3
  export { NileBarChart } from './nile-bar-chart/index.js';
4
4
  export type { BarChartSeriesData } from './nile-bar-chart/index.js';
5
5
  export { NilePieChart } from './nile-pie-chart/index.js';
@@ -16,7 +16,7 @@ export type { NileChartConfig, NileBarChartConfig, NilePieChartConfig, NileTrend
16
16
  export { convertConfig, registerAdapter } from './nile-chart/index.js';
17
17
  export { nileChartConfig } from './nile-chart/index.js';
18
18
  export type { AiConfigType, SwitchableConfigType, AqConfigType, ChartBarConfigType, ChartPieConfigType, ChartTrendlineConfigType, ChartAnomalyConfigType, ChartLineConfigType, ChartAreaConfigType, ChartInvertedAreaConfigType, ChartColumnConfigType, ChartDonutConfigType, ChartScatterConfigType, ChartBubbleConfigType, ChartSplineConfigType, ChartRadarConfigType, ChartGaugeConfigType, ChartWaterfallConfigType, ChartClusterConfigType, ChartStackedConfigType, ChartHistogramConfigType, ChartBellcurveConfigType, ChartBoxplotConfigType, ChartTimelineConfigType, ChartMasterDetailConfigType, ChartDumbbellConfigType, ChartDumbbellLowerConfigType, ChartDumbbellUpperConfigType, ChartColumnPyramidConfigType, ChartLollipopConfigType, ChartAreaSplineConfigType, ChartAreaNegativeConfigType, ChartAreaRangeConfigType, ChartColumnRangeConfigType, ChartColumnDrilldownConfigType, ChartRadialBarConfigType, ChartVariablePieConfigType, ChartEulerConfigType, ChartPolygonConfigType, ChartVectorConfigType, ChartXrangeConfigType, ChartFanConfigType, ChartFunnelConfigType, ChartOrganizationConfigType, ChartLineColumnConfigType, ChartHeatmapConfigType, ChartFlameConfigType, ChartSpiderwebConfigType, ChartKpiConfigType, ChartKpiPropsType, ChartMapConfigType, PrimitiveChartConfigType, SeparatedChartConfigInputType, AllChartConfigType, ChartConfigType, NileChartConfigInputType, ChartAiPanelPayload, ChartAiSenderPayload, NileAiPanelConfigInputType, NileAiSenderConfigInputType, } from './nile-chart/index.js';
19
- export type { SeparatedChartDemoConfig } from './internal/separated-chart-config.js';
19
+ export type { SeparatedChartDemoConfig } from './internal/utils/separated-chart-config.js';
20
20
  export { NileLineChart } from './nile-line-chart/index.js';
21
21
  export type { LineChartSeriesData } from './nile-line-chart/index.js';
22
22
  export { NileAreaChart } from './nile-area-chart/index.js';
@@ -71,6 +71,7 @@ export { NileXrangeChart } from './nile-xrange-chart/index.js';
71
71
  export type { XrangeDataPoint } from './nile-xrange-chart/index.js';
72
72
  export { NileFanChart } from './nile-fan-chart/index.js';
73
73
  export type { FanLinePoint, FanUncertaintyBand } from './nile-fan-chart/index.js';
74
+ export type { ForecastSeriesInput, ForecastIntervalRange, ForecastIntervalConfig, ForecastProjectionConfig, ForecastConfigFields, ForecastSeriesType, ForecastDashStyle, } from './internal/utils/chart-forecast.js';
74
75
  export { NileDonutChart } from './nile-donut-chart/index.js';
75
76
  export type { DonutChartSeriesData } from './nile-donut-chart/index.js';
76
77
  export { NileScatterChart } from './nile-scatter-chart/index.js';
@@ -103,7 +104,7 @@ export { NileFilterChart } from './nile-filter-chart/index.js';
103
104
  export type { FilterChartSeparatedPayload, FilterControl, FilterOption, FilterChartConfig, } from './nile-filter-chart/nile-filter-chart.js';
104
105
  export { NileMapChart } from './nile-map-chart/index.js';
105
106
  export type { MapChartDataPoint } from './nile-map-chart/index.js';
106
- export type { ChartExtremes, SetExtremesOptions, MapBounds, } from './internal/chart-runtime.js';
107
+ export type { ChartExtremes, SetExtremesOptions, MapBounds, } from './internal/utils/chart-runtime.js';
107
108
  export { NileAiSender } from './nile-ai-sender/index.js';
108
109
  export { NileAiPanel } from './nile-ai-panel/index.js';
109
110
  export { NileWidgetViewer } from './nile-widget-viewer/index.js';
@@ -111,7 +112,7 @@ export type { NileWidgetConfig, NileWidgetChartConfig, NileWidgetKpiConfig, Widg
111
112
  export { NileDashboardViewer } from './nile-dashboard-viewer/index.js';
112
113
  export type { NileDashboardConfig } from './nile-dashboard-viewer/index.js';
113
114
  export { NileDashboardBuilder } from './nile-dashboard-builder/index.js';
114
- export { fromApiDashboardResponse } from './internal/dashboard-adapters.js';
115
+ export { fromApiDashboardResponse } from './internal/utils/dashboard-adapters.js';
115
116
  export { NileExecutiveSummary } from './nile-executive-summary/index.js';
116
117
  export type { NileExecutiveSummaryConfig } from './nile-executive-summary/index.js';
117
118
  export { NileChartList } from './nile-chart-list/index.js';
package/dist/src/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // console.log(`[nile-visualization] Build: ${__NILE_BUILD_DATE__}`);
3
3
  // /* eslint-enable no-console */
4
4
  // Names of all Highcharts-derived events forwarded as `nile-*` CustomEvents on charts.
5
- export { NileChartEvents } from './internal/chart-events.js';
5
+ export { NileChartEvents } from './internal/utils/chart-events.js';
6
6
  export { NileBarChart } from './nile-bar-chart/index.js';
7
7
  export { NilePieChart } from './nile-pie-chart/index.js';
8
8
  export { NileTrendlineChart } from './nile-trendline-chart/index.js';
@@ -60,7 +60,7 @@ export { NileAiPanel } from './nile-ai-panel/index.js';
60
60
  export { NileWidgetViewer } from './nile-widget-viewer/index.js';
61
61
  export { NileDashboardViewer } from './nile-dashboard-viewer/index.js';
62
62
  export { NileDashboardBuilder } from './nile-dashboard-builder/index.js';
63
- export { fromApiDashboardResponse } from './internal/dashboard-adapters.js';
63
+ export { fromApiDashboardResponse } from './internal/utils/dashboard-adapters.js';
64
64
  export { NileExecutiveSummary } from './nile-executive-summary/index.js';
65
65
  export { NileChartList } from './nile-chart-list/index.js';
66
66
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,59 @@
1
+ import type Highcharts from 'highcharts';
2
+ import type { PropertyValues } from 'lit';
3
+ import NileChartBase from './nile-chart-base.js';
4
+ import { NO_FORECAST, type ForecastConfigFields, type ForecastProjectionConfig, type ForecastResult, type ForecastSeriesInput, type ForecastSeriesType } from '../utils/chart-forecast.js';
5
+ /**
6
+ * Base class for the five category-axis charts that can carry a projection
7
+ * (`line`, `spline`, `area`, `areaSpline`, `column`) — owns the shared
8
+ * property wiring around `chart-forecast.ts`'s derivation.
9
+ */
10
+ export default class NileForecastableChart extends NileChartBase {
11
+ protected chartSeriesType: ForecastSeriesType;
12
+ enableForecasting: boolean;
13
+ /** How the projected half is drawn. See `ForecastProjectionConfig`. */
14
+ projection: ForecastProjectionConfig | null;
15
+ /** Forecast input — line width for every series that doesn't set its own. Unused for `column`. */
16
+ lineWidth: number | null;
17
+ /** Forecast input — show point markers. Default `false`. Unused for `column`. */
18
+ showMarkers: boolean;
19
+ /** Forecast input — tooltip value suffix for every series that doesn't set its own. */
20
+ valueSuffix: string;
21
+ /** Forecast input — area fill opacity. Only read by `area` / `areaSpline`. */
22
+ fillOpacity: number | null;
23
+ /** Title for the x-axis. Not forecast-specific — applied either way. */
24
+ xAxisTitle: string;
25
+ /**
26
+ * Title for the opposite y-axis. Only rendered when some series sets
27
+ * `axis: 'secondary'` — there is no second axis to title otherwise.
28
+ */
29
+ secondaryAxisTitle: string;
30
+ /** Floor for the secondary axis. `null` lets Highcharts pick it from the data. */
31
+ secondaryAxisMin: number | null;
32
+ /** The property names a subclass must watch in `updated()`. Spread into its list. */
33
+ protected static readonly FORECASTABLE_PROPS: readonly string[];
34
+ /** Pending phase 2 of the forecast exit animation; see `animateForecastExit`. */
35
+ private forecastExitTimer;
36
+ protected get forecastData(): ForecastSeriesInput[];
37
+ protected get forecastCategories(): string[];
38
+ /** Copies the forecast fields off a `{ chart }` config slice. */
39
+ protected applyForecastableConfig(c: ForecastConfigFields): void;
40
+ /**
41
+ * The forecast overlay for the current state, or the empty overlay.
42
+ *
43
+ * Always returns something: the empty arrays are what clear a previous
44
+ * overlay, since `chart.update()` leaves an omitted key in place.
45
+ *
46
+ * @param retract build the collapsed frame — phase 1 of the exit animation.
47
+ */
48
+ protected forecastOverlay(retract?: boolean): ForecastResult | typeof NO_FORECAST & {
49
+ series?: undefined;
50
+ };
51
+ protected forecastSeries(overlay: {
52
+ series?: Highcharts.SeriesOptionsType[];
53
+ }): Highcharts.SeriesOptionsType[];
54
+ protected forecastYAxis(primary: Highcharts.YAxisOptions, hasSecondaryAxis: boolean): Highcharts.YAxisOptions | Highcharts.YAxisOptions[];
55
+ /** True when the clicked x sits past the boundary. For `nile-chart-click`. */
56
+ protected isForecastPoint(x: unknown, boundary: number): boolean;
57
+ protected updateChart(chart: Highcharts.Chart, changedProperties: PropertyValues, build: (retract?: boolean) => Highcharts.Options): void;
58
+ disconnectedCallback(): void;
59
+ }
@@ -0,0 +1,149 @@
1
+ import { __decorate } from "tslib";
2
+ import { property } from 'lit/decorators.js';
3
+ import NileChartBase from './nile-chart-base.js';
4
+ import { animateForecastExit, applyForecastConfig, buildForecast, FORECAST_UPDATE_ANIMATION, FORECAST_WATCHED_PROPS, hasForecastSeries, NO_FORECAST, plainForecastSeries, } from '../utils/chart-forecast.js';
5
+ /**
6
+ * Base class for the five category-axis charts that can carry a projection
7
+ * (`line`, `spline`, `area`, `areaSpline`, `column`) — owns the shared
8
+ * property wiring around `chart-forecast.ts`'s derivation.
9
+ */
10
+ class NileForecastableChart extends NileChartBase {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.chartSeriesType = 'line';
14
+ this.enableForecasting = false;
15
+ /** How the projected half is drawn. See `ForecastProjectionConfig`. */
16
+ this.projection = null;
17
+ /** Forecast input — line width for every series that doesn't set its own. Unused for `column`. */
18
+ this.lineWidth = null;
19
+ /** Forecast input — show point markers. Default `false`. Unused for `column`. */
20
+ this.showMarkers = false;
21
+ /** Forecast input — tooltip value suffix for every series that doesn't set its own. */
22
+ this.valueSuffix = '';
23
+ /** Forecast input — area fill opacity. Only read by `area` / `areaSpline`. */
24
+ this.fillOpacity = null;
25
+ /** Title for the x-axis. Not forecast-specific — applied either way. */
26
+ this.xAxisTitle = '';
27
+ /**
28
+ * Title for the opposite y-axis. Only rendered when some series sets
29
+ * `axis: 'secondary'` — there is no second axis to title otherwise.
30
+ */
31
+ this.secondaryAxisTitle = '';
32
+ /** Floor for the secondary axis. `null` lets Highcharts pick it from the data. */
33
+ this.secondaryAxisMin = null;
34
+ /** Pending phase 2 of the forecast exit animation; see `animateForecastExit`. */
35
+ this.forecastExitTimer = 0;
36
+ }
37
+ get forecastData() {
38
+ return this.data ?? [];
39
+ }
40
+ get forecastCategories() {
41
+ return this.categories ?? [];
42
+ }
43
+ /** Copies the forecast fields off a `{ chart }` config slice. */
44
+ applyForecastableConfig(c) {
45
+ applyForecastConfig(this, c);
46
+ const fill = c.fillOpacity;
47
+ if (fill !== undefined)
48
+ this.fillOpacity = fill;
49
+ }
50
+ /**
51
+ * The forecast overlay for the current state, or the empty overlay.
52
+ *
53
+ * Always returns something: the empty arrays are what clear a previous
54
+ * overlay, since `chart.update()` leaves an omitted key in place.
55
+ *
56
+ * @param retract build the collapsed frame — phase 1 of the exit animation.
57
+ */
58
+ forecastOverlay(retract = false) {
59
+ if (!(this.enableForecasting || retract) || !hasForecastSeries(this.forecastData)) {
60
+ // A secondary axis is a per-series display concern, not tied to whether
61
+ // the projection overlay itself is drawing — so it survives here too.
62
+ return {
63
+ ...NO_FORECAST,
64
+ hasSecondaryAxis: this.forecastData.some(s => s.axis === 'secondary'),
65
+ };
66
+ }
67
+ return buildForecast({
68
+ seriesType: this.chartSeriesType,
69
+ data: this.forecastData,
70
+ categories: this.forecastCategories,
71
+ projection: this.projection,
72
+ ...(this.lineWidth !== null ? { lineWidth: this.lineWidth } : {}),
73
+ ...(this.fillOpacity !== null ? { fillOpacity: this.fillOpacity } : {}),
74
+ showMarkers: this.showMarkers,
75
+ valueSuffix: this.valueSuffix,
76
+ retract,
77
+ });
78
+ }
79
+ forecastSeries(overlay) {
80
+ return overlay.series
81
+ ?? plainForecastSeries(this.chartSeriesType, this.forecastData, {
82
+ showMarkers: this.showMarkers,
83
+ ...(this.lineWidth !== null ? { lineWidth: this.lineWidth } : {}),
84
+ ...(this.fillOpacity !== null ? { fillOpacity: this.fillOpacity } : {}),
85
+ valueSuffix: this.valueSuffix,
86
+ });
87
+ }
88
+ forecastYAxis(primary, hasSecondaryAxis) {
89
+ if (!hasSecondaryAxis)
90
+ return primary;
91
+ return [
92
+ primary,
93
+ {
94
+ title: { text: this.secondaryAxisTitle || undefined },
95
+ opposite: true,
96
+ // No second gridline set — two overlaid grids read as noise.
97
+ gridLineWidth: 0,
98
+ ...(this.secondaryAxisMin !== null ? { min: this.secondaryAxisMin } : {}),
99
+ },
100
+ ];
101
+ }
102
+ /** True when the clicked x sits past the boundary. For `nile-chart-click`. */
103
+ isForecastPoint(x, boundary) {
104
+ return typeof x === 'number' && boundary >= 0 && x > boundary;
105
+ }
106
+ updateChart(chart, changedProperties, build) {
107
+ if (changedProperties.get('enableForecasting') === true && !this.enableForecasting) {
108
+ this.forecastExitTimer = animateForecastExit(chart, { retracted: build(true), settled: build() }, this.forecastExitTimer);
109
+ return;
110
+ }
111
+ clearTimeout(this.forecastExitTimer);
112
+ chart.update(build(), true, true, FORECAST_UPDATE_ANIMATION);
113
+ }
114
+ disconnectedCallback() {
115
+ super.disconnectedCallback();
116
+ clearTimeout(this.forecastExitTimer);
117
+ }
118
+ }
119
+ /** The property names a subclass must watch in `updated()`. Spread into its list. */
120
+ NileForecastableChart.FORECASTABLE_PROPS = Object.freeze(['fillOpacity', ...FORECAST_WATCHED_PROPS]);
121
+ export default NileForecastableChart;
122
+ __decorate([
123
+ property({ type: Boolean, attribute: 'enable-forecasting' })
124
+ ], NileForecastableChart.prototype, "enableForecasting", void 0);
125
+ __decorate([
126
+ property({ type: Object })
127
+ ], NileForecastableChart.prototype, "projection", void 0);
128
+ __decorate([
129
+ property({ type: Number, attribute: 'line-width' })
130
+ ], NileForecastableChart.prototype, "lineWidth", void 0);
131
+ __decorate([
132
+ property({ type: Boolean, attribute: 'show-markers' })
133
+ ], NileForecastableChart.prototype, "showMarkers", void 0);
134
+ __decorate([
135
+ property({ type: String, attribute: 'value-suffix' })
136
+ ], NileForecastableChart.prototype, "valueSuffix", void 0);
137
+ __decorate([
138
+ property({ type: Number, attribute: 'fill-opacity' })
139
+ ], NileForecastableChart.prototype, "fillOpacity", void 0);
140
+ __decorate([
141
+ property({ type: String, attribute: 'x-axis-title' })
142
+ ], NileForecastableChart.prototype, "xAxisTitle", void 0);
143
+ __decorate([
144
+ property({ type: String, attribute: 'secondary-axis-title' })
145
+ ], NileForecastableChart.prototype, "secondaryAxisTitle", void 0);
146
+ __decorate([
147
+ property({ type: Number, attribute: 'secondary-axis-min' })
148
+ ], NileForecastableChart.prototype, "secondaryAxisMin", void 0);
149
+ //# sourceMappingURL=forecastable-chart.js.map
@@ -1,6 +1,6 @@
1
1
  import type Highcharts from 'highcharts';
2
2
  import NileElement from './nile-element.js';
3
- import { type ChartExtremes, type SetExtremesOptions } from './chart-runtime.js';
3
+ import { type ChartExtremes, type SetExtremesOptions } from '../utils/chart-runtime.js';
4
4
  /**
5
5
  * Shared base for the individual chart components. Extends {@link NileElement}
6
6
  * (so `emit()` and its defaults are unchanged) and adds a small, additive
@@ -1,5 +1,5 @@
1
1
  import NileElement from './nile-element.js';
2
- import { getAxisExtremes, setAxisExtremes, } from './chart-runtime.js';
2
+ import { getAxisExtremes, setAxisExtremes, } from '../utils/chart-runtime.js';
3
3
  /**
4
4
  * Shared base for the individual chart components. Extends {@link NileElement}
5
5
  * (so `emit()` and its defaults are unchanged) and adds a small, additive
@@ -1,13 +1,15 @@
1
1
  import type { Options } from 'highcharts';
2
+ import type { ForecastConfigFields, ForecastSeriesInput } from '../utils/chart-forecast.js';
2
3
  import type { AreaChartSeriesData } from '../../nile-area-chart/nile-area-chart.js';
3
4
  /** HighCharts area chart config. */
4
- export interface ChartAreaConfigType {
5
+ export interface ChartAreaConfigType extends ForecastConfigFields {
5
6
  type: 'area';
6
- data: AreaChartSeriesData[];
7
+ data: Array<AreaChartSeriesData | ForecastSeriesInput>;
7
8
  categories?: string[];
8
9
  yAxisTitle?: string;
9
10
  height?: string;
10
11
  stacked?: boolean;
12
+ fillOpacity?: number;
11
13
  loading?: boolean;
12
14
  options?: Options;
13
15
  chartBg?: string;
@@ -1,13 +1,15 @@
1
1
  import type { Options } from 'highcharts';
2
+ import type { ForecastConfigFields, ForecastSeriesInput } from '../utils/chart-forecast.js';
2
3
  import type { AreaSplineSeriesData } from '../../nile-area-spline-chart/nile-area-spline-chart.js';
3
4
  /** Area spline (`<nile-area-spline-chart>`). */
4
- export interface ChartAreaSplineConfigType {
5
+ export interface ChartAreaSplineConfigType extends ForecastConfigFields {
5
6
  type: 'areaSpline';
6
- data: AreaSplineSeriesData[];
7
+ data: Array<AreaSplineSeriesData | ForecastSeriesInput>;
7
8
  categories?: string[];
8
9
  yAxisTitle?: string;
9
10
  height?: string;
10
11
  stacked?: boolean;
12
+ fillOpacity?: number;
11
13
  loading?: boolean;
12
14
  options?: Options;
13
15
  chartBg?: string;
@@ -1,9 +1,10 @@
1
1
  import type { Options } from 'highcharts';
2
+ import type { ForecastConfigFields, ForecastSeriesInput } from '../utils/chart-forecast.js';
2
3
  import type { ColumnChartSeriesData } from '../../nile-column-chart/nile-column-chart.js';
3
4
  /** HighCharts column chart config. */
4
- export interface ChartColumnConfigType {
5
+ export interface ChartColumnConfigType extends ForecastConfigFields {
5
6
  type: 'column';
6
- data: ColumnChartSeriesData[];
7
+ data: Array<ColumnChartSeriesData | ForecastSeriesInput>;
7
8
  categories?: string[];
8
9
  yAxisTitle?: string;
9
10
  height?: string;
@@ -1,9 +1,10 @@
1
1
  import type { Options } from 'highcharts';
2
+ import type { ForecastConfigFields, ForecastSeriesInput } from '../utils/chart-forecast.js';
2
3
  import type { LineChartSeriesData } from '../../nile-line-chart/nile-line-chart.js';
3
4
  /** HighCharts line chart config. */
4
- export interface ChartLineConfigType {
5
+ export interface ChartLineConfigType extends ForecastConfigFields {
5
6
  type: 'line';
6
- data: LineChartSeriesData[];
7
+ data: Array<LineChartSeriesData | ForecastSeriesInput>;
7
8
  categories?: string[];
8
9
  yAxisTitle?: string;
9
10
  height?: string;
@@ -1,9 +1,10 @@
1
1
  import type { Options } from 'highcharts';
2
+ import type { ForecastConfigFields, ForecastSeriesInput } from '../utils/chart-forecast.js';
2
3
  import type { SplineChartSeriesData } from '../../nile-spline-chart/nile-spline-chart.js';
3
4
  /** HighCharts spline chart config. */
4
- export interface ChartSplineConfigType {
5
+ export interface ChartSplineConfigType extends ForecastConfigFields {
5
6
  type: 'spline';
6
- data: SplineChartSeriesData[];
7
+ data: Array<SplineChartSeriesData | ForecastSeriesInput>;
7
8
  categories?: string[];
8
9
  yAxisTitle?: string;
9
10
  height?: string;
@@ -1,4 +1,4 @@
1
- import type { NileChartConfig, ChartType } from '../nile-chart/nile-chart-config.js';
1
+ import type { NileChartConfig, ChartType } from '../../nile-chart/nile-chart-config.js';
2
2
  type AdapterFn = (config: NileChartConfig) => NileChartConfig;
3
3
  /**
4
4
  * Register a custom adapter for converting between chart types.
@@ -1,3 +1,4 @@
1
+ import { flattenForecastSeries } from './chart-forecast.js';
1
2
  // ── Bar → Pie helpers ───────────────────────────────────────────────
2
3
  function barToPieByCategory(data, categories) {
3
4
  return categories.map((cat, i) => ({
@@ -150,7 +151,13 @@ const adapters = {
150
151
  'column->stacked': (config) => {
151
152
  if (config.type !== 'column')
152
153
  throw new Error('Expected column config');
153
- return { ...config, type: 'stacked', stackMode: 'normal' };
154
+ // `stacked` has no forecast support, so a projection flattens into the series.
155
+ return {
156
+ ...config,
157
+ type: 'stacked',
158
+ stackMode: 'normal',
159
+ data: flattenForecastSeries(config.data),
160
+ };
154
161
  },
155
162
  'stacked->column': (config) => {
156
163
  if (config.type !== 'stacked')
@@ -165,7 +172,12 @@ const adapters = {
165
172
  'column->bar': (config) => {
166
173
  if (config.type !== 'column')
167
174
  throw new Error('Expected column config');
168
- return { ...config, type: 'bar' };
175
+ // `bar` has no forecast support, so a projection flattens into the series.
176
+ return {
177
+ ...config,
178
+ type: 'bar',
179
+ data: flattenForecastSeries(config.data),
180
+ };
169
181
  },
170
182
  // ── Stacked ↔ pie / trendline / anomaly (same as bar) ──
171
183
  'stacked->pie': (config) => {
@@ -212,7 +224,7 @@ const adapters = {
212
224
  return {
213
225
  ...config,
214
226
  type: 'pie',
215
- data: barLikeToPie(config.data, config.categories ?? [], agg),
227
+ data: barLikeToPie(flattenForecastSeries(config.data), config.categories ?? [], agg),
216
228
  seriesName: config.chartTitle || 'Series',
217
229
  };
218
230
  },
@@ -0,0 +1,126 @@
1
+ import type Highcharts from 'highcharts';
2
+ export type ForecastSeriesType = 'line' | 'spline' | 'area' | 'areaspline' | 'column';
3
+ export type ForecastDashStyle = Highcharts.DashStyleValue;
4
+ /** One projected point's bounds: `[low, high]`, positionally aligned with `projected`. */
5
+ export type ForecastIntervalRange = [number, number];
6
+ export interface ForecastIntervalConfig {
7
+ name?: string;
8
+ color?: string;
9
+ opacity?: number;
10
+ level?: number | null;
11
+ label?: string | null;
12
+ }
13
+ /** How the projected half is drawn. Field reference: `chart-forecast.md`. */
14
+ export interface ForecastProjectionConfig {
15
+ /** Index of the first projected category; derived from `actual` when omitted. */
16
+ start?: number | null;
17
+ color?: string;
18
+ dashStyle?: ForecastDashStyle;
19
+ showNowLine?: boolean;
20
+ nowLabel?: string;
21
+ nowLineColor?: string;
22
+ bandLabel?: string;
23
+ bandColor?: string;
24
+ interval?: ForecastIntervalConfig | null;
25
+ }
26
+ /** A forecast-capable series entry. `data` is an alias of `actual`. */
27
+ export interface ForecastSeriesInput {
28
+ name?: string;
29
+ actual?: number[];
30
+ data?: number[];
31
+ projected?: number[];
32
+ interval?: ForecastIntervalRange[];
33
+ color?: string;
34
+ forecastColor?: string;
35
+ forecastDashStyle?: ForecastDashStyle;
36
+ intervalName?: string;
37
+ intervalColor?: string;
38
+ intervalOpacity?: number;
39
+ intervalLevel?: number;
40
+ intervalLabel?: string;
41
+ valueSuffix?: string;
42
+ lineWidth?: number;
43
+ showMarkers?: boolean;
44
+ fillOpacity?: number;
45
+ type?: ForecastSeriesType;
46
+ axis?: 'primary' | 'secondary';
47
+ }
48
+ export interface ForecastConfigFields {
49
+ enableForecasting?: boolean;
50
+ secondaryAxisTitle?: string;
51
+ secondaryAxisMin?: number | null;
52
+ projection?: ForecastProjectionConfig | null;
53
+ lineWidth?: number;
54
+ showMarkers?: boolean;
55
+ valueSuffix?: string;
56
+ xAxisTitle?: string;
57
+ }
58
+ export declare const FORECAST_WATCHED_PROPS: readonly string[];
59
+ /** Copies the forecast fields of a separated `{ chart }` config onto a component. */
60
+ export declare function applyForecastConfig(target: object, c: ForecastConfigFields): void;
61
+ /** What {@link buildForecast} needs from the calling chart. */
62
+ export interface ForecastInput {
63
+ seriesType: ForecastSeriesType;
64
+ data: ForecastSeriesInput[];
65
+ categories?: string[];
66
+ projection?: ForecastProjectionConfig | null;
67
+ lineWidth?: number;
68
+ showMarkers?: boolean;
69
+ fillOpacity?: number;
70
+ valueSuffix?: string;
71
+ /** Phase 1 of {@link animateForecastExit}: projected values pinned to the boundary. */
72
+ retract?: boolean;
73
+ }
74
+ /** The pieces a chart merges into the options it already builds. Assign all of them — even empty, so stale overlays clear. */
75
+ export interface ForecastResult {
76
+ series: Highcharts.SeriesOptionsType[];
77
+ plotLines: Highcharts.XAxisPlotLinesOptions[];
78
+ plotBands: Highcharts.XAxisPlotBandsOptions[];
79
+ tooltip: Highcharts.TooltipOptions;
80
+ /** Index of the last measured category; `-1` when there is no projection. */
81
+ boundary: number;
82
+ hasSecondaryAxis: boolean;
83
+ }
84
+ export declare const FORECAST_NOW_LINE_COLOR = "var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600))";
85
+ export declare function hasForecastSeries(data: readonly ForecastSeriesInput[] | undefined): boolean;
86
+ /** `actual + projected` as one plain series — for type conversions (column → pie). */
87
+ export declare function flattenForecastSeries(data: readonly ForecastSeriesInput[] | undefined): Array<{
88
+ name: string;
89
+ data: number[];
90
+ color?: string;
91
+ }>;
92
+ export interface ForecastPresentation {
93
+ lineWidth?: number;
94
+ showMarkers?: boolean;
95
+ valueSuffix?: string;
96
+ fillOpacity?: number;
97
+ }
98
+ /**
99
+ * The forecasting-off series: measured history only. Presentation keys are
100
+ * pinned because `chart.update()` leaves an omitted key in place.
101
+ */
102
+ export declare function plainForecastSeries(type: ForecastSeriesType, data: readonly ForecastSeriesInput[] | undefined, presentation?: ForecastPresentation): Array<{
103
+ type: ForecastSeriesType;
104
+ name: string;
105
+ data: number[];
106
+ color?: string;
107
+ zones: [];
108
+ yAxis: number;
109
+ }>;
110
+ /** `chart.update()`'s 4th argument — updates don't animate unless told to. */
111
+ export declare const FORECAST_UPDATE_ANIMATION: Highcharts.AnimationOptionsObject;
112
+ /**
113
+ * Two-phase exit — Highcharts only morphs a path when the point count is
114
+ * unchanged: retract first, then settle. Pass the previous timer as `pending`.
115
+ */
116
+ export declare function animateForecastExit(chart: Highcharts.Chart, frames: {
117
+ retracted: Highcharts.Options;
118
+ settled: Highcharts.Options;
119
+ }, pending: number): number;
120
+ /** The empty overlay — assigning it clears a previous one. */
121
+ export declare const NO_FORECAST: Readonly<Pick<ForecastResult, 'plotLines' | 'plotBands' | 'tooltip' | 'boundary' | 'hasSecondaryAxis'>>;
122
+ /**
123
+ * Derives the forecast overlay: split series, boundary marker, region tint,
124
+ * interval tooltip. Behaviour notes: `chart-forecast.md`.
125
+ */
126
+ export declare function buildForecast(input: ForecastInput): ForecastResult;