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,19 +1,22 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { Component, LOCALE_ID, ViewEncapsulation, computed, effect, inject, input, isDevMode, model,
|
|
2
|
+
import { Component, ElementRef, LOCALE_ID, ViewEncapsulation, afterRenderEffect, computed, effect, inject, input, isDevMode, model, signal, untracked, viewChild } from "@angular/core";
|
|
3
3
|
import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
|
|
4
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
4
5
|
import { wrCheckStyles, wrClamp } from "ngwr/utils";
|
|
5
6
|
import { useI18nFormatter, useI18nText, wrReadI18nText } from "ngwr/i18n";
|
|
6
7
|
import { WrChartLegend } from "ngwr/charts/chart-legend";
|
|
7
|
-
import { WrChartTable, useChartNumbers, wrChartColor, wrChartDash, wrChartMarker, wrChartMarkerExtent, wrChartMarkerPath } from "ngwr/charts/core";
|
|
8
|
-
import { useChartTooltip } from "ngwr/popover";
|
|
8
|
+
import { WrChartState, WrChartTable, useChartHover, useChartNumbers, useChartSize, useChartState, wrChartAxis, wrChartColor, wrChartDash, wrChartLabelStep, wrChartLongest, wrChartMarker, wrChartMarkerExtent, wrChartMarkerPath, wrChartNumberFormat, wrChartRound } from "ngwr/charts/core";
|
|
9
|
+
import { useChartTooltip, wrCoerceChartTooltip } from "ngwr/popover";
|
|
9
10
|
/**
|
|
10
11
|
* @license
|
|
11
12
|
*
|
|
12
13
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13
14
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
14
15
|
*/
|
|
15
|
-
const short = (value) =>
|
|
16
|
-
const percent = (share) =>
|
|
16
|
+
const short = (value) => wrChartRound(value, 4);
|
|
17
|
+
const percent = (share) => wrChartRound(share * 100, 2);
|
|
18
|
+
const PROBES = 3;
|
|
19
|
+
const LABEL_GAP = 8;
|
|
17
20
|
const POINT_RADIUS = 4;
|
|
18
21
|
var WrBarChart = class WrBarChart {
|
|
19
22
|
data = input([], ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
@@ -30,9 +33,17 @@ var WrBarChart = class WrBarChart {
|
|
|
30
33
|
totalText = wrReadI18nText("barChart.total", "Total");
|
|
31
34
|
valueText = wrReadI18nText("barChart.value", "Value");
|
|
32
35
|
datumText = useI18nFormatter("barChart.datum", "{{label}}: {{value}}");
|
|
33
|
-
ordinals =
|
|
34
|
-
color = input(
|
|
35
|
-
|
|
36
|
+
ordinals = wrChartNumberFormat(inject(LOCALE_ID));
|
|
37
|
+
color = input(wrChartColor(0), ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
|
|
38
|
+
showGrid = input(true, {
|
|
39
|
+
...ngDevMode ? { debugName: "showGrid" } : /* istanbul ignore next */ {},
|
|
40
|
+
transform: coerceBooleanProperty
|
|
41
|
+
});
|
|
42
|
+
showAxis = input(true, {
|
|
43
|
+
...ngDevMode ? { debugName: "showAxis" } : /* istanbul ignore next */ {},
|
|
44
|
+
transform: coerceBooleanProperty
|
|
45
|
+
});
|
|
46
|
+
showValues = input(false, {
|
|
36
47
|
...ngDevMode ? { debugName: "showValues" } : /* istanbul ignore next */ {},
|
|
37
48
|
transform: coerceBooleanProperty
|
|
38
49
|
});
|
|
@@ -46,12 +57,24 @@ var WrBarChart = class WrBarChart {
|
|
|
46
57
|
});
|
|
47
58
|
tooltip = input(true, {
|
|
48
59
|
...ngDevMode ? { debugName: "tooltip" } : /* istanbul ignore next */ {},
|
|
49
|
-
transform:
|
|
60
|
+
transform: wrCoerceChartTooltip
|
|
50
61
|
});
|
|
51
|
-
showLegend = input(
|
|
62
|
+
showLegend = input("auto", {
|
|
52
63
|
...ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {},
|
|
64
|
+
transform: (value) => value === "auto" ? "auto" : coerceBooleanProperty(value)
|
|
65
|
+
});
|
|
66
|
+
legendPosition = input("bottom", ...ngDevMode ? [{ debugName: "legendPosition" }] : /* istanbul ignore next */ []);
|
|
67
|
+
loading = input(false, {
|
|
68
|
+
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
69
|
+
transform: coerceBooleanProperty
|
|
70
|
+
});
|
|
71
|
+
error = input(false, {
|
|
72
|
+
...ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {},
|
|
53
73
|
transform: coerceBooleanProperty
|
|
54
74
|
});
|
|
75
|
+
emptyLabel = input(null, ...ngDevMode ? [{ debugName: "emptyLabel" }] : /* istanbul ignore next */ []);
|
|
76
|
+
loadingLabel = input(null, ...ngDevMode ? [{ debugName: "loadingLabel" }] : /* istanbul ignore next */ []);
|
|
77
|
+
errorLabel = input(null, ...ngDevMode ? [{ debugName: "errorLabel" }] : /* istanbul ignore next */ []);
|
|
55
78
|
toggleableLegend = input(false, {
|
|
56
79
|
...ngDevMode ? { debugName: "toggleableLegend" } : /* istanbul ignore next */ {},
|
|
57
80
|
transform: coerceBooleanProperty
|
|
@@ -64,11 +87,26 @@ var WrBarChart = class WrBarChart {
|
|
|
64
87
|
});
|
|
65
88
|
valueFormat = input(null, ...ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []);
|
|
66
89
|
numbers = useChartNumbers(this.valueFormat);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
90
|
+
host = inject(ElementRef).nativeElement;
|
|
91
|
+
trackEl = viewChild("trackEl", ...ngDevMode ? [{ debugName: "trackEl" }] : /* istanbul ignore next */ []);
|
|
92
|
+
labelsEl = viewChild("labelsEl", ...ngDevMode ? [{ debugName: "labelsEl" }] : /* istanbul ignore next */ []);
|
|
93
|
+
labelsSize = useChartSize(this.labelsEl);
|
|
94
|
+
labelWidth = signal(0, ...ngDevMode ? [{ debugName: "labelWidth" }] : /* istanbul ignore next */ []);
|
|
70
95
|
constructor() {
|
|
71
96
|
if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("charts/bar-chart");
|
|
97
|
+
useChartHover({
|
|
98
|
+
enter: (index) => this.tip.enter(index),
|
|
99
|
+
leave: (event) => this.tip.leave(event)
|
|
100
|
+
});
|
|
101
|
+
afterRenderEffect(() => {
|
|
102
|
+
const row = this.labelsEl()?.nativeElement;
|
|
103
|
+
this.labelProbes();
|
|
104
|
+
this.labelsSize();
|
|
105
|
+
if (!row) return;
|
|
106
|
+
let width = 0;
|
|
107
|
+
for (const probe of row.querySelectorAll(".wr-bar-chart__label-probe")) width = Math.max(width, probe.getBoundingClientRect().width);
|
|
108
|
+
if (width !== untracked(this.labelWidth)) this.labelWidth.set(width);
|
|
109
|
+
});
|
|
72
110
|
if (isDevMode()) {
|
|
73
111
|
let warned = false;
|
|
74
112
|
effect(() => {
|
|
@@ -116,7 +154,7 @@ var WrBarChart = class WrBarChart {
|
|
|
116
154
|
};
|
|
117
155
|
}, ...ngDevMode ? [{ debugName: "dataScale" }] : /* istanbul ignore next */ []);
|
|
118
156
|
bars = computed(() => {
|
|
119
|
-
const { lo, hi } = this.
|
|
157
|
+
const { lo, hi } = this.scale();
|
|
120
158
|
const combo = this.hasLines();
|
|
121
159
|
const floor = this.at(0);
|
|
122
160
|
const zero = this.zero();
|
|
@@ -133,10 +171,10 @@ var WrBarChart = class WrBarChart {
|
|
|
133
171
|
display: missing ? "" : this.numbers.label(value),
|
|
134
172
|
text,
|
|
135
173
|
color: d.color ?? this.color(),
|
|
136
|
-
share,
|
|
174
|
+
share: short(share),
|
|
137
175
|
below,
|
|
138
176
|
start: below ? short(zero - share) : zero,
|
|
139
|
-
at: below ? short(zero - share) : zero + share,
|
|
177
|
+
at: below ? short(zero - share) : short(zero + share),
|
|
140
178
|
name: missing ? d.label : this.name(d.label, value)
|
|
141
179
|
};
|
|
142
180
|
});
|
|
@@ -203,7 +241,35 @@ var WrBarChart = class WrBarChart {
|
|
|
203
241
|
hi
|
|
204
242
|
};
|
|
205
243
|
}, ...ngDevMode ? [{ debugName: "seriesScale" }] : /* istanbul ignore next */ []);
|
|
206
|
-
scale = computed(() =>
|
|
244
|
+
scale = computed(() => {
|
|
245
|
+
const { lo, hi } = this.seriesMode() ? this.seriesScale() : this.dataScale();
|
|
246
|
+
if (!this.showGrid() && !this.showAxis()) return {
|
|
247
|
+
lo,
|
|
248
|
+
hi,
|
|
249
|
+
ticks: [],
|
|
250
|
+
step: hi - lo
|
|
251
|
+
};
|
|
252
|
+
const axis = wrChartAxis(lo, hi, { includeZero: true });
|
|
253
|
+
const fixed = this.max() > 0;
|
|
254
|
+
const slack = axis.step * 1e-6;
|
|
255
|
+
const top = fixed ? hi : axis.ticks.find((tick) => Math.abs(tick - hi) <= slack) ?? axis.max;
|
|
256
|
+
return {
|
|
257
|
+
lo: axis.min,
|
|
258
|
+
hi: top,
|
|
259
|
+
ticks: axis.ticks.filter((tick) => tick <= top + slack),
|
|
260
|
+
step: axis.step
|
|
261
|
+
};
|
|
262
|
+
}, ...ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []);
|
|
263
|
+
ticks = computed(() => {
|
|
264
|
+
const { ticks, step } = this.scale();
|
|
265
|
+
const labels = this.showAxis() ? this.numbers.ticks(ticks, step) : [];
|
|
266
|
+
return ticks.map((value, index) => ({
|
|
267
|
+
value,
|
|
268
|
+
at: short(this.at(value)),
|
|
269
|
+
text: labels[index] ?? ""
|
|
270
|
+
}));
|
|
271
|
+
}, ...ngDevMode ? [{ debugName: "ticks" }] : /* istanbul ignore next */ []);
|
|
272
|
+
tickProbes = computed(() => wrChartLongest(this.ticks().map((tick) => tick.text), PROBES), ...ngDevMode ? [{ debugName: "tickProbes" }] : /* istanbul ignore next */ []);
|
|
207
273
|
at(value) {
|
|
208
274
|
const { lo, hi } = this.scale();
|
|
209
275
|
return wrClamp((value - lo) / (hi - lo), 0, 1);
|
|
@@ -213,17 +279,25 @@ var WrBarChart = class WrBarChart {
|
|
|
213
279
|
const series = this.visibleSeries();
|
|
214
280
|
const labels = this.categories();
|
|
215
281
|
const values = this.showValues();
|
|
282
|
+
const stacked = this.stacked();
|
|
216
283
|
const zero = this.at(0);
|
|
217
284
|
const name = (label, value) => this.name(label, value);
|
|
218
285
|
return Array.from({ length: this.categoryCount() }, (_, c) => {
|
|
219
286
|
const label = labels[c] ?? this.ordinals.format(c + 1);
|
|
220
|
-
|
|
287
|
+
let from = zero;
|
|
288
|
+
let to = zero;
|
|
289
|
+
const reach = (start, size) => {
|
|
290
|
+
from = Math.min(from, start);
|
|
291
|
+
to = Math.max(to, start + size);
|
|
292
|
+
};
|
|
293
|
+
if (!stacked) return {
|
|
221
294
|
label,
|
|
222
295
|
lanes: series.map((s) => {
|
|
223
296
|
const v = s.data[c];
|
|
224
297
|
if (v === null || v === void 0) return {
|
|
225
298
|
key: s.index,
|
|
226
|
-
|
|
299
|
+
up: [],
|
|
300
|
+
down: [],
|
|
227
301
|
ends: []
|
|
228
302
|
};
|
|
229
303
|
const end = this.at(v);
|
|
@@ -231,13 +305,16 @@ var WrBarChart = class WrBarChart {
|
|
|
231
305
|
series: s.index,
|
|
232
306
|
color: s.color,
|
|
233
307
|
dash: s.dash,
|
|
308
|
+
layer: null,
|
|
234
309
|
start: short(Math.min(zero, end)),
|
|
235
310
|
size: short(Math.abs(end - zero)),
|
|
236
311
|
name: name(s.label, v)
|
|
237
312
|
};
|
|
313
|
+
reach(bar.start, bar.size);
|
|
238
314
|
return {
|
|
239
315
|
key: s.index,
|
|
240
|
-
|
|
316
|
+
up: v < 0 ? [] : [bar],
|
|
317
|
+
down: v < 0 ? [bar] : [],
|
|
241
318
|
ends: values ? [{
|
|
242
319
|
text: this.numbers.label(v),
|
|
243
320
|
at: short(end),
|
|
@@ -245,35 +322,36 @@ var WrBarChart = class WrBarChart {
|
|
|
245
322
|
name: null
|
|
246
323
|
}] : []
|
|
247
324
|
};
|
|
248
|
-
})
|
|
325
|
+
}),
|
|
326
|
+
from: short(from),
|
|
327
|
+
to: short(to)
|
|
249
328
|
};
|
|
250
|
-
let
|
|
251
|
-
let
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
const
|
|
329
|
+
let rise = 0;
|
|
330
|
+
let fall = 0;
|
|
331
|
+
const up = [];
|
|
332
|
+
const down = [];
|
|
333
|
+
for (const s of series) {
|
|
255
334
|
const v = s.data[c];
|
|
256
|
-
if (v === null || v === void 0)
|
|
257
|
-
const
|
|
335
|
+
if (v === null || v === void 0) continue;
|
|
336
|
+
const side = v < 0 ? down : up;
|
|
337
|
+
const base = v < 0 ? fall : rise;
|
|
258
338
|
const top = base + v;
|
|
259
|
-
if (v < 0)
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
rises = true;
|
|
265
|
-
}
|
|
266
|
-
const from = this.at(base);
|
|
267
|
-
const to = this.at(top);
|
|
268
|
-
return [{
|
|
339
|
+
if (v < 0) fall = top;
|
|
340
|
+
else rise = top;
|
|
341
|
+
const start = this.at(base);
|
|
342
|
+
const end = this.at(top);
|
|
343
|
+
const bar = {
|
|
269
344
|
series: s.index,
|
|
270
345
|
color: s.color,
|
|
271
346
|
dash: s.dash,
|
|
272
|
-
|
|
273
|
-
|
|
347
|
+
layer: -side.length,
|
|
348
|
+
start: short(Math.min(start, end)),
|
|
349
|
+
size: short(Math.abs(end - start)),
|
|
274
350
|
name: name(s.label, v)
|
|
275
|
-
}
|
|
276
|
-
|
|
351
|
+
};
|
|
352
|
+
reach(bar.start, bar.size);
|
|
353
|
+
side.push(bar);
|
|
354
|
+
}
|
|
277
355
|
const total = (value, below) => ({
|
|
278
356
|
text: this.numbers.label(value),
|
|
279
357
|
at: short(this.at(value)),
|
|
@@ -281,15 +359,18 @@ var WrBarChart = class WrBarChart {
|
|
|
281
359
|
name: name(this.totalText(), value)
|
|
282
360
|
});
|
|
283
361
|
const ends = [];
|
|
284
|
-
if (values &&
|
|
285
|
-
if (values &&
|
|
362
|
+
if (values && up.length > 0) ends.push(total(rise, false));
|
|
363
|
+
if (values && down.length > 0) ends.push(total(fall, true));
|
|
286
364
|
return {
|
|
287
365
|
label,
|
|
288
366
|
lanes: [{
|
|
289
367
|
key: 0,
|
|
290
|
-
|
|
368
|
+
up,
|
|
369
|
+
down,
|
|
291
370
|
ends
|
|
292
|
-
}]
|
|
371
|
+
}],
|
|
372
|
+
from: short(from),
|
|
373
|
+
to: short(to)
|
|
293
374
|
};
|
|
294
375
|
});
|
|
295
376
|
}, ...ngDevMode ? [{ debugName: "seriesCategories" }] : /* istanbul ignore next */ []);
|
|
@@ -300,19 +381,17 @@ var WrBarChart = class WrBarChart {
|
|
|
300
381
|
max: [],
|
|
301
382
|
min: []
|
|
302
383
|
};
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
min: [...new Set(bars.filter((b) => b.below && !b.missing).map((b) => b.display))]
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
const ends = this.seriesCategories().flatMap((c) => c.lanes.flatMap((lane) => lane.ends));
|
|
384
|
+
const ends = this.seriesMode() ? this.seriesCategories().flatMap((c) => c.lanes.flatMap((lane) => lane.ends)) : this.bars().filter((bar) => !bar.missing).map((bar) => ({
|
|
385
|
+
text: bar.display,
|
|
386
|
+
below: bar.below
|
|
387
|
+
}));
|
|
311
388
|
return {
|
|
312
|
-
max:
|
|
313
|
-
min:
|
|
389
|
+
max: wrChartLongest(ends.filter((end) => !end.below).map((end) => end.text), PROBES),
|
|
390
|
+
min: wrChartLongest(ends.filter((end) => end.below).map((end) => end.text), PROBES)
|
|
314
391
|
};
|
|
315
392
|
}, ...ngDevMode ? [{ debugName: "rooms" }] : /* istanbul ignore next */ []);
|
|
393
|
+
labelProbes = computed(() => this.horizontal() ? [] : wrChartLongest(this.categoryLabels(), PROBES), ...ngDevMode ? [{ debugName: "labelProbes" }] : /* istanbul ignore next */ []);
|
|
394
|
+
labelStep = computed(() => wrChartLabelStep(this.categoryTotal(), this.labelsSize().width, this.labelWidth(), LABEL_GAP), ...ngDevMode ? [{ debugName: "labelStep" }] : /* istanbul ignore next */ []);
|
|
316
395
|
lineLayers = computed(() => {
|
|
317
396
|
const count = this.seriesMode() ? this.categoryCount() : this.data().length;
|
|
318
397
|
if (count === 0) return [];
|
|
@@ -329,27 +408,27 @@ var WrBarChart = class WrBarChart {
|
|
|
329
408
|
y: percent(1 - at)
|
|
330
409
|
};
|
|
331
410
|
};
|
|
411
|
+
const offset = this.resolvedSeries().length;
|
|
332
412
|
return this.visibleLines().map((line) => {
|
|
333
|
-
const segments = [];
|
|
334
413
|
const points = [];
|
|
335
|
-
let
|
|
414
|
+
let path = "";
|
|
415
|
+
let segments = 0;
|
|
416
|
+
let drawing = false;
|
|
336
417
|
for (let c = 0; c < count; c++) {
|
|
337
418
|
const value = line.data[c];
|
|
338
419
|
if (value === null || value === void 0) {
|
|
339
|
-
|
|
420
|
+
drawing = false;
|
|
340
421
|
continue;
|
|
341
422
|
}
|
|
342
423
|
const position = place(c, value);
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
to: position
|
|
346
|
-
});
|
|
424
|
+
path += `${drawing ? "L" : "M"}${position.x} ${position.y}`;
|
|
425
|
+
if (drawing) segments++;
|
|
347
426
|
points.push({
|
|
348
427
|
...position,
|
|
349
428
|
category: c,
|
|
350
429
|
name: this.name(labels[c] ?? this.ordinals.format(c + 1), value)
|
|
351
430
|
});
|
|
352
|
-
|
|
431
|
+
drawing = true;
|
|
353
432
|
}
|
|
354
433
|
return {
|
|
355
434
|
index: line.index,
|
|
@@ -359,8 +438,10 @@ var WrBarChart = class WrBarChart {
|
|
|
359
438
|
marker: line.marker,
|
|
360
439
|
d: wrChartMarkerPath(line.marker, POINT_RADIUS),
|
|
361
440
|
count,
|
|
441
|
+
path: segments > 0 ? path : "",
|
|
362
442
|
segments,
|
|
363
|
-
points
|
|
443
|
+
points,
|
|
444
|
+
key: offset + line.index
|
|
364
445
|
};
|
|
365
446
|
});
|
|
366
447
|
}, ...ngDevMode ? [{ debugName: "lineLayers" }] : /* istanbul ignore next */ []);
|
|
@@ -371,18 +452,41 @@ var WrBarChart = class WrBarChart {
|
|
|
371
452
|
const extent = wrChartMarkerExtent(line.marker, POINT_RADIUS);
|
|
372
453
|
reach = Math.max(reach, horizontal ? extent.side : Math.max(extent.top, extent.bottom));
|
|
373
454
|
}
|
|
374
|
-
return
|
|
455
|
+
return wrChartRound(reach, 3);
|
|
375
456
|
}, ...ngDevMode ? [{ debugName: "lineReach" }] : /* istanbul ignore next */ []);
|
|
376
|
-
legendItems = computed(() => [...this.resolvedSeries().map(({ label, color
|
|
457
|
+
legendItems = computed(() => [...this.resolvedSeries().map(({ label, color }) => ({
|
|
377
458
|
label,
|
|
378
|
-
color
|
|
379
|
-
dash
|
|
459
|
+
color
|
|
380
460
|
})), ...this.resolvedLines().map(({ label, color, dash, marker }) => ({
|
|
381
461
|
label,
|
|
382
462
|
color,
|
|
383
463
|
dash,
|
|
384
464
|
marker
|
|
385
465
|
}))], ...ngDevMode ? [{ debugName: "legendItems" }] : /* istanbul ignore next */ []);
|
|
466
|
+
legendShown = computed(() => {
|
|
467
|
+
const show = this.showLegend();
|
|
468
|
+
const rows = this.legendItems().length;
|
|
469
|
+
if (show === false || rows === 0 || this.legendPosition() === "none") return false;
|
|
470
|
+
if (!this.seriesMode() && !this.hasLines()) return false;
|
|
471
|
+
return show === true || rows > 1 || this.hasLines();
|
|
472
|
+
}, ...ngDevMode ? [{ debugName: "legendShown" }] : /* istanbul ignore next */ []);
|
|
473
|
+
legendFirst = computed(() => {
|
|
474
|
+
const position = this.legendPosition();
|
|
475
|
+
return position === "top" || position === "start";
|
|
476
|
+
}, ...ngDevMode ? [{ debugName: "legendFirst" }] : /* istanbul ignore next */ []);
|
|
477
|
+
legendSide = computed(() => {
|
|
478
|
+
const position = this.legendPosition();
|
|
479
|
+
return position === "start" || position === "end";
|
|
480
|
+
}, ...ngDevMode ? [{ debugName: "legendSide" }] : /* istanbul ignore next */ []);
|
|
481
|
+
empty = computed(() => this.categoryTotal() === 0, ...ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []);
|
|
482
|
+
state = useChartState({
|
|
483
|
+
loading: this.loading,
|
|
484
|
+
error: this.error,
|
|
485
|
+
empty: this.empty,
|
|
486
|
+
emptyLabel: this.emptyLabel,
|
|
487
|
+
loadingLabel: this.loadingLabel,
|
|
488
|
+
errorLabel: this.errorLabel
|
|
489
|
+
});
|
|
386
490
|
legendHidden = computed(() => {
|
|
387
491
|
const hiddenSeries = this.hiddenSeries();
|
|
388
492
|
if (!this.hasLines()) return hiddenSeries;
|
|
@@ -424,25 +528,26 @@ var WrBarChart = class WrBarChart {
|
|
|
424
528
|
tip = useChartTooltip(this.tooltip, (index) => this.seriesMode() ? this.categoryTip(index) : this.barTip(index));
|
|
425
529
|
barTip(index) {
|
|
426
530
|
const bar = this.bars()[index];
|
|
427
|
-
|
|
428
|
-
if (!bar || !anchor) return null;
|
|
531
|
+
if (!bar || this.state()) return null;
|
|
429
532
|
const rows = this.lineRows(index);
|
|
430
|
-
if (rows.length === 0
|
|
533
|
+
if (rows.length === 0 && bar.missing) return null;
|
|
534
|
+
const anchor = this.sectionBox(index, bar.start, bar.start + bar.share);
|
|
535
|
+
if (!anchor) return null;
|
|
536
|
+
return rows.length === 0 ? {
|
|
431
537
|
datum: {
|
|
432
538
|
label: bar.label,
|
|
433
539
|
value: bar.text,
|
|
434
540
|
color: bar.color
|
|
435
541
|
},
|
|
436
542
|
anchor
|
|
437
|
-
}
|
|
438
|
-
return {
|
|
543
|
+
} : {
|
|
439
544
|
datum: {
|
|
440
545
|
label: bar.label,
|
|
441
546
|
value: bar.text,
|
|
442
547
|
color: bar.color,
|
|
443
548
|
rows
|
|
444
549
|
},
|
|
445
|
-
anchor
|
|
550
|
+
anchor
|
|
446
551
|
};
|
|
447
552
|
}
|
|
448
553
|
lineRows(index) {
|
|
@@ -455,29 +560,44 @@ var WrBarChart = class WrBarChart {
|
|
|
455
560
|
}];
|
|
456
561
|
});
|
|
457
562
|
}
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
563
|
+
sectionBox(index, from, to) {
|
|
564
|
+
const track = this.trackEl()?.nativeElement;
|
|
565
|
+
const section = this.host.querySelector(`[data-wr-index="${index}"]`);
|
|
566
|
+
if (!track || !section) return null;
|
|
567
|
+
let reach = 0;
|
|
568
|
+
for (const line of this.visibleLines()) {
|
|
569
|
+
const value = line.data[index];
|
|
570
|
+
if (value === null || value === void 0) continue;
|
|
571
|
+
const at = this.at(value);
|
|
572
|
+
from = Math.min(from, at);
|
|
573
|
+
to = Math.max(to, at);
|
|
574
|
+
reach = this.lineReach() + 1;
|
|
575
|
+
}
|
|
576
|
+
const axis = track.getBoundingClientRect();
|
|
577
|
+
const across = section.getBoundingClientRect();
|
|
578
|
+
if (!this.horizontal()) {
|
|
579
|
+
const top = axis.bottom - to * axis.height - reach;
|
|
580
|
+
const bottom = axis.bottom - from * axis.height + reach;
|
|
581
|
+
return {
|
|
582
|
+
x: across.left,
|
|
583
|
+
y: top,
|
|
584
|
+
width: across.width,
|
|
585
|
+
height: bottom - top
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
const rtl = getComputedStyle(track).direction === "rtl";
|
|
589
|
+
const left = rtl ? axis.right - to * axis.width - reach : axis.left + from * axis.width - reach;
|
|
590
|
+
const right = rtl ? axis.right - from * axis.width + reach : axis.left + to * axis.width + reach;
|
|
470
591
|
return {
|
|
471
592
|
x: left,
|
|
472
|
-
y: top,
|
|
593
|
+
y: across.top,
|
|
473
594
|
width: right - left,
|
|
474
|
-
height:
|
|
595
|
+
height: across.height
|
|
475
596
|
};
|
|
476
597
|
}
|
|
477
598
|
categoryTip(index) {
|
|
478
599
|
const category = this.seriesCategories()[index];
|
|
479
|
-
|
|
480
|
-
if (!category || !element) return null;
|
|
600
|
+
if (!category || this.state()) return null;
|
|
481
601
|
const rows = [...this.visibleSeries().flatMap((s) => {
|
|
482
602
|
const value = s.data[index];
|
|
483
603
|
return value === null || value === void 0 ? [] : [{
|
|
@@ -487,15 +607,15 @@ var WrBarChart = class WrBarChart {
|
|
|
487
607
|
}];
|
|
488
608
|
}), ...this.lineRows(index)];
|
|
489
609
|
if (rows.length === 0) return null;
|
|
490
|
-
const
|
|
491
|
-
if (
|
|
610
|
+
const anchor = this.sectionBox(index, category.from, category.to);
|
|
611
|
+
if (!anchor) return null;
|
|
492
612
|
return {
|
|
493
613
|
datum: {
|
|
494
614
|
label: category.label,
|
|
495
615
|
value: "",
|
|
496
616
|
rows
|
|
497
617
|
},
|
|
498
|
-
anchor
|
|
618
|
+
anchor
|
|
499
619
|
};
|
|
500
620
|
}
|
|
501
621
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
@@ -569,6 +689,20 @@ var WrBarChart = class WrBarChart {
|
|
|
569
689
|
isRequired: false,
|
|
570
690
|
transformFunction: null
|
|
571
691
|
},
|
|
692
|
+
showGrid: {
|
|
693
|
+
classPropertyName: "showGrid",
|
|
694
|
+
publicName: "showGrid",
|
|
695
|
+
isSignal: true,
|
|
696
|
+
isRequired: false,
|
|
697
|
+
transformFunction: null
|
|
698
|
+
},
|
|
699
|
+
showAxis: {
|
|
700
|
+
classPropertyName: "showAxis",
|
|
701
|
+
publicName: "showAxis",
|
|
702
|
+
isSignal: true,
|
|
703
|
+
isRequired: false,
|
|
704
|
+
transformFunction: null
|
|
705
|
+
},
|
|
572
706
|
showValues: {
|
|
573
707
|
classPropertyName: "showValues",
|
|
574
708
|
publicName: "showValues",
|
|
@@ -604,6 +738,48 @@ var WrBarChart = class WrBarChart {
|
|
|
604
738
|
isRequired: false,
|
|
605
739
|
transformFunction: null
|
|
606
740
|
},
|
|
741
|
+
legendPosition: {
|
|
742
|
+
classPropertyName: "legendPosition",
|
|
743
|
+
publicName: "legendPosition",
|
|
744
|
+
isSignal: true,
|
|
745
|
+
isRequired: false,
|
|
746
|
+
transformFunction: null
|
|
747
|
+
},
|
|
748
|
+
loading: {
|
|
749
|
+
classPropertyName: "loading",
|
|
750
|
+
publicName: "loading",
|
|
751
|
+
isSignal: true,
|
|
752
|
+
isRequired: false,
|
|
753
|
+
transformFunction: null
|
|
754
|
+
},
|
|
755
|
+
error: {
|
|
756
|
+
classPropertyName: "error",
|
|
757
|
+
publicName: "error",
|
|
758
|
+
isSignal: true,
|
|
759
|
+
isRequired: false,
|
|
760
|
+
transformFunction: null
|
|
761
|
+
},
|
|
762
|
+
emptyLabel: {
|
|
763
|
+
classPropertyName: "emptyLabel",
|
|
764
|
+
publicName: "emptyLabel",
|
|
765
|
+
isSignal: true,
|
|
766
|
+
isRequired: false,
|
|
767
|
+
transformFunction: null
|
|
768
|
+
},
|
|
769
|
+
loadingLabel: {
|
|
770
|
+
classPropertyName: "loadingLabel",
|
|
771
|
+
publicName: "loadingLabel",
|
|
772
|
+
isSignal: true,
|
|
773
|
+
isRequired: false,
|
|
774
|
+
transformFunction: null
|
|
775
|
+
},
|
|
776
|
+
errorLabel: {
|
|
777
|
+
classPropertyName: "errorLabel",
|
|
778
|
+
publicName: "errorLabel",
|
|
779
|
+
isSignal: true,
|
|
780
|
+
isRequired: false,
|
|
781
|
+
transformFunction: null
|
|
782
|
+
},
|
|
607
783
|
toggleableLegend: {
|
|
608
784
|
classPropertyName: "toggleableLegend",
|
|
609
785
|
publicName: "toggleableLegend",
|
|
@@ -646,6 +822,8 @@ var WrBarChart = class WrBarChart {
|
|
|
646
822
|
},
|
|
647
823
|
host: {
|
|
648
824
|
properties: {
|
|
825
|
+
"class.wr-chart--legend-side": "legendShown() && legendSide()",
|
|
826
|
+
"class.wr-bar-chart--axis": "showAxis()",
|
|
649
827
|
"class.wr-bar-chart--horizontal": "horizontal()",
|
|
650
828
|
"class.wr-bar-chart--series": "seriesMode()",
|
|
651
829
|
"class.wr-bar-chart--stacked": "seriesMode() && stacked()",
|
|
@@ -653,48 +831,61 @@ var WrBarChart = class WrBarChart {
|
|
|
653
831
|
"style.--wr-bar-chart-reach": "hasLines() ? lineReach() : null",
|
|
654
832
|
"style.--wr-bar-chart-categories": "categoryTotal() || null"
|
|
655
833
|
},
|
|
656
|
-
classAttribute: "wr-bar-chart"
|
|
834
|
+
classAttribute: "wr-bar-chart wr-chart--legend"
|
|
657
835
|
},
|
|
658
|
-
viewQueries: [
|
|
836
|
+
viewQueries: [{
|
|
837
|
+
propertyName: "trackEl",
|
|
838
|
+
first: true,
|
|
839
|
+
predicate: ["trackEl"],
|
|
840
|
+
descendants: true,
|
|
841
|
+
isSignal: true
|
|
842
|
+
}, {
|
|
843
|
+
propertyName: "labelsEl",
|
|
844
|
+
first: true,
|
|
845
|
+
predicate: ["labelsEl"],
|
|
846
|
+
descendants: true,
|
|
847
|
+
isSignal: true
|
|
848
|
+
}],
|
|
849
|
+
ngImport: i0,
|
|
850
|
+
template: "@let isSeries = seriesMode();\n@let isHorizontal = horizontal();\n@let shown = state();\n@let scale = ticks();\n\n<!-- The legend, drawn before the body 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. Every\n series is keyed by a dot in its colour and each line by its dash and its marker. Rows\n are tracked by position, so two series that share a label are two rows. -->\n<ng-template #legend>\n <ul\n wr-chart-legend\n class=\"wr-bar-chart__legend\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [toggleable]=\"toggleableLegend()\"\n [hiddenSeries]=\"legendHidden()\"\n (hiddenSeriesChange)=\"onLegendHidden($event)\"\n ></ul>\n</ng-template>\n\n@if (legendShown() && legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n<div class=\"wr-bar-chart__body\">\n <!-- One layout for `data` and `series`, standing up and lying down: the plot is a grid of\n the value axis' scale, the track the bars run along, and a room past each end of it\n for the values printed there. A named `group`, not an `img`: `img` is a\n children-presentational role, so the bars' own `img` names inside it are dropped by a\n user agent that follows the spec - WebKit drops exactly such a subtree. Sideways,\n `height` is a floor rather than a height: each row keeps room for a line of text, so\n many rows grow the plot. -->\n <div\n class=\"wr-bar-chart__plot\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"isHorizontal ? null : height()\"\n [style.min-height.px]=\"isHorizontal ? height() : null\"\n >\n @if (showAxis()) {\n <!-- The scale: decoration, since every bar's name carries its value. The hidden\n copies of the longest labels are what give the gutter its width. -->\n <div class=\"wr-bar-chart__axis\" aria-hidden=\"true\">\n @for (text of tickProbes(); track $index) {\n <span class=\"wr-bar-chart__tick wr-bar-chart__tick--probe\">{{ text }}</span>\n }\n @for (tick of scale; track $index) {\n <span class=\"wr-bar-chart__tick\" [style.--wr-bar-chart-at]=\"tick.at\">{{ tick.text }}</span>\n }\n </div>\n }\n @if (isHorizontal) {\n <!-- In the plot, so the rows share its gap with the track; decoration, as under the\n vertical bars: each row's group or image is named. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (label of categoryLabels(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ label }}</span>\n }\n </div>\n }\n @if (showValues()) {\n <!-- Hidden copies of the longest values printed past each end of the axis, stacked in\n one cell: each room is as large as the largest of them, in the value's own font,\n so a value past the longest bar has exactly the space it needs. Tracked by\n position: they are measuring copies, and live data changes every text at once. -->\n <div class=\"wr-bar-chart__room wr-bar-chart__room--max\" aria-hidden=\"true\">\n @for (text of rooms().max; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n <div class=\"wr-bar-chart__room wr-bar-chart__room--min\" aria-hidden=\"true\">\n @for (text of rooms().min; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n }\n <div #trackEl class=\"wr-bar-chart__track\" data-wr-hold [style.--wr-bar-chart-zero]=\"zero()\">\n @if (showGrid()) {\n <!-- Under the bars: a line at every tick of the value axis. -->\n <div class=\"wr-bar-chart__grid\" aria-hidden=\"true\">\n @for (tick of scale; track $index) {\n <span class=\"wr-bar-chart__grid-line\" [style.--wr-bar-chart-at]=\"tick.at\"></span>\n }\n </div>\n }\n <!-- Before the bars, so a bar standing on zero covers it and a 0 draws nothing. -->\n <div class=\"wr-bar-chart__baseline\"></div>\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the grid and the axis the chart keeps. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n } @else if (isSeries) {\n @for (category of seriesCategories(); track $index) {\n <!-- `data-wr-index` is what the chart's one hover listener reads. -->\n <div\n class=\"wr-bar-chart__category\"\n role=\"group\"\n [attr.aria-label]=\"category.label\"\n [attr.data-wr-index]=\"$index\"\n >\n @for (lane of category.lanes; track lane.key) {\n <div class=\"wr-bar-chart__lane\">\n <!-- A side per sign: the box from zero to that end of the axis, which clips\n the bars it holds. Each bar is as large as its side and moved along the\n value axis by a transform the stylesheet works out from the two shares\n written here, so a new value moves the bar without a layout pass. By\n position, not by label: two series may share one. -->\n @if (lane.up.length > 0) {\n <div class=\"wr-bar-chart__side\">\n @for (bar of lane.up; track bar.series) {\n <div\n class=\"wr-bar-chart__series-bar\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [attr.data-wr-series]=\"bar.series\"\n [attr.data-dash]=\"bar.dash\"\n [style.--wr-bar-chart-color]=\"bar.color\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.size\"\n [style.z-index]=\"bar.layer\"\n ></div>\n }\n </div>\n }\n @if (lane.down.length > 0) {\n <div class=\"wr-bar-chart__side wr-bar-chart__side--down\">\n @for (bar of lane.down; track bar.series) {\n <div\n class=\"wr-bar-chart__series-bar\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [attr.data-wr-series]=\"bar.series\"\n [attr.data-dash]=\"bar.dash\"\n [style.--wr-bar-chart-color]=\"bar.color\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.size\"\n [style.z-index]=\"bar.layer\"\n ></div>\n }\n </div>\n }\n @for (end of lane.ends; track $index) {\n <!-- Past one bar, hidden: the bar's own name carries its value. Past a pile,\n an image named \"Total: 20\": no bar's name carries the total, and a\n reader should not have to add the names up. -->\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"end.below\"\n [style.--wr-bar-chart-at]=\"end.at\"\n [attr.role]=\"end.name ? 'img' : null\"\n [attr.aria-label]=\"end.name\"\n [attr.aria-hidden]=\"end.name ? null : 'true'\"\n >{{ end.text }}</span\n >\n }\n </div>\n }\n </div>\n }\n } @else {\n @for (bar of bars(); track $index) {\n <!-- One datum: the column is its lane, and carries its name. Keyed `c<n>` for the\n hover, a key no legend row has, so a column dims the others and never a line. -->\n <div\n class=\"wr-bar-chart__column\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [attr.data-wr-index]=\"$index\"\n [attr.data-wr-series]=\"`c${$index}`\"\n >\n <div class=\"wr-bar-chart__side\" [class.wr-bar-chart__side--down]=\"bar.below\">\n <div\n class=\"wr-bar-chart__bar\"\n [class.wr-bar-chart__bar--below]=\"bar.below\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.share\"\n [style.background]=\"bar.color\"\n ></div>\n </div>\n @if (showValues() && !bar.missing) {\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"bar.below\"\n [style.--wr-bar-chart-at]=\"bar.at\"\n >{{ bar.display }}</span\n >\n }\n </div>\n }\n }\n @if (!shown) {\n @for (line of lineLayers(); track line.index) {\n <!-- Over the bars and the baseline, and out of the pointer's way, so hovering a\n point still opens its category's tooltip. Each line is a group named by the\n line, holding a named image per point; its path is decoration. The box runs\n from the middle of the first category to the middle of the last, which the\n stylesheet works out from `count`. -->\n <svg\n class=\"wr-bar-chart__line\"\n role=\"group\"\n focusable=\"false\"\n [attr.aria-label]=\"line.label\"\n [attr.data-wr-series]=\"line.key\"\n [style.--wr-bar-chart-count]=\"line.count\"\n >\n @if (line.path) {\n <!-- The whole line as ONE path, in a box stretched over the line's own. The\n stroke does not scale with it, so the width and the dash stay in pixels. -->\n <svg\n class=\"wr-bar-chart__line-run\"\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\"\n aria-hidden=\"true\"\n >\n <path\n class=\"wr-bar-chart__line-segment\"\n fill=\"none\"\n vector-effect=\"non-scaling-stroke\"\n [attr.d]=\"line.path\"\n [attr.data-segments]=\"line.segments\"\n [attr.stroke]=\"line.color\"\n [attr.stroke-dasharray]=\"line.dash || null\"\n />\n </svg>\n }\n @for (point of line.points; track point.category) {\n <!-- A nested `<svg>` placed by percentage with its marker drawn about its origin\n in px, as the scatter chart places its points: one pixel of viewport, and\n `overflow` lets the marker reach outside it, so a marker keeps its shape\n and its size at any width. -->\n <svg\n class=\"wr-bar-chart__point\"\n role=\"img\"\n width=\"1\"\n height=\"1\"\n overflow=\"visible\"\n [attr.aria-label]=\"point.name\"\n [attr.x]=\"`${point.x}%`\"\n [attr.y]=\"`${point.y}%`\"\n [attr.data-marker]=\"line.marker\"\n >\n <path [attr.d]=\"line.d\" [attr.fill]=\"line.color\" />\n </svg>\n }\n </svg>\n }\n }\n </div>\n </div>\n @if (!isHorizontal) {\n <!-- Named on each bar or category above, so the visible label row is decoration. A\n name left out by the thinning keeps its slot, so the ones printed stay under their\n bars; the hidden copies of the longest names are what the thinning measures. -->\n <div #labelsEl class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @let step = labelStep();\n @for (label of categoryLabels(); track $index) {\n <span\n class=\"wr-bar-chart__label\"\n [class.wr-bar-chart__label--wide]=\"step > 1\"\n [class.wr-bar-chart__label--skipped]=\"step > 1 && $index % step !== 0\"\n >{{ label }}</span\n >\n }\n @for (text of labelProbes(); track $index) {\n <span class=\"wr-bar-chart__label-probe\">{{ text }}</span>\n }\n </div>\n }\n</div>\n\n@if (legendShown() && !legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n@if (dataTable() && !shown) {\n <!-- The figures for a screen reader who wants to move cell by cell. Clipped to nothing\n by its own stylesheet, so it takes no room and draws nothing. With `data`, one\n column for the bars, then one per line. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n",
|
|
851
|
+
dependencies: [
|
|
852
|
+
{
|
|
853
|
+
kind: "directive",
|
|
854
|
+
type: NgTemplateOutlet,
|
|
855
|
+
selector: "[ngTemplateOutlet]",
|
|
856
|
+
inputs: [
|
|
857
|
+
"ngTemplateOutletContext",
|
|
858
|
+
"ngTemplateOutlet",
|
|
859
|
+
"ngTemplateOutletInjector"
|
|
860
|
+
]
|
|
861
|
+
},
|
|
659
862
|
{
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
863
|
+
kind: "component",
|
|
864
|
+
type: WrChartLegend,
|
|
865
|
+
selector: "ul[wr-chart-legend]",
|
|
866
|
+
inputs: [
|
|
867
|
+
"items",
|
|
868
|
+
"position",
|
|
869
|
+
"toggleable",
|
|
870
|
+
"hiddenSeries",
|
|
871
|
+
"ariaLabel",
|
|
872
|
+
"hiddenLabel"
|
|
873
|
+
],
|
|
874
|
+
outputs: ["hiddenSeriesChange", "toggled"]
|
|
664
875
|
},
|
|
665
876
|
{
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
877
|
+
kind: "component",
|
|
878
|
+
type: WrChartState,
|
|
879
|
+
selector: "wr-chart-state",
|
|
880
|
+
inputs: ["kind", "label"]
|
|
670
881
|
},
|
|
671
882
|
{
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
883
|
+
kind: "component",
|
|
884
|
+
type: WrChartTable,
|
|
885
|
+
selector: "wr-chart-table",
|
|
886
|
+
inputs: ["data"]
|
|
676
887
|
}
|
|
677
888
|
],
|
|
678
|
-
ngImport: i0,
|
|
679
|
-
template: "@let isSeries = seriesMode();\n@let isHorizontal = horizontal();\n@let isCombo = hasLines();\n@if ((isSeries || isCombo) && showLegend() && legendItems().length > 0) {\n <!-- Every row keys its series by the series' own dash, the one its bars' outlines are\n drawn in, and each line by its dash and its marker. Rows are tracked by position, so\n two series that share a label are two rows. -->\n <ul\n wr-chart-legend\n class=\"wr-bar-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [hiddenSeries]=\"legendHidden()\"\n (hiddenSeriesChange)=\"onLegendHidden($event)\"\n ></ul>\n}\n\n@if (!isSeries && !isHorizontal && !isCombo) {\n <!-- A named `group`, not an `img`: `img` is a children-presentational role, so the\n bars' own `img` names inside it are dropped by a user agent that follows the spec —\n WebKit drops exactly such a subtree, which is why the donut moved its `img` off the\n wrapper. -->\n <div class=\"wr-bar-chart__plot\" role=\"group\" [attr.aria-label]=\"resolvedAriaLabel()\" [style.height.px]=\"height()\">\n @for (bar of bars(); track $index) {\n <div\n class=\"wr-bar-chart__column\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @if (showValues() && !bar.missing) {\n <span class=\"wr-bar-chart__value\">{{ bar.display }}</span>\n }\n <div #barEl class=\"wr-bar-chart__bar\" [style.flex-grow]=\"bar.share\" [style.background]=\"bar.color\"></div>\n </div>\n }\n </div>\n <!-- Named on the column above, so the visible label row is decoration here. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (bar of bars(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ bar.label }}</span>\n }\n </div>\n} @else {\n <!-- The layout `series`, `orientation=\"horizontal\"` and `lines` share: the plot is a grid\n of the track the bars run along, a room past each end of it for the values printed\n there, and — sideways — the gutter of category names. Still a named `group`, for the\n reason the vertical `data` plot gives. Sideways, `height` is a floor rather than a\n height: each row keeps room for a line of text, so many rows grow the plot. -->\n <div\n class=\"wr-bar-chart__plot\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"isHorizontal ? null : height()\"\n [style.min-height.px]=\"isHorizontal ? height() : null\"\n >\n @if (isHorizontal) {\n <!-- In the plot, so the rows share its gap with the track; decoration, as under the\n vertical bars: each row's group or image is named. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (label of categoryLabels(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ label }}</span>\n }\n </div>\n }\n @if (showValues()) {\n <!-- Hidden copies of the values printed past each end of the axis, stacked in one\n cell: each room is as large as the largest of them, in the value's own font, so\n a value past the longest bar has exactly the space it needs. Tracked by position:\n they are measuring copies, and live data changes every text at once. -->\n <div class=\"wr-bar-chart__room wr-bar-chart__room--max\" aria-hidden=\"true\">\n @for (text of rooms().max; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n <div class=\"wr-bar-chart__room wr-bar-chart__room--min\" aria-hidden=\"true\">\n @for (text of rooms().min; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n }\n <div class=\"wr-bar-chart__track\" [style.--wr-bar-chart-zero]=\"zero()\">\n @if (isSeries) {\n @for (category of seriesCategories(); track $index) {\n <div\n #categoryEl\n class=\"wr-bar-chart__category\"\n role=\"group\"\n [attr.aria-label]=\"category.label\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @for (lane of category.lanes; track lane.key) {\n <div class=\"wr-bar-chart__lane\">\n <!-- By position, not by label: two series may share one. Each bar hands the\n stylesheet where it starts and how much of the axis it covers. -->\n @for (bar of lane.bars; track bar.series) {\n <div\n class=\"wr-bar-chart__series-bar\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [style.--wr-bar-chart-color]=\"bar.color\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.size\"\n >\n <!-- The outline, in the series' colour and its own dash: what tells two\n series apart without hue, and what the legend's key draws. Sized in\n pixels, so a dash is the same length on every bar. -->\n <svg class=\"wr-bar-chart__edge\" aria-hidden=\"true\" focusable=\"false\">\n <rect\n width=\"100%\"\n height=\"100%\"\n fill=\"none\"\n [attr.stroke]=\"bar.color\"\n [attr.stroke-dasharray]=\"bar.dash || null\"\n />\n </svg>\n </div>\n }\n @for (end of lane.ends; track $index) {\n <!-- Past one bar, hidden: the bar's own name carries its value. Past a pile,\n an image named \"Total: 20\": no bar's name carries the total, and a\n reader should not have to add the names up. -->\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"end.below\"\n [style.--wr-bar-chart-at]=\"end.at\"\n [attr.role]=\"end.name ? 'img' : null\"\n [attr.aria-label]=\"end.name\"\n [attr.aria-hidden]=\"end.name ? null : 'true'\"\n >{{ end.text }}</span\n >\n }\n </div>\n }\n </div>\n }\n } @else {\n @for (bar of bars(); track $index) {\n <!-- Beside `lines`, the column also hands the stylesheet where its bar starts: on\n zero, or at its own end for a bar hanging below it. -->\n <div\n class=\"wr-bar-chart__column\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [style.--wr-bar-chart-start]=\"isCombo ? bar.start : null\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @if (showValues() && !bar.missing) {\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"bar.below\"\n [style.--wr-bar-chart-at]=\"bar.at\"\n >{{ bar.display }}</span\n >\n }\n <div\n #barEl\n class=\"wr-bar-chart__bar\"\n [class.wr-bar-chart__bar--below]=\"bar.below\"\n [style.flex-grow]=\"bar.share\"\n [style.background]=\"bar.color\"\n ></div>\n </div>\n }\n }\n <!-- After the bars, so it is drawn over them where zero runs through the plot. -->\n <div class=\"wr-bar-chart__baseline\"></div>\n @for (line of lineLayers(); track line.index) {\n <!-- Over the bars and the baseline, and out of the pointer's way, so hovering a\n point still opens its category's tooltip. Each line is a group named by the\n line, holding a named image per point; its runs are decoration. The box runs\n from the middle of the first category to the middle of the last, which the\n stylesheet works out from `count`, and every position in it is a percentage,\n so nothing stretches: a dash and a marker keep their size at any width. -->\n <svg\n class=\"wr-bar-chart__line\"\n role=\"group\"\n focusable=\"false\"\n [attr.aria-label]=\"line.label\"\n [style.--wr-bar-chart-count]=\"line.count\"\n >\n @for (segment of line.segments; track $index) {\n <line\n class=\"wr-bar-chart__line-segment\"\n [attr.x1]=\"`${segment.from.x}%`\"\n [attr.y1]=\"`${segment.from.y}%`\"\n [attr.x2]=\"`${segment.to.x}%`\"\n [attr.y2]=\"`${segment.to.y}%`\"\n [attr.stroke]=\"line.color\"\n [attr.stroke-dasharray]=\"line.dash || null\"\n />\n }\n @for (point of line.points; track point.category) {\n <!-- A nested `<svg>` placed by percentage with its marker drawn about its origin\n in px, as the scatter chart places its points: one pixel of viewport, and\n `overflow` lets the marker reach outside it. -->\n <svg\n #pointEl\n class=\"wr-bar-chart__point\"\n role=\"img\"\n width=\"1\"\n height=\"1\"\n overflow=\"visible\"\n [attr.aria-label]=\"point.name\"\n [attr.x]=\"`${point.x}%`\"\n [attr.y]=\"`${point.y}%`\"\n [attr.data-marker]=\"line.marker\"\n >\n <path [attr.d]=\"line.d\" [attr.fill]=\"line.color\" />\n </svg>\n }\n </svg>\n }\n </div>\n </div>\n @if (!isHorizontal) {\n <!-- Named on each category's group above, so the visible label row is decoration. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (label of categoryLabels(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ label }}</span>\n }\n </div>\n }\n}\n\n@if (dataTable() && (isSeries || bars().length > 0)) {\n <!-- The figures for a screen reader who wants to move cell by cell. Clipped to nothing\n by its own stylesheet, so it takes no room and draws nothing. With `data`, one\n column for the bars, then one per line. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n",
|
|
680
|
-
dependencies: [{
|
|
681
|
-
kind: "component",
|
|
682
|
-
type: WrChartLegend,
|
|
683
|
-
selector: "ul[wr-chart-legend]",
|
|
684
|
-
inputs: [
|
|
685
|
-
"items",
|
|
686
|
-
"toggleable",
|
|
687
|
-
"hiddenSeries",
|
|
688
|
-
"ariaLabel",
|
|
689
|
-
"hiddenLabel"
|
|
690
|
-
],
|
|
691
|
-
outputs: ["hiddenSeriesChange", "toggled"]
|
|
692
|
-
}, {
|
|
693
|
-
kind: "component",
|
|
694
|
-
type: WrChartTable,
|
|
695
|
-
selector: "wr-chart-table",
|
|
696
|
-
inputs: ["data"]
|
|
697
|
-
}],
|
|
698
889
|
encapsulation: i0.ViewEncapsulation.None
|
|
699
890
|
});
|
|
700
891
|
};
|
|
@@ -709,7 +900,9 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
709
900
|
selector: "wr-bar-chart",
|
|
710
901
|
encapsulation: ViewEncapsulation.None,
|
|
711
902
|
host: {
|
|
712
|
-
class: "wr-bar-chart",
|
|
903
|
+
class: "wr-bar-chart wr-chart--legend",
|
|
904
|
+
"[class.wr-chart--legend-side]": "legendShown() && legendSide()",
|
|
905
|
+
"[class.wr-bar-chart--axis]": "showAxis()",
|
|
713
906
|
"[class.wr-bar-chart--horizontal]": "horizontal()",
|
|
714
907
|
"[class.wr-bar-chart--series]": "seriesMode()",
|
|
715
908
|
"[class.wr-bar-chart--stacked]": "seriesMode() && stacked()",
|
|
@@ -717,8 +910,13 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
717
910
|
"[style.--wr-bar-chart-reach]": "hasLines() ? lineReach() : null",
|
|
718
911
|
"[style.--wr-bar-chart-categories]": "categoryTotal() || null"
|
|
719
912
|
},
|
|
720
|
-
imports: [
|
|
721
|
-
template: "@let isSeries = seriesMode();\n@let isHorizontal = horizontal();\n@let isCombo = hasLines();\n@if ((isSeries || isCombo) && showLegend() && legendItems().length > 0) {\n <!-- Every row keys its series by the series' own dash, the one its bars' outlines are\n drawn in, and each line by its dash and its marker. Rows are tracked by position, so\n two series that share a label are two rows. -->\n <ul\n wr-chart-legend\n class=\"wr-bar-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [hiddenSeries]=\"legendHidden()\"\n (hiddenSeriesChange)=\"onLegendHidden($event)\"\n ></ul>\n}\n\n@if (!isSeries && !isHorizontal && !isCombo) {\n <!-- A named `group`, not an `img`: `img` is a children-presentational role, so the\n bars' own `img` names inside it are dropped by a user agent that follows the spec —\n WebKit drops exactly such a subtree, which is why the donut moved its `img` off the\n wrapper. -->\n <div class=\"wr-bar-chart__plot\" role=\"group\" [attr.aria-label]=\"resolvedAriaLabel()\" [style.height.px]=\"height()\">\n @for (bar of bars(); track $index) {\n <div\n class=\"wr-bar-chart__column\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @if (showValues() && !bar.missing) {\n <span class=\"wr-bar-chart__value\">{{ bar.display }}</span>\n }\n <div #barEl class=\"wr-bar-chart__bar\" [style.flex-grow]=\"bar.share\" [style.background]=\"bar.color\"></div>\n </div>\n }\n </div>\n <!-- Named on the column above, so the visible label row is decoration here. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (bar of bars(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ bar.label }}</span>\n }\n </div>\n} @else {\n <!-- The layout `series`, `orientation=\"horizontal\"` and `lines` share: the plot is a grid\n of the track the bars run along, a room past each end of it for the values printed\n there, and — sideways — the gutter of category names. Still a named `group`, for the\n reason the vertical `data` plot gives. Sideways, `height` is a floor rather than a\n height: each row keeps room for a line of text, so many rows grow the plot. -->\n <div\n class=\"wr-bar-chart__plot\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"isHorizontal ? null : height()\"\n [style.min-height.px]=\"isHorizontal ? height() : null\"\n >\n @if (isHorizontal) {\n <!-- In the plot, so the rows share its gap with the track; decoration, as under the\n vertical bars: each row's group or image is named. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (label of categoryLabels(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ label }}</span>\n }\n </div>\n }\n @if (showValues()) {\n <!-- Hidden copies of the values printed past each end of the axis, stacked in one\n cell: each room is as large as the largest of them, in the value's own font, so\n a value past the longest bar has exactly the space it needs. Tracked by position:\n they are measuring copies, and live data changes every text at once. -->\n <div class=\"wr-bar-chart__room wr-bar-chart__room--max\" aria-hidden=\"true\">\n @for (text of rooms().max; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n <div class=\"wr-bar-chart__room wr-bar-chart__room--min\" aria-hidden=\"true\">\n @for (text of rooms().min; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n }\n <div class=\"wr-bar-chart__track\" [style.--wr-bar-chart-zero]=\"zero()\">\n @if (isSeries) {\n @for (category of seriesCategories(); track $index) {\n <div\n #categoryEl\n class=\"wr-bar-chart__category\"\n role=\"group\"\n [attr.aria-label]=\"category.label\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @for (lane of category.lanes; track lane.key) {\n <div class=\"wr-bar-chart__lane\">\n <!-- By position, not by label: two series may share one. Each bar hands the\n stylesheet where it starts and how much of the axis it covers. -->\n @for (bar of lane.bars; track bar.series) {\n <div\n class=\"wr-bar-chart__series-bar\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [style.--wr-bar-chart-color]=\"bar.color\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.size\"\n >\n <!-- The outline, in the series' colour and its own dash: what tells two\n series apart without hue, and what the legend's key draws. Sized in\n pixels, so a dash is the same length on every bar. -->\n <svg class=\"wr-bar-chart__edge\" aria-hidden=\"true\" focusable=\"false\">\n <rect\n width=\"100%\"\n height=\"100%\"\n fill=\"none\"\n [attr.stroke]=\"bar.color\"\n [attr.stroke-dasharray]=\"bar.dash || null\"\n />\n </svg>\n </div>\n }\n @for (end of lane.ends; track $index) {\n <!-- Past one bar, hidden: the bar's own name carries its value. Past a pile,\n an image named \"Total: 20\": no bar's name carries the total, and a\n reader should not have to add the names up. -->\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"end.below\"\n [style.--wr-bar-chart-at]=\"end.at\"\n [attr.role]=\"end.name ? 'img' : null\"\n [attr.aria-label]=\"end.name\"\n [attr.aria-hidden]=\"end.name ? null : 'true'\"\n >{{ end.text }}</span\n >\n }\n </div>\n }\n </div>\n }\n } @else {\n @for (bar of bars(); track $index) {\n <!-- Beside `lines`, the column also hands the stylesheet where its bar starts: on\n zero, or at its own end for a bar hanging below it. -->\n <div\n class=\"wr-bar-chart__column\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [style.--wr-bar-chart-start]=\"isCombo ? bar.start : null\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n @if (showValues() && !bar.missing) {\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"bar.below\"\n [style.--wr-bar-chart-at]=\"bar.at\"\n >{{ bar.display }}</span\n >\n }\n <div\n #barEl\n class=\"wr-bar-chart__bar\"\n [class.wr-bar-chart__bar--below]=\"bar.below\"\n [style.flex-grow]=\"bar.share\"\n [style.background]=\"bar.color\"\n ></div>\n </div>\n }\n }\n <!-- After the bars, so it is drawn over them where zero runs through the plot. -->\n <div class=\"wr-bar-chart__baseline\"></div>\n @for (line of lineLayers(); track line.index) {\n <!-- Over the bars and the baseline, and out of the pointer's way, so hovering a\n point still opens its category's tooltip. Each line is a group named by the\n line, holding a named image per point; its runs are decoration. The box runs\n from the middle of the first category to the middle of the last, which the\n stylesheet works out from `count`, and every position in it is a percentage,\n so nothing stretches: a dash and a marker keep their size at any width. -->\n <svg\n class=\"wr-bar-chart__line\"\n role=\"group\"\n focusable=\"false\"\n [attr.aria-label]=\"line.label\"\n [style.--wr-bar-chart-count]=\"line.count\"\n >\n @for (segment of line.segments; track $index) {\n <line\n class=\"wr-bar-chart__line-segment\"\n [attr.x1]=\"`${segment.from.x}%`\"\n [attr.y1]=\"`${segment.from.y}%`\"\n [attr.x2]=\"`${segment.to.x}%`\"\n [attr.y2]=\"`${segment.to.y}%`\"\n [attr.stroke]=\"line.color\"\n [attr.stroke-dasharray]=\"line.dash || null\"\n />\n }\n @for (point of line.points; track point.category) {\n <!-- A nested `<svg>` placed by percentage with its marker drawn about its origin\n in px, as the scatter chart places its points: one pixel of viewport, and\n `overflow` lets the marker reach outside it. -->\n <svg\n #pointEl\n class=\"wr-bar-chart__point\"\n role=\"img\"\n width=\"1\"\n height=\"1\"\n overflow=\"visible\"\n [attr.aria-label]=\"point.name\"\n [attr.x]=\"`${point.x}%`\"\n [attr.y]=\"`${point.y}%`\"\n [attr.data-marker]=\"line.marker\"\n >\n <path [attr.d]=\"line.d\" [attr.fill]=\"line.color\" />\n </svg>\n }\n </svg>\n }\n </div>\n </div>\n @if (!isHorizontal) {\n <!-- Named on each category's group above, so the visible label row is decoration. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (label of categoryLabels(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ label }}</span>\n }\n </div>\n }\n}\n\n@if (dataTable() && (isSeries || bars().length > 0)) {\n <!-- The figures for a screen reader who wants to move cell by cell. Clipped to nothing\n by its own stylesheet, so it takes no room and draws nothing. With `data`, one\n column for the bars, then one per line. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"
|
|
913
|
+
imports: [
|
|
914
|
+
NgTemplateOutlet,
|
|
915
|
+
WrChartLegend,
|
|
916
|
+
WrChartState,
|
|
917
|
+
WrChartTable
|
|
918
|
+
],
|
|
919
|
+
template: "@let isSeries = seriesMode();\n@let isHorizontal = horizontal();\n@let shown = state();\n@let scale = ticks();\n\n<!-- The legend, drawn before the body 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. Every\n series is keyed by a dot in its colour and each line by its dash and its marker. Rows\n are tracked by position, so two series that share a label are two rows. -->\n<ng-template #legend>\n <ul\n wr-chart-legend\n class=\"wr-bar-chart__legend\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [toggleable]=\"toggleableLegend()\"\n [hiddenSeries]=\"legendHidden()\"\n (hiddenSeriesChange)=\"onLegendHidden($event)\"\n ></ul>\n</ng-template>\n\n@if (legendShown() && legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n<div class=\"wr-bar-chart__body\">\n <!-- One layout for `data` and `series`, standing up and lying down: the plot is a grid of\n the value axis' scale, the track the bars run along, and a room past each end of it\n for the values printed there. A named `group`, not an `img`: `img` is a\n children-presentational role, so the bars' own `img` names inside it are dropped by a\n user agent that follows the spec - WebKit drops exactly such a subtree. Sideways,\n `height` is a floor rather than a height: each row keeps room for a line of text, so\n many rows grow the plot. -->\n <div\n class=\"wr-bar-chart__plot\"\n role=\"group\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"isHorizontal ? null : height()\"\n [style.min-height.px]=\"isHorizontal ? height() : null\"\n >\n @if (showAxis()) {\n <!-- The scale: decoration, since every bar's name carries its value. The hidden\n copies of the longest labels are what give the gutter its width. -->\n <div class=\"wr-bar-chart__axis\" aria-hidden=\"true\">\n @for (text of tickProbes(); track $index) {\n <span class=\"wr-bar-chart__tick wr-bar-chart__tick--probe\">{{ text }}</span>\n }\n @for (tick of scale; track $index) {\n <span class=\"wr-bar-chart__tick\" [style.--wr-bar-chart-at]=\"tick.at\">{{ tick.text }}</span>\n }\n </div>\n }\n @if (isHorizontal) {\n <!-- In the plot, so the rows share its gap with the track; decoration, as under the\n vertical bars: each row's group or image is named. -->\n <div class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @for (label of categoryLabels(); track $index) {\n <span class=\"wr-bar-chart__label\">{{ label }}</span>\n }\n </div>\n }\n @if (showValues()) {\n <!-- Hidden copies of the longest values printed past each end of the axis, stacked in\n one cell: each room is as large as the largest of them, in the value's own font,\n so a value past the longest bar has exactly the space it needs. Tracked by\n position: they are measuring copies, and live data changes every text at once. -->\n <div class=\"wr-bar-chart__room wr-bar-chart__room--max\" aria-hidden=\"true\">\n @for (text of rooms().max; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n <div class=\"wr-bar-chart__room wr-bar-chart__room--min\" aria-hidden=\"true\">\n @for (text of rooms().min; track $index) {\n <span class=\"wr-bar-chart__value\">{{ text }}</span>\n }\n </div>\n }\n <div #trackEl class=\"wr-bar-chart__track\" data-wr-hold [style.--wr-bar-chart-zero]=\"zero()\">\n @if (showGrid()) {\n <!-- Under the bars: a line at every tick of the value axis. -->\n <div class=\"wr-bar-chart__grid\" aria-hidden=\"true\">\n @for (tick of scale; track $index) {\n <span class=\"wr-bar-chart__grid-line\" [style.--wr-bar-chart-at]=\"tick.at\"></span>\n }\n </div>\n }\n <!-- Before the bars, so a bar standing on zero covers it and a 0 draws nothing. -->\n <div class=\"wr-bar-chart__baseline\"></div>\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the grid and the axis the chart keeps. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n } @else if (isSeries) {\n @for (category of seriesCategories(); track $index) {\n <!-- `data-wr-index` is what the chart's one hover listener reads. -->\n <div\n class=\"wr-bar-chart__category\"\n role=\"group\"\n [attr.aria-label]=\"category.label\"\n [attr.data-wr-index]=\"$index\"\n >\n @for (lane of category.lanes; track lane.key) {\n <div class=\"wr-bar-chart__lane\">\n <!-- A side per sign: the box from zero to that end of the axis, which clips\n the bars it holds. Each bar is as large as its side and moved along the\n value axis by a transform the stylesheet works out from the two shares\n written here, so a new value moves the bar without a layout pass. By\n position, not by label: two series may share one. -->\n @if (lane.up.length > 0) {\n <div class=\"wr-bar-chart__side\">\n @for (bar of lane.up; track bar.series) {\n <div\n class=\"wr-bar-chart__series-bar\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [attr.data-wr-series]=\"bar.series\"\n [attr.data-dash]=\"bar.dash\"\n [style.--wr-bar-chart-color]=\"bar.color\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.size\"\n [style.z-index]=\"bar.layer\"\n ></div>\n }\n </div>\n }\n @if (lane.down.length > 0) {\n <div class=\"wr-bar-chart__side wr-bar-chart__side--down\">\n @for (bar of lane.down; track bar.series) {\n <div\n class=\"wr-bar-chart__series-bar\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [attr.data-wr-series]=\"bar.series\"\n [attr.data-dash]=\"bar.dash\"\n [style.--wr-bar-chart-color]=\"bar.color\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.size\"\n [style.z-index]=\"bar.layer\"\n ></div>\n }\n </div>\n }\n @for (end of lane.ends; track $index) {\n <!-- Past one bar, hidden: the bar's own name carries its value. Past a pile,\n an image named \"Total: 20\": no bar's name carries the total, and a\n reader should not have to add the names up. -->\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"end.below\"\n [style.--wr-bar-chart-at]=\"end.at\"\n [attr.role]=\"end.name ? 'img' : null\"\n [attr.aria-label]=\"end.name\"\n [attr.aria-hidden]=\"end.name ? null : 'true'\"\n >{{ end.text }}</span\n >\n }\n </div>\n }\n </div>\n }\n } @else {\n @for (bar of bars(); track $index) {\n <!-- One datum: the column is its lane, and carries its name. Keyed `c<n>` for the\n hover, a key no legend row has, so a column dims the others and never a line. -->\n <div\n class=\"wr-bar-chart__column\"\n role=\"img\"\n [attr.aria-label]=\"bar.name\"\n [attr.data-wr-index]=\"$index\"\n [attr.data-wr-series]=\"`c${$index}`\"\n >\n <div class=\"wr-bar-chart__side\" [class.wr-bar-chart__side--down]=\"bar.below\">\n <div\n class=\"wr-bar-chart__bar\"\n [class.wr-bar-chart__bar--below]=\"bar.below\"\n [style.--wr-bar-chart-start]=\"bar.start\"\n [style.--wr-bar-chart-size]=\"bar.share\"\n [style.background]=\"bar.color\"\n ></div>\n </div>\n @if (showValues() && !bar.missing) {\n <span\n class=\"wr-bar-chart__value\"\n [class.wr-bar-chart__value--below]=\"bar.below\"\n [style.--wr-bar-chart-at]=\"bar.at\"\n >{{ bar.display }}</span\n >\n }\n </div>\n }\n }\n @if (!shown) {\n @for (line of lineLayers(); track line.index) {\n <!-- Over the bars and the baseline, and out of the pointer's way, so hovering a\n point still opens its category's tooltip. Each line is a group named by the\n line, holding a named image per point; its path is decoration. The box runs\n from the middle of the first category to the middle of the last, which the\n stylesheet works out from `count`. -->\n <svg\n class=\"wr-bar-chart__line\"\n role=\"group\"\n focusable=\"false\"\n [attr.aria-label]=\"line.label\"\n [attr.data-wr-series]=\"line.key\"\n [style.--wr-bar-chart-count]=\"line.count\"\n >\n @if (line.path) {\n <!-- The whole line as ONE path, in a box stretched over the line's own. The\n stroke does not scale with it, so the width and the dash stay in pixels. -->\n <svg\n class=\"wr-bar-chart__line-run\"\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\"\n aria-hidden=\"true\"\n >\n <path\n class=\"wr-bar-chart__line-segment\"\n fill=\"none\"\n vector-effect=\"non-scaling-stroke\"\n [attr.d]=\"line.path\"\n [attr.data-segments]=\"line.segments\"\n [attr.stroke]=\"line.color\"\n [attr.stroke-dasharray]=\"line.dash || null\"\n />\n </svg>\n }\n @for (point of line.points; track point.category) {\n <!-- A nested `<svg>` placed by percentage with its marker drawn about its origin\n in px, as the scatter chart places its points: one pixel of viewport, and\n `overflow` lets the marker reach outside it, so a marker keeps its shape\n and its size at any width. -->\n <svg\n class=\"wr-bar-chart__point\"\n role=\"img\"\n width=\"1\"\n height=\"1\"\n overflow=\"visible\"\n [attr.aria-label]=\"point.name\"\n [attr.x]=\"`${point.x}%`\"\n [attr.y]=\"`${point.y}%`\"\n [attr.data-marker]=\"line.marker\"\n >\n <path [attr.d]=\"line.d\" [attr.fill]=\"line.color\" />\n </svg>\n }\n </svg>\n }\n }\n </div>\n </div>\n @if (!isHorizontal) {\n <!-- Named on each bar or category above, so the visible label row is decoration. A\n name left out by the thinning keeps its slot, so the ones printed stay under their\n bars; the hidden copies of the longest names are what the thinning measures. -->\n <div #labelsEl class=\"wr-bar-chart__labels\" aria-hidden=\"true\">\n @let step = labelStep();\n @for (label of categoryLabels(); track $index) {\n <span\n class=\"wr-bar-chart__label\"\n [class.wr-bar-chart__label--wide]=\"step > 1\"\n [class.wr-bar-chart__label--skipped]=\"step > 1 && $index % step !== 0\"\n >{{ label }}</span\n >\n }\n @for (text of labelProbes(); track $index) {\n <span class=\"wr-bar-chart__label-probe\">{{ text }}</span>\n }\n </div>\n }\n</div>\n\n@if (legendShown() && !legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n@if (dataTable() && !shown) {\n <!-- The figures for a screen reader who wants to move cell by cell. Clipped to nothing\n by its own stylesheet, so it takes no room and draws nothing. With `data`, one\n column for the bars, then one per line. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"
|
|
722
920
|
}]
|
|
723
921
|
}],
|
|
724
922
|
ctorParameters: () => [],
|
|
@@ -787,6 +985,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
787
985
|
required: false
|
|
788
986
|
}]
|
|
789
987
|
}],
|
|
988
|
+
showGrid: [{
|
|
989
|
+
type: i0.Input,
|
|
990
|
+
args: [{
|
|
991
|
+
isSignal: true,
|
|
992
|
+
alias: "showGrid",
|
|
993
|
+
required: false
|
|
994
|
+
}]
|
|
995
|
+
}],
|
|
996
|
+
showAxis: [{
|
|
997
|
+
type: i0.Input,
|
|
998
|
+
args: [{
|
|
999
|
+
isSignal: true,
|
|
1000
|
+
alias: "showAxis",
|
|
1001
|
+
required: false
|
|
1002
|
+
}]
|
|
1003
|
+
}],
|
|
790
1004
|
showValues: [{
|
|
791
1005
|
type: i0.Input,
|
|
792
1006
|
args: [{
|
|
@@ -827,6 +1041,54 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
827
1041
|
required: false
|
|
828
1042
|
}]
|
|
829
1043
|
}],
|
|
1044
|
+
legendPosition: [{
|
|
1045
|
+
type: i0.Input,
|
|
1046
|
+
args: [{
|
|
1047
|
+
isSignal: true,
|
|
1048
|
+
alias: "legendPosition",
|
|
1049
|
+
required: false
|
|
1050
|
+
}]
|
|
1051
|
+
}],
|
|
1052
|
+
loading: [{
|
|
1053
|
+
type: i0.Input,
|
|
1054
|
+
args: [{
|
|
1055
|
+
isSignal: true,
|
|
1056
|
+
alias: "loading",
|
|
1057
|
+
required: false
|
|
1058
|
+
}]
|
|
1059
|
+
}],
|
|
1060
|
+
error: [{
|
|
1061
|
+
type: i0.Input,
|
|
1062
|
+
args: [{
|
|
1063
|
+
isSignal: true,
|
|
1064
|
+
alias: "error",
|
|
1065
|
+
required: false
|
|
1066
|
+
}]
|
|
1067
|
+
}],
|
|
1068
|
+
emptyLabel: [{
|
|
1069
|
+
type: i0.Input,
|
|
1070
|
+
args: [{
|
|
1071
|
+
isSignal: true,
|
|
1072
|
+
alias: "emptyLabel",
|
|
1073
|
+
required: false
|
|
1074
|
+
}]
|
|
1075
|
+
}],
|
|
1076
|
+
loadingLabel: [{
|
|
1077
|
+
type: i0.Input,
|
|
1078
|
+
args: [{
|
|
1079
|
+
isSignal: true,
|
|
1080
|
+
alias: "loadingLabel",
|
|
1081
|
+
required: false
|
|
1082
|
+
}]
|
|
1083
|
+
}],
|
|
1084
|
+
errorLabel: [{
|
|
1085
|
+
type: i0.Input,
|
|
1086
|
+
args: [{
|
|
1087
|
+
isSignal: true,
|
|
1088
|
+
alias: "errorLabel",
|
|
1089
|
+
required: false
|
|
1090
|
+
}]
|
|
1091
|
+
}],
|
|
830
1092
|
toggleableLegend: [{
|
|
831
1093
|
type: i0.Input,
|
|
832
1094
|
args: [{
|
|
@@ -873,17 +1135,13 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
873
1135
|
required: false
|
|
874
1136
|
}]
|
|
875
1137
|
}],
|
|
876
|
-
|
|
877
|
-
type: i0.
|
|
878
|
-
args: ["
|
|
879
|
-
}],
|
|
880
|
-
categoryEls: [{
|
|
881
|
-
type: i0.ViewChildren,
|
|
882
|
-
args: ["categoryEl", { isSignal: true }]
|
|
1138
|
+
trackEl: [{
|
|
1139
|
+
type: i0.ViewChild,
|
|
1140
|
+
args: ["trackEl", { isSignal: true }]
|
|
883
1141
|
}],
|
|
884
|
-
|
|
885
|
-
type: i0.
|
|
886
|
-
args: ["
|
|
1142
|
+
labelsEl: [{
|
|
1143
|
+
type: i0.ViewChild,
|
|
1144
|
+
args: ["labelsEl", { isSignal: true }]
|
|
887
1145
|
}]
|
|
888
1146
|
}
|
|
889
1147
|
});
|