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
|
@@ -4,45 +4,41 @@
|
|
|
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 matrix, 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
|
+
@use '../../chart-legend/styles' as chart-legend-styles; // WrChartScale
|
|
8
9
|
@include theme.loaded('charts/heatmap-chart');
|
|
9
10
|
|
|
10
|
-
// A level's paint
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
// is a faint tint rather than the surface itself — the surface is what an EMPTY cell shows
|
|
15
|
-
// — and the highest is the colour.
|
|
16
|
-
//
|
|
17
|
-
// Mixed in OKLab rather than sRGB, because OKLab's lightness is the one that moves evenly:
|
|
18
|
-
// the levels are told apart by lightness alone, so evenly spaced shares have to look evenly
|
|
19
|
-
// spaced, in the light scheme and the dark one.
|
|
20
|
-
$fill: color-mix(
|
|
21
|
-
in oklab,
|
|
22
|
-
var(--wr-heatmap-chart-scale-color, var(--wr-color-primary))
|
|
23
|
-
calc(
|
|
24
|
-
var(--wr-heatmap-chart-min-share) + (100% - var(--wr-heatmap-chart-min-share)) * var(--wr-heatmap-chart-level, 1)
|
|
25
|
-
),
|
|
26
|
-
var(--wr-heatmap-chart-surface)
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
// The share of white a printed value takes, 1 or 0, from its cell's luminance `y` (see
|
|
30
|
-
// `__value`). A string, so Sass passes the relative-colour channel name through untouched.
|
|
31
|
-
$white: 'clamp(0, (0.17913 - y) * infinity, 1)';
|
|
11
|
+
// A level's paint, which the component writes on every cell as `--wr-heatmap-chart-fill`:
|
|
12
|
+
// a step of the sequential scale below (`--wr-heatmap-chart-step-1` to `-5`), or between
|
|
13
|
+
// two steps a mix of them. A cell with none written takes the highest step.
|
|
14
|
+
$fill: var(--wr-heatmap-chart-fill, var(--wr-heatmap-chart-step-5));
|
|
32
15
|
|
|
33
16
|
.wr-heatmap-chart {
|
|
34
17
|
--wr-heatmap-chart-font-family: var(--wr-font-family-base);
|
|
35
18
|
--wr-heatmap-chart-color: var(--wr-color-on-surface);
|
|
36
|
-
// What
|
|
19
|
+
// What shows behind the cells, and what a colour of the chart's own is stepped toward.
|
|
37
20
|
--wr-heatmap-chart-surface: var(--wr-color-surface);
|
|
38
|
-
|
|
21
|
+
// The five steps a level is painted from: the chart theme's sequential scale, the first
|
|
22
|
+
// palette colour stepped toward the surface, so the scale turns over with the scheme and
|
|
23
|
+
// an app that retints the theme retints the heatmap. It was a mix of this chart's own,
|
|
24
|
+
// in OKLab from 15%, whose lowest level all but vanished on a dark surface.
|
|
25
|
+
--wr-heatmap-chart-step-1: var(--wr-chart-seq-1);
|
|
26
|
+
--wr-heatmap-chart-step-2: var(--wr-chart-seq-2);
|
|
27
|
+
--wr-heatmap-chart-step-3: var(--wr-chart-seq-3);
|
|
28
|
+
--wr-heatmap-chart-step-4: var(--wr-chart-seq-4);
|
|
29
|
+
--wr-heatmap-chart-step-5: var(--wr-chart-seq-5);
|
|
39
30
|
// The cells. A row is a fixed height and the columns share the width, so the matrix
|
|
40
31
|
// fills its container and never scrolls: a scroller would need a tab stop.
|
|
41
32
|
--wr-heatmap-chart-cell-height: 2rem;
|
|
42
|
-
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
// Half the smallest space token, 2px: what parts two cells here and two days of a
|
|
34
|
+
// calendar heatmap.
|
|
35
|
+
--wr-heatmap-chart-gap: calc(var(--wr-space-xs) / 2);
|
|
36
|
+
// The chart theme's radius, small enough for a cell only a few pixels wide.
|
|
37
|
+
--wr-heatmap-chart-cell-radius: var(--wr-chart-bar-radius);
|
|
38
|
+
// A faint line inside every cell's edge, in the text colour: the lowest levels are
|
|
39
|
+
// tints of the surface (1.3:1 against it in light, 1.2:1 in dark), and the edge is what
|
|
40
|
+
// keeps one readable as a cell. On the higher levels it disappears into the paint.
|
|
41
|
+
--wr-heatmap-chart-cell-edge: color-mix(in srgb, var(--wr-color-on-surface) 14%, transparent);
|
|
46
42
|
--wr-heatmap-chart-cell-padding-x: var(--wr-space-xs);
|
|
47
43
|
// The values `showValues` prints. Their colour is picked per cell (see `__value`).
|
|
48
44
|
--wr-heatmap-chart-value-font-size: var(--wr-text-xs);
|
|
@@ -56,18 +52,20 @@ $white: 'clamp(0, (0.17913 - y) * infinity, 1)';
|
|
|
56
52
|
--wr-heatmap-chart-active-ring: var(--wr-color-on-surface);
|
|
57
53
|
--wr-heatmap-chart-active-ring-width: 2px;
|
|
58
54
|
// The row and column names, muted as an axis' labels are on every chart.
|
|
59
|
-
--wr-heatmap-chart-label-font-size: var(--wr-
|
|
55
|
+
--wr-heatmap-chart-label-font-size: var(--wr-chart-label-size);
|
|
60
56
|
--wr-heatmap-chart-label-line-height: var(--wr-text-xs-leading);
|
|
61
|
-
--wr-heatmap-chart-label-color: var(--wr-
|
|
57
|
+
--wr-heatmap-chart-label-color: var(--wr-chart-label);
|
|
62
58
|
--wr-heatmap-chart-label-gap: var(--wr-space-sm);
|
|
63
59
|
--wr-heatmap-chart-row-label-max-width: 10rem;
|
|
64
|
-
// The
|
|
60
|
+
// The scale key beside the matrix: the shared key, through this chart's own hooks.
|
|
65
61
|
--wr-heatmap-chart-legend-margin-top: var(--wr-space-md);
|
|
66
62
|
--wr-heatmap-chart-legend-gap: var(--wr-space-sm);
|
|
67
|
-
--wr-heatmap-chart-legend-font-size: var(--wr-
|
|
68
|
-
--wr-heatmap-chart-legend-color: var(--wr-
|
|
69
|
-
--wr-heatmap-chart-swatch-width:
|
|
63
|
+
--wr-heatmap-chart-legend-font-size: var(--wr-chart-label-size);
|
|
64
|
+
--wr-heatmap-chart-legend-color: var(--wr-chart-label);
|
|
65
|
+
--wr-heatmap-chart-swatch-width: 0.75rem;
|
|
70
66
|
--wr-heatmap-chart-swatch-height: 0.75rem;
|
|
67
|
+
// The least the matrix is tall while it has no cell to draw: empty, loading, an error.
|
|
68
|
+
--wr-heatmap-chart-idle-height: 8rem;
|
|
71
69
|
|
|
72
70
|
display: block;
|
|
73
71
|
// The containing block of the out-of-flow `dataTable` copy, as on the line chart: a
|
|
@@ -78,6 +76,32 @@ $white: 'clamp(0, (0.17913 - y) * infinity, 1)';
|
|
|
78
76
|
font-family: var(--wr-heatmap-chart-font-family);
|
|
79
77
|
color: var(--wr-heatmap-chart-color);
|
|
80
78
|
|
|
79
|
+
// A colour of the chart's own (`color`): the same five steps, from that colour toward
|
|
80
|
+
// the surface, in the shares the chart theme steps its own scale by.
|
|
81
|
+
&--tinted {
|
|
82
|
+
--wr-heatmap-chart-step-1: color-mix(
|
|
83
|
+
in srgb,
|
|
84
|
+
var(--wr-heatmap-chart-scale-color) 20%,
|
|
85
|
+
var(--wr-heatmap-chart-surface)
|
|
86
|
+
);
|
|
87
|
+
--wr-heatmap-chart-step-2: color-mix(
|
|
88
|
+
in srgb,
|
|
89
|
+
var(--wr-heatmap-chart-scale-color) 40%,
|
|
90
|
+
var(--wr-heatmap-chart-surface)
|
|
91
|
+
);
|
|
92
|
+
--wr-heatmap-chart-step-3: color-mix(
|
|
93
|
+
in srgb,
|
|
94
|
+
var(--wr-heatmap-chart-scale-color) 60%,
|
|
95
|
+
var(--wr-heatmap-chart-surface)
|
|
96
|
+
);
|
|
97
|
+
--wr-heatmap-chart-step-4: color-mix(
|
|
98
|
+
in srgb,
|
|
99
|
+
var(--wr-heatmap-chart-scale-color) 80%,
|
|
100
|
+
var(--wr-heatmap-chart-surface)
|
|
101
|
+
);
|
|
102
|
+
--wr-heatmap-chart-step-5: var(--wr-heatmap-chart-scale-color);
|
|
103
|
+
}
|
|
104
|
+
|
|
81
105
|
// The names and the cells share one grid's tracks: an `auto` column for the row names,
|
|
82
106
|
// one equal column per column of the data, an `auto` row for the column names and one
|
|
83
107
|
// fixed row per row of the data. A grid follows `direction`, so under RTL the row names
|
|
@@ -87,6 +111,20 @@ $white: 'clamp(0, (0.17913 - y) * infinity, 1)';
|
|
|
87
111
|
grid-template-columns: auto repeat(var(--wr-heatmap-chart-columns, 1), minmax(0, 1fr));
|
|
88
112
|
grid-template-rows: auto repeat(var(--wr-heatmap-chart-rows, 1), var(--wr-heatmap-chart-cell-height));
|
|
89
113
|
gap: var(--wr-heatmap-chart-gap);
|
|
114
|
+
// What the state message is laid over.
|
|
115
|
+
position: relative;
|
|
116
|
+
min-width: 0;
|
|
117
|
+
|
|
118
|
+
&--idle {
|
|
119
|
+
min-height: var(--wr-heatmap-chart-idle-height);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// The message of an empty, loading or failed chart, over the cells' own area.
|
|
124
|
+
&__status {
|
|
125
|
+
grid-row: 2 / -1;
|
|
126
|
+
grid-column: 2 / -1;
|
|
127
|
+
position: relative;
|
|
90
128
|
}
|
|
91
129
|
|
|
92
130
|
&__column-labels,
|
|
@@ -190,6 +228,7 @@ $white: 'clamp(0, (0.17913 - y) * infinity, 1)';
|
|
|
190
228
|
overflow: hidden;
|
|
191
229
|
border-radius: var(--wr-heatmap-chart-cell-radius);
|
|
192
230
|
background: $fill;
|
|
231
|
+
box-shadow: inset 0 0 0 1px var(--wr-heatmap-chart-cell-edge);
|
|
193
232
|
// The levels are the chart, so they keep their colours under forced colors, as the SVG
|
|
194
233
|
// charts' fills do; forced colors would otherwise paint every cell as the page.
|
|
195
234
|
forced-color-adjust: none;
|
|
@@ -228,7 +267,7 @@ $white: 'clamp(0, (0.17913 - y) * infinity, 1)';
|
|
|
228
267
|
font-weight: var(--wr-heatmap-chart-value-font-weight);
|
|
229
268
|
line-height: 1;
|
|
230
269
|
font-variant-numeric: tabular-nums;
|
|
231
|
-
color:
|
|
270
|
+
color: core-styles.ink($fill);
|
|
232
271
|
}
|
|
233
272
|
|
|
234
273
|
// Where relative colour syntax is missing — Firefox before 128, inside the documented
|
|
@@ -237,7 +276,7 @@ $white: 'clamp(0, (0.17913 - y) * infinity, 1)';
|
|
|
237
276
|
// small chip of the surface instead, in the chart's text colour, which reads on any level
|
|
238
277
|
// and in either scheme. The condition is the declaration itself, so an engine that has
|
|
239
278
|
// the syntax but not channel keywords inside `calc()` takes the chip too.
|
|
240
|
-
@supports not (color:
|
|
279
|
+
@supports not (color: #{core-styles.ink(red)}) {
|
|
241
280
|
&__value {
|
|
242
281
|
padding: calc(var(--wr-heatmap-chart-cell-padding-x) / 4) calc(var(--wr-heatmap-chart-cell-padding-x) / 2);
|
|
243
282
|
border-radius: var(--wr-heatmap-chart-cell-radius);
|
|
@@ -246,15 +285,18 @@ $white: 'clamp(0, (0.17913 - y) * infinity, 1)';
|
|
|
246
285
|
}
|
|
247
286
|
}
|
|
248
287
|
|
|
288
|
+
// The scale key is the shared one (`wr-chart-scale`), drawn through this chart's hooks:
|
|
289
|
+
// its room from the matrix, its type, and a step the size of the old swatch hooks.
|
|
249
290
|
&__legend {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
291
|
+
--wr-chart-legend-space: var(--wr-heatmap-chart-legend-margin-top);
|
|
292
|
+
--wr-chart-scale-gap: var(--wr-heatmap-chart-legend-gap);
|
|
293
|
+
--wr-chart-scale-font-size: var(--wr-heatmap-chart-legend-font-size);
|
|
294
|
+
--wr-chart-scale-color: var(--wr-heatmap-chart-legend-color);
|
|
295
|
+
--wr-chart-scale-step-width: var(--wr-heatmap-chart-swatch-width);
|
|
296
|
+
--wr-chart-scale-step-height: var(--wr-heatmap-chart-swatch-height);
|
|
297
|
+
--wr-chart-scale-step-gap: var(--wr-heatmap-chart-gap);
|
|
298
|
+
--wr-chart-scale-step-radius: var(--wr-heatmap-chart-cell-radius);
|
|
299
|
+
--wr-chart-scale-step-edge: var(--wr-heatmap-chart-cell-edge);
|
|
258
300
|
}
|
|
259
301
|
|
|
260
302
|
&__legend-label {
|
|
@@ -265,18 +307,11 @@ $white: 'clamp(0, (0.17913 - y) * infinity, 1)';
|
|
|
265
307
|
unicode-bidi: plaintext;
|
|
266
308
|
}
|
|
267
309
|
|
|
268
|
-
// The
|
|
269
|
-
&__scale {
|
|
270
|
-
display: inline-flex;
|
|
271
|
-
border-radius: var(--wr-heatmap-chart-cell-radius);
|
|
272
|
-
overflow: hidden;
|
|
273
|
-
}
|
|
274
|
-
|
|
310
|
+
// The key of an empty cell, beside the ramp: a step's size, hatched (below).
|
|
275
311
|
&__swatch {
|
|
276
312
|
flex: none;
|
|
277
313
|
inline-size: var(--wr-heatmap-chart-swatch-width);
|
|
278
314
|
block-size: var(--wr-heatmap-chart-swatch-height);
|
|
279
|
-
background: $fill;
|
|
280
315
|
forced-color-adjust: none;
|
|
281
316
|
}
|
|
282
317
|
|
|
@@ -290,6 +325,7 @@ $white: 'clamp(0, (0.17913 - y) * infinity, 1)';
|
|
|
290
325
|
var(--wr-heatmap-chart-empty-hatch) 0 1px,
|
|
291
326
|
var(--wr-heatmap-chart-surface) 1px 5px
|
|
292
327
|
);
|
|
328
|
+
box-shadow: none;
|
|
293
329
|
outline: 1px dashed var(--wr-heatmap-chart-empty-border);
|
|
294
330
|
outline-offset: -1px;
|
|
295
331
|
}
|
|
@@ -300,6 +336,7 @@ $white: 'clamp(0, (0.17913 - y) * infinity, 1)';
|
|
|
300
336
|
|
|
301
337
|
// Above its neighbours, so the ring is not painted over by the next cell, and after the
|
|
302
338
|
// empty cell's outline, which it replaces. Every cell is positioned already (`__cell`).
|
|
339
|
+
// Set by hand on the one cell the tooltip reads, never bound on every cell.
|
|
303
340
|
&__cell--active {
|
|
304
341
|
z-index: 1;
|
|
305
342
|
outline: var(--wr-heatmap-chart-active-ring-width) solid var(--wr-heatmap-chart-active-ring);
|
|
@@ -1,21 +1,37 @@
|
|
|
1
1
|
@use '../../../theme/styles' as theme;
|
|
2
|
+
@use '../../../popover/styles'; // the `.wr-tooltip` chip the hover tooltip renders into
|
|
2
3
|
|
|
3
4
|
// Styles for the entry points this component's own markup renders. The legend is a
|
|
4
5
|
// `ul[wr-chart-legend]`, so `@use 'ngwr/charts/line-chart'` alone draws it styled.
|
|
5
6
|
@use '../../chart-legend/styles' as chart-legend-styles; // WrChartLegend
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
|
|
7
|
+
// The chart theme every hook below defaults to (`--wr-chart-*`), the hover-dim rule, the
|
|
8
|
+
// empty / loading / error message, and the `<wr-chart-table>` that `dataTable` renders
|
|
9
|
+
// beside the plot, which its own rule clips out of sight.
|
|
10
|
+
@use '../../core/styles' as core-styles; // WrChartTable, WrChartState
|
|
9
11
|
@include theme.loaded('charts/line-chart');
|
|
10
12
|
|
|
11
13
|
.wr-line-chart {
|
|
12
14
|
--wr-line-chart-font-family: var(--wr-font-family-base);
|
|
13
15
|
--wr-line-chart-color: var(--wr-color-on-surface);
|
|
14
|
-
// The horizontal gridlines,
|
|
15
|
-
//
|
|
16
|
-
--wr-line-chart-grid-color:
|
|
17
|
-
--wr-line-chart-
|
|
18
|
-
--wr-line-chart-
|
|
16
|
+
// The horizontal gridlines, the one at zero, and the hover crosshair: the chart
|
|
17
|
+
// theme's, as on every chart.
|
|
18
|
+
--wr-line-chart-grid-color: var(--wr-chart-grid);
|
|
19
|
+
--wr-line-chart-zero-color: var(--wr-chart-zero);
|
|
20
|
+
--wr-line-chart-crosshair-color: var(--wr-chart-axis);
|
|
21
|
+
// A line's width and a dot's diameter.
|
|
22
|
+
--wr-line-chart-line-width: var(--wr-chart-stroke);
|
|
23
|
+
--wr-line-chart-dot-size: var(--wr-chart-marker);
|
|
24
|
+
// The marker on each reading under the crosshair: its diameter, and the ring of the
|
|
25
|
+
// surface round it, which parts it from the line it sits on. The ring's colour keeps
|
|
26
|
+
// the name it had as the centre of the old marker.
|
|
27
|
+
--wr-line-chart-hover-dot-size: 8px;
|
|
28
|
+
--wr-line-chart-hover-ring-width: 2px;
|
|
29
|
+
--wr-line-chart-hover-center: var(--wr-chart-separator);
|
|
30
|
+
// The y axis' scale: its numbers, and their room from the plot.
|
|
31
|
+
--wr-line-chart-tick-gap: var(--wr-space-sm);
|
|
32
|
+
--wr-line-chart-tick-font-size: var(--wr-chart-label-size);
|
|
33
|
+
--wr-line-chart-tick-line-height: var(--wr-text-xs-leading);
|
|
34
|
+
--wr-line-chart-tick-color: var(--wr-chart-label);
|
|
19
35
|
// The room round the drawing inside the plot, which the dots and the hover ring
|
|
20
36
|
// overhang into: the drawing runs edge to edge, so a point at either end is drawn
|
|
21
37
|
// half outside it. The y labels read the block one to meet the gridlines, the x labels
|
|
@@ -26,10 +42,10 @@
|
|
|
26
42
|
// gridlines and every other series' line read through where fills overlap.
|
|
27
43
|
--wr-line-chart-area-opacity: 0.15;
|
|
28
44
|
|
|
29
|
-
// Where a point is, for the x labels
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
45
|
+
// Where a point is, for the x labels. They sit in a box as wide as the plot — the
|
|
46
|
+
// drawing plus its inline padding — and are handed the point's x as a percentage of
|
|
47
|
+
// the DRAWING, so the length from either side of that box to the point is the padding
|
|
48
|
+
// plus that share of what is left. The padding is room an end label
|
|
33
49
|
// may use too: measured in Chromium, "Mon" sits within a pixel of centred under the
|
|
34
50
|
// first dot, where a strip as wide as the drawing pushed it 12px off.
|
|
35
51
|
$inset: var(--wr-line-chart-plot-inset-x);
|
|
@@ -37,9 +53,6 @@
|
|
|
37
53
|
$point: calc($inset + (100% - 2 * $inset) * $x / 100);
|
|
38
54
|
$room-start: calc($inset + (100cqw - 2 * $inset) * $x / 100);
|
|
39
55
|
$room-end: calc($inset + (100cqw - 2 * $inset) * (100 - $x) / 100);
|
|
40
|
-
// How far a readout beside the crosshair keeps from it: the hover marker's 6px radius
|
|
41
|
-
// and as much again. The component's `BESIDE`, which it places the readout by.
|
|
42
|
-
$beside: 12px;
|
|
43
56
|
|
|
44
57
|
display: block;
|
|
45
58
|
// The containing block of the `dataTable` copy, which is out of flow and sits beside
|
|
@@ -47,8 +60,7 @@
|
|
|
47
60
|
// nearest positioned ancestor outside the chart, often the page, and inside an
|
|
48
61
|
// unpositioned scroller the 1px box kept its place in the scrolled content: measured
|
|
49
62
|
// in Chromium, a chart 2000px down a 300px scroller grew the page from 600px to
|
|
50
|
-
// 2241px of blank scroll. No z-index, so no stacking context
|
|
51
|
-
// resolves against the plot.
|
|
63
|
+
// 2241px of blank scroll. No z-index, so no stacking context.
|
|
52
64
|
position: relative;
|
|
53
65
|
font-family: var(--wr-line-chart-font-family);
|
|
54
66
|
color: var(--wr-line-chart-color);
|
|
@@ -59,17 +71,17 @@
|
|
|
59
71
|
--wr-line-chart-area-opacity: 0.3;
|
|
60
72
|
}
|
|
61
73
|
|
|
74
|
+
// The legend is the shared one, placed by `legendPosition`. The room between it and
|
|
75
|
+
// the plot, on whichever side that is: the shared rule reads `--wr-chart-legend-space`,
|
|
76
|
+
// and the first hook is the chart's own name for it, from when the legend was always
|
|
77
|
+
// above. The two gaps are the chart's own names for the shared legend's.
|
|
62
78
|
&__legend {
|
|
63
79
|
--wr-line-chart-legend-margin-bottom: var(--wr-space-md);
|
|
64
80
|
--wr-line-chart-legend-row-gap: var(--wr-space-sm);
|
|
65
81
|
--wr-line-chart-legend-column-gap: var(--wr-space-lg);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
padding: 0;
|
|
70
|
-
display: flex;
|
|
71
|
-
flex-wrap: wrap;
|
|
72
|
-
gap: var(--wr-line-chart-legend-row-gap) var(--wr-line-chart-legend-column-gap);
|
|
82
|
+
--wr-chart-legend-space: var(--wr-line-chart-legend-margin-bottom);
|
|
83
|
+
--wr-chart-legend-gap-y: var(--wr-line-chart-legend-row-gap);
|
|
84
|
+
--wr-chart-legend-gap-x: var(--wr-line-chart-legend-column-gap);
|
|
73
85
|
}
|
|
74
86
|
|
|
75
87
|
&__legend-item {
|
|
@@ -95,8 +107,6 @@
|
|
|
95
107
|
height: 0.125rem;
|
|
96
108
|
overflow: visible;
|
|
97
109
|
flex: 0 0 auto;
|
|
98
|
-
// The tooltip's swatch is an inline `background`, which forced colors resets
|
|
99
|
-
// to `Canvas`, while the line it names keeps its SVG stroke.
|
|
100
110
|
forced-color-adjust: none;
|
|
101
111
|
}
|
|
102
112
|
|
|
@@ -107,6 +117,25 @@
|
|
|
107
117
|
&__body {
|
|
108
118
|
display: grid;
|
|
109
119
|
grid-template-columns: auto minmax(0, 1fr);
|
|
120
|
+
min-width: 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// The top number of the scale is centred on the top gridline, which sits the plot's
|
|
124
|
+
// block padding below the top of the chart: half a line of the number needs at least
|
|
125
|
+
// that much room, or it hangs out of the chart's own box and a card that clips cuts
|
|
126
|
+
// it. Nothing at the defaults, where the padding is exactly half a line.
|
|
127
|
+
&--axis &__body {
|
|
128
|
+
padding-block-start: max(0px, calc(var(--wr-line-chart-tick-line-height) / 2 - var(--wr-line-chart-plot-inset-y)));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Empty, loading or failed: the shared message, over the plot. A grid item in the
|
|
132
|
+
// plot's own cell rather than a child of it, since the plot is an `img`; the shared
|
|
133
|
+
// rule's `inset` has nothing to resolve against here and the cell sizes it instead.
|
|
134
|
+
&__body > .wr-chart-state {
|
|
135
|
+
position: relative;
|
|
136
|
+
inset: auto;
|
|
137
|
+
grid-column: 2;
|
|
138
|
+
grid-row: 1;
|
|
110
139
|
}
|
|
111
140
|
|
|
112
141
|
// As wide as the longest label, which is the point: every label is in flow, in the one
|
|
@@ -119,11 +148,6 @@
|
|
|
119
148
|
// the plot: measured in Chromium, six labels on an 80px plot grew the row to 96px and
|
|
120
149
|
// left the last one 16px low.
|
|
121
150
|
&__y-axis {
|
|
122
|
-
--wr-line-chart-tick-gap: var(--wr-space-xs);
|
|
123
|
-
--wr-line-chart-tick-font-size: var(--wr-text-xs);
|
|
124
|
-
--wr-line-chart-tick-line-height: var(--wr-text-xs-leading);
|
|
125
|
-
--wr-line-chart-tick-color: var(--wr-color-on-surface-muted);
|
|
126
|
-
|
|
127
151
|
grid-column: 1;
|
|
128
152
|
grid-row: 1;
|
|
129
153
|
display: grid;
|
|
@@ -170,14 +194,42 @@
|
|
|
170
194
|
|
|
171
195
|
&__grid-line {
|
|
172
196
|
stroke: var(--wr-line-chart-grid-color);
|
|
197
|
+
stroke-width: 1px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Zero, wherever it falls on the axis: the line the values are read against.
|
|
201
|
+
&__grid-line--zero {
|
|
202
|
+
stroke: var(--wr-line-chart-zero-color);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// The widths are the stylesheet's rather than attributes, so a hook can set them. The
|
|
206
|
+
// strokes do not scale with the drawing, so each is in screen pixels.
|
|
207
|
+
&__line {
|
|
208
|
+
stroke-width: var(--wr-line-chart-line-width);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
&__dot {
|
|
212
|
+
stroke-width: var(--wr-line-chart-dot-size);
|
|
173
213
|
}
|
|
174
214
|
|
|
175
215
|
&__crosshair {
|
|
176
216
|
stroke: var(--wr-line-chart-crosshair-color);
|
|
217
|
+
stroke-width: 1px;
|
|
218
|
+
pointer-events: none;
|
|
177
219
|
}
|
|
178
220
|
|
|
179
|
-
|
|
221
|
+
// The marker on a reading: the series' colour, inside a ring of the surface drawn
|
|
222
|
+
// under it as a wider stroke. Out of the pointer's way, so the line under a marker is
|
|
223
|
+
// still what the pointer is on.
|
|
224
|
+
&__hover-dot {
|
|
225
|
+
stroke-width: var(--wr-line-chart-hover-dot-size);
|
|
226
|
+
pointer-events: none;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
&__hover-dot-ring {
|
|
180
230
|
stroke: var(--wr-line-chart-hover-center);
|
|
231
|
+
stroke-width: calc(var(--wr-line-chart-hover-dot-size) + 2 * var(--wr-line-chart-hover-ring-width));
|
|
232
|
+
pointer-events: none;
|
|
181
233
|
}
|
|
182
234
|
|
|
183
235
|
// The plot's drawing by its class, never a bare `svg`: the legend swatch is an
|
|
@@ -194,112 +246,11 @@
|
|
|
194
246
|
overflow: visible;
|
|
195
247
|
}
|
|
196
248
|
|
|
197
|
-
// What the tooltip's `cqw` resolves against: the plot's width, padding included. On
|
|
198
|
-
// the plot itself the containment would take the SVG out of the
|
|
199
|
-
// chart's intrinsic width — measured in Chromium, a `width: max-content` chart went
|
|
200
|
-
// from 480px to 0 — while this layer is out of flow and contributes nothing either
|
|
201
|
-
// way. Never hittable: it covers the plot, and taking the `mousemove` would close
|
|
202
|
-
// the tooltip it holds.
|
|
203
|
-
&__tooltip-layer {
|
|
204
|
-
position: absolute;
|
|
205
|
-
inset: 0;
|
|
206
|
-
container-type: inline-size;
|
|
207
|
-
pointer-events: none;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
&__tooltip {
|
|
211
|
-
--wr-line-chart-tooltip-border: var(--wr-border-base);
|
|
212
|
-
--wr-line-chart-tooltip-radius: var(--wr-border-radius-base);
|
|
213
|
-
--wr-line-chart-tooltip-padding-y: var(--wr-space-sm);
|
|
214
|
-
--wr-line-chart-tooltip-padding-x: var(--wr-space-md);
|
|
215
|
-
--wr-line-chart-tooltip-font-size: var(--wr-text-xs);
|
|
216
|
-
--wr-line-chart-tooltip-bg: var(--wr-color-surface);
|
|
217
|
-
--wr-line-chart-tooltip-shadow: var(--wr-shadow-sm);
|
|
218
|
-
|
|
219
|
-
position: absolute;
|
|
220
|
-
// rtl-ok: the SVG's own x, and SVG coordinates do not flip with `direction`
|
|
221
|
-
left: $point;
|
|
222
|
-
top: var(--wr-line-chart-plot-inset-y);
|
|
223
|
-
// Centred on its point, but never past either end of the plot — the x labels' clamp:
|
|
224
|
-
// the shift is the smaller of half the box and the room actually left on that side,
|
|
225
|
-
// so a tooltip that fits sits exactly over its crosshair and only the ones near an
|
|
226
|
-
// end move inwards. Centred with nothing bounding it, the tooltip at the last point
|
|
227
|
-
// hung half its width past the chart — measured at 52px over the right edge in
|
|
228
|
-
// Chromium, cut off by any container that clips and a sideways scroll on a phone for
|
|
229
|
-
// any that does not.
|
|
230
|
-
// rtl-ok: the SVG's own x, and SVG coordinates do not flip with `direction`
|
|
231
|
-
transform: translate(clamp(calc(-1 * $room-start), -50%, calc($room-end - 100%)), 0.5rem);
|
|
232
|
-
background: var(--wr-line-chart-tooltip-bg);
|
|
233
|
-
border: 1px solid var(--wr-line-chart-tooltip-border);
|
|
234
|
-
border-radius: var(--wr-line-chart-tooltip-radius);
|
|
235
|
-
box-shadow: var(--wr-line-chart-tooltip-shadow);
|
|
236
|
-
padding: var(--wr-line-chart-tooltip-padding-y) var(--wr-line-chart-tooltip-padding-x);
|
|
237
|
-
font-size: var(--wr-line-chart-tooltip-font-size);
|
|
238
|
-
pointer-events: none;
|
|
239
|
-
z-index: 1;
|
|
240
|
-
min-width: 6rem;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// Where the top would cover a marker the readout reads, which the component works out
|
|
244
|
-
// from its size: at the bottom of the plot, as far inside it as the top one sits, or —
|
|
245
|
-
// where the bottom would too — at the top beside the crosshair, every marker being on
|
|
246
|
-
// it, `$beside` off it on the side with more room and still never past either end. At
|
|
247
|
-
// the top always, it hid every reading in the plot's upper band under the chip that gave
|
|
248
|
-
// its value — a third of the rings on the docs' own demos.
|
|
249
|
-
&__tooltip--below {
|
|
250
|
-
top: auto;
|
|
251
|
-
bottom: var(--wr-line-chart-plot-inset-y);
|
|
252
|
-
// rtl-ok: the SVG's own x, and SVG coordinates do not flip with `direction`
|
|
253
|
-
transform: translate(clamp(calc(-1 * $room-start), -50%, calc($room-end - 100%)), -0.5rem);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
&__tooltip--left {
|
|
257
|
-
// rtl-ok: the SVG's own x, and SVG coordinates do not flip with `direction`
|
|
258
|
-
transform: translate(clamp(calc(-1 * $room-start), calc(-100% - $beside), calc($room-end - 100%)), 0.5rem);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
&__tooltip--right {
|
|
262
|
-
// rtl-ok: the SVG's own x, and SVG coordinates do not flip with `direction`
|
|
263
|
-
transform: translate(clamp(calc(-1 * $room-start), $beside, calc($room-end - 100%)), 0.5rem);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
&__tooltip-label {
|
|
267
|
-
--wr-line-chart-tooltip-label-font-weight: var(--wr-font-weight-semibold);
|
|
268
|
-
--wr-line-chart-tooltip-label-margin-bottom: var(--wr-space-xs);
|
|
269
|
-
|
|
270
|
-
font-weight: var(--wr-line-chart-tooltip-label-font-weight);
|
|
271
|
-
margin-bottom: var(--wr-line-chart-tooltip-label-margin-bottom);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
&__tooltip-row {
|
|
275
|
-
--wr-line-chart-tooltip-row-gap: var(--wr-space-sm);
|
|
276
|
-
|
|
277
|
-
display: flex;
|
|
278
|
-
align-items: center;
|
|
279
|
-
gap: var(--wr-line-chart-tooltip-row-gap);
|
|
280
|
-
font-variant-numeric: tabular-nums;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
&__tooltip-name {
|
|
284
|
-
--wr-line-chart-tooltip-name-color: var(--wr-color-on-surface-muted);
|
|
285
|
-
|
|
286
|
-
flex: 1 1 auto;
|
|
287
|
-
color: var(--wr-line-chart-tooltip-name-color);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
&__tooltip-value {
|
|
291
|
-
--wr-line-chart-tooltip-value-font-weight: var(--wr-font-weight-semibold);
|
|
292
|
-
|
|
293
|
-
font-weight: var(--wr-line-chart-tooltip-value-font-weight);
|
|
294
|
-
// As a tick: the sign of `-350` stays before the digits on an RTL page.
|
|
295
|
-
unicode-bidi: plaintext;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
249
|
&__x-labels {
|
|
299
250
|
--wr-line-chart-x-labels-margin-top: var(--wr-space-xs);
|
|
300
|
-
--wr-line-chart-x-labels-font-size: var(--wr-
|
|
251
|
+
--wr-line-chart-x-labels-font-size: var(--wr-chart-label-size);
|
|
301
252
|
--wr-line-chart-x-labels-line-height: var(--wr-text-xs-leading);
|
|
302
|
-
--wr-line-chart-x-labels-color: var(--wr-
|
|
253
|
+
--wr-line-chart-x-labels-color: var(--wr-chart-label);
|
|
303
254
|
|
|
304
255
|
grid-column: 2;
|
|
305
256
|
grid-row: 2;
|
|
@@ -351,8 +302,8 @@
|
|
|
351
302
|
unicode-bidi: plaintext;
|
|
352
303
|
}
|
|
353
304
|
|
|
354
|
-
//
|
|
355
|
-
// widest off it to decide how many labels print. Never wider than the strip, which is
|
|
305
|
+
// The longest few labels, a line each, laid out and never seen: the component measures
|
|
306
|
+
// the widest off it to decide how many labels print. Never wider than the strip, which is
|
|
356
307
|
// the most room a label could have, and clipped there, so a long one adds no overflow.
|
|
357
308
|
&__x-probe {
|
|
358
309
|
position: absolute;
|
|
@@ -367,19 +318,72 @@
|
|
|
367
318
|
}
|
|
368
319
|
}
|
|
369
320
|
|
|
321
|
+
// ── The tooltip ────────────────────────────────────────────────────────────────────
|
|
322
|
+
//
|
|
323
|
+
// The chart's readout is the chip every chart shares (`.wr-chart-tooltip`), drawn in an
|
|
324
|
+
// overlay outside the chart, so no hook set on the chart reaches it. The chart gives its
|
|
325
|
+
// chip this class, and the hooks the chart's own tooltip had are declared here with the
|
|
326
|
+
// shared chip's values: set one on `.wr-line-chart__tooltip` and this chart's chip
|
|
327
|
+
// follows, and no other chart's. The rule under it hands each to the shared chip's own
|
|
328
|
+
// hook; it names the shared class too, so it wins over the shared rule whatever order
|
|
329
|
+
// the two sheets load in.
|
|
330
|
+
.wr-line-chart__tooltip {
|
|
331
|
+
--wr-line-chart-tooltip-border: var(--wr-border-base);
|
|
332
|
+
--wr-line-chart-tooltip-radius: var(--wr-border-radius-sm);
|
|
333
|
+
--wr-line-chart-tooltip-padding-y: var(--wr-space-xs);
|
|
334
|
+
--wr-line-chart-tooltip-padding-x: var(--wr-space-sm);
|
|
335
|
+
--wr-line-chart-tooltip-font-size: var(--wr-text-xs);
|
|
336
|
+
--wr-line-chart-tooltip-bg: var(--wr-color-surface);
|
|
337
|
+
--wr-line-chart-tooltip-shadow: var(--wr-shadow-overlay);
|
|
338
|
+
// The heading: the x label over the rows.
|
|
339
|
+
--wr-line-chart-tooltip-label-font-weight: var(--wr-font-weight-semibold);
|
|
340
|
+
--wr-line-chart-tooltip-label-margin-bottom: 0px;
|
|
341
|
+
// A row: the gap between its swatch, its series' name and its value.
|
|
342
|
+
--wr-line-chart-tooltip-row-gap: var(--wr-space-sm);
|
|
343
|
+
--wr-line-chart-tooltip-name-color: color-mix(in srgb, currentColor 72%, transparent);
|
|
344
|
+
--wr-line-chart-tooltip-value-font-weight: var(--wr-font-weight-semibold);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.wr-line-chart__tooltip.wr-chart-tooltip {
|
|
348
|
+
--wr-tooltip-border: var(--wr-line-chart-tooltip-border);
|
|
349
|
+
--wr-tooltip-radius: var(--wr-line-chart-tooltip-radius);
|
|
350
|
+
--wr-tooltip-padding-y: var(--wr-line-chart-tooltip-padding-y);
|
|
351
|
+
--wr-tooltip-padding-x: var(--wr-line-chart-tooltip-padding-x);
|
|
352
|
+
--wr-tooltip-font-size: var(--wr-line-chart-tooltip-font-size);
|
|
353
|
+
--wr-tooltip-bg: var(--wr-line-chart-tooltip-bg);
|
|
354
|
+
--wr-chart-tooltip-gap: var(--wr-line-chart-tooltip-row-gap);
|
|
355
|
+
|
|
356
|
+
box-shadow: var(--wr-line-chart-tooltip-shadow);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.wr-line-chart__tooltip.wr-chart-tooltip .wr-chart-tooltip__head {
|
|
360
|
+
--wr-chart-tooltip-head-font-weight: var(--wr-line-chart-tooltip-label-font-weight);
|
|
361
|
+
|
|
362
|
+
margin-block-end: var(--wr-line-chart-tooltip-label-margin-bottom);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.wr-line-chart__tooltip.wr-chart-tooltip .wr-chart-tooltip__row-label {
|
|
366
|
+
--wr-chart-tooltip-row-label-color: var(--wr-line-chart-tooltip-name-color);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.wr-line-chart__tooltip.wr-chart-tooltip .wr-chart-tooltip__row-value {
|
|
370
|
+
--wr-chart-tooltip-row-value-font-weight: var(--wr-line-chart-tooltip-value-font-weight);
|
|
371
|
+
}
|
|
372
|
+
|
|
370
373
|
// Forced colors keeps the SVG strokes as written, so the strokes written in theme colours
|
|
371
374
|
// would keep colours the forced palette no longer has: the gridlines would all but vanish
|
|
372
|
-
// on a dark canvas, and the hovered marker
|
|
375
|
+
// on a dark canvas, and the ring round a hovered marker would be a ring of the old page.
|
|
373
376
|
@media (forced-colors: active) {
|
|
374
377
|
.wr-line-chart__grid-line {
|
|
375
378
|
stroke: GrayText;
|
|
376
379
|
}
|
|
377
380
|
|
|
381
|
+
.wr-line-chart__grid-line--zero,
|
|
378
382
|
.wr-line-chart__crosshair {
|
|
379
383
|
stroke: CanvasText;
|
|
380
384
|
}
|
|
381
385
|
|
|
382
|
-
.wr-line-chart__hover-dot-
|
|
386
|
+
.wr-line-chart__hover-dot-ring {
|
|
383
387
|
stroke: Canvas;
|
|
384
388
|
}
|
|
385
389
|
}
|