ngwr 16.3.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/carousel/styles/_index.scss +53 -1
- 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-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs +27 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +86 -4
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +56 -25
- 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 +60 -17
- 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 +49 -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-file-upload.mjs +7 -3
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +27 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +643 -14
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +13 -4
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +13 -4
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +13 -4
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +13 -4
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +13 -4
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +13 -4
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +13 -4
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +13 -4
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +13 -4
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +13 -4
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +13 -4
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +13 -4
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +13 -4
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +13 -4
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +13 -4
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +13 -4
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +13 -4
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +13 -4
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +13 -4
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +13 -4
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +13 -4
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +13 -4
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +22 -5
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +21 -2
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +1 -0
- package/fesm2022/ngwr-pagination.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 +3 -0
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +100 -3
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +2 -2
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +71 -3
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +173 -11
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tour-testing.mjs +13 -1
- package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +25 -16
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +52 -8
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +64 -1
- package/fesm2022/ngwr-utils.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/graph/styles/_index.scss +87 -0
- package/i18n/ar.json +13 -4
- package/i18n/cs.json +13 -4
- package/i18n/de.json +13 -4
- package/i18n/en.json +13 -4
- package/i18n/es.json +13 -4
- package/i18n/fr.json +13 -4
- package/i18n/he.json +13 -4
- package/i18n/hi.json +13 -4
- package/i18n/id.json +13 -4
- package/i18n/it.json +13 -4
- package/i18n/ja.json +13 -4
- package/i18n/ko.json +13 -4
- package/i18n/nl.json +13 -4
- package/i18n/pl.json +13 -4
- package/i18n/pt.json +13 -4
- package/i18n/ru.json +13 -4
- package/i18n/sv.json +13 -4
- package/i18n/tr.json +13 -4
- package/i18n/uk.json +13 -4
- package/i18n/vi.json +13 -4
- package/i18n/zh-TW.json +13 -4
- package/i18n/zh.json +13 -4
- package/llms-full.txt +12 -12
- package/llms.txt +64 -27
- package/package.json +1 -1
- package/popconfirm/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +24 -13
- package/schematics/collection.json +5 -0
- package/schematics/eject/index.js +158 -0
- package/schematics/eject/schema.js +8 -0
- package/schematics/eject/schema.json +24 -0
- package/schematics/eject/source.js +295 -0
- package/schematics/use/symbol-map.json +2 -0
- package/select/styles/_index.scss +13 -0
- package/skills/ngwr/SKILL.md +30 -3
- package/skills/ngwr/references/catalog.md +2 -2
- package/table/styles/_index.scss +24 -0
- package/theme/styles/_focus.scss +11 -1
- package/tour/styles/_index.scss +6 -0
- package/types/ngwr-carousel-testing.d.ts +29 -6
- package/types/ngwr-carousel.d.ts +52 -5
- package/types/ngwr-cascader-testing.d.ts +4 -3
- package/types/ngwr-cascader.d.ts +29 -7
- 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 +19 -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 +31 -6
- package/types/ngwr-file-upload.d.ts +8 -2
- package/types/ngwr-graph-testing.d.ts +28 -0
- package/types/ngwr-graph.d.ts +263 -91
- 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-select.d.ts +37 -0
- package/types/ngwr-table-testing.d.ts +52 -1
- package/types/ngwr-table.d.ts +102 -10
- package/types/ngwr-tour-testing.d.ts +10 -0
- package/types/ngwr-tour.d.ts +32 -4
- package/types/ngwr-tree-testing.d.ts +1 -2
- package/types/ngwr-tree.d.ts +35 -2
- package/types/ngwr-utils.d.ts +79 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +14 -11
- package/window/styles/_index.scss +5 -10
|
@@ -1,10 +1,206 @@
|
|
|
1
|
-
// Public Sass entry for the charts' shared parts
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// Public Sass entry for the charts' shared parts: the chart theme every chart paints
|
|
2
|
+
// through, and the rules of the parts they all draw the same way. Nothing an app imports
|
|
3
|
+
// draws from here directly: a chart loads this sheet from its own `_index.scss`, the way
|
|
4
|
+
// every component loads the styles of what it renders.
|
|
5
|
+
|
|
6
|
+
// The token layer whose roles every chart token below defaults to. Every chart that
|
|
7
|
+
// loads this sheet loads the theme too, and Sass emits a module once, so this adds
|
|
8
|
+
// nothing to a chart's output; it is what lets the sheet resolve its own reads.
|
|
9
|
+
@use '../../../theme/styles';
|
|
10
|
+
|
|
11
|
+
// Black or white, whichever reads better on `$fill`: the pick the theme's `-contrast`
|
|
12
|
+
// tokens make, made per mark because a mark's colour is the palette's or the consumer's.
|
|
13
|
+
// The paint's `y` in XYZ (D65) is the relative luminance WCAG measures, and the two
|
|
14
|
+
// candidates score the same, about 4.58:1, against a luminance of 0.17913. Below it white
|
|
15
|
+
// wins, above it black; the difference is scaled to ±infinity and clamped, so nothing
|
|
16
|
+
// between the two is drawn. An engine without relative colour syntax drops the
|
|
17
|
+
// declaration, so a chart guards it with `@supports not (color: #{ink(red)})`.
|
|
18
|
+
@function ink($fill) {
|
|
19
|
+
$white: 'clamp(0, (0.17913 - y) * infinity, 1)';
|
|
20
|
+
@return color(from #{$fill} xyz-d65 calc(0.9505 * #{$white}) #{$white} calc(1.0891 * #{$white}));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// ── The chart theme ────────────────────────────────────────────────────────────────
|
|
24
|
+
//
|
|
25
|
+
// One set of `--wr-chart-*` tokens for every chart: set one on `:root` and every chart
|
|
26
|
+
// follows. Each chart's own `--wr-<chart>-*` hooks default to these, so a hook still
|
|
27
|
+
// restyles one chart and a token restyles them all.
|
|
4
28
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
29
|
+
// Measured against `--wr-color-surface` (`#ffffff` light, `#0b1120` dark), WCAG relative
|
|
30
|
+
// luminance:
|
|
31
|
+
//
|
|
32
|
+
// - the grid, `--wr-border-base`: 1.47:1 light, 1.41:1 dark, and 3.47 / 3.56 under
|
|
33
|
+
// `prefers-contrast: more`, where the role itself deepens. It was a 70% mix of the same
|
|
34
|
+
// role, which measured 1.14 and 1.10 and read as no grid at all.
|
|
35
|
+
// - the zero line and the axis, `--wr-border-strong`: 2.54:1 light, 2.49:1 dark.
|
|
36
|
+
// - the palette, in order, light: 4.89, 3.32, 5.18, 8.98, 3.27, 5.40, 3.30, 7.56; dark:
|
|
37
|
+
// 4.07, 11.64, 8.48, 10.20, 12.44, 5.14, 5.01, 7.67. Every one clears the 3:1 WCAG asks
|
|
38
|
+
// of a graphic, on the surface and on `--wr-color-fill-subtle` (3.13 at the least).
|
|
39
|
+
:root {
|
|
40
|
+
--wr-chart-grid: var(--wr-border-base);
|
|
41
|
+
--wr-chart-axis: var(--wr-border-strong);
|
|
42
|
+
--wr-chart-zero: var(--wr-border-strong);
|
|
43
|
+
--wr-chart-label: var(--wr-color-on-surface-muted);
|
|
44
|
+
--wr-chart-label-size: var(--wr-text-xs);
|
|
45
|
+
// A line's width, and a marker's diameter at rest.
|
|
46
|
+
--wr-chart-stroke: 2px;
|
|
47
|
+
--wr-chart-marker: 6px;
|
|
48
|
+
// On the value end of a bar only: the end on the baseline stays square.
|
|
49
|
+
--wr-chart-bar-radius: 2px;
|
|
50
|
+
// How much of one band (a category's share of the axis) is left empty beside its bars.
|
|
51
|
+
--wr-chart-gap: 20%;
|
|
52
|
+
// The line between two fills that touch: a stacked segment, a slice, a tile.
|
|
53
|
+
--wr-chart-separator: var(--wr-color-surface);
|
|
54
|
+
// The opacity of everything but the series under the pointer.
|
|
55
|
+
--wr-chart-dim: 0.35;
|
|
56
|
+
// The unfilled part of a gauge, a meter or a bullet, and a cell with no data.
|
|
57
|
+
--wr-chart-track: color-mix(in srgb, var(--wr-border-base) 60%, transparent);
|
|
58
|
+
// The band behind the category under the pointer.
|
|
59
|
+
--wr-chart-band: color-mix(in srgb, var(--wr-color-on-surface) 6%, transparent);
|
|
60
|
+
// A mark moving to a new value, and a hover change. Both are 0s under reduced motion.
|
|
61
|
+
--wr-chart-duration: var(--wr-duration-slow);
|
|
62
|
+
--wr-chart-duration-short: var(--wr-duration-base);
|
|
63
|
+
--wr-chart-ease: var(--wr-ease-out);
|
|
64
|
+
|
|
65
|
+
// The categorical palette, in the order series take it. Not the status intents: a
|
|
66
|
+
// second series is not a success and a fourth is not a danger. The first is the brand
|
|
67
|
+
// colour, so a chart of one series is on brand and a rebrand carries it; the last is the
|
|
68
|
+
// neutral role. Neighbours alternate between a deep and a mid tone (1.47:1 apart in
|
|
69
|
+
// luminance at the least in light, and every neighbouring pair at least 0.129 apart in
|
|
70
|
+
// OKLab under simulated deuteranopia and protanopia in light, 0.086 in dark), so two
|
|
71
|
+
// series next to each other differ in lightness as well as in hue.
|
|
72
|
+
--wr-chart-1: var(--wr-color-primary);
|
|
73
|
+
--wr-chart-2: light-dark(#1a9e8f, #5fe0c8);
|
|
74
|
+
--wr-chart-3: light-dark(#c2410c, #f5975a);
|
|
75
|
+
--wr-chart-4: light-dark(#5b21b6, #c4b5fd);
|
|
76
|
+
--wr-chart-5: light-dark(#b7860b, #f2d042);
|
|
77
|
+
--wr-chart-6: light-dark(#b5329a, #d946cf);
|
|
78
|
+
--wr-chart-7: light-dark(#f0577b, #e8457f);
|
|
79
|
+
--wr-chart-8: var(--wr-color-on-surface-muted);
|
|
80
|
+
|
|
81
|
+
// Sequential: the first palette colour stepped toward the surface, so the scale turns
|
|
82
|
+
// over with the scheme by itself - the strongest step is the darkest on a light page
|
|
83
|
+
// and the lightest on a dark one. Steps 3 to 5 hold 3:1 against the surface; 1 and 2
|
|
84
|
+
// are tints, and a cell painted with one needs an edge or its value in text.
|
|
85
|
+
--wr-chart-seq-1: color-mix(in srgb, var(--wr-chart-1) 20%, var(--wr-color-surface));
|
|
86
|
+
--wr-chart-seq-2: color-mix(in srgb, var(--wr-chart-1) 40%, var(--wr-color-surface));
|
|
87
|
+
--wr-chart-seq-3: color-mix(in srgb, var(--wr-chart-1) 60%, var(--wr-color-surface));
|
|
88
|
+
--wr-chart-seq-4: color-mix(in srgb, var(--wr-chart-1) 80%, var(--wr-color-surface));
|
|
89
|
+
--wr-chart-seq-5: var(--wr-chart-1);
|
|
90
|
+
|
|
91
|
+
// Diverging: the two ends, each mixed toward the surface by the chart that draws the
|
|
92
|
+
// scale. Not success against danger, which a red-green reader cannot split.
|
|
93
|
+
--wr-chart-div-neg: var(--wr-color-danger);
|
|
94
|
+
--wr-chart-div-pos: var(--wr-color-primary);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@media (prefers-reduced-motion: reduce) {
|
|
98
|
+
:root {
|
|
99
|
+
--wr-chart-duration: 0s;
|
|
100
|
+
--wr-chart-duration-short: 0s;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// ── Hover ──────────────────────────────────────────────────────────────────────────
|
|
105
|
+
//
|
|
106
|
+
// A chart marks everything that belongs to one series with `data-wr-series`, its legend
|
|
107
|
+
// rows included. While the pointer is on one, `useChartHover` puts `wr-chart--dim` on the
|
|
108
|
+
// chart and `wr-chart-mark--on` on that series' marks, and the rest fall back. Zero
|
|
109
|
+
// specificity, so a chart's own rule for a mark wins whatever order the sheets load in.
|
|
110
|
+
:where([data-wr-series]) {
|
|
111
|
+
transition: opacity var(--wr-chart-duration-short) var(--wr-chart-ease);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:where(.wr-chart--dim) :where([data-wr-series]:not(.wr-chart-mark--on)) {
|
|
115
|
+
opacity: var(--wr-chart-dim);
|
|
116
|
+
}
|
|
7
117
|
|
|
118
|
+
// ── The legend beside the chart ────────────────────────────────────────────────────
|
|
119
|
+
//
|
|
120
|
+
// Above and below, the legend is a block before or after the chart's body and needs no
|
|
121
|
+
// rule. At inline start or end the chart puts `wr-chart--legend-side` on its host: the
|
|
122
|
+
// legend keeps its own width and the body takes the rest. The class is written twice on
|
|
123
|
+
// purpose: every chart's own block sets its `display`, in a sheet that loads after this
|
|
124
|
+
// one, and a single class would lose to it.
|
|
125
|
+
.wr-chart--legend-side.wr-chart--legend-side {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: flex-start;
|
|
128
|
+
|
|
129
|
+
> :where(:not(.wr-chart-legend, .wr-chart-table)) {
|
|
130
|
+
flex: 1 1 0;
|
|
131
|
+
min-width: 0;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// ── Empty, loading, error ──────────────────────────────────────────────────────────
|
|
136
|
+
//
|
|
137
|
+
// The message a chart shows in place of its marks, centred over the frame it keeps: the
|
|
138
|
+
// grid and the axis stay, so the chart holds its size and still reads as a chart. The
|
|
139
|
+
// chart positions the box it sits in.
|
|
140
|
+
.wr-chart-state {
|
|
141
|
+
--wr-chart-state-color: var(--wr-chart-label);
|
|
142
|
+
--wr-chart-state-font-size: var(--wr-text-sm);
|
|
143
|
+
--wr-chart-state-gap: var(--wr-space-sm);
|
|
144
|
+
--wr-chart-state-error-color: var(--wr-color-danger-ink);
|
|
145
|
+
--wr-chart-state-spinner-size: 1em;
|
|
146
|
+
--wr-chart-state-spinner-color: var(--wr-chart-1);
|
|
147
|
+
// A plate under the spinner and the words, so the gridlines and a track do not run
|
|
148
|
+
// through them, and the muted and error colours keep the contrast they are measured
|
|
149
|
+
// to against the surface.
|
|
150
|
+
--wr-chart-state-bg: var(--wr-color-surface);
|
|
151
|
+
--wr-chart-state-padding: var(--wr-space-xs) var(--wr-space-sm);
|
|
152
|
+
--wr-chart-state-radius: var(--wr-border-radius-sm);
|
|
153
|
+
|
|
154
|
+
position: absolute;
|
|
155
|
+
inset: 0;
|
|
156
|
+
z-index: 1;
|
|
157
|
+
display: flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
padding: var(--wr-chart-state-gap);
|
|
161
|
+
font-size: var(--wr-chart-state-font-size);
|
|
162
|
+
color: var(--wr-chart-state-color);
|
|
163
|
+
text-align: center;
|
|
164
|
+
pointer-events: none;
|
|
165
|
+
|
|
166
|
+
&--error {
|
|
167
|
+
color: var(--wr-chart-state-error-color);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&__plate {
|
|
171
|
+
display: inline-flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
gap: var(--wr-chart-state-gap);
|
|
174
|
+
padding: var(--wr-chart-state-padding);
|
|
175
|
+
border-radius: var(--wr-chart-state-radius);
|
|
176
|
+
background: var(--wr-chart-state-bg);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// A ring with one arc of it painted, turning. Still under reduced motion, where the
|
|
180
|
+
// word beside it carries the state alone.
|
|
181
|
+
&__spinner {
|
|
182
|
+
flex: none;
|
|
183
|
+
width: var(--wr-chart-state-spinner-size);
|
|
184
|
+
height: var(--wr-chart-state-spinner-size);
|
|
185
|
+
border: 2px solid var(--wr-chart-track);
|
|
186
|
+
border-block-start-color: var(--wr-chart-state-spinner-color);
|
|
187
|
+
border-radius: 50%;
|
|
188
|
+
animation: wr-chart-state-spin 0.8s linear infinite;
|
|
189
|
+
|
|
190
|
+
@media (prefers-reduced-motion: reduce) {
|
|
191
|
+
animation: none;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@keyframes wr-chart-state-spin {
|
|
197
|
+
to {
|
|
198
|
+
transform: rotate(1turn);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// ── The data table ─────────────────────────────────────────────────────────────────
|
|
203
|
+
//
|
|
8
204
|
// A chart's data table, read in full by assistive technology and drawn nowhere.
|
|
9
205
|
//
|
|
10
206
|
// The clip pattern on the HOST rather than on the `<table>`: a table grows to fit its
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
// Styles for the entry points this component's own markup renders. The legend is a
|
|
5
5
|
// `ul[wr-chart-legend]`, so `@use 'ngwr/charts/donut-chart'` alone draws it styled.
|
|
6
6
|
@use '../../chart-legend/styles' as chart-legend-styles; // WrChartLegend
|
|
7
|
+
// The chart theme every hook below defaults to (`--wr-chart-*`), the hover-dim rule and
|
|
8
|
+
// the empty / loading / error message.
|
|
9
|
+
@use '../../core/styles' as core-styles; // WrChartState
|
|
7
10
|
@include theme.loaded('charts/donut-chart');
|
|
8
11
|
|
|
9
12
|
.wr-donut-chart {
|
|
@@ -11,19 +14,27 @@
|
|
|
11
14
|
--wr-donut-chart-font-family: var(--wr-font-family-base);
|
|
12
15
|
--wr-donut-chart-color: var(--wr-color-on-surface);
|
|
13
16
|
// The gap between two slices: each is stroked in the surface the chart sits on, so the
|
|
14
|
-
// gap is a shape that tells two slices apart without hue.
|
|
15
|
-
|
|
17
|
+
// gap is a shape that tells two slices apart without hue. Its width is in pixels at any
|
|
18
|
+
// `size`: the stroke does not scale with the drawing.
|
|
19
|
+
--wr-donut-chart-slice-gap-color: var(--wr-chart-separator);
|
|
20
|
+
--wr-donut-chart-slice-gap-width: 1px;
|
|
21
|
+
// The ring with no slice on it: under a state, or with every slice hidden.
|
|
22
|
+
--wr-donut-chart-track-color: var(--wr-chart-track);
|
|
16
23
|
|
|
17
24
|
display: inline-flex;
|
|
18
25
|
flex-direction: column;
|
|
19
26
|
align-items: center;
|
|
20
|
-
gap
|
|
27
|
+
// No `gap`: the room between the drawing and the legend is the legend's own margin, on
|
|
28
|
+
// whichever side `legendPosition` puts it. See `&__legend`.
|
|
21
29
|
font-family: var(--wr-donut-chart-font-family);
|
|
22
30
|
color: var(--wr-donut-chart-color);
|
|
23
31
|
|
|
32
|
+
// The box a state's message is centred in. Never narrower than its `size` beside a
|
|
33
|
+
// legend, and never grown by it.
|
|
24
34
|
&__surface {
|
|
25
35
|
position: relative;
|
|
26
36
|
display: inline-block;
|
|
37
|
+
flex: none;
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
svg {
|
|
@@ -32,17 +43,36 @@
|
|
|
32
43
|
height: auto;
|
|
33
44
|
}
|
|
34
45
|
|
|
46
|
+
// The opacity transition for the hover-dim is the shared rule's, on `data-wr-series`.
|
|
35
47
|
&__slice {
|
|
36
48
|
stroke: var(--wr-donut-chart-slice-gap-color);
|
|
49
|
+
stroke-width: var(--wr-donut-chart-slice-gap-width);
|
|
37
50
|
}
|
|
38
51
|
|
|
52
|
+
// `gapless`: each slice stroked in its own colour, which closes the hairline seam that
|
|
53
|
+
// anti-aliasing leaves between two fills meeting edge to edge.
|
|
54
|
+
&--gapless &__slice {
|
|
55
|
+
stroke: var(--wr-donut-chart-slice-color);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// The outer half of that stroke lies past the drawing's box, which would flatten the
|
|
59
|
+
// ring where it touches the box's edges.
|
|
60
|
+
&--gapless svg {
|
|
61
|
+
overflow: visible;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&__track {
|
|
65
|
+
fill: var(--wr-donut-chart-track-color);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// The value sits on the middle row, so it is centred on the ring both ways, and the
|
|
69
|
+
// label on the row under it. A label alone takes the middle row itself.
|
|
39
70
|
&__center {
|
|
40
71
|
position: absolute;
|
|
41
72
|
inset: 0;
|
|
42
|
-
display:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
justify-content: center;
|
|
73
|
+
display: grid;
|
|
74
|
+
grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
75
|
+
justify-items: center;
|
|
46
76
|
text-align: center;
|
|
47
77
|
// The box covers the whole drawing, so it took every pointer event meant for
|
|
48
78
|
// the arcs under it and no slice could be hovered. Only the text itself is
|
|
@@ -52,11 +82,18 @@
|
|
|
52
82
|
|
|
53
83
|
&__center-value,
|
|
54
84
|
&__center-label {
|
|
85
|
+
grid-row: 2;
|
|
55
86
|
pointer-events: auto;
|
|
56
87
|
}
|
|
57
88
|
|
|
89
|
+
&__center-value ~ &__center-label {
|
|
90
|
+
grid-row: 3;
|
|
91
|
+
align-self: start;
|
|
92
|
+
}
|
|
93
|
+
|
|
58
94
|
&__center-value {
|
|
59
|
-
|
|
95
|
+
// The headline figure of a radial chart, the size the gauge prints its reading at.
|
|
96
|
+
--wr-donut-chart-center-value-font-size: var(--wr-text-xl);
|
|
60
97
|
--wr-donut-chart-center-value-font-weight: var(--wr-font-weight-semibold);
|
|
61
98
|
--wr-donut-chart-center-value-line-height: var(--wr-leading-tight);
|
|
62
99
|
|
|
@@ -71,25 +108,24 @@
|
|
|
71
108
|
|
|
72
109
|
&__center-label {
|
|
73
110
|
--wr-donut-chart-center-label-margin-top: var(--wr-space-xs);
|
|
74
|
-
--wr-donut-chart-center-label-font-size: var(--wr-
|
|
75
|
-
--wr-donut-chart-center-label-color: var(--wr-
|
|
111
|
+
--wr-donut-chart-center-label-font-size: var(--wr-chart-label-size);
|
|
112
|
+
--wr-donut-chart-center-label-color: var(--wr-chart-label);
|
|
76
113
|
|
|
77
114
|
margin-top: var(--wr-donut-chart-center-label-margin-top);
|
|
78
115
|
font-size: var(--wr-donut-chart-center-label-font-size);
|
|
79
116
|
color: var(--wr-donut-chart-center-label-color);
|
|
80
117
|
}
|
|
81
118
|
|
|
119
|
+
// The room between the legend and the drawing, on whichever side `legendPosition` puts
|
|
120
|
+
// it: the shared legend rule reads `--wr-chart-legend-space`, and `--wr-donut-chart-gap`
|
|
121
|
+
// is the chart's own name for it, from when the legend was always below. The row or the
|
|
122
|
+
// column, the margin and the centring are the shared legend's.
|
|
82
123
|
&__legend {
|
|
83
124
|
--wr-donut-chart-legend-gap-y: var(--wr-space-sm);
|
|
84
125
|
--wr-donut-chart-legend-gap-x: var(--wr-space-lg);
|
|
126
|
+
--wr-chart-legend-space: var(--wr-donut-chart-gap);
|
|
85
127
|
|
|
86
|
-
list-style: none;
|
|
87
|
-
margin: 0;
|
|
88
|
-
padding: 0;
|
|
89
|
-
display: flex;
|
|
90
|
-
flex-wrap: wrap;
|
|
91
128
|
gap: var(--wr-donut-chart-legend-gap-y) var(--wr-donut-chart-legend-gap-x);
|
|
92
|
-
justify-content: center;
|
|
93
129
|
}
|
|
94
130
|
|
|
95
131
|
&__legend-item {
|
|
@@ -108,23 +144,22 @@
|
|
|
108
144
|
color: inherit;
|
|
109
145
|
}
|
|
110
146
|
|
|
147
|
+
// The shared legend's dot, 8px, as the tooltip keys a row.
|
|
111
148
|
&__swatch {
|
|
112
|
-
width: 0.625rem;
|
|
113
|
-
height: 0.625rem;
|
|
114
|
-
border-radius: 50%;
|
|
115
149
|
// The key to the slices, whose SVG fills forced colors keeps — so an inline
|
|
116
150
|
// `background` reset to `Canvas` left the legend pointing at nothing.
|
|
117
151
|
forced-color-adjust: none;
|
|
118
152
|
}
|
|
119
153
|
|
|
120
154
|
&__legend-label {
|
|
121
|
-
|
|
155
|
+
// The row's own weight, as in every chart's legend.
|
|
156
|
+
--wr-donut-chart-legend-label-font-weight: inherit;
|
|
122
157
|
|
|
123
158
|
font-weight: var(--wr-donut-chart-legend-label-font-weight);
|
|
124
159
|
}
|
|
125
160
|
|
|
126
161
|
&__legend-value {
|
|
127
|
-
--wr-donut-chart-legend-value-color: var(--wr-
|
|
162
|
+
--wr-donut-chart-legend-value-color: var(--wr-chart-legend-value-color);
|
|
128
163
|
|
|
129
164
|
color: var(--wr-donut-chart-legend-value-color);
|
|
130
165
|
font-variant-numeric: tabular-nums;
|
|
@@ -134,6 +169,21 @@
|
|
|
134
169
|
}
|
|
135
170
|
}
|
|
136
171
|
|
|
172
|
+
// Beside the legend the chart is a row: the drawing keeps its `size` and the legend is
|
|
173
|
+
// centred against it. The shared side rule makes the host a block-level flex box whose
|
|
174
|
+
// body takes the rest of the row, which suits a plot that fills its container; this
|
|
175
|
+
// drawing has a size of its own, so the chart stays as wide as its parts. The class is
|
|
176
|
+
// doubled as the shared rule doubles it, and the chart's own name outweighs it.
|
|
177
|
+
.wr-donut-chart.wr-chart--legend-side.wr-chart--legend-side {
|
|
178
|
+
display: inline-flex;
|
|
179
|
+
flex-direction: row;
|
|
180
|
+
align-items: center;
|
|
181
|
+
|
|
182
|
+
> .wr-donut-chart__surface {
|
|
183
|
+
flex: none;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
137
187
|
// The SVG keeps its fills under forced colors, so the slices keep their colours and the
|
|
138
188
|
// legend still keys them; the gap between them is drawn in the surface, which means
|
|
139
189
|
// nothing on a forced palette, so it takes the page's own colour and still parts them.
|
|
@@ -141,4 +191,9 @@
|
|
|
141
191
|
.wr-donut-chart__slice {
|
|
142
192
|
stroke: Canvas;
|
|
143
193
|
}
|
|
194
|
+
|
|
195
|
+
// The track is a tint of a border role, which a forced palette has no place for.
|
|
196
|
+
.wr-donut-chart__track {
|
|
197
|
+
fill: GrayText;
|
|
198
|
+
}
|
|
144
199
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Styles for the entry points this component's own markup renders. With `dataTable`, the
|
|
5
5
|
// figures render as a `<wr-chart-table>` beside the stages, which its own sheet clips out
|
|
6
6
|
// of sight.
|
|
7
|
-
@use '../../core/styles' as core-styles; // WrChartTable
|
|
7
|
+
@use '../../core/styles' as core-styles; // WrChartTable, WrChartState
|
|
8
8
|
@include theme.loaded('charts/funnel-chart');
|
|
9
9
|
|
|
10
10
|
.wr-funnel-chart {
|
|
@@ -16,36 +16,47 @@
|
|
|
16
16
|
--wr-funnel-chart-column-gap: var(--wr-space-md);
|
|
17
17
|
--wr-funnel-chart-label-max-width: 12rem;
|
|
18
18
|
--wr-funnel-chart-track-min-width: 40%;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
--wr-funnel-chart-label-
|
|
22
|
-
--wr-funnel-chart-
|
|
23
|
-
--wr-funnel-chart-
|
|
19
|
+
// The stage names are the chart's category labels, in the size and the muted ink every
|
|
20
|
+
// chart on the theme writes its axis in; they were a step larger and in full ink.
|
|
21
|
+
--wr-funnel-chart-label-font-size: var(--wr-chart-label-size);
|
|
22
|
+
--wr-funnel-chart-label-line-height: var(--wr-text-xs-leading);
|
|
23
|
+
--wr-funnel-chart-label-color: var(--wr-chart-label);
|
|
24
|
+
// The values keep the full ink: they are the reading, not the frame.
|
|
25
|
+
--wr-funnel-chart-value-font-size: var(--wr-chart-label-size);
|
|
26
|
+
--wr-funnel-chart-value-line-height: var(--wr-text-xs-leading);
|
|
24
27
|
--wr-funnel-chart-value-font-weight: var(--wr-font-weight-medium);
|
|
25
28
|
--wr-funnel-chart-value-color: var(--wr-color-on-surface);
|
|
26
29
|
// The conversions: under each value, and between the bars.
|
|
27
|
-
--wr-funnel-chart-conversion-font-size: var(--wr-
|
|
30
|
+
--wr-funnel-chart-conversion-font-size: var(--wr-chart-label-size);
|
|
28
31
|
--wr-funnel-chart-conversion-line-height: var(--wr-text-xs-leading);
|
|
29
|
-
--wr-funnel-chart-conversion-color: var(--wr-
|
|
32
|
+
--wr-funnel-chart-conversion-color: var(--wr-chart-label);
|
|
30
33
|
// A bar is as tall as a value with its conversion under it, so every bar is the same
|
|
31
34
|
// height whether its stage prints one line beside it or two; and as tall as its row if
|
|
32
35
|
// that is taller, so the band above and below always meets its edge.
|
|
33
36
|
--wr-funnel-chart-bar-height: calc(
|
|
34
37
|
var(--wr-funnel-chart-value-line-height) + var(--wr-funnel-chart-conversion-line-height)
|
|
35
38
|
);
|
|
36
|
-
--wr-funnel-chart-bar-radius: var(--wr-
|
|
39
|
+
--wr-funnel-chart-bar-radius: var(--wr-chart-bar-radius);
|
|
40
|
+
// A bar moving to a new value, and a stage dimming under the pointer.
|
|
41
|
+
--wr-funnel-chart-duration: var(--wr-chart-duration);
|
|
42
|
+
--wr-funnel-chart-ease: var(--wr-chart-ease);
|
|
37
43
|
// The gap between two bars, which the band fills and the share of the stage above sits on.
|
|
38
44
|
--wr-funnel-chart-gap-height: 1.5rem;
|
|
39
|
-
// The band
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
//
|
|
43
|
-
--wr-funnel-chart-
|
|
44
|
-
--wr-funnel-chart-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
--wr-funnel-chart-
|
|
45
|
+
// The band carries no value of its own, only the narrowing the two bars' widths already
|
|
46
|
+
// state, so it is the theme's track: one quiet solid in both schemes. It was a 20% wash
|
|
47
|
+
// of the two stages' colours. Those still arrive on the band as
|
|
48
|
+
// `--wr-funnel-chart-band-from` and `-to`, for an app that wants a gradient here.
|
|
49
|
+
--wr-funnel-chart-band-bg: var(--wr-chart-track);
|
|
50
|
+
--wr-funnel-chart-band-opacity: 1;
|
|
51
|
+
// The share between the bars, on a chip of the surface: the band runs under it.
|
|
52
|
+
--wr-funnel-chart-gap-label-bg: var(--wr-chart-separator);
|
|
53
|
+
--wr-funnel-chart-gap-label-padding-x: var(--wr-space-sm);
|
|
54
|
+
--wr-funnel-chart-gap-label-radius: var(--wr-border-radius-pill);
|
|
55
|
+
// The row the open tooltip is about, banded from edge to edge with the label and the
|
|
56
|
+
// figures inset from the band.
|
|
57
|
+
--wr-funnel-chart-active-bg: var(--wr-chart-band);
|
|
58
|
+
// The least the chart is tall while it has no stage to draw: empty, loading, an error.
|
|
59
|
+
--wr-funnel-chart-idle-height: 8rem;
|
|
49
60
|
--wr-funnel-chart-stage-radius: var(--wr-border-radius-sm);
|
|
50
61
|
--wr-funnel-chart-stage-padding-x: var(--wr-space-xs);
|
|
51
62
|
|
|
@@ -75,6 +86,12 @@
|
|
|
75
86
|
minmax(var(--wr-funnel-chart-track-min-width), 1fr)
|
|
76
87
|
max-content;
|
|
77
88
|
column-gap: var(--wr-funnel-chart-column-gap);
|
|
89
|
+
// What the state message is laid over.
|
|
90
|
+
position: relative;
|
|
91
|
+
|
|
92
|
+
&--idle {
|
|
93
|
+
min-height: var(--wr-funnel-chart-idle-height);
|
|
94
|
+
}
|
|
78
95
|
}
|
|
79
96
|
|
|
80
97
|
&__stage,
|
|
@@ -121,18 +138,31 @@
|
|
|
121
138
|
min-width: 0;
|
|
122
139
|
}
|
|
123
140
|
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
//
|
|
141
|
+
// As wide as the track, and scaled to its share of it (`--wr-funnel-chart-bar-scale`, 0
|
|
142
|
+
// to 1, which the component writes): the largest stage, or `max`, is the full track. A
|
|
143
|
+
// new value moves a transform, which lays nothing out; it used to move `width`, and
|
|
144
|
+
// every frame of that laid the row out again. The corners are divided by the scale along
|
|
145
|
+
// the bar, so they are the same round at any length. A stage of zero or below is a
|
|
146
|
+
// hairline (`--hairline`), so it still shows where it is and has an anchor for the
|
|
147
|
+
// tooltip, and the floor on the scale keeps a sliver of a value from vanishing; a
|
|
148
|
+
// missing stage renders no bar at all.
|
|
128
149
|
&__bar {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
150
|
+
flex: none;
|
|
151
|
+
width: 100%;
|
|
152
|
+
transform: scaleX(max(var(--wr-funnel-chart-bar-scale, 1), 0.004));
|
|
153
|
+
border-radius: calc(var(--wr-funnel-chart-bar-radius) / max(var(--wr-funnel-chart-bar-scale, 1), 0.004)) /
|
|
154
|
+
var(--wr-funnel-chart-bar-radius);
|
|
155
|
+
transition: transform var(--wr-funnel-chart-duration) var(--wr-funnel-chart-ease);
|
|
132
156
|
// The bar is an inline `background`, which forced colors resets to `Canvas`: every bar
|
|
133
157
|
// would vanish into the page and leave its figures floating. The SVG charts keep their
|
|
134
158
|
// fills there, so the HTML marks do too.
|
|
135
159
|
forced-color-adjust: none;
|
|
160
|
+
|
|
161
|
+
&--hairline {
|
|
162
|
+
width: 1px;
|
|
163
|
+
transform: none;
|
|
164
|
+
border-radius: 0;
|
|
165
|
+
}
|
|
136
166
|
}
|
|
137
167
|
|
|
138
168
|
// Each figure shrunk to its text against the bar's side of the column, so its own
|
|
@@ -185,13 +215,11 @@
|
|
|
185
215
|
// below, so a stage with a colour of its own carries it into its band.
|
|
186
216
|
&__band {
|
|
187
217
|
align-self: stretch;
|
|
188
|
-
background:
|
|
189
|
-
var(--wr-funnel-chart-band-from, currentColor),
|
|
190
|
-
var(--wr-funnel-chart-band-to, currentColor)
|
|
191
|
-
);
|
|
218
|
+
background: var(--wr-funnel-chart-band-bg);
|
|
192
219
|
opacity: var(--wr-funnel-chart-band-opacity);
|
|
193
|
-
transition: clip-path
|
|
194
|
-
//
|
|
220
|
+
// No transition: the shape is a `clip-path`, and the chart moves transforms and
|
|
221
|
+
// opacity only. The band takes its new shape at once while the bars catch up.
|
|
222
|
+
// Kept under forced colors, which would reset it with the bars'.
|
|
195
223
|
forced-color-adjust: none;
|
|
196
224
|
}
|
|
197
225
|
|
|
@@ -220,12 +248,12 @@
|
|
|
220
248
|
}
|
|
221
249
|
}
|
|
222
250
|
|
|
223
|
-
// A bar
|
|
224
|
-
//
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
.wr-funnel-
|
|
228
|
-
|
|
251
|
+
// A bar entering the page grows from the funnel's axis, where the browser can start a
|
|
252
|
+
// transition from a style of its own (`@starting-style`); elsewhere it is drawn at its
|
|
253
|
+
// value. Under reduced motion the theme's duration is 0s, and it is drawn at once.
|
|
254
|
+
@starting-style {
|
|
255
|
+
.wr-funnel-chart__bar:not(.wr-funnel-chart__bar--hairline) {
|
|
256
|
+
transform: scaleX(0);
|
|
229
257
|
}
|
|
230
258
|
}
|
|
231
259
|
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
@use '../../../theme/styles' as theme;
|
|
2
2
|
@use '../../../popover/styles'; // the `.wr-tooltip` chip the hover tooltip renders into
|
|
3
|
+
// The chart theme the arcs default to (`--wr-chart-1`, `--wr-chart-track`) and the
|
|
4
|
+
// loading / error message.
|
|
5
|
+
@use '../../core/styles' as core-styles; // WrChartState
|
|
3
6
|
@include theme.loaded('charts/gauge');
|
|
4
7
|
|
|
5
8
|
.wr-gauge {
|
|
6
9
|
--wr-gauge-font-family: var(--wr-font-family-base);
|
|
7
10
|
--wr-gauge-color: var(--wr-color-on-surface);
|
|
8
11
|
--wr-gauge-text-padding-bottom: var(--wr-space-sm);
|
|
12
|
+
// The headline figure of a radial chart, the size the donut prints its centre value at.
|
|
9
13
|
--wr-gauge-text-font-size: var(--wr-text-xl);
|
|
10
14
|
--wr-gauge-text-font-weight: var(--wr-font-weight-semibold);
|
|
11
15
|
--wr-gauge-suffix-margin-inline-start: var(--wr-space-xs);
|
|
12
16
|
--wr-gauge-suffix-font-size: var(--wr-text-sm);
|
|
13
17
|
--wr-gauge-suffix-font-weight: var(--wr-font-weight-medium);
|
|
14
|
-
--wr-gauge-suffix-color: var(--wr-
|
|
18
|
+
--wr-gauge-suffix-color: var(--wr-chart-label);
|
|
15
19
|
|
|
16
20
|
display: inline-block;
|
|
17
21
|
font-family: var(--wr-gauge-font-family);
|
|
@@ -40,6 +44,13 @@
|
|
|
40
44
|
font-variant-numeric: tabular-nums;
|
|
41
45
|
}
|
|
42
46
|
|
|
47
|
+
// A state's message sits where the reading does, in the mouth of the dial, rather than
|
|
48
|
+
// across the arc: the shared rule centres it in the box.
|
|
49
|
+
.wr-chart-state {
|
|
50
|
+
align-items: flex-end;
|
|
51
|
+
padding-block-end: var(--wr-gauge-text-padding-bottom);
|
|
52
|
+
}
|
|
53
|
+
|
|
43
54
|
&__suffix {
|
|
44
55
|
margin-inline-start: var(--wr-gauge-suffix-margin-inline-start);
|
|
45
56
|
font-size: var(--wr-gauge-suffix-font-size);
|