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.
Files changed (295) hide show
  1. package/carousel/styles/_index.scss +53 -1
  2. package/charts/bar-chart/styles/_index.scss +494 -305
  3. package/charts/boxplot-chart/styles/_index.scss +114 -48
  4. package/charts/bullet-chart/styles/_index.scss +113 -42
  5. package/charts/calendar-heatmap/styles/_index.scss +111 -20
  6. package/charts/candlestick-chart/styles/_index.scss +61 -26
  7. package/charts/chart-legend/styles/_index.scss +119 -1
  8. package/charts/core/styles/_index.scss +201 -5
  9. package/charts/donut-chart/styles/_index.scss +76 -21
  10. package/charts/funnel-chart/styles/_index.scss +66 -38
  11. package/charts/gauge/styles/_index.scss +12 -1
  12. package/charts/heatmap-chart/styles/_index.scss +90 -53
  13. package/charts/line-chart/styles/_index.scss +143 -139
  14. package/charts/meter-group/styles/_index.scss +87 -25
  15. package/charts/radar-chart/styles/_index.scss +82 -40
  16. package/charts/scatter-chart/styles/_index.scss +117 -44
  17. package/charts/sparkline/styles/_index.scss +7 -1
  18. package/charts/treemap-chart/styles/_index.scss +94 -42
  19. package/charts/waterfall-chart/styles/_index.scss +150 -87
  20. package/color-picker/styles/_index.scss +7 -3
  21. package/copy-value/styles/_index.scss +21 -2
  22. package/date-stamp/styles/_index.scss +2 -1
  23. package/dialog/styles/_index.scss +6 -0
  24. package/drawer/styles/_index.scss +5 -1
  25. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  26. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  27. package/fesm2022/ngwr-carousel-testing.mjs +27 -1
  28. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  29. package/fesm2022/ngwr-carousel.mjs +86 -4
  30. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  31. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
  32. package/fesm2022/ngwr-cascader.mjs +56 -25
  33. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  34. package/fesm2022/ngwr-charts-bar-chart-testing.mjs +16 -14
  35. package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
  36. package/fesm2022/ngwr-charts-bar-chart.mjs +399 -141
  37. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  38. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +19 -5
  39. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -1
  40. package/fesm2022/ngwr-charts-boxplot-chart.mjs +250 -56
  41. package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
  42. package/fesm2022/ngwr-charts-bullet-chart.mjs +118 -18
  43. package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
  44. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +266 -46
  45. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  46. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +21 -10
  47. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -1
  48. package/fesm2022/ngwr-charts-candlestick-chart.mjs +319 -72
  49. package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
  50. package/fesm2022/ngwr-charts-chart-legend.mjs +211 -9
  51. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
  52. package/fesm2022/ngwr-charts-core.mjs +299 -18
  53. package/fesm2022/ngwr-charts-core.mjs.map +1 -1
  54. package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
  55. package/fesm2022/ngwr-charts-donut-chart.mjs +206 -27
  56. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  57. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +4 -4
  58. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -1
  59. package/fesm2022/ngwr-charts-funnel-chart.mjs +113 -10
  60. package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
  61. package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
  62. package/fesm2022/ngwr-charts-gauge.mjs +98 -12
  63. package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
  64. package/fesm2022/ngwr-charts-heatmap-chart.mjs +226 -31
  65. package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
  66. package/fesm2022/ngwr-charts-line-chart-testing.mjs +16 -4
  67. package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
  68. package/fesm2022/ngwr-charts-line-chart.mjs +407 -172
  69. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  70. package/fesm2022/ngwr-charts-meter-group-testing.mjs +4 -4
  71. package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
  72. package/fesm2022/ngwr-charts-meter-group.mjs +223 -31
  73. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  74. package/fesm2022/ngwr-charts-radar-chart-testing.mjs +2 -1
  75. package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -1
  76. package/fesm2022/ngwr-charts-radar-chart.mjs +255 -66
  77. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
  78. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +39 -18
  79. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -1
  80. package/fesm2022/ngwr-charts-scatter-chart.mjs +431 -53
  81. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
  82. package/fesm2022/ngwr-charts-sparkline.mjs +19 -8
  83. package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
  84. package/fesm2022/ngwr-charts-treemap-chart.mjs +253 -44
  85. package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
  86. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +15 -7
  87. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -1
  88. package/fesm2022/ngwr-charts-waterfall-chart.mjs +151 -23
  89. package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
  90. package/fesm2022/ngwr-color-picker.mjs +44 -4
  91. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  92. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
  93. package/fesm2022/ngwr-context-menu.mjs +60 -17
  94. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  95. package/fesm2022/ngwr-copy-value-testing.mjs +5 -1
  96. package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -1
  97. package/fesm2022/ngwr-copy-value.mjs +38 -2
  98. package/fesm2022/ngwr-copy-value.mjs.map +1 -1
  99. package/fesm2022/ngwr-date-picker.mjs +56 -8
  100. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  101. package/fesm2022/ngwr-dialog.mjs +13 -5
  102. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  103. package/fesm2022/ngwr-drawer.mjs +19 -3
  104. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  105. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  106. package/fesm2022/ngwr-dropdown.mjs +49 -6
  107. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  108. package/fesm2022/ngwr-editor.mjs +1 -0
  109. package/fesm2022/ngwr-editor.mjs.map +1 -1
  110. package/fesm2022/ngwr-file-upload.mjs +7 -3
  111. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  112. package/fesm2022/ngwr-graph-testing.mjs +27 -0
  113. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  114. package/fesm2022/ngwr-graph.mjs +643 -14
  115. package/fesm2022/ngwr-graph.mjs.map +1 -1
  116. package/fesm2022/ngwr-i18n-ar.mjs +13 -4
  117. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  118. package/fesm2022/ngwr-i18n-cs.mjs +13 -4
  119. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  120. package/fesm2022/ngwr-i18n-de.mjs +13 -4
  121. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  122. package/fesm2022/ngwr-i18n-en.mjs +13 -4
  123. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  124. package/fesm2022/ngwr-i18n-es.mjs +13 -4
  125. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  126. package/fesm2022/ngwr-i18n-fr.mjs +13 -4
  127. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  128. package/fesm2022/ngwr-i18n-he.mjs +13 -4
  129. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  130. package/fesm2022/ngwr-i18n-hi.mjs +13 -4
  131. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  132. package/fesm2022/ngwr-i18n-id.mjs +13 -4
  133. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  134. package/fesm2022/ngwr-i18n-it.mjs +13 -4
  135. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  136. package/fesm2022/ngwr-i18n-ja.mjs +13 -4
  137. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  138. package/fesm2022/ngwr-i18n-ko.mjs +13 -4
  139. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  140. package/fesm2022/ngwr-i18n-nl.mjs +13 -4
  141. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  142. package/fesm2022/ngwr-i18n-pl.mjs +13 -4
  143. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  144. package/fesm2022/ngwr-i18n-pt.mjs +13 -4
  145. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  146. package/fesm2022/ngwr-i18n-ru.mjs +13 -4
  147. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  148. package/fesm2022/ngwr-i18n-sv.mjs +13 -4
  149. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  150. package/fesm2022/ngwr-i18n-tr.mjs +13 -4
  151. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  152. package/fesm2022/ngwr-i18n-uk.mjs +13 -4
  153. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  154. package/fesm2022/ngwr-i18n-vi.mjs +13 -4
  155. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  156. package/fesm2022/ngwr-i18n-zh-tw.mjs +13 -4
  157. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  158. package/fesm2022/ngwr-i18n-zh.mjs +13 -4
  159. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  160. package/fesm2022/ngwr-lightbox.mjs +22 -5
  161. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  162. package/fesm2022/ngwr-list.mjs +2 -2
  163. package/fesm2022/ngwr-list.mjs.map +1 -1
  164. package/fesm2022/ngwr-overlay.mjs +21 -2
  165. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  166. package/fesm2022/ngwr-pagination.mjs +1 -0
  167. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  168. package/fesm2022/ngwr-popconfirm-testing.mjs +4 -1
  169. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  170. package/fesm2022/ngwr-popconfirm.mjs +41 -5
  171. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  172. package/fesm2022/ngwr-popover.mjs +67 -12
  173. package/fesm2022/ngwr-popover.mjs.map +1 -1
  174. package/fesm2022/ngwr-schema-form.mjs +3 -0
  175. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  176. package/fesm2022/ngwr-select.mjs +100 -3
  177. package/fesm2022/ngwr-select.mjs.map +1 -1
  178. package/fesm2022/ngwr-sortable-list.mjs +2 -2
  179. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  180. package/fesm2022/ngwr-table-testing.mjs +71 -3
  181. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  182. package/fesm2022/ngwr-table.mjs +173 -11
  183. package/fesm2022/ngwr-table.mjs.map +1 -1
  184. package/fesm2022/ngwr-tour-testing.mjs +13 -1
  185. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  186. package/fesm2022/ngwr-tour.mjs +25 -16
  187. package/fesm2022/ngwr-tour.mjs.map +1 -1
  188. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  189. package/fesm2022/ngwr-tree.mjs +52 -8
  190. package/fesm2022/ngwr-tree.mjs.map +1 -1
  191. package/fesm2022/ngwr-utils.mjs +64 -1
  192. package/fesm2022/ngwr-utils.mjs.map +1 -1
  193. package/fesm2022/ngwr-version.mjs +1 -1
  194. package/fesm2022/ngwr-version.mjs.map +1 -1
  195. package/fesm2022/ngwr-window.mjs +16 -9
  196. package/fesm2022/ngwr-window.mjs.map +1 -1
  197. package/graph/styles/_index.scss +87 -0
  198. package/i18n/ar.json +13 -4
  199. package/i18n/cs.json +13 -4
  200. package/i18n/de.json +13 -4
  201. package/i18n/en.json +13 -4
  202. package/i18n/es.json +13 -4
  203. package/i18n/fr.json +13 -4
  204. package/i18n/he.json +13 -4
  205. package/i18n/hi.json +13 -4
  206. package/i18n/id.json +13 -4
  207. package/i18n/it.json +13 -4
  208. package/i18n/ja.json +13 -4
  209. package/i18n/ko.json +13 -4
  210. package/i18n/nl.json +13 -4
  211. package/i18n/pl.json +13 -4
  212. package/i18n/pt.json +13 -4
  213. package/i18n/ru.json +13 -4
  214. package/i18n/sv.json +13 -4
  215. package/i18n/tr.json +13 -4
  216. package/i18n/uk.json +13 -4
  217. package/i18n/vi.json +13 -4
  218. package/i18n/zh-TW.json +13 -4
  219. package/i18n/zh.json +13 -4
  220. package/llms-full.txt +12 -12
  221. package/llms.txt +64 -27
  222. package/package.json +1 -1
  223. package/popconfirm/styles/_index.scss +6 -0
  224. package/popover/styles/_index.scss +24 -13
  225. package/schematics/collection.json +5 -0
  226. package/schematics/eject/index.js +158 -0
  227. package/schematics/eject/schema.js +8 -0
  228. package/schematics/eject/schema.json +24 -0
  229. package/schematics/eject/source.js +295 -0
  230. package/schematics/use/symbol-map.json +2 -0
  231. package/select/styles/_index.scss +13 -0
  232. package/skills/ngwr/SKILL.md +30 -3
  233. package/skills/ngwr/references/catalog.md +2 -2
  234. package/table/styles/_index.scss +24 -0
  235. package/theme/styles/_focus.scss +11 -1
  236. package/tour/styles/_index.scss +6 -0
  237. package/types/ngwr-carousel-testing.d.ts +29 -6
  238. package/types/ngwr-carousel.d.ts +52 -5
  239. package/types/ngwr-cascader-testing.d.ts +4 -3
  240. package/types/ngwr-cascader.d.ts +29 -7
  241. package/types/ngwr-charts-bar-chart-testing.d.ts +15 -13
  242. package/types/ngwr-charts-bar-chart.d.ts +220 -48
  243. package/types/ngwr-charts-boxplot-chart-testing.d.ts +9 -2
  244. package/types/ngwr-charts-boxplot-chart.d.ts +110 -19
  245. package/types/ngwr-charts-bullet-chart.d.ts +72 -12
  246. package/types/ngwr-charts-calendar-heatmap.d.ts +119 -15
  247. package/types/ngwr-charts-candlestick-chart-testing.d.ts +19 -9
  248. package/types/ngwr-charts-candlestick-chart.d.ts +195 -62
  249. package/types/ngwr-charts-chart-legend.d.ts +142 -5
  250. package/types/ngwr-charts-core.d.ts +259 -21
  251. package/types/ngwr-charts-donut-chart-testing.d.ts +11 -5
  252. package/types/ngwr-charts-donut-chart.d.ts +124 -16
  253. package/types/ngwr-charts-funnel-chart.d.ts +62 -6
  254. package/types/ngwr-charts-gauge-testing.d.ts +5 -1
  255. package/types/ngwr-charts-gauge.d.ts +72 -10
  256. package/types/ngwr-charts-heatmap-chart.d.ts +103 -20
  257. package/types/ngwr-charts-line-chart-testing.d.ts +16 -2
  258. package/types/ngwr-charts-line-chart.d.ts +215 -86
  259. package/types/ngwr-charts-meter-group.d.ts +96 -7
  260. package/types/ngwr-charts-radar-chart-testing.d.ts +14 -3
  261. package/types/ngwr-charts-radar-chart.d.ts +148 -28
  262. package/types/ngwr-charts-scatter-chart-testing.d.ts +22 -10
  263. package/types/ngwr-charts-scatter-chart.d.ts +188 -18
  264. package/types/ngwr-charts-sparkline.d.ts +26 -4
  265. package/types/ngwr-charts-treemap-chart.d.ts +121 -23
  266. package/types/ngwr-charts-waterfall-chart-testing.d.ts +8 -1
  267. package/types/ngwr-charts-waterfall-chart.d.ts +108 -21
  268. package/types/ngwr-color-picker.d.ts +27 -0
  269. package/types/ngwr-context-menu-testing.d.ts +10 -9
  270. package/types/ngwr-context-menu.d.ts +19 -0
  271. package/types/ngwr-copy-value.d.ts +8 -0
  272. package/types/ngwr-date-picker.d.ts +34 -2
  273. package/types/ngwr-dialog.d.ts +30 -10
  274. package/types/ngwr-drawer.d.ts +32 -1
  275. package/types/ngwr-dropdown-testing.d.ts +8 -5
  276. package/types/ngwr-dropdown.d.ts +31 -6
  277. package/types/ngwr-file-upload.d.ts +8 -2
  278. package/types/ngwr-graph-testing.d.ts +28 -0
  279. package/types/ngwr-graph.d.ts +263 -91
  280. package/types/ngwr-lightbox.d.ts +15 -0
  281. package/types/ngwr-overlay.d.ts +16 -1
  282. package/types/ngwr-popconfirm-testing.d.ts +11 -2
  283. package/types/ngwr-popconfirm.d.ts +28 -1
  284. package/types/ngwr-popover.d.ts +59 -9
  285. package/types/ngwr-select.d.ts +37 -0
  286. package/types/ngwr-table-testing.d.ts +52 -1
  287. package/types/ngwr-table.d.ts +102 -10
  288. package/types/ngwr-tour-testing.d.ts +10 -0
  289. package/types/ngwr-tour.d.ts +32 -4
  290. package/types/ngwr-tree-testing.d.ts +1 -2
  291. package/types/ngwr-tree.d.ts +35 -2
  292. package/types/ngwr-utils.d.ts +79 -1
  293. package/types/ngwr-version.d.ts +1 -1
  294. package/types/ngwr-window.d.ts +14 -11
  295. 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: the scale's colour (`--wr-heatmap-chart-scale-color`, which the component
11
- // writes from its `color` input) mixed toward the surface, by the level's place on the scale
12
- // (`--wr-heatmap-chart-level`, 0 to 1, which the component writes on every cell and every
13
- // legend swatch). The lowest level keeps `--wr-heatmap-chart-min-share` of the colour, so it
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 every level is mixed toward, and how much of the colour the lowest level keeps.
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
- --wr-heatmap-chart-min-share: 15%;
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
- --wr-heatmap-chart-gap: 2px;
43
- // 2px — a micro radius for cells that may be only a few pixels wide; the border-radius
44
- // tokens (6px+) would round a narrow column into a capsule.
45
- --wr-heatmap-chart-cell-radius: 2px;
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-text-xs);
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-color-on-surface-muted);
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 colour-scale legend under the matrix.
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-text-xs);
68
- --wr-heatmap-chart-legend-color: var(--wr-color-on-surface-muted);
69
- --wr-heatmap-chart-swatch-width: 1.25rem;
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: color(from #{$fill} xyz-d65 calc(0.9505 * #{$white}) #{$white} calc(1.0891 * #{$white}));
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: color(from red xyz-d65 calc(0.9505 * #{$white}) #{$white} calc(1.0891 * #{$white}))) {
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
- display: flex;
251
- flex-wrap: wrap;
252
- align-items: center;
253
- justify-content: center;
254
- gap: var(--wr-heatmap-chart-legend-gap);
255
- margin-block-start: var(--wr-heatmap-chart-legend-margin-top);
256
- font-size: var(--wr-heatmap-chart-legend-font-size);
257
- color: var(--wr-heatmap-chart-legend-color);
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 levels side by side, as one bar from the lowest to the highest.
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
- // With `dataTable`, the figures render as a `<wr-chart-table>` beside the plot, which
7
- // its own sheet clips out of sight.
8
- @use '../../core/styles' as core-styles; // WrChartTable
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, as faint as every chart's; the hover crosshair, and the
15
- // centre of the ring round each marker it reads.
16
- --wr-line-chart-grid-color: color-mix(in srgb, var(--wr-border-base) 70%, transparent);
17
- --wr-line-chart-crosshair-color: var(--wr-color-on-surface-muted);
18
- --wr-line-chart-hover-center: var(--wr-color-surface);
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 and the tooltip. Both sit in a box as wide as the
30
- // plot — the drawing plus its inline padding — and are handed the point's x as a
31
- // percentage of the DRAWING, so the length from either side of that box to the point
32
- // is the padding plus that share of what is left. The padding is room an end label
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; the tooltip already
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
- list-style: none;
68
- margin: 0 0 var(--wr-line-chart-legend-margin-bottom);
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
- &__hover-dot-center {
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-text-xs);
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-color-on-surface-muted);
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
- // Every label once, a line each, laid out and never seen: the component measures the
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's centre would be a disc of the old page.
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-center {
386
+ .wr-line-chart__hover-dot-ring {
383
387
  stroke: Canvas;
384
388
  }
385
389
  }