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,11 +1,12 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { Component, ViewEncapsulation, computed, input, model, viewChild } from "@angular/core";
|
|
3
3
|
import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
|
|
4
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
4
5
|
import { wrCheckStyles } from "ngwr/utils";
|
|
5
6
|
import { useI18nText } from "ngwr/i18n";
|
|
6
7
|
import { WR_CHART_LEGEND_BLOCK, WrChartLegend } from "ngwr/charts/chart-legend";
|
|
7
|
-
import { useChartNumbers, wrChartColor } from "ngwr/charts/core";
|
|
8
|
-
import { useChartTooltip } from "ngwr/popover";
|
|
8
|
+
import { WrChartState, useChartHover, useChartNumbers, useChartState, wrChartColor } from "ngwr/charts/core";
|
|
9
|
+
import { useChartTooltip, wrCoerceChartTooltip } from "ngwr/popover";
|
|
9
10
|
/**
|
|
10
11
|
* @license
|
|
11
12
|
*
|
|
@@ -20,6 +21,10 @@ const MAX_HIT_ANGLE = Math.PI / 12;
|
|
|
20
21
|
var WrDonutChart = class WrDonutChart {
|
|
21
22
|
constructor() {
|
|
22
23
|
if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("charts/donut-chart");
|
|
24
|
+
useChartHover({
|
|
25
|
+
enter: (index) => this.tip.enter(index),
|
|
26
|
+
leave: (event) => this.tip.leave(event)
|
|
27
|
+
});
|
|
23
28
|
}
|
|
24
29
|
segments = input([], ...ngDevMode ? [{ debugName: "segments" }] : /* istanbul ignore next */ []);
|
|
25
30
|
ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
@@ -38,10 +43,26 @@ var WrDonutChart = class WrDonutChart {
|
|
|
38
43
|
...ngDevMode ? { debugName: "pie" } : /* istanbul ignore next */ {},
|
|
39
44
|
transform: coerceBooleanProperty
|
|
40
45
|
});
|
|
41
|
-
|
|
46
|
+
gapless = input(false, {
|
|
47
|
+
...ngDevMode ? { debugName: "gapless" } : /* istanbul ignore next */ {},
|
|
48
|
+
transform: coerceBooleanProperty
|
|
49
|
+
});
|
|
50
|
+
showLegend = input("auto", {
|
|
42
51
|
...ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {},
|
|
52
|
+
transform: (value) => value === "auto" ? "auto" : coerceBooleanProperty(value)
|
|
53
|
+
});
|
|
54
|
+
legendPosition = input("bottom", ...ngDevMode ? [{ debugName: "legendPosition" }] : /* istanbul ignore next */ []);
|
|
55
|
+
loading = input(false, {
|
|
56
|
+
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
57
|
+
transform: coerceBooleanProperty
|
|
58
|
+
});
|
|
59
|
+
error = input(false, {
|
|
60
|
+
...ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {},
|
|
43
61
|
transform: coerceBooleanProperty
|
|
44
62
|
});
|
|
63
|
+
emptyLabel = input(null, ...ngDevMode ? [{ debugName: "emptyLabel" }] : /* istanbul ignore next */ []);
|
|
64
|
+
loadingLabel = input(null, ...ngDevMode ? [{ debugName: "loadingLabel" }] : /* istanbul ignore next */ []);
|
|
65
|
+
errorLabel = input(null, ...ngDevMode ? [{ debugName: "errorLabel" }] : /* istanbul ignore next */ []);
|
|
45
66
|
toggleableLegend = input(false, {
|
|
46
67
|
...ngDevMode ? { debugName: "toggleableLegend" } : /* istanbul ignore next */ {},
|
|
47
68
|
transform: coerceBooleanProperty
|
|
@@ -49,10 +70,10 @@ var WrDonutChart = class WrDonutChart {
|
|
|
49
70
|
hiddenSegments = model([], ...ngDevMode ? [{ debugName: "hiddenSegments" }] : /* istanbul ignore next */ []);
|
|
50
71
|
centerValue = input("", ...ngDevMode ? [{ debugName: "centerValue" }] : /* istanbul ignore next */ []);
|
|
51
72
|
centerLabel = input("", ...ngDevMode ? [{ debugName: "centerLabel" }] : /* istanbul ignore next */ []);
|
|
52
|
-
showCenter = computed(() => !this.pie() && (!!this.centerValue() || !!this.centerLabel()), ...ngDevMode ? [{ debugName: "showCenter" }] : /* istanbul ignore next */ []);
|
|
73
|
+
showCenter = computed(() => !this.pie() && !this.state() && (!!this.centerValue() || !!this.centerLabel()), ...ngDevMode ? [{ debugName: "showCenter" }] : /* istanbul ignore next */ []);
|
|
53
74
|
tooltip = input(true, {
|
|
54
75
|
...ngDevMode ? { debugName: "tooltip" } : /* istanbul ignore next */ {},
|
|
55
|
-
transform:
|
|
76
|
+
transform: wrCoerceChartTooltip
|
|
56
77
|
});
|
|
57
78
|
valueFormat = input(null, ...ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []);
|
|
58
79
|
numbers = useChartNumbers(this.valueFormat);
|
|
@@ -96,7 +117,7 @@ var WrDonutChart = class WrDonutChart {
|
|
|
96
117
|
});
|
|
97
118
|
}, ...ngDevMode ? [{ debugName: "slices" }] : /* istanbul ignore next */ []);
|
|
98
119
|
hits = computed(() => {
|
|
99
|
-
if (!this.pie() || !this.tooltip()) return [];
|
|
120
|
+
if (!this.pie() || !this.tooltip() || this.state()) return [];
|
|
100
121
|
const min = Math.min(MAX_HIT_ANGLE, HIT_PX / (this.size() / 2));
|
|
101
122
|
const drawn = this.slices().map((slice, index) => ({
|
|
102
123
|
index,
|
|
@@ -165,10 +186,34 @@ var WrDonutChart = class WrDonutChart {
|
|
|
165
186
|
color,
|
|
166
187
|
value: text === "" ? null : text
|
|
167
188
|
})), ...ngDevMode ? [{ debugName: "legendItems" }] : /* istanbul ignore next */ []);
|
|
189
|
+
legendShown = computed(() => {
|
|
190
|
+
const show = this.showLegend();
|
|
191
|
+
const rows = this.legendItems().length;
|
|
192
|
+
if (show === false || rows === 0 || this.legendPosition() === "none") return false;
|
|
193
|
+
return show === true || rows > 1;
|
|
194
|
+
}, ...ngDevMode ? [{ debugName: "legendShown" }] : /* istanbul ignore next */ []);
|
|
195
|
+
legendFirst = computed(() => {
|
|
196
|
+
const position = this.legendPosition();
|
|
197
|
+
return position === "top" || position === "start";
|
|
198
|
+
}, ...ngDevMode ? [{ debugName: "legendFirst" }] : /* istanbul ignore next */ []);
|
|
199
|
+
legendSide = computed(() => {
|
|
200
|
+
const position = this.legendPosition();
|
|
201
|
+
return position === "start" || position === "end";
|
|
202
|
+
}, ...ngDevMode ? [{ debugName: "legendSide" }] : /* istanbul ignore next */ []);
|
|
203
|
+
empty = computed(() => this.segments().every((s) => weight(s.value) === 0), ...ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []);
|
|
204
|
+
state = useChartState({
|
|
205
|
+
loading: this.loading,
|
|
206
|
+
error: this.error,
|
|
207
|
+
empty: this.empty,
|
|
208
|
+
emptyLabel: this.emptyLabel,
|
|
209
|
+
loadingLabel: this.loadingLabel,
|
|
210
|
+
errorLabel: this.errorLabel
|
|
211
|
+
});
|
|
212
|
+
track = computed(() => this.state() || this.slices().every((slice) => !slice.path) ? this.arcPath(0, Math.PI * 2) : null, ...ngDevMode ? [{ debugName: "track" }] : /* istanbul ignore next */ []);
|
|
168
213
|
tip = useChartTooltip(this.tooltip, (index) => {
|
|
169
214
|
const slice = this.slices()[index];
|
|
170
215
|
const svg = this.svg()?.nativeElement;
|
|
171
|
-
if (!slice?.path || !svg) return null;
|
|
216
|
+
if (!slice?.path || !svg || this.state()) return null;
|
|
172
217
|
const box = svg.getBoundingClientRect();
|
|
173
218
|
const cos = Math.cos(slice.midAngle);
|
|
174
219
|
const sin = Math.sin(slice.midAngle);
|
|
@@ -270,6 +315,13 @@ var WrDonutChart = class WrDonutChart {
|
|
|
270
315
|
isRequired: false,
|
|
271
316
|
transformFunction: null
|
|
272
317
|
},
|
|
318
|
+
gapless: {
|
|
319
|
+
classPropertyName: "gapless",
|
|
320
|
+
publicName: "gapless",
|
|
321
|
+
isSignal: true,
|
|
322
|
+
isRequired: false,
|
|
323
|
+
transformFunction: null
|
|
324
|
+
},
|
|
273
325
|
showLegend: {
|
|
274
326
|
classPropertyName: "showLegend",
|
|
275
327
|
publicName: "showLegend",
|
|
@@ -277,6 +329,48 @@ var WrDonutChart = class WrDonutChart {
|
|
|
277
329
|
isRequired: false,
|
|
278
330
|
transformFunction: null
|
|
279
331
|
},
|
|
332
|
+
legendPosition: {
|
|
333
|
+
classPropertyName: "legendPosition",
|
|
334
|
+
publicName: "legendPosition",
|
|
335
|
+
isSignal: true,
|
|
336
|
+
isRequired: false,
|
|
337
|
+
transformFunction: null
|
|
338
|
+
},
|
|
339
|
+
loading: {
|
|
340
|
+
classPropertyName: "loading",
|
|
341
|
+
publicName: "loading",
|
|
342
|
+
isSignal: true,
|
|
343
|
+
isRequired: false,
|
|
344
|
+
transformFunction: null
|
|
345
|
+
},
|
|
346
|
+
error: {
|
|
347
|
+
classPropertyName: "error",
|
|
348
|
+
publicName: "error",
|
|
349
|
+
isSignal: true,
|
|
350
|
+
isRequired: false,
|
|
351
|
+
transformFunction: null
|
|
352
|
+
},
|
|
353
|
+
emptyLabel: {
|
|
354
|
+
classPropertyName: "emptyLabel",
|
|
355
|
+
publicName: "emptyLabel",
|
|
356
|
+
isSignal: true,
|
|
357
|
+
isRequired: false,
|
|
358
|
+
transformFunction: null
|
|
359
|
+
},
|
|
360
|
+
loadingLabel: {
|
|
361
|
+
classPropertyName: "loadingLabel",
|
|
362
|
+
publicName: "loadingLabel",
|
|
363
|
+
isSignal: true,
|
|
364
|
+
isRequired: false,
|
|
365
|
+
transformFunction: null
|
|
366
|
+
},
|
|
367
|
+
errorLabel: {
|
|
368
|
+
classPropertyName: "errorLabel",
|
|
369
|
+
publicName: "errorLabel",
|
|
370
|
+
isSignal: true,
|
|
371
|
+
isRequired: false,
|
|
372
|
+
transformFunction: null
|
|
373
|
+
},
|
|
280
374
|
toggleableLegend: {
|
|
281
375
|
classPropertyName: "toggleableLegend",
|
|
282
376
|
publicName: "toggleableLegend",
|
|
@@ -322,8 +416,12 @@ var WrDonutChart = class WrDonutChart {
|
|
|
322
416
|
},
|
|
323
417
|
outputs: { hiddenSegments: "hiddenSegmentsChange" },
|
|
324
418
|
host: {
|
|
325
|
-
properties: {
|
|
326
|
-
|
|
419
|
+
properties: {
|
|
420
|
+
"class.wr-donut-chart--pie": "pie()",
|
|
421
|
+
"class.wr-donut-chart--gapless": "gapless()",
|
|
422
|
+
"class.wr-chart--legend-side": "legendShown() && legendSide()"
|
|
423
|
+
},
|
|
424
|
+
classAttribute: "wr-donut-chart wr-chart--legend"
|
|
327
425
|
},
|
|
328
426
|
viewQueries: [{
|
|
329
427
|
propertyName: "svg",
|
|
@@ -333,20 +431,39 @@ var WrDonutChart = class WrDonutChart {
|
|
|
333
431
|
isSignal: true
|
|
334
432
|
}],
|
|
335
433
|
ngImport: i0,
|
|
336
|
-
template: "<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper. `img` is a\n children-presentational role, so with it out here WebKit dropped the whole\n subtree — including the centre value and label, which are real text and are\n the headline datum the legend does not carry. -->\n <svg #svg viewBox=\"0 0 100 100\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <!-- Every slice is stroked in the SURFACE colour (`--wr-donut-chart-slice-gap-color`,\n from the stylesheet), so adjacent arcs are separated by a visible gap rather than\n by the boundary between two fills. Without it the only thing dividing two slices\n is the colour change itself, and
|
|
337
|
-
dependencies: [
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
434
|
+
template: "@let shown = state();\n\n<!-- The legend, drawn before the drawing or after it so it is in the DOM where it is on\n screen: a toggleable legend's rows are tab stops, and their order follows it. The key\n is `aria-hidden`: the row's text is its name, and the dot carries no word of its own. -->\n<ng-template #legend>\n <ul\n wr-chart-legend\n class=\"wr-donut-chart__legend\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSegments\"\n ></ul>\n</ng-template>\n\n@if (legendShown() && legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper. `img` is a\n children-presentational role, so with it out here WebKit dropped the whole\n subtree — including the centre value and label, which are real text and are\n the headline datum the legend does not carry. -->\n <svg #svg viewBox=\"0 0 100 100\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\">\n @if (track(); as ring) {\n <!-- The frame the chart keeps with no slice to draw: the ring itself, as a track. -->\n <path class=\"wr-donut-chart__track\" [attr.d]=\"ring\" />\n }\n <!-- Every slice is stroked in the SURFACE colour (`--wr-donut-chart-slice-gap-color`,\n from the stylesheet), so adjacent arcs are separated by a visible gap rather than\n by the boundary between two fills. Without it the only thing dividing two slices\n is the colour change itself, and for a reader who cannot separate hue two\n neighbours merge into one arc and the chart reads as having fewer slices than it\n has. A gap is a shape, and it survives greyscale, printing and a monochrome\n display. The stroke does not scale with the drawing, so the gap is the same\n pixels at any `size`; its width is the stylesheet's. -->\n @if (!shown) {\n @for (slice of slices(); track $index) {\n <!-- A hidden slice draws nothing at all; the index stays the slice's own, which is\n what the tooltip looks it up by. `data-wr-index` is what the chart's one hover\n listener reads, and `data-wr-series` the slice's legend row, which the hover\n dims by. -->\n @if (!slice.hidden) {\n <path\n class=\"wr-donut-chart__slice\"\n [attr.d]=\"slice.path\"\n [attr.fill]=\"slice.color\"\n [style.--wr-donut-chart-slice-color]=\"slice.color\"\n [attr.data-wr-index]=\"$index\"\n [attr.data-wr-series]=\"$index\"\n stroke-linejoin=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n }\n <!-- A sliver's wider hover target in a pie, filled with nothing: see `hits`, which is\n empty for the ring and with the tooltip off. Last, so it wins the pointer over the\n slices it reaches into; `fill`, so the unpainted stroke is not hit-tested and the\n edges stay where `hits` put them. It carries its slice's index and legend row, so\n the hover reads it as the slice. -->\n @for (hit of hits(); track hit.index) {\n <path\n class=\"wr-donut-chart__hit\"\n [attr.d]=\"hit.path\"\n [attr.data-wr-index]=\"hit.index\"\n [attr.data-wr-series]=\"hit.index\"\n fill=\"none\"\n pointer-events=\"fill\"\n />\n }\n }\n </svg>\n <!-- Never with `pie`: a pie has no hole to print in. -->\n @if (showCenter()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the track the chart keeps. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n }\n</div>\n\n@if (legendShown() && !legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n",
|
|
435
|
+
dependencies: [
|
|
436
|
+
{
|
|
437
|
+
kind: "directive",
|
|
438
|
+
type: NgTemplateOutlet,
|
|
439
|
+
selector: "[ngTemplateOutlet]",
|
|
440
|
+
inputs: [
|
|
441
|
+
"ngTemplateOutletContext",
|
|
442
|
+
"ngTemplateOutlet",
|
|
443
|
+
"ngTemplateOutletInjector"
|
|
444
|
+
]
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
kind: "component",
|
|
448
|
+
type: WrChartLegend,
|
|
449
|
+
selector: "ul[wr-chart-legend]",
|
|
450
|
+
inputs: [
|
|
451
|
+
"items",
|
|
452
|
+
"position",
|
|
453
|
+
"toggleable",
|
|
454
|
+
"hiddenSeries",
|
|
455
|
+
"ariaLabel",
|
|
456
|
+
"hiddenLabel"
|
|
457
|
+
],
|
|
458
|
+
outputs: ["hiddenSeriesChange", "toggled"]
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
kind: "component",
|
|
462
|
+
type: WrChartState,
|
|
463
|
+
selector: "wr-chart-state",
|
|
464
|
+
inputs: ["kind", "label"]
|
|
465
|
+
}
|
|
466
|
+
],
|
|
350
467
|
viewProviders: [{
|
|
351
468
|
provide: WR_CHART_LEGEND_BLOCK,
|
|
352
469
|
useValue: "wr-donut-chart"
|
|
@@ -365,15 +482,21 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
365
482
|
selector: "wr-donut-chart",
|
|
366
483
|
encapsulation: ViewEncapsulation.None,
|
|
367
484
|
host: {
|
|
368
|
-
class: "wr-donut-chart",
|
|
369
|
-
"[class.wr-donut-chart--pie]": "pie()"
|
|
485
|
+
class: "wr-donut-chart wr-chart--legend",
|
|
486
|
+
"[class.wr-donut-chart--pie]": "pie()",
|
|
487
|
+
"[class.wr-donut-chart--gapless]": "gapless()",
|
|
488
|
+
"[class.wr-chart--legend-side]": "legendShown() && legendSide()"
|
|
370
489
|
},
|
|
371
|
-
imports: [
|
|
490
|
+
imports: [
|
|
491
|
+
NgTemplateOutlet,
|
|
492
|
+
WrChartLegend,
|
|
493
|
+
WrChartState
|
|
494
|
+
],
|
|
372
495
|
viewProviders: [{
|
|
373
496
|
provide: WR_CHART_LEGEND_BLOCK,
|
|
374
497
|
useValue: "wr-donut-chart"
|
|
375
498
|
}],
|
|
376
|
-
template: "<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper. `img` is a\n children-presentational role, so with it out here WebKit dropped the whole\n subtree — including the centre value and label, which are real text and are\n the headline datum the legend does not carry. -->\n <svg #svg viewBox=\"0 0 100 100\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <!-- Every slice is stroked in the SURFACE colour (`--wr-donut-chart-slice-gap-color`,\n from the stylesheet), so adjacent arcs are separated by a visible gap rather than\n by the boundary between two fills. Without it the only thing dividing two slices\n is the colour change itself, and
|
|
499
|
+
template: "@let shown = state();\n\n<!-- The legend, drawn before the drawing or after it so it is in the DOM where it is on\n screen: a toggleable legend's rows are tab stops, and their order follows it. The key\n is `aria-hidden`: the row's text is its name, and the dot carries no word of its own. -->\n<ng-template #legend>\n <ul\n wr-chart-legend\n class=\"wr-donut-chart__legend\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSegments\"\n ></ul>\n</ng-template>\n\n@if (legendShown() && legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper. `img` is a\n children-presentational role, so with it out here WebKit dropped the whole\n subtree — including the centre value and label, which are real text and are\n the headline datum the legend does not carry. -->\n <svg #svg viewBox=\"0 0 100 100\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\">\n @if (track(); as ring) {\n <!-- The frame the chart keeps with no slice to draw: the ring itself, as a track. -->\n <path class=\"wr-donut-chart__track\" [attr.d]=\"ring\" />\n }\n <!-- Every slice is stroked in the SURFACE colour (`--wr-donut-chart-slice-gap-color`,\n from the stylesheet), so adjacent arcs are separated by a visible gap rather than\n by the boundary between two fills. Without it the only thing dividing two slices\n is the colour change itself, and for a reader who cannot separate hue two\n neighbours merge into one arc and the chart reads as having fewer slices than it\n has. A gap is a shape, and it survives greyscale, printing and a monochrome\n display. The stroke does not scale with the drawing, so the gap is the same\n pixels at any `size`; its width is the stylesheet's. -->\n @if (!shown) {\n @for (slice of slices(); track $index) {\n <!-- A hidden slice draws nothing at all; the index stays the slice's own, which is\n what the tooltip looks it up by. `data-wr-index` is what the chart's one hover\n listener reads, and `data-wr-series` the slice's legend row, which the hover\n dims by. -->\n @if (!slice.hidden) {\n <path\n class=\"wr-donut-chart__slice\"\n [attr.d]=\"slice.path\"\n [attr.fill]=\"slice.color\"\n [style.--wr-donut-chart-slice-color]=\"slice.color\"\n [attr.data-wr-index]=\"$index\"\n [attr.data-wr-series]=\"$index\"\n stroke-linejoin=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n }\n <!-- A sliver's wider hover target in a pie, filled with nothing: see `hits`, which is\n empty for the ring and with the tooltip off. Last, so it wins the pointer over the\n slices it reaches into; `fill`, so the unpainted stroke is not hit-tested and the\n edges stay where `hits` put them. It carries its slice's index and legend row, so\n the hover reads it as the slice. -->\n @for (hit of hits(); track hit.index) {\n <path\n class=\"wr-donut-chart__hit\"\n [attr.d]=\"hit.path\"\n [attr.data-wr-index]=\"hit.index\"\n [attr.data-wr-series]=\"hit.index\"\n fill=\"none\"\n pointer-events=\"fill\"\n />\n }\n }\n </svg>\n <!-- Never with `pie`: a pie has no hole to print in. -->\n @if (showCenter()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the track the chart keeps. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n }\n</div>\n\n@if (legendShown() && !legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n"
|
|
377
500
|
}]
|
|
378
501
|
}],
|
|
379
502
|
ctorParameters: () => [],
|
|
@@ -418,6 +541,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
418
541
|
required: false
|
|
419
542
|
}]
|
|
420
543
|
}],
|
|
544
|
+
gapless: [{
|
|
545
|
+
type: i0.Input,
|
|
546
|
+
args: [{
|
|
547
|
+
isSignal: true,
|
|
548
|
+
alias: "gapless",
|
|
549
|
+
required: false
|
|
550
|
+
}]
|
|
551
|
+
}],
|
|
421
552
|
showLegend: [{
|
|
422
553
|
type: i0.Input,
|
|
423
554
|
args: [{
|
|
@@ -426,6 +557,54 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
426
557
|
required: false
|
|
427
558
|
}]
|
|
428
559
|
}],
|
|
560
|
+
legendPosition: [{
|
|
561
|
+
type: i0.Input,
|
|
562
|
+
args: [{
|
|
563
|
+
isSignal: true,
|
|
564
|
+
alias: "legendPosition",
|
|
565
|
+
required: false
|
|
566
|
+
}]
|
|
567
|
+
}],
|
|
568
|
+
loading: [{
|
|
569
|
+
type: i0.Input,
|
|
570
|
+
args: [{
|
|
571
|
+
isSignal: true,
|
|
572
|
+
alias: "loading",
|
|
573
|
+
required: false
|
|
574
|
+
}]
|
|
575
|
+
}],
|
|
576
|
+
error: [{
|
|
577
|
+
type: i0.Input,
|
|
578
|
+
args: [{
|
|
579
|
+
isSignal: true,
|
|
580
|
+
alias: "error",
|
|
581
|
+
required: false
|
|
582
|
+
}]
|
|
583
|
+
}],
|
|
584
|
+
emptyLabel: [{
|
|
585
|
+
type: i0.Input,
|
|
586
|
+
args: [{
|
|
587
|
+
isSignal: true,
|
|
588
|
+
alias: "emptyLabel",
|
|
589
|
+
required: false
|
|
590
|
+
}]
|
|
591
|
+
}],
|
|
592
|
+
loadingLabel: [{
|
|
593
|
+
type: i0.Input,
|
|
594
|
+
args: [{
|
|
595
|
+
isSignal: true,
|
|
596
|
+
alias: "loadingLabel",
|
|
597
|
+
required: false
|
|
598
|
+
}]
|
|
599
|
+
}],
|
|
600
|
+
errorLabel: [{
|
|
601
|
+
type: i0.Input,
|
|
602
|
+
args: [{
|
|
603
|
+
isSignal: true,
|
|
604
|
+
alias: "errorLabel",
|
|
605
|
+
required: false
|
|
606
|
+
}]
|
|
607
|
+
}],
|
|
429
608
|
toggleableLegend: [{
|
|
430
609
|
type: i0.Input,
|
|
431
610
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-charts-donut-chart.mjs","names":[],"sources":["../../../projects/lib/charts/donut-chart/donut-chart.ts","../../../projects/lib/charts/donut-chart/donut-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, type ElementRef, ViewEncapsulation, computed, input, model, viewChild } from '@angular/core';\n\nimport { WR_CHART_LEGEND_BLOCK, WrChartLegend, type WrChartLegendItem } from 'ngwr/charts/chart-legend';\nimport { wrChartColor, useChartNumbers } from 'ngwr/charts/core';\nimport { useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip } from 'ngwr/popover';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrDonutSegment } from './types';\n\n/**\n * A segment's contribution to the ring. `Math.max(0, NaN)` is NaN, and the running total\n * carries it forward — so one non-finite datum used to take out its own arc AND every arc\n * after it, writing the literal text `NaN` into the path `d`.\n */\nfunction weight(value: number): number {\n return Number.isFinite(value) ? Math.max(0, value) : 0;\n}\n\n/**\n * How wide a slice's hover target is at least, along the outer edge, in CSS px. A\n * slice narrower than that — a share of a percent or two, which at the default 200px\n * is a few px of arc — is a target no pointer lands on, so it gets a wider one; see\n * `hits`.\n */\nconst HIT_PX = 12;\n\n/**\n * The widest that target may grow, in radians, whatever the chart's size: on a 48px\n * chart 12px of arc is a third of a quarter turn, which would take too much of the\n * slices beside it.\n */\nconst MAX_HIT_ANGLE = Math.PI / 12;\n\n/**\n * Donut chart, and with `pie` a pie chart. Optional center text via inputs.\n *\n * @example\n * ```html\n * <wr-donut-chart [segments]=\"[\n * { label: 'Used', value: 60 },\n * { label: 'Free', value: 40 }\n * ]\" centerLabel=\"Disk\" centerValue=\"60%\" />\n *\n * <wr-donut-chart [segments]=\"segments\" pie />\n * ```\n *\n * The legend is a `ul[wr-chart-legend]` (`ngwr/charts/chart-legend`), and with\n * `toggleableLegend` its rows show and hide their slices through `hiddenSegments`.\n *\n * @see https://ngwr.dev/charts/donut-chart\n */\n@Component({\n selector: 'wr-donut-chart',\n templateUrl: './donut-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-donut-chart', '[class.wr-donut-chart--pie]': 'pie()' },\n imports: [WrChartLegend],\n // The legend's rows keep the classes this chart drew before it drew them through\n // `WrChartLegend`: `.wr-donut-chart__legend-item`, `__swatch`, `__legend-label` and\n // `__legend-value`.\n viewProviders: [{ provide: WR_CHART_LEGEND_BLOCK, useValue: 'wr-donut-chart' }],\n})\nexport class WrDonutChart {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/donut-chart');\n }\n\n /**\n * The slices, drawn clockwise from twelve o'clock. A segment with no `color`\n * takes the next entry from the chart's fallback palette.\n */\n readonly segments = input<readonly WrDonutSegment[]>([]);\n\n /**\n * Accessible name of the drawing. The arcs carry no text and the legend is optional, so\n * with `showLegend: false` this and the centre text are the whole of what a screen reader\n * gets. Falls back to `donutChart.label`, or to `donutChart.pieLabel` with `pie`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly donutLabel = useI18nText(this.ariaLabel, 'donutChart.label', 'Donut chart');\n private readonly pieLabel = useI18nText(this.ariaLabel, 'donutChart.pieLabel', 'Pie chart');\n\n protected readonly resolvedAriaLabel = computed(() => (this.pie() ? this.pieLabel() : this.donutLabel()));\n\n /** Diameter in CSS pixels. @default 200 */\n readonly size = input(200, { transform: (v: unknown): number => Math.max(48, coerceNumberProperty(v, 200)) });\n\n /**\n * Inner-ring thickness as a percent of radius (0–100). `0` fills to the centre, and\n * keeps the centre text; `pie` ignores it. @default 30\n */\n readonly thickness = input(30, {\n transform: (v: unknown): number => Math.min(100, Math.max(0, coerceNumberProperty(v, 30))),\n });\n\n /**\n * Draw a pie chart: every slice fills to the centre, whatever `thickness` says, and\n * the host takes the `wr-donut-chart--pie` modifier. A pie has no hole to print in, so\n * `centerValue` and `centerLabel` are not rendered. Everything else is the donut's: the\n * slices run clockwise from twelve o'clock, with the same gap between them, the legend\n * and its toggle, and the tooltip — which in a pie also opens from a wider, invisible\n * target over a slice too thin to point at (see `tooltip`). The drawing's name falls\n * back to `donutChart.pieLabel`. @default false\n */\n readonly pie = input(false, { transform: coerceBooleanProperty });\n\n /** Show the legend under the chart. @default true */\n readonly showLegend = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Make each legend row a toggle button that shows and hides its slice, through\n * `hiddenSegments`. A row is a `<button aria-pressed>`, pressed while its slice is\n * shown, so the legend becomes one tab stop per slice. @default false\n */\n readonly toggleableLegend = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The positions in `segments` of the slices that are hidden. Positions rather than\n * labels, since two slices may share a label. A toggleable legend writes it, and a\n * host may bind it with or without one: `[(hiddenSegments)]`.\n *\n * A hidden slice is left out of the ring, and the slices still shown RE-NORMALISE:\n * they share the whole ring between them, each at its share of their own total. A\n * donut reads as the parts of the whole it draws, so leaving the hidden slice's arc\n * as a gap would show a whole that no longer adds up, and turning a slice off is how\n * a reader asks \"of the rest, how much is each?\". The tooltip cannot open on a slice\n * that is not drawn. The legend keeps the hidden slice's row, struck through and with\n * its own value, so it can be shown again; the row says \"hidden\" to a screen reader as\n * well, through `aria-pressed` on a toggle and a visually hidden word otherwise. The\n * centre text is printed as given, so a host that writes a total there works it out\n * from this list. A position past the end of `segments` is kept and ignored.\n */\n readonly hiddenSegments = model<readonly number[]>([]);\n\n /** Bold value text in the center. Not rendered with `pie`, which has no hole to hold it. */\n readonly centerValue = input<string>('');\n\n /** Smaller label under the value. Not rendered with `pie`, which has no hole to hold it. */\n readonly centerLabel = input<string>('');\n\n /** Whether the centre text renders: some is given, and there is a hole to print it in. */\n protected readonly showCenter = computed(() => !this.pie() && (!!this.centerValue() || !!this.centerLabel()));\n\n /**\n * Show a tooltip with the slice's label and value on hover. Pointer only — the\n * legend prints the same numbers, and with `showLegend` off `ariaLabel` is where\n * to say them. With `pie`, a slice too thin to land a pointer on, a sliver of a few\n * degrees, is hovered over a wider strip than it draws, through an invisible\n * `.wr-donut-chart__hit` over the pie: widened toward 12px of outer arc (15° on a chart\n * under about 92px) out of what the wider slices beside it can spare, each of which keeps\n * that much of its own. A sliver whose neighbours are slivers too, or have little to\n * spare, gets a narrower target or none, and is read in the legend. The ring draws no\n * such target. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Writes every value in the legend and the tooltip. `null` uses `Intl.NumberFormat`\n * in `LOCALE_ID`. The centre text is printed as given.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /** Each value as the legend and the tooltip print it: exact, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly hidden = computed(() => new Set(this.hiddenSegments()));\n\n private readonly svg = viewChild<ElementRef<SVGSVGElement>>('svg');\n\n // Drawn in a 100×100 viewBox.\n private readonly outerR = 50;\n\n protected readonly innerR = computed(() => {\n const thickness = this.thickness();\n // A pie, or a thickness of 0: fill all the way to the center, not a zero-width ring.\n if (this.pie() || thickness === 0) return 0;\n return this.outerR * (1 - thickness / 100);\n });\n\n /** The sum the ring is divided by: the slices still shown (see `hiddenSegments`). */\n protected readonly total = computed(() => {\n const hidden = this.hidden();\n const sum = this.segments().reduce((acc, s, i) => acc + (hidden.has(i) ? 0 : weight(s.value)), 0);\n return sum > 0 ? sum : 1;\n });\n\n /**\n * Resolved slices ready for the template — each carries its arc path.\n *\n * Angles are in the drawing's own frame, where 0 is three o'clock and a positive\n * angle turns clockwise, because y runs downwards. The ring starts a quarter turn\n * back from there, at twelve o'clock, which is where the input's JSDoc always said\n * it started and where a reader looks for the first slice; it used to start at three.\n */\n protected readonly slices = computed(() => {\n const total = this.total();\n const hidden = this.hidden();\n const origin = -Math.PI / 2;\n let cumulative = 0;\n return this.segments().map((s, i) => {\n const value = weight(s.value);\n const isHidden = hidden.has(i);\n // A hidden slice takes no turn of the ring, so the next slice starts where the last\n // shown one ended.\n const share = isHidden ? 0 : value;\n const startAngle = origin + (cumulative / total) * Math.PI * 2;\n cumulative += share;\n const endAngle = origin + (cumulative / total) * Math.PI * 2;\n return {\n label: s.label,\n value,\n // The segment's own figure, which a negative one keeps although it draws nothing:\n // the weight is the arc's, not the data's, and printing it named a \"0\" the data\n // never had. A value that is not a number has no figure to print.\n text: Number.isFinite(s.value) ? this.numbers.value(s.value) : '',\n color: s.color ?? wrChartColor(i),\n hidden: isHidden,\n path: isHidden ? '' : this.arcPath(startAngle, endAngle),\n percent: (share / total) * 100,\n startAngle,\n endAngle,\n midAngle: (startAngle + endAngle) / 2,\n };\n });\n });\n\n /**\n * In a pie, a wider hover target for every slice too thin to land a pointer on: an\n * invisible wedge over the slice, drawn above the pie, widened toward `HIT_PX` of outer\n * arc (`MAX_HIT_ANGLE` at most, which binds below about 92px) out of the wider slices\n * beside it.\n *\n * A wider slice gives away only what it can spare: it keeps `HIT_PX` of outer arc of its\n * own (the same `MAX_HIT_ANGLE` cap), however many slivers reach into it, so a slice\n * that was easy to point at stays easy, and its middle, where its own chip points, is\n * never covered. Two slivers reaching into one slice from either side split what it\n * spares. A sliver asks half its shortfall of each wider neighbour, or all of it of the\n * only one; what one side cannot give, the other gives if it can. Between two slivers\n * side by side the boundary stays their shared edge, so of a run of slivers only the two\n * at its ends grow, and the legend is where the rest are read — as it is for a sliver\n * whose neighbours have little to spare, which gets the narrower target they leave it.\n * A slice that draws nothing — a zero, or a hidden slice — has nothing to point at and\n * gets no target, and nor does one with no wider neighbour.\n *\n * Pie only, and only while the tooltip is on, which is all it is for: the ring draws\n * exactly what it drew before `pie` existed. The wedge is filled with nothing and\n * hit-tested through `pointer-events=\"fill\"`, which reads its interior whatever its\n * paint and never its unpainted stroke, so its edges are the ones computed here; it\n * paints in no theme and in no forced-colors palette.\n */\n protected readonly hits = computed(() => {\n if (!this.pie() || !this.tooltip()) return [];\n const min = Math.min(MAX_HIT_ANGLE, HIT_PX / (this.size() / 2));\n const drawn = this.slices()\n .map((slice, index) => ({ index, start: slice.startAngle, end: slice.endAngle }))\n .filter(slice => slice.end - slice.start > 0);\n const count = drawn.length;\n if (count < 2) return [];\n const width = drawn.map(slice => slice.end - slice.start);\n const thin = width.map(w => w < min);\n const prev = (k: number): number => (k - 1 + count) % count;\n const next = (k: number): number => (k + 1) % count;\n // What each wider slice can give away and still keep `min` of its own.\n const spare = width.map((w, k) => (thin[k] ? 0 : w - min));\n // How far each sliver asks to reach on each side: into a wider neighbour only.\n const ask = width.map((w, k) => {\n if (!thin[k]) return { before: 0, after: 0 };\n const before = !thin[prev(k)];\n const after = !thin[next(k)];\n const share = (min - w) / (before && after ? 2 : 1);\n return { before: before ? share : 0, after: after ? share : 0 };\n });\n const reach = width.map(() => ({ before: 0, after: 0 }));\n // A wider slice is reached into by the sliver before it, past its own end, and by the\n // one after it, past its own start — the same sliver from both sides when there are\n // only two slices. Each gets what it asks while the two fit in the spare; past that,\n // at least half of it, and more where the other asks for less.\n width.forEach((_, j) => {\n if (thin[j]) return;\n const fromBefore = thin[prev(j)] ? ask[prev(j)].after : 0;\n const fromAfter = thin[next(j)] ? ask[next(j)].before : 0;\n const claims = (fromBefore > 0 ? 1 : 0) + (fromAfter > 0 ? 1 : 0);\n if (claims === 0) return;\n const fair = spare[j] / claims;\n const toBefore = Math.min(fromBefore, Math.max(fair, spare[j] - fromAfter));\n const toAfter = Math.min(fromAfter, Math.max(fair, spare[j] - fromBefore));\n if (toBefore > 0) reach[prev(j)].after = toBefore;\n if (toAfter > 0) reach[next(j)].before = toAfter;\n spare[j] = Math.max(0, spare[j] - toBefore - toAfter);\n });\n // What one side could not give, the other side gives out of what it has left.\n width.forEach((w, k) => {\n if (!thin[k]) return;\n let short = min - w - reach[k].before - reach[k].after;\n for (const [side, j] of [\n ['before', prev(k)],\n ['after', next(k)],\n ] as const) {\n if (short <= 0 || thin[j]) continue;\n const more = Math.min(short, spare[j]);\n reach[k][side] += more;\n spare[j] -= more;\n short -= more;\n }\n });\n return drawn.flatMap((slice, k) => {\n const { before, after } = reach[k];\n if (!thin[k] || before + after <= 0) return [];\n return [{ index: slice.index, path: this.arcPath(slice.start - before, slice.end + after) }];\n });\n });\n\n /**\n * The legend's rows: every slice, hidden ones included, each with its own figure — a\n * negative one included, which draws no slice — and no value at all for a segment whose\n * value is not a number.\n */\n protected readonly legendItems = computed<readonly WrChartLegendItem[]>(() =>\n this.slices().map(({ label, color, text }) => ({ label, color, value: text === '' ? null : text }))\n );\n\n /**\n * One tooltip for the whole chart, pointing at the hovered slice: at the middle of\n * its OUTER arc, on the side that part of the ring faces — above for a slice whose\n * middle is in the top quarter, below for the bottom one, beside it for the two at\n * three and nine o'clock. From there the chip sits clear of the ring, and the way\n * onto it runs straight out of the slice that opened it, over nothing else.\n *\n * Not the slice's `<path>` element: its box is most of the ring for any slice past\n * a quarter, so the chip would point at the middle of the chart. And not the middle\n * of the band: a chip there lies over the ring, under a pointer resting on it —\n * measured in Chromium, the inner half of a lower slice landed on its own chip. A\n * tiny slice keeps its own mid-angle, so the arrow says which sliver it is.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const slice = this.slices()[index];\n const svg = this.svg()?.nativeElement;\n if (!slice?.path || !svg) return null;\n const box = svg.getBoundingClientRect();\n // The drawing's y runs downwards, so a positive sine is the lower half.\n const cos = Math.cos(slice.midAngle);\n const sin = Math.sin(slice.midAngle);\n const side = Math.abs(cos) > Math.abs(sin) ? (cos > 0 ? 'right' : 'left') : sin > 0 ? 'bottom' : 'top';\n return {\n datum: { label: slice.label, value: slice.text, color: slice.color },\n anchor: {\n x: box.left + ((50 + this.outerR * cos) / 100) * box.width,\n y: box.top + ((50 + this.outerR * sin) / 100) * box.height,\n },\n side,\n };\n });\n\n // Helpers\n\n /** SVG path for one donut slice using outer and inner arcs. */\n private arcPath(start: number, end: number): string {\n const cx = 50;\n const cy = 50;\n const ro = this.outerR;\n const ri = this.innerR();\n const sweep = end - start;\n if (sweep <= 0) return '';\n // Full-circle slice — two halves so the arc can render.\n if (sweep >= Math.PI * 2 - 1e-6) {\n const path = [\n `M ${cx + ro} ${cy}`,\n `A ${ro} ${ro} 0 1 1 ${cx - ro} ${cy}`,\n `A ${ro} ${ro} 0 1 1 ${cx + ro} ${cy}`,\n ];\n if (ri > 0) {\n path.push(`M ${cx + ri} ${cy}`, `A ${ri} ${ri} 0 1 0 ${cx - ri} ${cy}`, `A ${ri} ${ri} 0 1 0 ${cx + ri} ${cy}`);\n }\n return path.join(' ');\n }\n const largeArc = sweep > Math.PI ? 1 : 0;\n const sox = cx + ro * Math.cos(start);\n const soy = cy + ro * Math.sin(start);\n const eox = cx + ro * Math.cos(end);\n const eoy = cy + ro * Math.sin(end);\n if (ri === 0) {\n return `M ${cx} ${cy} L ${sox.toFixed(2)} ${soy.toFixed(2)} A ${ro} ${ro} 0 ${largeArc} 1 ${eox.toFixed(2)} ${eoy.toFixed(2)} Z`;\n }\n const eix = cx + ri * Math.cos(end);\n const eiy = cy + ri * Math.sin(end);\n const six = cx + ri * Math.cos(start);\n const siy = cy + ri * Math.sin(start);\n return [\n `M ${sox.toFixed(2)} ${soy.toFixed(2)}`,\n `A ${ro} ${ro} 0 ${largeArc} 1 ${eox.toFixed(2)} ${eoy.toFixed(2)}`,\n `L ${eix.toFixed(2)} ${eiy.toFixed(2)}`,\n `A ${ri} ${ri} 0 ${largeArc} 0 ${six.toFixed(2)} ${siy.toFixed(2)}`,\n 'Z',\n ].join(' ');\n }\n}\n\nexport type { WrDonutSegment } from './types';\n","<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper. `img` is a\n children-presentational role, so with it out here WebKit dropped the whole\n subtree — including the centre value and label, which are real text and are\n the headline datum the legend does not carry. -->\n <svg #svg viewBox=\"0 0 100 100\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\">\n <!-- Every slice is stroked in the SURFACE colour (`--wr-donut-chart-slice-gap-color`,\n from the stylesheet), so adjacent arcs are separated by a visible gap rather than\n by the boundary between two fills. Without it the only thing dividing two slices\n is the colour change itself, and the default palette's entries sit within about\n 1.06:1 of each other in relative luminance — for a reader who cannot separate\n hue, two neighbours merge into one arc and the chart reads as having fewer slices\n than it has. A gap is a shape, and it survives greyscale, printing and a\n monochrome display. -->\n @for (slice of slices(); track $index) {\n <!-- A hidden slice draws nothing at all; the index stays the slice's own, which is\n what the tooltip looks it up by. -->\n @if (!slice.hidden) {\n <path\n class=\"wr-donut-chart__slice\"\n [attr.d]=\"slice.path\"\n [attr.fill]=\"slice.color\"\n stroke-width=\"1\"\n stroke-linejoin=\"round\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n />\n }\n }\n <!-- A sliver's wider hover target in a pie, filled with nothing: see `hits`, which is\n empty for the ring and with the tooltip off. Last, so it wins the pointer over the\n slices it reaches into; `fill`, so the unpainted stroke is not hit-tested and the\n edges stay where `hits` put them. -->\n @for (hit of hits(); track hit.index) {\n <path\n class=\"wr-donut-chart__hit\"\n [attr.d]=\"hit.path\"\n fill=\"none\"\n pointer-events=\"fill\"\n (mouseenter)=\"tip.enter(hit.index)\"\n (mouseleave)=\"tip.leave($event)\"\n />\n }\n </svg>\n <!-- Never with `pie`: a pie has no hole to print in. -->\n @if (showCenter()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n</div>\n\n@if (showLegend() && slices().length > 0) {\n <!-- The key is `aria-hidden`: the row's text is its name, and the dot carries no word\n of its own. -->\n <ul\n wr-chart-legend\n class=\"wr-donut-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSegments\"\n ></ul>\n}\n"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AA,CAAA;EAAA,CAAA;EAAA,kBAAA,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,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,sBAAA;EAAA,CAAA;EAAA,aAAA,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,SAAA,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,KAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAK,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-charts-donut-chart.mjs","names":[],"sources":["../../../projects/lib/charts/donut-chart/donut-chart.ts","../../../projects/lib/charts/donut-chart/donut-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 { NgTemplateOutlet } from '@angular/common';\nimport { Component, type ElementRef, ViewEncapsulation, computed, input, model, viewChild } from '@angular/core';\n\nimport {\n WR_CHART_LEGEND_BLOCK,\n WrChartLegend,\n type WrChartLegendItem,\n type WrChartLegendPosition,\n} from 'ngwr/charts/chart-legend';\nimport { WrChartState, useChartHover, useChartNumbers, useChartState, wrChartColor } from 'ngwr/charts/core';\nimport { useI18nText } from 'ngwr/i18n';\nimport { useChartTooltip, wrCoerceChartTooltip } from 'ngwr/popover';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrDonutSegment } from './types';\n\n/**\n * A segment's contribution to the ring. `Math.max(0, NaN)` is NaN, and the running total\n * carries it forward — so one non-finite datum used to take out its own arc AND every arc\n * after it, writing the literal text `NaN` into the path `d`.\n */\nfunction weight(value: number): number {\n return Number.isFinite(value) ? Math.max(0, value) : 0;\n}\n\n/**\n * How wide a slice's hover target is at least, along the outer edge, in CSS px. A\n * slice narrower than that — a share of a percent or two, which at the default 200px\n * is a few px of arc — is a target no pointer lands on, so it gets a wider one; see\n * `hits`.\n */\nconst HIT_PX = 12;\n\n/**\n * The widest that target may grow, in radians, whatever the chart's size: on a 48px\n * chart 12px of arc is a third of a quarter turn, which would take too much of the\n * slices beside it.\n */\nconst MAX_HIT_ANGLE = Math.PI / 12;\n\n/**\n * Donut chart, and with `pie` a pie chart. Optional center text via inputs.\n *\n * @example\n * ```html\n * <wr-donut-chart [segments]=\"[\n * { label: 'Used', value: 60 },\n * { label: 'Free', value: 40 }\n * ]\" centerLabel=\"Disk\" centerValue=\"60%\" />\n *\n * <wr-donut-chart [segments]=\"segments\" pie />\n * ```\n *\n * **The look is the chart theme's.** A slice with no `color` takes the next colour of\n * the shared palette (`--wr-chart-1` to `--wr-chart-8`), and every two slices are parted\n * by a line in `--wr-chart-separator`, 1px at any `size`. Hovering a slice or a legend\n * row dims the others.\n *\n * **The legend** is a `ul[wr-chart-legend]` (`ngwr/charts/chart-legend`), placed by\n * `legendPosition` and left out for a single slice unless `showLegend` asks for it. With\n * `toggleableLegend` its rows show and hide their slices through `hiddenSegments`.\n *\n * **Empty, loading, error.** With nothing to draw the chart keeps its ring as a track\n * and says \"No data\"; `loading` and `error` put their own message there in place of the\n * slices.\n *\n * @see https://ngwr.dev/charts/donut-chart\n */\n@Component({\n selector: 'wr-donut-chart',\n templateUrl: './donut-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n // `wr-chart--legend`: the shared rule that keeps the legend's room from the drawing.\n class: 'wr-donut-chart wr-chart--legend',\n '[class.wr-donut-chart--pie]': 'pie()',\n '[class.wr-donut-chart--gapless]': 'gapless()',\n '[class.wr-chart--legend-side]': 'legendShown() && legendSide()',\n },\n imports: [NgTemplateOutlet, WrChartLegend, WrChartState],\n // The legend's rows keep the classes this chart drew before it drew them through\n // `WrChartLegend`: `.wr-donut-chart__legend-item`, `__swatch`, `__legend-label` and\n // `__legend-value`.\n viewProviders: [{ provide: WR_CHART_LEGEND_BLOCK, useValue: 'wr-donut-chart' }],\n})\nexport class WrDonutChart {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/donut-chart');\n // One listener pair for the whole chart: a slice and a sliver's wider target each\n // carry `data-wr-index`, and `data-wr-series` for the dim.\n useChartHover({ enter: index => this.tip.enter(index), leave: event => this.tip.leave(event) });\n }\n\n /**\n * The slices, drawn clockwise from twelve o'clock. A segment with no `color`\n * takes the next colour of the chart palette, `--wr-chart-1` to `--wr-chart-8`.\n */\n readonly segments = input<readonly WrDonutSegment[]>([]);\n\n /**\n * Accessible name of the drawing. The arcs carry no text and the legend is optional, so\n * with `showLegend: false` this and the centre text are the whole of what a screen reader\n * gets. Falls back to `donutChart.label`, or to `donutChart.pieLabel` with `pie`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n private readonly donutLabel = useI18nText(this.ariaLabel, 'donutChart.label', 'Donut chart');\n private readonly pieLabel = useI18nText(this.ariaLabel, 'donutChart.pieLabel', 'Pie chart');\n\n protected readonly resolvedAriaLabel = computed(() => (this.pie() ? this.pieLabel() : this.donutLabel()));\n\n /** Diameter in CSS pixels. @default 200 */\n readonly size = input(200, { transform: (v: unknown): number => Math.max(48, coerceNumberProperty(v, 200)) });\n\n /**\n * Inner-ring thickness as a percent of radius (0–100). `0` fills to the centre, and\n * keeps the centre text; `pie` ignores it. @default 30\n */\n readonly thickness = input(30, {\n transform: (v: unknown): number => Math.min(100, Math.max(0, coerceNumberProperty(v, 30))),\n });\n\n /**\n * Draw a pie chart: every slice fills to the centre, whatever `thickness` says, and\n * the host takes the `wr-donut-chart--pie` modifier. A pie has no hole to print in, so\n * `centerValue` and `centerLabel` are not rendered. Everything else is the donut's: the\n * slices run clockwise from twelve o'clock, with the same gap between them, the legend\n * and its toggle, and the tooltip — which in a pie also opens from a wider, invisible\n * target over a slice too thin to point at (see `tooltip`). The drawing's name falls\n * back to `donutChart.pieLabel`. @default false\n */\n readonly pie = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Draw the slices edge to edge, with no gap between them: each is stroked in its own\n * colour rather than the surface's, and the host takes the `wr-donut-chart--gapless`\n * modifier. The gap is a shape that tells two neighbours apart without hue, so with it\n * off only the colour change divides them; keep the legend or the tooltip on where the\n * chart has to read without hue. @default false\n */\n readonly gapless = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Show the legend. `'auto'` shows it when there is something to tell apart - two\n * segments or more - and leaves it out for a single one; `true` shows it for one\n * segment too. @default 'auto'\n */\n readonly showLegend = input<boolean | 'auto', unknown>('auto', {\n transform: (value: unknown): boolean | 'auto' => (value === 'auto' ? 'auto' : coerceBooleanProperty(value)),\n });\n\n /**\n * Where the legend sits: `bottom` or `top` of the chart as a wrapping row, `start` or\n * `end` of it as a column, or `none` for no legend at all - `hiddenSegments` still\n * hides a slice from outside. @default 'bottom'\n */\n readonly legendPosition = input<WrChartLegendPosition>('bottom');\n\n /**\n * A request for the chart's data is in flight: the slices give way to the loading\n * message, over the ring drawn as a track. @default false\n */\n readonly loading = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The chart's data failed to load: the slices 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 when there is nothing 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 * Make each legend row a toggle button that shows and hides its slice, through\n * `hiddenSegments`. A row is a `<button aria-pressed>`, pressed while its slice is\n * shown, so the legend becomes one tab stop per slice. @default false\n */\n readonly toggleableLegend = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The positions in `segments` of the slices that are hidden. Positions rather than\n * labels, since two slices may share a label. A toggleable legend writes it, and a\n * host may bind it with or without one: `[(hiddenSegments)]`.\n *\n * A hidden slice is left out of the ring, and the slices still shown RE-NORMALISE:\n * they share the whole ring between them, each at its share of their own total. A\n * donut reads as the parts of the whole it draws, so leaving the hidden slice's arc\n * as a gap would show a whole that no longer adds up, and turning a slice off is how\n * a reader asks \"of the rest, how much is each?\". The tooltip cannot open on a slice\n * that is not drawn. The legend keeps the hidden slice's row, struck through and with\n * its own value, so it can be shown again; the row says \"hidden\" to a screen reader as\n * well, through `aria-pressed` on a toggle and a visually hidden word otherwise. The\n * centre text is printed as given, so a host that writes a total there works it out\n * from this list. A position past the end of `segments` is kept and ignored.\n */\n readonly hiddenSegments = model<readonly number[]>([]);\n\n /** Bold value text in the center. Not rendered with `pie`, which has no hole to hold it. */\n readonly centerValue = input<string>('');\n\n /** Smaller label under the value. Not rendered with `pie`, which has no hole to hold it. */\n readonly centerLabel = input<string>('');\n\n /**\n * Whether the centre text renders: some is given, there is a hole to print it in, and\n * no state's message is there instead.\n */\n protected readonly showCenter = computed(\n () => !this.pie() && !this.state() && (!!this.centerValue() || !!this.centerLabel())\n );\n\n /**\n * Show a tooltip with the slice's label and value on hover. Pointer only — the legend\n * prints the same numbers, and with `showLegend` off `ariaLabel` is where to say\n * them. With `pie`, a slice too thin to land a pointer on, a sliver of a few degrees,\n * is hovered over a wider strip than it draws, through an invisible\n * `.wr-donut-chart__hit` over the pie: widened toward 12px of outer arc (15° on a\n * chart under about 92px) out of what the wider slices beside it can spare, each of\n * which keeps that much of its own. A sliver whose neighbours are slivers too, or\n * have little to spare, gets a narrower target or none, and is read in the legend.\n * The ring draws no such target.\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 * Writes every value in the legend and the tooltip. `null` uses `Intl.NumberFormat`\n * in `LOCALE_ID`. The centre text is printed as given.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /** Each value as the legend and the tooltip print it: exact, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly hidden = computed(() => new Set(this.hiddenSegments()));\n\n private readonly svg = viewChild<ElementRef<SVGSVGElement>>('svg');\n\n // Drawn in a 100×100 viewBox.\n private readonly outerR = 50;\n\n protected readonly innerR = computed(() => {\n const thickness = this.thickness();\n // A pie, or a thickness of 0: fill all the way to the center, not a zero-width ring.\n if (this.pie() || thickness === 0) return 0;\n return this.outerR * (1 - thickness / 100);\n });\n\n /** The sum the ring is divided by: the slices still shown (see `hiddenSegments`). */\n protected readonly total = computed(() => {\n const hidden = this.hidden();\n const sum = this.segments().reduce((acc, s, i) => acc + (hidden.has(i) ? 0 : weight(s.value)), 0);\n return sum > 0 ? sum : 1;\n });\n\n /**\n * Resolved slices ready for the template — each carries its arc path.\n *\n * Angles are in the drawing's own frame, where 0 is three o'clock and a positive\n * angle turns clockwise, because y runs downwards. The ring starts a quarter turn\n * back from there, at twelve o'clock, which is where the input's JSDoc always said\n * it started and where a reader looks for the first slice; it used to start at three.\n */\n protected readonly slices = computed(() => {\n const total = this.total();\n const hidden = this.hidden();\n const origin = -Math.PI / 2;\n let cumulative = 0;\n return this.segments().map((s, i) => {\n const value = weight(s.value);\n const isHidden = hidden.has(i);\n // A hidden slice takes no turn of the ring, so the next slice starts where the last\n // shown one ended.\n const share = isHidden ? 0 : value;\n const startAngle = origin + (cumulative / total) * Math.PI * 2;\n cumulative += share;\n const endAngle = origin + (cumulative / total) * Math.PI * 2;\n return {\n label: s.label,\n value,\n // The segment's own figure, which a negative one keeps although it draws nothing:\n // the weight is the arc's, not the data's, and printing it named a \"0\" the data\n // never had. A value that is not a number has no figure to print.\n text: Number.isFinite(s.value) ? this.numbers.value(s.value) : '',\n color: s.color ?? wrChartColor(i),\n hidden: isHidden,\n path: isHidden ? '' : this.arcPath(startAngle, endAngle),\n percent: (share / total) * 100,\n startAngle,\n endAngle,\n midAngle: (startAngle + endAngle) / 2,\n };\n });\n });\n\n /**\n * In a pie, a wider hover target for every slice too thin to land a pointer on: an\n * invisible wedge over the slice, drawn above the pie, widened toward `HIT_PX` of outer\n * arc (`MAX_HIT_ANGLE` at most, which binds below about 92px) out of the wider slices\n * beside it.\n *\n * A wider slice gives away only what it can spare: it keeps `HIT_PX` of outer arc of its\n * own (the same `MAX_HIT_ANGLE` cap), however many slivers reach into it, so a slice\n * that was easy to point at stays easy, and its middle, where its own chip points, is\n * never covered. Two slivers reaching into one slice from either side split what it\n * spares. A sliver asks half its shortfall of each wider neighbour, or all of it of the\n * only one; what one side cannot give, the other gives if it can. Between two slivers\n * side by side the boundary stays their shared edge, so of a run of slivers only the two\n * at its ends grow, and the legend is where the rest are read — as it is for a sliver\n * whose neighbours have little to spare, which gets the narrower target they leave it.\n * A slice that draws nothing — a zero, or a hidden slice — has nothing to point at and\n * gets no target, and nor does one with no wider neighbour.\n *\n * Pie only, and only while the tooltip is on, which is all it is for: the ring draws\n * exactly what it drew before `pie` existed. The wedge is filled with nothing and\n * hit-tested through `pointer-events=\"fill\"`, which reads its interior whatever its\n * paint and never its unpainted stroke, so its edges are the ones computed here; it\n * paints in no theme and in no forced-colors palette.\n */\n protected readonly hits = computed(() => {\n if (!this.pie() || !this.tooltip() || this.state()) return [];\n const min = Math.min(MAX_HIT_ANGLE, HIT_PX / (this.size() / 2));\n const drawn = this.slices()\n .map((slice, index) => ({ index, start: slice.startAngle, end: slice.endAngle }))\n .filter(slice => slice.end - slice.start > 0);\n const count = drawn.length;\n if (count < 2) return [];\n const width = drawn.map(slice => slice.end - slice.start);\n const thin = width.map(w => w < min);\n const prev = (k: number): number => (k - 1 + count) % count;\n const next = (k: number): number => (k + 1) % count;\n // What each wider slice can give away and still keep `min` of its own.\n const spare = width.map((w, k) => (thin[k] ? 0 : w - min));\n // How far each sliver asks to reach on each side: into a wider neighbour only.\n const ask = width.map((w, k) => {\n if (!thin[k]) return { before: 0, after: 0 };\n const before = !thin[prev(k)];\n const after = !thin[next(k)];\n const share = (min - w) / (before && after ? 2 : 1);\n return { before: before ? share : 0, after: after ? share : 0 };\n });\n const reach = width.map(() => ({ before: 0, after: 0 }));\n // A wider slice is reached into by the sliver before it, past its own end, and by the\n // one after it, past its own start — the same sliver from both sides when there are\n // only two slices. Each gets what it asks while the two fit in the spare; past that,\n // at least half of it, and more where the other asks for less.\n width.forEach((_, j) => {\n if (thin[j]) return;\n const fromBefore = thin[prev(j)] ? ask[prev(j)].after : 0;\n const fromAfter = thin[next(j)] ? ask[next(j)].before : 0;\n const claims = (fromBefore > 0 ? 1 : 0) + (fromAfter > 0 ? 1 : 0);\n if (claims === 0) return;\n const fair = spare[j] / claims;\n const toBefore = Math.min(fromBefore, Math.max(fair, spare[j] - fromAfter));\n const toAfter = Math.min(fromAfter, Math.max(fair, spare[j] - fromBefore));\n if (toBefore > 0) reach[prev(j)].after = toBefore;\n if (toAfter > 0) reach[next(j)].before = toAfter;\n spare[j] = Math.max(0, spare[j] - toBefore - toAfter);\n });\n // What one side could not give, the other side gives out of what it has left.\n width.forEach((w, k) => {\n if (!thin[k]) return;\n let short = min - w - reach[k].before - reach[k].after;\n for (const [side, j] of [\n ['before', prev(k)],\n ['after', next(k)],\n ] as const) {\n if (short <= 0 || thin[j]) continue;\n const more = Math.min(short, spare[j]);\n reach[k][side] += more;\n spare[j] -= more;\n short -= more;\n }\n });\n return drawn.flatMap((slice, k) => {\n const { before, after } = reach[k];\n if (!thin[k] || before + after <= 0) return [];\n return [{ index: slice.index, path: this.arcPath(slice.start - before, slice.end + after) }];\n });\n });\n\n /**\n * The legend's rows: every slice, hidden ones included, each with its own figure — a\n * negative one included, which draws no slice — and no value at all for a segment whose\n * value is not a number.\n */\n protected readonly legendItems = computed<readonly WrChartLegendItem[]>(() =>\n this.slices().map(({ label, color, text }) => ({ label, color, value: text === '' ? null : text }))\n );\n\n /**\n * Whether the chart draws its legend: unless `legendPosition` is `none` or `showLegend`\n * is off, and under `showLegend=\"auto\"` only with two segments or more, since a single\n * slice has nothing to tell apart.\n */\n protected readonly legendShown = computed(() => {\n const show = this.showLegend();\n const rows = this.legendItems().length;\n if (show === false || rows === 0 || this.legendPosition() === 'none') return false;\n return show === true || rows > 1;\n });\n\n /** Whether the legend comes before the drawing, in the DOM as on screen: above it, or at inline start. */\n protected readonly legendFirst = computed(() => {\n const position = this.legendPosition();\n return position === 'top' || position === 'start';\n });\n\n /** Whether the legend sits beside the drawing rather than above or below it. */\n protected readonly legendSide = computed(() => {\n const position = this.legendPosition();\n return position === 'start' || position === 'end';\n });\n\n /**\n * Whether the chart has nothing to draw: no segment, or none with a share to take. A\n * slice hidden from the legend still counts, so hiding every slice is not \"No data\".\n */\n private readonly empty = computed(() => this.segments().every(s => weight(s.value) === 0));\n\n /** What the chart shows in place of its slices, or `null` while it draws them. */\n protected readonly state = useChartState({\n loading: this.loading,\n error: this.error,\n empty: this.empty,\n emptyLabel: this.emptyLabel,\n loadingLabel: this.loadingLabel,\n errorLabel: this.errorLabel,\n });\n\n /**\n * The whole ring, or the whole disc of a pie, as one path: the frame the chart keeps\n * while it has no slice to draw - under a state, or with every slice hidden.\n */\n protected readonly track = computed(() =>\n this.state() || this.slices().every(slice => !slice.path) ? this.arcPath(0, Math.PI * 2) : null\n );\n\n /**\n * One tooltip for the whole chart, pointing at the hovered slice: at the middle of\n * its OUTER arc, on the side that part of the ring faces — above for a slice whose\n * middle is in the top quarter, below for the bottom one, beside it for the two at\n * three and nine o'clock. From there the chip sits clear of the ring, and the way\n * onto it runs straight out of the slice that opened it, over nothing else.\n *\n * Not the slice's `<path>` element: its box is most of the ring for any slice past\n * a quarter, so the chip would point at the middle of the chart. And not the middle\n * of the band: a chip there lies over the ring, under a pointer resting on it —\n * measured in Chromium, the inner half of a lower slice landed on its own chip. A\n * tiny slice keeps its own mid-angle, so the arrow says which sliver it is.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const slice = this.slices()[index];\n const svg = this.svg()?.nativeElement;\n // No slice is drawn under a state, so a chip open on one lets go.\n if (!slice?.path || !svg || this.state()) return null;\n const box = svg.getBoundingClientRect();\n // The drawing's y runs downwards, so a positive sine is the lower half.\n const cos = Math.cos(slice.midAngle);\n const sin = Math.sin(slice.midAngle);\n const side = Math.abs(cos) > Math.abs(sin) ? (cos > 0 ? 'right' : 'left') : sin > 0 ? 'bottom' : 'top';\n return {\n datum: { label: slice.label, value: slice.text, color: slice.color },\n anchor: {\n x: box.left + ((50 + this.outerR * cos) / 100) * box.width,\n y: box.top + ((50 + this.outerR * sin) / 100) * box.height,\n },\n side,\n };\n });\n\n // Helpers\n\n /** SVG path for one donut slice using outer and inner arcs. */\n private arcPath(start: number, end: number): string {\n const cx = 50;\n const cy = 50;\n const ro = this.outerR;\n const ri = this.innerR();\n const sweep = end - start;\n if (sweep <= 0) return '';\n // Full-circle slice — two halves so the arc can render.\n if (sweep >= Math.PI * 2 - 1e-6) {\n const path = [\n `M ${cx + ro} ${cy}`,\n `A ${ro} ${ro} 0 1 1 ${cx - ro} ${cy}`,\n `A ${ro} ${ro} 0 1 1 ${cx + ro} ${cy}`,\n ];\n if (ri > 0) {\n path.push(`M ${cx + ri} ${cy}`, `A ${ri} ${ri} 0 1 0 ${cx - ri} ${cy}`, `A ${ri} ${ri} 0 1 0 ${cx + ri} ${cy}`);\n }\n return path.join(' ');\n }\n const largeArc = sweep > Math.PI ? 1 : 0;\n const sox = cx + ro * Math.cos(start);\n const soy = cy + ro * Math.sin(start);\n const eox = cx + ro * Math.cos(end);\n const eoy = cy + ro * Math.sin(end);\n if (ri === 0) {\n return `M ${cx} ${cy} L ${sox.toFixed(2)} ${soy.toFixed(2)} A ${ro} ${ro} 0 ${largeArc} 1 ${eox.toFixed(2)} ${eoy.toFixed(2)} Z`;\n }\n const eix = cx + ri * Math.cos(end);\n const eiy = cy + ri * Math.sin(end);\n const six = cx + ri * Math.cos(start);\n const siy = cy + ri * Math.sin(start);\n return [\n `M ${sox.toFixed(2)} ${soy.toFixed(2)}`,\n `A ${ro} ${ro} 0 ${largeArc} 1 ${eox.toFixed(2)} ${eoy.toFixed(2)}`,\n `L ${eix.toFixed(2)} ${eiy.toFixed(2)}`,\n `A ${ri} ${ri} 0 ${largeArc} 0 ${six.toFixed(2)} ${siy.toFixed(2)}`,\n 'Z',\n ].join(' ');\n }\n}\n\nexport type { WrDonutSegment } from './types';\n","@let shown = state();\n\n<!-- The legend, drawn before the drawing or after it so it is in the DOM where it is on\n screen: a toggleable legend's rows are tab stops, and their order follows it. The key\n is `aria-hidden`: the row's text is its name, and the dot carries no word of its own. -->\n<ng-template #legend>\n <ul\n wr-chart-legend\n class=\"wr-donut-chart__legend\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSegments\"\n ></ul>\n</ng-template>\n\n@if (legendShown() && legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n<div class=\"wr-donut-chart__surface\" [style.width.px]=\"size()\">\n <!-- The name sits on the DRAWING, not on this wrapper. `img` is a\n children-presentational role, so with it out here WebKit dropped the whole\n subtree — including the centre value and label, which are real text and are\n the headline datum the legend does not carry. -->\n <svg #svg viewBox=\"0 0 100 100\" role=\"img\" [attr.aria-label]=\"resolvedAriaLabel()\">\n @if (track(); as ring) {\n <!-- The frame the chart keeps with no slice to draw: the ring itself, as a track. -->\n <path class=\"wr-donut-chart__track\" [attr.d]=\"ring\" />\n }\n <!-- Every slice is stroked in the SURFACE colour (`--wr-donut-chart-slice-gap-color`,\n from the stylesheet), so adjacent arcs are separated by a visible gap rather than\n by the boundary between two fills. Without it the only thing dividing two slices\n is the colour change itself, and for a reader who cannot separate hue two\n neighbours merge into one arc and the chart reads as having fewer slices than it\n has. A gap is a shape, and it survives greyscale, printing and a monochrome\n display. The stroke does not scale with the drawing, so the gap is the same\n pixels at any `size`; its width is the stylesheet's. -->\n @if (!shown) {\n @for (slice of slices(); track $index) {\n <!-- A hidden slice draws nothing at all; the index stays the slice's own, which is\n what the tooltip looks it up by. `data-wr-index` is what the chart's one hover\n listener reads, and `data-wr-series` the slice's legend row, which the hover\n dims by. -->\n @if (!slice.hidden) {\n <path\n class=\"wr-donut-chart__slice\"\n [attr.d]=\"slice.path\"\n [attr.fill]=\"slice.color\"\n [style.--wr-donut-chart-slice-color]=\"slice.color\"\n [attr.data-wr-index]=\"$index\"\n [attr.data-wr-series]=\"$index\"\n stroke-linejoin=\"round\"\n vector-effect=\"non-scaling-stroke\"\n />\n }\n }\n <!-- A sliver's wider hover target in a pie, filled with nothing: see `hits`, which is\n empty for the ring and with the tooltip off. Last, so it wins the pointer over the\n slices it reaches into; `fill`, so the unpainted stroke is not hit-tested and the\n edges stay where `hits` put them. It carries its slice's index and legend row, so\n the hover reads it as the slice. -->\n @for (hit of hits(); track hit.index) {\n <path\n class=\"wr-donut-chart__hit\"\n [attr.d]=\"hit.path\"\n [attr.data-wr-index]=\"hit.index\"\n [attr.data-wr-series]=\"hit.index\"\n fill=\"none\"\n pointer-events=\"fill\"\n />\n }\n }\n </svg>\n <!-- Never with `pie`: a pie has no hole to print in. -->\n @if (showCenter()) {\n <div class=\"wr-donut-chart__center\">\n @if (centerValue()) {\n <div class=\"wr-donut-chart__center-value\">{{ centerValue() }}</div>\n }\n @if (centerLabel()) {\n <div class=\"wr-donut-chart__center-label\">{{ centerLabel() }}</div>\n }\n </div>\n }\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the track the chart keeps. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n }\n</div>\n\n@if (legendShown() && !legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6BA,SAAS,OAAO,OAAa;CAC3B,OAAO,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI;AACvD;AAQA,MAAM,SAAS;AAOf,MAAM,gBAAgB,KAAK,KAAK;AA+ChC,IAAa,eAAb,MAAa,aAAY;CACvB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,oBAAoB;EAGrF,cAAc;GAAE,QAAO,UAAS,KAAK,IAAI,MAAM,KAAK;GAAG,QAAO,UAAS,KAAK,IAAI,MAAM,KAAK;EAAC,CAAE;CAChG;CAMS,WAAW,MAAiC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAO/C,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE9B,aAAa,YAAY,KAAK,WAAW,oBAAoB,aAAa;CAC1E,WAAW,YAAY,KAAK,WAAW,uBAAuB,WAAW;CAEvE,oBAAoB,eAAgB,KAAK,IAAG,IAAK,KAAK,SAAQ,IAAK,KAAK,WAAU,GAAI,GAAA,YAAA,CAAA,EAAA,WAAA,oBAAA,CAAA,+BAAA,CAAA,CAAA;CAGhG,OAAO,MAAM,KAAG;EAAA,GAAA,YAAA,EAAA,WAAA,OAAA,+BAAA,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the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
7
7
|
*/
|
|
8
|
-
const
|
|
8
|
+
const BAR_SCALE = /(?:^|;)\s*--wr-funnel-chart-bar-scale\s*:\s*([\d.]+)/;
|
|
9
9
|
var StageHarness = class StageHarness extends ComponentHarness {
|
|
10
10
|
static hostSelector = ".wr-funnel-chart__stage";
|
|
11
11
|
async read() {
|
|
@@ -23,9 +23,9 @@ var StageHarness = class StageHarness extends ComponentHarness {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
static widthOf(style) {
|
|
26
|
-
const match =
|
|
27
|
-
if (!match) throw new Error(`WrFunnelChartHarness.getStages(): a bar carries no inline
|
|
28
|
-
return Number.parseFloat(match[1]);
|
|
26
|
+
const match = BAR_SCALE.exec(style ?? "");
|
|
27
|
+
if (!match) throw new Error(`WrFunnelChartHarness.getStages(): a bar carries no inline share of the track (style: "${style ?? ""}"). The component writes one for every bar it draws, a stage of zero included, so its absence is the bug — reporting 0 would read as a stage of zero.`);
|
|
28
|
+
return Math.round(Number.parseFloat(match[1]) * 1e5) / 1e3;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
var GapHarness = class extends ComponentHarness {
|