@d3plus/core 4.5.0 → 4.7.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 (312) hide show
  1. package/README.md +3930 -2032
  2. package/es/index.js +3 -3
  3. package/es/index.js.map +1 -1
  4. package/es/internal.js +11 -1
  5. package/es/internal.js.map +1 -1
  6. package/es/src/charts/BarChart/index.js +8 -1
  7. package/es/src/charts/BarChart/index.js.map +1 -1
  8. package/es/src/charts/BoxWhisker/index.js +5 -0
  9. package/es/src/charts/BoxWhisker/index.js.map +1 -1
  10. package/es/src/charts/Chord/emit.js +55 -3
  11. package/es/src/charts/Chord/emit.js.map +1 -1
  12. package/es/src/charts/Chord/index.js +17 -0
  13. package/es/src/charts/Chord/index.js.map +1 -1
  14. package/es/src/charts/Geomap/applyLayout.js +20 -11
  15. package/es/src/charts/Geomap/applyLayout.js.map +1 -1
  16. package/es/src/charts/Geomap/index.js +8 -2
  17. package/es/src/charts/Geomap/index.js.map +1 -1
  18. package/es/src/charts/Histogram/binData.js +225 -0
  19. package/es/src/charts/Histogram/binData.js.map +1 -0
  20. package/es/src/charts/Histogram/index.js +271 -0
  21. package/es/src/charts/Histogram/index.js.map +1 -0
  22. package/es/src/charts/Matrix/emit.js +5 -4
  23. package/es/src/charts/Matrix/emit.js.map +1 -1
  24. package/es/src/charts/Network/applyLayout.js +52 -4
  25. package/es/src/charts/Network/applyLayout.js.map +1 -1
  26. package/es/src/charts/Network/emit.js +4 -4
  27. package/es/src/charts/Network/emit.js.map +1 -1
  28. package/es/src/charts/Network/index.js +10 -1
  29. package/es/src/charts/Network/index.js.map +1 -1
  30. package/es/src/charts/Pack/emit.js +42 -7
  31. package/es/src/charts/Pack/emit.js.map +1 -1
  32. package/es/src/charts/Pack/index.js +15 -0
  33. package/es/src/charts/Pack/index.js.map +1 -1
  34. package/es/src/charts/Pie/applyLayout.js +20 -2
  35. package/es/src/charts/Pie/applyLayout.js.map +1 -1
  36. package/es/src/charts/Pie/emit.js +275 -35
  37. package/es/src/charts/Pie/emit.js.map +1 -1
  38. package/es/src/charts/Pie/index.js +48 -1
  39. package/es/src/charts/Pie/index.js.map +1 -1
  40. package/es/src/charts/Plot/discreteSpan.js +42 -0
  41. package/es/src/charts/Plot/discreteSpan.js.map +1 -0
  42. package/es/src/charts/Plot/draw.js +3 -1
  43. package/es/src/charts/Plot/draw.js.map +1 -1
  44. package/es/src/charts/Plot/index.js +143 -14
  45. package/es/src/charts/Plot/index.js.map +1 -1
  46. package/es/src/charts/Plot/insetRegion.js +21 -0
  47. package/es/src/charts/Plot/insetRegion.js.map +1 -0
  48. package/es/src/charts/Plot/pipeline.js +47 -20
  49. package/es/src/charts/Plot/pipeline.js.map +1 -1
  50. package/es/src/charts/Plot/pipelineDomains.js +84 -8
  51. package/es/src/charts/Plot/pipelineDomains.js.map +1 -1
  52. package/es/src/charts/Plot/shapeDefaults.js +3 -3
  53. package/es/src/charts/Plot/shapeDefaults.js.map +1 -1
  54. package/es/src/charts/Plot/sharedHover.js +532 -0
  55. package/es/src/charts/Plot/sharedHover.js.map +1 -0
  56. package/es/src/charts/Plot/sharedHoverScene.js +230 -0
  57. package/es/src/charts/Plot/sharedHoverScene.js.map +1 -0
  58. package/es/src/charts/Plot/sharedTooltip.js +183 -0
  59. package/es/src/charts/Plot/sharedTooltip.js.map +1 -0
  60. package/es/src/charts/Plot/stackShareLabels.js +137 -0
  61. package/es/src/charts/Plot/stackShareLabels.js.map +1 -0
  62. package/es/src/charts/Plot/stackShareTooltip.js +31 -0
  63. package/es/src/charts/Plot/stackShareTooltip.js.map +1 -0
  64. package/es/src/charts/Plot/trendLines.js +469 -0
  65. package/es/src/charts/Plot/trendLines.js.map +1 -0
  66. package/es/src/charts/Plot/trendProjection.js +120 -0
  67. package/es/src/charts/Plot/trendProjection.js.map +1 -0
  68. package/es/src/charts/Plot/trendScene.js +234 -0
  69. package/es/src/charts/Plot/trendScene.js.map +1 -0
  70. package/es/src/charts/Plot/trendTooltip.js +222 -0
  71. package/es/src/charts/Plot/trendTooltip.js.map +1 -0
  72. package/es/src/charts/Priestley/emit.js +34 -6
  73. package/es/src/charts/Priestley/emit.js.map +1 -1
  74. package/es/src/charts/Radar/index.js +15 -2
  75. package/es/src/charts/Radar/index.js.map +1 -1
  76. package/es/src/charts/RadialMatrix/emit.js +4 -4
  77. package/es/src/charts/RadialMatrix/emit.js.map +1 -1
  78. package/es/src/charts/RadialMatrix/index.js +17 -1
  79. package/es/src/charts/RadialMatrix/index.js.map +1 -1
  80. package/es/src/charts/Rings/applyLayout.js +72 -116
  81. package/es/src/charts/Rings/applyLayout.js.map +1 -1
  82. package/es/src/charts/Rings/emit.js +2 -3
  83. package/es/src/charts/Rings/emit.js.map +1 -1
  84. package/es/src/charts/Rings/index.js +18 -3
  85. package/es/src/charts/Rings/index.js.map +1 -1
  86. package/es/src/charts/Rings/ringsSizing.js +189 -0
  87. package/es/src/charts/Rings/ringsSizing.js.map +1 -0
  88. package/es/src/charts/Sankey/index.js +2 -0
  89. package/es/src/charts/Sankey/index.js.map +1 -1
  90. package/es/src/charts/StackedArea/index.js +8 -1
  91. package/es/src/charts/StackedArea/index.js.map +1 -1
  92. package/es/src/charts/Tree/emit.js +2 -2
  93. package/es/src/charts/Tree/emit.js.map +1 -1
  94. package/es/src/charts/Tree/index.js +7 -3
  95. package/es/src/charts/Tree/index.js.map +1 -1
  96. package/es/src/charts/Treemap/emit.js +58 -6
  97. package/es/src/charts/Treemap/emit.js.map +1 -1
  98. package/es/src/charts/definition/ChartDefinition.js.map +1 -1
  99. package/es/src/charts/definition/makeChart.js +14 -1
  100. package/es/src/charts/definition/makeChart.js.map +1 -1
  101. package/es/src/charts/drawSteps/backControl.js +17 -2
  102. package/es/src/charts/drawSteps/backControl.js.map +1 -1
  103. package/es/src/charts/drawSteps/bottomRightControls.js +196 -0
  104. package/es/src/charts/drawSteps/bottomRightControls.js.map +1 -0
  105. package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +292 -0
  106. package/es/src/charts/drawSteps/bottomRightControlsMarkup.js.map +1 -0
  107. package/es/src/charts/drawSteps/minimap.js +34 -9
  108. package/es/src/charts/drawSteps/minimap.js.map +1 -1
  109. package/es/src/charts/drawSteps/searchControlsMarkup.js +15 -38
  110. package/es/src/charts/drawSteps/searchControlsMarkup.js.map +1 -1
  111. package/es/src/charts/drawSteps/zoomControls.js +3 -0
  112. package/es/src/charts/drawSteps/zoomControls.js.map +1 -1
  113. package/es/src/charts/events/click.legend.js +10 -5
  114. package/es/src/charts/events/click.legend.js.map +1 -1
  115. package/es/src/charts/events/click.shape.js +24 -1
  116. package/es/src/charts/events/click.shape.js.map +1 -1
  117. package/es/src/charts/events/mouseenter.js +3 -0
  118. package/es/src/charts/events/mouseenter.js.map +1 -1
  119. package/es/src/charts/events/mouseleave.js +3 -0
  120. package/es/src/charts/events/mouseleave.js.map +1 -1
  121. package/es/src/charts/events/mousemove.shape.js +10 -1
  122. package/es/src/charts/events/mousemove.shape.js.map +1 -1
  123. package/es/src/charts/features/axes.js +4 -1
  124. package/es/src/charts/features/axes.js.map +1 -1
  125. package/es/src/charts/features/emitHelpers.js +43 -5
  126. package/es/src/charts/features/emitHelpers.js.map +1 -1
  127. package/es/src/charts/features/features.js +3 -104
  128. package/es/src/charts/features/features.js.map +1 -1
  129. package/es/src/charts/features/featuresColorScale.js +161 -0
  130. package/es/src/charts/features/featuresColorScale.js.map +1 -0
  131. package/es/src/charts/features/featuresLegend.js +155 -34
  132. package/es/src/charts/features/featuresLegend.js.map +1 -1
  133. package/es/src/charts/features/insetState.js +174 -0
  134. package/es/src/charts/features/insetState.js.map +1 -0
  135. package/es/src/charts/features/plotPaint.js +51 -24
  136. package/es/src/charts/features/plotPaint.js.map +1 -1
  137. package/es/src/charts/features/sceneBounds.js +271 -0
  138. package/es/src/charts/features/sceneBounds.js.map +1 -0
  139. package/es/src/charts/features/shapeEmit.js +20 -2
  140. package/es/src/charts/features/shapeEmit.js.map +1 -1
  141. package/es/src/charts/features/tooltipSwatch.js +73 -0
  142. package/es/src/charts/features/tooltipSwatch.js.map +1 -0
  143. package/es/src/charts/index.js +1 -0
  144. package/es/src/charts/index.js.map +1 -1
  145. package/es/src/charts/pipeline/drillMorph.js +159 -0
  146. package/es/src/charts/pipeline/drillMorph.js.map +1 -0
  147. package/es/src/charts/pipeline/insetPlacement.js +406 -0
  148. package/es/src/charts/pipeline/insetPlacement.js.map +1 -0
  149. package/es/src/charts/pipeline/runChartDraw.js +35 -1
  150. package/es/src/charts/pipeline/runChartDraw.js.map +1 -1
  151. package/es/src/charts/pipeline/runVizPipeline.js +22 -3
  152. package/es/src/charts/pipeline/runVizPipeline.js.map +1 -1
  153. package/es/src/charts/pipeline/vizDrawPure.js +20 -0
  154. package/es/src/charts/pipeline/vizDrawPure.js.map +1 -1
  155. package/es/src/charts/viz/Viz.js +82 -11
  156. package/es/src/charts/viz/Viz.js.map +1 -1
  157. package/es/src/charts/viz/VizBase.js +29 -1
  158. package/es/src/charts/viz/VizBase.js.map +1 -1
  159. package/es/src/charts/viz/VizBaseConfig.js +25 -21
  160. package/es/src/charts/viz/VizBaseConfig.js.map +1 -1
  161. package/es/src/charts/viz/interactionOpacity.js +21 -13
  162. package/es/src/charts/viz/interactionOpacity.js.map +1 -1
  163. package/es/src/charts/viz/linkGroup.js +386 -0
  164. package/es/src/charts/viz/linkGroup.js.map +1 -0
  165. package/es/src/charts/viz/ordinalColor.js +2 -2
  166. package/es/src/charts/viz/ordinalColor.js.map +1 -1
  167. package/es/src/charts/viz/sceneRows.js +33 -0
  168. package/es/src/charts/viz/sceneRows.js.map +1 -0
  169. package/es/src/charts/viz/vizDefaults.js +39 -15
  170. package/es/src/charts/viz/vizDefaults.js.map +1 -1
  171. package/es/src/charts/viz/vizRender.js +54 -4
  172. package/es/src/charts/viz/vizRender.js.map +1 -1
  173. package/es/src/charts/viz/vizTypes.js.map +1 -1
  174. package/es/src/charts/viz/vizVisibility.js +145 -0
  175. package/es/src/charts/viz/vizVisibility.js.map +1 -0
  176. package/es/src/components/Axis/Axis.js +8 -8
  177. package/es/src/components/Axis/Axis.js.map +1 -1
  178. package/es/src/components/Axis/AxisBottom.js +1 -1
  179. package/es/src/components/Axis/AxisBottom.js.map +1 -1
  180. package/es/src/components/Axis/AxisLeft.js +1 -1
  181. package/es/src/components/Axis/AxisLeft.js.map +1 -1
  182. package/es/src/components/Axis/AxisRight.js +1 -1
  183. package/es/src/components/Axis/AxisRight.js.map +1 -1
  184. package/es/src/components/Axis/AxisTop.js +1 -1
  185. package/es/src/components/Axis/AxisTop.js.map +1 -1
  186. package/es/src/components/Axis/axisLayoutLabels.js +13 -1
  187. package/es/src/components/Axis/axisLayoutLabels.js.map +1 -1
  188. package/es/src/components/ColorScale/ColorScale.js +11 -11
  189. package/es/src/components/ColorScale/ColorScale.js.map +1 -1
  190. package/es/src/components/ColorScale/colorScaleScale.js +22 -10
  191. package/es/src/components/ColorScale/colorScaleScale.js.map +1 -1
  192. package/es/src/components/Legend/Legend.js +8 -5
  193. package/es/src/components/Legend/Legend.js.map +1 -1
  194. package/es/src/components/Legend/legendConfig.js +3 -2
  195. package/es/src/components/Legend/legendConfig.js.map +1 -1
  196. package/es/src/components/Legend/legendRender.js +70 -26
  197. package/es/src/components/Legend/legendRender.js.map +1 -1
  198. package/es/src/components/SizeLegend/SizeLegend.js +411 -0
  199. package/es/src/components/SizeLegend/SizeLegend.js.map +1 -0
  200. package/es/src/components/SizeLegend/sizeLegendLayout.js +285 -0
  201. package/es/src/components/SizeLegend/sizeLegendLayout.js.map +1 -0
  202. package/es/src/components/TextBox.js +1 -1
  203. package/es/src/components/TextBox.js.map +1 -1
  204. package/es/src/components/Timeline/timelineConfig.js +8 -4
  205. package/es/src/components/Timeline/timelineConfig.js.map +1 -1
  206. package/es/src/components/Timeline/timelineRender.js +1 -2
  207. package/es/src/components/Timeline/timelineRender.js.map +1 -1
  208. package/es/src/components/Tooltip.js +27 -7
  209. package/es/src/components/Tooltip.js.map +1 -1
  210. package/es/src/components/index.js +1 -0
  211. package/es/src/components/index.js.map +1 -1
  212. package/es/src/shapes/Bar.js +1 -1
  213. package/es/src/shapes/Bar.js.map +1 -1
  214. package/es/src/shapes/Box.js +5 -3
  215. package/es/src/shapes/Box.js.map +1 -1
  216. package/es/src/shapes/Rect.js +1 -1
  217. package/es/src/shapes/Rect.js.map +1 -1
  218. package/es/src/shapes/Shape.js +10 -37
  219. package/es/src/shapes/Shape.js.map +1 -1
  220. package/es/src/shapes/Whisker.js +4 -3
  221. package/es/src/shapes/Whisker.js.map +1 -1
  222. package/es/src/shapes/textureKey.js +104 -0
  223. package/es/src/shapes/textureKey.js.map +1 -0
  224. package/es/src/shapes/validateShapeConfig.js +141 -0
  225. package/es/src/shapes/validateShapeConfig.js.map +1 -0
  226. package/es/src/utils/BaseClass.js +134 -4
  227. package/es/src/utils/BaseClass.js.map +1 -1
  228. package/es/src/utils/D3plusConfig.js.map +1 -1
  229. package/es/src/utils/configDefault.js +17 -0
  230. package/es/src/utils/configDefault.js.map +1 -0
  231. package/es/src/utils/configPrep.js +2 -1
  232. package/es/src/utils/configPrep.js.map +1 -1
  233. package/es/src/utils/configWarnings.js +37 -0
  234. package/es/src/utils/configWarnings.js.map +1 -0
  235. package/es/src/utils/index.js +1 -0
  236. package/es/src/utils/index.js.map +1 -1
  237. package/package.json +12 -10
  238. package/types/index.d.ts +5 -4
  239. package/types/internal.d.ts +15 -1
  240. package/types/src/charts/BarChart/index.d.ts +2 -1
  241. package/types/src/charts/Geomap/applyLayout.d.ts +9 -1
  242. package/types/src/charts/Histogram/binData.d.ts +37 -0
  243. package/types/src/charts/Histogram/index.d.ts +14 -0
  244. package/types/src/charts/Network/applyLayout.d.ts +8 -0
  245. package/types/src/charts/Plot/discreteSpan.d.ts +9 -0
  246. package/types/src/charts/Plot/index.d.ts +47 -0
  247. package/types/src/charts/Plot/insetRegion.d.ts +4 -0
  248. package/types/src/charts/Plot/pipeline.d.ts +14 -0
  249. package/types/src/charts/Plot/sharedHover.d.ts +84 -0
  250. package/types/src/charts/Plot/sharedHoverScene.d.ts +11 -0
  251. package/types/src/charts/Plot/sharedTooltip.d.ts +36 -0
  252. package/types/src/charts/Plot/stackShareLabels.d.ts +21 -0
  253. package/types/src/charts/Plot/stackShareTooltip.d.ts +9 -0
  254. package/types/src/charts/Plot/trendLines.d.ts +90 -0
  255. package/types/src/charts/Plot/trendProjection.d.ts +28 -0
  256. package/types/src/charts/Plot/trendScene.d.ts +19 -0
  257. package/types/src/charts/Plot/trendTooltip.d.ts +30 -0
  258. package/types/src/charts/Rings/applyLayout.d.ts +9 -0
  259. package/types/src/charts/Rings/ringsSizing.d.ts +49 -0
  260. package/types/src/charts/StackedArea/index.d.ts +2 -1
  261. package/types/src/charts/definition/ChartDefinition.d.ts +39 -0
  262. package/types/src/charts/definition/makeChart.d.ts +2 -1
  263. package/types/src/charts/drawSteps/bottomRightControls.d.ts +26 -0
  264. package/types/src/charts/drawSteps/bottomRightControlsMarkup.d.ts +110 -0
  265. package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +7 -5
  266. package/types/src/charts/features/emitHelpers.d.ts +18 -4
  267. package/types/src/charts/features/features.d.ts +1 -8
  268. package/types/src/charts/features/featuresColorScale.d.ts +24 -0
  269. package/types/src/charts/features/featuresLegend.d.ts +15 -0
  270. package/types/src/charts/features/insetState.d.ts +95 -0
  271. package/types/src/charts/features/plotPaint.d.ts +25 -0
  272. package/types/src/charts/features/sceneBounds.d.ts +18 -0
  273. package/types/src/charts/features/tooltipSwatch.d.ts +31 -0
  274. package/types/src/charts/index.d.ts +1 -0
  275. package/types/src/charts/pipeline/drillMorph.d.ts +29 -0
  276. package/types/src/charts/pipeline/insetPlacement.d.ts +45 -0
  277. package/types/src/charts/pipeline/runVizPipeline.d.ts +10 -1
  278. package/types/src/charts/viz/Viz.d.ts +27 -2
  279. package/types/src/charts/viz/VizBase.d.ts +13 -0
  280. package/types/src/charts/viz/VizBaseConfig.d.ts +11 -11
  281. package/types/src/charts/viz/linkGroup.d.ts +96 -0
  282. package/types/src/charts/viz/sceneRows.d.ts +13 -0
  283. package/types/src/charts/viz/vizTypes.d.ts +164 -3
  284. package/types/src/charts/viz/vizVisibility.d.ts +34 -0
  285. package/types/src/components/Axis/AxisBottom.d.ts +1 -1
  286. package/types/src/components/Axis/AxisLeft.d.ts +1 -1
  287. package/types/src/components/Axis/AxisRight.d.ts +1 -1
  288. package/types/src/components/Axis/AxisTop.d.ts +1 -1
  289. package/types/src/components/ColorScale/ColorScale.d.ts +4 -4
  290. package/types/src/components/Legend/legendRender.d.ts +9 -3
  291. package/types/src/components/SizeLegend/SizeLegend.d.ts +107 -0
  292. package/types/src/components/SizeLegend/sizeLegendLayout.d.ts +101 -0
  293. package/types/src/components/TextBox.d.ts +1 -1
  294. package/types/src/components/Tooltip.d.ts +18 -3
  295. package/types/src/components/index.d.ts +1 -0
  296. package/types/src/shapes/Bar.d.ts +1 -1
  297. package/types/src/shapes/Box.d.ts +1 -1
  298. package/types/src/shapes/Rect.d.ts +1 -1
  299. package/types/src/shapes/Whisker.d.ts +1 -1
  300. package/types/src/shapes/textureKey.d.ts +9 -0
  301. package/types/src/shapes/validateShapeConfig.d.ts +10 -0
  302. package/types/src/utils/BaseClass.d.ts +15 -1
  303. package/types/src/utils/D3plusConfig.d.ts +139 -0
  304. package/types/src/utils/configDefault.d.ts +11 -0
  305. package/types/src/utils/configWarnings.d.ts +28 -0
  306. package/types/src/utils/index.d.ts +2 -1
  307. package/umd/d3plus-core.full.js +9325 -3024
  308. package/umd/d3plus-core.full.js.map +1 -1
  309. package/umd/d3plus-core.full.min.js +3348 -1727
  310. package/umd/d3plus-core.js +5412 -831
  311. package/umd/d3plus-core.js.map +1 -1
  312. package/umd/d3plus-core.min.js +2199 -948
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/D3plusConfig.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\n\nimport type VizBase from \"../charts/viz/VizBase.js\";\nimport type {AccessorFn} from \"./AccessorFn.js\";\n\ntype Position = \"top\" | \"right\" | \"bottom\" | \"left\";\n\ntype DataPointAccessor<T> = string | ((d: DataPoint) => T);\n\n/** A config value that is either a constant or a `(datum, index)` accessor. */\ntype Accessor<T> = T | ((d: DataPoint, i?: number) => T);\n\ntype AxisScale =\n | \"auto\"\n | \"band\"\n | \"diverging\"\n | \"divergingLog\"\n | \"divergingPow\"\n | \"divergingSqrt\"\n | \"divergingSymlog\"\n | \"identity\"\n | \"implicit\"\n | \"jenks\"\n | \"linear\"\n | \"log\"\n | \"ordinal\"\n | \"point\"\n | \"pow\"\n | \"quantile\"\n | \"quantize\"\n | \"radial\"\n | \"sequential\"\n | \"sequentialLog\"\n | \"sequentialPow\"\n | \"sequentialQuantile\"\n | \"sequentialSqrt\"\n | \"sequentialSymlog\"\n | \"sqrt\"\n | \"symlog\"\n | \"threshold\"\n | \"time\"\n | \"utc\";\n\nexport interface AxisConfig {\n barConfig?: Record<string, string | number>;\n /** Grid values of the axis. */\n grid?: unknown[];\n gridConfig?: Record<string, string | number>;\n /** Grid size of the axis. */\n gridSize?: number;\n label?: string;\n /** Visible tick labels of the axis. */\n labels?: unknown[];\n labelOffset?: false | number;\n /**\n Exact size of the space that contains the axis tick labels and title.\n Labels that need more room overflow outward instead of moving the axis\n line; zooming pins a rescaled axis this way so it doesn't shift.\n */\n fixedSize?: number;\n /** Maximum size allowed for the space that contains the axis tick labels and title. */\n maxSize?: number;\n /** Minimum size alloted for the space that contains the axis tick labels and title. */\n minSize?: number;\n /**\n Scale range (in pixels) of the axis. The given array must have 2 values,\n but one may be `undefined` to allow the default behavior for that value.\n */\n range?: (number | undefined)[];\n /** Scale of the axis. */\n scale?: AxisScale;\n /** Tick formatter. */\n tickFormat?: (d: number | string) => string | number;\n /** Tick values of the axis. */\n ticks?: unknown[];\n /**\n Whether the domain's min and max are always shown as ticks, even when\n they aren't among the scale's own \"nice\" tick values (the nearest nice\n tick is dropped when it would crowd them). Defaults to `true`; zooming\n turns it off so a rescaled axis shows only nice values.\n */\n domainTicks?: boolean;\n tickSize?: number;\n /**\n Defines a custom locale object to be used in time scales. Must include\n `dateTime`, `date`, `time`, `periods`, `days`, `shortDays`, `months`, and\n `shortMonths` (see\n [d3-time-format](https://github.com/d3/d3-time-format/blob/master/README.md#timeFormatLocale)).\n */\n timeLocale?: Record<string, unknown>;\n /** Title of the axis. */\n title?: string;\n}\n\nexport interface TooltipConfig {\n /** The inner HTML content of the arrow element, empty by default. */\n arrow?: ((d: DataPoint) => string) | string;\n /** The background color accessor for each tooltip. */\n background?: ((d: DataPoint) => string) | string;\n /** The border accessor for each tooltip. */\n border?: ((d: DataPoint) => string) | string;\n /** The border-radius accessor for each tooltip. */\n borderRadius?: ((d: DataPoint) => string) | string;\n /** The footer content accessor for each tooltip. */\n footer?: ((d: DataPoint) => string) | string;\n /** The max-width accessor for each tooltip. */\n maxWidth?: ((d: DataPoint) => string | number) | string | number;\n /** The min-width accessor for each tooltip. */\n minWidth?: ((d: DataPoint) => string | number) | string | number;\n /** The pixel offset between the tooltip and its anchor point. */\n offset?: ((d: DataPoint) => number) | number;\n /** The inner padding of each tooltip. */\n padding?: ((d: DataPoint) => string | number) | string | number;\n title?: ((d: DataPoint) => string) | string;\n body?: ((d: DataPoint) => string) | string;\n thead?:\n | ((d: DataPoint) => [string, string][])\n | Array<\n Array<\n | ((d: DataPoint, i?: number, x?: {share: number}) => string)\n | string\n >\n >;\n tbody?:\n | ((d: DataPoint) => [string, string][])\n | Array<\n Array<\n | ((d: DataPoint, i?: number, x?: {share: number}) => string)\n | string\n >\n >;\n}\n\nexport interface TextBoxConfig {\n /** The text content for each box. */\n text?: Accessor<string>;\n /** The font color as an accessor function or static string. Inferred from the DOM selection by default. */\n fontColor?: Accessor<string>;\n /** The font size in pixels. Inferred from the DOM selection by default. */\n fontSize?: Accessor<number>;\n /**\n The font-family to use: a font name, a comma-separated list of fallbacks,\n an array of fallbacks, or an accessor returning a string or array. The\n first available font on the client is used.\n */\n fontFamily?: Accessor<string | string[]>;\n /** The font weight. Inferred from the DOM selection by default. */\n fontWeight?: Accessor<string | number>;\n /** The minimum font size in pixels, used when dynamically resizing fonts. */\n fontMin?: number;\n /** The maximum font size in pixels, used when dynamically resizing fonts. */\n fontMax?: number;\n /** Toggles font resizing — a static boolean, or an accessor returning a boolean. */\n fontResize?: Accessor<boolean>;\n /** The font opacity as an accessor function or static number between 0 and 1. */\n fontOpacity?: Accessor<number>;\n /** The font stroke color for the rendered text. */\n fontStroke?: Accessor<string>;\n /** The font stroke width for the rendered text. */\n fontStrokeWidth?: Accessor<number>;\n /** The line height, which is 1.2 times the font size by default. */\n lineHeight?: Accessor<number>;\n /** Restricts the maximum number of lines to wrap onto; null (unlimited) by default. */\n maxLines?: Accessor<number | null>;\n /** Whether text is allowed to overflow its bounding box. */\n overflow?: Accessor<boolean>;\n /**\n Handles truncated lines, returning the new line value. Passed the line's\n text and number; by default appends an ellipsis to every line except a\n first word that cannot fit (which returns \"\").\n */\n ellipsis?: (text: string, line: number) => string;\n /** The padding as a CSS shorthand string or number. Defaults to 0. */\n padding?: Accessor<string | number>;\n /** The anchor point around which to rotate the text box. */\n rotateAnchor?: Accessor<[number, number]>;\n /** The word split function: given a string, returns it split into an array of words. */\n split?: (text: string) => string[];\n /** The width for each text box. */\n width?: Accessor<number>;\n /** The height for each text box. */\n height?: Accessor<number>;\n /** The x position (left edge) for each text box. */\n x?: Accessor<number>;\n /** The y position (top edge) for each text box. */\n y?: Accessor<number>;\n}\n\nexport interface TimelineConfig {\n /** Brush event filter. */\n brushFilter?: () => boolean;\n /**\n The minimum number of ticks that can be highlighted when using \"ticks\"\n `buttonBehavior`. Helpful for x/y plots where selecting fewer than 2 time\n periods is undesirable.\n */\n brushMin?: number;\n /** Toggles the horizontal alignment of the button timeline. */\n buttonAlign?: \"start\" | \"middle\" | \"end\";\n /** Toggles the style of the timeline. */\n buttonBehavior?: \"auto\" | \"buttons\" | \"ticks\";\n /** Button height. */\n buttonHeight?: number;\n /** Button padding. */\n buttonPadding?: number;\n /** Handle style. */\n handleConfig?: Record<string, unknown>;\n /** Handle size. */\n handleSize?: number;\n /**\n Determines the visibility of the play button to the left of the timeline,\n which cycles through the available periods at a rate set by `playButtonInterval`.\n */\n playButton?: boolean;\n /**\n The interval, in milliseconds, between periods when cycling via the play\n button. Used only when the chart's `duration` is 0 (no transition);\n otherwise playback steps once per `duration` so each step animates in full.\n */\n playButtonInterval?: number;\n /** The current selection. Defaults to the most recent period in the timeline. */\n selection?: (Date | number)[] | Date | number | false;\n /** Toggles the snapping value. */\n snapping?: boolean;\n}\n\nexport interface LegendConfig {\n /** The active method for all shapes. */\n active?: ((d: DataPoint, i?: number) => boolean) | false;\n /** The hover method for all shapes. */\n hover?: ((d: DataPoint, i?: number) => boolean) | false;\n /** The shape type used for each legend entry. */\n shape?: Accessor<string>;\n}\n\nexport interface ColorScaleConfig {\n /**\n For a linear scale, the `[min, max]` values used by the color scale; values\n outside this range map to the nearest color.\n */\n domain?: number[];\n /**\n Formats the label for each bucket in a bucket-type scale (\"jenks\",\n \"quantile\", …). Passed the bucket's start value, its index, the full\n bucket array, and every data value used to build the buckets.\n */\n bucketFormat?: (\n start: number,\n i: number,\n buckets: number[],\n values: number[],\n ) => string;\n /** Given a bucket's minimum and maximum values, returns the full label. */\n bucketJoiner?: (min: string, max: string) => string;\n}\n\nexport interface D3plusConfig {\n /** Data array or URL string to load data from. */\n data?: DataPoint[] | string;\n /** Locale code used for text and number formatting. */\n locale?: string;\n\n /** The active callback function for highlighting shapes. */\n active?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Custom aggregation functions keyed by data property. */\n aggs?: {[k: string]: (d: DataPoint[]) => unknown};\n /** Hides the SVG from assistive technology when true (`aria-hidden`). */\n ariaHidden?: boolean;\n /**\n Text (rendered as HTML — any valid HTML string works, including anchor\n links) shown in the chart's bottom-right corner, most often a map tile\n credit. `false` (the default) shows nothing. A credit wider than half\n the chart area collapses to a small \"ⓘ\" badge that expands on hover,\n focus, or click.\n */\n attribution?: string | boolean;\n /**\n Overrides the \"ⓘ\" badge a long attribution collapses to, which\n otherwise renders as an inline SVG. A string is used as the badge's\n raw HTML content; a mount function, `(el: HTMLElement) => void | (() =>\n void)`, is called once with the badge's reserved element so a live\n component (a React tree via `createRoot(el).render(...)`, or anything\n else imperative) can be mounted into it — return a cleanup function if\n there's teardown to do.\n */\n attributionIcon?: string | ((el: HTMLElement) => void | (() => void));\n /** CSS key/value pairs used to style the attribution text. */\n attributionStyle?: Record<string, unknown>;\n /** Additional CSS class name(s) applied to the back button, alongside the fixed `back-control` class. */\n backControlClassName?: string;\n /** Padding between bars in pixels. */\n barPadding?: number;\n /** The baseline for the x/y plot. */\n baseline?: number;\n /** Whether to cache the processed data between renders. */\n cache?: boolean;\n /** Treat a discrete color field as ordered: color it with a single-hue light→dark ramp instead of nominal categorical hues. */\n colorOrdinal?: boolean;\n /** Color scale key or custom color function. */\n colorScale?: string | ((d: number) => string);\n /** Configuration for the color scale component. */\n colorScaleConfig?: {\n axisConfig?: AxisConfig;\n centered?: boolean;\n colors?: string[];\n colorMin?: string;\n colorMid?: string;\n colorMax?: string;\n scale?: AxisScale;\n };\n /** Whether the color scale uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n colorScalePadding?: boolean | ((viz: VizBase) => boolean);\n /** Position of the color scale, `false` to hide it, or an accessor returning either. */\n colorScalePosition?: false | Position | (() => false | Position);\n /** Column key for matrix-style layouts. */\n column?: string;\n /**\n The confidence interval as `[lower, upper]` bounds — each given as an\n accessor function or a static data key (e.g. `[\"lci\", \"hci\"]`), or `false`\n to disable.\n */\n confidence?:\n | [\n string | ((d: DataPoint, i: number) => number),\n string | ((d: DataPoint, i: number) => number),\n ]\n | false;\n /** Maximum number of data points to render before downsampling. */\n dataCutoff?: number;\n /** Active depth level for nested groupings. */\n depth?: number;\n /** Sets orientation of main category axis. */\n discrete?: \"x\" | \"y\";\n /** Default duration of transitions, in milliseconds. */\n duration?: number;\n /** Predicate filtering which data points are included, or false to disable. */\n filter?: ((d: DataPoint, i: number) => boolean) | false;\n /** Allows removing specific geographies from topojson file to improve zoom. */\n fitFilter?:\n | number\n | string\n | ((d: Record<string, unknown>) => boolean);\n /** Grouping key(s) or accessor function(s). */\n groupBy?:\n | string\n | string[]\n | ((d: DataPoint) => string | number)\n | ((d: DataPoint) => string | number)[];\n /** Padding between groups of bars in pixels. */\n groupPadding?: number;\n /** Overall height of the visualization in pixels. */\n height?: number;\n /** Color for legend shapes whose grouping is hidden (via legend click), or a `(datum, index)` accessor. */\n hiddenColor?: string | ((d: DataPoint, i: number) => string);\n /** Opacity for legend labels whose grouping is hidden (via legend click), or a `(datum, index)` accessor. */\n hiddenOpacity?: number | ((d: DataPoint, i: number) => number);\n /** The hover callback function for highlighting shapes on mouseover. */\n hover?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Persistently emphasizes matching marks (keep color) and grays the rest. */\n highlight?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Label accessor for shapes. */\n label?: string | string[] | false | AccessorFn;\n /**\n Controls legend visibility. Pass `false` to hide it, `true` to always\n show it, or a `(config, data) => boolean` accessor to decide dynamically\n — the chart defaults use an accessor to auto-hide the legend when it\n would be redundant.\n */\n legend?: boolean | ((config: D3plusConfig, arr: DataPoint[]) => boolean);\n /** Configuration for the legend component. */\n legendConfig?: {\n label?: DataPointAccessor<string>;\n shapeConfig?: Record<string, string | number>;\n };\n /** Inverts legend click behavior (click hides / shift-click solos, or the reverse), or an accessor receiving the viz. */\n legendFilterInvert?: boolean | ((viz: VizBase) => boolean);\n /** Whether the legend uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n legendPadding?: boolean | ((viz: VizBase) => boolean);\n /** Position of the legend, or an accessor returning it. */\n legendPosition?: Position | (() => Position);\n /** Custom sort comparator for legend items. */\n legendSort?: (a: DataPoint, b: DataPoint) => number;\n /** Tooltip configuration for legend items. */\n legendTooltip?: TooltipConfig;\n /** Whether to show labels on line charts. */\n lineLabels?: boolean;\n /** Whether to show the loading message. */\n loadingMessage?: boolean;\n /** Custom HTML content for the loading indicator, or a function receiving the viz instance. */\n loadingHTML?: string | ((viz: VizBase) => string);\n /** Metric key for the visualization. */\n metric?: string;\n /** Shows a small overview + draggable-viewport minimap underneath the zoom controls once the chart is zoomed in. On by default whenever `zoom` is enabled. */\n minimap?: boolean;\n /** Additional CSS class name(s) applied to the minimap, alongside its fixed `d3plus-minimap`/etc. classes. */\n minimapClassName?: string;\n /** Custom HTML content shown when no data is supplied, or a function receiving the viz instance. */\n noDataHTML?: string | ((viz: VizBase) => string);\n /**\n Ocean color for geomaps (any CSS value including 'transparent'), or a\n `{light, dark}` pair chosen by the chart's backdrop. Defaults to the\n default basemap's own water colors.\n */\n ocean?: string | {light: string; dark: string};\n /** Event listeners keyed by event name. */\n on?: Record<string, (event: Event) => void>;\n /** Coordinate accessor for point-based geomaps. */\n point?: (d: DataPoint) => number[];\n /** Point size accessor for geomaps. */\n pointSize?: string | ((d: DataPoint) => number);\n /** Minimum point size for geomaps. */\n pointSizeMin?: number;\n /** Maximum point size for geomaps. */\n pointSizeMax?: number;\n /** Map projection name or function. */\n projection?: string | ((x: number, y: number) => [number, number]);\n /** Outer padding between the visualization edge and map shapes. */\n projectionPadding?: number | string;\n /** Rotation offset for the map projection center. */\n projectionRotate?: [number, number];\n /** Row key for matrix-style layouts. */\n row?: string;\n /** Scrollable container selector for tooltip positioning. */\n scrollContainer?: string | Window;\n /** Shows a top-left search button that expands into an input; typing highlights shapes whose label matches. On by default for every chart. */\n search?: boolean;\n /** Resolves the string the search box matches its typed term against, for a given datum. Defaults to the mark's resolved on-screen label. */\n searchAccessor?: (d: DataPoint, i: number) => string;\n /** Additional CSS class name(s) applied to the search toggle button and input, alongside the fixed `search-control` classes. */\n searchControlClassName?: string;\n /** Configuration for shape rendering. */\n shapeConfig?: {\n duration?: number;\n [key: string]: unknown;\n };\n /**\n A [sort comparator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\n that receives each shape class (e.g. \"Circle\", \"Line\") as its arguments.\n Shapes are drawn in groups by type, so this defines the layering order for\n all shapes of a given type.\n */\n shapeSort?: (a: string, b: string) => number;\n /** Size accessor key. */\n size?: string;\n /** Whether to stack series. */\n stacked?: boolean;\n /**\n Vertical offset applied to stacked series. One of `\"diverging\"`\n (default — positive and negative values split around zero), `\"none\"`,\n `\"expand\"` (normalize each stack to 100%), `\"silhouette\"` (streamgraph),\n or `\"wiggle\"` (minimize slope changes); or a custom offset function.\n */\n stackOffset?: string | ((series: number[][][], order: number[]) => void);\n /**\n Order of stacked series, from the bottom of the stack upward. Accepts a\n named order (`\"descending\"` [default] / `\"ascending\"` by summed value,\n `\"key\"` / `\"keyReverse\"` alphabetically, `\"none\"` / `\"data\"` for input\n order, or d3's `\"insideOut\"` / `\"appearance\"` / `\"reverse\"`), an Array of\n series keys for an explicit order, a value accessor, or a `{value, order}`\n config to rank series by an aggregate of any data field.\n */\n stackOrder?:\n | string\n | string[]\n | {value: string | ((d: DataPoint) => unknown); order?: \"ascending\" | \"descending\"}\n | ((d: DataPoint) => unknown);\n /** Subtitle text, or an accessor returning it. */\n subtitle?: string | ((data: DataPoint[]) => string);\n /** Whether the subtitle uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n subtitlePadding?: boolean | ((viz: VizBase) => boolean);\n /** Value accessor for treemaps and aggregation. */\n sum?: DataPointAccessor<number>;\n /** Accessible description applied to the root SVG (`<desc>`). */\n svgDesc?: string;\n /** Accessible title applied to the root SVG (`<title>`). */\n svgTitle?: string;\n /** Enables the top-left table-view toggle button, which swaps the chart for a static, scrollable `<table>` of its data. On by default for every chart. */\n tableView?: boolean;\n /** Additional CSS class name(s) applied to the `<table>` element rendered while in table view, alongside the fixed `d3plus-table-view-table` class. */\n tableViewClassName?: string;\n /** Additional CSS class name(s) applied to the table-view toggle button, alongside the fixed `table-view-control`/`table-view-toggle` classes. */\n tableViewControlClassName?: string;\n /** CSS key/value pairs styling the table-view toggle button. `false` removes all default styling. */\n tableViewControlStyle?: Record<string, unknown> | false;\n /** CSS key/value pairs styling the table-view toggle button while active (showing the data table). `false` removes all default styling. */\n tableViewControlStyleActive?: Record<string, unknown> | false;\n /** CSS key/value pairs styling the table-view toggle button on hover. `false` removes all default styling. */\n tableViewControlStyleHover?: Record<string, unknown> | false;\n /** Whether the data table shows a \"download CSV\" button, exporting its full (sorted, unpaginated) rows. On by default. */\n tableViewDownload?: boolean;\n /** Rows per page while in table view. `false` (or any non-positive number) disables pagination and shows every row on one page. */\n tableViewPageSize?: number | false;\n /** Whether the data table's column headers are clickable to sort (toggling asc/desc). On by default. */\n tableViewSort?: boolean;\n /** Threshold value for grouping small slices. */\n threshold?: number;\n /** Label for the threshold group, or a `(datum, index)` accessor. */\n thresholdName?: string | ((d: DataPoint, i: number) => string);\n /**\n URL template for XYZ map tiles, with `{z}`, `{x}`, `{y}` (and optional\n `{s}` subdomain) placeholders — or a `{light, dark}` pair, chosen by the\n chart's backdrop. Defaults to Esri's Light Gray and Dark Gray Canvas.\n */\n tileUrl?: string | {light: string; dark: string};\n /** Whether to show map tiles. */\n tiles?: boolean;\n /** Time key for temporal data. */\n time?: string;\n /** Predicate filtering which time slices are shown, or false to disable. */\n timeFilter?: ((d: DataPoint, i: number) => boolean) | false;\n /** Whether to show the timeline component. */\n timeline?: boolean;\n /** Whether the timeline uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n timelinePadding?: boolean | ((viz: VizBase) => boolean);\n /** Chart title or title accessor function. */\n title?: string | ((data: DataPoint[]) => string);\n /** CSS style configuration for the title. */\n titleConfig?: Record<string, string | number>;\n /** Whether the title uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n titlePadding?: boolean | ((viz: VizBase) => boolean);\n /** Whether to show tooltips, or a `(datum, index)` accessor deciding per mark. */\n tooltip?: boolean | ((d: DataPoint, i: number) => boolean);\n /** Configuration for the tooltip component. */\n tooltipConfig?: TooltipConfig;\n /** Path or object for the topojson data. */\n topojson?: string | object;\n /** CSS color to fill the map shapes. */\n topojsonFill?: string;\n /** Accessor function for topojson feature IDs. */\n topojsonId?: (obj: Record<string, unknown>) => string;\n /** Whether the total uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n totalPadding?: boolean | ((viz: VizBase) => boolean);\n /** Value accessor for the visualization. */\n value?: DataPointAccessor<number>;\n /** Overall width of the visualization in pixels. */\n width?: number;\n /** Key, index, or accessor function for x-axis values. */\n x?: string | number | ((d: DataPoint, i: number) => unknown);\n /** Configuration for the x-axis. */\n xConfig?: AxisConfig;\n /** The x domain as an array. If either value is undefined, it is calculated from the data. */\n xDomain?: (number | Date)[];\n /** The x2 domain as an array. If either value is undefined, it is calculated from the data. */\n x2Domain?: (number | Date)[];\n /** Custom sort function for x-axis values. */\n xSort?: (a: DataPoint, b: DataPoint) => number;\n /** Defines a custom sorting comparator function for discrete x2 axes. */\n x2Sort?: (a: DataPoint, b: DataPoint) => number;\n /** Key, index, or accessor function for y-axis values. */\n y?: string | number | ((d: DataPoint, i: number) => unknown);\n /** Configuration for the y-axis. */\n yConfig?: AxisConfig;\n /** The y domain as an array. If either value is undefined, it is calculated from the data. */\n yDomain?: (number | Date)[];\n /** The y2 domain as an array. If either value is undefined, it is calculated from the data. */\n y2Domain?: (number | Date)[];\n /** Custom sort function for y-axis values. */\n ySort?: (a: DataPoint, b: DataPoint) => number;\n /** Defines a custom sorting comparator function for discrete y2 axes. */\n y2Sort?: (a: DataPoint, b: DataPoint) => number;\n /** Enables pan/zoom with zoom-control buttons. On by default for every chart. */\n zoom?: boolean;\n /** Additional CSS class name(s) applied to each zoom control button, alongside the fixed `zoom-control`/`zoom-in`/etc. classes. */\n zoomControlClassName?: string;\n /**\n Overrides one or more of the four built-in zoom-control icons (`zoomIn`,\n `zoomOut`, `zoomReset`, `zoomBrush`), which otherwise render as inline\n SVGs. Each value is either raw HTML — used as that button's content — or\n a mount function, `(el: HTMLElement) => void | (() => void)`, called\n once with the button's reserved icon slot so a live component (a React\n tree via `createRoot(el).render(...)`, or anything else imperative) can\n be mounted into it — return a cleanup function if there's teardown to do.\n */\n zoomControlIcons?: Partial<\n Record<\n \"zoomIn\" | \"zoomOut\" | \"zoomReset\" | \"zoomBrush\",\n string | ((el: HTMLElement) => void | (() => void))\n >\n >;\n /** Multiplier applied to programmatic zoom steps. */\n zoomFactor?: number;\n /** Maximum zoom scale factor. Defaults to the scale at which the smallest shape fills the chart area. */\n zoomMax?: number;\n /** Whether panning (drag) is enabled while zoomed. */\n zoomPan?: boolean;\n /**\n Whether the mouse wheel (and one-finger touch) zooms. `\"modifier\"` (the\n default) leaves page scrolling alone: only\n Ctrl/⌘ + wheel or a trackpad/two-finger pinch zooms, and one finger pans\n only once zoomed in. `true` zooms on any wheel; `false` never does.\n */\n zoomScroll?: boolean | \"modifier\";\n\n /** Allows additional custom properties. */\n [key: string]: unknown;\n}\n"],"names":[],"mappings":"AAgQA,WAmVC"}
1
+ {"version":3,"sources":["../../../src/utils/D3plusConfig.ts"],"sourcesContent":["import type {ColorDefaults} from \"@d3plus/color\";\nimport type {DataPoint} from \"@d3plus/data\";\n\nimport type VizBase from \"../charts/viz/VizBase.js\";\nimport type {LinkOption} from \"../charts/viz/linkGroup.js\";\nimport type {AccessorFn} from \"./AccessorFn.js\";\nimport type {\n SizeLegendLineConfig,\n SizeLegendShapeConfig,\n SizeLegendTextConfig,\n} from \"../components/SizeLegend/SizeLegend.js\";\nimport type {SizeLegendScale, SizeLegendSize} from \"../components/SizeLegend/sizeLegendLayout.js\";\n\ntype Position = \"top\" | \"right\" | \"bottom\" | \"left\";\n\ntype DataPointAccessor<T> = string | ((d: DataPoint) => T);\n\n/** A config value that is either a constant or a `(datum, index)` accessor. */\ntype Accessor<T> = T | ((d: DataPoint, i?: number) => T);\n\ntype AxisScale =\n | \"auto\"\n | \"band\"\n | \"diverging\"\n | \"divergingLog\"\n | \"divergingPow\"\n | \"divergingSqrt\"\n | \"divergingSymlog\"\n | \"identity\"\n | \"implicit\"\n | \"jenks\"\n | \"linear\"\n | \"log\"\n | \"ordinal\"\n | \"point\"\n | \"pow\"\n | \"quantile\"\n | \"quantize\"\n | \"radial\"\n | \"sequential\"\n | \"sequentialLog\"\n | \"sequentialPow\"\n | \"sequentialQuantile\"\n | \"sequentialSqrt\"\n | \"sequentialSymlog\"\n | \"sqrt\"\n | \"symlog\"\n | \"threshold\"\n | \"time\"\n | \"utc\";\n\nexport interface AxisConfig {\n barConfig?: Record<string, string | number>;\n /** Grid values of the axis. */\n grid?: unknown[];\n gridConfig?: Record<string, string | number>;\n /** Grid size of the axis. */\n gridSize?: number;\n label?: string;\n /** Visible tick labels of the axis. */\n labels?: unknown[];\n labelOffset?: false | number;\n /**\n Exact size of the space that contains the axis tick labels and title.\n Labels that need more room overflow outward instead of moving the axis\n line; zooming pins a rescaled axis this way so it doesn't shift.\n */\n fixedSize?: number;\n /** Maximum size allowed for the space that contains the axis tick labels and title. */\n maxSize?: number;\n /** Minimum size alloted for the space that contains the axis tick labels and title. */\n minSize?: number;\n /**\n Scale range (in pixels) of the axis. The given array must have 2 values,\n but one may be `undefined` to allow the default behavior for that value.\n */\n range?: (number | undefined)[];\n /** Scale of the axis. */\n scale?: AxisScale;\n /** Tick formatter. */\n tickFormat?: (d: number | string) => string | number;\n /** Tick values of the axis. */\n ticks?: unknown[];\n /**\n Whether the domain's min and max are always shown as ticks, even when\n they aren't among the scale's own \"nice\" tick values (the nearest nice\n tick is dropped when it would crowd them). Defaults to `true`; zooming\n turns it off so a rescaled axis shows only nice values.\n */\n domainTicks?: boolean;\n tickSize?: number;\n /**\n Defines a custom locale object to be used in time scales. Must include\n `dateTime`, `date`, `time`, `periods`, `days`, `shortDays`, `months`, and\n `shortMonths` (see\n [d3-time-format](https://github.com/d3/d3-time-format/blob/master/README.md#timeFormatLocale)).\n */\n timeLocale?: Record<string, unknown>;\n /** Title of the axis. */\n title?: string;\n}\n\nexport interface TooltipConfig {\n /** The inner HTML content of the arrow element, empty by default. */\n arrow?: ((d: DataPoint) => string) | string;\n /** The background color accessor for each tooltip. */\n background?: ((d: DataPoint) => string) | string;\n /** The border accessor for each tooltip. */\n border?: ((d: DataPoint) => string) | string;\n /** The border-radius accessor for each tooltip. */\n borderRadius?: ((d: DataPoint) => string) | string;\n /** The footer content accessor for each tooltip. */\n footer?: ((d: DataPoint) => string) | string;\n /** The max-width accessor for each tooltip. */\n maxWidth?: ((d: DataPoint) => string | number) | string | number;\n /** The min-width accessor for each tooltip. */\n minWidth?: ((d: DataPoint) => string | number) | string | number;\n /** The pixel offset between the tooltip and its anchor point. */\n offset?: ((d: DataPoint) => number) | number;\n /** The inner padding of each tooltip. */\n padding?: ((d: DataPoint) => string | number) | string | number;\n title?: ((d: DataPoint) => string) | string;\n body?: ((d: DataPoint) => string) | string;\n thead?:\n | ((d: DataPoint) => [string, string][])\n | Array<\n Array<\n | ((d: DataPoint, i?: number, x?: {share: number}) => string)\n | string\n >\n >;\n tbody?:\n | ((d: DataPoint) => [string, string][])\n | Array<\n Array<\n | ((d: DataPoint, i?: number, x?: {share: number}) => string)\n | string\n >\n >;\n}\n\nexport interface TextBoxConfig {\n /** The text content for each box. */\n text?: Accessor<string>;\n /** The font color as an accessor function or static string. Inferred from the DOM selection by default. */\n fontColor?: Accessor<string>;\n /** The font size in pixels. Inferred from the DOM selection by default. */\n fontSize?: Accessor<number>;\n /**\n The font-family to use: a font name, a comma-separated list of fallbacks,\n an array of fallbacks, or an accessor returning a string or array. The\n first available font on the client is used.\n */\n fontFamily?: Accessor<string | string[]>;\n /** The font weight. Inferred from the DOM selection by default. */\n fontWeight?: Accessor<string | number>;\n /** The minimum font size in pixels, used when dynamically resizing fonts. */\n fontMin?: number;\n /** The maximum font size in pixels, used when dynamically resizing fonts. */\n fontMax?: number;\n /** Toggles font resizing — a static boolean, or an accessor returning a boolean. */\n fontResize?: Accessor<boolean>;\n /** The font opacity as an accessor function or static number between 0 and 1. */\n fontOpacity?: Accessor<number>;\n /** The font stroke color for the rendered text. */\n fontStroke?: Accessor<string>;\n /** The font stroke width for the rendered text. */\n fontStrokeWidth?: Accessor<number>;\n /** The line height, which is 1.2 times the font size by default. */\n lineHeight?: Accessor<number>;\n /** Restricts the maximum number of lines to wrap onto; null (unlimited) by default. */\n maxLines?: Accessor<number | null>;\n /** Whether text is allowed to overflow its bounding box. */\n overflow?: Accessor<boolean>;\n /**\n Handles truncated lines, returning the new line value. Passed the line's\n text and number; by default appends an ellipsis to every line except a\n first word that cannot fit (which returns \"\").\n */\n ellipsis?: (text: string, line: number) => string;\n /** The padding as a CSS shorthand string or number. Defaults to 0. */\n padding?: Accessor<string | number>;\n /** The anchor point around which to rotate the text box. */\n rotateAnchor?: Accessor<[number, number]>;\n /** The word split function: given a string, returns it split into an array of words. */\n split?: (text: string) => string[];\n /** The width for each text box. */\n width?: Accessor<number>;\n /** The height for each text box. */\n height?: Accessor<number>;\n /** The x position (left edge) for each text box. */\n x?: Accessor<number>;\n /** The y position (top edge) for each text box. */\n y?: Accessor<number>;\n}\n\nexport interface TimelineConfig {\n /** Brush event filter. */\n brushFilter?: () => boolean;\n /**\n The minimum number of ticks that can be highlighted when using \"ticks\"\n `buttonBehavior`. Helpful for x/y plots where selecting fewer than 2 time\n periods is undesirable.\n */\n brushMin?: number;\n /** Toggles the horizontal alignment of the button timeline. */\n buttonAlign?: \"start\" | \"middle\" | \"end\";\n /** Toggles the style of the timeline. */\n buttonBehavior?: \"auto\" | \"buttons\" | \"ticks\";\n /** Button height. */\n buttonHeight?: number;\n /** Button padding. */\n buttonPadding?: number;\n /** Handle style. */\n handleConfig?: Record<string, unknown>;\n /** Handle size. */\n handleSize?: number;\n /**\n Determines the visibility of the play button to the left of the timeline,\n which cycles through the available periods at a rate set by `playButtonInterval`.\n */\n playButton?: boolean;\n /**\n The interval, in milliseconds, between periods when cycling via the play\n button. Used only when the chart's `duration` is 0 (no transition);\n otherwise playback steps once per `duration` so each step animates in full.\n */\n playButtonInterval?: number;\n /** The current selection. Defaults to the most recent period in the timeline. */\n selection?: (Date | number)[] | Date | number | false;\n /** Toggles the snapping value. */\n snapping?: boolean;\n}\n\nexport interface LegendConfig {\n /** The active method for all shapes. */\n active?: ((d: DataPoint, i?: number) => boolean) | false;\n /** The hover method for all shapes. */\n hover?: ((d: DataPoint, i?: number) => boolean) | false;\n /** The shape type used for each legend entry. */\n shape?: Accessor<string>;\n}\n\nexport interface SizeLegendConfig {\n /**\n The values to draw circles for: an array of values, how many to pick\n from the size domain (default 3: its min, max, and a round middle), or\n a function receiving the `[min, max]` domain and returning values.\n */\n values?: number[] | number | ((domain: [number, number]) => number[]);\n /** Formats each value's label. Defaults to the locale's abbreviated number format. */\n tickFormat?: (value: number) => string;\n /** Title above the circles. Defaults to the `size` key when `size` is set to a string. */\n title?: string;\n /** Circle paint: `fill`, `fillOpacity`, `stroke`, `strokeWidth`, `strokeOpacity`. */\n shapeConfig?: SizeLegendShapeConfig;\n /** Leader-line paint: `stroke`, `strokeWidth`, `strokeOpacity`, `strokeDasharray`. */\n lineConfig?: SizeLegendLineConfig;\n /** Value-label font: `fontColor`, `fontFamily`, `fontSize`. */\n labelConfig?: SizeLegendTextConfig;\n /** Title font: `fontColor`, `fontFamily`, `fontSize`, `fontWeight`. */\n titleConfig?: SizeLegendTextConfig;\n padding?: number;\n /** Length of the leader lines past the largest circle, in pixels. */\n lineLength?: number;\n /** Gap between each leader line and its label, in pixels. */\n labelPadding?: number;\n}\n\nexport interface TrendLineConfig {\n /** `\"series\"` (default) fits one line per series, colored to match it; `\"all\"` fits one line to every point. Stacked charts always fit the stack totals. */\n group?: \"series\" | \"all\";\n /** The polynomial degree when `trendLine` is `\"polynomial\"`. Defaults to 2. */\n order?: number;\n /** Draws a confidence band around a linear fit. Defaults to `false`. */\n confidence?: boolean;\n /** The confidence band's level, between 0 and 1. Defaults to 0.95. */\n confidenceLevel?: number;\n /** Area shape config for the confidence band. Its fill defaults to the line color. */\n confidenceConfig?: Record<string, unknown>;\n /**\n Extends each trend line past the end of its data: a number of steps (at the data's own spacing — the median gap between values, or the calendar interval of dates), or `{to}` an end value to step up to (a number, or on a time axis a Date or a parseable date such as a year). Widens the axis to fit. Ignored on a category axis. Defaults to `0` (off).\n */\n projection?: number | {to: number | string | Date};\n /** Line shape config for the projected stretch, merged over the line's own styles. Defaults to `{strokeDasharray: \"2 4\"}`. */\n projectionConfig?: Record<string, unknown>;\n /** Shows the fitted equation, R², and observations when hovering a line. Defaults to `true`. */\n tooltip?: boolean;\n /** Line color. Defaults to the series color (dark gray when `group` is `\"all\"`). */\n stroke?: string;\n /** Line width in pixels. Defaults to 2. */\n strokeWidth?: number;\n /** Line dash pattern. Defaults to `\"6 4\"`. */\n strokeDasharray?: string;\n /** Other Line shape config. */\n [key: string]: unknown;\n}\n\nexport interface ColorScaleConfig {\n /** The scale's colors: one color, expanded into a light→dark ramp, or an array of colors to step through. */\n color?: string | string[];\n /**\n For a linear scale, the `[min, max]` values used by the color scale; values\n outside this range map to the nearest color.\n */\n domain?: number[];\n /**\n Formats the label for each bucket in a bucket-type scale (\"jenks\",\n \"quantile\", …). Passed the bucket's start value, its index, the full\n bucket array, and every data value used to build the buckets.\n */\n bucketFormat?: (\n start: number,\n i: number,\n buckets: number[],\n values: number[],\n ) => string;\n /** Given a bucket's minimum and maximum values, returns the full label. */\n bucketJoiner?: (min: string, max: string) => string;\n}\n\n/** `colorDefaults` input: any subset of the color defaults, with `scale` also accepting an array of colors. */\nexport type ColorDefaultsConfig = Partial<Omit<ColorDefaults, \"scale\">> & {\n scale?: ColorDefaults[\"scale\"] | string[];\n};\n\nexport interface D3plusConfig {\n /** Data array or URL string to load data from. */\n data?: DataPoint[] | string;\n /** Locale code used for text and number formatting. */\n locale?: string;\n\n /** The active callback function for highlighting shapes. */\n active?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Custom aggregation functions keyed by data property. */\n aggs?: {[k: string]: (d: DataPoint[]) => unknown};\n /** Hides the SVG from assistive technology when true (`aria-hidden`). */\n ariaHidden?: boolean;\n /**\n Text (rendered as HTML — any valid HTML string works, including anchor\n links) shown in the chart's bottom-right corner, most often a map tile\n credit. `false` (the default) shows nothing. A credit wider than half\n the chart area collapses to a small \"ⓘ\" badge that expands on hover,\n focus, or click.\n */\n attribution?: string | boolean;\n /**\n Overrides the \"ⓘ\" badge a long attribution collapses to, which\n otherwise renders as an inline SVG. A string is used as the badge's\n raw HTML content; a mount function, `(el: HTMLElement) => void | (() =>\n void)`, is called once with the badge's reserved element so a live\n component (a React tree via `createRoot(el).render(...)`, or anything\n else imperative) can be mounted into it — return a cleanup function if\n there's teardown to do.\n */\n attributionIcon?: string | ((el: HTMLElement) => void | (() => void));\n /** CSS key/value pairs used to style the attribution text. */\n attributionStyle?: Record<string, unknown>;\n /** Additional CSS class name(s) applied to the back button, alongside the fixed `back-control` class. */\n backControlClassName?: string;\n /** Padding between bars in pixels. */\n barPadding?: number;\n /** The baseline for the x/y plot. */\n baseline?: number;\n /** Whether to cache the processed data between renders. */\n cache?: boolean;\n /** Overrides for the default colors used for data fills and legible text (see `colorDefaults` in @d3plus/color). */\n colorDefaults?: ColorDefaultsConfig;\n /** Treat a discrete color field as ordered: color it with a single-hue light→dark ramp instead of nominal categorical hues. */\n colorOrdinal?: boolean;\n /** Color scale key or custom color function. */\n colorScale?: string | ((d: number) => string);\n /** Configuration for the color scale component. */\n colorScaleConfig?: {\n axisConfig?: AxisConfig;\n centered?: boolean;\n colors?: string[];\n colorMin?: string;\n colorMid?: string;\n colorMax?: string;\n scale?: AxisScale;\n };\n /** Whether the color scale uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n colorScalePadding?: boolean | ((viz: VizBase) => boolean);\n /** Position of the color scale, `false` to hide it, or an accessor returning either. */\n colorScalePosition?: false | Position | (() => false | Position);\n /** Column key for matrix-style layouts. */\n column?: string;\n /**\n The confidence interval as `[lower, upper]` bounds — each given as an\n accessor function or a static data key (e.g. `[\"lci\", \"hci\"]`), or `false`\n to disable.\n */\n confidence?:\n | [\n string | ((d: DataPoint, i: number) => number),\n string | ((d: DataPoint, i: number) => number),\n ]\n | false;\n /**\n Paint for the shared tooltip's crosshair guide line (`stroke`,\n `strokeWidth`, `strokeDasharray`, `strokeOpacity`, …).\n */\n crosshairConfig?: Record<string, unknown>;\n /** Maximum number of data points to render before downsampling. */\n dataCutoff?: number;\n /** Active depth level for nested groupings. */\n depth?: number;\n /** Sets orientation of main category axis. */\n discrete?: \"x\" | \"y\";\n /** Default duration of transitions, in milliseconds. */\n duration?: number;\n /** Predicate filtering which data points are included, or false to disable. */\n filter?: ((d: DataPoint, i: number) => boolean) | false;\n /** Allows removing specific geographies from topojson file to improve zoom. */\n fitFilter?:\n | number\n | string\n | ((d: Record<string, unknown>) => boolean);\n /** Grouping key(s) or accessor function(s). */\n groupBy?:\n | string\n | string[]\n | ((d: DataPoint) => string | number)\n | ((d: DataPoint) => string | number)[];\n /** Padding between groups of bars in pixels. */\n groupPadding?: number;\n /** Overall height of the visualization in pixels. */\n height?: number;\n /** Color for legend shapes whose grouping is hidden (via legend click), or a `(datum, index)` accessor. */\n hiddenColor?: string | ((d: DataPoint, i: number) => string);\n /** Opacity for legend labels whose grouping is hidden (via legend click), or a `(datum, index)` accessor. */\n hiddenOpacity?: number | ((d: DataPoint, i: number) => number);\n /** The hover callback function for highlighting shapes on mouseover. */\n hover?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Persistently emphasizes matching marks (keep color) and grays the rest. */\n highlight?: ((d: DataPoint, i: number) => boolean) | false | null;\n /** Label accessor for shapes. */\n label?: string | string[] | false | AccessorFn;\n /**\n Controls legend visibility. Pass `false` to hide it, `true` to always\n show it, or a `(config, data) => boolean` accessor to decide dynamically\n — the chart defaults use an accessor to auto-hide the legend when it\n would be redundant.\n */\n legend?: boolean | ((config: D3plusConfig, arr: DataPoint[]) => boolean);\n /** Configuration for the legend component. */\n legendConfig?: {\n label?: DataPointAccessor<string>;\n /**\n Each item's swatch: `\"Rect\"` (a square), `\"Circle\"` (a dot), or `\"Line\"`\n (a dot with a short stroke through it). Defaults to the shape of the\n series it stands for: a dot for Circles, the line glyph for Lines, and\n a square for everything else.\n */\n shape?: \"Rect\" | \"Circle\" | \"Line\" | DataPointAccessor<string>;\n shapeConfig?: Record<string, string | number>;\n };\n /** Inverts legend click behavior (click hides / shift-click solos, or the reverse), or an accessor receiving the viz. */\n legendFilterInvert?: boolean | ((viz: VizBase) => boolean);\n /**\n Whether one legend may be drawn inside the empty space around the chart's\n marks instead of in a margin (size legend first, then legend, then\n colorScale), or an accessor receiving the resolved config. Defaults to `true`.\n */\n legendInset?: boolean | ((config: D3plusConfig) => boolean);\n /** Style of the semi-transparent box behind a legend drawn inside the chart. */\n legendInsetConfig?: {\n /** Box fill; defaults to the chart's background color. */\n fill?: string;\n fillOpacity?: number;\n stroke?: string;\n strokeWidth?: number;\n /** Corner radius. */\n rx?: number;\n /** Space between the box's edge and the legend inside it. */\n margin?: number;\n /** Space kept between the box and the chart's marks and edges. */\n padding?: number;\n };\n /** Whether the legend uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n legendPadding?: boolean | ((viz: VizBase) => boolean);\n /** Position of the legend, or an accessor returning it. */\n legendPosition?: Position | (() => Position);\n /** Custom sort comparator for legend items. */\n legendSort?: (a: DataPoint, b: DataPoint) => number;\n /** Tooltip configuration for legend items. */\n legendTooltip?: TooltipConfig;\n /** Whether to show labels on line charts. */\n lineLabels?: boolean;\n /** Links this chart to every other chart with the same group name, so hovering, `active`, `highlight` (including search), and legend hide/solo clicks in one are mirrored in the rest, and a value gets the same categorical color in every chart. Rows match across charts by the value of `by` (a data key or accessor), which defaults to the chart's own id. A string is shorthand for `{group}`; set `hover`, `active`, `highlight`, `legend`, or `color` to `false` to stop sharing that behavior. */\n link?: LinkOption;\n /** Whether to show the loading message. */\n loadingMessage?: boolean;\n /** Custom HTML content for the loading indicator, or a function receiving the viz instance. */\n loadingHTML?: string | ((viz: VizBase) => string);\n /** Metric key for the visualization. */\n metric?: string;\n /** Shows a small overview + draggable-viewport minimap underneath the zoom controls once the chart is zoomed in. On by default whenever `zoom` is enabled. */\n minimap?: boolean;\n /** Additional CSS class name(s) applied to the minimap, alongside its fixed `d3plus-minimap`/etc. classes. */\n minimapClassName?: string;\n /** Custom HTML content shown when no data is supplied, or a function receiving the viz instance. */\n noDataHTML?: string | ((viz: VizBase) => string);\n /**\n Ocean color for geomaps (any CSS value including 'transparent'), or a\n `{light, dark}` pair chosen by the chart's backdrop. Defaults to the\n default basemap's own water colors.\n */\n ocean?: string | {light: string; dark: string};\n /** Event listeners keyed by event name. */\n on?: Record<string, (event: Event) => void>;\n /** Coordinate accessor for point-based geomaps. */\n point?: (d: DataPoint) => number[];\n /** Point size accessor for geomaps. */\n pointSize?: string | ((d: DataPoint) => number);\n /** Minimum point size for geomaps. */\n pointSizeMin?: number;\n /** Maximum point size for geomaps. */\n pointSizeMax?: number;\n /** Map projection name or function. */\n projection?: string | ((x: number, y: number) => [number, number]);\n /** Outer padding between the visualization edge and map shapes. */\n projectionPadding?: number | string;\n /** Rotation offset for the map projection center. */\n projectionRotate?: [number, number];\n /** Row key for matrix-style layouts. */\n row?: string;\n /** Scrollable container selector for tooltip positioning. */\n scrollContainer?: string | Window;\n /** Shows a top-left search button that expands into an input; typing highlights shapes whose label matches. On by default for every chart. */\n search?: boolean;\n /** Resolves the string the search box matches its typed term against, for a given datum. Defaults to the mark's resolved on-screen label. */\n searchAccessor?: (d: DataPoint, i: number) => string;\n /** Additional CSS class name(s) applied to the search toggle button and input, alongside the fixed `search-control` classes. */\n searchControlClassName?: string;\n /** Configuration for shape rendering. */\n shapeConfig?: {\n duration?: number;\n [key: string]: unknown;\n };\n /**\n A [sort comparator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\n that receives each shape class (e.g. \"Circle\", \"Line\") as its arguments.\n Shapes are drawn in groups by type, so this defines the layering order for\n all shapes of a given type.\n */\n shapeSort?: (a: string, b: string) => number;\n /** Size accessor key. */\n size?: string;\n /**\n Controls size-legend visibility — the nested-circle key drawn in the\n bottom-right corner of charts that size their marks. Shown by default\n whenever marks are sized by more than one value, unless it would take\n up more than a third of the chart's width or height; pass `true` to\n always show it, `false` to hide it, or a `(config, scale, size) =>\n boolean` accessor.\n */\n sizeLegend?:\n | boolean\n | ((config: D3plusConfig, scale: SizeLegendScale, size: SizeLegendSize) => boolean);\n /** Configuration for the size-legend component. */\n sizeLegendConfig?: SizeLegendConfig;\n /**\n Which margin the size legend claims in the bottom-right corner:\n `\"right\"` (default) keeps the chart's full height, `\"bottom\"` its full\n width.\n */\n sizeLegendPosition?: \"right\" | \"bottom\";\n /** Whether to stack series. */\n stacked?: boolean;\n /**\n Vertical offset applied to stacked series. One of `\"diverging\"`\n (default — positive and negative values split around zero), `\"none\"`,\n `\"expand\"` (normalize each stack to 100%), `\"silhouette\"` (streamgraph),\n or `\"wiggle\"` (minimize slope changes); or a custom offset function.\n */\n stackOffset?: string | ((series: number[][][], order: number[]) => void);\n /**\n Order of stacked series, from the bottom of the stack upward. Accepts a\n named order (`\"descending\"` [default] / `\"ascending\"` by summed value,\n `\"key\"` / `\"keyReverse\"` alphabetically, `\"none\"` / `\"data\"` for input\n order, or d3's `\"insideOut\"` / `\"appearance\"` / `\"reverse\"`), an Array of\n series keys for an explicit order, a value accessor, or a `{value, order}`\n config to rank series by an aggregate of any data field.\n */\n stackOrder?:\n | string\n | string[]\n | {value: string | ((d: DataPoint) => unknown); order?: \"ascending\" | \"descending\"}\n | ((d: DataPoint) => unknown);\n /** Subtitle text, or an accessor returning it. */\n subtitle?: string | ((data: DataPoint[]) => string);\n /** Whether the subtitle uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n subtitlePadding?: boolean | ((viz: VizBase) => boolean);\n /** Value accessor for treemaps and aggregation. */\n sum?: DataPointAccessor<number>;\n /** Accessible description applied to the root SVG (`<desc>`). */\n svgDesc?: string;\n /** Accessible title applied to the root SVG (`<title>`). */\n svgTitle?: string;\n /** Enables the top-left table-view toggle button, which swaps the chart for a static, scrollable `<table>` of its data. On by default for every chart. */\n tableView?: boolean;\n /** Additional CSS class name(s) applied to the `<table>` element rendered while in table view, alongside the fixed `d3plus-table-view-table` class. */\n tableViewClassName?: string;\n /** Additional CSS class name(s) applied to the table-view toggle button, alongside the fixed `table-view-control`/`table-view-toggle` classes. */\n tableViewControlClassName?: string;\n /** CSS key/value pairs styling the table-view toggle button. `false` removes all default styling. */\n tableViewControlStyle?: Record<string, unknown> | false;\n /** CSS key/value pairs styling the table-view toggle button while active (showing the data table). `false` removes all default styling. */\n tableViewControlStyleActive?: Record<string, unknown> | false;\n /** CSS key/value pairs styling the table-view toggle button on hover. `false` removes all default styling. */\n tableViewControlStyleHover?: Record<string, unknown> | false;\n /** Whether the data table shows a \"download CSV\" button, exporting its full (sorted, unpaginated) rows. On by default. */\n tableViewDownload?: boolean;\n /** Rows per page while in table view. `false` (or any non-positive number) disables pagination and shows every row on one page. */\n tableViewPageSize?: number | false;\n /** Whether the data table's column headers are clickable to sort (toggling asc/desc). On by default. */\n tableViewSort?: boolean;\n /** Threshold value for grouping small slices. */\n threshold?: number;\n /** Label for the threshold group, or a `(datum, index)` accessor. */\n thresholdName?: string | ((d: DataPoint, i: number) => string);\n /**\n URL template for XYZ map tiles, with `{z}`, `{x}`, `{y}` (and optional\n `{s}` subdomain) placeholders — or a `{light, dark}` pair, chosen by the\n chart's backdrop. Defaults to Esri's Light Gray and Dark Gray Canvas.\n */\n tileUrl?: string | {light: string; dark: string};\n /** Whether to show map tiles. */\n tiles?: boolean;\n /** Time key for temporal data. */\n time?: string;\n /** Predicate filtering which time slices are shown, or false to disable. */\n timeFilter?: ((d: DataPoint, i: number) => boolean) | false;\n /** Whether to show the timeline component. */\n timeline?: boolean;\n /** Whether the timeline uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n timelinePadding?: boolean | ((viz: VizBase) => boolean);\n /** Chart title or title accessor function. */\n title?: string | ((data: DataPoint[]) => string);\n /** CSS style configuration for the title. */\n titleConfig?: Record<string, string | number>;\n /** Whether the title uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n titlePadding?: boolean | ((viz: VizBase) => boolean);\n /** Whether to show tooltips, or a `(datum, index)` accessor deciding per mark. */\n tooltip?: boolean | ((d: DataPoint, i: number) => boolean);\n /** Configuration for the tooltip component. */\n tooltipConfig?: TooltipConfig;\n /**\n Whether hovering a Plot's plot area shows one tooltip listing every\n series' value at the nearest discrete-axis position, with a crosshair\n through it. Applies when a discrete axis is set and at least two series\n share that position.\n */\n tooltipShared?: boolean;\n /**\n Draws an automatic trend line fit to the plotted data: `true` (or\n `\"linear\"`) for a least-squares line, or `\"exponential\"`,\n `\"logarithmic\"`, `\"power\"`, or `\"polynomial\"`. `false` removes it.\n */\n trendLine?: boolean | \"linear\" | \"exponential\" | \"logarithmic\" | \"power\" | \"polynomial\";\n /**\n Options for the trend lines: `group` (`\"series\"` or `\"all\"`), the\n polynomial `order`, a `confidence` band with `confidenceLevel` and\n `confidenceConfig`, a `projection` into the future with\n `projectionConfig`, `tooltip`, and Line styles (`stroke`,\n `strokeWidth`, `strokeDasharray`, …).\n */\n trendLineConfig?: TrendLineConfig;\n /** Path or object for the topojson data. */\n topojson?: string | object;\n /** CSS color to fill the map shapes. */\n topojsonFill?: string;\n /** Accessor function for topojson feature IDs. */\n topojsonId?: (obj: Record<string, unknown>) => string;\n /** Whether the total uses the visualization's internal padding when positioning, or an accessor receiving the viz. */\n totalPadding?: boolean | ((viz: VizBase) => boolean);\n /** Value accessor for the visualization. */\n value?: DataPointAccessor<number>;\n /** Overall width of the visualization in pixels. */\n width?: number;\n /** Key, index, or accessor function for x-axis values. */\n x?: string | number | ((d: DataPoint, i: number) => unknown);\n /** Configuration for the x-axis. */\n xConfig?: AxisConfig;\n /** The x domain as an array. If either value is undefined, it is calculated from the data. */\n xDomain?: (number | Date)[];\n /** The x2 domain as an array. If either value is undefined, it is calculated from the data. */\n x2Domain?: (number | Date)[];\n /** Custom sort function for x-axis values. */\n xSort?: (a: DataPoint, b: DataPoint) => number;\n /** Defines a custom sorting comparator function for discrete x2 axes. */\n x2Sort?: (a: DataPoint, b: DataPoint) => number;\n /** Key, index, or accessor function for y-axis values. */\n y?: string | number | ((d: DataPoint, i: number) => unknown);\n /** Configuration for the y-axis. */\n yConfig?: AxisConfig;\n /** The y domain as an array. If either value is undefined, it is calculated from the data. */\n yDomain?: (number | Date)[];\n /** The y2 domain as an array. If either value is undefined, it is calculated from the data. */\n y2Domain?: (number | Date)[];\n /** Custom sort function for y-axis values. */\n ySort?: (a: DataPoint, b: DataPoint) => number;\n /** Defines a custom sorting comparator function for discrete y2 axes. */\n y2Sort?: (a: DataPoint, b: DataPoint) => number;\n /** Enables pan/zoom with zoom-control buttons. On by default for every chart. */\n zoom?: boolean;\n /** Additional CSS class name(s) applied to each zoom control button, alongside the fixed `zoom-control`/`zoom-in`/etc. classes. */\n zoomControlClassName?: string;\n /**\n Overrides one or more of the four built-in zoom-control icons (`zoomIn`,\n `zoomOut`, `zoomReset`, `zoomBrush`), which otherwise render as inline\n SVGs. Each value is either raw HTML — used as that button's content — or\n a mount function, `(el: HTMLElement) => void | (() => void)`, called\n once with the button's reserved icon slot so a live component (a React\n tree via `createRoot(el).render(...)`, or anything else imperative) can\n be mounted into it — return a cleanup function if there's teardown to do.\n */\n zoomControlIcons?: Partial<\n Record<\n \"zoomIn\" | \"zoomOut\" | \"zoomReset\" | \"zoomBrush\",\n string | ((el: HTMLElement) => void | (() => void))\n >\n >;\n /** Multiplier applied to programmatic zoom steps. */\n zoomFactor?: number;\n /** Maximum zoom scale factor. Defaults to the scale at which the smallest shape fills the chart area. */\n zoomMax?: number;\n /** Whether panning (drag) is enabled while zoomed. */\n zoomPan?: boolean;\n /**\n Whether the mouse wheel (and one-finger touch) zooms. `\"modifier\"` (the\n default) leaves page scrolling alone: only\n Ctrl/⌘ + wheel or a trackpad/two-finger pinch zooms, and one finger pans\n only once zoomed in. `true` zooms on any wheel; `false` never does.\n */\n zoomScroll?: boolean | \"modifier\";\n\n /** Allows additional custom properties. */\n [key: string]: unknown;\n}\n"],"names":[],"mappings":"AAsUA,WA+ZC"}
@@ -0,0 +1,17 @@
1
+ var defaults = new WeakSet();
2
+ /**
3
+ Marks a config function seeded by the library itself, so code that layers
4
+ config can tell it apart from one the user set.
5
+ @private
6
+ */ export function markDefault(value) {
7
+ defaults.add(value);
8
+ return value;
9
+ }
10
+ /**
11
+ Whether a config value is one registered with `markDefault`.
12
+ @private
13
+ */ export function isDefault(value) {
14
+ return typeof value === "function" && defaults.has(value);
15
+ }
16
+
17
+ //# sourceMappingURL=configDefault.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/configDefault.ts"],"sourcesContent":["const defaults = new WeakSet<object>();\n\n/**\n Marks a config function seeded by the library itself, so code that layers\n config can tell it apart from one the user set.\n @private\n*/\nexport function markDefault<T extends object>(value: T): T {\n defaults.add(value);\n return value;\n}\n\n/**\n Whether a config value is one registered with `markDefault`.\n @private\n*/\nexport function isDefault(value: unknown): boolean {\n return typeof value === \"function\" && defaults.has(value);\n}\n"],"names":["defaults","WeakSet","markDefault","value","add","isDefault","has"],"mappings":"AAAA,IAAMA,WAAW,IAAIC;AAErB;;;;AAIA,GACA,OAAO,SAASC,YAA8BC,KAAQ;IACpDH,SAASI,GAAG,CAACD;IACb,OAAOA;AACT;AAEA;;;AAGA,GACA,OAAO,SAASE,UAAUF,KAAc;IACtC,OAAO,OAAOA,UAAU,cAAcH,SAASM,GAAG,CAACH;AACrD"}
@@ -10,6 +10,7 @@ function _type_of(obj) {
10
10
  "@swc/helpers - typeof";
11
11
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
12
12
  }
13
+ import { markSharedConfig } from "./configWarnings.js";
13
14
  /**
14
15
  Preps a config object for d3plus data, and optionally bubbles up a specific nested type. When using this function, you must bind a d3plus class' `this` context.
15
16
  @param config The configuration object to parse.
@@ -78,7 +79,7 @@ function _type_of(obj) {
78
79
  keyEval(newConfig, config[nest]);
79
80
  if (config[nest].on) parseEvents(newConfig, config[nest].on);
80
81
  }
81
- return newConfig;
82
+ return markSharedConfig(newConfig);
82
83
  }
83
84
 
84
85
  //# sourceMappingURL=configPrep.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/configPrep.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\nimport { D3plusConfig } from \"./D3plusConfig.js\";\n\ninterface D3PlusWrapped {\n __d3plus__?: boolean;\n __d3plusParent__?: D3PlusWrapped;\n data?: DataPoint;\n feature?: DataPoint;\n i?: number;\n [key: string]: unknown;\n}\n\ntype DataAccessor = (\n d: DataPoint,\n i: number,\n s?: D3PlusWrapped,\n e?: Event,\n) => DataPoint[keyof DataPoint];\ntype ConfigValue =\n | DataAccessor\n | string\n | number\n | boolean\n | ConfigObject\n | ConfigValue[];\ninterface ConfigObject extends D3plusConfig {\n [key: string]: unknown;\n}\n\nexport interface VizContext {\n schema: {\n shapeConfig: ConfigObject;\n duration?: number;\n on?: Record<string, DataAccessor>;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n/**\n Preps a config object for d3plus data, and optionally bubbles up a specific nested type. When using this function, you must bind a d3plus class' `this` context.\n @param config The configuration object to parse.\n @param type The event classifier to user for \"on\" events. For example, the default event type of \"shape\" will apply all events in the \"on\" config object with that key, like \"click.shape\" and \"mouseleave.shape\", in addition to any gloval events like \"click\" and \"mouseleave\".\n @param nest An optional nested key to bubble up to the parent config level.\n*/\nexport default function configPrep(\n this: VizContext,\n config: ConfigObject = this.schema.shapeConfig,\n type: string = \"shape\",\n nest: string | false = false,\n): ConfigObject {\n const newConfig: ConfigObject = {\n duration: this.schema.duration,\n on: {},\n };\n\n const wrapFunction =\n (func: DataAccessor) =>\n (\n d: DataPoint | D3PlusWrapped,\n i: number,\n s?: D3PlusWrapped,\n e?: Event,\n ): DataPoint[keyof DataPoint] => {\n if (!func) return func as unknown as DataPoint[keyof DataPoint];\n let parent: D3PlusWrapped | undefined;\n while ((d as D3PlusWrapped).__d3plus__) {\n if (parent) (d as D3PlusWrapped).__d3plusParent__ = parent;\n parent = d as D3PlusWrapped;\n i = (d as D3PlusWrapped).i!;\n d = ((d as D3PlusWrapped).data || (d as D3PlusWrapped).feature)!;\n }\n return func.bind(this)(d as DataPoint, i, s || parent, e);\n };\n\n const parseEvents = (\n newObj: ConfigObject,\n on: Record<string, DataAccessor>,\n ): void => {\n for (const event in on) {\n if (\n ({}.hasOwnProperty.call(on, event) && !event.includes(\".\")) ||\n event.includes(`.${type}`)\n ) {\n (newObj.on as unknown as Record<string, DataAccessor>)[event] = wrapFunction(on[event]);\n }\n }\n };\n\n const arrayEval = (arr: ConfigValue[]): ConfigValue[] =>\n arr.map((d: ConfigValue) => {\n if (d instanceof Array) return arrayEval(d);\n else if (typeof d === \"object\")\n return keyEval({} as ConfigObject, d as ConfigObject);\n else if (typeof d === \"function\") return wrapFunction(d as DataAccessor);\n else return d;\n });\n\n const keyEval = (newObj: ConfigObject, obj: ConfigObject): ConfigObject => {\n for (const key in obj) {\n if ({}.hasOwnProperty.call(obj, key)) {\n if (key === \"on\")\n parseEvents(newObj, obj[key] as unknown as Record<string, DataAccessor>);\n else if (key === \"sort\")\n // `sort` is a two-argument layering comparator, not a per-datum\n // accessor — pass it through untouched so `wrapFunction` doesn't\n // rewrite it into a single-datum call (which would feed the index\n // as its second argument).\n newObj[key] = obj[key];\n else if (typeof obj[key] === \"function\") {\n newObj[key] = wrapFunction(obj[key] as DataAccessor);\n } else if (obj[key] instanceof Array) {\n newObj[key] = arrayEval(obj[key] as ConfigValue[]);\n } else if (typeof obj[key] === \"object\") {\n if (!newObj[key]) newObj[key] = {} as ConfigObject;\n (newObj[key] as ConfigObject).on = {};\n keyEval(newObj[key] as ConfigObject, obj[key] as ConfigObject);\n } else newObj[key] = obj[key];\n }\n }\n\n return newObj;\n };\n\n keyEval(newConfig, config);\n if (this.schema.on) parseEvents(newConfig, this.schema.on as unknown as Record<string, DataAccessor>);\n if (nest && config[nest]) {\n keyEval(newConfig, config[nest] as ConfigObject);\n if ((config[nest] as ConfigObject).on)\n parseEvents(newConfig, (config[nest] as ConfigObject).on as unknown as Record<string, DataAccessor>);\n }\n\n return newConfig;\n}\n"],"names":["configPrep","config","schema","shapeConfig","type","nest","newConfig","duration","on","wrapFunction","func","d","i","s","e","parent","__d3plus__","__d3plusParent__","data","feature","bind","parseEvents","newObj","event","hasOwnProperty","call","includes","arrayEval","arr","map","Array","keyEval","obj","key"],"mappings":";;;;;;;;;;;;AAuCA;;;;;AAKA,GACA,eAAe,SAASA;;QAEtBC,SAAAA,iEAAuB,IAAI,CAACC,MAAM,CAACC,WAAW,EAC9CC,OAAAA,iEAAe,SACfC,OAAAA,iEAAuB;IAEvB,IAAMC,YAA0B;QAC9BC,UAAU,IAAI,CAACL,MAAM,CAACK,QAAQ;QAC9BC,IAAI,CAAC;IACP;IAEA,IAAMC,eACJ,sBAACC;eACD,SACEC,GACAC,GACAC,GACAC;YAEA,IAAI,CAACJ,MAAM,OAAOA;YAClB,IAAIK;YACJ,MAAO,AAACJ,EAAoBK,UAAU,CAAE;gBACtC,IAAID,QAAQ,AAACJ,EAAoBM,gBAAgB,GAAGF;gBACpDA,SAASJ;gBACTC,IAAI,AAACD,EAAoBC,CAAC;gBAC1BD,IAAK,AAACA,EAAoBO,IAAI,IAAI,AAACP,EAAoBQ,OAAO;YAChE;YACA,OAAOT,KAAKU,IAAI,QAAOT,GAAgBC,GAAGC,KAAKE,QAAQD;QACzD;;IAEF,IAAMO,cAAc,qBAClBC,QACAd;QAEA,IAAK,IAAMe,SAASf,GAAI;YACtB,IACE,AAAC,CAAA,CAAC,CAAA,EAAEgB,cAAc,CAACC,IAAI,CAACjB,IAAIe,UAAU,CAACA,MAAMG,QAAQ,CAAC,QACtDH,MAAMG,QAAQ,CAAC,AAAC,IAAQ,OAALtB,QACnB;gBACCkB,OAAOd,EAAE,AAA4C,CAACe,MAAM,GAAGd,aAAaD,EAAE,CAACe,MAAM;YACxF;QACF;IACF;IAEA,IAAMI,YAAY,oBAACC;eACjBA,IAAIC,GAAG,CAAC,SAAClB;YACP,IAAIA,AAAC,YAADA,GAAamB,QAAO,OAAOH,UAAUhB;iBACpC,IAAI,CAAA,OAAOA,kCAAP,SAAOA,EAAAA,MAAM,UACpB,OAAOoB,QAAQ,CAAC,GAAmBpB;iBAChC,IAAI,OAAOA,MAAM,YAAY,OAAOF,aAAaE;iBACjD,OAAOA;QACd;;IAEF,IAAMoB,UAAU,kBAACT,QAAsBU;QACrC,IAAK,IAAMC,OAAOD,IAAK;YACrB,IAAI,CAAA,CAAC,CAAA,EAAER,cAAc,CAACC,IAAI,CAACO,KAAKC,MAAM;gBACpC,IAAIA,QAAQ,MACVZ,YAAYC,QAAQU,GAAG,CAACC,IAAI;qBACzB,IAAIA,QAAQ,QACf,gEAAgE;gBAChE,iEAAiE;gBACjE,kEAAkE;gBAClE,2BAA2B;gBAC3BX,MAAM,CAACW,IAAI,GAAGD,GAAG,CAACC,IAAI;qBACnB,IAAI,OAAOD,GAAG,CAACC,IAAI,KAAK,YAAY;oBACvCX,MAAM,CAACW,IAAI,GAAGxB,aAAauB,GAAG,CAACC,IAAI;gBACrC,OAAO,IAAID,AAAQ,YAARA,GAAG,CAACC,IAAI,EAAYH,QAAO;oBACpCR,MAAM,CAACW,IAAI,GAAGN,UAAUK,GAAG,CAACC,IAAI;gBAClC,OAAO,IAAI,SAAOD,GAAG,CAACC,IAAI,MAAK,UAAU;oBACvC,IAAI,CAACX,MAAM,CAACW,IAAI,EAAEX,MAAM,CAACW,IAAI,GAAG,CAAC;oBAChCX,MAAM,CAACW,IAAI,CAAkBzB,EAAE,GAAG,CAAC;oBACpCuB,QAAQT,MAAM,CAACW,IAAI,EAAkBD,GAAG,CAACC,IAAI;gBAC/C,OAAOX,MAAM,CAACW,IAAI,GAAGD,GAAG,CAACC,IAAI;YAC/B;QACF;QAEA,OAAOX;IACT;IAEAS,QAAQzB,WAAWL;IACnB,IAAI,IAAI,CAACC,MAAM,CAACM,EAAE,EAAEa,YAAYf,WAAW,IAAI,CAACJ,MAAM,CAACM,EAAE;IACzD,IAAIH,QAAQJ,MAAM,CAACI,KAAK,EAAE;QACxB0B,QAAQzB,WAAWL,MAAM,CAACI,KAAK;QAC/B,IAAI,AAACJ,MAAM,CAACI,KAAK,CAAkBG,EAAE,EACnCa,YAAYf,WAAW,AAACL,MAAM,CAACI,KAAK,CAAkBG,EAAE;IAC5D;IAEA,OAAOF;AACT"}
1
+ {"version":3,"sources":["../../../src/utils/configPrep.ts"],"sourcesContent":["import type {DataPoint} from \"@d3plus/data\";\nimport { D3plusConfig } from \"./D3plusConfig.js\";\nimport {markSharedConfig} from \"./configWarnings.js\";\n\ninterface D3PlusWrapped {\n __d3plus__?: boolean;\n __d3plusParent__?: D3PlusWrapped;\n data?: DataPoint;\n feature?: DataPoint;\n i?: number;\n [key: string]: unknown;\n}\n\ntype DataAccessor = (\n d: DataPoint,\n i: number,\n s?: D3PlusWrapped,\n e?: Event,\n) => DataPoint[keyof DataPoint];\ntype ConfigValue =\n | DataAccessor\n | string\n | number\n | boolean\n | ConfigObject\n | ConfigValue[];\ninterface ConfigObject extends D3plusConfig {\n [key: string]: unknown;\n}\n\nexport interface VizContext {\n schema: {\n shapeConfig: ConfigObject;\n duration?: number;\n on?: Record<string, DataAccessor>;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n/**\n Preps a config object for d3plus data, and optionally bubbles up a specific nested type. When using this function, you must bind a d3plus class' `this` context.\n @param config The configuration object to parse.\n @param type The event classifier to user for \"on\" events. For example, the default event type of \"shape\" will apply all events in the \"on\" config object with that key, like \"click.shape\" and \"mouseleave.shape\", in addition to any gloval events like \"click\" and \"mouseleave\".\n @param nest An optional nested key to bubble up to the parent config level.\n*/\nexport default function configPrep(\n this: VizContext,\n config: ConfigObject = this.schema.shapeConfig,\n type: string = \"shape\",\n nest: string | false = false,\n): ConfigObject {\n const newConfig: ConfigObject = {\n duration: this.schema.duration,\n on: {},\n };\n\n const wrapFunction =\n (func: DataAccessor) =>\n (\n d: DataPoint | D3PlusWrapped,\n i: number,\n s?: D3PlusWrapped,\n e?: Event,\n ): DataPoint[keyof DataPoint] => {\n if (!func) return func as unknown as DataPoint[keyof DataPoint];\n let parent: D3PlusWrapped | undefined;\n while ((d as D3PlusWrapped).__d3plus__) {\n if (parent) (d as D3PlusWrapped).__d3plusParent__ = parent;\n parent = d as D3PlusWrapped;\n i = (d as D3PlusWrapped).i!;\n d = ((d as D3PlusWrapped).data || (d as D3PlusWrapped).feature)!;\n }\n return func.bind(this)(d as DataPoint, i, s || parent, e);\n };\n\n const parseEvents = (\n newObj: ConfigObject,\n on: Record<string, DataAccessor>,\n ): void => {\n for (const event in on) {\n if (\n ({}.hasOwnProperty.call(on, event) && !event.includes(\".\")) ||\n event.includes(`.${type}`)\n ) {\n (newObj.on as unknown as Record<string, DataAccessor>)[event] = wrapFunction(on[event]);\n }\n }\n };\n\n const arrayEval = (arr: ConfigValue[]): ConfigValue[] =>\n arr.map((d: ConfigValue) => {\n if (d instanceof Array) return arrayEval(d);\n else if (typeof d === \"object\")\n return keyEval({} as ConfigObject, d as ConfigObject);\n else if (typeof d === \"function\") return wrapFunction(d as DataAccessor);\n else return d;\n });\n\n const keyEval = (newObj: ConfigObject, obj: ConfigObject): ConfigObject => {\n for (const key in obj) {\n if ({}.hasOwnProperty.call(obj, key)) {\n if (key === \"on\")\n parseEvents(newObj, obj[key] as unknown as Record<string, DataAccessor>);\n else if (key === \"sort\")\n // `sort` is a two-argument layering comparator, not a per-datum\n // accessor — pass it through untouched so `wrapFunction` doesn't\n // rewrite it into a single-datum call (which would feed the index\n // as its second argument).\n newObj[key] = obj[key];\n else if (typeof obj[key] === \"function\") {\n newObj[key] = wrapFunction(obj[key] as DataAccessor);\n } else if (obj[key] instanceof Array) {\n newObj[key] = arrayEval(obj[key] as ConfigValue[]);\n } else if (typeof obj[key] === \"object\") {\n if (!newObj[key]) newObj[key] = {} as ConfigObject;\n (newObj[key] as ConfigObject).on = {};\n keyEval(newObj[key] as ConfigObject, obj[key] as ConfigObject);\n } else newObj[key] = obj[key];\n }\n }\n\n return newObj;\n };\n\n keyEval(newConfig, config);\n if (this.schema.on) parseEvents(newConfig, this.schema.on as unknown as Record<string, DataAccessor>);\n if (nest && config[nest]) {\n keyEval(newConfig, config[nest] as ConfigObject);\n if ((config[nest] as ConfigObject).on)\n parseEvents(newConfig, (config[nest] as ConfigObject).on as unknown as Record<string, DataAccessor>);\n }\n\n return markSharedConfig(newConfig);\n}\n"],"names":["markSharedConfig","configPrep","config","schema","shapeConfig","type","nest","newConfig","duration","on","wrapFunction","func","d","i","s","e","parent","__d3plus__","__d3plusParent__","data","feature","bind","parseEvents","newObj","event","hasOwnProperty","call","includes","arrayEval","arr","map","Array","keyEval","obj","key"],"mappings":";;;;;;;;;;;;AAEA,SAAQA,gBAAgB,QAAO,sBAAsB;AAsCrD;;;;;AAKA,GACA,eAAe,SAASC;;QAEtBC,SAAAA,iEAAuB,IAAI,CAACC,MAAM,CAACC,WAAW,EAC9CC,OAAAA,iEAAe,SACfC,OAAAA,iEAAuB;IAEvB,IAAMC,YAA0B;QAC9BC,UAAU,IAAI,CAACL,MAAM,CAACK,QAAQ;QAC9BC,IAAI,CAAC;IACP;IAEA,IAAMC,eACJ,sBAACC;eACD,SACEC,GACAC,GACAC,GACAC;YAEA,IAAI,CAACJ,MAAM,OAAOA;YAClB,IAAIK;YACJ,MAAO,AAACJ,EAAoBK,UAAU,CAAE;gBACtC,IAAID,QAAQ,AAACJ,EAAoBM,gBAAgB,GAAGF;gBACpDA,SAASJ;gBACTC,IAAI,AAACD,EAAoBC,CAAC;gBAC1BD,IAAK,AAACA,EAAoBO,IAAI,IAAI,AAACP,EAAoBQ,OAAO;YAChE;YACA,OAAOT,KAAKU,IAAI,QAAOT,GAAgBC,GAAGC,KAAKE,QAAQD;QACzD;;IAEF,IAAMO,cAAc,qBAClBC,QACAd;QAEA,IAAK,IAAMe,SAASf,GAAI;YACtB,IACE,AAAC,CAAA,CAAC,CAAA,EAAEgB,cAAc,CAACC,IAAI,CAACjB,IAAIe,UAAU,CAACA,MAAMG,QAAQ,CAAC,QACtDH,MAAMG,QAAQ,CAAC,AAAC,IAAQ,OAALtB,QACnB;gBACCkB,OAAOd,EAAE,AAA4C,CAACe,MAAM,GAAGd,aAAaD,EAAE,CAACe,MAAM;YACxF;QACF;IACF;IAEA,IAAMI,YAAY,oBAACC;eACjBA,IAAIC,GAAG,CAAC,SAAClB;YACP,IAAIA,AAAC,YAADA,GAAamB,QAAO,OAAOH,UAAUhB;iBACpC,IAAI,CAAA,OAAOA,kCAAP,SAAOA,EAAAA,MAAM,UACpB,OAAOoB,QAAQ,CAAC,GAAmBpB;iBAChC,IAAI,OAAOA,MAAM,YAAY,OAAOF,aAAaE;iBACjD,OAAOA;QACd;;IAEF,IAAMoB,UAAU,kBAACT,QAAsBU;QACrC,IAAK,IAAMC,OAAOD,IAAK;YACrB,IAAI,CAAA,CAAC,CAAA,EAAER,cAAc,CAACC,IAAI,CAACO,KAAKC,MAAM;gBACpC,IAAIA,QAAQ,MACVZ,YAAYC,QAAQU,GAAG,CAACC,IAAI;qBACzB,IAAIA,QAAQ,QACf,gEAAgE;gBAChE,iEAAiE;gBACjE,kEAAkE;gBAClE,2BAA2B;gBAC3BX,MAAM,CAACW,IAAI,GAAGD,GAAG,CAACC,IAAI;qBACnB,IAAI,OAAOD,GAAG,CAACC,IAAI,KAAK,YAAY;oBACvCX,MAAM,CAACW,IAAI,GAAGxB,aAAauB,GAAG,CAACC,IAAI;gBACrC,OAAO,IAAID,AAAQ,YAARA,GAAG,CAACC,IAAI,EAAYH,QAAO;oBACpCR,MAAM,CAACW,IAAI,GAAGN,UAAUK,GAAG,CAACC,IAAI;gBAClC,OAAO,IAAI,SAAOD,GAAG,CAACC,IAAI,MAAK,UAAU;oBACvC,IAAI,CAACX,MAAM,CAACW,IAAI,EAAEX,MAAM,CAACW,IAAI,GAAG,CAAC;oBAChCX,MAAM,CAACW,IAAI,CAAkBzB,EAAE,GAAG,CAAC;oBACpCuB,QAAQT,MAAM,CAACW,IAAI,EAAkBD,GAAG,CAACC,IAAI;gBAC/C,OAAOX,MAAM,CAACW,IAAI,GAAGD,GAAG,CAACC,IAAI;YAC/B;QACF;QAEA,OAAOX;IACT;IAEAS,QAAQzB,WAAWL;IACnB,IAAI,IAAI,CAACC,MAAM,CAACM,EAAE,EAAEa,YAAYf,WAAW,IAAI,CAACJ,MAAM,CAACM,EAAE;IACzD,IAAIH,QAAQJ,MAAM,CAACI,KAAK,EAAE;QACxB0B,QAAQzB,WAAWL,MAAM,CAACI,KAAK;QAC/B,IAAI,AAACJ,MAAM,CAACI,KAAK,CAAkBG,EAAE,EACnCa,YAAYf,WAAW,AAACL,MAAM,CAACI,KAAK,CAAkBG,EAAE;IAC5D;IAEA,OAAOT,iBAAiBO;AAC1B"}
@@ -0,0 +1,37 @@
1
+ function _type_of(obj) {
2
+ "@swc/helpers - typeof";
3
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
4
+ }
5
+ var shared = new WeakSet();
6
+ var warned = new Set();
7
+ var enabled = true;
8
+ export function configWarnings(_) {
9
+ if (!arguments.length) return enabled;
10
+ enabled = !!_;
11
+ }
12
+ /**
13
+ Marks a config object as shared across several classes, so keys meant for
14
+ other targets (like a `shapeConfig` carrying both `r` and `width`) are
15
+ applied where supported without `BaseClass.config()` warning about the rest.
16
+ @private
17
+ */ export function markSharedConfig(config) {
18
+ shared.add(config);
19
+ return config;
20
+ }
21
+ /** @private */ export function isSharedConfig(config) {
22
+ return (typeof config === "undefined" ? "undefined" : _type_of(config)) === "object" && config !== null && shared.has(config);
23
+ }
24
+ /**
25
+ Warns that `owner` was given a config key it does not support. Each message
26
+ is logged once, so re-renders (and framework wrappers re-applying the same
27
+ config) don't flood the console.
28
+ @private
29
+ */ export function warnUnknownConfig(owner, key) {
30
+ if (!enabled) return;
31
+ var message = "".concat(owner, ' received unknown property "').concat(key, '".');
32
+ if (warned.has(message)) return;
33
+ warned.add(message);
34
+ console.warn(message);
35
+ }
36
+
37
+ //# sourceMappingURL=configWarnings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/configWarnings.ts"],"sourcesContent":["const shared = new WeakSet<object>();\nconst warned = new Set<string>();\nlet enabled = true;\n\n/**\n Toggles the console warnings d3plus logs when a class receives a config\n property it does not support (like a misspelled key passed to `.config()`\n or `shapeConfig`). Warnings are on by default and the setting applies to\n every chart on the page. With no argument, returns the current setting.\n\n@example\nimport {configWarnings} from \"@d3plus/core\";\nconfigWarnings(false);\n*/\nexport function configWarnings(): boolean;\nexport function configWarnings(_: boolean): void;\nexport function configWarnings(_?: boolean): boolean | void {\n if (!arguments.length) return enabled;\n enabled = !!_;\n}\n\n/**\n Marks a config object as shared across several classes, so keys meant for\n other targets (like a `shapeConfig` carrying both `r` and `width`) are\n applied where supported without `BaseClass.config()` warning about the rest.\n @private\n*/\nexport function markSharedConfig<T extends object>(config: T): T {\n shared.add(config);\n return config;\n}\n\n/** @private */\nexport function isSharedConfig(config: unknown): boolean {\n return typeof config === \"object\" && config !== null && shared.has(config);\n}\n\n/**\n Warns that `owner` was given a config key it does not support. Each message\n is logged once, so re-renders (and framework wrappers re-applying the same\n config) don't flood the console.\n @private\n*/\nexport function warnUnknownConfig(owner: string, key: string): void {\n if (!enabled) return;\n const message = `${owner} received unknown property \"${key}\".`;\n if (warned.has(message)) return;\n warned.add(message);\n console.warn(message);\n}\n"],"names":["shared","WeakSet","warned","Set","enabled","configWarnings","_","arguments","length","markSharedConfig","config","add","isSharedConfig","has","warnUnknownConfig","owner","key","message","console","warn"],"mappings":";;;;AAAA,IAAMA,SAAS,IAAIC;AACnB,IAAMC,SAAS,IAAIC;AACnB,IAAIC,UAAU;AAcd,OAAO,SAASC,eAAeC,CAAW;IACxC,IAAI,CAACC,UAAUC,MAAM,EAAE,OAAOJ;IAC9BA,UAAU,CAAC,CAACE;AACd;AAEA;;;;;AAKA,GACA,OAAO,SAASG,iBAAmCC,MAAS;IAC1DV,OAAOW,GAAG,CAACD;IACX,OAAOA;AACT;AAEA,aAAa,GACb,OAAO,SAASE,eAAeF,MAAe;IAC5C,OAAO,CAAA,OAAOA,uCAAP,SAAOA,OAAK,MAAM,YAAYA,WAAW,QAAQV,OAAOa,GAAG,CAACH;AACrE;AAEA;;;;;AAKA,GACA,OAAO,SAASI,kBAAkBC,KAAa,EAAEC,GAAW;IAC1D,IAAI,CAACZ,SAAS;IACd,IAAMa,UAAU,AAAC,GAAsCD,OAApCD,OAAM,gCAAkC,OAAJC,KAAI;IAC3D,IAAId,OAAOW,GAAG,CAACI,UAAU;IACzBf,OAAOS,GAAG,CAACM;IACXC,QAAQC,IAAI,CAACF;AACf"}
@@ -1,6 +1,7 @@
1
1
  export { default as accessor } from "./accessor.js";
2
2
  export { default as BaseClass } from "./BaseClass.js";
3
3
  export { default as configPrep } from "./configPrep.js";
4
+ export { configWarnings } from "./configWarnings.js";
4
5
  export { default as constant } from "./constant.js";
5
6
  export { default as getProp } from "./getProp.js";
6
7
  export { paintComponentScene } from "./paintComponentScene.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["export type {AccessorFn} from \"./AccessorFn.js\";\nexport {default as accessor} from \"./accessor.js\";\nexport {default as BaseClass} from \"./BaseClass.js\";\nexport type {\n D3plusConfig,\n AxisConfig,\n ColorScaleConfig,\n LegendConfig,\n TextBoxConfig,\n TimelineConfig,\n TooltipConfig,\n} from \"./D3plusConfig.js\";\nexport type {D3Scale} from \"./D3Scale.js\";\nexport {default as configPrep} from \"./configPrep.js\";\nexport {default as constant} from \"./constant.js\";\nexport {default as getProp} from \"./getProp.js\";\nexport {paintComponentScene} from \"./paintComponentScene.js\";\nexport {default as RESET} from \"./RESET.js\";\n"],"names":["default","accessor","BaseClass","configPrep","constant","getProp","paintComponentScene","RESET"],"mappings":"AACA,SAAQA,WAAWC,QAAQ,QAAO,gBAAgB;AAClD,SAAQD,WAAWE,SAAS,QAAO,iBAAiB;AAWpD,SAAQF,WAAWG,UAAU,QAAO,kBAAkB;AACtD,SAAQH,WAAWI,QAAQ,QAAO,gBAAgB;AAClD,SAAQJ,WAAWK,OAAO,QAAO,eAAe;AAChD,SAAQC,mBAAmB,QAAO,2BAA2B;AAC7D,SAAQN,WAAWO,KAAK,QAAO,aAAa"}
1
+ {"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["export type {AccessorFn} from \"./AccessorFn.js\";\nexport {default as accessor} from \"./accessor.js\";\nexport {default as BaseClass} from \"./BaseClass.js\";\nexport type {\n D3plusConfig,\n AxisConfig,\n ColorDefaultsConfig,\n ColorScaleConfig,\n LegendConfig,\n SizeLegendConfig,\n TextBoxConfig,\n TimelineConfig,\n TooltipConfig,\n TrendLineConfig,\n} from \"./D3plusConfig.js\";\nexport type {D3Scale} from \"./D3Scale.js\";\nexport {default as configPrep} from \"./configPrep.js\";\nexport {configWarnings} from \"./configWarnings.js\";\nexport {default as constant} from \"./constant.js\";\nexport {default as getProp} from \"./getProp.js\";\nexport {paintComponentScene} from \"./paintComponentScene.js\";\nexport {default as RESET} from \"./RESET.js\";\n"],"names":["default","accessor","BaseClass","configPrep","configWarnings","constant","getProp","paintComponentScene","RESET"],"mappings":"AACA,SAAQA,WAAWC,QAAQ,QAAO,gBAAgB;AAClD,SAAQD,WAAWE,SAAS,QAAO,iBAAiB;AAcpD,SAAQF,WAAWG,UAAU,QAAO,kBAAkB;AACtD,SAAQC,cAAc,QAAO,sBAAsB;AACnD,SAAQJ,WAAWK,QAAQ,QAAO,gBAAgB;AAClD,SAAQL,WAAWM,OAAO,QAAO,eAAe;AAChD,SAAQC,mBAAmB,QAAO,2BAA2B;AAC7D,SAAQP,WAAWQ,KAAK,QAAO,aAAa"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d3plus/core",
3
- "version": "4.5.0",
3
+ "version": "4.7.0",
4
4
  "description": "Data visualization made easy. A javascript library that extends the popular D3.js to enable fast and beautiful visualizations.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -57,22 +57,24 @@
57
57
  "d3-selection": "^3.0.0",
58
58
  "d3-shape": "^3.2.0",
59
59
  "d3-tile": "^1.0.0",
60
+ "d3-time": "^3.1.0",
60
61
  "d3-time-format": "^4.1.0",
61
62
  "d3-transition": "^3.0.1",
62
63
  "d3-zoom": "^3.0.0",
63
64
  "open-color": "^1.9.1",
64
65
  "textures": "^1.2.3",
65
66
  "topojson-client": "^3.1.0",
66
- "@d3plus/data": "4.5.0",
67
- "@d3plus/dom": "4.5.0",
68
- "@d3plus/format": "4.5.0",
69
- "@d3plus/locales": "4.5.0",
70
- "@d3plus/math": "4.5.0",
71
- "@d3plus/text": "4.5.0",
72
- "@d3plus/render": "4.5.0",
73
- "@d3plus/color": "4.5.0"
67
+ "@d3plus/data": "4.7.0",
68
+ "@d3plus/dom": "4.7.0",
69
+ "@d3plus/locales": "4.7.0",
70
+ "@d3plus/format": "4.7.0",
71
+ "@d3plus/math": "4.7.0",
72
+ "@d3plus/text": "4.7.0",
73
+ "@d3plus/render": "4.7.0",
74
+ "@d3plus/color": "4.7.0"
74
75
  },
75
76
  "devDependencies": {
77
+ "@bcoe/v8-coverage": "^1.0.2",
76
78
  "playwright": "1.59.1"
77
79
  },
78
80
  "scripts": {
@@ -81,6 +83,6 @@
81
83
  "build:umd": "node ../../scripts/build-umd.js",
82
84
  "dev": "node ../../scripts/dev.js",
83
85
  "test": "eslint index.ts internal.ts umd-entry.ts src && eslint --global=it test && mocha 'test/**/*-test.js'",
84
- "test:coverage": "c8 -r text -r lcov --src src mocha 'test/**/*-test.js'"
86
+ "test:coverage": "c8 -r text -r lcov --src src --exclude-after-remap --include 'src/**' --include '*.ts' mocha 'test/**/*-test.js'"
85
87
  }
86
88
  }
package/types/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- export { AreaPlot, BarChart, BoxWhisker, BumpChart, Chord, Donut, Geomap, LinePlot, Matrix, Network, Pack, Pie, Plot, Priestley, Radar, RadialMatrix, Rings, Sankey, StackedArea, Tree, Treemap, Viz, } from "./src/charts/index.js";
2
- export { Axis, AxisBottom, AxisLeft, AxisRight, AxisTop, ColorScale, Legend, Message, TextBox, Timeline, Tooltip, } from "./src/components/index.js";
1
+ export { AreaPlot, BarChart, BoxWhisker, BumpChart, Chord, Donut, Geomap, Histogram, LinePlot, Matrix, Network, Pack, Pie, Plot, Priestley, Radar, RadialMatrix, Rings, Sankey, StackedArea, Tree, Treemap, Viz, } from "./src/charts/index.js";
2
+ export { Axis, AxisBottom, AxisLeft, AxisRight, AxisTop, ColorScale, Legend, Message, SizeLegend, TextBox, Timeline, Tooltip, } from "./src/components/index.js";
3
3
  export { Area, Bar, Box, Circle, Image, Line, Path, Rect, Shape, Whisker, } from "./src/shapes/index.js";
4
- export { accessor, BaseClass, configPrep, constant, RESET, } from "./src/utils/index.js";
5
- export type { D3plusConfig, AxisConfig, ColorScaleConfig, LegendConfig, TextBoxConfig, TimelineConfig, TooltipConfig, } from "./src/utils/index.js";
4
+ export { accessor, BaseClass, configPrep, configWarnings, constant, RESET, } from "./src/utils/index.js";
5
+ export type { D3plusConfig, AxisConfig, ColorDefaultsConfig, ColorScaleConfig, LegendConfig, SizeLegendConfig, TextBoxConfig, TimelineConfig, TooltipConfig, TrendLineConfig, } from "./src/utils/index.js";
6
+ export type { LinkConfig, LinkOption } from "./src/charts/viz/linkGroup.js";
6
7
  export type { AnyShapeConfig, AreaConfig, BarConfig, BaseShapeConfig, BoxConfig, CircleConfig, ConstOrAccessor, ImageConfig, LineConfig, PathConfig, RectConfig, StringOrAccessor, WhiskerConfig, } from "./src/shapes/shapeConfig.js";
7
8
  export type { D3Selection, Margin, Padding, } from "./src/charts/viz/vizTypes.js";
@@ -22,8 +22,10 @@ export { applyRadarLayout } from "./src/charts/Radar/applyLayout.js";
22
22
  export { applyRadialMatrixLayout } from "./src/charts/RadialMatrix/applyLayout.js";
23
23
  export { applyTreeLayout } from "./src/charts/Tree/applyLayout.js";
24
24
  export { applyTreemapLayout } from "./src/charts/Treemap/applyLayout.js";
25
+ export { default as binData } from "./src/charts/Histogram/binData.js";
25
26
  export { chordDef } from "./src/charts/Chord/index.js";
26
27
  export { geomapDef } from "./src/charts/Geomap/index.js";
28
+ export { histogramDef } from "./src/charts/Histogram/index.js";
27
29
  export { matrixDef } from "./src/charts/Matrix/index.js";
28
30
  export { networkDef } from "./src/charts/Network/index.js";
29
31
  export { ringsDef } from "./src/charts/Rings/index.js";
@@ -37,7 +39,7 @@ export { treeDef } from "./src/charts/Tree/index.js";
37
39
  export { treemapDef } from "./src/charts/Treemap/index.js";
38
40
  export { createFluent, installFluent } from "./src/fluent.js";
39
41
  export { runStages } from "./src/charts/pipeline/stages.js";
40
- export { runVizPipeline } from "./src/charts/pipeline/runVizPipeline.js";
42
+ export { runPostDrawFeatures, runVizPipeline } from "./src/charts/pipeline/runVizPipeline.js";
41
43
  export { resolveSpec } from "./src/charts/pipeline/resolveSpec.js";
42
44
  export { vizDraw } from "./src/charts/pipeline/vizDraw.js";
43
45
  export { vizDrawPure } from "./src/charts/pipeline/vizDrawPure.js";
@@ -49,8 +51,20 @@ export { computeAxisLayout, measureAxis } from "./src/components/Axis/Axis.js";
49
51
  export { colorScaleFeature, legendFeature, runLayout, subtitleFeature, timelineFeature, titleFeature, totalFeature, } from "./src/charts/features/features.js";
50
52
  export { getTopLeftContributions, topLeftControlsFeature, TOP_LEFT_CONTRIBUTORS, } from "./src/charts/drawSteps/topLeftControls.js";
51
53
  export { backContribution } from "./src/charts/drawSteps/backControl.js";
54
+ export { BOTTOM_RIGHT_CONTRIBUTORS, bottomRightControlsFeature, reserveBottomRight, sizeLegendContribution, } from "./src/charts/drawSteps/bottomRightControls.js";
55
+ export { bottomRightClearance, bottomRightControlsBox, bottomRightControlsDrop, bottomRightControlsInset, bottomRightControlsShortfall, } from "./src/charts/drawSteps/bottomRightControlsMarkup.js";
56
+ export type { BottomRightBox, BottomRightContribution } from "./src/charts/drawSteps/bottomRightControlsMarkup.js";
57
+ export { computeSizeLegend, defaultSizeLegendValues, zoomSizeLegendScale, } from "./src/components/SizeLegend/sizeLegendLayout.js";
58
+ export type { SizeLegendLayout, SizeLegendScale, SizeLegendSize } from "./src/components/SizeLegend/sizeLegendLayout.js";
59
+ export { drawWithInset, fitInset, sceneInsetRegion } from "./src/charts/pipeline/insetPlacement.js";
60
+ export { markBoxes } from "./src/charts/features/sceneBounds.js";
61
+ export { INSET_PRIORITY, insetBackground, insetComponentOffset, insetFrame, insetOrient, insetPlacementFor, insetStyle, isInsetPending, } from "./src/charts/features/insetState.js";
62
+ export type { InsetKey, InsetOrient, InsetPlacement, InsetRegion, InsetStyle, } from "./src/charts/features/insetState.js";
52
63
  export { tableViewContribution } from "./src/charts/drawSteps/tableViewControl.js";
53
64
  export { searchContribution } from "./src/charts/drawSteps/searchControls.js";
65
+ export { broadcastLegend, broadcastLink, linkAs, linkKeys, linkedColorDefaults, linkMembers, linkPredicate, linkValues, registerLink, resolveLink, unregisterLink, } from "./src/charts/viz/linkGroup.js";
66
+ export type { LinkKind, ResolvedLink } from "./src/charts/viz/linkGroup.js";
67
+ export { forEachSceneRow, MARK_TYPES } from "./src/charts/viz/sceneRows.js";
54
68
  export type { ResolvedSpec } from "./src/charts/pipeline/resolveSpec.js";
55
69
  export type { VizContext } from "./src/charts/pipeline/vizContext.js";
56
70
  export type { VizPreDrawResult } from "./src/charts/pipeline/vizPreDrawPure.js";
@@ -4,7 +4,8 @@
4
4
  import type { ChartDefinition } from "../definition/ChartDefinition.js";
5
5
  export declare const barChartDef: ChartDefinition;
6
6
  /**
7
- Creates a bar chart based on an array of data.
7
+ Creates a bar chart based on an array of data. When stacked, each bar's
8
+ fraction of its stack total is available to tooltip accessors as `share`.
8
9
  */
9
10
  declare const _default: new () => any;
10
11
  export default _default;
@@ -3,5 +3,13 @@
3
3
  topojson → feature conversion + filter, builds the d3-geo path
4
4
  generator, fits the projection, and stashes `geomapCtx` on `viz.ctx`.
5
5
  */
6
- import type { TransformStage } from "../pipeline/stages.js";
6
+ import type { DataPoint } from "@d3plus/data";
7
+ import type { TransformStage, VizContext } from "../pipeline/stages.js";
8
+ import type { SizeLegendScale } from "../../components/SizeLegend/sizeLegendLayout.js";
9
+ type GeomapViz = VizContext["viz"];
10
+ /** The rows drawn as points: those whose `point` accessor returns coordinates. */
11
+ export declare function geomapPointData(v: GeomapViz): DataPoint[];
12
+ /** The point radius scale: `pointSizeScale` over the points' `pointSize` extent, onto `[pointSizeMin, pointSizeMax]`. */
13
+ export declare function geomapPointSizeScale(v: GeomapViz, pointData: DataPoint[]): SizeLegendScale;
7
14
  export declare const applyGeomapLayout: TransformStage;
15
+ export {};
@@ -0,0 +1,37 @@
1
+ import type { DataPoint } from "@d3plus/data";
2
+ /** A d3-array threshold generator: `(values, min, max) → count | edges`. */
3
+ export type ThresholdGenerator = (values: ArrayLike<number>, min: number, max: number) => number | number[];
4
+ /** How bin heights are normalized. */
5
+ export type BinNormalize = "count" | "density" | "relative";
6
+ export interface BinOptions {
7
+ /** Numeric observation accessor. */
8
+ value: (d: DataPoint, i: number) => unknown;
9
+ /** Series key for a row; rows sharing a key are binned together. */
10
+ group?: (d: DataPoint, i: number) => string;
11
+ /** Bin count, explicit edges, or a threshold generator. */
12
+ thresholds?: number | number[] | ThresholdGenerator;
13
+ /** `[min, max]` to bin across; defaults to the values' extent. */
14
+ domain?: [number, number];
15
+ /** Uniform bin width; overrides `thresholds`. */
16
+ width?: number;
17
+ /** `"count"` (default), `"density"` (area sums to 1), or `"relative"` (heights sum to 1). */
18
+ normalize?: BinNormalize;
19
+ }
20
+ /** One bin of one group. Carries the group's first row's fields. */
21
+ export interface BinRow extends DataPoint {
22
+ /** Bin start (inclusive). */
23
+ x0: number;
24
+ /** Bin end (exclusive, except for the last bin). */
25
+ x1: number;
26
+ /** Bin midpoint. */
27
+ x: number;
28
+ /** Observations in this group's bin. */
29
+ count: number;
30
+ /** The normalized height. */
31
+ y: number;
32
+ }
33
+ /**
34
+ Bins `rows` by `options.value`. Non-finite values are dropped. Every group
35
+ gets a row for every bin (empty bins included, so stacks line up).
36
+ */
37
+ export default function binData(rows: DataPoint[], options: BinOptions): BinRow[];
@@ -0,0 +1,14 @@
1
+ /**
2
+ Histogram — BarChart-style Plot that bins raw observations along a linear
3
+ x axis, one contiguous bar per bin, stacking series by `groupBy`.
4
+ */
5
+ import type { ChartDefinition } from "../definition/ChartDefinition.js";
6
+ export declare const histogramDef: ChartDefinition;
7
+ /**
8
+ Creates a histogram from an array of raw observations: the `value` of each
9
+ row is binned along a linear x axis, and bar heights show each bin's
10
+ count (or density / relative frequency via `binNormalize`). Series set by
11
+ `groupBy` share bin edges and are stacked.
12
+ */
13
+ declare const _default: new () => any;
14
+ export default _default;
@@ -7,4 +7,12 @@
7
7
  `viz.ctx` for the click/hover handlers installed by `setup`.
8
8
  */
9
9
  import type { TransformStage } from "../pipeline/stages.js";
10
+ import type { SizeLegendScale } from "../../components/SizeLegend/sizeLegendLayout.js";
11
+ /**
12
+ Network's size-legend scale for a chart area of `width` × `height`: the
13
+ same node set, positions, and fitted radius scale the layout builds, run
14
+ on a scratch copy of the nodes. The fit only shrinks as the area does, so
15
+ the layout's final radii never exceed this estimate's.
16
+ */
17
+ export declare function networkSizeLegendScale(v: Parameters<TransformStage>[0]["viz"], width: number, height: number): SizeLegendScale | null;
10
18
  export declare const applyNetworkLayout: TransformStage;
@@ -0,0 +1,9 @@
1
+ import type { VizInstance } from "../viz/vizTypes.js";
2
+ /** Whether `axis` is a span-valued discrete axis. */
3
+ export declare function isSpanAxis(viz: VizInstance, axis: string): boolean;
4
+ /** `[start, end]` of a formatted Plot row (reads its source `data`). */
5
+ export declare function rowSpan(viz: VizInstance, row: Record<string, unknown>): [number, number];
6
+ /** The `[min start, max end]` domain covering every row's span. */
7
+ export declare function spanDomain(viz: VizInstance, rows: Record<string, unknown>[]): number[];
8
+ /** Every unique span boundary, ascending — the tick values for a span axis. */
9
+ export declare function spanEdges(viz: VizInstance, rows: Record<string, unknown>[]): number[];
@@ -1,6 +1,7 @@
1
1
  import { type StackOffsetFn, type StackOrderFn, type StackOrderInput } from "./stackHelpers.js";
2
2
  import type { PlotPaintContext } from "../features/plotPaint.js";
3
3
  import { type ZoomState } from "./plotZoom.js";
4
+ import { type TrendLineType } from "./trendLines.js";
4
5
  import Viz from "../viz/Viz.js";
5
6
  import type { InteractionPoint, PickResult, Scene, SceneEvent } from "@d3plus/render";
6
7
  import type { DataPoint } from "@d3plus/data";
@@ -13,6 +14,8 @@ type PlotAccessorArg = string | PlotAccessor;
13
14
  Creates an x/y plot based on an array of data.
14
15
  */
15
16
  export default class Plot extends Viz {
17
+ _trendLine: TrendLineType;
18
+ _trendLineConfig: Record<string, unknown>;
16
19
  /**
17
20
  Invoked when creating a new class instance, and sets any default parameters.
18
21
  @private
@@ -70,11 +73,30 @@ export default class Plot extends Viz {
70
73
  @private
71
74
  */
72
75
  _nearestInteractionPoint(points: InteractionPoint[], point: [number, number]): InteractionPoint | null;
76
+ /**
77
+ Drives the shared multi-series tooltip + crosshair: while the pointer is
78
+ inside the plot area, snaps to the nearest discrete position and, when
79
+ two or more series share it, shows them all in one tooltip (suppressing
80
+ the single-shape tooltip). Clears on leaving the plot area or the chart.
81
+ @private
82
+ */
83
+ _sharedHover(event: SceneEvent): void;
73
84
  /**
74
85
  Extends the draw behavior of the abstract Viz class.
75
86
  @private
76
87
  */
77
88
  _draw(callback?: () => void): VizInstance;
89
+ /**
90
+ The bubble radius scale, for the size legend (see `plotSizeLegendScale`).
91
+ @private
92
+ */
93
+ _sizeLegendScale(): import("../../../internal.js").SizeLegendScale | null;
94
+ /**
95
+ The plot area, with the plotted marks as obstacles, for drawing a
96
+ legend inside the plot's empty space (see `legendInset`).
97
+ @private
98
+ */
99
+ _insetRegion(): import("../features/insetState.js").InsetRegion | null;
78
100
  /**
79
101
  Paint phase: production axis rendering, shape buffer setup, and shape
80
102
  emission with event handlers. Receives all cross-phase locals from
@@ -140,6 +162,31 @@ export default class Plot extends Viz {
140
162
  The behavior to be used when calculating the position and size of each shape's label(s). The value passed can either be the _String_ name of the behavior to be used for all shapes, or an accessor _Function_ that will be provided each data point and will be expected to return the behavior to be used for that data point. The availability and options for this method depend on the default logic for each Shape. As an example, the values "outside" or "inside" can be set for Bar shapes, whose "auto" default will calculate the best position dynamically based on the available space.
141
163
  */
142
164
  labelPosition(_?: string | ((d: DataPoint, i: number) => string)): this | ((d: DataPoint, i: number) => string);
165
+ /**
166
+ Paint for the shared tooltip's crosshair guide line (`stroke`,
167
+ `strokeWidth`, `strokeDasharray`, `strokeOpacity`, …). Merged into the
168
+ current config.
169
+ */
170
+ crosshairConfig(_?: Record<string, unknown>): this | Record<string, unknown>;
171
+ /**
172
+ Draws an automatic trend line fit to the plotted data: `true` (or `"linear"`) for a least-squares line, or one of `"exponential"`, `"logarithmic"`, `"power"`, or `"polynomial"`. By default each series gets its own line in its color; see `trendLineConfig` for grouping, a confidence band, and styling. On a chart with a discrete axis, the line runs along that axis, fitting categories by their order. Set to `false` (the default) to remove.
173
+ */
174
+ trendLine(_?: TrendLineType): this | TrendLineType;
175
+ /**
176
+ Options for the trend lines drawn by `trendLine`, merged into the current config:
177
+ - `group`: `"series"` (default) fits one line per series, colored to match it; `"all"` fits a single line to every point.
178
+ - `order`: the polynomial degree when `trendLine` is `"polynomial"` (default `2`).
179
+ - `confidence`: draws a confidence band around a linear fit (default `false`).
180
+ - `confidenceLevel`: the band's confidence level (default `0.95`).
181
+ - `confidenceConfig`: Area shape config for the band (default `{fillOpacity: 0.15}`; fill defaults to the line color).
182
+ - `projection`: extends each line past the end of its data, by a number of steps at the data's own spacing (e.g. `5` more years), or to an end value with `{to: 2030}` (default `0`, off). The axis widens to fit, and a linear fit's band becomes a prediction interval that fans out over the projection. Hovering a projected step lists each series' projected value. Ignored on a category axis.
183
+ - `projectionConfig`: Line shape config for the projected stretch, over the line's own styles (default `{strokeDasharray: "2 4"}`).
184
+ - `tooltip`: shows the fitted equation and R² when hovering a line (default `true`).
185
+ - Any other key (`stroke`, `strokeWidth`, `strokeDasharray`, …) styles the Line shape.
186
+
187
+ Stacked charts always fit one line to the stack totals.
188
+ */
189
+ trendLineConfig(_?: Record<string, unknown>): this | Record<string, unknown>;
143
190
  /**
144
191
  Shape config for the Circle shapes drawn by the lineMarkers method.
145
192
  */