@fundar/data-chart-telling 1.17.0 → 1.19.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 (353) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +2 -1
  3. package/dist/configuration/config.svelte.js +4 -3
  4. package/dist/index.d.ts +10 -3
  5. package/dist/index.js +4 -1
  6. package/dist/layout/coordinates/CoordinatesLayout.svelte +3 -1
  7. package/dist/layout/geometry/GeometryLayout.svelte +222 -53
  8. package/dist/layout/geometry/ScaleFreeContext.d.ts +31 -0
  9. package/dist/layout/geometry/ScaleFreeContext.js +65 -0
  10. package/dist/layout/geometry/ScaleFreeMarks.svelte +14 -0
  11. package/dist/layout/geometry/ScaleFreeMarks.svelte.d.ts +7 -0
  12. package/dist/layout/geometry/ScaleGate.svelte.d.ts +8 -0
  13. package/dist/layout/geometry/ScaleGate.svelte.js +95 -0
  14. package/dist/layout/geometry/ScaleGateMarks.svelte +15 -0
  15. package/dist/layout/geometry/ScaleGateMarks.svelte.d.ts +7 -0
  16. package/dist/layout/hover/HoverDefaults.d.ts +52 -0
  17. package/dist/layout/hover/HoverDefaults.js +96 -0
  18. package/dist/layout/hover/HoverLayers.d.ts +35 -0
  19. package/dist/layout/hover/HoverLayers.js +122 -0
  20. package/dist/layout/hover/HoverSettings.d.ts +1 -3
  21. package/dist/layout/hover/HoverSettings.js +3 -2
  22. package/dist/layout/hover/HoverShapes.d.ts +56 -0
  23. package/dist/layout/hover/HoverShapes.js +163 -0
  24. package/dist/layout/hover/PlotHover.svelte.d.ts +18 -0
  25. package/dist/layout/hover/PlotHover.svelte.js +54 -1
  26. package/dist/layout/legend/LegendState.svelte.d.ts +2 -0
  27. package/dist/layout/legend/LegendState.svelte.js +5 -0
  28. package/dist/layout/margins/Box.d.ts +4 -0
  29. package/dist/layout/margins/Box.js +14 -0
  30. package/dist/layout/margins/PlotMargins.svelte.js +26 -1
  31. package/dist/layout/plot/{Plot.svelte.d.ts → AbstractPlot.svelte.d.ts} +3 -3
  32. package/dist/layout/plot/Core.svelte +2 -2
  33. package/dist/layout/plot/PublicPlotContext.d.ts +6 -0
  34. package/dist/layout/plot/PublicPlotContext.js +8 -0
  35. package/dist/layout/styles/ValueLabels.d.ts +118 -59
  36. package/dist/layout/styles/ValueLabels.js +313 -146
  37. package/dist/layout/tooltip/TooltipState.svelte.d.ts +8 -9
  38. package/dist/layout/tooltip/TooltipState.svelte.js +28 -29
  39. package/dist/markers/MarkerKinds.d.ts +84 -1
  40. package/dist/markers/MarkerKinds.js +150 -23
  41. package/dist/markers/area/AreaMarker.svelte +1 -1
  42. package/dist/markers/band/BandMarker.svelte +74 -0
  43. package/dist/markers/band/BandMarker.svelte.d.ts +7 -0
  44. package/dist/markers/band/Bands.d.ts +16 -0
  45. package/dist/markers/band/Bands.js +48 -0
  46. package/dist/markers/bar/BarMarker.svelte +29 -70
  47. package/dist/markers/bollinger/BollingerMarker.svelte +1 -1
  48. package/dist/markers/box/BoxMarker.svelte +1 -1
  49. package/dist/markers/dot/DotRadius.d.ts +11 -0
  50. package/dist/markers/dot/DotRadius.js +21 -0
  51. package/dist/markers/hover/HoverMarker.svelte +7 -265
  52. package/dist/markers/hover/HoverMarker.svelte.d.ts +4 -27
  53. package/dist/markers/labels/CurveLabel.svelte +56 -0
  54. package/dist/markers/labels/CurveLabel.svelte.d.ts +9 -0
  55. package/dist/markers/labels/LabelMerge.d.ts +11 -0
  56. package/dist/markers/labels/LabelMerge.js +87 -0
  57. package/dist/markers/labels/MarkerLabel.svelte +36 -0
  58. package/dist/markers/labels/MarkerLabel.svelte.d.ts +10 -0
  59. package/dist/markers/labels/MarkerLabels.d.ts +52 -0
  60. package/dist/markers/labels/MarkerLabels.js +97 -0
  61. package/dist/markers/labels/geometry/BoxGeometry.d.ts +8 -0
  62. package/dist/markers/labels/geometry/BoxGeometry.js +101 -0
  63. package/dist/markers/labels/geometry/CurveGeometry.d.ts +34 -0
  64. package/dist/markers/labels/geometry/CurveGeometry.js +193 -0
  65. package/dist/markers/labels/geometry/PointGeometry.d.ts +9 -0
  66. package/dist/markers/labels/geometry/PointGeometry.js +22 -0
  67. package/dist/markers/labels/layouts/BoxLayout.d.ts +10 -0
  68. package/dist/markers/labels/layouts/BoxLayout.js +49 -0
  69. package/dist/markers/labels/layouts/PathLayout.d.ts +11 -0
  70. package/dist/markers/labels/layouts/PathLayout.js +91 -0
  71. package/dist/markers/labels/layouts/PointLayout.d.ts +19 -0
  72. package/dist/markers/labels/layouts/PointLayout.js +94 -0
  73. package/dist/markers/regression/RegressionMarker.svelte +1 -1
  74. package/dist/markers/text/Covering.d.ts +13 -0
  75. package/dist/markers/text/Covering.js +29 -0
  76. package/dist/markers/text/Declutter.d.ts +24 -3
  77. package/dist/markers/text/Declutter.js +46 -3
  78. package/dist/markers/text/TextMarker.svelte +90 -17
  79. package/dist/markers/text/TextMarker.svelte.d.ts +1 -1
  80. package/dist/markers/tick/TickMarker.svelte +1 -1
  81. package/dist/markers/utils/MarkerChannels.d.ts +1 -1
  82. package/dist/markers/utils/MarkerChannels.js +3 -2
  83. package/dist/markers/utils/PointPixel.d.ts +37 -0
  84. package/dist/markers/utils/PointPixel.js +44 -0
  85. package/dist/markers/violin/ViolinMarker.svelte +1 -1
  86. package/dist/markers/waffle/WaffleMarker.svelte +1 -1
  87. package/dist/phases/Pipeline.d.ts +7 -7
  88. package/dist/phases/Pipeline.js +12 -9
  89. package/dist/phases/context/ContextPhase.d.ts +22 -0
  90. package/dist/phases/context/ContextPhase.js +23 -0
  91. package/dist/phases/context/RowContext.d.ts +37 -0
  92. package/dist/phases/context/RowContext.js +97 -0
  93. package/dist/phases/data/DataPhase.d.ts +4 -4
  94. package/dist/phases/data/DataPhase.js +7 -7
  95. package/dist/phases/hover/HoverPhase.d.ts +6 -7
  96. package/dist/phases/hover/HoverPhase.js +28 -23
  97. package/dist/phases/mapping/MappingPhase.d.ts +4 -4
  98. package/dist/phases/mapping/MappingPhase.js +2 -2
  99. package/dist/phases/markers/MarkerStyles.d.ts +8 -0
  100. package/dist/phases/markers/MarkerStyles.js +24 -6
  101. package/dist/phases/markers/MarkersPhase.d.ts +6 -7
  102. package/dist/phases/markers/MarkersPhase.js +18 -12
  103. package/dist/phases/scales/ScalesPhase.d.ts +4 -4
  104. package/dist/phases/scales/ScalesPhase.js +4 -4
  105. package/dist/phases/sharedScales/SharedScalesPhase.d.ts +2 -2
  106. package/dist/phases/sharedScales/SharedScalesPhase.js +2 -2
  107. package/dist/phases/statistics/MarkerGrouping.d.ts +0 -9
  108. package/dist/phases/statistics/MarkerGrouping.js +5 -48
  109. package/dist/phases/statistics/MarkerInheritance.d.ts +11 -0
  110. package/dist/phases/statistics/MarkerInheritance.js +25 -0
  111. package/dist/phases/statistics/MarkerOrientation.d.ts +26 -0
  112. package/dist/phases/statistics/MarkerOrientation.js +29 -0
  113. package/dist/phases/statistics/StatisticsPhase.js +15 -15
  114. package/dist/phases/styles/StylesPhase.d.ts +3 -3
  115. package/dist/phases/styles/StylesPhase.js +2 -2
  116. package/dist/phases/tooltip/TooltipPhase.d.ts +4 -4
  117. package/dist/phases/tooltip/TooltipPhase.js +10 -7
  118. package/dist/phases/transforms/TransformsPhase.d.ts +3 -3
  119. package/dist/phases/transforms/TransformsPhase.js +7 -5
  120. package/dist/plots/correlation/heatmap/Plot.svelte +2 -2
  121. package/dist/plots/correlation/heatmap/Plot.svelte.d.ts +0 -1
  122. package/dist/plots/correlation/heatmap/defaults.d.ts +2 -2
  123. package/dist/plots/correlation/heatmap/defaults.js +35 -7
  124. package/dist/plots/correlation/heatmap/markers.d.ts +2 -8
  125. package/dist/plots/correlation/heatmap/markers.js +8 -11
  126. package/dist/plots/correlation/scatter/Plot.svelte +2 -2
  127. package/dist/plots/correlation/scatter/Plot.svelte.d.ts +0 -1
  128. package/dist/plots/correlation/scatter/defaults.d.ts +2 -2
  129. package/dist/plots/correlation/scatter/defaults.js +18 -6
  130. package/dist/plots/correlation/scatter/markers.d.ts +2 -11
  131. package/dist/plots/correlation/scatter/markers.js +24 -30
  132. package/dist/plots/distribution/box/BoxSummaries.d.ts +22 -8
  133. package/dist/plots/distribution/box/BoxSummaries.js +99 -40
  134. package/dist/plots/distribution/box/Plot.svelte +2 -2
  135. package/dist/plots/distribution/box/Plot.svelte.d.ts +0 -1
  136. package/dist/plots/distribution/box/defaults.d.ts +2 -2
  137. package/dist/plots/distribution/box/defaults.js +20 -6
  138. package/dist/plots/distribution/box/markers.d.ts +2 -2
  139. package/dist/plots/distribution/box/markers.js +13 -4
  140. package/dist/plots/distribution/density/Plot.svelte +2 -2
  141. package/dist/plots/distribution/density/Plot.svelte.d.ts +0 -1
  142. package/dist/plots/distribution/density/defaults.d.ts +2 -2
  143. package/dist/plots/distribution/density/defaults.js +33 -1
  144. package/dist/plots/distribution/density/markers.d.ts +2 -2
  145. package/dist/plots/distribution/density/markers.js +9 -5
  146. package/dist/plots/distribution/histogram/Plot.svelte +2 -2
  147. package/dist/plots/distribution/histogram/Plot.svelte.d.ts +0 -1
  148. package/dist/plots/distribution/histogram/defaults.d.ts +2 -2
  149. package/dist/plots/distribution/histogram/defaults.js +36 -36
  150. package/dist/plots/distribution/histogram/markers.d.ts +2 -2
  151. package/dist/plots/distribution/histogram/markers.js +7 -6
  152. package/dist/plots/distribution/pyramid/Plot.svelte +2 -2
  153. package/dist/plots/distribution/pyramid/Plot.svelte.d.ts +0 -1
  154. package/dist/plots/distribution/pyramid/defaults.d.ts +2 -2
  155. package/dist/plots/distribution/pyramid/defaults.js +13 -3
  156. package/dist/plots/distribution/pyramid/markers.d.ts +2 -10
  157. package/dist/plots/distribution/pyramid/markers.js +9 -18
  158. package/dist/plots/distribution/violin/Plot.svelte +2 -2
  159. package/dist/plots/distribution/violin/Plot.svelte.d.ts +0 -1
  160. package/dist/plots/distribution/violin/defaults.d.ts +2 -2
  161. package/dist/plots/distribution/violin/defaults.js +20 -7
  162. package/dist/plots/distribution/violin/markers.d.ts +2 -2
  163. package/dist/plots/distribution/violin/markers.js +30 -6
  164. package/dist/plots/evolution/area/Plot.svelte +2 -2
  165. package/dist/plots/evolution/area/Plot.svelte.d.ts +0 -1
  166. package/dist/plots/evolution/area/defaults.d.ts +2 -2
  167. package/dist/plots/evolution/area/defaults.js +5 -8
  168. package/dist/plots/evolution/area/markers.d.ts +2 -2
  169. package/dist/plots/evolution/area/markers.js +7 -5
  170. package/dist/plots/evolution/line/Plot.svelte +2 -2
  171. package/dist/plots/evolution/line/Plot.svelte.d.ts +0 -1
  172. package/dist/plots/evolution/line/defaults.d.ts +2 -2
  173. package/dist/plots/evolution/line/defaults.js +5 -7
  174. package/dist/plots/evolution/line/markers.d.ts +2 -2
  175. package/dist/plots/evolution/line/markers.js +6 -4
  176. package/dist/plots/evolution/slope/Plot.svelte +2 -2
  177. package/dist/plots/evolution/slope/Plot.svelte.d.ts +0 -1
  178. package/dist/plots/evolution/slope/defaults.d.ts +2 -2
  179. package/dist/plots/evolution/slope/defaults.js +11 -6
  180. package/dist/plots/evolution/slope/markers.d.ts +6 -5
  181. package/dist/plots/evolution/slope/markers.js +19 -12
  182. package/dist/plots/evolution/sparkline/Plot.svelte +2 -2
  183. package/dist/plots/evolution/sparkline/Plot.svelte.d.ts +0 -1
  184. package/dist/plots/evolution/sparkline/defaults.d.ts +2 -2
  185. package/dist/plots/evolution/sparkline/defaults.js +5 -2
  186. package/dist/plots/evolution/sparkline/markers.d.ts +2 -2
  187. package/dist/plots/evolution/sparkline/markers.js +6 -4
  188. package/dist/plots/generic/Plot.svelte +42 -0
  189. package/dist/plots/generic/Plot.svelte.d.ts +25 -0
  190. package/dist/plots/generic/defaults.d.ts +4 -0
  191. package/dist/plots/generic/defaults.js +7 -0
  192. package/dist/plots/map/geo/Core.svelte +3 -3
  193. package/dist/plots/map/geo/Plot.svelte +2 -2
  194. package/dist/plots/map/geo/Plot.svelte.d.ts +0 -1
  195. package/dist/plots/map/geo/defaults.d.ts +2 -2
  196. package/dist/plots/map/geo/phases/data.d.ts +1 -1
  197. package/dist/plots/map/geo/phases/data.js +1 -1
  198. package/dist/plots/map/geo/phases/hover.d.ts +2 -2
  199. package/dist/plots/map/geo/phases/hover.js +3 -3
  200. package/dist/plots/map/geo/phases/markers.d.ts +2 -2
  201. package/dist/plots/map/geo/phases/markers.js +3 -3
  202. package/dist/plots/map/geo/phases/scales.d.ts +2 -2
  203. package/dist/plots/map/geo/phases/scales.js +2 -2
  204. package/dist/plots/part-of-a-whole/treemap/Plot.svelte +2 -2
  205. package/dist/plots/part-of-a-whole/treemap/Plot.svelte.d.ts +0 -1
  206. package/dist/plots/part-of-a-whole/treemap/defaults.d.ts +2 -2
  207. package/dist/plots/part-of-a-whole/treemap/defaults.js +38 -22
  208. package/dist/plots/ranking/bar/Plot.svelte +2 -2
  209. package/dist/plots/ranking/bar/Plot.svelte.d.ts +0 -1
  210. package/dist/plots/ranking/bar/defaults.d.ts +2 -2
  211. package/dist/plots/ranking/bar/defaults.js +26 -10
  212. package/dist/plots/ranking/bar/markers.d.ts +3 -3
  213. package/dist/plots/ranking/bar/markers.js +17 -33
  214. package/dist/plots/ranking/bullet/Plot.svelte +2 -2
  215. package/dist/plots/ranking/bullet/Plot.svelte.d.ts +0 -1
  216. package/dist/plots/ranking/bullet/defaults.d.ts +2 -2
  217. package/dist/plots/ranking/bullet/defaults.js +24 -4
  218. package/dist/plots/ranking/bullet/markers.d.ts +3 -3
  219. package/dist/plots/ranking/bullet/markers.js +16 -10
  220. package/dist/plots/ranking/cleveland/ClevelandMarkers.d.ts +4 -11
  221. package/dist/plots/ranking/cleveland/ClevelandMarkers.js +73 -54
  222. package/dist/plots/ranking/cleveland/Plot.svelte +2 -2
  223. package/dist/plots/ranking/cleveland/Plot.svelte.d.ts +0 -1
  224. package/dist/plots/ranking/cleveland/defaults.d.ts +2 -2
  225. package/dist/plots/ranking/cleveland/defaults.js +39 -5
  226. package/dist/plots/ranking/dumbbell/Plot.svelte +2 -2
  227. package/dist/plots/ranking/dumbbell/Plot.svelte.d.ts +0 -1
  228. package/dist/plots/ranking/dumbbell/defaults.d.ts +2 -2
  229. package/dist/plots/ranking/forest/Plot.svelte +2 -2
  230. package/dist/plots/ranking/forest/Plot.svelte.d.ts +0 -1
  231. package/dist/plots/ranking/forest/defaults.d.ts +2 -2
  232. package/dist/plots/ranking/lollipop/Plot.svelte +2 -2
  233. package/dist/plots/ranking/lollipop/Plot.svelte.d.ts +0 -1
  234. package/dist/plots/ranking/lollipop/defaults.d.ts +2 -2
  235. package/dist/types/configuration/styling.d.ts +4 -0
  236. package/dist/types/layout/context.d.ts +23 -0
  237. package/dist/types/layout/context.js +1 -0
  238. package/dist/types/layout/hover.d.ts +3 -0
  239. package/dist/types/layout/styles/bullet.d.ts +4 -1
  240. package/dist/types/layout/styles/values.d.ts +59 -13
  241. package/dist/types/layout/tooltip.d.ts +5 -10
  242. package/dist/types/markers/axis/area.d.ts +5 -1
  243. package/dist/types/markers/axis/axisBasedMarkersConfig.d.ts +2 -1
  244. package/dist/types/markers/axis/band.d.ts +24 -0
  245. package/dist/types/markers/axis/band.js +1 -0
  246. package/dist/types/markers/axis/bar.d.ts +7 -4
  247. package/dist/types/markers/axis/bollinger.d.ts +2 -1
  248. package/dist/types/markers/axis/box.d.ts +2 -1
  249. package/dist/types/markers/axis/cell.d.ts +4 -1
  250. package/dist/types/markers/axis/hover.d.ts +60 -15
  251. package/dist/types/markers/axis/line.d.ts +4 -1
  252. package/dist/types/markers/axis/rect.d.ts +4 -1
  253. package/dist/types/markers/axis/regression.d.ts +2 -1
  254. package/dist/types/markers/axis/tick.d.ts +2 -1
  255. package/dist/types/markers/axis/trail.d.ts +4 -1
  256. package/dist/types/markers/axis/violin.d.ts +2 -1
  257. package/dist/types/markers/axis/waffle.d.ts +5 -1
  258. package/dist/types/markers/basic/dot.d.ts +4 -1
  259. package/dist/types/markers/basic/text.d.ts +25 -21
  260. package/dist/types/markers/channels/commonMarkerConfig.d.ts +6 -2
  261. package/dist/types/markers/channels/commonMarkerConfigWithLabel.d.ts +5 -9
  262. package/dist/types/markers/channels/commonMarkerConfigWithOrientation.d.ts +5 -0
  263. package/dist/types/markers/channels/commonMarkerConfigWithOrientation.js +1 -0
  264. package/dist/types/markers/common.d.ts +1 -0
  265. package/dist/types/markers/common.js +1 -0
  266. package/dist/types/markers/labels/box.d.ts +57 -0
  267. package/dist/types/markers/labels/box.js +1 -0
  268. package/dist/types/markers/labels/common.d.ts +15 -0
  269. package/dist/types/markers/labels/common.js +1 -0
  270. package/dist/types/markers/labels/path.d.ts +52 -0
  271. package/dist/types/markers/labels/path.js +1 -0
  272. package/dist/types/markers/labels/point.d.ts +40 -0
  273. package/dist/types/markers/labels/point.js +1 -0
  274. package/dist/types/markers/traits.d.ts +10 -0
  275. package/dist/types/phases/context/phase.d.ts +7 -0
  276. package/dist/types/phases/context/phase.js +1 -0
  277. package/dist/types/phases/data/phase.d.ts +2 -2
  278. package/dist/types/phases/hover/phase.d.ts +10 -7
  279. package/dist/types/phases/index.d.ts +2 -1
  280. package/dist/types/phases/kind.d.ts +11 -8
  281. package/dist/types/phases/mapping/phase.d.ts +2 -2
  282. package/dist/types/phases/markers/phase.d.ts +3 -10
  283. package/dist/types/phases/scales/phase.d.ts +4 -4
  284. package/dist/types/phases/stage.d.ts +3 -3
  285. package/dist/types/phases/state.d.ts +1 -1
  286. package/dist/types/phases/statistics/phase.d.ts +8 -3
  287. package/dist/types/phases/styles/phase.d.ts +18 -5
  288. package/dist/types/phases/transforms/phase.d.ts +4 -2
  289. package/dist/types/plots/constants.d.ts +3 -17
  290. package/dist/types/plots/correlation/heatmap/props.d.ts +3 -2
  291. package/dist/types/plots/correlation/heatmap/state.d.ts +2 -2
  292. package/dist/types/plots/correlation/scatter/props.d.ts +3 -2
  293. package/dist/types/plots/correlation/scatter/state.d.ts +2 -2
  294. package/dist/types/plots/distribution/box/props.d.ts +28 -2
  295. package/dist/types/plots/distribution/box/state.d.ts +6 -17
  296. package/dist/types/plots/distribution/density/props.d.ts +2 -1
  297. package/dist/types/plots/distribution/density/state.d.ts +2 -2
  298. package/dist/types/plots/distribution/histogram/props.d.ts +16 -2
  299. package/dist/types/plots/distribution/histogram/state.d.ts +2 -2
  300. package/dist/types/plots/distribution/pyramid/props.d.ts +3 -2
  301. package/dist/types/plots/distribution/pyramid/state.d.ts +2 -2
  302. package/dist/types/plots/distribution/violin/props.d.ts +6 -2
  303. package/dist/types/plots/distribution/violin/state.d.ts +2 -2
  304. package/dist/types/plots/evolution/area/props.d.ts +3 -2
  305. package/dist/types/plots/evolution/area/state.d.ts +2 -2
  306. package/dist/types/plots/evolution/line/props.d.ts +3 -2
  307. package/dist/types/plots/evolution/line/state.d.ts +2 -2
  308. package/dist/types/plots/evolution/slope/state.d.ts +2 -2
  309. package/dist/types/plots/evolution/sparkline/state.d.ts +2 -2
  310. package/dist/types/plots/generic/props.d.ts +16 -0
  311. package/dist/types/plots/generic/props.js +1 -0
  312. package/dist/types/plots/generic/state.d.ts +4 -0
  313. package/dist/types/plots/generic/state.js +1 -0
  314. package/dist/types/plots/map/geo/state.d.ts +1 -1
  315. package/dist/types/plots/part-of-a-whole/treemap/props.d.ts +18 -6
  316. package/dist/types/plots/part-of-a-whole/treemap/state.d.ts +2 -2
  317. package/dist/types/plots/props.d.ts +3 -0
  318. package/dist/types/plots/ranking/bar/props.d.ts +3 -2
  319. package/dist/types/plots/ranking/bar/state.d.ts +2 -2
  320. package/dist/types/plots/ranking/bullet/state.d.ts +2 -2
  321. package/dist/types/plots/ranking/cleveland/props.d.ts +3 -2
  322. package/dist/types/plots/ranking/cleveland/state.d.ts +2 -2
  323. package/dist/types/plots/ranking/dumbbell/props.d.ts +3 -2
  324. package/dist/types/plots/ranking/dumbbell/state.d.ts +2 -2
  325. package/dist/types/plots/ranking/forest/props.d.ts +5 -2
  326. package/dist/types/plots/ranking/forest/state.d.ts +2 -2
  327. package/dist/types/plots/ranking/lollipop/props.d.ts +3 -2
  328. package/dist/types/plots/ranking/lollipop/state.d.ts +2 -2
  329. package/docs/architecture.md +9 -9
  330. package/docs/markers.md +36 -6
  331. package/docs/plots/evolution/line.md +1 -1
  332. package/docs/plots/evolution/slope.md +1 -1
  333. package/docs/plots/part-of-a-whole/treemap.md +36 -2
  334. package/docs/plots/ranking/bar.md +1 -0
  335. package/docs/plots/ranking/cleveland.md +1 -1
  336. package/docs/state.md +33 -0
  337. package/docs/styles-and-segments.md +2 -15
  338. package/docs/theming.md +2 -1
  339. package/docs/tooltip-and-hover.md +81 -3
  340. package/docs/value-labels.md +159 -0
  341. package/examples/BarValues.svelte +1 -1
  342. package/examples/LineDates.svelte +1 -1
  343. package/examples/ResponsiveLine.svelte +3 -1
  344. package/examples/TreemapHover.svelte +25 -0
  345. package/examples/ValueLabels.svelte +1 -1
  346. package/llms-full.txt +9 -7
  347. package/llms.txt +3 -1
  348. package/package.json +3 -1
  349. package/dist/markers/utils/BoxLabel.d.ts +0 -58
  350. package/dist/markers/utils/BoxLabel.js +0 -175
  351. package/dist/markers/utils/MarkerLabel.svelte +0 -33
  352. package/dist/markers/utils/MarkerLabel.svelte.d.ts +0 -10
  353. /package/dist/layout/plot/{Plot.svelte → AbstractPlot.svelte} +0 -0
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" generics="TData extends Record<string, unknown>">
2
- import Plot from '../../../layout/plot/Plot.svelte';
2
+ import AbstractPlot from '../../../layout/plot/AbstractPlot.svelte';
3
3
  import { buildDumbbellDefaults } from './defaults';
4
4
  import type {
5
5
  DumbbellPlotProps,
@@ -28,7 +28,7 @@
28
28
  }: DumbbellPlotProps<TData> = $props();
29
29
  </script>
30
30
 
31
- <Plot
31
+ <AbstractPlot
32
32
  core={core as DumbbellPlotCoreProps<TData>}
33
33
  defaults={buildDumbbellDefaults}
34
34
  bind:margins
@@ -1,4 +1,3 @@
1
- import Plot from '../../../layout/plot/Plot.svelte';
2
1
  import type { DumbbellPlotProps } from '../../../types/plots/ranking/dumbbell/props';
3
2
  declare function $$render<TData extends Record<string, unknown>>(): {
4
3
  props: DumbbellPlotProps<TData>;
@@ -1,9 +1,9 @@
1
1
  import type { AxisPlotDefaults } from '../../../types/phases';
2
- import type { DumbbellPlotState, DumbbellPlotCtx } from '../../../types/plots/ranking/dumbbell/state';
2
+ import type { DumbbellPlotState, DumbbellPlotEnv } from '../../../types/plots/ranking/dumbbell/state';
3
3
  /**
4
4
  * DumbbellPlot on the shared pipeline: a ClevelandPlot of exactly two series,
5
5
  * so every category is two dots joined by a connector - the change, or the gap,
6
6
  * between them. It warns when it has another number of series, which
7
7
  * `LollipopPlot` (one) and `ClevelandPlot` (any) are for.
8
8
  */
9
- export declare function buildDumbbellDefaults<TData extends Record<string, unknown>>(): AxisPlotDefaults<DumbbellPlotState<TData>, DumbbellPlotCtx>;
9
+ export declare function buildDumbbellDefaults<TData extends Record<string, unknown>>(): AxisPlotDefaults<DumbbellPlotState<TData>, DumbbellPlotEnv>;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" generics="TData extends Record<string, unknown>">
2
- import Plot from '../../../layout/plot/Plot.svelte';
2
+ import AbstractPlot from '../../../layout/plot/AbstractPlot.svelte';
3
3
  import { buildForestDefaults } from './defaults';
4
4
  import type { ForestPlotProps, ForestPlotCoreProps } from '../../../types/plots/ranking/forest/props';
5
5
 
@@ -25,7 +25,7 @@
25
25
  }: ForestPlotProps<TData> = $props();
26
26
  </script>
27
27
 
28
- <Plot
28
+ <AbstractPlot
29
29
  core={core as ForestPlotCoreProps<TData>}
30
30
  defaults={buildForestDefaults}
31
31
  bind:margins
@@ -1,4 +1,3 @@
1
- import Plot from '../../../layout/plot/Plot.svelte';
2
1
  import type { ForestPlotProps } from '../../../types/plots/ranking/forest/props';
3
2
  declare function $$render<TData extends Record<string, unknown>>(): {
4
3
  props: ForestPlotProps<TData>;
@@ -1,5 +1,5 @@
1
1
  import type { AxisPlotDefaults } from '../../../types/phases';
2
- import type { ForestPlotState, ForestPlotCtx } from '../../../types/plots/ranking/forest/state';
2
+ import type { ForestPlotState, ForestPlotEnv } from '../../../types/plots/ranking/forest/state';
3
3
  /**
4
4
  * ForestPlot on the shared pipeline: a ClevelandPlot whose dot is an estimate
5
5
  * and whose stem is its interval - each row's `lower` and `upper`, or `error`
@@ -8,4 +8,4 @@ import type { ForestPlotState, ForestPlotCtx } from '../../../types/plots/rankin
8
8
  * for - or `facet`, to compare the series side by side. The value axis fits the
9
9
  * intervals' ends.
10
10
  */
11
- export declare function buildForestDefaults<TData extends Record<string, unknown>>(): AxisPlotDefaults<ForestPlotState<TData>, ForestPlotCtx>;
11
+ export declare function buildForestDefaults<TData extends Record<string, unknown>>(): AxisPlotDefaults<ForestPlotState<TData>, ForestPlotEnv>;
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" generics="TData extends Record<string, unknown>">
2
- import Plot from '../../../layout/plot/Plot.svelte';
2
+ import AbstractPlot from '../../../layout/plot/AbstractPlot.svelte';
3
3
  import { buildLollipopDefaults } from './defaults';
4
4
  import type {
5
5
  LollipopPlotProps,
@@ -28,7 +28,7 @@
28
28
  }: LollipopPlotProps<TData> = $props();
29
29
  </script>
30
30
 
31
- <Plot
31
+ <AbstractPlot
32
32
  core={core as LollipopPlotCoreProps<TData>}
33
33
  defaults={buildLollipopDefaults}
34
34
  bind:margins
@@ -1,4 +1,3 @@
1
- import Plot from '../../../layout/plot/Plot.svelte';
2
1
  import type { LollipopPlotProps } from '../../../types/plots/ranking/lollipop/props';
3
2
  declare function $$render<TData extends Record<string, unknown>>(): {
4
3
  props: LollipopPlotProps<TData>;
@@ -1,9 +1,9 @@
1
1
  import type { AxisPlotDefaults } from '../../../types/phases';
2
- import type { LollipopPlotState, LollipopPlotCtx } from '../../../types/plots/ranking/lollipop/state';
2
+ import type { LollipopPlotState, LollipopPlotEnv } from '../../../types/plots/ranking/lollipop/state';
3
3
  /**
4
4
  * LollipopPlot on the shared pipeline: a ClevelandPlot of one value per
5
5
  * category, whose stem rises from the baseline - zero, or the nearest end of a
6
6
  * pinned value domain - to the dot. It warns when a category has values in
7
7
  * several series, which `DumbbellPlot` and `ClevelandPlot` are for.
8
8
  */
9
- export declare function buildLollipopDefaults<TData extends Record<string, unknown>>(): AxisPlotDefaults<LollipopPlotState<TData>, LollipopPlotCtx>;
9
+ export declare function buildLollipopDefaults<TData extends Record<string, unknown>>(): AxisPlotDefaults<LollipopPlotState<TData>, LollipopPlotEnv>;
@@ -243,6 +243,8 @@ export type PlotStylesConfig = {
243
243
  dot: DotStyle;
244
244
  font: FontStyle;
245
245
  area: AreaStyle;
246
+ /** How a hovered shape looks on a plot whose hover only restyles its shapes (a treemap's tile, a heatmap's cell). */
247
+ active: StrokeStyle;
246
248
  };
247
249
  facet: {
248
250
  /** Position badge shown in `carousel`/`paginated` facet modes. */
@@ -379,6 +381,8 @@ export type PlotStylesConfig = {
379
381
  /** Gap, in px, between a connector and its label when it is written beside it. */
380
382
  labelGap: number;
381
383
  };
384
+ /** The `band` marker's style, under its own `styles`. */
385
+ band: AreaStyle;
382
386
  /** The `delta` marker's label offset and anchor, per axis the delta is taken on. A marker's own `text` wins. */
383
387
  delta: {
384
388
  text: Record<'x' | 'y', {
@@ -0,0 +1,23 @@
1
+ /**
2
+ * What a plot knows of one of the rows it draws: the series it is drawn in, where it sits, and the value it shows
3
+ * - the dataset's own, or the one the plot works out for it (a density's estimate, a bin's count). It is worked
4
+ * out once per row, as the plot reads its data, and every place that writes about a row reads it: a tooltip's
5
+ * `format`, a hover's points and labels, the value labels, and an author's own markers (see `RowContext.of`).
6
+ * A plot kind that works out more about a row gives a type that extends this one.
7
+ */
8
+ export type PlotRowContext<TRow = Record<string, unknown>> = {
9
+ /** The name of the series the row is drawn in, on the plots that have series. */
10
+ series?: string;
11
+ /** The row's value on `x`: its own (not a stack's running total), else where the plot's transforms put it. */
12
+ x?: unknown;
13
+ /** The row's value on `y`, as `x`. */
14
+ y?: unknown;
15
+ /** The value the row shows, on the plot's value axis, when it is a number. */
16
+ value?: number;
17
+ /** The row itself, as the plot drew it: the data's fields, plus whatever its transforms added. */
18
+ row?: TRow;
19
+ /** Which of the row's values a label writes, on a plot whose rows have several (`styles.values.parts`). */
20
+ part?: string;
21
+ };
22
+ /** A plot kind's own context of a row: the shared one, with what the kind works out for it. */
23
+ export type KindRowContext<TExtra extends object, TRow = Record<string, unknown>> = PlotRowContext<TRow> & TExtra;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,4 @@
1
+ import type { PlotRowContext } from './context';
1
2
  import type { AxisValue } from './mapping';
2
3
  /**
3
4
  * How the hover highlight finds related points within a facet.
@@ -41,6 +42,8 @@ export type HoverDisplayPoint = {
41
42
  color?: string;
42
43
  /** A 'grouped' series' own slice of the category band, as start/end fractions (0-1) of the whole band. `undefined` means the whole band. */
43
44
  areaInset?: BandSlice;
45
+ /** What the plot knows of the point's row: its series, where it sits, its value and whatever its kind works out - see {@link PlotRowContext}. */
46
+ context?: PlotRowContext;
44
47
  };
45
48
  /** A candidate point for hover matching/highlighting - also carries its source row. */
46
49
  export type HoverPoint<T> = HoverDisplayPoint & {
@@ -1,7 +1,10 @@
1
+ import type { WithValues, BarValueLabel } from './values';
1
2
  import type { GapsAwarePlotStylesConfig } from './gaps';
2
3
  import type { BarSegmentStyle } from '../../plots/segments/common';
4
+ /** The values of a bullet's row its value labels can write: its bar's, its target, its ranges' bounds. */
5
+ export type BulletValuePart = 'value' | 'target' | 'ranges';
3
6
  /** `BulletPlot`'s `styles`: a bar plot's, with the look of its ranges and its target. Each field falls back to `bullet` in the configuration. */
4
- export type BulletStylesConfig = GapsAwarePlotStylesConfig<BarSegmentStyle> & {
7
+ export type BulletStylesConfig = WithValues<GapsAwarePlotStylesConfig<BarSegmentStyle>, BarValueLabel, BulletValuePart> & {
5
8
  /** The bar that shows the value. */
6
9
  bar?: {
7
10
  /** Its thickness across the category band, in px. */
@@ -1,6 +1,10 @@
1
- import type { ValueAnchor } from '../../plots/constants';
1
+ import type { MarkerLabelConfig } from '../../markers/labels/common';
2
+ import type { BoxLabelConfig } from '../../markers/labels/box';
3
+ import type { PointLabelConfig } from '../../markers/labels/point';
4
+ import type { AreaEdgeLabelConfig, PageEdge, PathLabelConfig, RimLabelConfig, StrokeLabelConfig, ValueEdge } from '../../markers/labels/path';
2
5
  import type { FontStyle, StrokeStyle } from '../../plots/styling';
3
6
  import type { NumberDisplay } from '../numbers';
7
+ import type { PlotRowContext } from '../context';
4
8
  /**
5
9
  * Which of a group's rows get a value label: its first or last, or the one
6
10
  * with the lowest or highest value (read on the plot's value axis). The group
@@ -13,17 +17,42 @@ export type ValueSelect = 'first' | 'last' | 'min' | 'max';
13
17
  * marker over the rows the plot itself draws (after its own `transforms`):
14
18
  * one at the end of each series on a line or area plot, one per bar on a bar,
15
19
  * pyramid or histogram plot, one per point on a scatter plot and one per cell
16
- * on a heatmap. The high-level `anchor` sets sensible defaults for placement;
17
- * `fontStyle` (`dx`, `dy`, `textAnchor`, `lineAnchor`, `lineHeight`, `rotate`,
18
- * `class`, `textClass`, `fill`, …) overrides those defaults field-by-field when
19
- * provided - mirrors {@link DeltaConfig}'s `fontStyle`/`strokeStyle` split, so
20
- * label text and connector-line styling never mix into one flat bag of props.
20
+ * on a heatmap. `layout` and its options place them as a marker's `label` would (each
21
+ * plot kind takes the layouts its shapes do, with defaults of its own for each);
22
+ * `fontStyle` (`fill`, `fontSize`, `lineHeight`, `rotate`, `class`, …) styles
23
+ * the text, never where it sits - mirrors {@link DeltaConfig}'s
24
+ * `fontStyle`/`strokeStyle` split, so label text and connector-line styling
25
+ * never mix into one flat bag of props.
21
26
  */
22
- export type ValuesStyle = NumberDisplay & {
23
- /** Whether the labels are drawn. Off by default, except on a heatmap. */
27
+ /** The options of a label that place it, as `styles.values` takes them: its `layout` optional, the kind's by default. */
28
+ type LayoutKey = 'anchor' | 'edge' | 'side' | 'offset' | 'gap';
29
+ export type ValueLayoutOf<TLabel> = TLabel extends {
30
+ layout?: infer TLayout;
31
+ } ? Pick<TLabel, Extract<keyof TLabel, LayoutKey>> & {
32
+ layout?: TLayout;
33
+ } : never;
34
+ /**
35
+ * `TStyles` with its `values` taking only the labels of `TLabel` - the layouts a plot kind's shapes write - and, on a
36
+ * kind whose rows have several values, the `TPart`s it can label.
37
+ */
38
+ export type WithValues<TStyles, TLabel extends MarkerLabelConfig, TPart extends string = 'value'> = Omit<TStyles, 'values'> & {
39
+ values?: ValuesStyle<TLabel, TPart>;
40
+ };
41
+ export type ValuesStyle<TLabel extends MarkerLabelConfig = MarkerLabelConfig, TPart extends string = string> = ValuesOptions & ValueLayoutOf<TLabel> & {
42
+ parts?: ValueParts<TPart, TLabel>;
43
+ };
44
+ /** What a part's own label sets, over the plot's: where it sits and its text. */
45
+ export type ValuePartOptions<TLabel = MarkerLabelConfig> = Omit<ValueLayoutOf<TLabel>, 'layout'> & Pick<ValuesOptions, 'format'>;
46
+ /**
47
+ * The parts of each row a plot kind with several values per row labels - a box's `median`, a bullet's `target`: a
48
+ * list of them, or a record turning each on (`true`) or setting its own options.
49
+ */
50
+ export type ValueParts<TPart extends string, TLabel = MarkerLabelConfig> = TPart[] | Partial<Record<TPart, boolean | ValuePartOptions<TLabel>>>;
51
+ /** A value label's text style, without what places it: the layout's options do that. */
52
+ export type ValuesFontStyle = Omit<FontStyle, 'textAnchor' | 'lineAnchor' | 'dx' | 'dy'>;
53
+ type ValuesOptions = NumberDisplay & {
54
+ /** Whether the labels are drawn. Setting any other option of them turns them on; off by default, except on a heatmap. */
24
55
  show?: boolean;
25
- /** Where each label sits on its mark - see {@link ValueAnchor}. */
26
- anchor?: ValueAnchor;
27
56
  /**
28
57
  * Which rows of each group are labelled: one selector, or a list of them (a
29
58
  * row picked by any is labelled) - see {@link ValueSelect}. Each plot has its
@@ -38,11 +67,28 @@ export type ValuesStyle = NumberDisplay & {
38
67
  * CSS color writes them all in it. `fontStyle.fill` wins when it is set.
39
68
  */
40
69
  color?: 'series' | (string & {});
41
- /** A label's text, in place of the value as `decimals`, `prefix`, `suffix` and `signDisplay` write it, from its row's own value (a histogram bin's count) and its series - and, on the plots that label one row each, that row, for the other fields of the data. */
42
- format?: (value: number, seriesName: string, row?: Record<string, unknown>, number?: (value: number) => string) => string;
70
+ /**
71
+ * A label's text, in place of the value as `decimals`, `prefix`, `suffix` and `signDisplay` write it: from the
72
+ * value it shows (a histogram bin's count, a tile's share), `number`, which writes a value as those fields ask,
73
+ * and `context`, what the plot knows of the labelled row - its `series`, `x`, `y`, whatever its kind works out
74
+ * and, where the label has one, the `row` itself, for the other fields of the data (see {@link PlotRowContext}).
75
+ */
76
+ format?: (value: number, number: (value: number) => string, context: PlotRowContext) => string;
43
77
  /** Hovering a label dims every other series, like toggling them off in the legend. */
44
78
  hoverIsolate?: boolean;
45
- fontStyle?: FontStyle;
79
+ /** The text's look; where it sits is the layout's (`side`, `gap`, `offset`...). */
80
+ fontStyle?: ValuesFontStyle;
46
81
  /** The connectors a line or area plot routes back from labels that had to move apart. */
47
82
  strokeStyle?: StrokeStyle;
48
83
  };
84
+ /** The labels a plot of bars writes on them: in each, along an edge (its `tip` too) or beside a point of it. */
85
+ export type BarValueLabel = BoxLabelConfig | PathLabelConfig<PageEdge | ValueEdge> | PointLabelConfig;
86
+ /** The labels a plot of boxes with no value direction (a heatmap's cells, a histogram's bins) writes on them. */
87
+ export type CellValueLabel = BoxLabelConfig | PathLabelConfig<PageEdge> | PointLabelConfig;
88
+ /** The labels a plot of lines writes: beside its points, or along its lines. */
89
+ export type LineValueLabel = PointLabelConfig | StrokeLabelConfig;
90
+ /** The labels a plot of areas writes: beside its points, or along their top or bottom edge. */
91
+ export type AreaValueLabel = PointLabelConfig | AreaEdgeLabelConfig;
92
+ /** The labels a plot of dots writes: beside them, or around their rim. */
93
+ export type DotValueLabel = PointLabelConfig | RimLabelConfig;
94
+ export {};
@@ -1,6 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import type { HoverStrategy } from './hover';
3
3
  import type { NumberDisplay } from './numbers';
4
+ import type { PlotRowContext } from './context';
4
5
  /**
5
6
  * Preferred horizontal placement of the tooltip beside the cursor; it moves
6
7
  * to the other side when it would overflow. Defaults to `'right'`.
@@ -12,15 +13,8 @@ export type TooltipAnchorY = 'top' | 'middle' | 'bottom';
12
13
  export type TooltipRow<TRow> = TRow & {
13
14
  seriesColor?: string;
14
15
  };
15
- /**
16
- * What a plot knows of a hovered row beyond its own fields, the third argument of a tooltip's `format`:
17
- * the series it is drawn in, on the plots that have series. A plot kind that works out more about a row
18
- * gives a type that extends this one.
19
- */
20
- export type TooltipContext = {
21
- /** The name of the series the row is drawn in. */
22
- series?: string;
23
- };
16
+ /** What a plot knows of a hovered row, the third argument of a tooltip's `format` - see {@link PlotRowContext}. */
17
+ export type TooltipContext = PlotRowContext;
24
18
  /**
25
19
  * Author-facing tooltip option on the chart kinds. `true` = enable with defaults. `decimals`, `prefix`,
26
20
  * `suffix` and `signDisplay` write the value the default text shows - the one on the plot's value axis (the
@@ -33,7 +27,8 @@ export type TooltipOptions<TRow extends Record<string, unknown>, TContext extend
33
27
  sync?: boolean;
34
28
  /**
35
29
  * Custom tooltip text for a row (supports `\n`). Defaults per chart kind. `number` writes a value as the display
36
- * fields above ask, and `context` is what the plot knows of the row - see {@link TooltipContext}.
30
+ * fields above ask, and `context` is what the plot knows of the row: its series, `x`, `y`, the value it shows and
31
+ * whatever its kind works out (a tile's share, a box's quartiles) - see {@link PlotRowContext}.
37
32
  */
38
33
  format?: (row: TRow, number: (value: number) => string, context: TContext) => string;
39
34
  /** Named subset of crossing series to include. Omitted = all matched. */
@@ -1,3 +1,7 @@
1
+ import type { AreaEdgeLabelConfig } from '../labels/path';
2
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
3
+ import type { PointLabelConfig } from '../labels/point';
4
+ import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
1
5
  import type { AreaStyle } from '../../plots/styling';
2
6
  import type { CommonMarkerConfigWithArea } from '../channels/commonMarkerConfigWithArea';
3
7
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
@@ -9,4 +13,4 @@ export type AreaMarkerConfig = {
9
13
  curve?: CurveName;
10
14
  tension?: number;
11
15
  styles?: AreaStyle;
12
- } & CommonMarkerConfigWithArea & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval;
16
+ } & CommonMarkerConfigWithOrientation & CommonMarkerConfigWithArea & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel<AreaEdgeLabelConfig | PointLabelConfig>;
@@ -23,8 +23,9 @@ import type { TrailMarkerConfig } from './trail';
23
23
  import type { WaffleMarkerConfig } from './waffle';
24
24
  import type { ViolinMarkerConfig } from './violin';
25
25
  import type { RuleMarkerConfig } from './rule';
26
+ import type { BandMarkerConfig } from './band';
26
27
  import type { HoverMarkerConfig } from './hover';
27
28
  import type { CustomComponentMarkerConfig } from './component';
28
29
  import type { DeltaMarkerConfig } from './delta';
29
30
  /** Every marker kind an axis-based plot can render. */
30
- export type AxisBasedMarkersConfig = BasicMarkersConfig | LineMarkerConfig | BarMarkerConfig | CellMarkerConfig | RectMarkerConfig | RegressionMarkerConfig | BollingerMarkerConfig | AreaMarkerConfig | DensityMarkerConfig | BoxMarkerConfig | HullMarkerConfig | DifferenceMarkerConfig | ArrowMarkerConfig | BrushMarkerConfig | DelaunayLinkMarkerConfig | DelaunayMeshMarkerConfig | VoronoiMarkerConfig | VoronoiMeshMarkerConfig | ImageMarkerConfig | RasterMarkerConfig | TickMarkerConfig | TrailMarkerConfig | WaffleMarkerConfig | ViolinMarkerConfig | RuleMarkerConfig | HoverMarkerConfig | CustomComponentMarkerConfig | DeltaMarkerConfig;
31
+ export type AxisBasedMarkersConfig = BasicMarkersConfig | LineMarkerConfig | BarMarkerConfig | CellMarkerConfig | RectMarkerConfig | RegressionMarkerConfig | BollingerMarkerConfig | AreaMarkerConfig | DensityMarkerConfig | BoxMarkerConfig | HullMarkerConfig | DifferenceMarkerConfig | ArrowMarkerConfig | BrushMarkerConfig | DelaunayLinkMarkerConfig | DelaunayMeshMarkerConfig | VoronoiMarkerConfig | VoronoiMeshMarkerConfig | ImageMarkerConfig | RasterMarkerConfig | TickMarkerConfig | TrailMarkerConfig | WaffleMarkerConfig | ViolinMarkerConfig | RuleMarkerConfig | BandMarkerConfig | HoverMarkerConfig | CustomComponentMarkerConfig | DeltaMarkerConfig;
@@ -0,0 +1,24 @@
1
+ import type { AxisValue } from '../../layout/mapping';
2
+ import type { BandSlice } from '../../layout/hover';
3
+ import type { AreaStyle, PerRow } from '../../plots/styling';
4
+ import type { CommonMarkerConfig } from '../channels/commonMarkerConfig';
5
+ /**
6
+ * The band of a category on a band axis, across the whole of the other axis: one per category, however many rows
7
+ * name it. On an axis that is not a band scale it draws nothing.
8
+ */
9
+ export type BandMarkerConfig = {
10
+ type: 'band';
11
+ axis: 'x' | 'y';
12
+ /**
13
+ * Which band. A list draws one at each category (without `data`); with `data`, a field key or a function of the
14
+ * row gives each row's own.
15
+ */
16
+ value: AxisValue | string | (AxisValue | string)[] | ((d: any) => AxisValue);
17
+ /**
18
+ * The part of the band it fills, as the fractions of its width left out at its start and its end (a grouped
19
+ * bar's series' slice). A function of the row gives each row's own; a band several rows share fills what all of
20
+ * them do. Unset, the whole band.
21
+ */
22
+ slice?: BandSlice | ((d: any) => BandSlice | undefined);
23
+ styles?: PerRow<AreaStyle>;
24
+ } & Omit<CommonMarkerConfig, 'x' | 'y'>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,14 +1,17 @@
1
+ import type { PathLabelConfig, PageEdge, ValueEdge } from '../labels/path';
2
+ import type { BoxLabelConfig } from '../labels/box';
3
+ import type { PointLabelConfig } from '../labels/point';
4
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
5
  import type { AxisValue } from '../../layout/mapping';
2
6
  import type { AreaStyle, PerRow, InsetStyle } from '../../plots/styling';
3
7
  import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
4
8
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
5
9
  import type { CommonMarkerConfigWithInterval } from '../channels/commonMarkerConfigWithInterval';
6
- /** A bar mark; `role` tells a visible segment from the hover hit area and highlight. */
10
+ /** A bar mark; `role` tells a visible segment from the hover hit area. */
7
11
  export type BarMarkerConfig = {
8
12
  type: 'bar';
9
- role: 'segment' | 'hitArea' | 'highlight';
10
- isHorizontal: boolean;
13
+ role: 'segment' | 'hitArea';
11
14
  thickness?: number;
12
15
  styles?: PerRow<AreaStyle> & InsetStyle;
13
16
  category?: AxisValue;
14
- } & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel;
17
+ } & CommonMarkerConfigWithOrientation & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel<BoxLabelConfig | PathLabelConfig<PageEdge | ValueEdge> | PointLabelConfig>;
@@ -1,6 +1,7 @@
1
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
2
  import type { BollingerStatisticOptions } from '../../layout/statistics';
2
3
  import type { CommonMarkerConfig } from '../channels/commonMarkerConfig';
3
4
  /** A moving-average band (svelteplot's `BollingerX`/`BollingerY`). */
4
5
  export type BollingerMarkerConfig = {
5
6
  type: 'bollinger';
6
- } & BollingerStatisticOptions & CommonMarkerConfig;
7
+ } & CommonMarkerConfigWithOrientation & BollingerStatisticOptions & CommonMarkerConfig;
@@ -1,3 +1,4 @@
1
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
2
  import type { CommonMarkerConfig } from '../channels/commonMarkerConfig';
2
3
  /**
3
4
  * A box plot (svelteplot's `BoxX`/`BoxY`). Styled per sub-mark through `bar`,
@@ -16,4 +17,4 @@ export type BoxMarkerConfig = {
16
17
  index: number;
17
18
  count: number;
18
19
  };
19
- } & CommonMarkerConfig;
20
+ } & CommonMarkerConfigWithOrientation & CommonMarkerConfig;
@@ -1,3 +1,6 @@
1
+ import type { PathLabelConfig, PageEdge } from '../labels/path';
2
+ import type { BoxLabelConfig } from '../labels/box';
3
+ import type { PointLabelConfig } from '../labels/point';
1
4
  import type { AreaStyle, PerRow, InsetStyle } from '../../plots/styling';
2
5
  import type { CommonMarkerConfigWithArea } from '../channels/commonMarkerConfigWithArea';
3
6
  import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
@@ -6,4 +9,4 @@ import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfig
6
9
  export type CellMarkerConfig = {
7
10
  type: 'cell';
8
11
  styles?: PerRow<AreaStyle & Pick<InsetStyle, 'inset'>>;
9
- } & CommonMarkerConfigWithColor & CommonMarkerConfigWithArea & CommonMarkerConfigWithLabel;
12
+ } & CommonMarkerConfigWithColor & CommonMarkerConfigWithArea & CommonMarkerConfigWithLabel<BoxLabelConfig | PathLabelConfig<PageEdge> | PointLabelConfig>;
@@ -1,10 +1,54 @@
1
- import type { AreaStyle, DotStyle, FontStyle, StrokeStyle } from '../../plots/styling';
1
+ import type { AxisBasedMarkersConfig } from './axisBasedMarkersConfig';
2
2
  import type { HoverDisplayPoint, HoverStrategy } from '../../layout/hover';
3
3
  import type { NumberDisplay } from '../../layout/numbers';
4
+ import type { LineStyle } from '../../plots/constants';
5
+ /** A style value: the same for every shape, or a function of the row a shape draws. */
6
+ type ShapeStyleValue<T> = T | ((row: any) => T);
4
7
  /**
5
- * In-SVG hover highlight: crosshair, dot and label. The label is the hovered value as `decimals`, `prefix`,
6
- * `suffix` and `signDisplay` write it - as the plot writes it while none of them (nor `numbers.decimals`) is set -
7
- * unless `format` writes it.
8
+ * How the shapes of a marker linked to the hover (`hover: true` or `'style'`) look while the hover is on: the
9
+ * hovered ones under `active`, the rest under `others`. Each value replaces the shape's own, and may be a
10
+ * function of its row.
11
+ */
12
+ export type HoverShapeStyle = {
13
+ fill?: ShapeStyleValue<string>;
14
+ fillOpacity?: ShapeStyleValue<number>;
15
+ stroke?: ShapeStyleValue<string>;
16
+ strokeWidth?: ShapeStyleValue<number>;
17
+ strokeOpacity?: ShapeStyleValue<number>;
18
+ strokeDasharray?: string | LineStyle;
19
+ };
20
+ /** `T` with its `K` fields left to be set. */
21
+ type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
22
+ /** A marker as the hover takes it: a `rule`'s and a `band`'s `value` and a `text`'s `text` default to the point's. */
23
+ type InHover<T> = T extends {
24
+ type: 'rule' | 'band';
25
+ } ? Optional<T, 'value' & keyof T> : T extends {
26
+ type: 'text';
27
+ } ? Optional<T, 'text' & keyof T> : T;
28
+ /**
29
+ * A marker the hover draws: any marker but another hover, over the hovered points. Without `data` of its own its
30
+ * rows are the points - each its `x`, `y`, `label` (written as the hover marker's number fields ask), `series`,
31
+ * `color` (its series'), `areaInset` (its slice of the band) and `row` (the row it stands for) - and its `x` and
32
+ * `y` default to the point's. What it leaves unset comes from the hover: a `rule` sits at each point along its
33
+ * `axis`, a `band` around it (in its series' slice), a `text` writes its label; each in the configuration's `hover`
34
+ * look (a `rect` in its `area`), and a `dot` and a `text` in the point's series color.
35
+ */
36
+ export type HoverLayerMarker = InHover<Exclude<AxisBasedMarkersConfig, {
37
+ type: 'hover';
38
+ }>> & {
39
+ /**
40
+ * Which points it draws: every one the hover matches (the default), only the one under the pointer, or those a
41
+ * function of the point keeps.
42
+ */
43
+ points?: 'all' | 'active' | ((point: HoverDisplayPoint) => boolean);
44
+ };
45
+ /**
46
+ * The plot's hover, inside the plot: how the hovered shapes look (`active`) and the rest (`others`), and the
47
+ * markers it draws behind the plot's shapes (`back`) and in front of them (`front`) - a rule, a band, a dot, a
48
+ * label, a component. Each plot kind has a hover of its own that this one is laid over: `active` and `others`
49
+ * field by field, `back` and `front` replacing the kind's lists when set (`back: []` draws nothing behind).
50
+ * The points' label is the hovered value as `decimals`, `prefix`, `suffix` and `signDisplay` write it - as the
51
+ * plot writes it while none of them (nor `numbers.decimals`) is set - unless `format` writes it.
8
52
  */
9
53
  export type HoverMarkerConfig = NumberDisplay & {
10
54
  type: 'hover';
@@ -12,16 +56,17 @@ export type HoverMarkerConfig = NumberDisplay & {
12
56
  scope?: 'series' | 'segment';
13
57
  strategy?: HoverStrategy;
14
58
  sync?: boolean;
15
- ruleX?: boolean;
16
- ruleY?: boolean;
17
- /** A thickened highlight area in place of a thin crosshair; meaningful on band scales only. */
18
- areaX?: boolean;
19
- areaY?: boolean;
20
- showLabels?: boolean;
21
- /** The label's text for a point, in place of the value. `number` writes a value as the display fields above ask. */
59
+ /** How the hovered shapes of every marker linked to the hover look - the plot's own tiles, bars and cells among them. */
60
+ active?: HoverShapeStyle;
61
+ /** How the shapes the hover does not reach look, while it is on. */
62
+ others?: HoverShapeStyle;
63
+ /** The markers drawn behind every other one of the plot, over the hovered points. */
64
+ back?: HoverLayerMarker[];
65
+ /** The markers drawn in front of the plot's shapes, over the hovered points. */
66
+ front?: HoverLayerMarker[];
67
+ /** A point's label, in place of its value. `number` writes a value as the display fields above ask. */
22
68
  format?: (point: HoverDisplayPoint, number: (value: number) => string) => string;
23
- rule?: StrokeStyle;
24
- area?: AreaStyle;
25
- dot?: DotStyle;
26
- text?: FontStyle;
27
69
  };
70
+ /** What a plot kind's own hover is made of, which an author's `hover` marker is laid over. */
71
+ export type HoverLook = Pick<HoverMarkerConfig, 'active' | 'others' | 'back' | 'front'>;
72
+ export {};
@@ -1,3 +1,6 @@
1
+ import type { StrokeLabelConfig } from '../labels/path';
2
+ import type { PointLabelConfig } from '../labels/point';
3
+ import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
1
4
  import type { StrokeStyle } from '../../plots/styling';
2
5
  import type { CurveName } from '../../layout/styles/curve';
3
6
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
@@ -6,4 +9,4 @@ export type LineMarkerConfig = {
6
9
  type: 'line';
7
10
  curve?: CurveName;
8
11
  styles?: StrokeStyle;
9
- } & CommonMarkerConfigWithColor;
12
+ } & CommonMarkerConfigWithColor & CommonMarkerConfigWithLabel<StrokeLabelConfig | PointLabelConfig>;
@@ -1,3 +1,6 @@
1
+ import type { PathLabelConfig, PageEdge } from '../labels/path';
2
+ import type { BoxLabelConfig } from '../labels/box';
3
+ import type { PointLabelConfig } from '../labels/point';
1
4
  import type { AreaStyle, PerRow, InsetStyle } from '../../plots/styling';
2
5
  import type { CommonMarkerConfigWithArea } from '../channels/commonMarkerConfigWithArea';
3
6
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
@@ -8,4 +11,4 @@ export type RectMarkerConfig = {
8
11
  type: 'rect';
9
12
  interval?: number | string;
10
13
  styles?: PerRow<AreaStyle & InsetStyle>;
11
- } & CommonMarkerConfigWithArea & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel;
14
+ } & CommonMarkerConfigWithArea & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel<BoxLabelConfig | PathLabelConfig<PageEdge> | PointLabelConfig>;
@@ -1,6 +1,7 @@
1
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
2
  import type { RegressionStatisticOptions } from '../../layout/statistics';
2
3
  import type { CommonMarkerConfig } from '../channels/commonMarkerConfig';
3
4
  /** A fitted regression curve (svelteplot's `RegressionX`/`RegressionY`). */
4
5
  export type RegressionMarkerConfig = {
5
6
  type: 'regression';
6
- } & RegressionStatisticOptions & CommonMarkerConfig;
7
+ } & CommonMarkerConfigWithOrientation & RegressionStatisticOptions & CommonMarkerConfig;
@@ -1,3 +1,4 @@
1
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
2
  import type { StrokeStyle, PerRow } from '../../plots/styling';
2
3
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
3
4
  /** A short tick per row along one axis (svelteplot's `TickX`/`TickY`). */
@@ -5,4 +6,4 @@ export type TickMarkerConfig = {
5
6
  type: 'tick';
6
7
  tickLength?: number | ((d: any) => number);
7
8
  styles?: PerRow<StrokeStyle>;
8
- } & CommonMarkerConfigWithColor;
9
+ } & CommonMarkerConfigWithOrientation & CommonMarkerConfigWithColor;
@@ -1,3 +1,6 @@
1
+ import type { StrokeLabelConfig } from '../labels/path';
2
+ import type { PointLabelConfig } from '../labels/point';
3
+ import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
1
4
  import type { AreaStyle } from '../../plots/styling';
2
5
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
3
6
  import type { CommonMarkerConfigWithRadius } from '../channels/commonMarkerConfigWithRadius';
@@ -10,4 +13,4 @@ export type TrailMarkerConfig = {
10
13
  cap?: 'butt' | 'round';
11
14
  resolution?: number | 'auto';
12
15
  styles?: Pick<AreaStyle, 'fill' | 'fillOpacity'>;
13
- } & CommonMarkerConfigWithRadius & CommonMarkerConfigWithColor;
16
+ } & CommonMarkerConfigWithRadius & CommonMarkerConfigWithColor & CommonMarkerConfigWithLabel<StrokeLabelConfig | PointLabelConfig>;
@@ -1,3 +1,4 @@
1
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
2
  import type { AreaStyle } from '../../plots/styling';
2
3
  import type { DensityKernel } from '../../transforms/density';
3
4
  import type { CommonMarkerConfig } from '../channels/commonMarkerConfig';
@@ -22,4 +23,4 @@ export type ViolinMarkerConfig = {
22
23
  count: number;
23
24
  };
24
25
  styles?: AreaStyle;
25
- } & CommonMarkerConfig;
26
+ } & CommonMarkerConfigWithOrientation & CommonMarkerConfig;
@@ -1,3 +1,7 @@
1
+ import type { PathLabelConfig, PageEdge, ValueEdge } from '../labels/path';
2
+ import type { BoxLabelConfig } from '../labels/box';
3
+ import type { PointLabelConfig } from '../labels/point';
4
+ import type { CommonMarkerConfigWithOrientation } from '../channels/commonMarkerConfigWithOrientation';
1
5
  import type { AreaStyle, PerRow } from '../../plots/styling';
2
6
  import type { CommonMarkerConfigWithLabel } from '../channels/commonMarkerConfigWithLabel';
3
7
  import type { CommonMarkerConfigWithColor } from '../channels/commonMarkerConfigWithColor';
@@ -11,4 +15,4 @@ export type WaffleMarkerConfig = {
11
15
  gap?: number;
12
16
  round?: boolean;
13
17
  styles?: PerRow<AreaStyle>;
14
- } & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel;
18
+ } & CommonMarkerConfigWithOrientation & CommonMarkerConfigWithColor & CommonMarkerConfigWithInterval & CommonMarkerConfigWithLabel<BoxLabelConfig | PathLabelConfig<PageEdge | ValueEdge> | PointLabelConfig>;