@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
@@ -40,19 +40,28 @@ function _unsupported_iterable_to_array(o, minLen) {
40
40
  1. `viz._preDraw()` — data filtering + legend-data + drawDepth
41
41
  2. `viz._draw()` — chart-specific layout + scene absorption
42
42
  3. `zoomControls(viz)` — zoom HTML overlay (architectural carve-out)
43
- 4. `attributionFeature.layout(viz)` — bottom-right attribution panel
44
- 5. `viz._drawSceneToTarget()` — paint scene via SvgRenderer/CanvasRenderer
43
+ 4. `minimapFeature.layout(viz)` — zoomed-chart viewport indicator
44
+ 5. `topLeftControlsFeature.layout(viz)` — back/table-view/search panel
45
+ 5b. `bottomRightControlsFeature.layout(viz)` — size-legend corner panel
46
+ 6. `attributionFeature.layout(viz)` — bottom-right attribution panel
47
+ 7. `tableViewFeature.layout(viz)` — chart-sized data-table overlay
48
+ 8. `viz._drawSceneToTarget()` — paint scene via SvgRenderer/CanvasRenderer
45
49
 
46
50
  Future work:
47
51
  - Extract a `ResolvedSpec` so step 1 takes (config) not (this).
48
52
  - Decouple step 2 so it takes (ctx) not (this); stages already follow
49
53
  this pattern but `_draw` itself doesn't.
50
- - Replace step 5's `this._sceneRenderer` slot with a returned handle
54
+ - Replace step 8's `this._sceneRenderer` slot with a returned handle
51
55
  so callers can pick/destroy/diff without instance lookup.
52
56
 
53
57
  @param viz A Viz instance (or any subclass: Plot, Treemap, Pack, …).
54
58
  */ import { attributionFeature, runLayout } from "../features/features.js";
59
+ import { minimapFeature } from "../drawSteps/minimap.js";
55
60
  import { zoomFeature } from "../drawSteps/zoomControls.js";
61
+ import { resolveDrillMorph } from "./drillMorph.js";
62
+ import { topLeftControlsFeature } from "../drawSteps/topLeftControls.js";
63
+ import { bottomRightControlsFeature } from "../drawSteps/bottomRightControls.js";
64
+ import { tableViewFeature } from "../drawSteps/tableView.js";
56
65
  export function runVizPipeline(viz) {
57
66
  // Goes through `viz._preDraw()` / `viz._draw()` (not the free functions
58
67
  // directly) so subclass overrides (Plot._preDraw, Treemap._draw, Plot._draw,
@@ -61,24 +70,49 @@ export function runVizPipeline(viz) {
61
70
  // calls hit the shim which delegates to the free functions.
62
71
  viz._preDraw();
63
72
  viz._draw();
64
- // Post-draw features: zoom + brush event wiring and the attribution
65
- // overlay. Both run after `_draw()` (they need the rendered chart body +
66
- // `_container`/`_zoomGroup`), claim zero margin, and wire DOM the
67
- // serializable scene graph can't carry. `zoomFeature` runs before
68
- // `attributionFeature` to preserve the prior step order.
69
- // `zoomFeature` returns its control-button overlay as a panel rather
70
- // than mutating `viz._featurePanels` from inside `layout()` (the
71
- // FeatureModule contract). The engine appends the returned panels to
72
- // the instance buffer that `toScene()` reads — including on later zoom
73
- // repaints, which re-walk `toScene()` outside this pipeline pass.
73
+ // Post-draw features: zoom + brush event wiring, the minimap, the shared
74
+ // top-left controls panel (back / table-view button / search), the
75
+ // attribution overlay, and the table-view data-table overlay. All run
76
+ // after `_draw()` (zoom needs the rendered chart body + `_container`/
77
+ // `_zoomGroup`), claim zero margin, and wire DOM the serializable scene
78
+ // graph can't carry. `minimapFeature` runs right after `zoomFeature` — it
79
+ // needs `_zoomBehavior`'s `translateExtent()`/`scaleExtent()` already
80
+ // configured for this draw — and before `attributionFeature` to preserve
81
+ // the prior step order; `topLeftControlsFeature` has no ordering
82
+ // dependency on either. `tableViewFeature` runs LAST so its panel — a
83
+ // chart-sized overlay, present only while table view is active — stacks
84
+ // above every other panel in the overlay host (siblings paint in scene
85
+ // order), covering zoom/minimap/top-left-controls/attribution while
86
+ // showing.
87
+ // Each of these returns its overlay as a panel rather than mutating
88
+ // `viz._featurePanels` from inside `layout()` (the FeatureModule
89
+ // contract). The engine appends the returned panels to the instance
90
+ // buffer that `toScene()` reads — including on later repaints (a zoom
91
+ // event, a table-view toggle), which re-walk `toScene()` outside this
92
+ // pipeline pass.
93
+ runPostDrawFeatures(viz);
94
+ // Resolve the drill-down morph's enter/exit boxes (if a drill click armed
95
+ // one) now that this draw's _bodyRect/_chartScene are final.
96
+ resolveDrillMorph(viz);
97
+ viz._drawSceneToTarget();
98
+ }
99
+ /**
100
+ Runs the post-draw features (see above) and appends their panels. Anything
101
+ that re-runs `viz._draw()` outside this pipeline — Rings re-centering on a
102
+ click, say — must call this after it: `_draw()` resets the feature panels,
103
+ so skipping it drops the corner controls, size legend, and attribution.
104
+ */ export function runPostDrawFeatures(viz) {
74
105
  var post = runLayout({
75
106
  viz: viz
76
107
  }, [
77
108
  zoomFeature,
78
- attributionFeature
109
+ minimapFeature,
110
+ topLeftControlsFeature,
111
+ bottomRightControlsFeature,
112
+ attributionFeature,
113
+ tableViewFeature
79
114
  ]);
80
115
  if (post.panels.length) viz._featurePanels = _to_consumable_array(viz._featurePanels || []).concat(_to_consumable_array(post.panels));
81
- viz._drawSceneToTarget();
82
116
  }
83
117
 
84
118
  //# sourceMappingURL=runVizPipeline.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/charts/pipeline/runVizPipeline.ts"],"sourcesContent":["/**\n `runVizPipeline(viz)` — the chart pipeline as a free function.\n\n Draws the boundary between \"lifecycle/DOM/data-loading\" (which lives on\n `Viz.render()`, inherently instance-bound) and\n \"transform-the-data-into-a-scene\" (callable without the lifecycle). The\n transform side isn't fully pure yet — `_preDraw`/`_draw` still mutate\n `this` rather than threading an explicit context\n (`UserConfig → ResolvedSpec → transform stages → SceneGraph → renderer`).\n\n Calling this function on a Viz instance runs the same four steps\n `Viz.render()` previously inlined inside its `Promise.all().then()`\n callback:\n\n 1. `viz._preDraw()` — data filtering + legend-data + drawDepth\n 2. `viz._draw()` — chart-specific layout + scene absorption\n 3. `zoomControls(viz)` — zoom HTML overlay (architectural carve-out)\n 4. `attributionFeature.layout(viz)` — bottom-right attribution panel\n 5. `viz._drawSceneToTarget()` — paint scene via SvgRenderer/CanvasRenderer\n\n Future work:\n - Extract a `ResolvedSpec` so step 1 takes (config) not (this).\n - Decouple step 2 so it takes (ctx) not (this); stages already follow\n this pattern but `_draw` itself doesn't.\n - Replace step 5's `this._sceneRenderer` slot with a returned handle\n so callers can pick/destroy/diff without instance lookup.\n\n @param viz A Viz instance (or any subclass: Plot, Treemap, Pack, …).\n*/\n\nimport {attributionFeature, runLayout} from \"../features/features.js\";\nimport {zoomFeature} from \"../drawSteps/zoomControls.js\";\nimport type {VizInstance as Viz} from \"../viz/vizTypes.js\";\n\nexport function runVizPipeline(viz: Viz): void {\n // Goes through `viz._preDraw()` / `viz._draw()` (not the free functions\n // directly) so subclass overrides (Plot._preDraw, Treemap._draw, Plot._draw,\n // Pack/Pie/Matrix/…) still run. The free functions `vizPreDraw` / `vizDraw`\n // hold the BASE Viz behavior; subclasses' `super._preDraw()`/`super._draw()`\n // calls hit the shim which delegates to the free functions.\n viz._preDraw();\n viz._draw();\n // Post-draw features: zoom + brush event wiring and the attribution\n // overlay. Both run after `_draw()` (they need the rendered chart body +\n // `_container`/`_zoomGroup`), claim zero margin, and wire DOM the\n // serializable scene graph can't carry. `zoomFeature` runs before\n // `attributionFeature` to preserve the prior step order.\n // `zoomFeature` returns its control-button overlay as a panel rather\n // than mutating `viz._featurePanels` from inside `layout()` (the\n // FeatureModule contract). The engine appends the returned panels to\n // the instance buffer that `toScene()` reads — including on later zoom\n // repaints, which re-walk `toScene()` outside this pipeline pass.\n const post = runLayout({viz}, [zoomFeature, attributionFeature]);\n if (post.panels.length)\n viz._featurePanels = [...(viz._featurePanels || []), ...post.panels];\n viz._drawSceneToTarget();\n}\n"],"names":["attributionFeature","runLayout","zoomFeature","runVizPipeline","viz","_preDraw","_draw","post","panels","length","_featurePanels","_drawSceneToTarget"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,GAEA,SAAQA,kBAAkB,EAAEC,SAAS,QAAO,0BAA0B;AACtE,SAAQC,WAAW,QAAO,+BAA+B;AAGzD,OAAO,SAASC,eAAeC,GAAQ;IACrC,wEAAwE;IACxE,6EAA6E;IAC7E,4EAA4E;IAC5E,6EAA6E;IAC7E,4DAA4D;IAC5DA,IAAIC,QAAQ;IACZD,IAAIE,KAAK;IACT,oEAAoE;IACpE,yEAAyE;IACzE,kEAAkE;IAClE,kEAAkE;IAClE,yDAAyD;IACzD,qEAAqE;IACrE,iEAAiE;IACjE,qEAAqE;IACrE,uEAAuE;IACvE,kEAAkE;IAClE,IAAMC,OAAON,UAAU;QAACG,KAAAA;IAAG,GAAG;QAACF;QAAaF;KAAmB;IAC/D,IAAIO,KAAKC,MAAM,CAACC,MAAM,EACpBL,IAAIM,cAAc,GAAG,AAAC,qBAAIN,IAAIM,cAAc,IAAI,EAAE,SAAG,qBAAGH,KAAKC,MAAM;IACrEJ,IAAIO,kBAAkB;AACxB"}
1
+ {"version":3,"sources":["../../../../src/charts/pipeline/runVizPipeline.ts"],"sourcesContent":["/**\n `runVizPipeline(viz)` — the chart pipeline as a free function.\n\n Draws the boundary between \"lifecycle/DOM/data-loading\" (which lives on\n `Viz.render()`, inherently instance-bound) and\n \"transform-the-data-into-a-scene\" (callable without the lifecycle). The\n transform side isn't fully pure yet — `_preDraw`/`_draw` still mutate\n `this` rather than threading an explicit context\n (`UserConfig → ResolvedSpec → transform stages → SceneGraph → renderer`).\n\n Calling this function on a Viz instance runs the same four steps\n `Viz.render()` previously inlined inside its `Promise.all().then()`\n callback:\n\n 1. `viz._preDraw()` — data filtering + legend-data + drawDepth\n 2. `viz._draw()` — chart-specific layout + scene absorption\n 3. `zoomControls(viz)` — zoom HTML overlay (architectural carve-out)\n 4. `minimapFeature.layout(viz)` — zoomed-chart viewport indicator\n 5. `topLeftControlsFeature.layout(viz)` — back/table-view/search panel\n 5b. `bottomRightControlsFeature.layout(viz)` — size-legend corner panel\n 6. `attributionFeature.layout(viz)` — bottom-right attribution panel\n 7. `tableViewFeature.layout(viz)` — chart-sized data-table overlay\n 8. `viz._drawSceneToTarget()` — paint scene via SvgRenderer/CanvasRenderer\n\n Future work:\n - Extract a `ResolvedSpec` so step 1 takes (config) not (this).\n - Decouple step 2 so it takes (ctx) not (this); stages already follow\n this pattern but `_draw` itself doesn't.\n - Replace step 8's `this._sceneRenderer` slot with a returned handle\n so callers can pick/destroy/diff without instance lookup.\n\n @param viz A Viz instance (or any subclass: Plot, Treemap, Pack, …).\n*/\n\nimport {attributionFeature, runLayout} from \"../features/features.js\";\nimport {minimapFeature} from \"../drawSteps/minimap.js\";\nimport {zoomFeature} from \"../drawSteps/zoomControls.js\";\nimport {resolveDrillMorph} from \"./drillMorph.js\";\nimport {topLeftControlsFeature} from \"../drawSteps/topLeftControls.js\";\nimport {bottomRightControlsFeature} from \"../drawSteps/bottomRightControls.js\";\nimport {tableViewFeature} from \"../drawSteps/tableView.js\";\nimport type {VizInstance as Viz} from \"../viz/vizTypes.js\";\n\nexport function runVizPipeline(viz: Viz): void {\n // Goes through `viz._preDraw()` / `viz._draw()` (not the free functions\n // directly) so subclass overrides (Plot._preDraw, Treemap._draw, Plot._draw,\n // Pack/Pie/Matrix/…) still run. The free functions `vizPreDraw` / `vizDraw`\n // hold the BASE Viz behavior; subclasses' `super._preDraw()`/`super._draw()`\n // calls hit the shim which delegates to the free functions.\n viz._preDraw();\n viz._draw();\n // Post-draw features: zoom + brush event wiring, the minimap, the shared\n // top-left controls panel (back / table-view button / search), the\n // attribution overlay, and the table-view data-table overlay. All run\n // after `_draw()` (zoom needs the rendered chart body + `_container`/\n // `_zoomGroup`), claim zero margin, and wire DOM the serializable scene\n // graph can't carry. `minimapFeature` runs right after `zoomFeature` — it\n // needs `_zoomBehavior`'s `translateExtent()`/`scaleExtent()` already\n // configured for this draw — and before `attributionFeature` to preserve\n // the prior step order; `topLeftControlsFeature` has no ordering\n // dependency on either. `tableViewFeature` runs LAST so its panel — a\n // chart-sized overlay, present only while table view is active — stacks\n // above every other panel in the overlay host (siblings paint in scene\n // order), covering zoom/minimap/top-left-controls/attribution while\n // showing.\n // Each of these returns its overlay as a panel rather than mutating\n // `viz._featurePanels` from inside `layout()` (the FeatureModule\n // contract). The engine appends the returned panels to the instance\n // buffer that `toScene()` reads — including on later repaints (a zoom\n // event, a table-view toggle), which re-walk `toScene()` outside this\n // pipeline pass.\n runPostDrawFeatures(viz);\n // Resolve the drill-down morph's enter/exit boxes (if a drill click armed\n // one) now that this draw's _bodyRect/_chartScene are final.\n resolveDrillMorph(viz);\n viz._drawSceneToTarget();\n}\n\n/**\n Runs the post-draw features (see above) and appends their panels. Anything\n that re-runs `viz._draw()` outside this pipeline — Rings re-centering on a\n click, say — must call this after it: `_draw()` resets the feature panels,\n so skipping it drops the corner controls, size legend, and attribution.\n*/\nexport function runPostDrawFeatures(viz: Viz): void {\n const post = runLayout({viz}, [\n zoomFeature,\n minimapFeature,\n topLeftControlsFeature,\n bottomRightControlsFeature,\n attributionFeature,\n tableViewFeature,\n ]);\n if (post.panels.length)\n viz._featurePanels = [...(viz._featurePanels || []), ...post.panels];\n}\n"],"names":["attributionFeature","runLayout","minimapFeature","zoomFeature","resolveDrillMorph","topLeftControlsFeature","bottomRightControlsFeature","tableViewFeature","runVizPipeline","viz","_preDraw","_draw","runPostDrawFeatures","_drawSceneToTarget","post","panels","length","_featurePanels"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,GAEA,SAAQA,kBAAkB,EAAEC,SAAS,QAAO,0BAA0B;AACtE,SAAQC,cAAc,QAAO,0BAA0B;AACvD,SAAQC,WAAW,QAAO,+BAA+B;AACzD,SAAQC,iBAAiB,QAAO,kBAAkB;AAClD,SAAQC,sBAAsB,QAAO,kCAAkC;AACvE,SAAQC,0BAA0B,QAAO,sCAAsC;AAC/E,SAAQC,gBAAgB,QAAO,4BAA4B;AAG3D,OAAO,SAASC,eAAeC,GAAQ;IACrC,wEAAwE;IACxE,6EAA6E;IAC7E,4EAA4E;IAC5E,6EAA6E;IAC7E,4DAA4D;IAC5DA,IAAIC,QAAQ;IACZD,IAAIE,KAAK;IACT,yEAAyE;IACzE,mEAAmE;IACnE,sEAAsE;IACtE,sEAAsE;IACtE,wEAAwE;IACxE,0EAA0E;IAC1E,sEAAsE;IACtE,yEAAyE;IACzE,iEAAiE;IACjE,sEAAsE;IACtE,wEAAwE;IACxE,uEAAuE;IACvE,oEAAoE;IACpE,WAAW;IACX,oEAAoE;IACpE,iEAAiE;IACjE,oEAAoE;IACpE,sEAAsE;IACtE,sEAAsE;IACtE,iBAAiB;IACjBC,oBAAoBH;IACpB,0EAA0E;IAC1E,6DAA6D;IAC7DL,kBAAkBK;IAClBA,IAAII,kBAAkB;AACxB;AAEA;;;;;AAKA,GACA,OAAO,SAASD,oBAAoBH,GAAQ;IAC1C,IAAMK,OAAOb,UAAU;QAACQ,KAAAA;IAAG,GAAG;QAC5BN;QACAD;QACAG;QACAC;QACAN;QACAO;KACD;IACD,IAAIO,KAAKC,MAAM,CAACC,MAAM,EACpBP,IAAIQ,cAAc,GAAG,AAAC,qBAAIR,IAAIQ,cAAc,IAAI,EAAE,SAAG,qBAAGH,KAAKC,MAAM;AACvE"}
@@ -50,7 +50,12 @@ function _unsupported_iterable_to_array(o, minLen) {
50
50
  - `featurePanels` — final aggregated panel list
51
51
  - `resetChartScene`/`resetChartTransform`/`resetShapes` (always true)
52
52
  - `legendPosition`/`colorScalePosition` — sanitized values
53
- */ import { backFeature, colorScaleFeature, legendFeature, runLayout, sanitizePosition, subtitleFeature, timelineFeature, titleFeature, totalFeature } from "../features/features.js";
53
+ */ import { colorScaleFeature, legendFeature, runLayout, sanitizePosition, subtitleFeature, timelineFeature, titleFeature, totalFeature } from "../features/features.js";
54
+ import { zoomControlsBox } from "../drawSteps/zoomControlsMarkup.js";
55
+ import { getTopLeftContributions } from "../drawSteps/topLeftControls.js";
56
+ import { topLeftControlsBox } from "../drawSteps/topLeftControlsMarkup.js";
57
+ import { reserveBottomRight } from "../drawSteps/bottomRightControls.js";
58
+ import { bottomRightControlsRightShortfall, bottomRightControlsShortfall } from "../drawSteps/bottomRightControlsMarkup.js";
54
59
  import { resolveSpec } from "./resolveSpec.js";
55
60
  export function vizDrawPure(viz) {
56
61
  var _prevCtx = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
@@ -96,14 +101,16 @@ export function vizDrawPure(viz) {
96
101
  bottom: viz._margin.bottom,
97
102
  left: viz._margin.left
98
103
  };
99
- // Top blocks first (back / title / subtitle / total) so the running
100
- // margin.top grows BEFORE the left/right legend lays out — the legend
101
- // positions against it. Title must lay out first or the left legend
102
- // overlaps the title at y=0.
104
+ // Top blocks first (title / subtitle / total) so the running margin.top
105
+ // grows BEFORE the left/right legend lays out — the legend positions
106
+ // against it. Title must lay out first or the left legend overlaps the
107
+ // title at y=0. "← Back" no longer claims margin here — it's a
108
+ // zero-margin contribution to the shared top-left controls panel
109
+ // (`topLeftControlsFeature`, registered post-draw in `runVizPipeline`),
110
+ // the same way zoom's buttons float rather than claim margin.
103
111
  var topBlocks = runLayout({
104
112
  viz: viz
105
113
  }, [
106
- backFeature,
107
114
  titleFeature,
108
115
  subtitleFeature,
109
116
  totalFeature
@@ -118,6 +125,13 @@ export function vizDrawPure(viz) {
118
125
  ], running);
119
126
  out.marginDelta.bottom += timelineClaim.margin.bottom;
120
127
  running.bottom += timelineClaim.margin.bottom;
128
+ // The bottom-right corner panel (the size legend) measures next, above the
129
+ // timeline and against the area left so far, so the legend/colorScale
130
+ // blocks below can inset around it (see `bottomRightControlsInset`).
131
+ reserveBottomRight(viz, running.bottom, {
132
+ width: viz.schema.width - running.left - running.right,
133
+ height: viz.schema.height - running.top - running.bottom
134
+ });
121
135
  // Left/right legend + colorScale claims. Includes `=== false` (mirrors
122
136
  // colorScale below) so a previously-rendered left/right legend tears
123
137
  // down its DOM when the user toggles off via `.legendPosition(false)`.
@@ -143,6 +157,12 @@ export function vizDrawPure(viz) {
143
157
  running.left += claim1.margin.left;
144
158
  running.right += claim1.margin.right;
145
159
  }
160
+ // A right-side bottom-right panel (the size legend's default) shares the
161
+ // right column: widen the right margin to it, if the left/right claims
162
+ // above didn't already, before the bottom blocks lay out against it.
163
+ var rightShortfall = bottomRightControlsRightShortfall(viz, running.right);
164
+ out.marginDelta.right += rightShortfall;
165
+ running.right += rightShortfall;
146
166
  // Top/bottom legend + colorScale.
147
167
  if (legendPosition === "top" || legendPosition === "bottom") {
148
168
  var claim2 = runLayout({
@@ -166,6 +186,32 @@ export function vizDrawPure(viz) {
166
186
  running.top += claim3.margin.top;
167
187
  running.bottom += claim3.margin.bottom;
168
188
  }
189
+ // A bottom-side panel: the chart body must end above it, so if the bottom
190
+ // claims so far are shorter than it, top the bottom margin up.
191
+ var shortfall = bottomRightControlsShortfall(viz, running.bottom);
192
+ out.marginDelta.bottom += shortfall;
193
+ running.bottom += shortfall;
194
+ // The corner controls (zoom, back/search) deliberately claim zero
195
+ // margin of their own — they float at y:0, and normally whatever's
196
+ // ABOVE the chart body (title/subtitle/total, a top legend/colorScale)
197
+ // already pushed it down clear of them. But when NONE of those claimed
198
+ // any margin.top, the chart body starts at y:0 too, and the buttons
199
+ // paint directly over its top edge — a Treemap's very top row, most
200
+ // visibly, since there's no dead space up there to absorb it. Reserve
201
+ // just enough room for the taller of the two corner rows in that one
202
+ // case; a chart with a title/legend already has (at minimum) that same
203
+ // room from its own claim, so this never adds on top of one.
204
+ if (!out.marginDelta.top) {
205
+ var _ref, _ref1;
206
+ var _zoomControlsBox, _topLeftControlsBox;
207
+ var zoomHeight = (_ref = (_zoomControlsBox = zoomControlsBox(viz)) === null || _zoomControlsBox === void 0 ? void 0 : _zoomControlsBox.height) !== null && _ref !== void 0 ? _ref : 0;
208
+ var topLeftHeight = (_ref1 = (_topLeftControlsBox = topLeftControlsBox(viz, getTopLeftContributions(viz))) === null || _topLeftControlsBox === void 0 ? void 0 : _topLeftControlsBox.height) !== null && _ref1 !== void 0 ? _ref1 : 0;
209
+ var cornerHeight = Math.max(zoomHeight, topLeftHeight);
210
+ if (cornerHeight) {
211
+ out.marginDelta.top += cornerHeight;
212
+ running.top += cornerHeight;
213
+ }
214
+ }
169
215
  // Snapshot final featurePanels onto the returned ctx.
170
216
  out.featurePanels = viz._featurePanels.slice();
171
217
  return out;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/charts/pipeline/vizDrawPure.ts"],"sourcesContent":["/**\n `vizDrawPure(viz, prevCtx)` — the returning form of `vizDraw`.\n\n NAMING CAVEAT: the suffix `Pure` here means **\"returns a Partial<\n VizContext> describing the layout intent\"**, not \"free of side effects\n in the FP sense.\" The OUTER orchestration (margin computation,\n legendPosition resolution, panel aggregation, reset signals) is pure\n in the returned-ctx sense — its observable output is the ctx. The\n inner `runLayout([features])` calls write through to viz directly:\n - reset writes (`viz._featurePanels = []`, `viz._chartScene = []`,\n `viz._chartTransform = undefined`, `viz._shapes = []`)\n - margin claims (`viz._margin.X += claim.margin.X`) so the next\n runLayout sees the updated margins\n - FeatureModule layouts that mount/measure their components\n These writes are part of the contract: subclasses and feature\n modules consume live viz state during the layout body, and the shim\n pattern (`vizDraw` calling `vizDrawPure`) is what bridges the\n free-function surface to the class instances that still hold the\n components.\n\n The shim (`vizDraw`) wraps this and serves as the public surface.\n\n Returns a context with:\n - `marginDelta` (top/bottom/left/right) — total added to viz._margin\n - `featurePanels` — final aggregated panel list\n - `resetChartScene`/`resetChartTransform`/`resetShapes` (always true)\n - `legendPosition`/`colorScalePosition` — sanitized values\n*/\n\nimport {\n backFeature,\n colorScaleFeature,\n legendFeature,\n runLayout,\n sanitizePosition,\n subtitleFeature,\n timelineFeature,\n titleFeature,\n totalFeature,\n} from \"../features/features.js\";\n\nimport {resolveSpec} from \"./resolveSpec.js\";\n\nimport type {SceneNode} from \"@d3plus/render\";\n\nimport type {VizContext} from \"./vizContext.js\";\nimport type {VizInstance as Viz} from \"../viz/vizTypes.js\";\n\nexport interface VizDrawCtx extends VizContext {\n marginDelta?: {top: number; bottom: number; left: number; right: number};\n featurePanels?: SceneNode[];\n legendPosition?: string | false;\n colorScalePosition?: string | false;\n resetChartScene?: boolean;\n resetChartTransform?: boolean;\n resetShapes?: boolean;\n}\n\nexport function vizDrawPure(\n viz: Viz,\n _prevCtx: Partial<VizContext> = {},\n): Partial<VizDrawCtx> {\n const out: Partial<VizDrawCtx> = {\n resetChartScene: true,\n resetChartTransform: true,\n resetShapes: true,\n marginDelta: {top: 0, bottom: 0, left: 0, right: 0},\n featurePanels: [],\n };\n\n // Reset side effects before features run. `viz._featurePanels` is a\n // cross-stage accumulator: seeded here, appended to later by the\n // zoomControls feature, and read by Viz.toScene — so it has to live on\n // the instance, not in a local. The shim RE-reads viz._featurePanels\n // into out.featurePanels for callers.\n viz._featurePanels = [];\n viz._chartScene = [];\n viz._chartTransform = undefined;\n viz._shapes = [];\n\n // Sanitize positions via the shared `sanitizePosition` helper (same\n // function legendFeature / colorScaleFeature use) so the three sites\n // can't drift. One frozen `resolveSpec` snapshot feeds both accessors:\n // the position accessors take the resolved config as their argument, so\n // a single snapshot reflects config once instead of twice.\n const spec = resolveSpec(viz);\n const legendPosition = sanitizePosition(\n viz.schema.legendPosition.bind(viz)(spec),\n );\n const colorScalePosition = sanitizePosition(\n viz.schema.colorScalePosition.bind(viz)(spec),\n );\n out.legendPosition = legendPosition;\n out.colorScalePosition = colorScalePosition;\n\n // `running` is the cross-call margin accumulator, threaded into each\n // runLayout as its baseMargin so features read the live running total via\n // ctx.layoutMargin (not viz._margin). Seeded from viz._margin so the math\n // matches whatever base the instance carried in.\n const running = {\n top: viz._margin.top,\n right: viz._margin.right,\n bottom: viz._margin.bottom,\n left: viz._margin.left,\n };\n\n // Top blocks first (back / title / subtitle / total) so the running\n // margin.top grows BEFORE the left/right legend lays out — the legend\n // positions against it. Title must lay out first or the left legend\n // overlaps the title at y=0.\n const topBlocks = runLayout({viz}, [\n backFeature,\n titleFeature,\n subtitleFeature,\n totalFeature,\n ], running);\n viz._featurePanels.push(...topBlocks.panels);\n out.marginDelta!.top += topBlocks.margin.top;\n running.top += topBlocks.margin.top;\n\n const timelineClaim = runLayout({viz}, [timelineFeature], running);\n out.marginDelta!.bottom += timelineClaim.margin.bottom;\n running.bottom += timelineClaim.margin.bottom;\n\n // Left/right legend + colorScale claims. Includes `=== false` (mirrors\n // colorScale below) so a previously-rendered left/right legend tears\n // down its DOM when the user toggles off via `.legendPosition(false)`.\n if (\n legendPosition === \"left\" ||\n legendPosition === \"right\" ||\n legendPosition === false\n ) {\n const claim = runLayout({viz}, [legendFeature], running);\n out.marginDelta!.left += claim.margin.left;\n out.marginDelta!.right += claim.margin.right;\n running.left += claim.margin.left;\n running.right += claim.margin.right;\n }\n if (\n colorScalePosition === \"left\" ||\n colorScalePosition === \"right\" ||\n colorScalePosition === false\n ) {\n const claim = runLayout({viz}, [colorScaleFeature], running);\n out.marginDelta!.left += claim.margin.left;\n out.marginDelta!.right += claim.margin.right;\n running.left += claim.margin.left;\n running.right += claim.margin.right;\n }\n\n // Top/bottom legend + colorScale.\n if (legendPosition === \"top\" || legendPosition === \"bottom\") {\n const claim = runLayout({viz}, [legendFeature], running);\n out.marginDelta!.top += claim.margin.top;\n out.marginDelta!.bottom += claim.margin.bottom;\n running.top += claim.margin.top;\n running.bottom += claim.margin.bottom;\n }\n if (colorScalePosition === \"top\" || colorScalePosition === \"bottom\") {\n const claim = runLayout({viz}, [colorScaleFeature], running);\n out.marginDelta!.top += claim.margin.top;\n out.marginDelta!.bottom += claim.margin.bottom;\n running.top += claim.margin.top;\n running.bottom += claim.margin.bottom;\n }\n\n // Snapshot final featurePanels onto the returned ctx.\n out.featurePanels = viz._featurePanels.slice();\n\n return out;\n}\n"],"names":["backFeature","colorScaleFeature","legendFeature","runLayout","sanitizePosition","subtitleFeature","timelineFeature","titleFeature","totalFeature","resolveSpec","vizDrawPure","viz","_prevCtx","out","resetChartScene","resetChartTransform","resetShapes","marginDelta","top","bottom","left","right","featurePanels","_featurePanels","_chartScene","_chartTransform","undefined","_shapes","spec","legendPosition","schema","bind","colorScalePosition","running","_margin","topBlocks","push","panels","margin","timelineClaim","claim","slice"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,GAEA,SACEA,WAAW,EACXC,iBAAiB,EACjBC,aAAa,EACbC,SAAS,EACTC,gBAAgB,EAChBC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,YAAY,QACP,0BAA0B;AAEjC,SAAQC,WAAW,QAAO,mBAAmB;AAiB7C,OAAO,SAASC,YACdC,GAAQ;QACRC,WAAAA,iEAAgC,CAAC;QAwDjCD;IAtDA,IAAME,MAA2B;QAC/BC,iBAAiB;QACjBC,qBAAqB;QACrBC,aAAa;QACbC,aAAa;YAACC,KAAK;YAAGC,QA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W,CAAEE,MAAM,IAAIqB,OAAMF,MAAM,CAACnB,MAAM;QAC9Cc,QAAQf,GAAG,IAAIsB,OAAMF,MAAM,CAACpB,GAAG;QAC/Be,QAAQd,MAAM,IAAIqB,OAAMF,MAAM,CAACnB,MAAM;IACvC;IACA,IAAIa,uBAAuB,SAASA,uBAAuB,UAAU;QACnE,IAAMQ,SAAQrC,UAAU;YAACQ,KAAAA;QAAG,GAAG;YAACV;SAAkB,EAAEgC;QACpDpB,IAAII,WAAW,CAAEC,GAAG,IAAIsB,OAAMF,MAAM,CAACpB,GAAG;QACxCL,IAAII,WAAW,CAAEE,MAAM,IAAIqB,OAAMF,MAAM,CAACnB,MAAM;QAC9Cc,QAAQf,GAAG,IAAIsB,OAAMF,MAAM,CAACpB,GAAG;QAC/Be,QAAQd,MAAM,IAAIqB,OAAMF,MAAM,CAACnB,MAAM;IACvC;IAEA,sDAAsD;IACtDN,IAAIS,aAAa,GAAGX,IAAIY,cAAc,CAACkB,KAAK;IAE5C,OAAO5B;AACT"}
1
+ {"version":3,"sources":["../../../../src/charts/pipeline/vizDrawPure.ts"],"sourcesContent":["/**\n `vizDrawPure(viz, prevCtx)` — the returning form of `vizDraw`.\n\n NAMING CAVEAT: the suffix `Pure` here means **\"returns a Partial<\n VizContext> describing the layout intent\"**, not \"free of side effects\n in the FP sense.\" The OUTER orchestration (margin computation,\n legendPosition resolution, panel aggregation, reset signals) is pure\n in the returned-ctx sense — its observable output is the ctx. The\n inner `runLayout([features])` calls write through to viz directly:\n - reset writes (`viz._featurePanels = []`, `viz._chartScene = []`,\n `viz._chartTransform = undefined`, `viz._shapes = []`)\n - margin claims (`viz._margin.X += claim.margin.X`) so the next\n runLayout sees the updated margins\n - FeatureModule layouts that mount/measure their components\n These writes are part of the contract: subclasses and feature\n modules consume live viz state during the layout body, and the shim\n pattern (`vizDraw` calling `vizDrawPure`) is what bridges the\n free-function surface to the class instances that still hold the\n components.\n\n The shim (`vizDraw`) wraps this and serves as the public surface.\n\n Returns a context with:\n - `marginDelta` (top/bottom/left/right) — total added to viz._margin\n - `featurePanels` — final aggregated panel list\n - `resetChartScene`/`resetChartTransform`/`resetShapes` (always true)\n - `legendPosition`/`colorScalePosition` — sanitized values\n*/\n\nimport {\n colorScaleFeature,\n legendFeature,\n runLayout,\n sanitizePosition,\n subtitleFeature,\n timelineFeature,\n titleFeature,\n totalFeature,\n} from \"../features/features.js\";\nimport {zoomControlsBox} from \"../drawSteps/zoomControlsMarkup.js\";\nimport {getTopLeftContributions} from \"../drawSteps/topLeftControls.js\";\nimport {topLeftControlsBox} from \"../drawSteps/topLeftControlsMarkup.js\";\nimport {reserveBottomRight} from \"../drawSteps/bottomRightControls.js\";\nimport {\n bottomRightControlsRightShortfall,\n bottomRightControlsShortfall,\n} from \"../drawSteps/bottomRightControlsMarkup.js\";\n\nimport {resolveSpec} from \"./resolveSpec.js\";\n\nimport type {SceneNode} from \"@d3plus/render\";\n\nimport type {VizContext} from \"./vizContext.js\";\nimport type {VizInstance as Viz} from \"../viz/vizTypes.js\";\n\nexport interface VizDrawCtx extends VizContext {\n marginDelta?: {top: number; bottom: number; left: number; right: number};\n featurePanels?: SceneNode[];\n legendPosition?: string | false;\n colorScalePosition?: string | false;\n resetChartScene?: boolean;\n resetChartTransform?: boolean;\n resetShapes?: boolean;\n}\n\nexport function vizDrawPure(\n viz: Viz,\n _prevCtx: Partial<VizContext> = {},\n): Partial<VizDrawCtx> {\n const out: Partial<VizDrawCtx> = {\n resetChartScene: true,\n resetChartTransform: true,\n resetShapes: true,\n marginDelta: {top: 0, bottom: 0, left: 0, right: 0},\n featurePanels: [],\n };\n\n // Reset side effects before features run. `viz._featurePanels` is a\n // cross-stage accumulator: seeded here, appended to later by the\n // zoomControls feature, and read by Viz.toScene — so it has to live on\n // the instance, not in a local. The shim RE-reads viz._featurePanels\n // into out.featurePanels for callers.\n viz._featurePanels = [];\n viz._chartScene = [];\n viz._chartTransform = undefined;\n viz._shapes = [];\n\n // Sanitize positions via the shared `sanitizePosition` helper (same\n // function legendFeature / colorScaleFeature use) so the three sites\n // can't drift. One frozen `resolveSpec` snapshot feeds both accessors:\n // the position accessors take the resolved config as their argument, so\n // a single snapshot reflects config once instead of twice.\n const spec = resolveSpec(viz);\n const legendPosition = sanitizePosition(\n viz.schema.legendPosition.bind(viz)(spec),\n );\n const colorScalePosition = sanitizePosition(\n viz.schema.colorScalePosition.bind(viz)(spec),\n );\n out.legendPosition = legendPosition;\n out.colorScalePosition = colorScalePosition;\n\n // `running` is the cross-call margin accumulator, threaded into each\n // runLayout as its baseMargin so features read the live running total via\n // ctx.layoutMargin (not viz._margin). Seeded from viz._margin so the math\n // matches whatever base the instance carried in.\n const running = {\n top: viz._margin.top,\n right: viz._margin.right,\n bottom: viz._margin.bottom,\n left: viz._margin.left,\n };\n\n // Top blocks first (title / subtitle / total) so the running margin.top\n // grows BEFORE the left/right legend lays out — the legend positions\n // against it. Title must lay out first or the left legend overlaps the\n // title at y=0. \"← Back\" no longer claims margin here — it's a\n // zero-margin contribution to the shared top-left controls panel\n // (`topLeftControlsFeature`, registered post-draw in `runVizPipeline`),\n // the same way zoom's buttons float rather than claim margin.\n const topBlocks = runLayout({viz}, [\n titleFeature,\n subtitleFeature,\n totalFeature,\n ], running);\n viz._featurePanels.push(...topBlocks.panels);\n out.marginDelta!.top += topBlocks.margin.top;\n running.top += topBlocks.margin.top;\n\n const timelineClaim = runLayout({viz}, [timelineFeature], running);\n out.marginDelta!.bottom += timelineClaim.margin.bottom;\n running.bottom += timelineClaim.margin.bottom;\n\n // The bottom-right corner panel (the size legend) measures next, above the\n // timeline and against the area left so far, so the legend/colorScale\n // blocks below can inset around it (see `bottomRightControlsInset`).\n reserveBottomRight(viz, running.bottom, {\n width: viz.schema.width - running.left - running.right,\n height: viz.schema.height - running.top - running.bottom,\n });\n\n // Left/right legend + colorScale claims. Includes `=== false` (mirrors\n // colorScale below) so a previously-rendered left/right legend tears\n // down its DOM when the user toggles off via `.legendPosition(false)`.\n if (\n legendPosition === \"left\" ||\n legendPosition === \"right\" ||\n legendPosition === false\n ) {\n const claim = runLayout({viz}, [legendFeature], running);\n out.marginDelta!.left += claim.margin.left;\n out.marginDelta!.right += claim.margin.right;\n running.left += claim.margin.left;\n running.right += claim.margin.right;\n }\n if (\n colorScalePosition === \"left\" ||\n colorScalePosition === \"right\" ||\n colorScalePosition === false\n ) {\n const claim = runLayout({viz}, [colorScaleFeature], running);\n out.marginDelta!.left += claim.margin.left;\n out.marginDelta!.right += claim.margin.right;\n running.left += claim.margin.left;\n running.right += claim.margin.right;\n }\n\n // A right-side bottom-right panel (the size legend's default) shares the\n // right column: widen the right margin to it, if the left/right claims\n // above didn't already, before the bottom blocks lay out against it.\n const rightShortfall = bottomRightControlsRightShortfall(viz, running.right);\n out.marginDelta!.right += rightShortfall;\n running.right += rightShortfall;\n\n // Top/bottom legend + colorScale.\n if (legendPosition === \"top\" || legendPosition === \"bottom\") {\n const claim = runLayout({viz}, [legendFeature], running);\n out.marginDelta!.top += claim.margin.top;\n out.marginDelta!.bottom += claim.margin.bottom;\n running.top += claim.margin.top;\n running.bottom += claim.margin.bottom;\n }\n if (colorScalePosition === \"top\" || colorScalePosition === \"bottom\") {\n const claim = runLayout({viz}, [colorScaleFeature], running);\n out.marginDelta!.top += claim.margin.top;\n out.marginDelta!.bottom += claim.margin.bottom;\n running.top += claim.margin.top;\n running.bottom += claim.margin.bottom;\n }\n\n // A bottom-side panel: the chart body must end above it, so if the bottom\n // claims so far are shorter than it, top the bottom margin up.\n const shortfall = bottomRightControlsShortfall(viz, running.bottom);\n out.marginDelta!.bottom += shortfall;\n running.bottom += shortfall;\n\n // The corner controls (zoom, back/search) deliberately claim zero\n // margin of their own — they float at y:0, and normally whatever's\n // ABOVE the chart body (title/subtitle/total, a top legend/colorScale)\n // already pushed it down clear of them. But when NONE of those claimed\n // any margin.top, the chart body starts at y:0 too, and the buttons\n // paint directly over its top edge — a Treemap's very top row, most\n // visibly, since there's no dead space up there to absorb it. Reserve\n // just enough room for the taller of the two corner rows in that one\n // case; a chart with a title/legend already has (at minimum) that same\n // room from its own claim, so this never adds on top of one.\n if (!out.marginDelta!.top) {\n const zoomHeight = zoomControlsBox(viz as never)?.height ?? 0;\n const topLeftHeight =\n topLeftControlsBox(viz as never, getTopLeftContributions(viz as never))?.height ?? 0;\n const cornerHeight = Math.max(zoomHeight, topLeftHeight);\n if (cornerHeight) {\n out.marginDelta!.top += cornerHeight;\n running.top += cornerHeight;\n }\n }\n\n // Snapshot final featurePanels onto the returned ctx.\n out.featurePanels = viz._featurePanels.slice();\n\n return out;\n}\n"],"names":["colorScaleFeature","legendFeature","runLayout","sanitizePosition","subtitleFeature","timelineFeature","titleFeature","totalFeature","zoomControlsBox","getTopLeftContributions","topLeftControlsBox","reserveBottomRight","bottomRightControlsRightShortfall","bottomRightControlsShortfall","resolveSpec","vizDrawPure","viz","_prevCtx","out","resetChartScene","resetChartTransform","resetShapes","marginDelta","top","bottom","left","right","featurePanels","_featurePanels","_chartScene","_chartTransform","undefined","_shapes","spec","legendPosition","schema","bind","colorScalePosition","running","_margin","topBlocks","push","panels","margin","timelineClaim","width","height","claim","rightShortfall","shortfall","zoomHeight","topLeftHeight","cornerHeight","Math","max","slice"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,GAEA,SACEA,iBAAiB,EACjBC,aAAa,EACbC,SAAS,EACTC,gBAAgB,EAChBC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,YAAY,QACP,0BAA0B;AACjC,SAAQC,eAAe,QAAO,qCAAqC;AACnE,SAAQC,uBAAuB,QAAO,kCAAkC;AACxE,SAAQC,kBAAkB,QAAO,wCAAwC;AACzE,SAAQC,kBAAkB,QAAO,sCAAsC;AACvE,SACEC,iCAAiC,EACjCC,4BAA4B,QACvB,4CAA4C;AAEnD,SAAQC,WAAW,QAAO,mBAAmB;AAiB7C,OAAO,SAASC,YACdC,GAAQ;QACRC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AA6BG,KAAKsB,QAAQd,MAAM;IAClEN,IAAII,WAAW,CAAEE,MAAM,IAAIyB;IAC3BX,QAAQd,MAAM,IAAIyB;IAElB,kEAAkE;IAClE,mEAAmE;IACnE,uEAAuE;IACvE,uEAAuE;IACvE,oEAAoE;IACpE,oEAAoE;IACpE,sEAAsE;IACtE,qEAAqE;IACrE,uEAAuE;IACvE,6DAA6D;IAC7D,IAAI,CAAC/B,IAAII,WAAW,CAAEC,GAAG,EAAE;;YACNf,kBAEjBE;QAFF,IAAMwC,sBAAa1C,mBAAAA,gBAAgBQ,kBAAhBR,uCAAAA,iBAA+BsC,MAAM,uCAAI;QAC5D,IAAMK,0BACJzC,sBAAAA,mBAAmBM,KAAcP,wBAAwBO,mBAAzDN,0CAAAA,oBAAyEoC,MAAM,yCAAI;QACrF,IAAMM,eAAeC,KAAKC,GAAG,CAACJ,YAAYC;QAC1C,IAAIC,cAAc;YAChBlC,IAAII,WAAW,CAAEC,GAAG,IAAI6B;YACxBd,QAAQf,GAAG,IAAI6B;QACjB;IACF;IAEA,sDAAsD;IACtDlC,IAAIS,aAAa,GAAGX,IAAIY,cAAc,CAAC2B,KAAK;IAE5C,OAAOrC;AACT"}
@@ -323,6 +323,8 @@ import { computeTrailCatchup } from "./trailCatchup.js";
323
323
  import { CanvasRenderer, SvgRenderer } from "@d3plus/render";
324
324
  import VizBase from "./VizBase.js";
325
325
  import { applyColorScaleBucketOpacity, applyInteractionOpacity } from "./interactionOpacity.js";
326
+ import { chartAreaRect } from "../features/chartGeometry.js";
327
+ import { applyZoomPointerEvents, bindCanvasZoom } from "../drawSteps/zoomControls.js";
326
328
  import { initVizDefaults } from "./vizDefaults.js";
327
329
  import { vizRender } from "./vizRender.js";
328
330
  import { vizDraw } from "../pipeline/vizDraw.js";
@@ -399,15 +401,19 @@ var Viz = /*#__PURE__*/ function(VizBase) {
399
401
  var children = [];
400
402
  // Chart cells stashed on _chartScene — via `chartDef.emit(ctx)` for
401
403
  // data-driven charts, or `Plot._paint` for the paint-driven Plot family.
402
- // Wraps in two groups when a zoom transform is active:
403
- // viz-chart-cells (chart-positioning transform)
404
+ // Wraps in three groups:
405
+ // viz-chart-cells (clip window, untransformed)
404
406
  // viz-zoom (zoom transform — pan/scale from d3-zoom)
405
- // … chart scene children
407
+ // viz-chart-body (chart-positioning transform)
408
+ // … chart scene children
406
409
  // This lets zoom apply to the chart content WITHOUT moving legend/
407
410
  // title/total/etc. (which live in sibling viz-* groups, not under
408
- // viz-chart-cells).
411
+ // viz-chart-cells). The zoom transform sits above the chart transform so
412
+ // it lives in the same surface space d3-zoom measures the pointer in —
413
+ // a wheel zoom stays anchored under the cursor regardless of margins or
414
+ // a chart's own centering transform (Pie, Radar, …).
409
415
  if (this._chartScene && this._chartScene.length) {
410
- var _this__zoomTransform;
416
+ var _this__zoomTransform, _this__chartClip;
411
417
  var sliced = applyInteractionOpacity(this._chartScene, this);
412
418
  // Always emit the viz-zoom group (identity transform when no zoom is
413
419
  // active) so its key is stable across the first zoom. Otherwise the first
@@ -423,16 +429,28 @@ var Viz = /*#__PURE__*/ function(VizBase) {
423
429
  y: 0,
424
430
  scale: 1
425
431
  },
426
- children: sliced
432
+ children: [
433
+ _object_spread_props(_object_spread({
434
+ type: "group",
435
+ key: "viz-chart-body"
436
+ }, this._chartTransform ? {
437
+ transform: this._chartTransform
438
+ } : {}), {
439
+ children: sliced
440
+ })
441
+ ]
427
442
  }
428
443
  ];
444
+ // Fixed clip window (e.g. Geomap's map rect): stays put in scene space
445
+ // while the viz-zoom child transform pans/scales content beneath it.
446
+ // Any zoomable chart without its own clip is clipped to the chart area,
447
+ // so zoomed content can't spill over the legend/title/timeline.
448
+ var clip = (_this__chartClip = this._chartClip) !== null && _this__chartClip !== void 0 ? _this__chartClip : this.schema.zoom && this._margin ? chartAreaRect(this) : undefined;
429
449
  children.push(_object_spread_props(_object_spread({
430
450
  type: "group",
431
451
  key: "viz-chart-cells"
432
- }, this._chartTransform ? {
433
- transform: this._chartTransform
434
- } : {}, this._chartClip ? {
435
- clip: this._chartClip
452
+ }, clip ? {
453
+ clip: clip
436
454
  } : {}), {
437
455
  children: zoomNode
438
456
  }));
@@ -528,34 +546,13 @@ var Viz = /*#__PURE__*/ function(VizBase) {
528
546
  }
529
547
  }
530
548
  }
531
- // E2: FeatureModule.layout() panels (title/subtitle/total/back).
549
+ // E2: FeatureModule.layout() panels (title/subtitle/total, plus the
550
+ // zoom/top-left-controls/attribution overlays appended post-draw).
532
551
  if (this._featurePanels && this._featurePanels.length) {
533
- var panels = this._featurePanels.slice();
534
- var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
535
- try {
536
- // Tag the back-button panel so the pointer bridge can route its click.
537
- for(var _iterator1 = panels[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
538
- var panel = _step1.value;
539
- if (panel && typeof panel.key === "string" && panel.key.toLowerCase().includes("back")) tagInteractionGroup(panel, "back");
540
- }
541
- } catch (err) {
542
- _didIteratorError1 = true;
543
- _iteratorError1 = err;
544
- } finally{
545
- try {
546
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
547
- _iterator1.return();
548
- }
549
- } finally{
550
- if (_didIteratorError1) {
551
- throw _iteratorError1;
552
- }
553
- }
554
- }
555
552
  children.push({
556
553
  type: "group",
557
554
  key: "viz-features",
558
- children: panels
555
+ children: this._featurePanels
559
556
  });
560
557
  }
561
558
  return {
@@ -580,6 +577,16 @@ var Viz = /*#__PURE__*/ function(VizBase) {
580
577
  },
581
578
  {
582
579
  /**
580
+ The chart's size-legend radius scale (see `ChartDefinition.sizeLegendScale`).
581
+ Charts that size marks override this; the base chart sizes nothing.
582
+ @private
583
+ */ key: "_sizeLegendScale",
584
+ value: function _sizeLegendScale(_available) {
585
+ return null;
586
+ }
587
+ },
588
+ {
589
+ /**
583
590
  * Applies the threshold algorithm according to the type of chart used.
584
591
  * @param {Array} data The data to process.
585
592
  * @private
@@ -774,7 +781,7 @@ var Viz = /*#__PURE__*/ function(VizBase) {
774
781
  // re-renders. Interaction handlers (zoomed, hover, etc.) pass 0 to
775
782
  // skip the transition machinery — animating every wheel/drag tick
776
783
  // accumulates `setTimeout(duration+10)` per event.
777
- var drawDuration = durationOverride !== undefined ? durationOverride : this.schema.duration;
784
+ var drawDuration = durationOverride !== undefined ? durationOverride : this._instantNextDraw ? 0 : this.schema.duration;
778
785
  // A duration>0 render (drill-down, zoom, re-center) must win over any
779
786
  // pending coalesced duration-0 repaint — otherwise that repaint fires on
780
787
  // the next frame and interrupts this transition, snapping shapes to their
@@ -811,8 +818,30 @@ var Viz = /*#__PURE__*/ function(VizBase) {
811
818
  this._sceneRenderer.drawScene(scene, {
812
819
  duration: drawDuration,
813
820
  sequence: sequence,
814
- trailCatchup: trailCatchup
821
+ trailCatchup: trailCatchup,
822
+ // The drill-down morph's resolved boxes for this draw, if a drill
823
+ // click armed one (resolveDrillMorph, run just before this method via
824
+ // runVizPipeline). One-shot: cleared right below so a later repaint
825
+ // that reaches this method by some OTHER path (a zoom/pan tick, a
826
+ // coalesced hover repaint, Rings' click-to-recenter) never inherits a
827
+ // stale box from an earlier drill click.
828
+ enterFrom: this._resolvedEnterFrom,
829
+ enterFromBody: this._resolvedEnterFromBody,
830
+ exitTo: this._resolvedExitTo,
831
+ exitToBody: this._resolvedExitToBody,
832
+ instantExitKey: this._resolvedInstantExitKey,
833
+ reunionEnterKey: this._resolvedReunionEnterKey,
834
+ reunionEnterFrom: this._resolvedReunionEnterFrom,
835
+ instantExitAll: this._resolvedInstantExitAll
815
836
  });
837
+ this._resolvedEnterFrom = undefined;
838
+ this._resolvedEnterFromBody = undefined;
839
+ this._resolvedExitTo = undefined;
840
+ this._resolvedExitToBody = undefined;
841
+ this._resolvedInstantExitKey = undefined;
842
+ this._resolvedReunionEnterKey = undefined;
843
+ this._resolvedReunionEnterFrom = undefined;
844
+ this._resolvedInstantExitAll = undefined;
816
845
  this._lastSceneRendered = scene;
817
846
  // Canvas backend: the compute <svg> (`_select`) is an emptied overlay
818
847
  // sitting on top of the <canvas>. An svg root hit-tests its whole box, so
@@ -822,12 +851,11 @@ var Viz = /*#__PURE__*/ function(VizBase) {
822
851
  // is the sole interaction surface. The only interactive DOM that still
823
852
  // lives in this svg is the timeline's d3-brush (the canvas can't host the
824
853
  // native brush handles), so re-enable events on just that group. On the
825
- // SVG backend `_select` IS the scene host, so events must stay enabled.
826
- if (this._select) {
827
- this._select.style("pointer-events", kind === "canvas" ? "none" : null);
828
- if (this._container) this._container.style("pointer-events", kind === "canvas" ? "none" : null);
829
- if (kind === "canvas") this._select.select("g.d3plus-viz-timeline").style("pointer-events", "auto");
830
- }
854
+ // SVG backend `_select` IS the scene host, so events must stay enabled
855
+ // (except while the zoom brush is active — see `applyZoomPointerEvents`).
856
+ applyZoomPointerEvents(this);
857
+ if (this._select && kind === "canvas") this._select.select("g.d3plus-viz-timeline").style("pointer-events", "auto");
858
+ if (kind === "canvas") bindCanvasZoom(this);
831
859
  // The timeline brush (d3-brush DOM, mounted in `g.d3plus-viz-timeline` in
832
860
  // the outer svg) must paint above the scene-rendered timeline buttons/ticks
833
861
  // so its selection tint + handles sit on top of them (matching v3). The
@@ -838,6 +866,9 @@ var Viz = /*#__PURE__*/ function(VizBase) {
838
866
  var host = userTarget && typeof userTarget.querySelector === "function" ? userTarget : null;
839
867
  var tlGroup = host ? host.querySelector(":scope > g.d3plus-viz-timeline") : null;
840
868
  if (tlGroup) host.appendChild(tlGroup);
869
+ // Likewise the zoom brush, so its selection box draws over the shapes.
870
+ var zoomBrush = host ? host.querySelector(":scope > g.d3plus-zoom-brush") : null;
871
+ if (zoomBrush && zoomBrush !== host.lastElementChild) host.appendChild(zoomBrush);
841
872
  }
842
873
  }
843
874
  },
@@ -866,6 +897,15 @@ var Viz = /*#__PURE__*/ function(VizBase) {
866
897
  },
867
898
  {
868
899
  /**
900
+ Pointer hook run by `_routeSceneEvent` before any handler routing, for
901
+ every event including ones over empty space. No-op here; Plot overrides
902
+ it to drive the shared multi-series tooltip and crosshair.
903
+ @private
904
+ */ key: "_sharedHover",
905
+ value: function _sharedHover(_event) {}
906
+ },
907
+ {
908
+ /**
869
909
  Routes a renderer pointer event to the matching `viz.schema.on` handlers.
870
910
  Bridges the v4 scene-rendered path (SvgRenderer/CanvasRenderer), where
871
911
  compute-mode shapes mount no per-shape DOM, so `shape.on(evt, fn)`
@@ -884,6 +924,10 @@ var Viz = /*#__PURE__*/ function(VizBase) {
884
924
  // — the glitchy jump. `_transitionEndsAt` is stamped by `_drawSceneToTarget`
885
925
  // for the transition's duration; it lapses on its own, so interaction
886
926
  // resumes the instant the transition settles.
927
+ // Runs for every event, picked or not, so a chart can track the pointer
928
+ // across empty space (Plot's shared tooltip + crosshair) — and ahead of
929
+ // the transition guard below, so leaving mid-transition still clears it.
930
+ this._sharedHover(event);
887
931
  if (this._transitionEndsAt && Date.now() < this._transitionEndsAt) return;
888
932
  var pick = event.pick;
889
933
  // Dispatch helper shared by the live-pick path and the leave path.
@@ -916,20 +960,10 @@ var Viz = /*#__PURE__*/ function(VizBase) {
916
960
  if (!pick || !pick.node) return;
917
961
  // Scene nodes carry interaction metadata stamped by Viz.toScene.
918
962
  var nodeAny = pick.node;
919
- // Back-button panel: its d3-selection click listener never fires in the
920
- // scene path (it's a plain text node), so route its click here to pop
921
- // the drill-down history / step up a level.
922
- if (nodeAny.interactionGroup === "back") {
923
- if (event.type === "click") {
924
- var self = this;
925
- if (self._history.length) self.config(self._history.pop()).render();
926
- else self.depth(self._drawDepth - 1).filter(false).render();
927
- }
928
- return;
929
- }
930
- // Axis ticks/labels and the timeline are chrome — they carry data but
931
- // are not chart shapes, so they must not fire shape tooltips/handlers.
932
- if (nodeAny.interactionGroup === "axis" || nodeAny.interactionGroup === "timeline") return;
963
+ // Axis ticks/labels, the timeline, and Plot's trend lines are chrome —
964
+ // they carry data but are not chart shapes, so they must not fire shape
965
+ // tooltips/handlers (a trend line's own tooltip runs in `_sharedHover`).
966
+ if (nodeAny.interactionGroup === "axis" || nodeAny.interactionGroup === "timeline" || nodeAny.interactionGroup === "trend") return;
933
967
  // Prefer the node's stamped interaction group (set by Viz.toScene), so
934
968
  // legend swatches route to legend handlers on Canvas too — where the
935
969
  // single canvas element has no per-shape DOM to walk. Fall back to SVG
@@ -950,7 +984,11 @@ var Viz = /*#__PURE__*/ function(VizBase) {
950
984
  i: sourceIndex,
951
985
  x: rawDatum,
952
986
  isLegend: isLegendNode,
953
- shapeType: shapeType
987
+ shapeType: shapeType,
988
+ // The live picked node's own geometry, read synchronously by clickShape
989
+ // (before the drill-down re-render replaces this frame) to arm the
990
+ // forward drill-down morph.
991
+ node: pick.node
954
992
  };
955
993
  this._hoverDatum = rawDatum;
956
994
  fire(handlerKey, sourceDatum, sourceIndex, rawDatum);
@@ -993,11 +1031,13 @@ var Viz = /*#__PURE__*/ function(VizBase) {
993
1031
  },
994
1032
  {
995
1033
  /**
996
- Tears down the visualization: disconnects the ResizeObserver and removes DOM event listeners. Call this when unmounting to avoid memory leaks.
1034
+ Tears down the visualization: disconnects the ResizeObserver, stops listening for web font loads, and removes DOM event listeners. Call this when unmounting to avoid memory leaks.
997
1035
  */ key: "destroy",
998
1036
  value: function destroy() {
999
- var _this__resizeObserver;
1037
+ var _this__resizeObserver, _this__fontsUnsubscribe, _this, _this__visibleUnobserve, _this1, _this__unloadUnobserve, _this2;
1000
1038
  (_this__resizeObserver = this._resizeObserver) === null || _this__resizeObserver === void 0 ? void 0 : _this__resizeObserver.disconnect();
1039
+ (_this__fontsUnsubscribe = (_this = this)._fontsUnsubscribe) === null || _this__fontsUnsubscribe === void 0 ? void 0 : _this__fontsUnsubscribe.call(_this);
1040
+ this._fontsUnsubscribe = undefined;
1001
1041
  this._tooltipClass.data([]).render();
1002
1042
  select("body").on("touchstart.".concat(this._uuid), null);
1003
1043
  // Clear the visibility/resize/scroll poll timers + scroll listener
@@ -1014,6 +1054,10 @@ var Viz = /*#__PURE__*/ function(VizBase) {
1014
1054
  if (this._scrollPoll) {
1015
1055
  this._scrollPoll = clearTimeout(this._scrollPoll);
1016
1056
  }
1057
+ (_this__visibleUnobserve = (_this1 = this)._visibleUnobserve) === null || _this__visibleUnobserve === void 0 ? void 0 : _this__visibleUnobserve.call(_this1);
1058
+ this._visibleUnobserve = undefined;
1059
+ (_this__unloadUnobserve = (_this2 = this)._unloadUnobserve) === null || _this__unloadUnobserve === void 0 ? void 0 : _this__unloadUnobserve.call(_this2);
1060
+ this._unloadUnobserve = undefined;
1017
1061
  if (this._sceneRepaintRAF != null) {
1018
1062
  if (typeof cancelAnimationFrame === "function") cancelAnimationFrame(this._sceneRepaintRAF);
1019
1063
  this._sceneRepaintRAF = undefined;