@fundar/data-chart-telling 1.16.0 → 1.18.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 (330) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/configuration/ConfigVars.svelte +14 -0
  3. package/dist/configuration/ConfigVars.svelte.d.ts +3 -0
  4. package/dist/configuration/config.svelte.d.ts +5 -0
  5. package/dist/configuration/config.svelte.js +20 -6
  6. package/dist/configuration/themes/dark.js +1 -1
  7. package/dist/configuration/themes/editorial.js +1 -1
  8. package/dist/index.d.ts +12 -4
  9. package/dist/index.js +4 -1
  10. package/dist/layout/base/BasePlotLayout.svelte +1 -1
  11. package/dist/layout/figure/Figure.svelte +5 -12
  12. package/dist/layout/figure/FigureChrome.svelte +2 -10
  13. package/dist/layout/geometry/GeometryLayout.svelte +219 -44
  14. package/dist/layout/hover/HoverDefaults.d.ts +52 -0
  15. package/dist/layout/hover/HoverDefaults.js +96 -0
  16. package/dist/layout/hover/HoverLayers.d.ts +35 -0
  17. package/dist/layout/hover/HoverLayers.js +122 -0
  18. package/dist/layout/hover/HoverSettings.js +4 -1
  19. package/dist/layout/hover/HoverShapes.d.ts +44 -0
  20. package/dist/layout/hover/HoverShapes.js +103 -0
  21. package/dist/layout/hover/PlotHover.svelte.d.ts +18 -0
  22. package/dist/layout/hover/PlotHover.svelte.js +54 -1
  23. package/dist/layout/legend/DisabledStyle.d.ts +1 -1
  24. package/dist/layout/legend/DisabledStyle.js +1 -1
  25. package/dist/layout/legend/DiscreteBadgeItem.svelte +1 -1
  26. package/dist/layout/legend/DiscreteSection.svelte +1 -1
  27. package/dist/layout/legend/LegendState.svelte.d.ts +14 -2
  28. package/dist/layout/legend/LegendState.svelte.js +23 -4
  29. package/dist/layout/legend/LegendText.d.ts +4 -1
  30. package/dist/layout/legend/LegendText.js +7 -1
  31. package/dist/layout/margins/PlotMargins.svelte.d.ts +2 -2
  32. package/dist/layout/margins/PlotMargins.svelte.js +2 -2
  33. package/dist/layout/plot/Core.svelte +2 -2
  34. package/dist/layout/plot/Plot.svelte +4 -2
  35. package/dist/layout/plot/Plot.svelte.d.ts +2 -1
  36. package/dist/layout/plot/PublicPlotContext.d.ts +6 -0
  37. package/dist/layout/plot/PublicPlotContext.js +8 -0
  38. package/dist/layout/scales/ScalesLayout.svelte +1 -1
  39. package/dist/layout/styles/ValueLabels.d.ts +43 -4
  40. package/dist/layout/styles/ValueLabels.js +87 -19
  41. package/dist/layout/timeline/Timeline.svelte +5 -1
  42. package/dist/layout/tooltip/TooltipState.svelte.d.ts +8 -9
  43. package/dist/layout/tooltip/TooltipState.svelte.js +28 -29
  44. package/dist/markers/MarkerKinds.d.ts +5 -0
  45. package/dist/markers/MarkerKinds.js +1 -0
  46. package/dist/markers/area/AreaMarker.svelte +3 -0
  47. package/dist/markers/arrow/ArrowMarker.svelte +9 -5
  48. package/dist/markers/band/BandMarker.svelte +74 -0
  49. package/dist/markers/band/BandMarker.svelte.d.ts +7 -0
  50. package/dist/markers/band/Bands.d.ts +16 -0
  51. package/dist/markers/band/Bands.js +48 -0
  52. package/dist/markers/bar/BarMarker.svelte +50 -96
  53. package/dist/markers/bollinger/BollingerMarker.svelte +3 -0
  54. package/dist/markers/box/BoxMarker.svelte +3 -1
  55. package/dist/markers/cell/CellMarker.svelte +11 -7
  56. package/dist/markers/contour/ContourMarker.svelte +3 -0
  57. package/dist/markers/delaunay/DelaunayLinkMarker.svelte +9 -5
  58. package/dist/markers/delaunay/DelaunayMeshMarker.svelte +3 -0
  59. package/dist/markers/density/DensityMarker.svelte +3 -0
  60. package/dist/markers/difference/DifferenceMarker.svelte +3 -0
  61. package/dist/markers/dot/DotMarker.svelte +11 -6
  62. package/dist/markers/geo/GraticuleMarker.svelte +3 -0
  63. package/dist/markers/geo/SphereMarker.svelte +3 -0
  64. package/dist/markers/hover/HoverMarker.svelte +7 -249
  65. package/dist/markers/hover/HoverMarker.svelte.d.ts +4 -27
  66. package/dist/markers/hull/HullMarker.svelte +3 -0
  67. package/dist/markers/image/ImageMarker.svelte +3 -0
  68. package/dist/markers/line/LineMarker.svelte +3 -0
  69. package/dist/markers/link/LinkMarker.svelte +3 -0
  70. package/dist/markers/raster/RasterMarker.svelte +3 -0
  71. package/dist/markers/rect/RectMarker.svelte +25 -17
  72. package/dist/markers/regression/RegressionMarker.svelte +3 -0
  73. package/dist/markers/rule/RuleMarker.svelte +15 -5
  74. package/dist/markers/text/TextFit.d.ts +44 -0
  75. package/dist/markers/text/TextFit.js +86 -0
  76. package/dist/markers/text/TextMarker.svelte +186 -90
  77. package/dist/markers/text/TextMarker.svelte.d.ts +2 -0
  78. package/dist/markers/tick/TickMarker.svelte +9 -3
  79. package/dist/markers/trail/TrailMarker.svelte +3 -0
  80. package/dist/markers/utils/BoxLabel.d.ts +58 -0
  81. package/dist/markers/utils/BoxLabel.js +175 -0
  82. package/dist/markers/utils/MarkerEvents.d.ts +23 -0
  83. package/dist/markers/utils/MarkerEvents.js +44 -0
  84. package/dist/markers/utils/MarkerLabel.svelte +33 -0
  85. package/dist/markers/utils/MarkerLabel.svelte.d.ts +10 -0
  86. package/dist/markers/utils/PointPixel.d.ts +37 -0
  87. package/dist/markers/utils/PointPixel.js +44 -0
  88. package/dist/markers/utils/RowStroke.d.ts +9 -21
  89. package/dist/markers/utils/RowStroke.js +10 -21
  90. package/dist/markers/utils/RowStyle.d.ts +26 -0
  91. package/dist/markers/utils/RowStyle.js +55 -0
  92. package/dist/markers/vector/VectorMarker.svelte +3 -0
  93. package/dist/markers/voronoi/VoronoiMarker.svelte +9 -5
  94. package/dist/markers/voronoi/VoronoiMeshMarker.svelte +3 -0
  95. package/dist/markers/waffle/WaffleMarker.svelte +9 -5
  96. package/dist/phases/Pipeline.d.ts +10 -8
  97. package/dist/phases/Pipeline.js +13 -9
  98. package/dist/phases/context/ContextPhase.d.ts +22 -0
  99. package/dist/phases/context/ContextPhase.js +23 -0
  100. package/dist/phases/context/RowContext.d.ts +35 -0
  101. package/dist/phases/context/RowContext.js +95 -0
  102. package/dist/phases/data/DataPhase.d.ts +4 -4
  103. package/dist/phases/data/DataPhase.js +53 -12
  104. package/dist/phases/hover/HoverPhase.d.ts +6 -7
  105. package/dist/phases/hover/HoverPhase.js +28 -15
  106. package/dist/phases/mapping/MappingPhase.d.ts +4 -4
  107. package/dist/phases/mapping/MappingPhase.js +4 -3
  108. package/dist/phases/markers/MarkerStyles.d.ts +26 -0
  109. package/dist/phases/markers/MarkerStyles.js +126 -0
  110. package/dist/phases/markers/MarkersPhase.d.ts +5 -5
  111. package/dist/phases/markers/MarkersPhase.js +8 -6
  112. package/dist/phases/scales/ScalesPhase.d.ts +4 -4
  113. package/dist/phases/scales/ScalesPhase.js +4 -4
  114. package/dist/phases/sharedScales/SharedScalesPhase.d.ts +2 -2
  115. package/dist/phases/sharedScales/SharedScalesPhase.js +2 -2
  116. package/dist/phases/statistics/MarkerGrouping.d.ts +0 -9
  117. package/dist/phases/statistics/MarkerGrouping.js +0 -16
  118. package/dist/phases/statistics/StatisticsPhase.js +1 -1
  119. package/dist/phases/styles/StylesPhase.d.ts +3 -3
  120. package/dist/phases/styles/StylesPhase.js +2 -2
  121. package/dist/phases/tooltip/TooltipPhase.d.ts +4 -4
  122. package/dist/phases/tooltip/TooltipPhase.js +10 -7
  123. package/dist/phases/transforms/Transforms.js +3 -1
  124. package/dist/phases/transforms/TransformsPhase.d.ts +3 -3
  125. package/dist/phases/transforms/TransformsPhase.js +60 -6
  126. package/dist/phases/transforms/methods/TreemapTransform.d.ts +28 -0
  127. package/dist/phases/transforms/methods/TreemapTransform.js +119 -0
  128. package/dist/plots/correlation/heatmap/defaults.d.ts +2 -2
  129. package/dist/plots/correlation/heatmap/defaults.js +23 -8
  130. package/dist/plots/correlation/heatmap/markers.d.ts +2 -10
  131. package/dist/plots/correlation/heatmap/markers.js +11 -37
  132. package/dist/plots/correlation/scatter/defaults.d.ts +2 -2
  133. package/dist/plots/correlation/scatter/defaults.js +9 -3
  134. package/dist/plots/correlation/scatter/markers.d.ts +3 -3
  135. package/dist/plots/correlation/scatter/markers.js +6 -5
  136. package/dist/plots/distribution/box/BoxSummaries.d.ts +17 -8
  137. package/dist/plots/distribution/box/BoxSummaries.js +90 -40
  138. package/dist/plots/distribution/box/defaults.d.ts +2 -2
  139. package/dist/plots/distribution/box/defaults.js +9 -6
  140. package/dist/plots/distribution/box/markers.d.ts +2 -2
  141. package/dist/plots/distribution/box/markers.js +3 -3
  142. package/dist/plots/distribution/density/defaults.d.ts +2 -2
  143. package/dist/plots/distribution/density/defaults.js +17 -1
  144. package/dist/plots/distribution/density/markers.d.ts +2 -2
  145. package/dist/plots/distribution/density/markers.js +4 -4
  146. package/dist/plots/distribution/histogram/defaults.d.ts +2 -2
  147. package/dist/plots/distribution/histogram/defaults.js +22 -27
  148. package/dist/plots/distribution/histogram/markers.d.ts +3 -12
  149. package/dist/plots/distribution/histogram/markers.js +21 -62
  150. package/dist/plots/distribution/pyramid/defaults.d.ts +2 -2
  151. package/dist/plots/distribution/pyramid/defaults.js +7 -4
  152. package/dist/plots/distribution/pyramid/markers.d.ts +2 -12
  153. package/dist/plots/distribution/pyramid/markers.js +16 -66
  154. package/dist/plots/distribution/violin/defaults.d.ts +2 -2
  155. package/dist/plots/distribution/violin/defaults.js +9 -7
  156. package/dist/plots/distribution/violin/markers.d.ts +2 -2
  157. package/dist/plots/distribution/violin/markers.js +4 -4
  158. package/dist/plots/evolution/area/defaults.d.ts +2 -2
  159. package/dist/plots/evolution/area/defaults.js +1 -1
  160. package/dist/plots/evolution/area/markers.d.ts +2 -2
  161. package/dist/plots/evolution/area/markers.js +4 -4
  162. package/dist/plots/evolution/line/defaults.d.ts +2 -2
  163. package/dist/plots/evolution/line/defaults.js +1 -1
  164. package/dist/plots/evolution/line/markers.d.ts +2 -2
  165. package/dist/plots/evolution/line/markers.js +3 -3
  166. package/dist/plots/evolution/slope/defaults.d.ts +2 -2
  167. package/dist/plots/evolution/slope/defaults.js +8 -4
  168. package/dist/plots/evolution/slope/markers.d.ts +2 -2
  169. package/dist/plots/evolution/slope/markers.js +3 -3
  170. package/dist/plots/evolution/sparkline/defaults.d.ts +2 -2
  171. package/dist/plots/evolution/sparkline/defaults.js +5 -2
  172. package/dist/plots/evolution/sparkline/markers.d.ts +2 -2
  173. package/dist/plots/evolution/sparkline/markers.js +3 -3
  174. package/dist/plots/map/geo/Core.svelte +3 -3
  175. package/dist/plots/map/geo/defaults.d.ts +2 -2
  176. package/dist/plots/map/geo/phases/data.d.ts +1 -1
  177. package/dist/plots/map/geo/phases/data.js +1 -1
  178. package/dist/plots/map/geo/phases/hover.d.ts +2 -2
  179. package/dist/plots/map/geo/phases/hover.js +3 -3
  180. package/dist/plots/map/geo/phases/markers.d.ts +2 -2
  181. package/dist/plots/map/geo/phases/markers.js +5 -4
  182. package/dist/plots/map/geo/phases/scales.d.ts +2 -2
  183. package/dist/plots/map/geo/phases/scales.js +2 -2
  184. package/dist/plots/part-of-a-whole/treemap/Plot.svelte +47 -0
  185. package/dist/plots/part-of-a-whole/treemap/Plot.svelte.d.ts +26 -0
  186. package/dist/plots/part-of-a-whole/treemap/defaults.d.ts +10 -0
  187. package/dist/plots/part-of-a-whole/treemap/defaults.js +183 -0
  188. package/dist/plots/ranking/bar/defaults.d.ts +2 -2
  189. package/dist/plots/ranking/bar/defaults.js +15 -9
  190. package/dist/plots/ranking/bar/markers.d.ts +4 -14
  191. package/dist/plots/ranking/bar/markers.js +45 -86
  192. package/dist/plots/ranking/bullet/defaults.d.ts +2 -2
  193. package/dist/plots/ranking/bullet/defaults.js +4 -4
  194. package/dist/plots/ranking/bullet/markers.d.ts +3 -3
  195. package/dist/plots/ranking/bullet/markers.js +11 -12
  196. package/dist/plots/ranking/cleveland/ClevelandMarkers.d.ts +3 -3
  197. package/dist/plots/ranking/cleveland/ClevelandMarkers.js +28 -23
  198. package/dist/plots/ranking/cleveland/defaults.d.ts +2 -2
  199. package/dist/plots/ranking/cleveland/defaults.js +7 -4
  200. package/dist/plots/ranking/dumbbell/defaults.d.ts +2 -2
  201. package/dist/plots/ranking/forest/defaults.d.ts +2 -2
  202. package/dist/plots/ranking/lollipop/defaults.d.ts +2 -2
  203. package/dist/types/configuration/styling.d.ts +31 -2
  204. package/dist/types/layout/context.d.ts +21 -0
  205. package/dist/types/layout/context.js +1 -0
  206. package/dist/types/layout/hover.d.ts +3 -0
  207. package/dist/types/layout/legend.d.ts +8 -1
  208. package/dist/types/layout/mapping.d.ts +12 -3
  209. package/dist/types/layout/scales.d.ts +6 -0
  210. package/dist/types/layout/styles/values.d.ts +8 -2
  211. package/dist/types/layout/tooltip.d.ts +11 -4
  212. package/dist/types/markers/axis/arrow.d.ts +2 -8
  213. package/dist/types/markers/axis/axisBasedMarkersConfig.d.ts +2 -1
  214. package/dist/types/markers/axis/band.d.ts +24 -0
  215. package/dist/types/markers/axis/band.js +1 -0
  216. package/dist/types/markers/axis/bar.d.ts +6 -10
  217. package/dist/types/markers/axis/cell.d.ts +5 -5
  218. package/dist/types/markers/axis/delaunayLink.d.ts +2 -2
  219. package/dist/types/markers/axis/hover.d.ts +60 -15
  220. package/dist/types/markers/axis/rect.d.ts +4 -8
  221. package/dist/types/markers/axis/rule.d.ts +2 -16
  222. package/dist/types/markers/axis/tick.d.ts +2 -2
  223. package/dist/types/markers/axis/voronoi.d.ts +2 -2
  224. package/dist/types/markers/axis/waffle.d.ts +4 -3
  225. package/dist/types/markers/basic/dot.d.ts +2 -2
  226. package/dist/types/markers/basic/text.d.ts +56 -14
  227. package/dist/types/markers/channels/commonMarkerConfig.d.ts +8 -1
  228. package/dist/types/markers/channels/commonMarkerConfigWithArea.d.ts +1 -2
  229. package/dist/types/markers/channels/commonMarkerConfigWithLabel.d.ts +10 -0
  230. package/dist/types/markers/channels/commonMarkerConfigWithLabel.js +1 -0
  231. package/dist/types/markers/channels/commonMarkerEvents.d.ts +17 -0
  232. package/dist/types/markers/channels/commonMarkerEvents.js +13 -0
  233. package/dist/types/markers/common.d.ts +1 -0
  234. package/dist/types/markers/common.js +1 -0
  235. package/dist/types/markers/geo/contour.d.ts +2 -1
  236. package/dist/types/markers/geo/graticule.d.ts +2 -1
  237. package/dist/types/markers/geo/link.d.ts +2 -1
  238. package/dist/types/markers/geo/sphere.d.ts +2 -1
  239. package/dist/types/markers/geo/vector.d.ts +2 -1
  240. package/dist/types/phases/context/phase.d.ts +7 -0
  241. package/dist/types/phases/context/phase.js +1 -0
  242. package/dist/types/phases/data/phase.d.ts +7 -2
  243. package/dist/types/phases/hover/phase.d.ts +10 -5
  244. package/dist/types/phases/index.d.ts +2 -1
  245. package/dist/types/phases/kind.d.ts +11 -8
  246. package/dist/types/phases/mapping/phase.d.ts +2 -2
  247. package/dist/types/phases/markers/phase.d.ts +3 -3
  248. package/dist/types/phases/scales/phase.d.ts +4 -4
  249. package/dist/types/phases/stage.d.ts +3 -3
  250. package/dist/types/phases/state.d.ts +8 -1
  251. package/dist/types/phases/statistics/phase.d.ts +2 -1
  252. package/dist/types/phases/styles/phase.d.ts +3 -2
  253. package/dist/types/phases/transforms/phase.d.ts +13 -2
  254. package/dist/types/plots/constants.d.ts +17 -19
  255. package/dist/types/plots/correlation/heatmap/props.d.ts +3 -3
  256. package/dist/types/plots/correlation/heatmap/state.d.ts +2 -2
  257. package/dist/types/plots/correlation/scatter/props.d.ts +3 -3
  258. package/dist/types/plots/correlation/scatter/state.d.ts +2 -2
  259. package/dist/types/plots/data/common.d.ts +19 -6
  260. package/dist/types/plots/data/geo.d.ts +1 -1
  261. package/dist/types/plots/distribution/box/props.d.ts +25 -3
  262. package/dist/types/plots/distribution/box/state.d.ts +6 -17
  263. package/dist/types/plots/distribution/density/props.d.ts +3 -11
  264. package/dist/types/plots/distribution/density/state.d.ts +2 -2
  265. package/dist/types/plots/distribution/histogram/props.d.ts +16 -11
  266. package/dist/types/plots/distribution/histogram/state.d.ts +2 -2
  267. package/dist/types/plots/distribution/pyramid/props.d.ts +3 -3
  268. package/dist/types/plots/distribution/pyramid/state.d.ts +2 -2
  269. package/dist/types/plots/distribution/violin/props.d.ts +4 -3
  270. package/dist/types/plots/distribution/violin/state.d.ts +2 -2
  271. package/dist/types/plots/evolution/area/props.d.ts +3 -3
  272. package/dist/types/plots/evolution/area/state.d.ts +2 -2
  273. package/dist/types/plots/evolution/line/props.d.ts +3 -3
  274. package/dist/types/plots/evolution/line/state.d.ts +2 -2
  275. package/dist/types/plots/evolution/slope/state.d.ts +2 -2
  276. package/dist/types/plots/evolution/sparkline/state.d.ts +2 -2
  277. package/dist/types/plots/map/geo/state.d.ts +1 -1
  278. package/dist/types/plots/part-of-a-whole/treemap/props.d.ts +29 -0
  279. package/dist/types/plots/part-of-a-whole/treemap/props.js +1 -0
  280. package/dist/types/plots/part-of-a-whole/treemap/state.d.ts +6 -0
  281. package/dist/types/plots/part-of-a-whole/treemap/state.js +1 -0
  282. package/dist/types/plots/props.d.ts +10 -4
  283. package/dist/types/plots/ranking/bar/props.d.ts +3 -3
  284. package/dist/types/plots/ranking/bar/state.d.ts +2 -2
  285. package/dist/types/plots/ranking/bullet/state.d.ts +2 -2
  286. package/dist/types/plots/ranking/cleveland/props.d.ts +3 -3
  287. package/dist/types/plots/ranking/cleveland/state.d.ts +2 -2
  288. package/dist/types/plots/ranking/dumbbell/props.d.ts +3 -3
  289. package/dist/types/plots/ranking/dumbbell/state.d.ts +2 -2
  290. package/dist/types/plots/ranking/forest/props.d.ts +3 -3
  291. package/dist/types/plots/ranking/forest/state.d.ts +2 -2
  292. package/dist/types/plots/ranking/lollipop/props.d.ts +3 -3
  293. package/dist/types/plots/ranking/lollipop/state.d.ts +2 -2
  294. package/dist/types/plots/styling.d.ts +24 -0
  295. package/dist/types/transforms/index.d.ts +3 -1
  296. package/dist/types/transforms/treemap.d.ts +32 -0
  297. package/dist/types/transforms/treemap.js +5 -0
  298. package/dist/utils/color/ColorTones.d.ts +19 -0
  299. package/dist/utils/color/ColorTones.js +64 -0
  300. package/dist/utils/color/CssColor.d.ts +14 -5
  301. package/dist/utils/color/CssColor.js +69 -27
  302. package/dist/utils/color/index.d.ts +4 -0
  303. package/dist/utils/color/index.js +4 -0
  304. package/dist/utils/grouping.d.ts +18 -1
  305. package/dist/utils/grouping.js +31 -0
  306. package/docs/concepts.md +3 -2
  307. package/docs/legend.md +8 -5
  308. package/docs/markers.md +110 -28
  309. package/docs/plots/evolution/line.md +1 -1
  310. package/docs/plots/evolution/slope.md +1 -1
  311. package/docs/plots/part-of-a-whole/treemap.md +103 -0
  312. package/docs/plots/ranking/bar.md +2 -1
  313. package/docs/plots/ranking/cleveland.md +1 -1
  314. package/docs/plots.md +21 -20
  315. package/docs/scales.md +3 -0
  316. package/docs/state.md +34 -1
  317. package/docs/styles-and-segments.md +20 -19
  318. package/docs/theming.md +6 -12
  319. package/docs/tooltip-and-hover.md +81 -3
  320. package/docs/transforms-and-statistics.md +17 -16
  321. package/examples/LineDates.svelte +1 -1
  322. package/examples/ResponsiveLine.svelte +3 -1
  323. package/examples/Treemap.svelte +13 -0
  324. package/examples/TreemapHover.svelte +25 -0
  325. package/examples/ValueLabels.svelte +1 -1
  326. package/examples/datasets/economic-activity.ts +40 -0
  327. package/examples/datasets/index.ts +1 -0
  328. package/llms-full.txt +11 -9
  329. package/llms.txt +4 -1
  330. package/package.json +3 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,62 @@
2
2
 
3
3
  All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project adheres to [Semantic Versioning](https://semver.org/).
4
4
 
5
+ ## [1.18.0] - 2026-11-09
6
+
7
+ ### Added
8
+
9
+ - A `band` marker: the band of a category on a band scale, across the whole of the other axis - `{ type: 'band', axis: 'x', value: 'Salta' }`. `value` is a category or a list of them, or with `data` a field key or a function of the row; rows that name the same category draw one band. `slice` fills part of it, as the fractions of its width left out at each end (a grouped bar's series), and a band several rows share fills what all of their slices do. `styles` take `AreaStyle`, each field a value or a function of the row, over the configuration's new `band` (`{ fill: '#94a3b8', fillOpacity: 0.25 }`). It takes the pointer only with a handler of its own, and draws nothing on an axis that is not a band scale.
10
+ - The `hover` marker's `active` and `others` restyle the shapes themselves: the ones the hover matches (by its `strategy`) take `active`, every other one `others`, while the hover is on - `fill`, `fillOpacity`, `stroke`, `strokeWidth`, `strokeOpacity` and `strokeDasharray`, each a value or a function of the row. `markers={[{ type: 'hover', active: { fillOpacity: 1 }, others: { fillOpacity: 0.3 } }]}` lightens the hovered tile of a `TreemapPlot` and fades the rest, and does the same on the cells of a `HeatmapPlot`, the bars of a `BarPlot`, a `BulletPlot` and a `PyramidPlot`, a `HistogramPlot`'s bins, a `ScatterPlot`'s dots and the dots of the Cleveland family, whose own shapes are linked to the hover. On a dot they are its `dotFill`, `dotStroke`... The shape is restyled, not covered: its label stays on top, and one with no `fill` of its own is written in the color that reads best on the new one. They go over `styles` and `segments`; a series the legend dims keeps its dimmed fill and opacities.
11
+ - The `hover` marker's `back` and `front`: the markers it draws behind the plot's shapes and in front of them - any marker but another `hover`, a `component` too, with its styles and events. They draw the hovered points, each a row with its `x`, `y`, `label` (written as the marker's number fields or `format` ask), `series`, `color`, `areaInset` and `row`, unless they have `data` of their own, and what they leave unset comes from the hover: `x` and `y`, a `rule`'s and a `band`'s `value` (and a band's `slice`), a `text`'s `text`, the configuration's `hover` look (`rule`, `dot`, `font`, `area`) and the series color of a `dot` and a `text`. `points: 'active'` draws only the point under the pointer, and a function of the point some of them. On a grouped bar plot each is drawn in its series' slice of the band.
12
+ - Each plot kind has a hover of its own that an author's `hover` marker is laid over: `active` and `others` field by field, `back` and `front` replaced when set (`back: []` draws nothing behind). `LinePlot`, `AreaPlot` and `DensityPlot` draw a crosshair along each axis their strategy matches along, and a dot and the value on each point, as the marker did; `ScatterPlot` a crosshair through the point and its value; `SlopePlot` and the Cleveland family (`ClevelandPlot`, `DumbbellPlot`, `ForestPlot`, `LollipopPlot`) a rule along the value axis, a dot and the value; `BarPlot`, `BulletPlot`, `BoxPlot`, `ViolinPlot` and `PyramidPlot` the hovered category's band behind their shapes; `HistogramPlot` the hovered bin's span; `SparklinePlot` a dot; `TreemapPlot` and `HeatmapPlot` only outline the hovered tile or cell, in the configuration's new `hover.active` (`{ stroke: '#111827', strokeWidth: 2 }`).
13
+ - The hover's point under the pointer is the one nearest it of those the hover reaches: a crosshair at it, and `points: 'active'`, follow the pointer up and down a category from one series' point to another's.
14
+ - A row context: what a plot knows of each row it draws, worked out once as it reads its data and kept on the row - its `series`, its `x` and `y` (its own values, not a stack's running total, else where the transforms put it), the `value` it shows, the `row` itself, and what the plot kind works out for it: a `TreemapPlot` tile's `name`, `path` and `share`; a `HistogramPlot` bin's `count`, `from` and `to`; a `BoxPlot` or `ViolinPlot` value's box (`category`, `min`, `p25`, `median`, `p75`, `max`, `count`, `outliers`); a `DensityPlot` point's estimate as its `value`; a `HeatmapPlot` cell's color value. `tooltip.format`, `styles.values.format`, the `hover` marker's points (`point.context`, in its `format` and its `back` and `front` markers) and `usePlot().contextOf(row)` all read it, and `RowContext.of(row)` reads it anywhere, from a row or a copy of it. A plot kind adds its own with a `context` function in its defaults. `PlotRowContext`, `KindRowContext`, `TreemapRowContext`, `HistogramRowContext` and `BoxRowContext` are exported.
15
+ - A `DensityPlot`'s hovered point and its tooltip read as its estimated density, with three decimals.
16
+ - What a plot's hover draws follows the strategy in force as it is shown: a composer's `hover.strategy` changed while the plot is on screen (a scrolly step) changes the crosshair it draws.
17
+ - A marker's `hover` takes `'trigger'` (a hit area of the plot's hover, what `true` was) and `'style'` (its shapes take the hover marker's `active` and `others`); `true` does both. `HoverMarkerConfig`, `HoverShapeStyle` and `HoverLayerMarker` are exported.
18
+ - `examples/TreemapHover.svelte`, a _Configuration / State_ story reading a histogram's row context, and a `Layout/Hover` section of stories: each plot kind's own hover, the strategies (one changed while a plot is shown), the number fields, the scope, `active` and `others`, `back` and `front`.
19
+
20
+ ### Changed
21
+
22
+ - **Breaking:** `styles.values.format` is `(value, number, context)`, as a tooltip's `format`: the series is `context.series`, the labelled row `context.row`. `format: (v, name) => `${name}: ${v}`` is `format: (v, _number, { series }) => `${series}: ${v}``.
23
+ - **Breaking:** a `HistogramPlot`'s tooltip rows are its bins as they are, without the `count`, `from`, `to` and `group` they had: those are in the `context`, a `tooltip.format`'s third argument (`group` is `series`).
24
+ - A tooltip's `context` holds the row's `x`, `y`, `value` and `row` along with its `series`, and a `TreemapPlot`'s the tile's `name`, `path` and `value` along with its `share`. `TreemapTooltipContext` is `TreemapRowContext`.
25
+ - **Breaking:** the `hover` marker's `ruleX`, `ruleY`, `areaX`, `areaY`, `showLabels`, `rule`, `area`, `dot` and `text` are gone: what it draws is its `back` and `front` markers. `ruleX: false` is `back: []`; `ruleY: true` a `{ type: 'rule', axis: 'y', points: 'active' }` in `back`; `areaX: true` a `{ type: 'band', axis: 'x' }` in `back`; `showLabels: false` is `front: [{ type: 'dot' }]`; `rule`, `area`, `dot` and `text` are the `styles` of those markers. `text.textAnchor: 'outside'` is two `text` markers, each kept to one side of zero by `points`. On every plot but `LinePlot`, `AreaPlot` and `DensityPlot`, `{ type: 'hover' }` draws something else than the crosshair, dot and label it drew: see the hover each plot kind has of its own, above.
26
+ - A marker with `hover: true` (or `'trigger'`) hovers the row of the shape under the pointer, not the first of its rows.
27
+ - A series the legend dims (`mode: 'dim'`) stays hoverable: it is matched and shows in the tooltip. Only one it hides, omits or rescales away is out of the hover.
28
+
29
+ ## [1.17.0] - 2026-11-06
30
+
31
+ ### Added
32
+
33
+ - A `rect`, `cell`, `bar` or `waffle` marker takes a `label`: a text in the middle of each shape, with every option of a `text` marker, fitted to the shape - written smaller, down to `minFontSize`; then cut short with an ellipsis on as many lines as it holds; then as its `fallback`, a value alone, say; and left out when nothing fits. It takes no pointer from the shape, unless it has a handler of its own. `anchor` puts it against an edge or in a corner, and `outside` beyond the edge, where `fitMargins` makes room for it. A `text` marker takes the same `fit`, with a box of its own.
34
+ - A `treemap` transform, for a `rect` marker on any plot kind: it lays the rows out as tiles in the unit square with d3-hierarchy - a tile per distinct path of `levels`, its area the sum of its rows' `value` - and gives `x1`/`x2`/`y1`/`y2` (and `x`/`y` at each tile's centre for a `text`). `tile` picks how a rectangle is split (`'squarify'`, `'binary'`, `'slice'`, `'dice'`, `'sliceDice'`) and `aspect` the shape of the box the tiles fill.
35
+ - Every marker takes handlers for the pointer (`onclick`, `onpointerenter`, `onpointerleave`, `onpointermove`...), called with the event and the row of the shape. They are the props svelteplot documents on all its marks, passed on by every marker that draws one (not `brush`, `hover`, `inset`, `delta` or the map's `features`); svelteplot's code wires them up on `Rect`, `Bar`, `Cell`, `Area`, `Arrow`, `Dot`, `Trail`, `Vector`, `Line`, `Link`, `DelaunayLink` and `Voronoi` so far, and the rest will follow it. `rect`'s `styles.borderRadius` rounds its corners.
36
+ - A `text` marker takes the pointer handlers every marker takes (`onclick`, `onpointerenter`...) in place of its own `onPointerEnter` and `onPointerLeave`, which are gone.
37
+ - The `styles` of the markers that draw a shape per row - `rect`, `bar`, `cell`, `waffle`, `dot`, `tick`, `rule`, `arrow`, `voronoi` and `delaunayLink`, and `text` for `fill`, `fillOpacity`, `stroke`, `strokeWidth`, `fontWeight` and `fontStyle` - take a function of the row in place of a value: `styles: { fillOpacity: (row) => (row.selected ? 0.55 : 0.12) }`. A string names a field of the rows instead: a number such as `strokeWidth` or `fillOpacity` always, a color when the rows have a field of that name. A color or an opacity a function returns is drawn as it is.
38
+ - `TreemapPlot`: a tile per row, its area its `value`, nested by `grouping` and laid out with `d3-hierarchy` (a `treemap` entry in `transforms` sets `tile`: `'squarify'`, `'binary'`, `'slice'`, `'dice'` or `'sliceDice'`). `grouping` is the whole path of a tile (`'sector.branch'`) (the last level names it, rows with the same path are one tile, so `grouping: 'sector'` alone is a tile per sector) and its outermost level colors the tiles and fills the legend. The tiles are the `treemap` transform drawn as `rect` markers with a `label`. `segments` can be keyed by the path of a tile (`'Tertiary.Finance'`), the most specific winning, and `tooltip.format(row, number, context)` gets the tile's `share` (0 to 100) in its `context`. A tile is labelled with its name over its share of the whole, as `styles.values` asks, and the label is fitted to the tile: at a smaller font size first, then the name cut short with an ellipsis, then the share alone, then nothing. Hovering a tile matches it alone. `treemap` in the configuration sets the line between tiles and the label's color, size and room.
39
+ - `grouping` takes fields joined by dots (`'region.sex'`): the levels of one grouping, outermost first. A plot that nests its rows (`TreemapPlot`) nests by them; any other splits its rows by the combination of the levels, a series named `'CABA.F'`. A dotted name is a field when the rows have one by that name.
40
+ - `DataProps` is now `DualAxisDataProps`, one of a family by the axes a plot has: `SingleAxisDataProps` (`x` or `y` alone, a histogram's or a density's) and `NonAxisDataProps` (no position channels, a treemap's), which the other two extend. Each takes the channels a plot cannot draw without as a second parameter.
41
+ - `scales.color.depth`: with a `grouping` of several levels, the level the colors reach - each outermost value keeps its categorical color and the values under it, down to that level, take tones of it. A treemap colors its tiles so, and any other plot the series it splits by every level. `ColorTones` (`colorTones`, `hierarchicalColors`) builds the tones, for any plot of a hierarchy.
42
+ - A legend's `disabled: { mode: 'rescale' }`: the series is removed and the parts left of a whole are the new 100% - a stack's categories are scaled back up to their totals, a treemap's tiles laid out and given their shares anew. `'omit'` now leaves a treemap's other tiles in their place and with their share of the whole.
43
+ - The legend makes words of each level of a series grouped by several (`'Americas.Argentina'`).
44
+ - A `value` channel: what a row amounts to as a part of a whole. `TreemapPlot` sizes its tiles by it; the other plots ignore it.
45
+ - `tooltip.format` gets a third argument, `context`: what the plot knows of the row beyond its fields - its `series`, and what its kind adds (a treemap's `share`).
46
+ - A marker's `strokeDasharray` takes a named line style - `'solid'`, `'dashed'`, `'dotted'`, `'dashdot'` - as well as an SVG dash pattern.
47
+ - Every marker takes `hover: true`, which makes it a hit area of the plot's hover: the pointer over any of its shapes hovers its rows.
48
+ - A label inside its shape (`rect`, `cell`, `bar`, `waffle`, and the value labels of every plot written in a shape) with no `fill` of its own is written in the color that reads best on the shape, as it is seen - blended with the plot's background as far as its `fillOpacity` lets it through. It picks from the configuration's new `text.label.contrast` (`['#ffffff', '#111827']`), and takes white or black instead when neither reaches WCAG AA (4.5:1).
49
+ - `CssColor.alpha` and `CssColor.composite`: a color's opacity, and the opaque color it is seen as over a backdrop. `CssColor.contrastText` (and `contrastTextColor`) takes a `minRatio`, WCAG AA by default.
50
+
51
+ ### Changed
52
+
53
+ - **Breaking:** `continuous.labelColor` and the `--dct-heat-text`, `--dct-heat-min` and `--dct-heat-max` CSS variables are gone: a heatmap's value labels contrast with each cell (`text.label.contrast`), and its ramp is the default continuous one, `continuous.min`/`max` or `continuous.scheme`, set with `setConfiguration`. No style read the variables.
54
+ - The configuration's `--dct-*` CSS variables are set once on the document root (`:where(:root)`), not on each figure, so a variable set on a wrapping element overrides them, as the theming docs say. `cssVarsRule` writes them as that rule.
55
+ - The axes, and what a plot writes in their ink (value labels outside their shape, a violin's box, a bullet's target, a Cleveland connector, a map's outlines), take `--dct-axis-color`; the timeline's current step takes `--dct-timeline-active`. Both fall back to the configuration.
56
+ - `CssColor.contrastText` never returns a candidate under its `minRatio` (WCAG AA, 4.5:1) when white or black does better, and its luminance follows sRGB's own threshold (0.04045).
57
+ - The value labels of `BarPlot`, `BulletPlot`, `PyramidPlot`, `HistogramPlot` and `HeatmapPlot` are the `label` of their own shapes (`bar`, `rect`, `cell`), so they fit them: a label that does not fit is written smaller, cut short, or left out. On those plots `styles.values.anchor` takes the anchors of a shape's label - `'middle'`, `'top'`, `'bottom'`, `'left'`, `'right'`, the corners (`'top-left'`...), and `'tip'` and `'base'`, the end of a bar away from zero and the one on it, on either side of zero - and `'outside'`, beyond the tip, which stays the default. `'start'` and `'end'` are gone from them (they were the top and bottom of the page, or the left and right, whatever the sign); the plots that label a point or the end of a line keep them. `fontStyle.dx` and `dy` now push a label from its anchor rather than replace its gap. A label with `hoverIsolate` still dims the other series and a dimmed series dims its labels. `LabelAnchor` is one type for the anchors of a text marker's `frameAnchor`, a shape's `label` and the plots' `anchor`.
58
+
59
+ - Everything a marker is drawn with now goes in its `styles`, which takes a function of the row for any field: the `stroke`, `strokeWidth` and `strokeOpacity` of `rule` and `arrow` (they took a field key or a function beside `styles`), the `fill` and `fillOpacity` of `text` and the `fill` of `cell`, and the insets - `inset`, `insetLeft`, `insetRight`, `insetTop` and `insetBottom` of `rect`, `bar`, `cell` and `rule`, `inset`, `insetStart` and `insetEnd` of `arrow`. The field keys they took stay, now in `styles`: `styles: { stroke: 'color' }`.
60
+
5
61
  ## [1.16.0] - 2026-11-04
6
62
 
7
63
  ### Fixed
@@ -0,0 +1,14 @@
1
+ <script lang="ts">
2
+ import { getConfiguration, configToCssVars, cssVarsRule } from './config.svelte';
3
+
4
+ /**
5
+ * The configuration's `--dct-*` custom properties, as one rule on the document root rather than on each element
6
+ * that reads them: an author's own rule - on a wrapping element too - overrides them.
7
+ */
8
+ const rule = $derived(cssVarsRule(configToCssVars(getConfiguration())));
9
+ </script>
10
+
11
+ <svelte:head>
12
+ <!-- eslint-disable-next-line svelte/no-at-html-tags -->
13
+ {@html `<style data-dct-config>${rule}</style>`}
14
+ </svelte:head>
@@ -0,0 +1,3 @@
1
+ declare const ConfigVars: import("svelte").Component<Record<string, never>, {}, "">;
2
+ type ConfigVars = ReturnType<typeof ConfigVars>;
3
+ export default ConfigVars;
@@ -8,5 +8,10 @@ export declare function setConfiguration(patch: PlotStylesConfigInput): PlotStyl
8
8
  export declare function resetConfiguration(): void;
9
9
  /** Flatten a config into the `--dct-*` custom properties used by the styles. */
10
10
  export declare function configToCssVars(c: PlotStylesConfig): Record<string, string>;
11
+ /**
12
+ * A CSS-vars record as one rule on the document root, with no specificity (`:where(:root)`): every element inherits
13
+ * them, and any rule of the author's that sets one - on a wrapping element too - wins over it.
14
+ */
15
+ export declare function cssVarsRule(vars: Record<string, string>): string;
11
16
  /** Serialize a CSS-vars record into a `style` attribute string. */
12
17
  export declare function cssVarsStyle(vars: Record<string, string>): string;
@@ -61,7 +61,7 @@ export const DEFAULT_CONFIG = {
61
61
  palette: Palette.resolve('tableau10'),
62
62
  symbols: ['circle', 'square', 'triangle', 'diamond', 'star', 'cross'],
63
63
  // A light tint of the palette's first color up to the color itself.
64
- continuous: { min: '#eaf0f6', max: '#4e79a7', labelColor: '#111827', opacityRange: [0.2, 1] },
64
+ continuous: { min: '#eaf0f6', max: '#4e79a7', opacityRange: [0.2, 1] },
65
65
  margins: { top: 'auto', right: 'auto', bottom: 'auto', left: 'auto' },
66
66
  frameClip: { tolerance: 2 },
67
67
  // ── Features ────────────────────────────────────────────────────────────────
@@ -161,7 +161,8 @@ export const DEFAULT_CONFIG = {
161
161
  rule: { stroke: '#e6580d', strokeOpacity: 0.35, strokeWidth: 1.5, strokeDasharray: '4 4' },
162
162
  dot: { dotRadius: 5, dotFill: 'currentColor' },
163
163
  font: { fill: 'currentColor', fontSize: 12, dy: -18 },
164
- area: { fill: '#94a3b8', fillOpacity: 0.4 }
164
+ area: { fill: '#94a3b8', fillOpacity: 0.4 },
165
+ active: { stroke: '#111827', strokeWidth: 2 }
165
166
  },
166
167
  facet: {
167
168
  indicator: {
@@ -179,6 +180,13 @@ export const DEFAULT_CONFIG = {
179
180
  disabledOpacity: 0.3
180
181
  }
181
182
  },
183
+ treemap: {
184
+ stroke: '#ffffff',
185
+ strokeWidth: 1.5,
186
+ fontSize: 12,
187
+ padding: 4,
188
+ lineHeight: 1.2
189
+ },
182
190
  timeline: {
183
191
  axisColor: 'currentColor',
184
192
  activeColor: '#4e79a7',
@@ -240,7 +248,7 @@ export const DEFAULT_CONFIG = {
240
248
  labelFontSize: 11,
241
249
  labelGap: 4
242
250
  },
243
- // Beside a vertical delta (taken on x), above a horizontal one (on y).
251
+ band: { fill: '#94a3b8', fillOpacity: 0.25 },
244
252
  delta: {
245
253
  text: {
246
254
  x: { dx: 12, dy: 0, lineAnchor: 'middle', textAnchor: 'start' },
@@ -248,6 +256,7 @@ export const DEFAULT_CONFIG = {
248
256
  }
249
257
  },
250
258
  text: {
259
+ label: { gap: 4, padding: 4, minFontSize: 8, minLetters: 3, contrast: ['#ffffff', '#111827'] },
251
260
  declutter: {
252
261
  elbowGap: 10,
253
262
  laneStep: 7,
@@ -363,9 +372,6 @@ export function configToCssVars(c) {
363
372
  '--dct-divider-style': c.divider.style,
364
373
  '--dct-divider-margin': c.divider.margin,
365
374
  '--dct-row-gap': c.chrome.rowGap,
366
- '--dct-heat-min': c.continuous.min,
367
- '--dct-heat-max': c.continuous.max,
368
- '--dct-heat-text': c.continuous.labelColor,
369
375
  '--dct-axis-color': c.axis.color,
370
376
  '--dct-legend-font': c.legend.font,
371
377
  '--dct-legend-size': c.legend.size,
@@ -440,6 +446,14 @@ export function configToCssVars(c) {
440
446
  '--dct-player-toggle-pad': c.timeline.player.toggle.padding
441
447
  };
442
448
  }
449
+ /**
450
+ * A CSS-vars record as one rule on the document root, with no specificity (`:where(:root)`): every element inherits
451
+ * them, and any rule of the author's that sets one - on a wrapping element too - wins over it.
452
+ */
453
+ export function cssVarsRule(vars) {
454
+ // A value never closes the `<style>` it is written in.
455
+ return `:where(:root){${cssVarsStyle(vars).replace(/</g, '')}}`;
456
+ }
443
457
  /** Serialize a CSS-vars record into a `style` attribute string. */
444
458
  export function cssVarsStyle(vars) {
445
459
  return Object.entries(vars)
@@ -9,7 +9,7 @@ export const DARK_THEME = {
9
9
  caption: { color: '#94a3b8' },
10
10
  legend: { gap: '0.5rem 1.5rem', swatchSize: '1rem' },
11
11
  palette: ['#38bdf8', '#f472b6', '#a3e635', '#fbbf24', '#c084fc'],
12
- continuous: { min: '#1e293b', max: '#38bdf8', labelColor: '#e5e7eb' },
12
+ continuous: { min: '#1e293b', max: '#38bdf8' },
13
13
  axis: { color: '#94a3b8', fontSize: 13, xTickSize: 6, yTickSize: 6 },
14
14
  tooltip: { background: '#e5e7eb', color: '#0f172a' },
15
15
  facet: {
@@ -6,7 +6,7 @@ export const EDITORIAL_THEME = {
6
6
  subtitle: { color: '#8a6d3b', size: '1.05rem' },
7
7
  caption: { color: '#8a6d3b' },
8
8
  palette: ['#9b2226', '#606c38', '#6a4c93', '#ee9b00', '#005f73'],
9
- continuous: { min: '#fff3e0', max: '#bb3e03', labelColor: '#2b2118' },
9
+ continuous: { min: '#fff3e0', max: '#bb3e03' },
10
10
  axis: { color: '#8a6d3b', fontSize: 13, xTickSize: 6, yTickSize: 6 },
11
11
  line: { strokeWidth: 5, dotRadius: 5 },
12
12
  timeline: { activeColor: '#bb3e03', axisColor: '#8a6d3b', thickness: 60 },
package/dist/index.d.ts CHANGED
@@ -15,15 +15,21 @@ export { default as PyramidPlot } from './plots/distribution/pyramid/Plot.svelte
15
15
  export { default as ScatterPlot } from './plots/correlation/scatter/Plot.svelte';
16
16
  export { default as SlopePlot } from './plots/evolution/slope/Plot.svelte';
17
17
  export { default as SparklinePlot } from './plots/evolution/sparkline/Plot.svelte';
18
+ export { default as TreemapPlot } from './plots/part-of-a-whole/treemap/Plot.svelte';
18
19
  export { default as ViolinPlot } from './plots/distribution/violin/Plot.svelte';
19
20
  export { default as PlotComposer } from './layout/composer/PlotComposer.svelte';
20
21
  export { default as GridCell } from './layout/grid/GridCell.svelte';
21
22
  export { default as Plot } from './layout/plot/Plot.svelte';
22
23
  export { default as BasePlotLayout } from './layout/base/BasePlotLayout.svelte';
23
24
  export { usePlot, useFigure } from './layout/plot/usePlot';
25
+ export { RowContext } from './phases/context/RowContext';
26
+ export type { PlotRowContext, KindRowContext } from './types/layout/context';
27
+ export type { ContextStageOptions } from './types/phases/context/phase';
28
+ export type { BoxRowContext, BoxSummary } from './types/plots/distribution/box/props';
29
+ export type { HistogramRowContext } from './types/plots/distribution/histogram/props';
24
30
  export type { PublicPlotContext, PublicFigureContext, PublicHover, PublicPlotHover, PublicLegend, PublicTimeline } from './layout/plot/PublicPlotContext';
25
31
  export { argentinaBicontinental } from './layout/coordinates/projections/argentina';
26
- export { setConfiguration, getConfiguration, resetConfiguration, configToCssVars, cssVarsStyle, DEFAULT_CONFIG } from './configuration/config.svelte';
32
+ export { setConfiguration, getConfiguration, resetConfiguration, configToCssVars, cssVarsStyle, cssVarsRule, DEFAULT_CONFIG } from './configuration/config.svelte';
27
33
  export { THEMES } from './configuration/themes';
28
34
  export { SYSTEM_FONT } from './configuration/fonts';
29
35
  export type { ThemeName } from './configuration/themes';
@@ -33,10 +39,12 @@ export { Margins } from './layout/margins/Margins';
33
39
  export { resolveOpacityScale } from './utils/OpacityScale';
34
40
  export { resolveSymbolScale } from './utils/SymbolScale';
35
41
  export { Statistics } from './phases/statistics/Statistics';
36
- export type { AxisValue, ChannelValue, ChannelName, AxisChannelName, IndependentChannelName, SizeChannelName, ChannelAccessors } from './types/layout/mapping';
42
+ export type { AxisValue, ChannelValue, ChannelName, AxisChannelName, IndependentChannelName, SizeChannelName, ChannelAccessors, GroupingAccessor } from './types/layout/mapping';
37
43
  export type { AxisScale, AxisBasedScalesConfig, ChannelScalesConfig } from './types/layout/scales';
38
44
  export type { NumberDisplay } from './types/layout/numbers';
39
- export type { Accessor, Series, SeriesProps, DataProps } from './types/plots/data/common';
45
+ export type { TreemapPlotProps, TreemapRowContext, TreemapTooltipContext } from './types/plots/part-of-a-whole/treemap/props';
46
+ export type { TreemapTile } from './types/transforms/treemap';
47
+ export type { Accessor, Series, SeriesProps, NonAxisDataProps, SingleAxisDataProps, DualAxisDataProps } from './types/plots/data/common';
40
48
  export type { BasePlotProps, PlotCoreProps, PlotChromeProps, FigureBoxProps, SegmentsConfig, ScalesConfig, MarginConfig, TooltipConfig, HoverConfig } from './types/plots/props';
41
49
  export type { AxisBasedStylesConfig, ConnectorBasedStylesConfig, BulletStylesConfig, GapsAwarePlotStylesConfig, CurveAwarePlotStylesConfig, GeoStylesConfig, GeoTileLayerConfig } from './types/layout/styles';
42
50
  export type { GapsConfig } from './types/plots/gaps';
@@ -44,7 +52,7 @@ export type { LineSegmentStyle, BarSegmentStyle, CellSegmentStyle, GeoSegmentSty
44
52
  export type { Range, Area, Segment } from './types/plots/segments/config';
45
53
  export type { SymbolType } from './types/plots/constants';
46
54
  export type { FontStyle, StrokeStyle, DotStyle, AreaStyle } from './types/plots/styling';
47
- export type { AxisBasedMarkersConfig, BrushSelection } from './types/markers/common';
55
+ export type { AxisBasedMarkersConfig, BrushSelection, HoverMarkerConfig, HoverShapeStyle, HoverLayerMarker } from './types/markers/common';
48
56
  export type { StatisticConfig } from './types/layout/statistics';
49
57
  export type * from './types/transforms';
50
58
  export type { GeoFeature, GeoJsonInput, GeoDataProps, Topology } from './types/plots/data/geo';
package/dist/index.js CHANGED
@@ -18,6 +18,7 @@ export { default as PyramidPlot } from './plots/distribution/pyramid/Plot.svelte
18
18
  export { default as ScatterPlot } from './plots/correlation/scatter/Plot.svelte';
19
19
  export { default as SlopePlot } from './plots/evolution/slope/Plot.svelte';
20
20
  export { default as SparklinePlot } from './plots/evolution/sparkline/Plot.svelte';
21
+ export { default as TreemapPlot } from './plots/part-of-a-whole/treemap/Plot.svelte';
21
22
  export { default as ViolinPlot } from './plots/distribution/violin/Plot.svelte';
22
23
  // ── Composition ─────────────────────────────────────────────────────────────
23
24
  // Separate plots combined into one figure, with chrome of its own.
@@ -27,9 +28,11 @@ export { default as GridCell } from './layout/grid/GridCell.svelte';
27
28
  export { default as Plot } from './layout/plot/Plot.svelte';
28
29
  export { default as BasePlotLayout } from './layout/base/BasePlotLayout.svelte';
29
30
  export { usePlot, useFigure } from './layout/plot/usePlot';
31
+ // What a plot knows of each row it draws, which every format reads.
32
+ export { RowContext } from './phases/context/RowContext';
30
33
  // Custom geo projections - usable as `scales.projection.type`.
31
34
  export { argentinaBicontinental } from './layout/coordinates/projections/argentina';
32
- export { setConfiguration, getConfiguration, resetConfiguration, configToCssVars, cssVarsStyle, DEFAULT_CONFIG } from './configuration/config.svelte';
35
+ export { setConfiguration, getConfiguration, resetConfiguration, configToCssVars, cssVarsStyle, cssVarsRule, DEFAULT_CONFIG } from './configuration/config.svelte';
33
36
  export { THEMES } from './configuration/themes';
34
37
  export { SYSTEM_FONT } from './configuration/fonts';
35
38
  // ── Utils ─────────────────────────────────────────────────────────────────────
@@ -317,7 +317,7 @@
317
317
  <div
318
318
  class="dct-plot"
319
319
  bind:this={containerEl}
320
- style:color={cfg.axis.color}
320
+ style:color={`var(--dct-axis-color, ${cfg.axis.color})`}
321
321
  style:touch-action={touchAction}
322
322
  onpointermove={hover.active ? onMove : undefined}
323
323
  onpointerleave={hover.active ? ctrl.onLeave : undefined}
@@ -6,11 +6,8 @@
6
6
  import TimelineRule from '../timeline/TimelineRule.svelte';
7
7
  import { TimelineState } from '../timeline/TimelineState.svelte';
8
8
  import { GridCellsRegistry } from '../grid/GridCellsRegistry.svelte';
9
- import {
10
- getConfiguration,
11
- configToCssVars,
12
- cssVarsStyle
13
- } from '../../configuration/config.svelte';
9
+ import ConfigVars from '../../configuration/ConfigVars.svelte';
10
+ import { getConfiguration } from '../../configuration/config.svelte';
14
11
  import { HoverState } from '../hover/HoverState.svelte';
15
12
  import { LegendState } from '../legend/LegendState.svelte';
16
13
  import { LegendLabels } from '../legend/LegendLabels';
@@ -165,18 +162,14 @@
165
162
  plot={body}
166
163
  />
167
164
  {:else}
168
- <!-- No chrome means no container to stamp the `--dct-*` vars that facet and timeline chrome read. -->
169
- <div
170
- style={cssVarsStyle(configToCssVars(cfg))}
171
- style:font-family="var(--dct-font, inherit)"
172
- style:width="{w}px"
173
- style:height="{h}px"
174
- >
165
+ <div style:font-family="var(--dct-font, inherit)" style:width="{w}px" style:height="{h}px">
175
166
  {@render body({ width: w, height: h })}
176
167
  </div>
177
168
  {/if}
178
169
  {/snippet}
179
170
 
171
+ <ConfigVars />
172
+
180
173
  {#if grid}
181
174
  <GridCell class="dct-grid-cell--figure" {area} {inset}>
182
175
  {#snippet children(cell)}
@@ -2,11 +2,7 @@
2
2
  import type { Snippet } from 'svelte';
3
3
  import type { PlotBoxSnippet } from '../../types/layout/figure';
4
4
  import type { PlotChromeEntry, PlotChromeItem } from '../../types/plots/props';
5
- import {
6
- getConfiguration,
7
- configToCssVars,
8
- cssVarsStyle
9
- } from '../../configuration/config.svelte';
5
+ import { getConfiguration } from '../../configuration/config.svelte';
10
6
 
11
7
  /**
12
8
  * A figure's chrome - a plot's or a composer's - drawn by its `Figure`. It owns the fixed footprint (`width`/`height`),
@@ -175,10 +171,6 @@
175
171
 
176
172
  let bodyWidth = $state(0);
177
173
  let bodyHeight = $state(0);
178
-
179
- // Stamp every `--dct-*` custom property on the root so the scoped styles below
180
- // (and any nested plot/legend/timeline) resolve them from the live config.
181
- const themeStyle = $derived(cssVarsStyle(configToCssVars(getConfiguration())));
182
174
  </script>
183
175
 
184
176
  {#snippet cell(block: Cell)}
@@ -217,7 +209,7 @@
217
209
  {/if}
218
210
  {/snippet}
219
211
 
220
- <div class="dct-figure-chrome" style={themeStyle} style:width="{width}px" style:height="{height}px">
212
+ <div class="dct-figure-chrome" style:width="{width}px" style:height="{height}px">
221
213
  {#each blocks as block (block.key)}
222
214
  {#if block.type === 'divider'}
223
215
  <hr class="dct-figure-chrome__divider" />