@d3plus/core 4.3.0 → 4.6.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 (335) hide show
  1. package/README.md +7406 -3676
  2. package/es/index.js +3 -3
  3. package/es/index.js.map +1 -1
  4. package/es/internal.js +13 -2
  5. package/es/internal.js.map +1 -1
  6. package/es/src/charts/AreaPlot/index.js +1 -2
  7. package/es/src/charts/AreaPlot/index.js.map +1 -1
  8. package/es/src/charts/BarChart/index.js +9 -3
  9. package/es/src/charts/BarChart/index.js.map +1 -1
  10. package/es/src/charts/BoxWhisker/index.js +6 -2
  11. package/es/src/charts/BoxWhisker/index.js.map +1 -1
  12. package/es/src/charts/BumpChart/index.js +1 -2
  13. package/es/src/charts/BumpChart/index.js.map +1 -1
  14. package/es/src/charts/Chord/applyLayout.js +205 -0
  15. package/es/src/charts/Chord/applyLayout.js.map +1 -0
  16. package/es/src/charts/Chord/emit.js +220 -0
  17. package/es/src/charts/Chord/emit.js.map +1 -0
  18. package/es/src/charts/Chord/index.js +249 -0
  19. package/es/src/charts/Chord/index.js.map +1 -0
  20. package/es/src/charts/Geomap/applyLayout.js +17 -10
  21. package/es/src/charts/Geomap/applyLayout.js.map +1 -1
  22. package/es/src/charts/Geomap/basemapTheme.js +78 -0
  23. package/es/src/charts/Geomap/basemapTheme.js.map +1 -0
  24. package/es/src/charts/Geomap/emit.js +18 -9
  25. package/es/src/charts/Geomap/emit.js.map +1 -1
  26. package/es/src/charts/Geomap/index.js +74 -105
  27. package/es/src/charts/Geomap/index.js.map +1 -1
  28. package/es/src/charts/Histogram/binData.js +225 -0
  29. package/es/src/charts/Histogram/binData.js.map +1 -0
  30. package/es/src/charts/Histogram/index.js +271 -0
  31. package/es/src/charts/Histogram/index.js.map +1 -0
  32. package/es/src/charts/LinePlot/index.js +1 -2
  33. package/es/src/charts/LinePlot/index.js.map +1 -1
  34. package/es/src/charts/Matrix/emit.js +6 -0
  35. package/es/src/charts/Matrix/emit.js.map +1 -1
  36. package/es/src/charts/Matrix/index.js +1 -2
  37. package/es/src/charts/Matrix/index.js.map +1 -1
  38. package/es/src/charts/Network/applyLayout.js +52 -4
  39. package/es/src/charts/Network/applyLayout.js.map +1 -1
  40. package/es/src/charts/Network/emit.js +61 -27
  41. package/es/src/charts/Network/emit.js.map +1 -1
  42. package/es/src/charts/Network/index.js +40 -55
  43. package/es/src/charts/Network/index.js.map +1 -1
  44. package/es/src/charts/Pack/emit.js +40 -2
  45. package/es/src/charts/Pack/emit.js.map +1 -1
  46. package/es/src/charts/Pack/index.js +14 -2
  47. package/es/src/charts/Pack/index.js.map +1 -1
  48. package/es/src/charts/Pie/applyLayout.js +20 -2
  49. package/es/src/charts/Pie/applyLayout.js.map +1 -1
  50. package/es/src/charts/Pie/emit.js +277 -32
  51. package/es/src/charts/Pie/emit.js.map +1 -1
  52. package/es/src/charts/Pie/index.js +47 -3
  53. package/es/src/charts/Pie/index.js.map +1 -1
  54. package/es/src/charts/Plot/discreteSpan.js +42 -0
  55. package/es/src/charts/Plot/discreteSpan.js.map +1 -0
  56. package/es/src/charts/Plot/draw.js +3 -1
  57. package/es/src/charts/Plot/draw.js.map +1 -1
  58. package/es/src/charts/Plot/index.js +152 -17
  59. package/es/src/charts/Plot/index.js.map +1 -1
  60. package/es/src/charts/Plot/pipeline.js +48 -22
  61. package/es/src/charts/Plot/pipeline.js.map +1 -1
  62. package/es/src/charts/Plot/pipelineDomains.js +84 -8
  63. package/es/src/charts/Plot/pipelineDomains.js.map +1 -1
  64. package/es/src/charts/Plot/plotZoom.js +278 -0
  65. package/es/src/charts/Plot/plotZoom.js.map +1 -0
  66. package/es/src/charts/Plot/shapeDefaults.js +3 -3
  67. package/es/src/charts/Plot/shapeDefaults.js.map +1 -1
  68. package/es/src/charts/Plot/sharedHover.js +431 -0
  69. package/es/src/charts/Plot/sharedHover.js.map +1 -0
  70. package/es/src/charts/Plot/sharedHoverScene.js +230 -0
  71. package/es/src/charts/Plot/sharedHoverScene.js.map +1 -0
  72. package/es/src/charts/Plot/sharedTooltip.js +163 -0
  73. package/es/src/charts/Plot/sharedTooltip.js.map +1 -0
  74. package/es/src/charts/Plot/stackShareLabels.js +137 -0
  75. package/es/src/charts/Plot/stackShareLabels.js.map +1 -0
  76. package/es/src/charts/Plot/stackShareTooltip.js +31 -0
  77. package/es/src/charts/Plot/stackShareTooltip.js.map +1 -0
  78. package/es/src/charts/Plot/trendLines.js +367 -0
  79. package/es/src/charts/Plot/trendLines.js.map +1 -0
  80. package/es/src/charts/Plot/trendScene.js +220 -0
  81. package/es/src/charts/Plot/trendScene.js.map +1 -0
  82. package/es/src/charts/Plot/trendTooltip.js +160 -0
  83. package/es/src/charts/Plot/trendTooltip.js.map +1 -0
  84. package/es/src/charts/Priestley/emit.js +36 -3
  85. package/es/src/charts/Priestley/emit.js.map +1 -1
  86. package/es/src/charts/Priestley/index.js +1 -2
  87. package/es/src/charts/Priestley/index.js.map +1 -1
  88. package/es/src/charts/Radar/emit.js +4 -1
  89. package/es/src/charts/Radar/emit.js.map +1 -1
  90. package/es/src/charts/Radar/index.js +16 -4
  91. package/es/src/charts/Radar/index.js.map +1 -1
  92. package/es/src/charts/RadialMatrix/emit.js +6 -0
  93. package/es/src/charts/RadialMatrix/emit.js.map +1 -1
  94. package/es/src/charts/RadialMatrix/index.js +18 -3
  95. package/es/src/charts/RadialMatrix/index.js.map +1 -1
  96. package/es/src/charts/Rings/applyLayout.js +72 -116
  97. package/es/src/charts/Rings/applyLayout.js.map +1 -1
  98. package/es/src/charts/Rings/emit.js +75 -10
  99. package/es/src/charts/Rings/emit.js.map +1 -1
  100. package/es/src/charts/Rings/index.js +24 -5
  101. package/es/src/charts/Rings/index.js.map +1 -1
  102. package/es/src/charts/Rings/ringsSizing.js +189 -0
  103. package/es/src/charts/Rings/ringsSizing.js.map +1 -0
  104. package/es/src/charts/Sankey/emit.js +55 -11
  105. package/es/src/charts/Sankey/emit.js.map +1 -1
  106. package/es/src/charts/Sankey/index.js +8 -2
  107. package/es/src/charts/Sankey/index.js.map +1 -1
  108. package/es/src/charts/StackedArea/index.js +9 -3
  109. package/es/src/charts/StackedArea/index.js.map +1 -1
  110. package/es/src/charts/Tree/emit.js +10 -4
  111. package/es/src/charts/Tree/emit.js.map +1 -1
  112. package/es/src/charts/Tree/index.js +6 -5
  113. package/es/src/charts/Tree/index.js.map +1 -1
  114. package/es/src/charts/Treemap/emit.js +56 -3
  115. package/es/src/charts/Treemap/emit.js.map +1 -1
  116. package/es/src/charts/Treemap/index.js +1 -2
  117. package/es/src/charts/Treemap/index.js.map +1 -1
  118. package/es/src/charts/definition/ChartDefinition.js.map +1 -1
  119. package/es/src/charts/definition/makeChart.js +8 -1
  120. package/es/src/charts/definition/makeChart.js.map +1 -1
  121. package/es/src/charts/drawSteps/backControl.js +85 -0
  122. package/es/src/charts/drawSteps/backControl.js.map +1 -0
  123. package/es/src/charts/drawSteps/bottomRightControls.js +193 -0
  124. package/es/src/charts/drawSteps/bottomRightControls.js.map +1 -0
  125. package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +161 -0
  126. package/es/src/charts/drawSteps/bottomRightControlsMarkup.js.map +1 -0
  127. package/es/src/charts/drawSteps/controlButtonStyle.js +108 -0
  128. package/es/src/charts/drawSteps/controlButtonStyle.js.map +1 -0
  129. package/es/src/charts/drawSteps/minimap.js +395 -0
  130. package/es/src/charts/drawSteps/minimap.js.map +1 -0
  131. package/es/src/charts/drawSteps/minimapMarkup.js +147 -0
  132. package/es/src/charts/drawSteps/minimapMarkup.js.map +1 -0
  133. package/es/src/charts/drawSteps/searchControls.js +358 -0
  134. package/es/src/charts/drawSteps/searchControls.js.map +1 -0
  135. package/es/src/charts/drawSteps/searchControlsMarkup.js +430 -0
  136. package/es/src/charts/drawSteps/searchControlsMarkup.js.map +1 -0
  137. package/es/src/charts/drawSteps/tableView.js +173 -0
  138. package/es/src/charts/drawSteps/tableView.js.map +1 -0
  139. package/es/src/charts/drawSteps/tableViewControl.js +39 -0
  140. package/es/src/charts/drawSteps/tableViewControl.js.map +1 -0
  141. package/es/src/charts/drawSteps/tableViewMarkup.js +647 -0
  142. package/es/src/charts/drawSteps/tableViewMarkup.js.map +1 -0
  143. package/es/src/charts/drawSteps/topLeftControls.js +73 -0
  144. package/es/src/charts/drawSteps/topLeftControls.js.map +1 -0
  145. package/es/src/charts/drawSteps/topLeftControlsMarkup.js +227 -0
  146. package/es/src/charts/drawSteps/topLeftControlsMarkup.js.map +1 -0
  147. package/es/src/charts/drawSteps/zoomControls.js +317 -175
  148. package/es/src/charts/drawSteps/zoomControls.js.map +1 -1
  149. package/es/src/charts/drawSteps/zoomControlsMarkup.js +280 -0
  150. package/es/src/charts/drawSteps/zoomControlsMarkup.js.map +1 -0
  151. package/es/src/charts/events/click.shape.js +24 -1
  152. package/es/src/charts/events/click.shape.js.map +1 -1
  153. package/es/src/charts/events/mouseenter.js +3 -0
  154. package/es/src/charts/events/mouseenter.js.map +1 -1
  155. package/es/src/charts/events/mouseleave.js +3 -0
  156. package/es/src/charts/events/mouseleave.js.map +1 -1
  157. package/es/src/charts/events/mousemove.shape.js +2 -0
  158. package/es/src/charts/events/mousemove.shape.js.map +1 -1
  159. package/es/src/charts/features/attributionFeature.js +137 -0
  160. package/es/src/charts/features/attributionFeature.js.map +1 -0
  161. package/es/src/charts/features/axes.js +24 -9
  162. package/es/src/charts/features/axes.js.map +1 -1
  163. package/es/src/charts/features/chartGeometry.js +16 -2
  164. package/es/src/charts/features/chartGeometry.js.map +1 -1
  165. package/es/src/charts/features/edgeArrows.js +155 -0
  166. package/es/src/charts/features/edgeArrows.js.map +1 -0
  167. package/es/src/charts/features/emitHelpers.js +32 -0
  168. package/es/src/charts/features/emitHelpers.js.map +1 -1
  169. package/es/src/charts/features/ensureZoomDom.js +63 -12
  170. package/es/src/charts/features/ensureZoomDom.js.map +1 -1
  171. package/es/src/charts/features/features.js +89 -112
  172. package/es/src/charts/features/features.js.map +1 -1
  173. package/es/src/charts/features/featuresLegend.js +53 -17
  174. package/es/src/charts/features/featuresLegend.js.map +1 -1
  175. package/es/src/charts/features/plotPaint.js +81 -29
  176. package/es/src/charts/features/plotPaint.js.map +1 -1
  177. package/es/src/charts/features/shapeEmit.js +20 -2
  178. package/es/src/charts/features/shapeEmit.js.map +1 -1
  179. package/es/src/charts/features/zoomExtent.js +185 -0
  180. package/es/src/charts/features/zoomExtent.js.map +1 -0
  181. package/es/src/charts/helpers/tileAttributions.js +26 -0
  182. package/es/src/charts/helpers/tileAttributions.js.map +1 -1
  183. package/es/src/charts/index.js +2 -0
  184. package/es/src/charts/index.js.map +1 -1
  185. package/es/src/charts/pipeline/drillMorph.js +159 -0
  186. package/es/src/charts/pipeline/drillMorph.js.map +1 -0
  187. package/es/src/charts/pipeline/runChartDraw.js +35 -1
  188. package/es/src/charts/pipeline/runChartDraw.js.map +1 -1
  189. package/es/src/charts/pipeline/runVizPipeline.js +49 -15
  190. package/es/src/charts/pipeline/runVizPipeline.js.map +1 -1
  191. package/es/src/charts/pipeline/vizDrawPure.js +52 -6
  192. package/es/src/charts/pipeline/vizDrawPure.js.map +1 -1
  193. package/es/src/charts/viz/Viz.js +103 -59
  194. package/es/src/charts/viz/Viz.js.map +1 -1
  195. package/es/src/charts/viz/VizBase.js +186 -5
  196. package/es/src/charts/viz/VizBase.js.map +1 -1
  197. package/es/src/charts/viz/VizBaseConfig.js +41 -3
  198. package/es/src/charts/viz/VizBaseConfig.js.map +1 -1
  199. package/es/src/charts/viz/ordinalColor.js +2 -2
  200. package/es/src/charts/viz/ordinalColor.js.map +1 -1
  201. package/es/src/charts/viz/vizDefaults.js +270 -58
  202. package/es/src/charts/viz/vizDefaults.js.map +1 -1
  203. package/es/src/charts/viz/vizRender.js +54 -4
  204. package/es/src/charts/viz/vizRender.js.map +1 -1
  205. package/es/src/charts/viz/vizTypes.js.map +1 -1
  206. package/es/src/charts/viz/vizVisibility.js +145 -0
  207. package/es/src/charts/viz/vizVisibility.js.map +1 -0
  208. package/es/src/components/Axis/Axis.js +18 -9
  209. package/es/src/components/Axis/Axis.js.map +1 -1
  210. package/es/src/components/Axis/axisLayoutLabels.js +2 -1
  211. package/es/src/components/Axis/axisLayoutLabels.js.map +1 -1
  212. package/es/src/components/Axis/axisRender.js +5 -1
  213. package/es/src/components/Axis/axisRender.js.map +1 -1
  214. package/es/src/components/ColorScale/ColorScale.js +11 -11
  215. package/es/src/components/ColorScale/ColorScale.js.map +1 -1
  216. package/es/src/components/ColorScale/colorScaleScale.js +22 -10
  217. package/es/src/components/ColorScale/colorScaleScale.js.map +1 -1
  218. package/es/src/components/Legend/Legend.js +8 -5
  219. package/es/src/components/Legend/Legend.js.map +1 -1
  220. package/es/src/components/Legend/legendConfig.js +87 -21
  221. package/es/src/components/Legend/legendConfig.js.map +1 -1
  222. package/es/src/components/Legend/legendRender.js +29 -22
  223. package/es/src/components/Legend/legendRender.js.map +1 -1
  224. package/es/src/components/SizeLegend/SizeLegend.js +411 -0
  225. package/es/src/components/SizeLegend/SizeLegend.js.map +1 -0
  226. package/es/src/components/SizeLegend/sizeLegendLayout.js +285 -0
  227. package/es/src/components/SizeLegend/sizeLegendLayout.js.map +1 -0
  228. package/es/src/components/Timeline/timelineConfig.js +8 -4
  229. package/es/src/components/Timeline/timelineConfig.js.map +1 -1
  230. package/es/src/components/Timeline/timelineRender.js +1 -2
  231. package/es/src/components/Timeline/timelineRender.js.map +1 -1
  232. package/es/src/components/Tooltip.js +27 -7
  233. package/es/src/components/Tooltip.js.map +1 -1
  234. package/es/src/components/index.js +1 -0
  235. package/es/src/components/index.js.map +1 -1
  236. package/es/src/shapes/Box.js +4 -2
  237. package/es/src/shapes/Box.js.map +1 -1
  238. package/es/src/shapes/Shape.js +1 -1
  239. package/es/src/shapes/Shape.js.map +1 -1
  240. package/es/src/shapes/Whisker.js +3 -2
  241. package/es/src/shapes/Whisker.js.map +1 -1
  242. package/es/src/shapes/validateShapeConfig.js +141 -0
  243. package/es/src/shapes/validateShapeConfig.js.map +1 -0
  244. package/es/src/utils/BaseClass.js +134 -4
  245. package/es/src/utils/BaseClass.js.map +1 -1
  246. package/es/src/utils/D3plusConfig.js.map +1 -1
  247. package/es/src/utils/configDefault.js +17 -0
  248. package/es/src/utils/configDefault.js.map +1 -0
  249. package/es/src/utils/configPrep.js +2 -1
  250. package/es/src/utils/configPrep.js.map +1 -1
  251. package/es/src/utils/configWarnings.js +37 -0
  252. package/es/src/utils/configWarnings.js.map +1 -0
  253. package/es/src/utils/index.js +1 -0
  254. package/es/src/utils/index.js.map +1 -1
  255. package/package.json +13 -11
  256. package/types/index.d.ts +4 -4
  257. package/types/internal.d.ts +16 -2
  258. package/types/src/charts/BarChart/index.d.ts +2 -1
  259. package/types/src/charts/Chord/applyLayout.d.ts +43 -0
  260. package/types/src/charts/Chord/emit.d.ts +10 -0
  261. package/types/src/charts/Chord/index.d.ts +19 -0
  262. package/types/src/charts/Geomap/applyLayout.d.ts +9 -1
  263. package/types/src/charts/Geomap/basemapTheme.d.ts +35 -0
  264. package/types/src/charts/Histogram/binData.d.ts +37 -0
  265. package/types/src/charts/Histogram/index.d.ts +14 -0
  266. package/types/src/charts/Network/applyLayout.d.ts +8 -0
  267. package/types/src/charts/Plot/discreteSpan.d.ts +9 -0
  268. package/types/src/charts/Plot/index.d.ts +51 -3
  269. package/types/src/charts/Plot/pipeline.d.ts +14 -0
  270. package/types/src/charts/Plot/plotZoom.d.ts +65 -0
  271. package/types/src/charts/Plot/sharedHover.d.ts +79 -0
  272. package/types/src/charts/Plot/sharedHoverScene.d.ts +11 -0
  273. package/types/src/charts/Plot/sharedTooltip.d.ts +26 -0
  274. package/types/src/charts/Plot/stackShareLabels.d.ts +21 -0
  275. package/types/src/charts/Plot/stackShareTooltip.d.ts +9 -0
  276. package/types/src/charts/Plot/trendLines.d.ts +70 -0
  277. package/types/src/charts/Plot/trendScene.d.ts +18 -0
  278. package/types/src/charts/Plot/trendTooltip.d.ts +19 -0
  279. package/types/src/charts/Rings/applyLayout.d.ts +9 -0
  280. package/types/src/charts/Rings/ringsSizing.d.ts +49 -0
  281. package/types/src/charts/StackedArea/index.d.ts +2 -1
  282. package/types/src/charts/definition/ChartDefinition.d.ts +33 -1
  283. package/types/src/charts/definition/makeChart.d.ts +2 -1
  284. package/types/src/charts/drawSteps/backControl.d.ts +29 -0
  285. package/types/src/charts/drawSteps/bottomRightControls.d.ts +26 -0
  286. package/types/src/charts/drawSteps/bottomRightControlsMarkup.d.ts +108 -0
  287. package/types/src/charts/drawSteps/controlButtonStyle.d.ts +45 -0
  288. package/types/src/charts/drawSteps/minimap.d.ts +19 -0
  289. package/types/src/charts/drawSteps/minimapMarkup.d.ts +45 -0
  290. package/types/src/charts/drawSteps/searchControls.d.ts +3 -0
  291. package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +111 -0
  292. package/types/src/charts/drawSteps/tableView.d.ts +23 -0
  293. package/types/src/charts/drawSteps/tableViewControl.d.ts +21 -0
  294. package/types/src/charts/drawSteps/tableViewMarkup.d.ts +119 -0
  295. package/types/src/charts/drawSteps/topLeftControls.d.ts +32 -0
  296. package/types/src/charts/drawSteps/topLeftControlsMarkup.d.ts +72 -0
  297. package/types/src/charts/drawSteps/zoomControls.d.ts +48 -8
  298. package/types/src/charts/drawSteps/zoomControlsMarkup.d.ts +138 -0
  299. package/types/src/charts/features/attributionFeature.d.ts +21 -0
  300. package/types/src/charts/features/axes.d.ts +1 -1
  301. package/types/src/charts/features/chartGeometry.d.ts +9 -3
  302. package/types/src/charts/features/edgeArrows.d.ts +92 -0
  303. package/types/src/charts/features/emitHelpers.d.ts +19 -0
  304. package/types/src/charts/features/ensureZoomDom.d.ts +6 -2
  305. package/types/src/charts/features/features.d.ts +32 -17
  306. package/types/src/charts/features/featuresLegend.d.ts +15 -0
  307. package/types/src/charts/features/plotPaint.d.ts +40 -2
  308. package/types/src/charts/features/zoomExtent.d.ts +25 -0
  309. package/types/src/charts/index.d.ts +2 -0
  310. package/types/src/charts/pipeline/drillMorph.d.ts +29 -0
  311. package/types/src/charts/pipeline/runVizPipeline.d.ts +14 -3
  312. package/types/src/charts/viz/Viz.d.ts +18 -1
  313. package/types/src/charts/viz/VizBase.d.ts +99 -4
  314. package/types/src/charts/viz/VizBaseConfig.d.ts +25 -3
  315. package/types/src/charts/viz/vizDefaults.d.ts +155 -0
  316. package/types/src/charts/viz/vizTypes.d.ts +204 -4
  317. package/types/src/charts/viz/vizVisibility.d.ts +34 -0
  318. package/types/src/components/Axis/Axis.d.ts +2 -0
  319. package/types/src/components/Legend/legendRender.d.ts +8 -2
  320. package/types/src/components/SizeLegend/SizeLegend.d.ts +107 -0
  321. package/types/src/components/SizeLegend/sizeLegendLayout.d.ts +101 -0
  322. package/types/src/components/Tooltip.d.ts +18 -3
  323. package/types/src/components/index.d.ts +1 -0
  324. package/types/src/shapes/validateShapeConfig.d.ts +10 -0
  325. package/types/src/utils/BaseClass.d.ts +15 -1
  326. package/types/src/utils/D3plusConfig.d.ts +200 -8
  327. package/types/src/utils/configDefault.d.ts +11 -0
  328. package/types/src/utils/configWarnings.d.ts +28 -0
  329. package/types/src/utils/index.d.ts +2 -1
  330. package/umd/d3plus-core.full.js +44507 -35766
  331. package/umd/d3plus-core.full.js.map +1 -1
  332. package/umd/d3plus-core.full.min.js +7073 -4410
  333. package/umd/d3plus-core.js +16718 -9634
  334. package/umd/d3plus-core.js.map +1 -1
  335. package/umd/d3plus-core.min.js +4615 -2322
@@ -1,4 +1,159 @@
1
1
  import type Viz from "./Viz.js";
2
+ /**
3
+ Default inline style for the "← Back" button — structural-only, the
4
+ same properties `zoomControlStyleDefault`/`searchControlStyleDefault`
5
+ use, except `width: "auto"` (it shows an icon + the word "Back", not a
6
+ single centered glyph) with a small `gap` between them and horizontal
7
+ padding for breathing room. Also lighter/smaller than the other two's
8
+ `font` (900 15px): that value is a holdover from when their icons were
9
+ bold Unicode glyphs sized to read clearly (the icons are SVG now, so it
10
+ no longer affects THEM at all) — but back is the one place that font
11
+ actually renders visible text, where 900 15px reads oversized/heavy.
12
+ No background/border/color, same as the other two: a plain
13
+ browser-appearance button, letting native/host-page button chrome show
14
+ through by default.
15
+ @private
16
+ */
17
+ export declare const backControlStyleDefault: {
18
+ "align-items": string;
19
+ display: string;
20
+ font: string;
21
+ gap: string;
22
+ height: string;
23
+ "justify-content": string;
24
+ padding: string;
25
+ width: string;
26
+ };
27
+ export declare const attributionStyleDefault: {
28
+ background: string;
29
+ color: string;
30
+ "border-radius": string;
31
+ display: string;
32
+ "align-items": string;
33
+ gap: string;
34
+ font: string;
35
+ };
36
+ export declare const attributionStyleDarkDefault: {
37
+ background: string;
38
+ color: string;
39
+ "border-radius": string;
40
+ display: string;
41
+ "align-items": string;
42
+ gap: string;
43
+ font: string;
44
+ };
45
+ /**
46
+ Default inline styles for the zoom-control buttons — structural only
47
+ (sizing/spacing/typography); no color, background, border, or opacity.
48
+ Letting native/host-page button chrome show through by default means a
49
+ page styling its own buttons (Tailwind, Bootstrap, a design system) via
50
+ `zoomControlClassName` composes cleanly instead of fighting inline color
51
+ overrides. The active state (brush mode on) paints the OS accent color
52
+ through CSS system colors (`AccentColor`/`AccentColorText`, falling back
53
+ to the selection `Highlight` where unsupported), so it reads as pressed
54
+ in the browser's own idiom; hover gets no default styling (`false`). The
55
+ `.active` class, `aria-pressed`, and `:hover`/`:active` pseudo-classes
56
+ stay available for a host page's own CSS to hook into. Consumers who want d3plus's old
57
+ opinionated look can restore it via `.zoomControlStyle({...})`.
58
+
59
+ Exported as stable object references (not inlined per-instance) so
60
+ `zoomControls.ts` can tell, via `===`, whether a given viz's
61
+ `zoomControlStyle*` is still the untouched default — that's what lets
62
+ setting `zoomControlClassName` auto-disable the defaults without also
63
+ clobbering a style the caller explicitly customized themselves.
64
+ @private
65
+ */
66
+ export declare const zoomControlStyleDefault: {
67
+ "align-items": string;
68
+ display: string;
69
+ font: string;
70
+ height: string;
71
+ "justify-content": string;
72
+ padding: number;
73
+ width: string;
74
+ };
75
+ export declare const zoomControlStyleActiveDefault: {
76
+ "background-color": string;
77
+ "border-color": string;
78
+ color: string;
79
+ };
80
+ export declare const zoomControlStyleHoverDefault: false;
81
+ /**
82
+ Default inline styles for the table-view toggle button — structural only,
83
+ mirroring `zoomControlStyleDefault` et al. so the two chrome features look
84
+ and behave consistently. Kept as separate object references (not shared
85
+ with zoom's) so `tableViewControl.ts` can independently detect, via `===`,
86
+ whether `tableViewControlStyle*` is still untouched — the same
87
+ auto-disable-on-className trick `zoomControlClassName` uses.
88
+ */
89
+ export declare const tableViewControlStyleDefault: {
90
+ "align-items": string;
91
+ display: string;
92
+ font: string;
93
+ height: string;
94
+ "justify-content": string;
95
+ padding: number;
96
+ width: string;
97
+ };
98
+ export declare const tableViewControlStyleActiveDefault: {
99
+ "background-color": string;
100
+ "border-color": string;
101
+ color: string;
102
+ };
103
+ export declare const tableViewControlStyleHoverDefault: false;
104
+ /**
105
+ Default inline styles for the minimap — mirrors the zoom-control defaults'
106
+ own reasoning (structural/neutral, easy to override or auto-disable via
107
+ `minimapClassName`) and the same by-reference `===` trick that lets
108
+ setting `minimapClassName` auto-disable an untouched default without
109
+ clobbering a caller's own customization.
110
+ @private
111
+ */
112
+ export declare const minimapStyleDefault: {
113
+ background: string;
114
+ border: string;
115
+ "border-radius": string;
116
+ "box-sizing": string;
117
+ };
118
+ export declare const minimapViewportStyleDefault: {
119
+ background: string;
120
+ border: string;
121
+ "border-radius": string;
122
+ cursor: string;
123
+ };
124
+ export declare const minimapViewportStyleActiveDefault: {
125
+ background: string;
126
+ cursor: string;
127
+ };
128
+ export declare const minimapLabelStyleDefault: {
129
+ bottom: string;
130
+ right: string;
131
+ color: string;
132
+ font: string;
133
+ "pointer-events": string;
134
+ };
135
+ /**
136
+ Default inline styles for the search control's toggle button — the same
137
+ structural-only values as `zoomControlStyleDefault` et al. (visual
138
+ parity by default), kept as independent objects/consumers rather than
139
+ shared references so restyling one doesn't affect the other.
140
+ @private
141
+ */
142
+ export declare const searchControlStyleDefault: {
143
+ "align-items": string;
144
+ display: string;
145
+ font: string;
146
+ height: string;
147
+ "justify-content": string;
148
+ padding: number;
149
+ width: string;
150
+ };
151
+ export declare const searchControlStyleActiveDefault: {
152
+ "background-color": string;
153
+ "border-color": string;
154
+ color: string;
155
+ };
156
+ export declare const searchControlStyleHoverDefault: false;
2
157
  /**
3
158
  Seeds a fresh Viz instance's schema defaults and installs the identity-coerce
4
159
  fluent accessors. Extracted from the constructor so the seeding logic stays
@@ -20,10 +20,15 @@
20
20
 
21
21
  @module
22
22
  */
23
+ import type { PlotZoomBase, ZoomState } from "../Plot/plotZoom.js";
24
+ import type { TrendFit, TrendLineType } from "../Plot/trendLines.js";
25
+ import type { ZoomControlIconKey } from "../drawSteps/zoomControlsMarkup.js";
26
+ import type { BottomRightBox } from "../drawSteps/bottomRightControlsMarkup.js";
23
27
  import type { ZoomTransform } from "d3-zoom";
24
28
  import type { DataPoint } from "@d3plus/data";
25
- import type { ClipShape, SceneNode, Transform } from "@d3plus/render";
26
- import type { Axis, ColorScale, Legend, Message, TextBox, Timeline, Tooltip } from "../../components/index.js";
29
+ import type { ClipShape, SceneNode, Transform, TransitionRect } from "@d3plus/render";
30
+ import type { Axis, ColorScale, Legend, Message, SizeLegend, TextBox, Timeline, Tooltip } from "../../components/index.js";
31
+ import type { SizeLegendScale } from "../../components/SizeLegend/sizeLegendLayout.js";
27
32
  import type Shape from "../../shapes/Shape.js";
28
33
  import type { D3plusConfig, D3Scale } from "../../utils/index.js";
29
34
  import type { PlotPaintContext } from "../features/plotPaint.js";
@@ -41,6 +46,15 @@ export interface Padding {
41
46
  left: number;
42
47
  right: number;
43
48
  }
49
+ /** One entry on the drill-down history stack (`Viz._history`), pushed by a click.shape drill-down and popped by Back. */
50
+ export interface DrillDownHistoryEntry {
51
+ depth: number;
52
+ filter?: (d: DataPoint, i: number) => boolean;
53
+ /** `groupBy[groupDepth]`'s value for the clicked node — identifies the reunion node the Back morph grows back into. */
54
+ groupId?: unknown;
55
+ /** The groupBy index `groupId` was read at (== `_drawDepth` when the node was clicked). */
56
+ groupDepth?: number;
57
+ }
44
58
  /**
45
59
  D3-style selection — deliberately loose. d3-selection's element/datum
46
60
  generics are invariant, so a single typed alias can't accept every
@@ -114,6 +128,8 @@ export interface VizInstance {
114
128
  _y2?: (d: DataPoint, i: number) => number | Date | string;
115
129
  _shape: (d: DataPoint, i: number) => string;
116
130
  _size?: (d: DataPoint, i?: number) => number;
131
+ /** The data key `size` was set to, when it was set with a string; the size legend's default title. */
132
+ _sizeKey?: string;
117
133
  _value?: (d: DataPoint, i: number) => number;
118
134
  _time?: (d: DataPoint, i: number) => string | number | Date;
119
135
  _sort?: ((a: DataPoint, b: DataPoint) => number) | null;
@@ -140,6 +156,21 @@ export interface VizInstance {
140
156
  _previousShapes?: string[];
141
157
  _previousAnnotations?: Record<string, string[]>;
142
158
  _zoomTransform?: Transform;
159
+ /** Data-shape nodes the automatic `zoomMax` measures when they aren't `_chartScene`'s top level (Plot). */
160
+ _zoomShapes?: SceneNode[];
161
+ /** The unzoomed Plot draw an axis-rescaling zoom rescales from. */
162
+ _plotZoomBase?: PlotZoomBase;
163
+ /** Pending repaint that drops a Plot's zoom clip once an animated reset settles. */
164
+ _plotUnclipTimer?: ReturnType<typeof setTimeout>;
165
+ /**
166
+ Chart-specific zoom: repaints for a transform and returns true, or
167
+ returns false to fall back to picture zoom (Plot rescales its axes).
168
+ */
169
+ _zoomRescale?: (t: ZoomState, duration?: number) => boolean;
170
+ /** Cleanup functions returned by `zoomControlIcons`' mount functions, keyed by button. */
171
+ _zoomIconCleanup?: Partial<Record<ZoomControlIconKey, () => void>>;
172
+ /** Cleanup function returned by an `attributionIcon` mount function. */
173
+ _attributionIconCleanup?: () => void;
143
174
  _select?: D3Selection;
144
175
  _sceneTarget?: Element;
145
176
  _sceneRenderer?: VizRenderer;
@@ -152,12 +183,39 @@ export interface VizInstance {
152
183
  /** True while the current hover came from a colorScale bucket swatch. */
153
184
  _hoverBucket?: boolean;
154
185
  _highlight?: ((d: DataPoint, i?: number) => boolean) | false;
186
+ /** Whether the search control's input is currently open. */
187
+ _searchOpen?: boolean;
188
+ /** The search control's current (lowercased) search term. */
189
+ _searchTerm?: string;
190
+ /** The `_highlight` predicate saved when the search box opened, restored when it closes. */
191
+ _searchPrevHighlight?: ((d: DataPoint, i?: number) => boolean) | false;
192
+ /** 0-based index of the current match within `searchMatches(...)`, once Enter/Shift+Enter has stepped to one. */
193
+ _searchMatchIndex?: number;
155
194
  _ordinalColorScale?: ((value: string) => string) | undefined;
156
195
  _hoverDatum?: DataPoint | null;
196
+ /** Epoch ms until which an animated transition is in flight (pointer routing pauses). */
197
+ _transitionEndsAt?: number;
157
198
  _userHover?: number;
158
199
  _userDuration?: number;
159
200
  _dataCutoff: number;
160
201
  _brushing?: boolean;
202
+ /** Whether the table-view toggle is currently showing the data table instead of the chart. */
203
+ _tableView?: boolean;
204
+ /** The data table's current page (0-indexed), when `tableViewPageSize` paginates it. */
205
+ _tableViewPage?: number;
206
+ /** The data table's current sort column + direction, when the user has clicked a header. */
207
+ _tableViewSort?: {
208
+ column: string;
209
+ direction: "asc" | "desc";
210
+ };
211
+ /** Which dataset the data table currently shows — `viz._data` (raw) once toggled, `viz._filteredData` (aggregate) by default. */
212
+ _tableViewDataSource?: "raw" | "aggregate";
213
+ /** Cached first-occurrence-index lookups (exact JSON match, and groupBy-key fallback) for restoring `.data()` insertion order to the aggregate view; invalidated by comparing against the raw array reference they were built from. */
214
+ _tableViewGroupOrder?: {
215
+ data: DataPoint[];
216
+ exact: Map<string, number>;
217
+ group: Map<string, number>;
218
+ };
161
219
  /** Timeline brush selection (timeline feature). */
162
220
  _timelineSelection?: (Date | number)[] | false;
163
221
  /** The last drawn timeline value (ms), to detect multi-period trail jumps. */
@@ -165,15 +223,138 @@ export interface VizInstance {
165
223
  /** The user-set data, retained to detect changes across `.data()` calls. */
166
224
  _userData?: DataPoint[] | string;
167
225
  /** Drill-down history stack (back button). */
168
- _history?: DataPoint[];
226
+ _history?: DrillDownHistoryEntry[];
227
+ /**
228
+ The local, chart-family-defined "body rect" flip-morph fractions are
229
+ measured against — e.g. Treemap/Pack's margin-adjusted chart area at
230
+ local origin, or Plot's measured axis plot rect. Set by `runChartDraw`
231
+ (via `ChartDefinition.chartBodyRect`) or by Plot's own paint pipeline.
232
+ */
233
+ _bodyRect?: {
234
+ x: number;
235
+ y: number;
236
+ width: number;
237
+ height: number;
238
+ };
239
+ /**
240
+ One-shot: the clicked node's rect, captured at click time and
241
+ normalized as fractions of the *pre-click* `_bodyRect`, armed by
242
+ `clickShape`. Resolved into `_resolvedEnterFrom` (against the *new*
243
+ draw's `_bodyRect`) and cleared by `resolveDrillMorph`. Also carries:
244
+ `key`, the clicked node's own scene key, resolved into
245
+ `_resolvedInstantExitKey` so its own exit (now filtered out of the new
246
+ scene) is removed instantly instead of animating on top of the
247
+ children that replace it; and, when the clicked node carried them
248
+ (currently only Pie/Donut wedges), `parentStartAngle`/`parentEndAngle`
249
+ — its angular range, read by the next draw's `pieEmit` to build each
250
+ entering child wedge's `flipFromArc` (a real arc confined within that
251
+ range, at full radius) via the actual arc generator.
252
+ */
253
+ _pendingEnterOrigin?: {
254
+ fx: number;
255
+ fy: number;
256
+ fw: number;
257
+ fh: number;
258
+ key?: string | number;
259
+ parentStartAngle?: number;
260
+ parentEndAngle?: number;
261
+ };
262
+ /**
263
+ One-shot: the group id/depth being un-filtered by a Back click, armed by
264
+ the two Back-click sites — plus the OLD (pre-render) `_bodyRect`,
265
+ captured at the same moment, so the exiting siblings' own (frozen)
266
+ geometry can be read as proportions of the frame they were actually
267
+ laid out in. Resolved into `_resolvedExitTo`/`_resolvedExitToBody` (by
268
+ finding the matching node in the *new* `_chartScene`) and cleared by
269
+ `resolveDrillMorph`.
270
+ */
271
+ _pendingExitReunion?: {
272
+ groupId: unknown;
273
+ groupDepth: number;
274
+ body?: {
275
+ x: number;
276
+ y: number;
277
+ width: number;
278
+ height: number;
279
+ };
280
+ };
281
+ /**
282
+ The drill-down morph's resolved enter/exit boxes for the upcoming
283
+ `drawScene` call, plus each one's "body" reference box (the full
284
+ layout entering/exiting nodes' own geometry is proportional within —
285
+ see `DrawOptions.enterFromBody`/`exitToBody`). Set by
286
+ `resolveDrillMorph`, read and one-shot cleared by `_drawSceneToTarget`.
287
+ */
288
+ _resolvedEnterFrom?: TransitionRect;
289
+ _resolvedEnterFromBody?: TransitionRect;
290
+ _resolvedExitTo?: TransitionRect;
291
+ _resolvedExitToBody?: TransitionRect;
292
+ /** See `DrawOptions.instantExitKey` — the clicked node's own key, resolved from `_pendingEnterOrigin.key`. */
293
+ _resolvedInstantExitKey?: string | number;
294
+ /** See `DrawOptions.reunionEnterKey` — the Back click's reunion node's own key, resolved when `resolveDrillMorph` finds a match. */
295
+ _resolvedReunionEnterKey?: string | number;
296
+ /** See `DrawOptions.reunionEnterFrom` — the OLD (pre-Back) body rect, the full size the reunion node's former children occupied. */
297
+ _resolvedReunionEnterFrom?: TransitionRect;
298
+ /** See `DrawOptions.instantExitAll` — set alongside `_resolvedReunionEnterKey`, when a reunion match was found. */
299
+ _resolvedInstantExitAll?: boolean;
300
+ /** Cached measured size of the shared top-left controls panel (back/table-view/search). `measurement` is `topLeftControlsMarkup.ts`-internal (per-item positions); `signature` is the cache key (each contribution's html + resolved style). */
301
+ _topLeftControlsBox?: {
302
+ width: number;
303
+ height: number;
304
+ signature: string;
305
+ measurement: unknown;
306
+ };
169
307
  _xAxis?: Axis;
170
308
  _yAxis?: Axis;
171
309
  _x2Axis?: Axis;
172
310
  _y2Axis?: Axis;
311
+ /** The x/y data keys, when set by string (Plot's default axis titles). */
312
+ _xKey?: string;
313
+ _yKey?: string;
173
314
  _xFunc?: (d: DataPoint, axis?: string) => number;
174
315
  _yFunc?: (d: DataPoint, axis?: string) => number;
316
+ /** The plot area (inside the axes) in chart content space, set by the paint phase. */
317
+ _plotArea?: {
318
+ x: number;
319
+ y: number;
320
+ width: number;
321
+ height: number;
322
+ };
323
+ /** Crosshair guide-line paint for the shared tooltip. */
324
+ _crosshairConfig?: Record<string, unknown>;
325
+ /**
326
+ The active shared-tooltip hover, if any: the snapped discrete position
327
+ (pixel + data value), the hovered Line points to mark, and which side of
328
+ the marks the crosshair draws on.
329
+ */
330
+ _sharedHoverState?: {
331
+ mode: "shared" | "single";
332
+ axis: "x" | "y";
333
+ px: number;
334
+ value: unknown;
335
+ markers: {
336
+ datum: DataPoint;
337
+ x: number;
338
+ y: number;
339
+ }[];
340
+ layer: "back" | "front";
341
+ } | null;
342
+ /** True while the shared multi-series tooltip owns the tooltip. */
343
+ _sharedHoverActive?: boolean;
344
+ /** The tooltip's own `arrow`/`thead`/`tbody`, held while the shared tooltip replaces them. */
345
+ _sharedTooltipSaved?: {
346
+ arrow: unknown;
347
+ thead: unknown;
348
+ tbody: unknown;
349
+ };
175
350
  /** Internal size scale built in Plot's pipeline; maps `_size` → pixel radius. */
176
351
  _sizeScaleD3?: D3Scale;
352
+ /** The radius scale the chart's layout actually drew with; the size legend paints from it. Null when nothing is sized. */
353
+ _sizeLegendFinal?: SizeLegendScale | null;
354
+ /** Size-legend component, rendered in the bottom-right corner panel. */
355
+ _sizeLegendClass?: SizeLegend;
356
+ /** The bottom-right corner panel reserved in `vizDrawPure` for this draw (see `bottomRightControlsMarkup.ts`). */
357
+ _bottomRightBox?: BottomRightBox | null;
177
358
  /** Per-axis "is this axis time-valued" flags, set by `formatPlotData`. */
178
359
  _xTime?: boolean;
179
360
  _x2Time?: boolean;
@@ -195,16 +376,22 @@ export interface VizInstance {
195
376
  _labelConnectorConfig?: Record<string, unknown>;
196
377
  _lineMarkerConfig?: Record<string, unknown>;
197
378
  _confidenceConfig?: Record<string, unknown>;
379
+ /** The `trendLine` setting: a regression type, `true` (linear), or `false`. */
380
+ _trendLine?: TrendLineType;
381
+ _trendLineConfig?: Record<string, unknown>;
382
+ /** The trend lines fit by `computePlotTrendFits` for the current draw. */
383
+ _trendFits?: TrendFit[];
198
384
  _xCutoff?: number;
199
385
  _yCutoff?: number;
200
386
  _discreteCutoff?: number;
387
+ /** Per-datum `[start, end]` along the discrete axis; makes that axis continuous (see Plot/discreteSpan.ts). */
388
+ _discreteExtent?: (d: DataPoint) => [number, number];
201
389
  _buffer?: Record<string, unknown>;
202
390
  _legendClass?: Legend;
203
391
  _colorScaleClass?: ColorScale;
204
392
  _timelineClass?: Timeline;
205
393
  _titleClass?: TextBox;
206
394
  _subtitleClass?: TextBox;
207
- _backClass?: TextBox;
208
395
  _messageClass?: Message;
209
396
  _tooltipClass?: Tooltip;
210
397
  _legendSort?: (a: DataPoint, b: DataPoint) => number;
@@ -232,6 +419,14 @@ export interface VizInstance {
232
419
  _zoomBehavior?: any;
233
420
  _zoomBrush?: any;
234
421
  _zoomSet?: boolean;
422
+ /** Whether a Geomap's themed basemap resolved dark on the latest draw. */
423
+ _basemapDark?: boolean;
424
+ /** Whether a Geomap is watching its backdrop for theme changes. */
425
+ _themeWatch?: boolean;
426
+ /** The attribution d3plus last set from the tile URL (vs. a user-set one). */
427
+ _tileAttribution?: string | false;
428
+ /** Whether a compact (ⓘ) attribution was clicked open. */
429
+ _attributionPinned?: boolean;
235
430
  _zoomToBounds?: (bounds: number[][] | null, duration?: number) => void;
236
431
  _renderTiles?: (transform?: ZoomTransform, duration?: number) => void;
237
432
  /**
@@ -259,6 +454,11 @@ export interface VizInstance {
259
454
  _scheduleSceneRepaint(): void;
260
455
  _sceneRepaintRAF?: number;
261
456
  _thresholdFunction?(data: DataPoint[], tree?: unknown): DataPoint[];
457
+ /** The chart's size-legend radius scale, estimated before layout for the given chart area (see `ChartDefinition.sizeLegendScale`). */
458
+ _sizeLegendScale?(available: {
459
+ width: number;
460
+ height: number;
461
+ }): SizeLegendScale | null;
262
462
  toScene?(): SceneNode;
263
463
  config?(_?: D3plusConfig): D3plusConfig | this;
264
464
  active?(_?: unknown): unknown;
@@ -0,0 +1,34 @@
1
+ import type Viz from "./Viz.js";
2
+ /**
3
+ Whether viewport observation is available (false in JSDOM/SSR, where the
4
+ scroll-polling fallback in `vizRender` is used instead).
5
+ @private
6
+ */
7
+ export declare function canObserveVisibility(): boolean;
8
+ /**
9
+ Observes `el` against `scrollContainer` through one IntersectionObserver
10
+ shared by every viz using that root. `onVisible` runs once `el` has stayed in
11
+ view for `delay` ms, so elements scrolled past quickly never fire; leaving
12
+ view cancels the pending call and runs `onHidden`, if given. Returns a function
13
+ that stops observing.
14
+ @private
15
+ */
16
+ export declare function observeVisibility(el: Element, scrollContainer: unknown, onVisible: () => void, delay?: number, onHidden?: () => void): () => void;
17
+ /**
18
+ Releases a chart's DOM/scene while it is off-screen. The `<svg>` and its
19
+ size stay in place so the page doesn't reflow; data and config are kept, so
20
+ `vizReload` can redraw it without refetching.
21
+ @private
22
+ */
23
+ export declare function vizUnload(viz: Viz): void;
24
+ /**
25
+ Redraws an unloaded chart without an entrance animation.
26
+ @private
27
+ */
28
+ export declare function vizReload(viz: Viz): void;
29
+ /**
30
+ Installs (or removes) the persistent observer that unloads the chart when it
31
+ leaves the viewport and reloads it on return. Idempotent.
32
+ @private
33
+ */
34
+ export declare function syncUnloadObserver(viz: Viz): void;
@@ -16,6 +16,8 @@ export default class Axis extends BaseClass {
16
16
  _labelRotation: boolean | undefined;
17
17
  _margin: Record<string, number>;
18
18
  _outerBounds: Record<string, number>;
19
+ /** The measured size of the tick-label/title space, before margins (see `fixedSize`). */
20
+ _labelSpace?: number;
19
21
  _position: {
20
22
  horizontal: boolean;
21
23
  width: string;
@@ -5,9 +5,15 @@ export declare function measureLegendTitle(legend: Legend): void;
5
5
  export declare function computeLegendLineData(legend: Legend, availableHeight: number): Record<string, unknown>[];
6
6
  /**
7
7
  Runs the row-wrapping pass: builds rows, retries label-free if it overflows,
8
- then distributes row `y` offsets. Returns the resolved `spaceNeeded`.
8
+ then distributes row `y` offsets. Returns the widest row's width, or
9
+ `false` when even label-free swatches overflow the available space.
9
10
  */
10
- export declare function wrapLegendRows(legend: Legend, availableWidth: number, availableHeight: number, spaceNeeded: number): number;
11
+ export declare function wrapLegendRows(legend: Legend, availableWidth: number, availableHeight: number): number | false;
12
+ /**
13
+ Empties a legend whose swatches don't fit: no title, no shapes, and zero
14
+ outer bounds, so a parent chart claims no margin for it.
15
+ */
16
+ export declare function clearLegend(legend: Legend): void;
11
17
  /** Computes `_outerBounds` (size + aligned x/y offset) from the laid-out rows. */
12
18
  export declare function computeLegendBounds(legend: Legend, spaceNeeded: number): void;
13
19
  /** Renders the title TextBox into the legend's title group. */
@@ -0,0 +1,107 @@
1
+ import type { D3Selection } from "@d3plus/dom";
2
+ import type { GroupNode, SvgRenderer } from "@d3plus/render";
3
+ import { BaseClass } from "../../utils/index.js";
4
+ import type { SizeLegendLayout } from "./sizeLegendLayout.js";
5
+ /** Circle paint for the legend's nested circles. */
6
+ export interface SizeLegendShapeConfig {
7
+ [key: string]: unknown;
8
+ fill?: string;
9
+ fillOpacity?: number;
10
+ stroke?: string;
11
+ strokeOpacity?: number;
12
+ strokeWidth?: number;
13
+ }
14
+ /** Paint for the leader lines running from each circle to its label. */
15
+ export interface SizeLegendLineConfig {
16
+ stroke?: string;
17
+ strokeDasharray?: number[];
18
+ strokeOpacity?: number;
19
+ strokeWidth?: number;
20
+ }
21
+ /** Font settings for the value labels and the title. */
22
+ export interface SizeLegendTextConfig {
23
+ fontColor?: string;
24
+ fontFamily?: string | string[];
25
+ fontSize?: number;
26
+ fontWeight?: number | string;
27
+ }
28
+ /**
29
+ A nested-circle legend for a size scale: concentric circles sharing a
30
+ bottom tangent, each labeled with the value its radius encodes.
31
+
32
+ Charts that size marks by a `size` accessor (bubble plots, Geomap points,
33
+ Network, Rings) draw one automatically in their bottom-right corner (see
34
+ `sizeLegend` and `sizeLegendConfig` on the chart). On its own, give it
35
+ any d3 continuous scale that maps values to pixel radii.
36
+ @example
37
+ new SizeLegend()
38
+ .scale(d3.scaleSqrt().domain([0, 1000]).range([2, 30]))
39
+ .title("Population")
40
+ .select("#container")
41
+ .render();
42
+ */
43
+ export default class SizeLegend extends BaseClass {
44
+ [key: string]: any;
45
+ _layout: SizeLegendLayout;
46
+ /** Drops values whose circles would outgrow this radius; set by a zoomed chart. */
47
+ _maxRadius?: number;
48
+ _select?: D3Selection;
49
+ _sceneRenderer?: SvgRenderer;
50
+ /**
51
+ Invoked when creating a new class instance, and sets any default parameters.
52
+ @private
53
+ */
54
+ constructor();
55
+ /**
56
+ Font settings for the value labels: `fontColor`, `fontFamily`, `fontSize`. Merged into the current settings.
57
+ */
58
+ labelConfig(): SizeLegendTextConfig;
59
+ labelConfig(_: SizeLegendTextConfig): this;
60
+ /**
61
+ Paint for the leader lines: `stroke`, `strokeWidth`, `strokeOpacity`, `strokeDasharray`. Merged into the current settings.
62
+ */
63
+ lineConfig(): SizeLegendLineConfig;
64
+ lineConfig(_: SizeLegendLineConfig): this;
65
+ /**
66
+ Paint for the circles: `fill`, `fillOpacity`, `stroke`, `strokeWidth`, `strokeOpacity`. Merged into the current settings.
67
+ */
68
+ shapeConfig(): SizeLegendShapeConfig;
69
+ shapeConfig(_: SizeLegendShapeConfig): this;
70
+ /**
71
+ Font settings for the title: `fontColor`, `fontFamily`, `fontSize`, `fontWeight`. Merged into the current settings.
72
+ */
73
+ titleConfig(): SizeLegendTextConfig;
74
+ titleConfig(_: SizeLegendTextConfig): this;
75
+ /**
76
+ The container element for a standalone render, as a d3 selector or DOM element.
77
+ */
78
+ select(): D3Selection | undefined;
79
+ select(_: string | HTMLElement | SVGElement): this;
80
+ /**
81
+ Lays the legend out from the current config and returns the result
82
+ (circles, leader lines, labels, overall width/height). Pure: reads no
83
+ DOM, so a chart can measure the legend before it draws.
84
+ */
85
+ layout(): SizeLegendLayout;
86
+ /**
87
+ The width and height of the last layout, in pixels.
88
+ */
89
+ outerBounds(): {
90
+ width: number;
91
+ height: number;
92
+ };
93
+ /**
94
+ Produces a backend-agnostic scene graph of the last layout, offset by the
95
+ optional transform.
96
+ @param x Horizontal offset of the legend's top-left corner.
97
+ @param y Vertical offset of the legend's top-left corner.
98
+ */
99
+ toScene(x?: number, y?: number): GroupNode;
100
+ /**
101
+ Renders the legend. Standalone, it paints into the `select` container
102
+ (sized to the legend); inside a chart (`renderMode("compute")`) it only
103
+ lays out, and the chart composes `toScene()`.
104
+ @param callback Optional callback invoked after rendering completes.
105
+ */
106
+ render(callback?: () => void): this;
107
+ }