ngwr 16.4.0 → 16.5.0
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/charts/bar-chart/styles/_index.scss +494 -305
- package/charts/boxplot-chart/styles/_index.scss +114 -48
- package/charts/bullet-chart/styles/_index.scss +113 -42
- package/charts/calendar-heatmap/styles/_index.scss +111 -20
- package/charts/candlestick-chart/styles/_index.scss +61 -26
- package/charts/chart-legend/styles/_index.scss +119 -1
- package/charts/core/styles/_index.scss +201 -5
- package/charts/donut-chart/styles/_index.scss +76 -21
- package/charts/funnel-chart/styles/_index.scss +66 -38
- package/charts/gauge/styles/_index.scss +12 -1
- package/charts/heatmap-chart/styles/_index.scss +90 -53
- package/charts/line-chart/styles/_index.scss +143 -139
- package/charts/meter-group/styles/_index.scss +87 -25
- package/charts/radar-chart/styles/_index.scss +82 -40
- package/charts/scatter-chart/styles/_index.scss +117 -44
- package/charts/sparkline/styles/_index.scss +7 -1
- package/charts/treemap-chart/styles/_index.scss +94 -42
- package/charts/waterfall-chart/styles/_index.scss +150 -87
- package/color-picker/styles/_index.scss +7 -3
- package/copy-value/styles/_index.scss +21 -2
- package/date-stamp/styles/_index.scss +2 -1
- package/dialog/styles/_index.scss +6 -0
- package/drawer/styles/_index.scss +5 -1
- package/fesm2022/ngwr-carousel-testing.mjs +4 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +21 -2
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +48 -4
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart-testing.mjs +16 -14
- package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +399 -141
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +19 -5
- package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +250 -56
- package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bullet-chart.mjs +118 -18
- package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +266 -46
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +21 -10
- package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +319 -72
- package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-chart-legend.mjs +211 -9
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +299 -18
- package/fesm2022/ngwr-charts-core.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart.mjs +206 -27
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +4 -4
- package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart.mjs +113 -10
- package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-gauge.mjs +98 -12
- package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +226 -31
- package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart-testing.mjs +16 -4
- package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +407 -172
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group-testing.mjs +4 -4
- package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +223 -31
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart-testing.mjs +2 -1
- package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +255 -66
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +39 -18
- package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +431 -53
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline.mjs +19 -8
- package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-charts-treemap-chart.mjs +253 -44
- package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +15 -7
- package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +151 -23
- package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +44 -4
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +47 -19
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value-testing.mjs +5 -1
- package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value.mjs +38 -2
- package/fesm2022/ngwr-copy-value.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +56 -8
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +13 -5
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +19 -3
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +35 -6
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +1 -0
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +81 -13
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +5 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +5 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +5 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +5 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +5 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +5 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +5 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +5 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +5 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +5 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +5 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +5 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +5 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +5 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +5 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +5 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +5 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +5 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +5 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +5 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +5 -0
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +5 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +20 -3
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +21 -2
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs +4 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +41 -5
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +67 -12
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +2 -0
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +2 -0
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +14 -9
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +49 -16
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +16 -9
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/i18n/ar.json +5 -0
- package/i18n/cs.json +5 -0
- package/i18n/de.json +5 -0
- package/i18n/en.json +5 -0
- package/i18n/es.json +5 -0
- package/i18n/fr.json +5 -0
- package/i18n/he.json +5 -0
- package/i18n/hi.json +5 -0
- package/i18n/id.json +5 -0
- package/i18n/it.json +5 -0
- package/i18n/ja.json +5 -0
- package/i18n/ko.json +5 -0
- package/i18n/nl.json +5 -0
- package/i18n/pl.json +5 -0
- package/i18n/pt.json +5 -0
- package/i18n/ru.json +5 -0
- package/i18n/sv.json +5 -0
- package/i18n/tr.json +5 -0
- package/i18n/uk.json +5 -0
- package/i18n/vi.json +5 -0
- package/i18n/zh-TW.json +5 -0
- package/i18n/zh.json +5 -0
- package/llms-full.txt +8 -8
- package/llms.txt +7 -3
- package/package.json +1 -1
- package/popconfirm/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +24 -13
- package/schematics/use/symbol-map.json +1 -0
- package/skills/ngwr/references/catalog.md +1 -1
- package/tour/styles/_index.scss +6 -0
- package/types/ngwr-carousel-testing.d.ts +6 -4
- package/types/ngwr-carousel.d.ts +14 -3
- package/types/ngwr-cascader-testing.d.ts +4 -3
- package/types/ngwr-cascader.d.ts +27 -3
- package/types/ngwr-charts-bar-chart-testing.d.ts +15 -13
- package/types/ngwr-charts-bar-chart.d.ts +220 -48
- package/types/ngwr-charts-boxplot-chart-testing.d.ts +9 -2
- package/types/ngwr-charts-boxplot-chart.d.ts +110 -19
- package/types/ngwr-charts-bullet-chart.d.ts +72 -12
- package/types/ngwr-charts-calendar-heatmap.d.ts +119 -15
- package/types/ngwr-charts-candlestick-chart-testing.d.ts +19 -9
- package/types/ngwr-charts-candlestick-chart.d.ts +195 -62
- package/types/ngwr-charts-chart-legend.d.ts +142 -5
- package/types/ngwr-charts-core.d.ts +259 -21
- package/types/ngwr-charts-donut-chart-testing.d.ts +11 -5
- package/types/ngwr-charts-donut-chart.d.ts +124 -16
- package/types/ngwr-charts-funnel-chart.d.ts +62 -6
- package/types/ngwr-charts-gauge-testing.d.ts +5 -1
- package/types/ngwr-charts-gauge.d.ts +72 -10
- package/types/ngwr-charts-heatmap-chart.d.ts +103 -20
- package/types/ngwr-charts-line-chart-testing.d.ts +16 -2
- package/types/ngwr-charts-line-chart.d.ts +215 -86
- package/types/ngwr-charts-meter-group.d.ts +96 -7
- package/types/ngwr-charts-radar-chart-testing.d.ts +14 -3
- package/types/ngwr-charts-radar-chart.d.ts +148 -28
- package/types/ngwr-charts-scatter-chart-testing.d.ts +22 -10
- package/types/ngwr-charts-scatter-chart.d.ts +188 -18
- package/types/ngwr-charts-sparkline.d.ts +26 -4
- package/types/ngwr-charts-treemap-chart.d.ts +121 -23
- package/types/ngwr-charts-waterfall-chart-testing.d.ts +8 -1
- package/types/ngwr-charts-waterfall-chart.d.ts +108 -21
- package/types/ngwr-color-picker.d.ts +27 -0
- package/types/ngwr-context-menu-testing.d.ts +10 -9
- package/types/ngwr-context-menu.d.ts +17 -0
- package/types/ngwr-copy-value.d.ts +8 -0
- package/types/ngwr-date-picker.d.ts +34 -2
- package/types/ngwr-dialog.d.ts +30 -10
- package/types/ngwr-drawer.d.ts +32 -1
- package/types/ngwr-dropdown-testing.d.ts +8 -5
- package/types/ngwr-dropdown.d.ts +29 -6
- package/types/ngwr-graph.d.ts +22 -6
- package/types/ngwr-lightbox.d.ts +15 -0
- package/types/ngwr-overlay.d.ts +16 -1
- package/types/ngwr-popconfirm-testing.d.ts +11 -2
- package/types/ngwr-popconfirm.d.ts +28 -1
- package/types/ngwr-popover.d.ts +59 -9
- package/types/ngwr-table.d.ts +1 -1
- package/types/ngwr-tour.d.ts +21 -2
- package/types/ngwr-tree-testing.d.ts +1 -2
- package/types/ngwr-tree.d.ts +33 -2
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +14 -11
- package/window/styles/_index.scss +5 -10
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { Component, ViewEncapsulation, computed, effect, input, isDevMode
|
|
2
|
+
import { Component, ElementRef, ViewEncapsulation, computed, effect, inject, input, isDevMode } from "@angular/core";
|
|
3
3
|
import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
|
|
4
4
|
import { wrCheckStyles } from "ngwr/utils";
|
|
5
5
|
import { useI18nFormatter, useI18nText, wrReadI18nText } from "ngwr/i18n";
|
|
6
|
-
import { WrChartTable, useChartNumbers, wrChartAxis } from "ngwr/charts/core";
|
|
7
|
-
import { useChartTooltip } from "ngwr/popover";
|
|
6
|
+
import { WrChartState, WrChartTable, useChartHover, useChartNumbers, useChartState, wrChartAxis, wrChartColor, wrChartRound } from "ngwr/charts/core";
|
|
7
|
+
import { useChartTooltip, wrCoerceChartTooltip } from "ngwr/popover";
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
*
|
|
@@ -13,7 +13,7 @@ import { useChartTooltip } from "ngwr/popover";
|
|
|
13
13
|
*/
|
|
14
14
|
const MINUS = "−";
|
|
15
15
|
const isolate = (text) => `${text}`;
|
|
16
|
-
const percent = (value) =>
|
|
16
|
+
const percent = (value) => wrChartRound(value, 3);
|
|
17
17
|
const clean = (value) => Number(value.toPrecision(15)) || 0;
|
|
18
18
|
var WrWaterfallChart = class WrWaterfallChart {
|
|
19
19
|
steps = input([], ...ngDevMode ? [{ debugName: "steps" }] : /* istanbul ignore next */ []);
|
|
@@ -21,7 +21,7 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
21
21
|
resolvedAriaLabel = useI18nText(this.ariaLabel, "waterfallChart.label", "Waterfall chart");
|
|
22
22
|
increaseColor = input("var(--wr-color-success)", ...ngDevMode ? [{ debugName: "increaseColor" }] : /* istanbul ignore next */ []);
|
|
23
23
|
decreaseColor = input("var(--wr-color-danger)", ...ngDevMode ? [{ debugName: "decreaseColor" }] : /* istanbul ignore next */ []);
|
|
24
|
-
totalColor = input(
|
|
24
|
+
totalColor = input(wrChartColor(0), ...ngDevMode ? [{ debugName: "totalColor" }] : /* istanbul ignore next */ []);
|
|
25
25
|
height = input(240, {
|
|
26
26
|
...ngDevMode ? { debugName: "height" } : /* istanbul ignore next */ {},
|
|
27
27
|
transform: (v) => Math.max(80, coerceNumberProperty(v, 240))
|
|
@@ -30,7 +30,11 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
30
30
|
...ngDevMode ? { debugName: "showGrid" } : /* istanbul ignore next */ {},
|
|
31
31
|
transform: coerceBooleanProperty
|
|
32
32
|
});
|
|
33
|
-
|
|
33
|
+
showAxis = input(true, {
|
|
34
|
+
...ngDevMode ? { debugName: "showAxis" } : /* istanbul ignore next */ {},
|
|
35
|
+
transform: coerceBooleanProperty
|
|
36
|
+
});
|
|
37
|
+
showValues = input(false, {
|
|
34
38
|
...ngDevMode ? { debugName: "showValues" } : /* istanbul ignore next */ {},
|
|
35
39
|
transform: coerceBooleanProperty
|
|
36
40
|
});
|
|
@@ -40,8 +44,19 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
40
44
|
});
|
|
41
45
|
tooltip = input(true, {
|
|
42
46
|
...ngDevMode ? { debugName: "tooltip" } : /* istanbul ignore next */ {},
|
|
47
|
+
transform: wrCoerceChartTooltip
|
|
48
|
+
});
|
|
49
|
+
loading = input(false, {
|
|
50
|
+
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
51
|
+
transform: coerceBooleanProperty
|
|
52
|
+
});
|
|
53
|
+
error = input(false, {
|
|
54
|
+
...ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {},
|
|
43
55
|
transform: coerceBooleanProperty
|
|
44
56
|
});
|
|
57
|
+
emptyLabel = input(null, ...ngDevMode ? [{ debugName: "emptyLabel" }] : /* istanbul ignore next */ []);
|
|
58
|
+
loadingLabel = input(null, ...ngDevMode ? [{ debugName: "loadingLabel" }] : /* istanbul ignore next */ []);
|
|
59
|
+
errorLabel = input(null, ...ngDevMode ? [{ debugName: "errorLabel" }] : /* istanbul ignore next */ []);
|
|
45
60
|
dataTable = input(false, {
|
|
46
61
|
...ngDevMode ? { debugName: "dataTable" } : /* istanbul ignore next */ {},
|
|
47
62
|
transform: coerceBooleanProperty
|
|
@@ -53,9 +68,13 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
53
68
|
runningTotalName = wrReadI18nText("waterfallChart.runningTotal", "Running total");
|
|
54
69
|
changeStepName = useI18nFormatter("waterfallChart.changeStep", "{{label}}: {{change}}, running total {{total}}");
|
|
55
70
|
totalStepName = useI18nFormatter("waterfallChart.totalStep", "{{label}}: total {{total}}");
|
|
56
|
-
|
|
71
|
+
host = inject(ElementRef).nativeElement;
|
|
57
72
|
constructor() {
|
|
58
73
|
if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("charts/waterfall-chart");
|
|
74
|
+
useChartHover({
|
|
75
|
+
enter: (index) => this.tip.enter(index),
|
|
76
|
+
leave: (event) => this.tip.leave(event)
|
|
77
|
+
});
|
|
59
78
|
if (isDevMode()) {
|
|
60
79
|
const warned = /* @__PURE__ */ new Set();
|
|
61
80
|
effect(() => {
|
|
@@ -151,6 +170,7 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
151
170
|
color: colors[step.kind],
|
|
152
171
|
display: step.change === null ? this.written(step.end, (v) => this.numbers.label(v, "label")) : this.signed(step.change, (v) => this.numbers.label(v, "label")),
|
|
153
172
|
below: step.kind === "decrease" || step.kind === "total" && step.end < 0,
|
|
173
|
+
figures: `${step.start} ${step.end}`,
|
|
154
174
|
changeText,
|
|
155
175
|
totalText,
|
|
156
176
|
name: step.change === null ? this.totalStepName({
|
|
@@ -165,6 +185,19 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
165
185
|
};
|
|
166
186
|
});
|
|
167
187
|
}, ...ngDevMode ? [{ debugName: "drawn" }] : /* istanbul ignore next */ []);
|
|
188
|
+
classes = computed(() => {
|
|
189
|
+
const active = this.tip.active();
|
|
190
|
+
return this.kinds().map((kind, index) => index === active ? `${kind} wr-waterfall-chart__step--active` : kind);
|
|
191
|
+
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
192
|
+
kinds = computed(() => this.drawn().map((step) => `wr-waterfall-chart__step wr-waterfall-chart__step--${step.kind}${step.below ? " wr-waterfall-chart__step--down" : ""}`), ...ngDevMode ? [{ debugName: "kinds" }] : /* istanbul ignore next */ []);
|
|
193
|
+
state = useChartState({
|
|
194
|
+
loading: this.loading,
|
|
195
|
+
error: this.error,
|
|
196
|
+
empty: computed(() => this.steps().length === 0),
|
|
197
|
+
emptyLabel: this.emptyLabel,
|
|
198
|
+
loadingLabel: this.loadingLabel,
|
|
199
|
+
errorLabel: this.errorLabel
|
|
200
|
+
});
|
|
168
201
|
tableData = computed(() => ({
|
|
169
202
|
caption: this.resolvedAriaLabel(),
|
|
170
203
|
corner: this.stepName(),
|
|
@@ -175,9 +208,17 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
175
208
|
})) }]
|
|
176
209
|
}), ...ngDevMode ? [{ debugName: "tableData" }] : /* istanbul ignore next */ []);
|
|
177
210
|
tip = useChartTooltip(this.tooltip, (index) => {
|
|
178
|
-
const step = this.drawn()[index];
|
|
179
|
-
const
|
|
180
|
-
if (!step || !
|
|
211
|
+
const step = this.state() ? void 0 : this.drawn()[index];
|
|
212
|
+
const column = this.host.querySelector(`[data-wr-index="${index}"]`);
|
|
213
|
+
if (!step || !column) return null;
|
|
214
|
+
const box = column.getBoundingClientRect();
|
|
215
|
+
const top = box.bottom - step.hi / 100 * box.height;
|
|
216
|
+
const anchor = {
|
|
217
|
+
x: box.left,
|
|
218
|
+
y: top,
|
|
219
|
+
width: box.width,
|
|
220
|
+
height: (step.hi - step.lo) / 100 * box.height
|
|
221
|
+
};
|
|
181
222
|
const rows = [];
|
|
182
223
|
if (step.kind !== "total") rows.push({
|
|
183
224
|
label: this.changeName(),
|
|
@@ -276,6 +317,13 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
276
317
|
isRequired: false,
|
|
277
318
|
transformFunction: null
|
|
278
319
|
},
|
|
320
|
+
showAxis: {
|
|
321
|
+
classPropertyName: "showAxis",
|
|
322
|
+
publicName: "showAxis",
|
|
323
|
+
isSignal: true,
|
|
324
|
+
isRequired: false,
|
|
325
|
+
transformFunction: null
|
|
326
|
+
},
|
|
279
327
|
showValues: {
|
|
280
328
|
classPropertyName: "showValues",
|
|
281
329
|
publicName: "showValues",
|
|
@@ -297,6 +345,41 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
297
345
|
isRequired: false,
|
|
298
346
|
transformFunction: null
|
|
299
347
|
},
|
|
348
|
+
loading: {
|
|
349
|
+
classPropertyName: "loading",
|
|
350
|
+
publicName: "loading",
|
|
351
|
+
isSignal: true,
|
|
352
|
+
isRequired: false,
|
|
353
|
+
transformFunction: null
|
|
354
|
+
},
|
|
355
|
+
error: {
|
|
356
|
+
classPropertyName: "error",
|
|
357
|
+
publicName: "error",
|
|
358
|
+
isSignal: true,
|
|
359
|
+
isRequired: false,
|
|
360
|
+
transformFunction: null
|
|
361
|
+
},
|
|
362
|
+
emptyLabel: {
|
|
363
|
+
classPropertyName: "emptyLabel",
|
|
364
|
+
publicName: "emptyLabel",
|
|
365
|
+
isSignal: true,
|
|
366
|
+
isRequired: false,
|
|
367
|
+
transformFunction: null
|
|
368
|
+
},
|
|
369
|
+
loadingLabel: {
|
|
370
|
+
classPropertyName: "loadingLabel",
|
|
371
|
+
publicName: "loadingLabel",
|
|
372
|
+
isSignal: true,
|
|
373
|
+
isRequired: false,
|
|
374
|
+
transformFunction: null
|
|
375
|
+
},
|
|
376
|
+
errorLabel: {
|
|
377
|
+
classPropertyName: "errorLabel",
|
|
378
|
+
publicName: "errorLabel",
|
|
379
|
+
isSignal: true,
|
|
380
|
+
isRequired: false,
|
|
381
|
+
transformFunction: null
|
|
382
|
+
},
|
|
300
383
|
dataTable: {
|
|
301
384
|
classPropertyName: "dataTable",
|
|
302
385
|
publicName: "dataTable",
|
|
@@ -314,20 +397,20 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
314
397
|
},
|
|
315
398
|
host: {
|
|
316
399
|
properties: {
|
|
400
|
+
"class.wr-waterfall-chart--axis": "showAxis()",
|
|
317
401
|
"class.wr-waterfall-chart--values": "showValues()",
|
|
318
402
|
"style.--wr-waterfall-chart-steps": "steps().length || 1"
|
|
319
403
|
},
|
|
320
404
|
classAttribute: "wr-waterfall-chart"
|
|
321
405
|
},
|
|
322
|
-
viewQueries: [{
|
|
323
|
-
propertyName: "barEls",
|
|
324
|
-
predicate: ["barEl"],
|
|
325
|
-
descendants: true,
|
|
326
|
-
isSignal: true
|
|
327
|
-
}],
|
|
328
406
|
ngImport: i0,
|
|
329
|
-
template: "@let
|
|
407
|
+
template: "@let values = showValues();\n@let shown = state();\n@let stepClasses = classes();\n@let connectors = showConnectors();\n<!-- Two columns: the value axis' tick labels at inline start and the plot beside them,\n with the step labels under the plot only, so their slots are the plot's columns. -->\n<div class=\"wr-waterfall-chart__body\">\n @if (showAxis()) {\n <!-- HTML beside the plot rather than inside it, in flow, so the column is exactly as\n wide as the longest label; each one hands the stylesheet the y of its own\n gridline. Hidden: every figure is in a step's own name, and the axis is the eye's. -->\n <div class=\"wr-waterfall-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of ticks(); track $index) {\n <span class=\"wr-waterfall-chart__tick\" [style.--wr-waterfall-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <!-- A named `group` of one named `img` per step, as the bar chart's columns are. Not one\n `img` round the whole chart: `img` makes everything inside it presentational, and\n WebKit drops such a subtree, so every step's own name would go with it. -->\n <div\n class=\"wr-waterfall-chart__plot\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\n >\n <!-- The drawing: every position in it is a percentage of its height from the bottom,\n handed to the stylesheet as a number. -->\n <div class=\"wr-waterfall-chart__track\" [style.--wr-waterfall-chart-zero]=\"zero()\">\n @if (showGrid()) {\n @for (tick of ticks(); track $index) {\n <span\n class=\"wr-waterfall-chart__grid-line\"\n aria-hidden=\"true\"\n [style.--wr-waterfall-chart-level]=\"tick.bottom\"\n ></span>\n }\n }\n\n <!-- Before the bars, so a bar that reaches zero covers it and a total of 0 draws nothing. -->\n <span class=\"wr-waterfall-chart__baseline\" aria-hidden=\"true\"></span>\n\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the grid and the scale the chart keeps. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n } @else {\n @for (step of drawn(); track $index) {\n <!-- Its change and the running total after it in its name: the figure inside is\n drawn for the eye, and the `img` role makes it presentational. The bar's two\n ends are handed to the stylesheet; `data-wr-index` is what the chart's one\n hover listener reads, and `data-step` the running totals before and after,\n beside the name that says them in words. -->\n <div\n role=\"img\"\n [class]=\"stepClasses[$index]\"\n [attr.aria-label]=\"step.name\"\n [attr.data-wr-index]=\"$index\"\n [attr.data-step]=\"step.figures\"\n [style.--wr-waterfall-chart-lo]=\"step.lo\"\n [style.--wr-waterfall-chart-hi]=\"step.hi\"\n >\n <!-- The bar is the part of the painted box its clip lets through: both are moved\n by a transform, so a new value lays nothing out. A change of zero writes no\n paint: its neutral hairline is the stylesheet's hook. -->\n <span class=\"wr-waterfall-chart__clip\"\n ><span class=\"wr-waterfall-chart__bar\" [style.background]=\"step.color\"></span\n ></span>\n @if (values) {\n <!-- The slot carries the figure to the end of the bar by a transform. In it, a\n line one figure tall that the figure joins only where it fits whole; one\n that does not wraps out of sight below it (see the stylesheet). -->\n <span class=\"wr-waterfall-chart__value-slot\" [class.wr-waterfall-chart__value-slot--below]=\"step.below\"\n ><span class=\"wr-waterfall-chart__value\" [class.wr-waterfall-chart__value--below]=\"step.below\"\n ><span class=\"wr-waterfall-chart__value-text\">{{ step.display }}</span></span\n ></span\n >\n }\n @if (connectors && step.connector !== null) {\n <!-- Across the gap to the next bar, at the running total that bar starts from. -->\n <span class=\"wr-waterfall-chart__connector\" [style.--wr-waterfall-chart-level]=\"step.connector\"></span>\n }\n </div>\n }\n }\n </div>\n </div>\n\n <!-- Named on each step above, so the visible label row is decoration here. -->\n <div class=\"wr-waterfall-chart__labels\" aria-hidden=\"true\">\n @for (step of drawn(); track $index) {\n <span class=\"wr-waterfall-chart__label\" [class.wr-waterfall-chart__label--total]=\"step.kind === 'total'\">{{\n step.label\n }}</span>\n }\n </div>\n</div>\n\n@if (dataTable() && !shown) {\n <!-- The figures for a screen reader who wants to move cell by cell, beside the steps\n rather than inside an `img`. Clipped to nothing by its own stylesheet, so it takes no\n room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n",
|
|
330
408
|
dependencies: [{
|
|
409
|
+
kind: "component",
|
|
410
|
+
type: WrChartState,
|
|
411
|
+
selector: "wr-chart-state",
|
|
412
|
+
inputs: ["kind", "label"]
|
|
413
|
+
}, {
|
|
331
414
|
kind: "component",
|
|
332
415
|
type: WrChartTable,
|
|
333
416
|
selector: "wr-chart-table",
|
|
@@ -348,11 +431,12 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
348
431
|
encapsulation: ViewEncapsulation.None,
|
|
349
432
|
host: {
|
|
350
433
|
class: "wr-waterfall-chart",
|
|
434
|
+
"[class.wr-waterfall-chart--axis]": "showAxis()",
|
|
351
435
|
"[class.wr-waterfall-chart--values]": "showValues()",
|
|
352
436
|
"[style.--wr-waterfall-chart-steps]": "steps().length || 1"
|
|
353
437
|
},
|
|
354
|
-
imports: [WrChartTable],
|
|
355
|
-
template: "@let
|
|
438
|
+
imports: [WrChartState, WrChartTable],
|
|
439
|
+
template: "@let values = showValues();\n@let shown = state();\n@let stepClasses = classes();\n@let connectors = showConnectors();\n<!-- Two columns: the value axis' tick labels at inline start and the plot beside them,\n with the step labels under the plot only, so their slots are the plot's columns. -->\n<div class=\"wr-waterfall-chart__body\">\n @if (showAxis()) {\n <!-- HTML beside the plot rather than inside it, in flow, so the column is exactly as\n wide as the longest label; each one hands the stylesheet the y of its own\n gridline. Hidden: every figure is in a step's own name, and the axis is the eye's. -->\n <div class=\"wr-waterfall-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of ticks(); track $index) {\n <span class=\"wr-waterfall-chart__tick\" [style.--wr-waterfall-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <!-- A named `group` of one named `img` per step, as the bar chart's columns are. Not one\n `img` round the whole chart: `img` makes everything inside it presentational, and\n WebKit drops such a subtree, so every step's own name would go with it. -->\n <div\n class=\"wr-waterfall-chart__plot\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\n >\n <!-- The drawing: every position in it is a percentage of its height from the bottom,\n handed to the stylesheet as a number. -->\n <div class=\"wr-waterfall-chart__track\" [style.--wr-waterfall-chart-zero]=\"zero()\">\n @if (showGrid()) {\n @for (tick of ticks(); track $index) {\n <span\n class=\"wr-waterfall-chart__grid-line\"\n aria-hidden=\"true\"\n [style.--wr-waterfall-chart-level]=\"tick.bottom\"\n ></span>\n }\n }\n\n <!-- Before the bars, so a bar that reaches zero covers it and a total of 0 draws nothing. -->\n <span class=\"wr-waterfall-chart__baseline\" aria-hidden=\"true\"></span>\n\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the grid and the scale the chart keeps. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n } @else {\n @for (step of drawn(); track $index) {\n <!-- Its change and the running total after it in its name: the figure inside is\n drawn for the eye, and the `img` role makes it presentational. The bar's two\n ends are handed to the stylesheet; `data-wr-index` is what the chart's one\n hover listener reads, and `data-step` the running totals before and after,\n beside the name that says them in words. -->\n <div\n role=\"img\"\n [class]=\"stepClasses[$index]\"\n [attr.aria-label]=\"step.name\"\n [attr.data-wr-index]=\"$index\"\n [attr.data-step]=\"step.figures\"\n [style.--wr-waterfall-chart-lo]=\"step.lo\"\n [style.--wr-waterfall-chart-hi]=\"step.hi\"\n >\n <!-- The bar is the part of the painted box its clip lets through: both are moved\n by a transform, so a new value lays nothing out. A change of zero writes no\n paint: its neutral hairline is the stylesheet's hook. -->\n <span class=\"wr-waterfall-chart__clip\"\n ><span class=\"wr-waterfall-chart__bar\" [style.background]=\"step.color\"></span\n ></span>\n @if (values) {\n <!-- The slot carries the figure to the end of the bar by a transform. In it, a\n line one figure tall that the figure joins only where it fits whole; one\n that does not wraps out of sight below it (see the stylesheet). -->\n <span class=\"wr-waterfall-chart__value-slot\" [class.wr-waterfall-chart__value-slot--below]=\"step.below\"\n ><span class=\"wr-waterfall-chart__value\" [class.wr-waterfall-chart__value--below]=\"step.below\"\n ><span class=\"wr-waterfall-chart__value-text\">{{ step.display }}</span></span\n ></span\n >\n }\n @if (connectors && step.connector !== null) {\n <!-- Across the gap to the next bar, at the running total that bar starts from. -->\n <span class=\"wr-waterfall-chart__connector\" [style.--wr-waterfall-chart-level]=\"step.connector\"></span>\n }\n </div>\n }\n }\n </div>\n </div>\n\n <!-- Named on each step above, so the visible label row is decoration here. -->\n <div class=\"wr-waterfall-chart__labels\" aria-hidden=\"true\">\n @for (step of drawn(); track $index) {\n <span class=\"wr-waterfall-chart__label\" [class.wr-waterfall-chart__label--total]=\"step.kind === 'total'\">{{\n step.label\n }}</span>\n }\n </div>\n</div>\n\n@if (dataTable() && !shown) {\n <!-- The figures for a screen reader who wants to move cell by cell, beside the steps\n rather than inside an `img`. Clipped to nothing by its own stylesheet, so it takes no\n room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"
|
|
356
440
|
}]
|
|
357
441
|
}],
|
|
358
442
|
ctorParameters: () => [],
|
|
@@ -413,6 +497,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
413
497
|
required: false
|
|
414
498
|
}]
|
|
415
499
|
}],
|
|
500
|
+
showAxis: [{
|
|
501
|
+
type: i0.Input,
|
|
502
|
+
args: [{
|
|
503
|
+
isSignal: true,
|
|
504
|
+
alias: "showAxis",
|
|
505
|
+
required: false
|
|
506
|
+
}]
|
|
507
|
+
}],
|
|
416
508
|
showValues: [{
|
|
417
509
|
type: i0.Input,
|
|
418
510
|
args: [{
|
|
@@ -437,6 +529,46 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
437
529
|
required: false
|
|
438
530
|
}]
|
|
439
531
|
}],
|
|
532
|
+
loading: [{
|
|
533
|
+
type: i0.Input,
|
|
534
|
+
args: [{
|
|
535
|
+
isSignal: true,
|
|
536
|
+
alias: "loading",
|
|
537
|
+
required: false
|
|
538
|
+
}]
|
|
539
|
+
}],
|
|
540
|
+
error: [{
|
|
541
|
+
type: i0.Input,
|
|
542
|
+
args: [{
|
|
543
|
+
isSignal: true,
|
|
544
|
+
alias: "error",
|
|
545
|
+
required: false
|
|
546
|
+
}]
|
|
547
|
+
}],
|
|
548
|
+
emptyLabel: [{
|
|
549
|
+
type: i0.Input,
|
|
550
|
+
args: [{
|
|
551
|
+
isSignal: true,
|
|
552
|
+
alias: "emptyLabel",
|
|
553
|
+
required: false
|
|
554
|
+
}]
|
|
555
|
+
}],
|
|
556
|
+
loadingLabel: [{
|
|
557
|
+
type: i0.Input,
|
|
558
|
+
args: [{
|
|
559
|
+
isSignal: true,
|
|
560
|
+
alias: "loadingLabel",
|
|
561
|
+
required: false
|
|
562
|
+
}]
|
|
563
|
+
}],
|
|
564
|
+
errorLabel: [{
|
|
565
|
+
type: i0.Input,
|
|
566
|
+
args: [{
|
|
567
|
+
isSignal: true,
|
|
568
|
+
alias: "errorLabel",
|
|
569
|
+
required: false
|
|
570
|
+
}]
|
|
571
|
+
}],
|
|
440
572
|
dataTable: [{
|
|
441
573
|
type: i0.Input,
|
|
442
574
|
args: [{
|
|
@@ -452,10 +584,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
452
584
|
alias: "valueFormat",
|
|
453
585
|
required: false
|
|
454
586
|
}]
|
|
455
|
-
}],
|
|
456
|
-
barEls: [{
|
|
457
|
-
type: i0.ViewChildren,
|
|
458
|
-
args: ["barEl", { isSignal: true }]
|
|
459
587
|
}]
|
|
460
588
|
}
|
|
461
589
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-charts-waterfall-chart.mjs","names":[],"sources":["../../../projects/lib/charts/waterfall-chart/waterfall-chart.ts","../../../projects/lib/charts/waterfall-chart/waterfall-chart.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n type ElementRef,\n ViewEncapsulation,\n computed,\n effect,\n input,\n isDevMode,\n viewChildren,\n} from '@angular/core';\n\nimport { WrChartTable, type WrChartTableData, wrChartAxis, useChartNumbers } from 'ngwr/charts/core';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { type WrChartTooltipRow, useChartTooltip } from 'ngwr/popover';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrWaterfallStep, WrWaterfallValueContext } from './types';\n\n/** What a step is: a change up, a change down, a change of nothing, or a total from zero. */\ntype Kind = 'increase' | 'decrease' | 'flat' | 'total';\n\n/**\n * U+2212 MINUS SIGN: as wide as the plus, where a hyphen is a short dash that reads as\n * punctuation. Every figure below zero takes it — a change, a running total, a total, a\n * tick — so one chart never prints two different minus signs side by side.\n */\nconst MINUS = '−';\n\n/**\n * A figure wrapped in U+2068 FIRST STRONG ISOLATE … U+2069 POP DIRECTIONAL ISOLATE, for the\n * tooltip, which renders outside the chart where no stylesheet of its own sets its\n * direction. A `−` in front of digits has no direction of its own, so in an RTL document\n * it would land on the digits' far side — `350−` beside a bar printing `−350`. The isolate\n * takes its direction from the figure's own first strong character, as `unicode-bidi:\n * plaintext` does for the figures on the drawing, so the two agree.\n */\nconst isolate = (text: string): string => `${text}`;\n\n/** A percentage to three decimals with `-0` folded to `0`, so an inline style stays short. */\nconst percent = (value: number): number => Math.round(value * 1000) / 1000 || 0;\n\n/**\n * A running total with the float noise of its additions taken off: 0.1 + 0.2 is\n * 0.30000000000000004, which would print as the total it is and still fail to equal the\n * 0.3 a host passes as that total. Fifteen significant digits is every digit a double\n * holds exactly.\n */\nconst clean = (value: number): number => Number(value.toPrecision(15)) || 0;\n\n/** One step with its arithmetic done: where the running total was, where it is, and where its bar runs. */\ninterface Resolved {\n readonly label: string;\n readonly kind: Kind;\n /** The step's change, or `null` on a total, which changes nothing. */\n readonly change: number | null;\n /** The running total before the step. */\n readonly start: number;\n /** The running total after it: what a total step shows. */\n readonly end: number;\n /** A total's own finite `value` where the steps above add up to something else, else `null`. */\n readonly mismatch: number | null;\n}\n\n/** One step as drawn and announced. */\ninterface DrawnStep {\n readonly label: string;\n readonly kind: Kind;\n readonly start: number;\n readonly end: number;\n /** The bar's bottom and top, as percentages of the drawing's height from its bottom. */\n readonly lo: number;\n readonly hi: number;\n /** The bar's paint, or `null` on a change of zero, which the stylesheet's neutral hook paints. */\n readonly color: string | null;\n /** The figure printed on the drawing: the signed change, or the total, as `valueFormat` writes a `'label'`. */\n readonly display: string;\n /** Whether that figure goes under the bar — a change down, a total below zero — rather than over it. */\n readonly below: boolean;\n /** The change in full with its sign, `''` on a total. */\n readonly changeText: string;\n /** The running total after the step, in full. */\n readonly totalText: string;\n /** What the step announces. */\n readonly name: string;\n /** The level of the connector to the next step, as a percentage of the drawing's height, or `null` for none. */\n readonly connector: number | null;\n}\n\n/**\n * Waterfall chart: how a figure gets from one value to another, one change at a time — an\n * opening balance, the revenue and costs that move it, the balance it closes on. HTML\n * marks laid out by the stylesheet, no dependency.\n *\n * @example\n * ```html\n * <wr-waterfall-chart\n * ariaLabel=\"Profit bridge, Q3\"\n * [steps]=\"[\n * { label: 'Opening', value: 4200, total: true },\n * { label: 'Sales', value: 1800 },\n * { label: 'Refunds', value: -350 },\n * { label: 'Payroll', value: -900 },\n * { label: 'Closing', value: 4750, total: true }\n * ]\"\n * />\n * ```\n *\n * **The arithmetic is the chart's.** A change step floats between the running total\n * before it and after it; a total step is a full bar from zero to the running total. A\n * total's own `value` is checked rather than drawn, so the bars cannot disagree with each\n * other: the closing bar ends exactly where the last change does, and in dev mode a\n * `value` that says otherwise warns — the steps above it do not add up to the figure the\n * host expected. The one total that is not checked is one before every change, where\n * nothing has run yet: its value is where the running total starts. A change that is not\n * a finite number counts as zero.\n *\n * **Colour is not the only channel.** An increase is `increaseColor`, a decrease\n * `decreaseColor` and a total `totalColor` — success, danger and primary unless told\n * otherwise — and each is also told apart without hue: a change runs UP or DOWN from the\n * thin connector that carries the previous running total to it, and its figure is printed\n * on the side it runs to, with its sign (`+1,800`, `−350`); a total stands on the zero\n * line, its figure has no `+` and its label is set in a heavier weight. A change of zero\n * — or of a value that is not a finite number — is neither: a hairline at the running\n * total in the neutral `--wr-waterfall-chart-flat-color`, printed `0` with no sign, and\n * classed `--flat` rather than as an increase.\n *\n * Those cues are the figures and the connectors, so turning BOTH `showValues` and\n * `showConnectors` off leaves colour alone to tell a change up from a change down on\n * screen: a +100 and a following −100 float over the same span. Each step's name and the\n * data table still carry the change; keep one of the two on wherever the chart has to\n * read without hue. On a narrow chart a figure too wide for its column is left out (see\n * `showValues`), and there the connectors are the cue that stays.\n *\n * Every figure below zero is written with `−` (U+2212 MINUS SIGN) in front of its\n * magnitude — a change, a running total, a total and a tick alike — so a name reads\n * \"Eq: −900, running total −600\" with one sign, not Intl's hyphen beside the chart's minus.\n *\n * **What a screen reader gets.** The chart is a named `role=\"group\"` of one `role=\"img\"`\n * per step, as the bar chart's columns are, each named with its change and the running\n * total after it — \"Refunds: −350, running total 5,650\" — or, for a total, \"Closing:\n * total 4,750\". `dataTable` adds the same figures as a table to walk cell by cell. The\n * tooltip is pointer only, and no part of the chart is a tab stop.\n *\n * The value axis always includes zero, so a total is a bar from the zero line and a\n * running total that goes negative hangs below it. Under RTL the steps run from the\n * right, with the value axis at the inline start, as every part of the layout is logical.\n * The gap between two bars is `--wr-waterfall-chart-gap`, held to a quarter of one step's\n * share of the drawing, so a chart of many steps narrows its gaps with its bars rather\n * than running out of room.\n *\n * @see https://ngwr.dev/charts/waterfall-chart\n */\n@Component({\n selector: 'wr-waterfall-chart',\n templateUrl: './waterfall-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-waterfall-chart',\n // Room over and under the drawing for the figure printed past a bar's end.\n '[class.wr-waterfall-chart--values]': 'showValues()',\n // How many columns share the drawing: what the stylesheet holds the gap to, so many\n // steps narrow it with their bars rather than run out of room (see `$gap-in-row`).\n '[style.--wr-waterfall-chart-steps]': 'steps().length || 1',\n },\n imports: [WrChartTable],\n})\nexport class WrWaterfallChart {\n /**\n * The steps, in order. A step without `total` is a change to the running total; a step\n * with it is a bar from zero showing the running total. See {@link WrWaterfallStep} for\n * what a total's `value` does.\n */\n readonly steps = input<readonly WrWaterfallStep[]>([]);\n\n /**\n * Accessible name of the chart, and the data table's caption. Each step names itself, so\n * say what the chart shows. Falls back to `waterfallChart.label` (\"Waterfall chart\").\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'waterfallChart.label', 'Waterfall chart');\n\n /** The colour of a change up. Any CSS colour, `var(--wr-…)` included. @default 'var(--wr-color-success)' */\n readonly increaseColor = input<string>('var(--wr-color-success)');\n\n /** The colour of a change down. Any CSS colour. @default 'var(--wr-color-danger)' */\n readonly decreaseColor = input<string>('var(--wr-color-danger)');\n\n /** The colour of a total. Any CSS colour. @default 'var(--wr-color-primary)' */\n readonly totalColor = input<string>('var(--wr-color-primary)');\n\n /** The plot's height in px, at least 80. @default 240 */\n readonly height = input(240, { transform: (v: unknown): number => Math.max(80, coerceNumberProperty(v, 240)) });\n\n /** Show the gridlines and the value axis' tick labels. @default true */\n readonly showGrid = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Print each step's figure past the end of its bar: a change with its sign, over the bar\n * when it runs up and under it when it runs down, and a total with no `+`. Compact from\n * a thousand up (`+1.2K`) by default; with `valueFormat`, whatever it writes for\n * `'label'`, so a formatter can go compact here and stay exact everywhere else.\n *\n * A figure is printed whole or not at all: one wider than its column and a quarter of\n * the gap on either side — which keeps it clear of its neighbours' — is left out rather\n * than cut, since `+$1,…` is not a figure and `−$9…` reads as −$9. The tooltip, the\n * names and the data table carry every figure in full.\n *\n * The sign is one of the two cues besides colour that tell a change up from a change\n * down; the connectors are the other. Off together with `showConnectors`, colour is the\n * only one left on screen. @default true\n */\n readonly showValues = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Draw the thin line that carries each running total across the gap to the next bar,\n * which starts from it. None leads into a total that starts a running total of its own\n * — one before every change, at a value the line would not meet.\n *\n * A change up leaves the line at its bottom and a change down at its top, so the line\n * is one of the two cues besides colour that tell them apart; the signed figures are\n * the other. Off together with `showValues`, colour is the only one left on screen.\n * @default true\n */\n readonly showConnectors = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a tooltip with the step's change and the running total after it on hover. Pointer\n * only — each step's accessible name already carries both. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Render the chart's figures as a table only assistive technology reaches, beside the\n * drawing: a row per step, headed by its label, with its change (empty on a total) and\n * the running total after it, each written as the tooltip writes it.\n *\n * Each step's accessible name already carries both figures; the table is for a reader\n * who wants to move through them cell by cell, with the column headings read out. It is\n * clipped to nothing: it takes no room, draws nothing and holds no tab stop.\n * @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Writes every number the chart shows: the figures on the drawing, the axis ticks, the\n * tooltip, the accessible names and the data table. Every figure is handed over as its\n * MAGNITUDE, never below zero, and the chart writes the sign in front: `+` or `−`\n * (U+2212 MINUS SIGN) on a change, `−` on a running total, a total or a tick below zero.\n * So one formatter writes every figure, and one minus sign appears throughout.\n *\n * It is told where the figure goes (see {@link WrWaterfallValueContext}): `'label'` past\n * a bar, where a compact form fits a narrow column; `'tick'` on the value axis; `'value'`\n * in the tooltip, the names and the data table, which a reader goes to for the exact\n * figure. A `(value) => string` written for another chart fits too, and writes all three\n * alike. `null` uses `Intl.NumberFormat` in `LOCALE_ID`: compact past the bars from a\n * thousand up, compact ticks (`1.2K`, `3.4M`) unless the full numbers are shorter, and\n * the exact figure everywhere else.\n */\n readonly valueFormat = input<((value: number, context: WrWaterfallValueContext) => string) | null>(null);\n\n /** The figures, the compact labels and the ticks, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers<[WrWaterfallValueContext]>(this.valueFormat);\n\n private readonly stepName = wrReadI18nText('waterfallChart.step', 'Step');\n private readonly changeName = wrReadI18nText('waterfallChart.change', 'Change');\n private readonly runningTotalName = wrReadI18nText('waterfallChart.runningTotal', 'Running total');\n private readonly changeStepName = useI18nFormatter(\n 'waterfallChart.changeStep',\n '{{label}}: {{change}}, running total {{total}}'\n );\n private readonly totalStepName = useI18nFormatter('waterfallChart.totalStep', '{{label}}: total {{total}}');\n\n private readonly barEls = viewChildren<ElementRef<HTMLElement>>('barEl');\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/waterfall-chart');\n // A total whose figure the steps above do not add up to is drawn at what they DO add\n // up to, which on screen is a chart that looks right about data that is not.\n if (isDevMode()) {\n const warned = new Set<string>();\n effect(() => {\n this.resolved().forEach((step, index) => {\n if (step.mismatch === null) return;\n const key = `${index}:${step.mismatch}:${step.end}`;\n if (warned.has(key)) return;\n warned.add(key);\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-waterfall-chart>: the total \"${step.label}\" (step ${index + 1}) is given as ${step.mismatch}, ` +\n `and the steps above it add up to ${step.end}. The bar shows ${step.end}.`\n );\n });\n });\n }\n }\n\n /**\n * Every step with its arithmetic done. The running total starts at zero, and a total\n * before every change sets it to its own value; a change moves it; a later total shows\n * it and only checks its own value against it.\n */\n private readonly resolved = computed<readonly Resolved[]>(() => {\n let running = 0;\n let moved = false;\n return this.steps().map((step): Resolved => {\n const value = Number.isFinite(step.value) ? step.value : null;\n const start = running;\n if (step.total) {\n let mismatch: number | null = null;\n if (!moved) {\n if (value !== null) running = clean(value);\n } else if (value !== null && clean(value) !== running) {\n mismatch = value;\n }\n return { label: step.label, kind: 'total', change: null, start, end: running, mismatch };\n }\n const change = value ?? 0;\n running = clean(running + change);\n moved = true;\n return {\n label: step.label,\n // Zero is neither way: a missing figure counted as nothing must not read as growth.\n kind: change < 0 ? 'decrease' : change > 0 ? 'increase' : 'flat',\n change,\n start,\n end: running,\n mismatch: null,\n };\n });\n });\n\n /**\n * The value axis, from `wrChartAxis` over every bar's two ends with zero always inside —\n * a total stands on it — snapped outward to a readable step and lifted a step where the\n * highest bar would end on the frame. With no step, the empty 0 to 1 frame.\n */\n protected readonly axis = computed(() => {\n const steps = this.resolved();\n if (steps.length === 0) return wrChartAxis(Number.NaN, Number.NaN);\n let min = 0;\n let max = 0;\n for (const { start, end, kind } of steps) {\n const from = kind === 'total' ? 0 : start;\n min = Math.min(min, from, end);\n max = Math.max(max, from, end);\n }\n return wrChartAxis(min, max, { includeZero: true });\n });\n\n /** Where zero is, as a percentage of the drawing's height from its bottom: the line every total stands on. */\n protected readonly zero = computed(() => this.level(0));\n\n /**\n * The ticks, top to bottom: each value's label, and its gridline's distance from the\n * drawing's top (for the label) and from its bottom (for the line).\n */\n protected readonly ticks = computed(() => {\n const { step, ticks } = this.axis();\n // Magnitudes, with the chart's own minus in front, as every other figure here.\n const labels = this.numbers.ticks(\n ticks.map(value => Math.abs(value)),\n step,\n 'tick'\n );\n return ticks.map((value, i) => {\n const bottom = this.level(value);\n return { label: value < 0 ? `${MINUS}${labels[i]}` : labels[i], bottom, top: percent(100 - bottom) };\n });\n });\n\n /**\n * The steps as drawn and announced: every figure written once, here, so the drawing, the\n * names, the tooltip and the table cannot disagree.\n */\n protected readonly drawn = computed<readonly DrawnStep[]>(() => {\n const steps = this.resolved();\n const colors: Record<Kind, string | null> = {\n increase: this.increaseColor(),\n decrease: this.decreaseColor(),\n flat: null,\n total: this.totalColor(),\n };\n return steps.map((step, i): DrawnStep => {\n const from = step.kind === 'total' ? 0 : step.start;\n const totalText = this.written(step.end, v => this.numbers.value(v, 'value'));\n const changeText = step.change === null ? '' : this.signed(step.change, v => this.numbers.value(v, 'value'));\n const next = steps[i + 1];\n // A change starts from the running total, and so does a total that shows it; a total\n // before every change starts one of its own, and a line into it would lead nowhere.\n const connected = next !== undefined && (next.kind !== 'total' || next.end === step.end);\n return {\n label: step.label,\n kind: step.kind,\n start: step.start,\n end: step.end,\n lo: this.level(Math.min(from, step.end)),\n hi: this.level(Math.max(from, step.end)),\n color: colors[step.kind],\n display:\n step.change === null\n ? this.written(step.end, v => this.numbers.label(v, 'label'))\n : this.signed(step.change, v => this.numbers.label(v, 'label')),\n below: step.kind === 'decrease' || (step.kind === 'total' && step.end < 0),\n changeText,\n totalText,\n name:\n step.change === null\n ? this.totalStepName({ label: step.label, total: totalText })\n : this.changeStepName({ label: step.label, change: changeText, total: totalText }),\n connector: connected ? this.level(step.end) : null,\n };\n });\n });\n\n /**\n * The figures for `dataTable`: the chart's name as the caption, a row per step headed by\n * its label, and its change and the running total after it as the columns. A total has\n * no change, so that cell is empty.\n */\n protected readonly tableData = computed<WrChartTableData>(() => ({\n caption: this.resolvedAriaLabel(),\n corner: this.stepName(),\n columns: [this.changeName(), this.runningTotalName()],\n groups: [{ rows: this.drawn().map(step => ({ header: step.label, cells: [step.changeText, step.totalText] })) }],\n }));\n\n /**\n * One tooltip for the whole chart, for the step under the pointer: its swatch and label\n * as the heading, then its change — a total has none — and the running total after it.\n * It points at the top edge of the BAR rather than at the column, which is the full\n * height of the plot; a change of zero keeps its hairline to point at, and no swatch,\n * since its neutral paint says nothing. Each figure is isolated (see `isolate`), so a\n * sign stays in front of its digits in an RTL document.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const step = this.drawn()[index];\n const anchor = this.barEls()[index]?.nativeElement;\n if (!step || !anchor) return null;\n const rows: WrChartTooltipRow[] = [];\n if (step.kind !== 'total') rows.push({ label: this.changeName(), value: isolate(step.changeText) });\n rows.push({ label: this.runningTotalName(), value: isolate(step.totalText) });\n const label = step.label;\n return {\n datum: step.color === null ? { label, value: '', rows } : { label, value: '', color: step.color, rows },\n anchor,\n };\n });\n\n /** Where `value` sits on the axis, as a percentage of the drawing's height from its bottom. */\n private level(value: number): number {\n const { min, max } = this.axis();\n return percent(((value - min) / (max - min)) * 100);\n }\n\n /** A change with its sign in front of its magnitude: `+` up, `−` down, and none for a change of zero. */\n private signed(change: number, write: (magnitude: number) => string): string {\n return change > 0 ? `+${write(change)}` : this.written(change, write);\n }\n\n /** A figure with `−` in front of its magnitude below zero and no sign otherwise: a running total, a total. */\n private written(value: number, write: (magnitude: number) => string): string {\n return value < 0 ? `${MINUS}${write(-value)}` : write(Math.abs(value));\n }\n}\n\nexport type { WrWaterfallStep, WrWaterfallValueContext } from './types';\n","@let active = tip.active();\n@let values = showValues();\n@let connectors = showConnectors();\n<!-- Two columns: the value axis' tick labels at inline start and the plot beside them,\n with the step labels under the plot only, so their slots are the plot's columns. -->\n<div class=\"wr-waterfall-chart__body\">\n @if (showGrid()) {\n <!-- HTML beside the plot rather than inside it, in flow, so the column is exactly as\n wide as the longest label; each one hands the stylesheet the y of its own\n gridline. Hidden: every figure is in a step's own name, and the axis is the eye's. -->\n <div class=\"wr-waterfall-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of ticks(); track $index) {\n <span class=\"wr-waterfall-chart__tick\" [style.--wr-waterfall-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <!-- A named `group` of one named `img` per step, as the bar chart's columns are. Not one\n `img` round the whole chart: `img` makes everything inside it presentational, and\n WebKit drops such a subtree, so every step's own name would go with it. -->\n <div\n class=\"wr-waterfall-chart__plot\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\n >\n <!-- The drawing: every position in it is a percentage of its height from the bottom,\n handed to the stylesheet as a number. -->\n <div class=\"wr-waterfall-chart__track\" [style.--wr-waterfall-chart-zero]=\"zero()\">\n @if (showGrid()) {\n @for (tick of ticks(); track $index) {\n <span\n class=\"wr-waterfall-chart__grid-line\"\n aria-hidden=\"true\"\n [style.--wr-waterfall-chart-level]=\"tick.bottom\"\n ></span>\n }\n }\n\n @for (step of drawn(); track $index) {\n <!-- Its change and the running total after it in its name: the figure inside is\n drawn for the eye, and the `img` role makes it presentational. The bar's two\n ends are handed to the stylesheet; the running totals before and after it ride\n along as data, beside the name that says them in words. -->\n <div\n class=\"wr-waterfall-chart__step\"\n [class.wr-waterfall-chart__step--increase]=\"step.kind === 'increase'\"\n [class.wr-waterfall-chart__step--decrease]=\"step.kind === 'decrease'\"\n [class.wr-waterfall-chart__step--flat]=\"step.kind === 'flat'\"\n [class.wr-waterfall-chart__step--total]=\"step.kind === 'total'\"\n [class.wr-waterfall-chart__step--active]=\"active === $index\"\n role=\"img\"\n [attr.aria-label]=\"step.name\"\n [attr.data-start]=\"step.start\"\n [attr.data-end]=\"step.end\"\n [style.--wr-waterfall-chart-lo]=\"step.lo\"\n [style.--wr-waterfall-chart-hi]=\"step.hi\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n <!-- A change of zero writes no paint: its neutral hairline is the stylesheet's hook. -->\n <span #barEl class=\"wr-waterfall-chart__bar\" [style.background]=\"step.color\"></span>\n @if (values) {\n <!-- A line one figure tall that the figure joins only where it fits whole; one\n that does not wraps out of sight below it (see the stylesheet). -->\n <span class=\"wr-waterfall-chart__value\" [class.wr-waterfall-chart__value--below]=\"step.below\"\n ><span class=\"wr-waterfall-chart__value-text\">{{ step.display }}</span></span\n >\n }\n @if (connectors && step.connector !== null) {\n <!-- Across the gap to the next bar, at the running total that bar starts from. -->\n <span class=\"wr-waterfall-chart__connector\" [style.--wr-waterfall-chart-level]=\"step.connector\"></span>\n }\n </div>\n }\n\n <!-- After the bars, so it is drawn over them where zero runs through the plot. -->\n <span class=\"wr-waterfall-chart__baseline\" aria-hidden=\"true\"></span>\n </div>\n </div>\n\n <!-- Named on each step above, so the visible label row is decoration here. -->\n <div class=\"wr-waterfall-chart__labels\" aria-hidden=\"true\">\n @for (step of drawn(); track $index) {\n <span class=\"wr-waterfall-chart__label\" [class.wr-waterfall-chart__label--total]=\"step.kind === 'total'\">{{\n step.label\n }}</span>\n }\n </div>\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader who wants to move cell by cell, beside the steps\n rather than inside an `img`. Clipped to nothing by its own stylesheet, so it takes no\n room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,MAAM,QAAQ;AAUd,MAAM,WAAW,SAAyB,IAAI,KAAI;AAGlD,MAAM,WAAW,UAA0B,KAAK,MAAM,QAAQ,GAAI,IAAI,OAAQ;AAQ9E,MAAM,SAAS,UAA0B,OAAO,MAAM,YAAY,EAAE,CAAC,KAAK;AAuH1E,IAAa,mBAAb,MAAa,iBAAgB;CAMlB,QAAQ,MAAkC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAM7C,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,oBAAoB,YAAY,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A;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,gBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-charts-waterfall-chart.mjs","names":[],"sources":["../../../projects/lib/charts/waterfall-chart/waterfall-chart.ts","../../../projects/lib/charts/waterfall-chart/waterfall-chart.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Component, ElementRef, ViewEncapsulation, computed, effect, inject, input, isDevMode } from '@angular/core';\n\nimport {\n WrChartState,\n WrChartTable,\n type WrChartTableData,\n useChartHover,\n useChartNumbers,\n useChartState,\n wrChartAxis,\n wrChartColor,\n wrChartRound,\n} from 'ngwr/charts/core';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { type WrChartTooltipRow, useChartTooltip, wrCoerceChartTooltip } from 'ngwr/popover';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrWaterfallStep, WrWaterfallValueContext } from './types';\n\n/** What a step is: a change up, a change down, a change of nothing, or a total from zero. */\ntype Kind = 'increase' | 'decrease' | 'flat' | 'total';\n\n/**\n * U+2212 MINUS SIGN: as wide as the plus, where a hyphen is a short dash that reads as\n * punctuation. Every figure below zero takes it — a change, a running total, a total, a\n * tick — so one chart never prints two different minus signs side by side.\n */\nconst MINUS = '−';\n\n/**\n * A figure wrapped in U+2068 FIRST STRONG ISOLATE … U+2069 POP DIRECTIONAL ISOLATE, for the\n * tooltip, which renders outside the chart where no stylesheet of its own sets its\n * direction. A `−` in front of digits has no direction of its own, so in an RTL document\n * it would land on the digits' far side — `350−` beside a bar printing `−350`. The isolate\n * takes its direction from the figure's own first strong character, as `unicode-bidi:\n * plaintext` does for the figures on the drawing, so the two agree.\n */\nconst isolate = (text: string): string => `${text}`;\n\n/** A percentage to three decimals with `-0` folded to `0`, so an inline style stays short. */\nconst percent = (value: number): number => wrChartRound(value, 3);\n\n/**\n * A running total with the float noise of its additions taken off: 0.1 + 0.2 is\n * 0.30000000000000004, which would print as the total it is and still fail to equal the\n * 0.3 a host passes as that total. Fifteen significant digits is every digit a double\n * holds exactly.\n */\nconst clean = (value: number): number => Number(value.toPrecision(15)) || 0;\n\n/** One step with its arithmetic done: where the running total was, where it is, and where its bar runs. */\ninterface Resolved {\n readonly label: string;\n readonly kind: Kind;\n /** The step's change, or `null` on a total, which changes nothing. */\n readonly change: number | null;\n /** The running total before the step. */\n readonly start: number;\n /** The running total after it: what a total step shows. */\n readonly end: number;\n /** A total's own finite `value` where the steps above add up to something else, else `null`. */\n readonly mismatch: number | null;\n}\n\n/** One step as drawn and announced. */\ninterface DrawnStep {\n readonly label: string;\n readonly kind: Kind;\n readonly start: number;\n readonly end: number;\n /** The bar's bottom and top, as percentages of the drawing's height from its bottom. */\n readonly lo: number;\n readonly hi: number;\n /** The bar's paint, or `null` on a change of zero, which the stylesheet's neutral hook paints. */\n readonly color: string | null;\n /** The figure printed on the drawing: the signed change, or the total, as `valueFormat` writes a `'label'`. */\n readonly display: string;\n /** Whether that figure goes under the bar — a change down, a total below zero — rather than over it. */\n readonly below: boolean;\n /** The running totals before and after the step, as one attribute: what the harness reads. */\n readonly figures: string;\n /** The change in full with its sign, `''` on a total. */\n readonly changeText: string;\n /** The running total after the step, in full. */\n readonly totalText: string;\n /** What the step announces. */\n readonly name: string;\n /** The level of the connector to the next step, as a percentage of the drawing's height, or `null` for none. */\n readonly connector: number | null;\n}\n\n/**\n * Waterfall chart: how a figure gets from one value to another, one change at a time — an\n * opening balance, the revenue and costs that move it, the balance it closes on. HTML\n * marks laid out by the stylesheet, no dependency.\n *\n * @example\n * ```html\n * <wr-waterfall-chart\n * ariaLabel=\"Profit bridge, Q3\"\n * [steps]=\"[\n * { label: 'Opening', value: 4200, total: true },\n * { label: 'Sales', value: 1800 },\n * { label: 'Refunds', value: -350 },\n * { label: 'Payroll', value: -900 },\n * { label: 'Closing', value: 4750, total: true }\n * ]\"\n * />\n * ```\n *\n * **The arithmetic is the chart's.** A change step floats between the running total\n * before it and after it; a total step is a full bar from zero to the running total. A\n * total's own `value` is checked rather than drawn, so the bars cannot disagree with each\n * other: the closing bar ends exactly where the last change does, and in dev mode a\n * `value` that says otherwise warns — the steps above it do not add up to the figure the\n * host expected. The one total that is not checked is one before every change, where\n * nothing has run yet: its value is where the running total starts. A change that is not\n * a finite number counts as zero.\n *\n * **Colour is not the only channel.** An increase is `increaseColor`, a decrease\n * `decreaseColor` and a total `totalColor` — success, danger and the first colour of the\n * chart palette unless told otherwise — and each is also told apart without hue: a change\n * runs UP or DOWN from the thin connector that carries the previous running total to it,\n * its bar is rounded on the end it runs to, and with `showValues` its figure is printed on\n * that side, with its sign (`+1,800`, `−350`); a total stands on the zero line, its figure\n * has no `+` and its label is set in a heavier weight. A change of zero\n * — or of a value that is not a finite number — is neither: a hairline at the running\n * total in the neutral `--wr-waterfall-chart-flat-color`, printed `0` with no sign, and\n * classed `--flat` rather than as an increase.\n *\n * Those cues are the figures and the connectors. The figures are off by default, as on\n * every chart of the family, so the connectors are the cue a chart keeps unconfigured:\n * turning `showConnectors` off with `showValues` off leaves colour, and the 2px of\n * rounding, to tell a change up from a change down on screen - a +100 and a following\n * −100 float over the same span. Each step's name, the tooltip and the data table still\n * carry the change; keep one of the two on wherever the chart has to read without hue. On\n * a narrow chart a figure too wide for its column is left out (see `showValues`), and\n * there the connectors are the cue that stays.\n *\n * **The frame.** Gridlines across the plot (`showGrid`) with a scale beside it\n * (`showAxis`), both on by default, and the zero line either way. With no step the chart\n * keeps that frame and says \"No data\"; `loading` and `error` put their own message there\n * in place of the bars.\n *\n * Every figure below zero is written with `−` (U+2212 MINUS SIGN) in front of its\n * magnitude — a change, a running total, a total and a tick alike — so a name reads\n * \"Eq: −900, running total −600\" with one sign, not Intl's hyphen beside the chart's minus.\n *\n * **What a screen reader gets.** The chart is a named `role=\"group\"` of one `role=\"img\"`\n * per step, as the bar chart's columns are, each named with its change and the running\n * total after it — \"Refunds: −350, running total 5,650\" — or, for a total, \"Closing:\n * total 4,750\". `dataTable` adds the same figures as a table to walk cell by cell. The\n * tooltip is pointer only, and no part of the chart is a tab stop.\n *\n * The value axis always includes zero, so a total is a bar from the zero line and a\n * running total that goes negative hangs below it. Under RTL the steps run from the\n * right, with the value axis at the inline start, as every part of the layout is logical.\n * The gap between two bars is `--wr-waterfall-chart-gap`, a share of one step's band\n * (`--wr-chart-gap` by default) and never more than half of it, so a chart of many steps\n * narrows its gaps with its bars rather than running out of room. A bar moves to a new\n * value by a transform, so an update lays nothing out.\n *\n * @see https://ngwr.dev/charts/waterfall-chart\n */\n@Component({\n selector: 'wr-waterfall-chart',\n templateUrl: './waterfall-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-waterfall-chart',\n '[class.wr-waterfall-chart--axis]': 'showAxis()',\n // Room over and under the drawing for the figure printed past a bar's end.\n '[class.wr-waterfall-chart--values]': 'showValues()',\n // How many columns share the drawing: what the stylesheet holds the gap to, so many\n // steps narrow it with their bars rather than run out of room.\n '[style.--wr-waterfall-chart-steps]': 'steps().length || 1',\n },\n imports: [WrChartState, WrChartTable],\n})\nexport class WrWaterfallChart {\n /**\n * The steps, in order. A step without `total` is a change to the running total; a step\n * with it is a bar from zero showing the running total. See {@link WrWaterfallStep} for\n * what a total's `value` does.\n */\n readonly steps = input<readonly WrWaterfallStep[]>([]);\n\n /**\n * Accessible name of the chart, and the data table's caption. Each step names itself, so\n * say what the chart shows. Falls back to `waterfallChart.label` (\"Waterfall chart\").\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'waterfallChart.label', 'Waterfall chart');\n\n /** The colour of a change up. Any CSS colour, `var(--wr-…)` included. @default 'var(--wr-color-success)' */\n readonly increaseColor = input<string>('var(--wr-color-success)');\n\n /** The colour of a change down. Any CSS colour. @default 'var(--wr-color-danger)' */\n readonly decreaseColor = input<string>('var(--wr-color-danger)');\n\n /**\n * The colour of a total. Any CSS colour. The first colour of the chart palette, which is\n * the brand colour until `--wr-chart-1` is set: a total is neither a gain nor a loss, so\n * it takes no status colour. @default 'var(--wr-chart-1)'\n */\n readonly totalColor = input<string>(wrChartColor(0));\n\n /** The plot's height in px, at least 80. @default 240 */\n readonly height = input(240, { transform: (v: unknown): number => Math.max(80, coerceNumberProperty(v, 240)) });\n\n /**\n * Draw the gridlines: one across the plot at every tick of the value axis, in\n * `--wr-waterfall-chart-grid-color` (the chart theme's `--wr-chart-grid`). The zero line\n * is drawn either way. @default true\n */\n readonly showGrid = input(true, { transform: coerceBooleanProperty });\n\n /** Print the value axis' scale beside the plot: a number at every tick. @default true */\n readonly showAxis = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Print each step's figure past the end of its bar: a change with its sign, over the bar\n * when it runs up and under it when it runs down, and a total with no `+`. Compact from\n * a thousand up (`+1.2K`) by default; with `valueFormat`, whatever it writes for\n * `'label'`, so a formatter can go compact here and stay exact everywhere else.\n *\n * A figure is printed whole or not at all: one wider than its column and a quarter of\n * the gap on either side — which keeps it clear of its neighbours' — is left out rather\n * than cut, since `+$1,…` is not a figure and `−$9…` reads as −$9. The tooltip, the\n * names and the data table carry every figure in full.\n *\n * The sign is one of the two cues besides colour that tell a change up from a change\n * down; the connectors are the other. Off together with `showConnectors`, colour is the\n * only one left on screen. Off by default, as on every chart of the family: the scale,\n * the tooltip and each step's name already carry the figures. @default false\n */\n readonly showValues = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Draw the thin line that carries each running total across the gap to the next bar,\n * which starts from it. None leads into a total that starts a running total of its own\n * — one before every change, at a value the line would not meet.\n *\n * A change up leaves the line at its bottom and a change down at its top, so the line\n * is one of the two cues besides colour that tell them apart; the signed figures are\n * the other. Off together with `showValues`, colour is the only one left on screen.\n * @default true\n */\n readonly showConnectors = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a tooltip with the step's change and the running total after it on hover.\n * Pointer only — each step's accessible name already carries both.\n *\n * By default the pointer passes under the chip to the chart, so the next section\n * answers at once and the chip closes off the chart; `'hoverable'` lets the pointer\n * rest on the chip instead, as WCAG 1.4.13 asks of a hint. @default true\n */\n readonly tooltip = input<boolean | 'hoverable', unknown>(true, { transform: wrCoerceChartTooltip });\n\n /**\n * A request for the chart's data is in flight: the bars give way to the loading\n * message, over the grid and the scale the chart keeps. @default false\n */\n readonly loading = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The chart's data failed to load: the bars give way to the error message. `loading`\n * wins while both are set. @default false\n */\n readonly error = input(false, { transform: coerceBooleanProperty });\n\n /** The message shown with no step to draw. Falls back to `chart.empty`, then `'No data'`. */\n readonly emptyLabel = input<string | null>(null);\n\n /** The message shown while `loading`. Falls back to `chart.loading`, then `'Loading…'`. */\n readonly loadingLabel = input<string | null>(null);\n\n /** The message shown on `error`. Falls back to `chart.error`, then `'Could not load'`. */\n readonly errorLabel = input<string | null>(null);\n\n /**\n * Render the chart's figures as a table only assistive technology reaches, beside the\n * drawing: a row per step, headed by its label, with its change (empty on a total) and\n * the running total after it, each written as the tooltip writes it.\n *\n * Each step's accessible name already carries both figures; the table is for a reader\n * who wants to move through them cell by cell, with the column headings read out. It is\n * clipped to nothing: it takes no room, draws nothing and holds no tab stop.\n * @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Writes every number the chart shows: the figures on the drawing, the axis ticks, the\n * tooltip, the accessible names and the data table. Every figure is handed over as its\n * MAGNITUDE, never below zero, and the chart writes the sign in front: `+` or `−`\n * (U+2212 MINUS SIGN) on a change, `−` on a running total, a total or a tick below zero.\n * So one formatter writes every figure, and one minus sign appears throughout.\n *\n * It is told where the figure goes (see {@link WrWaterfallValueContext}): `'label'` past\n * a bar, where a compact form fits a narrow column; `'tick'` on the value axis; `'value'`\n * in the tooltip, the names and the data table, which a reader goes to for the exact\n * figure. A `(value) => string` written for another chart fits too, and writes all three\n * alike. `null` uses `Intl.NumberFormat` in `LOCALE_ID`: compact past the bars from a\n * thousand up, compact ticks (`1.2K`, `3.4M`) unless the full numbers are shorter, and\n * the exact figure everywhere else.\n */\n readonly valueFormat = input<((value: number, context: WrWaterfallValueContext) => string) | null>(null);\n\n /** The figures, the compact labels and the ticks, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers<[WrWaterfallValueContext]>(this.valueFormat);\n\n private readonly stepName = wrReadI18nText('waterfallChart.step', 'Step');\n private readonly changeName = wrReadI18nText('waterfallChart.change', 'Change');\n private readonly runningTotalName = wrReadI18nText('waterfallChart.runningTotal', 'Running total');\n private readonly changeStepName = useI18nFormatter(\n 'waterfallChart.changeStep',\n '{{label}}: {{change}}, running total {{total}}'\n );\n private readonly totalStepName = useI18nFormatter('waterfallChart.totalStep', '{{label}}: total {{total}}');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/waterfall-chart');\n // One listener pair for the whole chart: a step is whatever carries `data-wr-index`.\n useChartHover({ enter: index => this.tip.enter(index), leave: event => this.tip.leave(event) });\n // A total whose figure the steps above do not add up to is drawn at what they DO add\n // up to, which on screen is a chart that looks right about data that is not.\n if (isDevMode()) {\n const warned = new Set<string>();\n effect(() => {\n this.resolved().forEach((step, index) => {\n if (step.mismatch === null) return;\n const key = `${index}:${step.mismatch}:${step.end}`;\n if (warned.has(key)) return;\n warned.add(key);\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-waterfall-chart>: the total \"${step.label}\" (step ${index + 1}) is given as ${step.mismatch}, ` +\n `and the steps above it add up to ${step.end}. The bar shows ${step.end}.`\n );\n });\n });\n }\n }\n\n /**\n * Every step with its arithmetic done. The running total starts at zero, and a total\n * before every change sets it to its own value; a change moves it; a later total shows\n * it and only checks its own value against it.\n */\n private readonly resolved = computed<readonly Resolved[]>(() => {\n let running = 0;\n let moved = false;\n return this.steps().map((step): Resolved => {\n const value = Number.isFinite(step.value) ? step.value : null;\n const start = running;\n if (step.total) {\n let mismatch: number | null = null;\n if (!moved) {\n if (value !== null) running = clean(value);\n } else if (value !== null && clean(value) !== running) {\n mismatch = value;\n }\n return { label: step.label, kind: 'total', change: null, start, end: running, mismatch };\n }\n const change = value ?? 0;\n running = clean(running + change);\n moved = true;\n return {\n label: step.label,\n // Zero is neither way: a missing figure counted as nothing must not read as growth.\n kind: change < 0 ? 'decrease' : change > 0 ? 'increase' : 'flat',\n change,\n start,\n end: running,\n mismatch: null,\n };\n });\n });\n\n /**\n * The value axis, from `wrChartAxis` over every bar's two ends with zero always inside —\n * a total stands on it — snapped outward to a readable step and lifted a step where the\n * highest bar would end on the frame. With no step, the empty 0 to 1 frame.\n */\n protected readonly axis = computed(() => {\n const steps = this.resolved();\n if (steps.length === 0) return wrChartAxis(Number.NaN, Number.NaN);\n let min = 0;\n let max = 0;\n for (const { start, end, kind } of steps) {\n const from = kind === 'total' ? 0 : start;\n min = Math.min(min, from, end);\n max = Math.max(max, from, end);\n }\n return wrChartAxis(min, max, { includeZero: true });\n });\n\n /** Where zero is, as a percentage of the drawing's height from its bottom: the line every total stands on. */\n protected readonly zero = computed(() => this.level(0));\n\n /**\n * The ticks, top to bottom: each value's label, and its gridline's distance from the\n * drawing's top (for the label) and from its bottom (for the line).\n */\n protected readonly ticks = computed(() => {\n const { step, ticks } = this.axis();\n // Magnitudes, with the chart's own minus in front, as every other figure here.\n const labels = this.numbers.ticks(\n ticks.map(value => Math.abs(value)),\n step,\n 'tick'\n );\n return ticks.map((value, i) => {\n const bottom = this.level(value);\n return { label: value < 0 ? `${MINUS}${labels[i]}` : labels[i], bottom, top: percent(100 - bottom) };\n });\n });\n\n /**\n * The steps as drawn and announced: every figure written once, here, so the drawing, the\n * names, the tooltip and the table cannot disagree.\n */\n protected readonly drawn = computed<readonly DrawnStep[]>(() => {\n const steps = this.resolved();\n const colors: Record<Kind, string | null> = {\n increase: this.increaseColor(),\n decrease: this.decreaseColor(),\n flat: null,\n total: this.totalColor(),\n };\n return steps.map((step, i): DrawnStep => {\n const from = step.kind === 'total' ? 0 : step.start;\n const totalText = this.written(step.end, v => this.numbers.value(v, 'value'));\n const changeText = step.change === null ? '' : this.signed(step.change, v => this.numbers.value(v, 'value'));\n const next = steps[i + 1];\n // A change starts from the running total, and so does a total that shows it; a total\n // before every change starts one of its own, and a line into it would lead nowhere.\n const connected = next !== undefined && (next.kind !== 'total' || next.end === step.end);\n return {\n label: step.label,\n kind: step.kind,\n start: step.start,\n end: step.end,\n lo: this.level(Math.min(from, step.end)),\n hi: this.level(Math.max(from, step.end)),\n color: colors[step.kind],\n display:\n step.change === null\n ? this.written(step.end, v => this.numbers.label(v, 'label'))\n : this.signed(step.change, v => this.numbers.label(v, 'label')),\n below: step.kind === 'decrease' || (step.kind === 'total' && step.end < 0),\n figures: `${step.start} ${step.end}`,\n changeText,\n totalText,\n name:\n step.change === null\n ? this.totalStepName({ label: step.label, total: totalText })\n : this.changeStepName({ label: step.label, change: changeText, total: totalText }),\n connector: connected ? this.level(step.end) : null,\n };\n });\n });\n\n /**\n * Each step's classes, as ONE binding: its kind, `--down` where its bar runs down from\n * where it starts (a change down, a total below zero), which is the end the stylesheet\n * rounds, and `--active` on the step the tooltip is about. Five bindings a step were\n * five comparisons a step on every hover change; this is one string each.\n */\n protected readonly classes = computed<readonly string[]>(() => {\n const active = this.tip.active();\n return this.kinds().map((kind, index) => (index === active ? `${kind} wr-waterfall-chart__step--active` : kind));\n });\n\n /** The part of a step's classes a hover does not change. */\n private readonly kinds = computed<readonly string[]>(() =>\n this.drawn().map(\n step =>\n `wr-waterfall-chart__step wr-waterfall-chart__step--${step.kind}${step.below ? ' wr-waterfall-chart__step--down' : ''}`\n )\n );\n\n /** What the chart shows in place of its bars, or `null` while it draws them. */\n protected readonly state = useChartState({\n loading: this.loading,\n error: this.error,\n empty: computed(() => this.steps().length === 0),\n emptyLabel: this.emptyLabel,\n loadingLabel: this.loadingLabel,\n errorLabel: this.errorLabel,\n });\n\n /**\n * The figures for `dataTable`: the chart's name as the caption, a row per step headed by\n * its label, and its change and the running total after it as the columns. A total has\n * no change, so that cell is empty.\n */\n protected readonly tableData = computed<WrChartTableData>(() => ({\n caption: this.resolvedAriaLabel(),\n corner: this.stepName(),\n columns: [this.changeName(), this.runningTotalName()],\n groups: [{ rows: this.drawn().map(step => ({ header: step.label, cells: [step.changeText, step.totalText] })) }],\n }));\n\n /**\n * One tooltip for the whole chart, for the step under the pointer: its swatch and label\n * as the heading, then its change — a total has none — and the running total after it.\n * It points at the top edge of the BAR rather than at the column, which is the full\n * height of the plot; a change of zero keeps its hairline to point at, and no swatch,\n * since its neutral paint says nothing. Each figure is isolated (see `isolate`), so a\n * sign stays in front of its digits in an RTL document.\n *\n * The bar's box is worked out from the two ends the chart wrote and the column's own\n * box, not read off the bar: a bar is moved by a transform inside a box that clips it,\n * so its own box is neither where it is drawn nor, mid-transition, where it is going.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const step = this.state() ? undefined : this.drawn()[index];\n const column = this.host.querySelector(`[data-wr-index=\"${index}\"]`);\n if (!step || !column) return null;\n const box = column.getBoundingClientRect();\n const top = box.bottom - (step.hi / 100) * box.height;\n const anchor = { x: box.left, y: top, width: box.width, height: ((step.hi - step.lo) / 100) * box.height };\n const rows: WrChartTooltipRow[] = [];\n if (step.kind !== 'total') rows.push({ label: this.changeName(), value: isolate(step.changeText) });\n rows.push({ label: this.runningTotalName(), value: isolate(step.totalText) });\n const label = step.label;\n return {\n datum: step.color === null ? { label, value: '', rows } : { label, value: '', color: step.color, rows },\n anchor,\n };\n });\n\n /** Where `value` sits on the axis, as a percentage of the drawing's height from its bottom. */\n private level(value: number): number {\n const { min, max } = this.axis();\n return percent(((value - min) / (max - min)) * 100);\n }\n\n /** A change with its sign in front of its magnitude: `+` up, `−` down, and none for a change of zero. */\n private signed(change: number, write: (magnitude: number) => string): string {\n return change > 0 ? `+${write(change)}` : this.written(change, write);\n }\n\n /** A figure with `−` in front of its magnitude below zero and no sign otherwise: a running total, a total. */\n private written(value: number, write: (magnitude: number) => string): string {\n return value < 0 ? `${MINUS}${write(-value)}` : write(Math.abs(value));\n }\n}\n\nexport type { WrWaterfallStep, WrWaterfallValueContext } from './types';\n","@let values = showValues();\n@let shown = state();\n@let stepClasses = classes();\n@let connectors = showConnectors();\n<!-- Two columns: the value axis' tick labels at inline start and the plot beside them,\n with the step labels under the plot only, so their slots are the plot's columns. -->\n<div class=\"wr-waterfall-chart__body\">\n @if (showAxis()) {\n <!-- HTML beside the plot rather than inside it, in flow, so the column is exactly as\n wide as the longest label; each one hands the stylesheet the y of its own\n gridline. Hidden: every figure is in a step's own name, and the axis is the eye's. -->\n <div class=\"wr-waterfall-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of ticks(); track $index) {\n <span class=\"wr-waterfall-chart__tick\" [style.--wr-waterfall-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <!-- A named `group` of one named `img` per step, as the bar chart's columns are. Not one\n `img` round the whole chart: `img` makes everything inside it presentational, and\n WebKit drops such a subtree, so every step's own name would go with it. -->\n <div\n class=\"wr-waterfall-chart__plot\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\n >\n <!-- The drawing: every position in it is a percentage of its height from the bottom,\n handed to the stylesheet as a number. -->\n <div class=\"wr-waterfall-chart__track\" [style.--wr-waterfall-chart-zero]=\"zero()\">\n @if (showGrid()) {\n @for (tick of ticks(); track $index) {\n <span\n class=\"wr-waterfall-chart__grid-line\"\n aria-hidden=\"true\"\n [style.--wr-waterfall-chart-level]=\"tick.bottom\"\n ></span>\n }\n }\n\n <!-- Before the bars, so a bar that reaches zero covers it and a total of 0 draws nothing. -->\n <span class=\"wr-waterfall-chart__baseline\" aria-hidden=\"true\"></span>\n\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the grid and the scale the chart keeps. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n } @else {\n @for (step of drawn(); track $index) {\n <!-- Its change and the running total after it in its name: the figure inside is\n drawn for the eye, and the `img` role makes it presentational. The bar's two\n ends are handed to the stylesheet; `data-wr-index` is what the chart's one\n hover listener reads, and `data-step` the running totals before and after,\n beside the name that says them in words. -->\n <div\n role=\"img\"\n [class]=\"stepClasses[$index]\"\n [attr.aria-label]=\"step.name\"\n [attr.data-wr-index]=\"$index\"\n [attr.data-step]=\"step.figures\"\n [style.--wr-waterfall-chart-lo]=\"step.lo\"\n [style.--wr-waterfall-chart-hi]=\"step.hi\"\n >\n <!-- The bar is the part of the painted box its clip lets through: both are moved\n by a transform, so a new value lays nothing out. A change of zero writes no\n paint: its neutral hairline is the stylesheet's hook. -->\n <span class=\"wr-waterfall-chart__clip\"\n ><span class=\"wr-waterfall-chart__bar\" [style.background]=\"step.color\"></span\n ></span>\n @if (values) {\n <!-- The slot carries the figure to the end of the bar by a transform. In it, a\n line one figure tall that the figure joins only where it fits whole; one\n that does not wraps out of sight below it (see the stylesheet). -->\n <span class=\"wr-waterfall-chart__value-slot\" [class.wr-waterfall-chart__value-slot--below]=\"step.below\"\n ><span class=\"wr-waterfall-chart__value\" [class.wr-waterfall-chart__value--below]=\"step.below\"\n ><span class=\"wr-waterfall-chart__value-text\">{{ step.display }}</span></span\n ></span\n >\n }\n @if (connectors && step.connector !== null) {\n <!-- Across the gap to the next bar, at the running total that bar starts from. -->\n <span class=\"wr-waterfall-chart__connector\" [style.--wr-waterfall-chart-level]=\"step.connector\"></span>\n }\n </div>\n }\n }\n </div>\n </div>\n\n <!-- Named on each step above, so the visible label row is decoration here. -->\n <div class=\"wr-waterfall-chart__labels\" aria-hidden=\"true\">\n @for (step of drawn(); track $index) {\n <span class=\"wr-waterfall-chart__label\" [class.wr-waterfall-chart__label--total]=\"step.kind === 'total'\">{{\n step.label\n }}</span>\n }\n </div>\n</div>\n\n@if (dataTable() && !shown) {\n <!-- The figures for a screen reader who wants to move cell by cell, beside the steps\n rather than inside an `img`. Clipped to nothing by its own stylesheet, so it takes no\n room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;AAmCA,MAAM,QAAQ;AAUd,MAAM,WAAW,SAAyB,IAAI,KAAI;AAGlD,MAAM,WAAW,UAA0B,aAAa,OAAO,CAAC;AAQhE,MAAM,SAAS,UAA0B,OAAO,MAAM,YAAY,EAAE,CAAC,KAAK;AAmI1E,IAAa,mBAAb,MAAa,iBAAgB;CAMlB,QAAQ,MAAkC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QA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