@fundar/data-chart-telling 1.1.0 → 1.2.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 (524) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +6 -6
  3. package/dist/configuration/config.svelte.d.ts +1 -1
  4. package/dist/configuration/config.svelte.js +165 -100
  5. package/dist/configuration/themes/index.d.ts +5 -1428
  6. package/dist/index.d.ts +23 -14
  7. package/dist/index.js +20 -11
  8. package/dist/layout/base/BasePlotLayout.svelte +115 -50
  9. package/dist/layout/base/BasePlotLayout.svelte.d.ts +1 -38
  10. package/dist/layout/coordinates/CoordinatesLayout.svelte +42 -40
  11. package/dist/layout/coordinates/CoordinatesLayout.svelte.d.ts +0 -2
  12. package/dist/layout/coordinates/ProjectionZoom.svelte +48 -0
  13. package/dist/layout/coordinates/ProjectionZoom.svelte.d.ts +10 -0
  14. package/dist/layout/coordinates/ZoomedProjection.d.ts +11 -0
  15. package/dist/layout/coordinates/ZoomedProjection.js +24 -0
  16. package/dist/layout/coordinates/camera.svelte.js +11 -8
  17. package/dist/layout/coordinates/projections/argentina.js +1 -1
  18. package/dist/layout/coordinates/projections/fit.d.ts +1 -1
  19. package/dist/layout/coordinates/projections/fit.js +1 -1
  20. package/dist/layout/coordinates/zoom.svelte.d.ts +4 -5
  21. package/dist/layout/coordinates/zoom.svelte.js +4 -5
  22. package/dist/layout/facet/FacetLayout.svelte +1 -1
  23. package/dist/layout/facet/config.js +1 -1
  24. package/dist/layout/figure/Figure.svelte +2 -0
  25. package/dist/layout/geometry/GeometryLayout.svelte +14 -9
  26. package/dist/layout/geometry/GeometryLayout.svelte.d.ts +0 -3
  27. package/dist/layout/geometry/MarkerOffset.svelte +28 -0
  28. package/dist/layout/geometry/MarkerOffset.svelte.d.ts +13 -0
  29. package/dist/layout/grid/GridCell.svelte +6 -8
  30. package/dist/layout/legend/ContinuousSection.svelte +44 -9
  31. package/dist/layout/legend/DiscreteBadgeItem.svelte +2 -2
  32. package/dist/layout/legend/DiscreteSection.svelte +2 -2
  33. package/dist/layout/legend/DiscreteSymbolIcon.svelte +1 -1
  34. package/dist/layout/legend/LegendChannels.js +36 -12
  35. package/dist/layout/legend/LegendLayout.svelte +9 -1
  36. package/dist/layout/legend/LegendState.svelte.d.ts +4 -0
  37. package/dist/layout/legend/LegendState.svelte.js +20 -3
  38. package/dist/layout/legend/SizeSection.svelte +1 -1
  39. package/dist/layout/margins/PlotMargins.svelte.d.ts +2 -5
  40. package/dist/layout/margins/PlotMargins.svelte.js +4 -8
  41. package/dist/layout/plot/Slice.d.ts +5 -1
  42. package/dist/layout/plot/Slice.js +14 -4
  43. package/dist/layout/scales/NiceTicks.d.ts +3 -0
  44. package/dist/layout/scales/NiceTicks.js +4 -0
  45. package/dist/layout/scales/ScalesLayout.svelte +72 -7
  46. package/dist/layout/scales/ScalesLayout.svelte.d.ts +5 -0
  47. package/dist/layout/scales/SveltePlotScale.d.ts +2 -2
  48. package/dist/layout/scales/SveltePlotScale.js +13 -6
  49. package/dist/layout/scales/TickLabels.d.ts +32 -0
  50. package/dist/layout/scales/TickLabels.js +55 -0
  51. package/dist/layout/styles/StylesLayout.svelte +2 -2
  52. package/dist/layout/styles/ValueLabels.d.ts +33 -5
  53. package/dist/layout/styles/ValueLabels.js +80 -21
  54. package/dist/layout/timeline/TimelineLayout.svelte +1 -1
  55. package/dist/layout/tooltip/Tooltip.svelte +4 -4
  56. package/dist/layout/tooltip/Tooltip.svelte.d.ts +4 -4
  57. package/dist/layout/tooltip/TooltipState.svelte.js +1 -1
  58. package/dist/markers/MarkerKinds.d.ts +5 -0
  59. package/dist/markers/MarkerKinds.js +1 -0
  60. package/dist/markers/area/AreaMarker.svelte +15 -63
  61. package/dist/markers/arrow/ArrowMarker.svelte +51 -9
  62. package/dist/markers/bar/BarMarker.svelte +8 -4
  63. package/dist/markers/bollinger/BollingerMarker.svelte +33 -18
  64. package/dist/markers/box/BoxMarker.svelte +40 -9
  65. package/dist/markers/delta/Delta.js +1 -1
  66. package/dist/markers/dot/DotMarker.svelte +24 -27
  67. package/dist/markers/image/ImageMarker.svelte +17 -12
  68. package/dist/markers/inset/InsetMarker.svelte +2 -2
  69. package/dist/markers/line/LineMarker.svelte +1 -0
  70. package/dist/markers/link/LinkMarker.svelte +174 -29
  71. package/dist/markers/regression/RegressionMarker.svelte +16 -33
  72. package/dist/markers/rule/RuleMarker.svelte +9 -3
  73. package/dist/markers/text/Declutter.d.ts +4 -0
  74. package/dist/markers/text/Declutter.js +26 -11
  75. package/dist/markers/text/TextMarker.svelte +91 -48
  76. package/dist/markers/tick/TickMarker.svelte +27 -25
  77. package/dist/markers/utils/MarkerChannels.d.ts +24 -0
  78. package/dist/markers/utils/MarkerChannels.js +42 -7
  79. package/dist/markers/utils/RowOffset.d.ts +23 -0
  80. package/dist/markers/utils/RowOffset.js +23 -0
  81. package/dist/markers/utils/RowOffsetMarks.svelte +30 -0
  82. package/dist/markers/utils/RowOffsetMarks.svelte.d.ts +33 -0
  83. package/dist/markers/utils/RowStroke.d.ts +31 -0
  84. package/dist/markers/utils/RowStroke.js +28 -0
  85. package/dist/markers/violin/ViolinMarker.svelte +75 -0
  86. package/dist/markers/violin/ViolinMarker.svelte.d.ts +7 -0
  87. package/dist/markers/violin/ViolinProfiles.d.ts +29 -0
  88. package/dist/markers/violin/ViolinProfiles.js +55 -0
  89. package/dist/markers/waffle/WaffleMarker.svelte +17 -37
  90. package/dist/phases/Pipeline.d.ts +5 -0
  91. package/dist/phases/Pipeline.js +5 -0
  92. package/dist/phases/data/DataPhase.js +3 -3
  93. package/dist/phases/data/PlotAxes.d.ts +10 -0
  94. package/dist/phases/data/PlotAxes.js +14 -1
  95. package/dist/phases/facet/FacetPanels.d.ts +1 -0
  96. package/dist/phases/facet/FacetPanels.js +1 -0
  97. package/dist/phases/mapping/MappingPhase.js +1 -1
  98. package/dist/phases/markers/MarkersPhase.js +2 -1
  99. package/dist/phases/scales/CategoryOrder.d.ts +23 -0
  100. package/dist/phases/scales/CategoryOrder.js +73 -0
  101. package/dist/phases/scales/ScalesPhase.js +21 -7
  102. package/dist/phases/sharedScales/SharedScalesPhase.d.ts +3 -2
  103. package/dist/phases/sharedScales/SharedScalesPhase.js +5 -2
  104. package/dist/phases/statistics/Statistics.d.ts +10 -6
  105. package/dist/phases/statistics/Statistics.js +20 -10
  106. package/dist/phases/statistics/StatisticsPhase.js +7 -2
  107. package/dist/phases/statistics/methods/BollingerStatistic.d.ts +1 -1
  108. package/dist/phases/statistics/methods/BollingerStatistic.js +13 -11
  109. package/dist/phases/statistics/methods/BoxStatistic.d.ts +1 -1
  110. package/dist/phases/statistics/methods/BoxStatistic.js +14 -12
  111. package/dist/phases/statistics/methods/Density2dStatistic.d.ts +1 -1
  112. package/dist/phases/statistics/methods/Density2dStatistic.js +13 -11
  113. package/dist/phases/statistics/methods/DensityStatistic.d.ts +1 -1
  114. package/dist/phases/statistics/methods/DensityStatistic.js +11 -9
  115. package/dist/phases/statistics/methods/DeviationStatistic.d.ts +8 -0
  116. package/dist/phases/statistics/methods/DeviationStatistic.js +111 -0
  117. package/dist/phases/statistics/methods/MovingAverageStatistic.d.ts +1 -1
  118. package/dist/phases/statistics/methods/MovingAverageStatistic.js +11 -9
  119. package/dist/phases/statistics/methods/RegressionStatistic.d.ts +1 -1
  120. package/dist/phases/statistics/methods/RegressionStatistic.js +16 -14
  121. package/dist/phases/transforms/ProcessedPositions.js +1 -1
  122. package/dist/phases/transforms/TransformsPhase.js +49 -3
  123. package/dist/phases/transforms/ValueSelection.d.ts +30 -0
  124. package/dist/phases/transforms/ValueSelection.js +53 -0
  125. package/dist/plots/{heatmap → correlation/heatmap}/Plot.svelte +5 -2
  126. package/dist/plots/{heatmap → correlation/heatmap}/Plot.svelte.d.ts +2 -2
  127. package/dist/plots/{heatmap → correlation/heatmap}/defaults.d.ts +2 -2
  128. package/dist/plots/{heatmap → correlation/heatmap}/defaults.js +5 -5
  129. package/dist/plots/{heatmap → correlation/heatmap}/markers.d.ts +4 -4
  130. package/dist/plots/{heatmap → correlation/heatmap}/markers.js +3 -3
  131. package/dist/plots/{scatter → correlation/scatter}/Plot.svelte +5 -2
  132. package/dist/plots/{scatter → correlation/scatter}/Plot.svelte.d.ts +2 -2
  133. package/dist/plots/{scatter → correlation/scatter}/defaults.d.ts +2 -2
  134. package/dist/plots/{scatter → correlation/scatter}/defaults.js +4 -4
  135. package/dist/plots/{scatter → correlation/scatter}/markers.d.ts +4 -4
  136. package/dist/plots/{scatter → correlation/scatter}/markers.js +3 -3
  137. package/dist/plots/{box → distribution/box}/BoxSummaries.d.ts +2 -2
  138. package/dist/plots/{box → distribution/box}/BoxSummaries.js +6 -6
  139. package/dist/plots/{box → distribution/box}/Plot.svelte +2 -2
  140. package/dist/plots/{box → distribution/box}/Plot.svelte.d.ts +2 -2
  141. package/dist/plots/{box → distribution/box}/defaults.d.ts +2 -2
  142. package/dist/plots/{box → distribution/box}/defaults.js +1 -1
  143. package/dist/plots/{box → distribution/box}/markers.d.ts +2 -2
  144. package/dist/plots/distribution/density/Plot.svelte +45 -0
  145. package/dist/plots/distribution/density/Plot.svelte.d.ts +26 -0
  146. package/dist/plots/distribution/density/defaults.d.ts +9 -0
  147. package/dist/plots/distribution/density/defaults.js +29 -0
  148. package/dist/plots/distribution/density/markers.d.ts +9 -0
  149. package/dist/plots/distribution/density/markers.js +42 -0
  150. package/dist/plots/{histogram → distribution/histogram}/Plot.svelte +2 -2
  151. package/dist/plots/{histogram → distribution/histogram}/Plot.svelte.d.ts +2 -2
  152. package/dist/plots/{histogram → distribution/histogram}/defaults.d.ts +2 -2
  153. package/dist/plots/{histogram → distribution/histogram}/defaults.js +3 -3
  154. package/dist/plots/{histogram → distribution/histogram}/markers.d.ts +3 -3
  155. package/dist/plots/{histogram → distribution/histogram}/markers.js +5 -5
  156. package/dist/plots/{pyramid → distribution/pyramid}/Plot.svelte +5 -2
  157. package/dist/plots/{pyramid → distribution/pyramid}/Plot.svelte.d.ts +2 -2
  158. package/dist/plots/{pyramid → distribution/pyramid}/defaults.d.ts +2 -2
  159. package/dist/plots/{pyramid → distribution/pyramid}/defaults.js +6 -6
  160. package/dist/plots/{pyramid → distribution/pyramid}/markers.d.ts +4 -4
  161. package/dist/plots/{pyramid → distribution/pyramid}/markers.js +6 -6
  162. package/dist/plots/distribution/violin/Plot.svelte +45 -0
  163. package/dist/plots/distribution/violin/Plot.svelte.d.ts +26 -0
  164. package/dist/plots/distribution/violin/defaults.d.ts +10 -0
  165. package/dist/plots/distribution/violin/defaults.js +58 -0
  166. package/dist/plots/distribution/violin/markers.d.ts +10 -0
  167. package/dist/plots/distribution/violin/markers.js +71 -0
  168. package/dist/plots/{area → evolution/area}/Plot.svelte +2 -2
  169. package/dist/plots/{area → evolution/area}/Plot.svelte.d.ts +2 -2
  170. package/dist/plots/{area → evolution/area}/defaults.d.ts +2 -2
  171. package/dist/plots/{area → evolution/area}/defaults.js +2 -0
  172. package/dist/plots/{area → evolution/area}/markers.d.ts +2 -2
  173. package/dist/plots/{area → evolution/area}/markers.js +1 -1
  174. package/dist/plots/{line → evolution/line}/Plot.svelte +2 -2
  175. package/dist/plots/{line → evolution/line}/Plot.svelte.d.ts +2 -2
  176. package/dist/plots/{line → evolution/line}/defaults.d.ts +2 -2
  177. package/dist/plots/{line → evolution/line}/defaults.js +2 -0
  178. package/dist/plots/{line → evolution/line}/markers.d.ts +11 -8
  179. package/dist/plots/{line → evolution/line}/markers.js +6 -4
  180. package/dist/plots/evolution/slope/Plot.svelte +42 -0
  181. package/dist/plots/evolution/slope/Plot.svelte.d.ts +26 -0
  182. package/dist/plots/evolution/slope/defaults.d.ts +8 -0
  183. package/dist/plots/evolution/slope/defaults.js +31 -0
  184. package/dist/plots/evolution/slope/markers.d.ts +16 -0
  185. package/dist/plots/evolution/slope/markers.js +79 -0
  186. package/dist/plots/evolution/sparkline/Plot.svelte +45 -0
  187. package/dist/plots/evolution/sparkline/Plot.svelte.d.ts +26 -0
  188. package/dist/plots/evolution/sparkline/defaults.d.ts +7 -0
  189. package/dist/plots/evolution/sparkline/defaults.js +23 -0
  190. package/dist/plots/evolution/sparkline/markers.d.ts +7 -0
  191. package/dist/plots/evolution/sparkline/markers.js +56 -0
  192. package/dist/plots/{geo → map/geo}/Core.svelte +11 -10
  193. package/dist/plots/{geo → map/geo}/Core.svelte.d.ts +1 -1
  194. package/dist/plots/map/geo/GeoFeatures.svelte.d.ts +9 -0
  195. package/dist/plots/map/geo/GeoFeatures.svelte.js +55 -0
  196. package/dist/plots/map/geo/GeoGeometry.d.ts +27 -0
  197. package/dist/plots/map/geo/GeoGeometry.js +142 -0
  198. package/dist/plots/map/geo/GeoSegments.d.ts +16 -0
  199. package/dist/plots/map/geo/GeoSegments.js +23 -0
  200. package/dist/plots/{geo → map/geo}/Plot.svelte +10 -10
  201. package/dist/plots/{geo → map/geo}/Plot.svelte.d.ts +2 -2
  202. package/dist/plots/{geo → map/geo}/defaults.d.ts +2 -2
  203. package/dist/plots/{geo → map/geo}/defaults.js +1 -1
  204. package/dist/plots/{geo → map/geo}/phases/data.d.ts +1 -1
  205. package/dist/plots/{geo → map/geo}/phases/data.js +7 -6
  206. package/dist/plots/{geo → map/geo}/phases/hover.d.ts +1 -1
  207. package/dist/plots/{geo → map/geo}/phases/hover.js +2 -2
  208. package/dist/plots/{geo → map/geo}/phases/markers.d.ts +1 -1
  209. package/dist/plots/{geo → map/geo}/phases/markers.js +6 -10
  210. package/dist/plots/{geo → map/geo}/phases/scales.d.ts +2 -2
  211. package/dist/plots/{geo → map/geo}/phases/scales.js +28 -12
  212. package/dist/plots/{geo → map/geo}/phases/tooltip.d.ts +1 -1
  213. package/dist/plots/map/geo/phases/tooltip.js +5 -0
  214. package/dist/plots/{geo → map/geo}/slices.d.ts +2 -2
  215. package/dist/plots/{geo → map/geo}/slices.js +2 -2
  216. package/dist/plots/{bar → ranking/bar}/Plot.svelte +2 -2
  217. package/dist/plots/{bar → ranking/bar}/Plot.svelte.d.ts +2 -2
  218. package/dist/plots/ranking/bar/defaults.d.ts +16 -0
  219. package/dist/plots/{bar → ranking/bar}/defaults.js +15 -9
  220. package/dist/plots/{bar → ranking/bar}/markers.d.ts +8 -8
  221. package/dist/plots/{bar → ranking/bar}/markers.js +8 -17
  222. package/dist/plots/ranking/bullet/Plot.svelte +42 -0
  223. package/dist/plots/ranking/bullet/Plot.svelte.d.ts +26 -0
  224. package/dist/plots/ranking/bullet/defaults.d.ts +8 -0
  225. package/dist/plots/ranking/bullet/defaults.js +24 -0
  226. package/dist/plots/ranking/bullet/markers.d.ts +10 -0
  227. package/dist/plots/ranking/bullet/markers.js +90 -0
  228. package/dist/plots/ranking/cleveland/ClevelandConnector.d.ts +48 -0
  229. package/dist/plots/ranking/cleveland/ClevelandConnector.js +140 -0
  230. package/dist/plots/ranking/cleveland/ClevelandMarkers.d.ts +33 -0
  231. package/dist/plots/ranking/cleveland/ClevelandMarkers.js +375 -0
  232. package/dist/plots/ranking/cleveland/ClevelandRanges.d.ts +31 -0
  233. package/dist/plots/ranking/cleveland/ClevelandRanges.js +116 -0
  234. package/dist/plots/ranking/cleveland/Plot.svelte +45 -0
  235. package/dist/plots/ranking/cleveland/Plot.svelte.d.ts +26 -0
  236. package/dist/plots/ranking/cleveland/defaults.d.ts +13 -0
  237. package/dist/plots/ranking/cleveland/defaults.js +66 -0
  238. package/dist/plots/ranking/dumbbell/Plot.svelte +45 -0
  239. package/dist/plots/ranking/dumbbell/Plot.svelte.d.ts +26 -0
  240. package/dist/plots/ranking/dumbbell/defaults.d.ts +9 -0
  241. package/dist/plots/ranking/dumbbell/defaults.js +19 -0
  242. package/dist/plots/ranking/forest/Plot.svelte +42 -0
  243. package/dist/plots/ranking/forest/Plot.svelte.d.ts +26 -0
  244. package/dist/plots/ranking/forest/defaults.d.ts +11 -0
  245. package/dist/plots/ranking/forest/defaults.js +20 -0
  246. package/dist/plots/ranking/lollipop/Plot.svelte +45 -0
  247. package/dist/plots/ranking/lollipop/Plot.svelte.d.ts +26 -0
  248. package/dist/plots/ranking/lollipop/defaults.d.ts +9 -0
  249. package/dist/plots/ranking/lollipop/defaults.js +18 -0
  250. package/dist/plots/utils/RowNumbers.d.ts +16 -0
  251. package/dist/plots/utils/RowNumbers.js +24 -0
  252. package/dist/plots/utils/gaps.js +1 -1
  253. package/dist/plots/utils/segments.js +1 -1
  254. package/dist/types/configuration/styling.d.ts +276 -143
  255. package/dist/types/layout/coordinates.d.ts +5 -4
  256. package/dist/types/layout/legend.d.ts +21 -5
  257. package/dist/types/layout/plot.d.ts +44 -1
  258. package/dist/types/layout/scales.d.ts +39 -7
  259. package/dist/types/layout/statistics/deviation.d.ts +40 -0
  260. package/dist/types/layout/statistics/index.d.ts +7 -2
  261. package/dist/types/layout/styles/base.d.ts +18 -0
  262. package/dist/types/layout/styles/bullet.d.ts +25 -0
  263. package/dist/types/layout/styles/connector.d.ts +98 -0
  264. package/dist/types/layout/styles/curve.d.ts +11 -0
  265. package/dist/types/layout/styles/frame.d.ts +17 -0
  266. package/dist/types/layout/styles/gaps.d.ts +12 -0
  267. package/dist/types/layout/styles/geo.d.ts +55 -0
  268. package/dist/types/layout/styles/index.d.ts +8 -0
  269. package/dist/types/layout/styles/index.js +8 -0
  270. package/dist/types/layout/styles/values.d.ts +47 -0
  271. package/dist/types/layout/timeline.d.ts +5 -2
  272. package/dist/types/layout/tooltip.d.ts +6 -2
  273. package/dist/types/markers/axis/area.d.ts +2 -2
  274. package/dist/types/markers/axis/arrow.d.ts +3 -0
  275. package/dist/types/markers/axis/axisBasedMarkersConfig.d.ts +2 -1
  276. package/dist/types/markers/axis/bar.d.ts +1 -1
  277. package/dist/types/markers/axis/box.d.ts +5 -0
  278. package/dist/types/markers/axis/difference.d.ts +2 -2
  279. package/dist/types/markers/axis/image.d.ts +3 -2
  280. package/dist/types/markers/axis/line.d.ts +2 -0
  281. package/dist/types/markers/axis/rule.d.ts +9 -0
  282. package/dist/types/markers/axis/trail.d.ts +2 -3
  283. package/dist/types/markers/axis/violin.d.ts +25 -0
  284. package/dist/types/markers/basic/dot.d.ts +3 -2
  285. package/dist/types/markers/basic/text.d.ts +13 -3
  286. package/dist/types/markers/channels/commonMarkerConfig.d.ts +7 -3
  287. package/dist/types/markers/channels/commonMarkerConfigWithRowOffset.d.ts +13 -0
  288. package/dist/types/markers/common.d.ts +1 -1
  289. package/dist/types/markers/common.js +1 -0
  290. package/dist/types/markers/geo/link.d.ts +5 -1
  291. package/dist/types/phases/index.d.ts +1 -1
  292. package/dist/types/phases/scales/phase.d.ts +5 -1
  293. package/dist/types/phases/state.d.ts +15 -2
  294. package/dist/types/phases/statistics/source.d.ts +3 -1
  295. package/dist/types/phases/transforms/phase.d.ts +22 -0
  296. package/dist/types/plots/{heatmap → correlation/heatmap}/props.d.ts +6 -6
  297. package/dist/types/plots/{heatmap → correlation/heatmap}/state.d.ts +4 -4
  298. package/dist/types/plots/{scatter → correlation/scatter}/props.d.ts +6 -6
  299. package/dist/types/plots/{scatter → correlation/scatter}/state.d.ts +2 -2
  300. package/dist/types/plots/{box → distribution/box}/props.d.ts +6 -6
  301. package/dist/types/plots/{box → distribution/box}/state.d.ts +3 -3
  302. package/dist/types/plots/distribution/density/props.d.ts +23 -0
  303. package/dist/types/plots/distribution/density/state.d.ts +6 -0
  304. package/dist/types/plots/{histogram → distribution/histogram}/props.d.ts +7 -7
  305. package/dist/types/plots/{histogram → distribution/histogram}/state.d.ts +2 -2
  306. package/dist/types/plots/distribution/histogram/state.js +1 -0
  307. package/dist/types/plots/{pyramid → distribution/pyramid}/props.d.ts +6 -6
  308. package/dist/types/plots/distribution/pyramid/props.js +1 -0
  309. package/dist/types/plots/{pyramid → distribution/pyramid}/state.d.ts +3 -3
  310. package/dist/types/plots/distribution/pyramid/state.js +1 -0
  311. package/dist/types/plots/distribution/violin/props.d.ts +23 -0
  312. package/dist/types/plots/distribution/violin/props.js +1 -0
  313. package/dist/types/plots/distribution/violin/state.d.ts +6 -0
  314. package/dist/types/plots/distribution/violin/state.js +1 -0
  315. package/dist/types/plots/{area → evolution/area}/props.d.ts +6 -6
  316. package/dist/types/plots/evolution/area/props.js +1 -0
  317. package/dist/types/plots/{area → evolution/area}/state.d.ts +2 -2
  318. package/dist/types/plots/evolution/area/state.js +1 -0
  319. package/dist/types/plots/evolution/line/props.d.ts +10 -0
  320. package/dist/types/plots/evolution/line/props.js +1 -0
  321. package/dist/types/plots/{line → evolution/line}/state.d.ts +3 -3
  322. package/dist/types/plots/evolution/line/state.js +1 -0
  323. package/dist/types/plots/evolution/slope/props.d.ts +5 -0
  324. package/dist/types/plots/evolution/slope/props.js +1 -0
  325. package/dist/types/plots/evolution/slope/state.d.ts +5 -0
  326. package/dist/types/plots/evolution/slope/state.js +1 -0
  327. package/dist/types/plots/evolution/sparkline/props.d.ts +5 -0
  328. package/dist/types/plots/evolution/sparkline/props.js +1 -0
  329. package/dist/types/plots/evolution/sparkline/state.d.ts +5 -0
  330. package/dist/types/plots/evolution/sparkline/state.js +1 -0
  331. package/dist/types/plots/{geo → map/geo}/props.d.ts +8 -8
  332. package/dist/types/plots/map/geo/props.js +1 -0
  333. package/dist/types/plots/{geo → map/geo}/state.d.ts +18 -11
  334. package/dist/types/plots/map/geo/state.js +1 -0
  335. package/dist/types/plots/props.d.ts +1 -1
  336. package/dist/types/plots/{bar → ranking/bar}/props.d.ts +6 -6
  337. package/dist/types/plots/ranking/bar/props.js +1 -0
  338. package/dist/types/plots/{bar → ranking/bar}/state.d.ts +2 -2
  339. package/dist/types/plots/ranking/bar/state.js +1 -0
  340. package/dist/types/plots/ranking/bullet/props.d.ts +22 -0
  341. package/dist/types/plots/ranking/bullet/props.js +1 -0
  342. package/dist/types/plots/ranking/bullet/state.d.ts +5 -0
  343. package/dist/types/plots/ranking/bullet/state.js +1 -0
  344. package/dist/types/plots/ranking/cleveland/props.d.ts +10 -0
  345. package/dist/types/plots/ranking/cleveland/props.js +1 -0
  346. package/dist/types/plots/ranking/cleveland/state.d.ts +49 -0
  347. package/dist/types/plots/ranking/cleveland/state.js +1 -0
  348. package/dist/types/plots/ranking/dumbbell/props.d.ts +10 -0
  349. package/dist/types/plots/ranking/dumbbell/props.js +1 -0
  350. package/dist/types/plots/ranking/dumbbell/state.d.ts +5 -0
  351. package/dist/types/plots/ranking/dumbbell/state.js +1 -0
  352. package/dist/types/plots/ranking/forest/props.d.ts +23 -0
  353. package/dist/types/plots/ranking/forest/props.js +1 -0
  354. package/dist/types/plots/ranking/forest/state.d.ts +5 -0
  355. package/dist/types/plots/ranking/forest/state.js +1 -0
  356. package/dist/types/plots/ranking/lollipop/props.d.ts +10 -0
  357. package/dist/types/plots/ranking/lollipop/props.js +1 -0
  358. package/dist/types/plots/ranking/lollipop/state.d.ts +5 -0
  359. package/dist/types/plots/ranking/lollipop/state.js +1 -0
  360. package/dist/types/plots/segments/common.d.ts +4 -1
  361. package/dist/utils/OpacityScale.d.ts +14 -0
  362. package/dist/utils/OpacityScale.js +43 -0
  363. package/dist/utils/{symbol.d.ts → SymbolPath.d.ts} +0 -12
  364. package/dist/utils/{symbol.js → SymbolPath.js} +0 -24
  365. package/dist/utils/SymbolScale.d.ts +18 -0
  366. package/dist/utils/SymbolScale.js +29 -0
  367. package/dist/utils/color/ColorRamp.d.ts +27 -0
  368. package/dist/utils/color/ColorRamp.js +120 -0
  369. package/dist/utils/color/CssColor.d.ts +19 -0
  370. package/dist/utils/color/CssColor.js +114 -0
  371. package/dist/utils/color/Palette.d.ts +21 -0
  372. package/dist/utils/color/Palette.js +52 -0
  373. package/dist/utils/color/index.d.ts +11 -3
  374. package/dist/utils/color/index.js +14 -3
  375. package/dist/utils/grouping.js +1 -1
  376. package/docs/architecture.md +1 -1
  377. package/docs/chrome.md +2 -2
  378. package/docs/composer.md +2 -2
  379. package/docs/concepts.md +1 -1
  380. package/docs/development.md +1 -1
  381. package/docs/facets.md +3 -3
  382. package/docs/getting-started.md +2 -2
  383. package/docs/legend.md +13 -11
  384. package/docs/markers.md +29 -27
  385. package/docs/plots/correlation/heatmap.md +26 -0
  386. package/docs/plots/correlation/scatter.md +35 -0
  387. package/docs/plots/distribution/box.md +28 -0
  388. package/docs/plots/distribution/density.md +26 -0
  389. package/docs/plots/distribution/histogram.md +33 -0
  390. package/docs/plots/distribution/pyramid.md +31 -0
  391. package/docs/plots/distribution/violin.md +35 -0
  392. package/docs/plots/evolution/area.md +32 -0
  393. package/docs/plots/evolution/line.md +93 -0
  394. package/docs/plots/evolution/slope.md +39 -0
  395. package/docs/plots/evolution/sparkline.md +34 -0
  396. package/docs/plots/ranking/bar.md +59 -0
  397. package/docs/plots/ranking/bullet.md +37 -0
  398. package/docs/plots/ranking/cleveland.md +54 -0
  399. package/docs/plots/ranking/dumbbell.md +39 -0
  400. package/docs/plots/ranking/forest.md +40 -0
  401. package/docs/plots/ranking/lollipop.md +39 -0
  402. package/docs/plots.md +22 -280
  403. package/docs/scales.md +30 -24
  404. package/docs/styles-and-segments.md +24 -21
  405. package/docs/theming.md +23 -20
  406. package/docs/timeline.md +3 -3
  407. package/docs/tooltip-and-hover.md +10 -10
  408. package/docs/transforms-and-statistics.md +13 -12
  409. package/examples/BarValues.svelte +1 -1
  410. package/examples/Box.svelte +1 -1
  411. package/examples/Bullet.svelte +17 -0
  412. package/examples/Chrome.svelte +1 -1
  413. package/examples/ChromeOrder.svelte +1 -1
  414. package/examples/Cleveland.svelte +15 -0
  415. package/examples/Composer.svelte +2 -2
  416. package/examples/CustomTooltip.svelte +1 -1
  417. package/examples/Density.svelte +7 -0
  418. package/examples/Dumbbell.svelte +16 -0
  419. package/examples/Facets.svelte +1 -1
  420. package/examples/FacetsCarousel.svelte +1 -1
  421. package/examples/FacetsRowsCols.svelte +1 -1
  422. package/examples/FirstPlot.svelte +1 -1
  423. package/examples/Forest.svelte +17 -0
  424. package/examples/Gaps.svelte +2 -2
  425. package/examples/GroupedBars.svelte +1 -1
  426. package/examples/Heatmap.svelte +3 -3
  427. package/examples/HeatmapSegments.svelte +8 -8
  428. package/examples/Histogram.svelte +1 -1
  429. package/examples/HorizontalBars.svelte +1 -1
  430. package/examples/LegendSections.svelte +1 -1
  431. package/examples/LegendToggle.svelte +1 -1
  432. package/examples/LineByRegion.svelte +1 -1
  433. package/examples/LineDates.svelte +1 -1
  434. package/examples/LineStep.svelte +16 -0
  435. package/examples/LineStepSegment.svelte +18 -0
  436. package/examples/Lollipop.svelte +17 -0
  437. package/examples/Markers.svelte +1 -1
  438. package/examples/MovingAverage.svelte +1 -1
  439. package/examples/Pyramid.svelte +9 -2
  440. package/examples/Regression.svelte +2 -2
  441. package/examples/ResponsiveLine.svelte +1 -1
  442. package/examples/Scales.svelte +1 -1
  443. package/examples/Scatter.svelte +2 -2
  444. package/examples/SegmentHighlight.svelte +1 -1
  445. package/examples/Segments.svelte +1 -1
  446. package/examples/SegmentsBySeries.svelte +1 -1
  447. package/examples/Slope.svelte +17 -0
  448. package/examples/Sparkline.svelte +14 -0
  449. package/examples/StackedArea.svelte +1 -1
  450. package/examples/StackedBars.svelte +1 -1
  451. package/examples/TimelinePlayer.svelte +1 -1
  452. package/examples/TimelineRule.svelte +1 -1
  453. package/examples/Tooltip.svelte +1 -1
  454. package/examples/ValueLabels.svelte +1 -1
  455. package/examples/Violin.svelte +14 -0
  456. package/examples/datasets/argentina-chile-trends.ts +34 -0
  457. package/examples/datasets/commodity-prices.ts +48 -0
  458. package/examples/datasets/countries-over-time.ts +368 -0
  459. package/examples/datasets/daily-temperature.ts +121 -0
  460. package/examples/datasets/earthquakes.ts +977 -0
  461. package/examples/datasets/flight-routes.ts +29 -0
  462. package/examples/datasets/height-density.ts +37 -0
  463. package/examples/datasets/heights.ts +370 -0
  464. package/examples/datasets/index.ts +24 -0
  465. package/examples/datasets/inflation-by-region.ts +44 -0
  466. package/examples/datasets/inflation-ranges.ts +34 -0
  467. package/examples/datasets/iris-flower.ts +207 -0
  468. package/examples/datasets/life-expectancy.ts +95 -0
  469. package/examples/datasets/napoleons-march.ts +182 -0
  470. package/examples/datasets/penguins.ts +54 -0
  471. package/examples/datasets/population-by-age-with-gaps.ts +23 -0
  472. package/examples/datasets/population-by-age.ts +890 -0
  473. package/examples/datasets/province-population.ts +521 -0
  474. package/examples/datasets/stock-prices.ts +63 -0
  475. package/examples/datasets/weather-stations-over-time.ts +31 -0
  476. package/examples/datasets/weather-stations.ts +22 -0
  477. package/examples/datasets/wind-vectors.ts +30 -0
  478. package/examples/datasets/world-temperature.ts +400 -0
  479. package/llms-full.txt +22 -11
  480. package/llms.txt +32 -4
  481. package/package.json +10 -1
  482. package/dist/plots/bar/defaults.d.ts +0 -9
  483. package/dist/plots/geo/features.svelte.d.ts +0 -5
  484. package/dist/plots/geo/features.svelte.js +0 -44
  485. package/dist/plots/geo/phases/tooltip.js +0 -5
  486. package/dist/plots/utils/geoAccessors.d.ts +0 -72
  487. package/dist/plots/utils/geoAccessors.js +0 -220
  488. package/dist/plots/utils/geoSegments.d.ts +0 -29
  489. package/dist/plots/utils/geoSegments.js +0 -37
  490. package/dist/types/layout/styles.d.ts +0 -122
  491. package/dist/types/markers/axis/curveName.d.ts +0 -2
  492. package/dist/types/plots/line/props.d.ts +0 -10
  493. package/dist/utils/color/contrast.d.ts +0 -9
  494. package/dist/utils/color/contrast.js +0 -40
  495. package/dist/utils/color/cssColor.d.ts +0 -4
  496. package/dist/utils/color/cssColor.js +0 -77
  497. package/dist/utils/color/ramp.d.ts +0 -17
  498. package/dist/utils/color/ramp.js +0 -110
  499. package/dist/utils/opacity.d.ts +0 -9
  500. package/dist/utils/opacity.js +0 -38
  501. package/examples/data.ts +0 -324
  502. /package/dist/plots/{box → distribution/box}/markers.js +0 -0
  503. /package/dist/types/layout/{styles.js → statistics/deviation.js} +0 -0
  504. /package/dist/types/{markers/axis/curveName.js → layout/styles/base.js} +0 -0
  505. /package/dist/types/{plots/area/props.js → layout/styles/bullet.js} +0 -0
  506. /package/dist/types/{plots/area/state.js → layout/styles/connector.js} +0 -0
  507. /package/dist/types/{plots/bar/props.js → layout/styles/curve.js} +0 -0
  508. /package/dist/types/{plots/bar/state.js → layout/styles/frame.js} +0 -0
  509. /package/dist/types/{plots/box/props.js → layout/styles/gaps.js} +0 -0
  510. /package/dist/types/{plots/box/state.js → layout/styles/geo.js} +0 -0
  511. /package/dist/types/{plots/geo/props.js → layout/styles/values.js} +0 -0
  512. /package/dist/types/{plots/geo/state.js → markers/axis/violin.js} +0 -0
  513. /package/dist/types/{plots/heatmap/props.js → markers/channels/commonMarkerConfigWithRowOffset.js} +0 -0
  514. /package/dist/types/plots/{histogram → correlation/heatmap}/props.js +0 -0
  515. /package/dist/types/plots/{heatmap → correlation/heatmap}/state.js +0 -0
  516. /package/dist/types/plots/{line → correlation/scatter}/props.js +0 -0
  517. /package/dist/types/plots/{histogram → correlation/scatter}/state.js +0 -0
  518. /package/dist/types/plots/{pyramid → distribution/box}/props.js +0 -0
  519. /package/dist/types/plots/{line → distribution/box}/state.js +0 -0
  520. /package/dist/types/plots/{scatter → distribution/density}/props.js +0 -0
  521. /package/dist/types/plots/{pyramid → distribution/density}/state.js +0 -0
  522. /package/dist/types/plots/{scatter/state.js → distribution/histogram/props.js} +0 -0
  523. /package/dist/{plots/utils → utils}/accessors.d.ts +0 -0
  524. /package/dist/{plots/utils → utils}/accessors.js +0 -0
@@ -2,6 +2,7 @@ import type { StrokeStyle, DotStyle, FontStyle, AreaStyle } from '../plots/styli
2
2
  import type { LineAnchor, SymbolType, TextAnchor } from '../plots/constants';
3
3
  import type { PlotChromeEntry } from '../plots/props';
4
4
  import type { EdgeTicksOptions } from '../layout/scales';
5
+ import type { CurveName } from '../layout/styles/curve';
5
6
  export type TextStyle = {
6
7
  /** font-family */
7
8
  font: string;
@@ -16,12 +17,32 @@ export type TextStyle = {
16
17
  /** letter-spacing */
17
18
  spacing: string;
18
19
  };
20
+ /** What the plots that join dots along a category (lollipop, dumbbell, Cleveland) read from their own configuration block. */
21
+ export type DotRangeStyling = {
22
+ /** Radius of every dot that sets none of its own, in px. */
23
+ dotRadius: number;
24
+ /** Whether every connector draws a cap - a short tick across it - at each end, unless `styles.connector.caps` says otherwise. */
25
+ caps?: boolean;
26
+ /** Width of every connector that sets none of its own, in px; `'dots'` makes it as thick as the dots are wide, a band. */
27
+ stemWidth: number | 'dots';
28
+ /** Color of the connector of a category with several dots; a lone dot's stem takes its series' color. Unset, the axis color. */
29
+ connectorColor?: string;
30
+ /** Gap, in px, between a dot and its value label, unless the labels' own `dx`/`dy` set one. */
31
+ labelGap: number;
32
+ /** Fallback gap (0-1) between neighbouring categories, when a plot doesn't set its own `scales.x/y.paddingInner`. */
33
+ paddingInner: number;
34
+ /** Fallback gap (0-1) before the first and after the last category, when a plot doesn't set its own `scales.x/y.paddingOuter`. */
35
+ paddingOuter: number;
36
+ };
19
37
  /** How a chrome divider's line is drawn, as a CSS border style. */
20
38
  export type DividerLineStyle = 'solid' | 'dashed' | 'dotted' | 'double';
21
39
  export type PlotStylesConfig = {
22
40
  font: string;
23
41
  color: string;
24
42
  background: string;
43
+ title: TextStyle;
44
+ subtitle: TextStyle;
45
+ caption: TextStyle;
25
46
  spacing: {
26
47
  headerPadding: string;
27
48
  legendPadding: string;
@@ -44,9 +65,63 @@ export type PlotStylesConfig = {
44
65
  /** The space between the blocks of a row of the chrome, as a CSS length. */
45
66
  rowGap: string;
46
67
  };
47
- title: TextStyle;
48
- subtitle: TextStyle;
49
- caption: TextStyle;
68
+ /** Discrete categorical palette (grouped series). */
69
+ palette: string[];
70
+ /** Default shape cycle for the `symbol` channel, in order. */
71
+ symbols: SymbolType[];
72
+ /** The default continuous ramp, the on-cell label colour and the default opacity-channel range. */
73
+ continuous: {
74
+ /** The ramp's first color, when it is not a named `scheme`. */
75
+ min: string;
76
+ /** The ramp's last color, when it is not a named `scheme`. */
77
+ max: string;
78
+ /** A named d3-scale-chromatic ramp (`'viridis'`, `'blues'`...), over `min` and `max`. */
79
+ scheme?: string;
80
+ /** The part of `scheme` to use, as `[from, to]` fractions of it: `[0.2, 1]` skips the near-white start of `'blues'`. */
81
+ schemeRange?: [number, number];
82
+ labelColor: string;
83
+ opacityRange: [number, number];
84
+ };
85
+ /**
86
+ * Per-side plot margin. `'auto'` (the default) lets svelteplot size that
87
+ * side to fit whatever it actually renders there - tick labels, an axis
88
+ * title, rotated ticks - instead of clipping content or leaving unused
89
+ * space. A number pins that side exactly, opting out of auto-sizing.
90
+ */
91
+ margins: {
92
+ top: number | 'auto';
93
+ right: number | 'auto';
94
+ bottom: number | 'auto';
95
+ left: number | 'auto';
96
+ };
97
+ /** Marker clipping to the plot's inner frame (see `FrameClip`). */
98
+ frameClip: {
99
+ /**
100
+ * How far (px) a clipped mark may reach past the frame before it's cut,
101
+ * so strokes and labels on the edge aren't shaved off. A number sets all
102
+ * four sides; a string takes CSS shorthand px values for 1-4 sides, e.g.
103
+ * `'4px'`, `'4px 8px'`, `'0 8px 4px'`, `'0 8px 4px 2px'`.
104
+ */
105
+ tolerance: number | string;
106
+ };
107
+ axis: {
108
+ color: string;
109
+ fontSize: number;
110
+ labelFontSize: number;
111
+ titleFontSize: number;
112
+ xTickSize: number;
113
+ yTickSize: number;
114
+ xTickPadding: number;
115
+ yTickPadding: number;
116
+ grid: boolean;
117
+ locale: string;
118
+ compactDisplay: 'short' | 'long';
119
+ edgeTicks: {
120
+ x: EdgeTicksOptions;
121
+ y: EdgeTicksOptions;
122
+ };
123
+ autoRotate: boolean;
124
+ };
50
125
  legend: {
51
126
  font: string;
52
127
  size: string;
@@ -95,6 +170,17 @@ export type PlotStylesConfig = {
95
170
  barHeight: number;
96
171
  /** Corner radius (px) of the gradient bar and excluded-range overlays. */
97
172
  barRadius: number;
173
+ /** The bar of an opacity section: one color fading over a checkerboard, so it reads as transparency and not as a color ramp. */
174
+ opacity: {
175
+ /** The color that fades, unless the marker it describes draws in one of its own. */
176
+ color: string;
177
+ /** The checkerboard behind the bar: its squares' size (px) and two colors. */
178
+ checker: {
179
+ size: number;
180
+ light: string;
181
+ dark: string;
182
+ };
183
+ };
98
184
  /** The draggable lo/hi handle. */
99
185
  handle: {
100
186
  width: string;
@@ -129,23 +215,6 @@ export type PlotStylesConfig = {
129
215
  };
130
216
  };
131
217
  };
132
- axis: {
133
- color: string;
134
- fontSize: number;
135
- labelFontSize: number;
136
- titleFontSize: number;
137
- xTickSize: number;
138
- yTickSize: number;
139
- xTickPadding: number;
140
- yTickPadding: number;
141
- grid: boolean;
142
- locale: string;
143
- compactDisplay: 'short' | 'long';
144
- edgeTicks: {
145
- x: EdgeTicksOptions;
146
- y: EdgeTicksOptions;
147
- };
148
- };
149
218
  tooltip: {
150
219
  background: string;
151
220
  color: string;
@@ -155,107 +224,35 @@ export type PlotStylesConfig = {
155
224
  border: string;
156
225
  };
157
226
  /**
158
- * Per-side plot margin. `'auto'` (the default) lets svelteplot size that
159
- * side to fit whatever it actually renders there - tick labels, an axis
160
- * title, rotated ticks - instead of clipping content or leaving unused
161
- * space. A number pins that side exactly, opting out of auto-sizing.
227
+ * In-SVG hover highlight: crosshair rule, dot + value label, and the area
228
+ * highlight - a restyled feature on `GeoPlot`, or an `areaX`/`areaY` band
229
+ * on an axis-based plot's band scale.
162
230
  */
163
- margins: {
164
- top: number | 'auto';
165
- right: number | 'auto';
166
- bottom: number | 'auto';
167
- left: number | 'auto';
168
- };
169
- /** Marker clipping to the plot's inner frame (see `FrameClip`). */
170
- frameClip: {
171
- /**
172
- * How far (px) a clipped mark may reach past the frame before it's cut,
173
- * so strokes and labels on the edge aren't shaved off. A number sets all
174
- * four sides; a string takes CSS shorthand px values for 1-4 sides, e.g.
175
- * `'4px'`, `'4px 8px'`, `'0 8px 4px'`, `'0 8px 4px 2px'`.
176
- */
177
- tolerance: number | string;
178
- };
179
- /** Discrete categorical palette (grouped series). */
180
- palette: string[];
181
- /** Default shape cycle for the `symbol` channel, in order. */
182
- symbols: SymbolType[];
183
- /** Continuous gradient endpoints + on-cell label colour, plus the default opacity-channel range. */
184
- continuous: {
185
- min: string;
186
- max: string;
187
- labelColor: string;
188
- opacityRange: [number, number];
231
+ hover: {
232
+ rule: StrokeStyle;
233
+ dot: DotStyle;
234
+ font: FontStyle;
235
+ area: AreaStyle;
189
236
  };
190
- /** Default line geometry. */
191
- line: {
192
- strokeWidth: number;
193
- dotRadius: number;
194
- /**
195
- * Default gap-fill bridge styling (`LinePlot`'s `styles.gaps`) - the
196
- * fallback merged under whatever a gap zone's own `style` sets, the
197
- * same way `hover.rule`/`hover.dot` back every hover marker's style.
198
- */
199
- gap: {
200
- stroke: StrokeStyle;
201
- dots: DotStyle;
237
+ facet: {
238
+ /** Position badge shown in `carousel`/`paginated` facet modes. */
239
+ indicator: {
240
+ background: string;
241
+ color: string;
242
+ fontSize: string;
243
+ padding: string;
244
+ radius: string;
202
245
  };
203
- };
204
- /** Default text-marker behavior. */
205
- text: {
206
- /** Geometry and connector of a decluttered text marker (`declutter`) - e.g. LinePlot's end-of-line value labels. */
207
- declutter: {
208
- /** Shortest lane's distance (px) from the point before a connector bends. */
209
- elbowGap: number;
210
- /** Extra distance (px) each further lane sits out from the last. */
211
- laneStep: number;
212
- /** Clearance (px) between the outermost lane and the label text. */
213
- labelGap: number;
214
- /** Default connector stroke. */
215
- connector: StrokeStyle;
246
+ /** Prev/next buttons shown in `paginated` facet mode. */
247
+ navButton: {
248
+ background: string;
249
+ color: string;
250
+ /** Button diameter (width and height). */
251
+ size: string;
252
+ fontSize: string;
253
+ disabledOpacity: number;
216
254
  };
217
255
  };
218
- /** Default bar-mark styling. */
219
- bar: {
220
- /** Default gap-fill styling (`BarPlot`'s `styles.gaps`) - the fallback merged under whatever a gap zone's own `style` sets. */
221
- gap: AreaStyle;
222
- /** Gap (0-1) between the bars of side-by-side series within one category, as a fraction of each bar's slice. */
223
- seriesPadding: number;
224
- /** Fallback gap (0-1) *between* category groups on BarPlot's own category axis, when a plot doesn't set its own `scales.x/y.paddingInner`. */
225
- paddingInner: number;
226
- /** Fallback gap (0-1) before the first and after the last category group on BarPlot's own category axis, when a plot doesn't set its own `scales.x/y.paddingOuter`. */
227
- paddingOuter: number;
228
- };
229
- /** Default pyramid-bar styling. */
230
- pyramid: {
231
- /** Default gap-fill styling (`PyramidPlot`'s `styles.gaps`) - the fallback merged under whatever a gap zone's own `style` sets. */
232
- gap: AreaStyle;
233
- };
234
- /** Default area-plot styling. */
235
- area: {
236
- /** Fill opacity of every area marker that sets none of its own. */
237
- fillOpacity: number;
238
- };
239
- /** Default histogram styling. */
240
- histogram: {
241
- /** Pixels taken off each side of every bar, so neighbouring bars leave a gap of twice this. */
242
- inset: number;
243
- /** Fill opacity of every bar, so a grouped histogram's bars behind another group's still show. */
244
- fillOpacity: number;
245
- };
246
- /** Default box-plot styling. */
247
- box: {
248
- /** Fill opacity of every box that sets none of its own. */
249
- fillOpacity: number;
250
- /** Fallback gap (0-1) between the boxes of neighbouring categories, when a plot doesn't set its own `scales.x/y.paddingInner`. */
251
- paddingInner: number;
252
- /** Fallback gap (0-1) before the first and after the last box, when a plot doesn't set its own `scales.x/y.paddingOuter`. */
253
- paddingOuter: number;
254
- };
255
- /** Default scatter point geometry. */
256
- scatter: {
257
- dotRadius: number;
258
- };
259
256
  /** Timeline gutter styling. */
260
257
  timeline: {
261
258
  axisColor: string;
@@ -326,16 +323,32 @@ export type PlotStylesConfig = {
326
323
  };
327
324
  };
328
325
  };
329
- /**
330
- * In-SVG hover highlight: crosshair rule, dot + value label, and the area
331
- * highlight - a restyled feature on `GeoPlot`, or an `areaX`/`areaY` band
332
- * on an axis-based plot's band scale.
333
- */
334
- hover: {
335
- rule: StrokeStyle;
336
- dot: DotStyle;
337
- font: FontStyle;
338
- area: AreaStyle;
326
+ /** What `styles.connector` falls back to on the plots that join dots (lollipop, dumbbell, Cleveland). */
327
+ connector: {
328
+ /** The colors of a connector colored `{ by: 'sign' }`: where the value rose, fell, or did not move. */
329
+ sign: {
330
+ positive: string;
331
+ negative: string;
332
+ zero: string;
333
+ };
334
+ /** The ramp of a connector colored `{ by: 'length' }`: from the shortest to the longest. */
335
+ lengthScheme: string[];
336
+ /** The ramp of a connector colored `{ by: 'difference' }`: falling, still, rising, meeting at 0. */
337
+ differenceScheme: string[];
338
+ /** Opacity (0-1) of the part of a connector outside the stretch between its `from` and `to` dots. */
339
+ outsideOpacity: number;
340
+ /** A connector drawn as an arrow (`styles.connector.arrow`): its thickness, and the length (px) and angle (degrees) of its head. */
341
+ arrow: {
342
+ width: number;
343
+ headLength: number;
344
+ headAngle: number;
345
+ };
346
+ /** The length (px) of the caps a connector draws at its ends (`styles.connector.caps`). */
347
+ capLength: number;
348
+ /** Font size of a connector's label, in px. */
349
+ labelFontSize: number;
350
+ /** Gap, in px, between a connector and its label when it is written beside it. */
351
+ labelGap: number;
339
352
  };
340
353
  /** The `delta` marker's label offset and anchor, per axis the delta is taken on. A marker's own `text` wins. */
341
354
  delta: {
@@ -346,28 +359,148 @@ export type PlotStylesConfig = {
346
359
  textAnchor: TextAnchor;
347
360
  }>;
348
361
  };
349
- facet: {
350
- /** Position badge shown in `carousel`/`paginated` facet modes. */
351
- indicator: {
352
- background: string;
353
- color: string;
354
- fontSize: string;
355
- padding: string;
356
- radius: string;
362
+ /** Default text-marker behavior. */
363
+ text: {
364
+ /** Geometry and connector of a decluttered text marker (`declutter`) - e.g. LinePlot's end-of-line value labels. */
365
+ declutter: {
366
+ /** Shortest lane's distance (px) from the point before a connector bends. */
367
+ elbowGap: number;
368
+ /** Extra distance (px) each further lane sits out from the last. */
369
+ laneStep: number;
370
+ /** Clearance (px) between the outermost lane and the label text. */
371
+ labelGap: number;
372
+ /** Default connector stroke. */
373
+ connector: StrokeStyle;
357
374
  };
358
- /** Prev/next buttons shown in `paginated` facet mode. */
359
- navButton: {
360
- background: string;
361
- color: string;
362
- /** Button diameter (width and height). */
363
- size: string;
364
- fontSize: string;
365
- disabledOpacity: number;
375
+ };
376
+ /** Default area-plot styling. */
377
+ area: {
378
+ /** Fill opacity of every area marker that sets none of its own. */
379
+ fillOpacity: number;
380
+ };
381
+ /** Default bar-mark styling. */
382
+ bar: {
383
+ /** Default gap-fill styling (`BarPlot`'s `styles.gaps`) - the fallback merged under whatever a gap zone's own `style` sets. */
384
+ gap: AreaStyle;
385
+ /** Gap (0-1) between the bars of side-by-side series within one category, as a fraction of each bar's slice. */
386
+ seriesPadding: number;
387
+ /** Fallback gap (0-1) *between* category groups on BarPlot's own category axis, when a plot doesn't set its own `scales.x/y.paddingInner`. */
388
+ paddingInner: number;
389
+ /** Fallback gap (0-1) before the first and after the last category group on BarPlot's own category axis, when a plot doesn't set its own `scales.x/y.paddingOuter`. */
390
+ paddingOuter: number;
391
+ };
392
+ /** Default box-plot styling. */
393
+ box: {
394
+ /** Fill opacity of every box that sets none of its own. */
395
+ fillOpacity: number;
396
+ /** Fallback gap (0-1) between the boxes of neighbouring categories, when a plot doesn't set its own `scales.x/y.paddingInner`. */
397
+ paddingInner: number;
398
+ /** Fallback gap (0-1) before the first and after the last box, when a plot doesn't set its own `scales.x/y.paddingOuter`. */
399
+ paddingOuter: number;
400
+ };
401
+ /** Default bullet-plot styling: a bar over graded ranges, with a tick at its target. */
402
+ bullet: {
403
+ /** The bar's thickness (px) across its category band. */
404
+ barThickness: number;
405
+ /** The thickness (px) of the bands that grade the value. */
406
+ rangeWidth: number;
407
+ /** The colors of those bands, from the smallest to the largest; the last one repeats if there are more bands. */
408
+ rangeColors: string[];
409
+ /** The length (px) and thickness of the target tick. */
410
+ targetLength: number;
411
+ targetWidth: number;
412
+ /** The target tick's color; the axis color when unset. */
413
+ targetColor?: string;
414
+ /** Padding between category bands, as fractions (0-1) of a band. */
415
+ paddingInner: number;
416
+ paddingOuter: number;
417
+ };
418
+ /** Default Cleveland-plot styling. */
419
+ cleveland: DotRangeStyling;
420
+ /** Default density-plot styling. */
421
+ density: {
422
+ /** Fill opacity of every area, so a grouped density's curves behind another group's still show. */
423
+ fillOpacity: number;
424
+ /** Stroke width of every curve drawn as a line. */
425
+ strokeWidth: number;
426
+ };
427
+ /** Default dumbbell-plot styling. */
428
+ dumbbell: DotRangeStyling;
429
+ /** Default forest-plot styling: the dot is the estimate, the stem its interval. */
430
+ forest: DotRangeStyling;
431
+ /** Default histogram styling. */
432
+ histogram: {
433
+ /** Pixels taken off each side of every bar, so neighbouring bars leave a gap of twice this. */
434
+ inset: number;
435
+ /** Fill opacity of every bar, so a grouped histogram's bars behind another group's still show. */
436
+ fillOpacity: number;
437
+ };
438
+ /** Default line geometry. */
439
+ line: {
440
+ /** Curve of every line that sets none (`styles.curve`, a segment's `curve`): `'auto'` joins the points with straight segments, or along the great circle on a projected map. */
441
+ curve: CurveName | 'auto';
442
+ strokeWidth: number;
443
+ dotRadius: number;
444
+ /**
445
+ * Default gap-fill bridge styling (`LinePlot`'s `styles.gaps`) - the
446
+ * fallback merged under whatever a gap zone's own `style` sets, the
447
+ * same way `hover.rule`/`hover.dot` back every hover marker's style.
448
+ */
449
+ gap: {
450
+ stroke: StrokeStyle;
451
+ dots: DotStyle;
366
452
  };
367
453
  };
454
+ /** Default lollipop-plot styling. */
455
+ lollipop: DotRangeStyling;
456
+ /** Default pyramid-bar styling. */
457
+ pyramid: {
458
+ /** Default gap-fill styling (`PyramidPlot`'s `styles.gaps`) - the fallback merged under whatever a gap zone's own `style` sets. */
459
+ gap: AreaStyle;
460
+ };
461
+ /** Default scatter point geometry. */
462
+ scatter: {
463
+ dotRadius: number;
464
+ };
465
+ /** Default slope-plot styling: a line and a dot per series between the positions of its category axis. */
466
+ slope: {
467
+ strokeWidth: number;
468
+ dotRadius: number;
469
+ /** Space (0-1, as a fraction of the step between positions) left outside the first and last position; the labels' margins grow beyond it. */
470
+ padding: number;
471
+ };
472
+ /** Default sparkline styling: a thin line, and the dot on its last point. */
473
+ sparkline: {
474
+ strokeWidth: number;
475
+ dotRadius: number;
476
+ };
477
+ /** Default violin-plot styling. */
478
+ violin: {
479
+ /** Fill opacity of every violin that sets none of its own. */
480
+ fillOpacity: number;
481
+ /** Fallback gap (0-1) between the violins of neighbouring categories, when a plot doesn't set its own `scales.x/y.paddingInner`. */
482
+ paddingInner: number;
483
+ /** Fallback gap (0-1) before the first and after the last violin, when a plot doesn't set its own `scales.x/y.paddingOuter`. */
484
+ paddingOuter: number;
485
+ /** Width (px) of the box inside each violin. */
486
+ boxWidth: number;
487
+ };
488
+ };
489
+ /**
490
+ * A categorical palette as `setConfiguration` takes it: a list of colors, or the name of a
491
+ * d3-scale-chromatic scheme - a color list (`'dark2'`, `'tableau10'`...) or a ramp (`'viridis'`,
492
+ * `'blues'`...) - or one with its own `count` of colors (8 for a ramp) and `schemeRange`, the part of
493
+ * the ramp to spread them over (`[0.3, 1]` skips the near-white start of `'blues'`).
494
+ */
495
+ export type PaletteInput = string[] | string | {
496
+ scheme: string;
497
+ count?: number;
498
+ schemeRange?: [number, number];
368
499
  };
369
500
  /** Deep-partial input accepted by `setConfiguration`. */
370
- export type PlotStylesConfigInput = DeepPartial<PlotStylesConfig>;
501
+ export type PlotStylesConfigInput = Omit<DeepPartial<PlotStylesConfig>, 'palette'> & {
502
+ palette?: PaletteInput;
503
+ };
371
504
  type DeepPartial<T> = {
372
505
  [K in keyof T]?: T[K] extends (infer U)[] ? U[] : T[K] extends object ? DeepPartial<T[K]> : T[K];
373
506
  };
@@ -1,6 +1,6 @@
1
1
  import type { GeoProjection } from 'd3-geo';
2
2
  import type { GeoCameraConfig } from '../plots/camera';
3
- import type { ChannelScalesConfig, LengthScaleConfig } from './scales';
3
+ import type { ChannelScalesConfig, LengthScaleConfig, RScaleConfig } from './scales';
4
4
  /**
5
5
  * The projection names svelteplot's `<Plot projection>` accepts as a string
6
6
  * (svelteplot itself doesn't export this as a type - defined here so authors
@@ -47,11 +47,12 @@ export type GeoProjectionConfig = GeoProjectionName | {
47
47
  /**
48
48
  * `scales` prop for GeoPlot - the geo analog of `AxisBasedScalesConfig`. A
49
49
  * map has no x/y axis pair (the coordinate system is `coordinates.projection`),
50
- * so this carries the channels in {@link ChannelScalesConfig} plus `length` -
51
- * GeoPlot's own plot-wide-only channel (a `vector` marker's magnitude),
52
- * the geo analog of `AxisBasedScalesConfig.r`.
50
+ * so this carries the channels in {@link ChannelScalesConfig} plus the two
51
+ * plot-wide-only ones: `r` (a `dot` marker's size) and `length` (a `vector`
52
+ * marker's magnitude).
53
53
  */
54
54
  export type GeoScalesConfig = ChannelScalesConfig & {
55
+ r?: RScaleConfig;
55
56
  length?: LengthScaleConfig;
56
57
  };
57
58
  /** Wheel/pinch scale gesture only - see `CoordinatesConfig.pan` for drag-to-translate, and `.rotate` for drag-to-spin-the-globe. */
@@ -111,6 +111,8 @@ export type ContinuousInteractiveConfig = {
111
111
  export type ContinuousLegendSection = {
112
112
  type: 'continuous';
113
113
  title?: string;
114
+ /** The channel the section reads, which tells apart automatic sections that share a title. */
115
+ channel?: Exclude<LegendChannel, 'series'>;
114
116
  columns?: number;
115
117
  min: number;
116
118
  max: number;
@@ -120,7 +122,7 @@ export type ContinuousLegendSection = {
120
122
  scheme?: string | string[];
121
123
  /** Splits an array `scheme` into two halves meeting at this value (diverging). */
122
124
  pivot?: number;
123
- /** Draws the bar in one color (`colorMin`, the text color by default) fading across this opacity range, instead of a color ramp. */
125
+ /** Draws the bar in one color (`colorMin`, `legend.continuous.opacity.color` by default) fading across this opacity range over a checkerboard, instead of a color ramp. */
124
126
  opacity?: [number, number];
125
127
  ticks?: number[];
126
128
  width?: number;
@@ -135,6 +137,8 @@ export type ContinuousLegendSection = {
135
137
  export type SizeLegendSection = {
136
138
  type: 'size';
137
139
  title?: string;
140
+ /** The channel the section reads, which tells apart automatic sections that share a title. */
141
+ channel?: Exclude<LegendChannel, 'series'>;
138
142
  columns?: number;
139
143
  domain: [number, number];
140
144
  range: [number, number];
@@ -157,6 +161,8 @@ export type SizeLegendSection = {
157
161
  export type SymbolLegendSection = {
158
162
  type: 'symbol';
159
163
  title?: string;
164
+ /** The channel the section reads, which tells apart automatic sections that share a title. */
165
+ channel?: Exclude<LegendChannel, 'series'>;
160
166
  columns?: number;
161
167
  /** Item flow direction, as in a discrete section. */
162
168
  layout?: LegendItemsLayout;
@@ -247,8 +253,8 @@ export type LegendEntry = {
247
253
  export type MarkLegend = string | (Omit<LegendItem, 'name' | 'disabled'> & {
248
254
  label: string;
249
255
  });
250
- /** What a legend reads each automatic section from: the series, or the channel a scale encodes. */
251
- export type LegendChannel = 'series' | 'color' | 'opacity' | 'size' | 'symbol';
256
+ /** What a legend reads each automatic section from: the series, or the channel a scale encodes - named as the plot's own prop (`r` for sizes). */
257
+ export type LegendChannel = 'series' | 'color' | 'opacity' | 'r' | 'symbol';
252
258
  /**
253
259
  * How to adjust one automatic section: its own configuration, minus what the
254
260
  * plots compute for it. An entry with a `match` (one, or several in a list) adjusts
@@ -289,7 +295,7 @@ export type LegendExtension = {
289
295
  series?: Omit<DiscreteLegendSection, 'type' | 'items'>;
290
296
  color?: ColorOverride | ColorOverride[];
291
297
  opacity?: LegendOverride<ContinuousLegendSection, 'min' | 'max' | 'colorMin' | 'colorMax' | 'scheme' | 'pivot' | 'opacity' | 'interactive'>;
292
- size?: LegendOverride<SizeLegendSection, 'domain' | 'range' | 'color' | 'filled' | 'symbol'>;
298
+ r?: LegendOverride<SizeLegendSection, 'domain' | 'range' | 'color' | 'filled' | 'symbol'>;
293
299
  symbol?: LegendOverride<SymbolLegendSection, 'items' | 'color' | 'filled'>;
294
300
  };
295
301
  /** A segment or marker as the legend reads it: whether it names itself, the channels it draws with and the colors it draws in. */
@@ -306,7 +312,7 @@ export type LegendSource = {
306
312
  opacity?: OpacityScaleConfig;
307
313
  symbol?: SymbolScaleConfig;
308
314
  };
309
- legend?: MarkLegend;
315
+ legend?: MarkLegend | false;
310
316
  fill?: unknown;
311
317
  stroke?: unknown;
312
318
  styles?: {
@@ -322,12 +328,22 @@ export type LegendSource = {
322
328
  export type LegendPlot = {
323
329
  resolvedSeries?: {
324
330
  name: string;
331
+ data?: unknown[];
325
332
  }[];
326
333
  colorForSeries?: (name: string) => string;
327
334
  markers?: LegendSource[];
328
335
  segments?: Record<string, LegendSource[] | undefined>;
329
336
  /** The `[min, max]` a plot-level color ramp spans, when the plot has no `color` channel to read it from. */
330
337
  colorDomain?: [number, number];
338
+ /** The ramps of the segments that set their own color scale, each over its own features' values. */
339
+ colorRamps?: {
340
+ name: string;
341
+ domain: [number, number];
342
+ scale: {
343
+ scheme?: unknown;
344
+ pivot?: number;
345
+ };
346
+ }[];
331
347
  /** The `[min, max]` of a plot-level numeric `opacity` channel. */
332
348
  opacityDomain?: [number, number];
333
349
  channels?: {
@@ -1,7 +1,12 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import type { TimeValue } from './timeline';
3
3
  import type { GridPlacement } from './grid';
4
- import type { MarginConfig, TooltipConfig } from '../plots/props';
4
+ import type { MarginConfig, TooltipConfig, HoverConfig as PlotHoverConfig } from '../plots/props';
5
+ import type { Margins as MarginsType } from '../../layout/margins/Margins';
6
+ import type { EdgeBox } from './box';
7
+ import type { StylesLayoutConfig } from './styles';
8
+ import type { HoverPosition } from '../phases';
9
+ import type { PlotAxes } from '../../phases/data/PlotAxes';
5
10
  /** Where one cell sits among the slices: the timeline step and the facet it shows. */
6
11
  export type SlicePlace = {
7
12
  time?: TimeValue;
@@ -39,3 +44,41 @@ export type PlotCoreBase = GridPlacement & {
39
44
  scales?: object;
40
45
  margins?: MarginConfig;
41
46
  };
47
+ /**
48
+ * What `BasePlotLayout` draws from: the end of a plot's pipeline. An axis
49
+ * kind's state is one as is; GeoPlot builds its own.
50
+ */
51
+ export type PlotLayoutState = {
52
+ /** What the pointer can match, and how the hover reads. */
53
+ hover?: PlotHoverConfig<any>;
54
+ /** Where each row sits, for hover matching and the plot's scales. */
55
+ hoverPosition?: HoverPosition;
56
+ /** The rows the plot draws and hovers over. */
57
+ hoverRows?: unknown[];
58
+ /** The plot's x/y/r/length scales, and the scales a marker without its own inherits. */
59
+ scales?: object;
60
+ /** The axes whose domain the plot kind fit itself rather than the author pinned. */
61
+ fittedAxes?: string[];
62
+ /** What the plot's position channels are and which way it runs, for what draws inside it. */
63
+ axes?: PlotAxes;
64
+ /** The plot's channels as given, whose field titles an axis with no rows. */
65
+ channels?: Record<string, {
66
+ source?: unknown;
67
+ } | undefined>;
68
+ /** Every marker the pipeline resolved. */
69
+ markers?: object[];
70
+ /** All resolved series - axis kinds only. */
71
+ resolvedSeries?: object[];
72
+ /** Each series' color, by name - axis kinds only. */
73
+ colorForSeries?: (name: string) => string;
74
+ /** Per-series marker groups - axis kinds only. */
75
+ scopedGroups?: object[];
76
+ /** The plot's `styles`: its frame and, on a map, its tile layer. */
77
+ styles?: StylesLayoutConfig;
78
+ /** What an `'auto'` margin side reads as. Defaults to {@link Margins.AXIS_ESTIMATE}. */
79
+ marginEstimate?: MarginsType;
80
+ /** The plot's value labels, whose `reach` is the room the margins start from. */
81
+ valueLabels?: {
82
+ reach: EdgeBox[];
83
+ };
84
+ };