@d3plus/core 3.1.6 → 4.0.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 (579) hide show
  1. package/README.md +9922 -78537
  2. package/es/index.js +8 -0
  3. package/es/index.js.map +1 -1
  4. package/es/internal.js +54 -0
  5. package/es/internal.js.map +1 -0
  6. package/es/src/charts/AreaPlot/index.js +36 -0
  7. package/es/src/charts/AreaPlot/index.js.map +1 -0
  8. package/es/src/charts/BarChart/index.js +48 -0
  9. package/es/src/charts/BarChart/index.js.map +1 -0
  10. package/es/src/charts/BoxWhisker/index.js +52 -0
  11. package/es/src/charts/BoxWhisker/index.js.map +1 -0
  12. package/es/src/charts/BumpChart/index.js +81 -0
  13. package/es/src/charts/BumpChart/index.js.map +1 -0
  14. package/es/src/charts/Donut/index.js +42 -0
  15. package/es/src/charts/Donut/index.js.map +1 -0
  16. package/es/src/charts/Geomap/applyLayout.js +208 -0
  17. package/es/src/charts/Geomap/applyLayout.js.map +1 -0
  18. package/es/src/charts/Geomap/emit.js +169 -0
  19. package/es/src/charts/Geomap/emit.js.map +1 -0
  20. package/es/src/charts/Geomap/index.js +521 -0
  21. package/es/src/charts/Geomap/index.js.map +1 -0
  22. package/es/src/charts/LinePlot/index.js +32 -0
  23. package/es/src/charts/LinePlot/index.js.map +1 -0
  24. package/es/src/charts/Matrix/applyLayout.js +92 -0
  25. package/es/src/charts/Matrix/applyLayout.js.map +1 -0
  26. package/es/src/charts/Matrix/emit.js +44 -0
  27. package/es/src/charts/Matrix/emit.js.map +1 -0
  28. package/es/src/charts/Matrix/index.js +154 -0
  29. package/es/src/charts/Matrix/index.js.map +1 -0
  30. package/es/src/charts/Network/applyLayout.js +322 -0
  31. package/es/src/charts/Network/applyLayout.js.map +1 -0
  32. package/es/src/charts/Network/emit.js +273 -0
  33. package/es/src/charts/Network/emit.js.map +1 -0
  34. package/es/src/charts/Network/index.js +422 -0
  35. package/es/src/charts/Network/index.js.map +1 -0
  36. package/es/src/charts/Pack/applyLayout.js +46 -0
  37. package/es/src/charts/Pack/applyLayout.js.map +1 -0
  38. package/es/src/charts/Pack/emit.js +116 -0
  39. package/es/src/charts/Pack/emit.js.map +1 -0
  40. package/es/src/charts/Pack/index.js +194 -0
  41. package/es/src/charts/Pack/index.js.map +1 -0
  42. package/es/src/charts/Pack/recursionCircles.js +18 -0
  43. package/es/src/charts/Pack/recursionCircles.js.map +1 -0
  44. package/es/src/charts/Pie/applyLayout.js +44 -0
  45. package/es/src/charts/Pie/applyLayout.js.map +1 -0
  46. package/es/src/charts/Pie/emit.js +111 -0
  47. package/es/src/charts/Pie/emit.js.map +1 -0
  48. package/es/src/charts/Pie/index.js +134 -0
  49. package/es/src/charts/Pie/index.js.map +1 -0
  50. package/es/src/charts/Plot/draw.js +424 -0
  51. package/es/src/charts/Plot/draw.js.map +1 -0
  52. package/es/src/charts/Plot/index.js +827 -0
  53. package/es/src/charts/Plot/index.js.map +1 -0
  54. package/es/src/charts/Plot/labelPlacement.js +36 -0
  55. package/es/src/charts/Plot/labelPlacement.js.map +1 -0
  56. package/es/src/charts/Plot/pipeline.js +594 -0
  57. package/es/src/charts/Plot/pipeline.js.map +1 -0
  58. package/es/src/charts/Plot/pipelineDomains.js +254 -0
  59. package/es/src/charts/Plot/pipelineDomains.js.map +1 -0
  60. package/es/src/charts/Plot/pipelineLineLabels.js +210 -0
  61. package/es/src/charts/Plot/pipelineLineLabels.js.map +1 -0
  62. package/es/src/charts/Plot/shapeDefaults.js +189 -0
  63. package/es/src/charts/Plot/shapeDefaults.js.map +1 -0
  64. package/es/src/charts/Plot/stackHelpers.js +52 -0
  65. package/es/src/charts/Plot/stackHelpers.js.map +1 -0
  66. package/es/src/charts/Priestley/applyLayout.js +121 -0
  67. package/es/src/charts/Priestley/applyLayout.js.map +1 -0
  68. package/es/src/charts/Priestley/emit.js +129 -0
  69. package/es/src/charts/Priestley/emit.js.map +1 -0
  70. package/es/src/charts/Priestley/index.js +97 -0
  71. package/es/src/charts/Priestley/index.js.map +1 -0
  72. package/es/src/charts/Radar/applyLayout.js +326 -0
  73. package/es/src/charts/Radar/applyLayout.js.map +1 -0
  74. package/es/src/charts/Radar/emit.js +28 -0
  75. package/es/src/charts/Radar/emit.js.map +1 -0
  76. package/es/src/charts/Radar/index.js +98 -0
  77. package/es/src/charts/Radar/index.js.map +1 -0
  78. package/es/src/charts/RadialMatrix/applyLayout.js +132 -0
  79. package/es/src/charts/RadialMatrix/applyLayout.js.map +1 -0
  80. package/es/src/charts/RadialMatrix/emit.js +33 -0
  81. package/es/src/charts/RadialMatrix/emit.js.map +1 -0
  82. package/es/src/charts/RadialMatrix/index.js +144 -0
  83. package/es/src/charts/RadialMatrix/index.js.map +1 -0
  84. package/es/src/charts/Rings/applyLayout.js +508 -0
  85. package/es/src/charts/Rings/applyLayout.js.map +1 -0
  86. package/es/src/charts/Rings/emit.js +222 -0
  87. package/es/src/charts/Rings/emit.js.map +1 -0
  88. package/es/src/charts/Rings/index.js +245 -0
  89. package/es/src/charts/Rings/index.js.map +1 -0
  90. package/es/src/charts/Sankey/applyLayout.js +107 -0
  91. package/es/src/charts/Sankey/applyLayout.js.map +1 -0
  92. package/es/src/charts/Sankey/emit.js +134 -0
  93. package/es/src/charts/Sankey/emit.js.map +1 -0
  94. package/es/src/charts/Sankey/index.js +219 -0
  95. package/es/src/charts/Sankey/index.js.map +1 -0
  96. package/es/src/charts/StackedArea/index.js +27 -0
  97. package/es/src/charts/StackedArea/index.js.map +1 -0
  98. package/es/src/charts/Tree/applyLayout.js +233 -0
  99. package/es/src/charts/Tree/applyLayout.js.map +1 -0
  100. package/es/src/charts/Tree/emit.js +257 -0
  101. package/es/src/charts/Tree/emit.js.map +1 -0
  102. package/es/src/charts/Tree/index.js +105 -0
  103. package/es/src/charts/Tree/index.js.map +1 -0
  104. package/es/src/charts/Treemap/applyLayout.js +85 -0
  105. package/es/src/charts/Treemap/applyLayout.js.map +1 -0
  106. package/es/src/charts/Treemap/emit.js +141 -0
  107. package/es/src/charts/Treemap/emit.js.map +1 -0
  108. package/es/src/charts/Treemap/index.js +177 -0
  109. package/es/src/charts/Treemap/index.js.map +1 -0
  110. package/es/src/charts/Treemap/thresholdFunction.js +112 -0
  111. package/es/src/charts/Treemap/thresholdFunction.js.map +1 -0
  112. package/es/src/charts/definition/ChartDefinition.js +12 -0
  113. package/es/src/charts/definition/ChartDefinition.js.map +1 -0
  114. package/es/src/charts/definition/applyDefinition.js +107 -0
  115. package/es/src/charts/definition/applyDefinition.js.map +1 -0
  116. package/es/src/charts/definition/makeChart.js +153 -0
  117. package/es/src/charts/definition/makeChart.js.map +1 -0
  118. package/es/src/charts/drawSteps/zoomControls.js +231 -96
  119. package/es/src/charts/drawSteps/zoomControls.js.map +1 -1
  120. package/es/src/charts/events/click.legend.js +2 -2
  121. package/es/src/charts/events/click.legend.js.map +1 -1
  122. package/es/src/charts/events/click.shape.js +5 -5
  123. package/es/src/charts/events/click.shape.js.map +1 -1
  124. package/es/src/charts/events/mouseenter.js +20 -1
  125. package/es/src/charts/events/mouseenter.js.map +1 -1
  126. package/es/src/charts/events/mouseleave.js +19 -4
  127. package/es/src/charts/events/mouseleave.js.map +1 -1
  128. package/es/src/charts/events/mousemove.legend.js +10 -10
  129. package/es/src/charts/events/mousemove.legend.js.map +1 -1
  130. package/es/src/charts/events/mousemove.shape.js +14 -8
  131. package/es/src/charts/events/mousemove.shape.js.map +1 -1
  132. package/es/src/charts/events/touchstart.body.js.map +1 -1
  133. package/es/src/charts/features/axes.js +432 -0
  134. package/es/src/charts/features/axes.js.map +1 -0
  135. package/es/src/charts/features/chartGeometry.js +66 -0
  136. package/es/src/charts/features/chartGeometry.js.map +1 -0
  137. package/es/src/charts/features/colorScaleBucket.js +92 -0
  138. package/es/src/charts/features/colorScaleBucket.js.map +1 -0
  139. package/es/src/charts/features/emitHelpers.js +217 -0
  140. package/es/src/charts/features/emitHelpers.js.map +1 -0
  141. package/es/src/charts/features/ensureZoomDom.js +71 -0
  142. package/es/src/charts/features/ensureZoomDom.js.map +1 -0
  143. package/es/src/charts/features/features.js +650 -0
  144. package/es/src/charts/features/features.js.map +1 -0
  145. package/es/src/charts/features/featuresLegend.js +180 -0
  146. package/es/src/charts/features/featuresLegend.js.map +1 -0
  147. package/es/src/charts/features/legendLabel.js +12 -0
  148. package/es/src/charts/features/legendLabel.js.map +1 -0
  149. package/es/src/charts/features/lineLabels.js +154 -0
  150. package/es/src/charts/features/lineLabels.js.map +1 -0
  151. package/es/src/charts/features/plotPaint.js +512 -0
  152. package/es/src/charts/features/plotPaint.js.map +1 -0
  153. package/es/src/charts/features/shapeEmit.js +273 -0
  154. package/es/src/charts/features/shapeEmit.js.map +1 -0
  155. package/es/src/charts/helpers/matrixData.js +3 -3
  156. package/es/src/charts/helpers/matrixData.js.map +1 -1
  157. package/es/src/charts/index.js +21 -21
  158. package/es/src/charts/index.js.map +1 -1
  159. package/es/src/charts/pipeline/resolveSpec.js +44 -0
  160. package/es/src/charts/pipeline/resolveSpec.js.map +1 -0
  161. package/es/src/charts/pipeline/runChartDraw.js +109 -0
  162. package/es/src/charts/pipeline/runChartDraw.js.map +1 -0
  163. package/es/src/charts/pipeline/runVizPipeline.js +84 -0
  164. package/es/src/charts/pipeline/runVizPipeline.js.map +1 -0
  165. package/es/src/charts/pipeline/stages.js +103 -0
  166. package/es/src/charts/pipeline/stages.js.map +1 -0
  167. package/es/src/charts/pipeline/vizContext.js +29 -0
  168. package/es/src/charts/pipeline/vizContext.js.map +1 -0
  169. package/es/src/charts/pipeline/vizDraw.js +37 -0
  170. package/es/src/charts/pipeline/vizDraw.js.map +1 -0
  171. package/es/src/charts/pipeline/vizDrawPure.js +174 -0
  172. package/es/src/charts/pipeline/vizDrawPure.js.map +1 -0
  173. package/es/src/charts/pipeline/vizPreDraw.js +145 -0
  174. package/es/src/charts/pipeline/vizPreDraw.js.map +1 -0
  175. package/es/src/charts/pipeline/vizPreDrawPure.js +279 -0
  176. package/es/src/charts/pipeline/vizPreDrawPure.js.map +1 -0
  177. package/es/src/charts/plotBuffers/Bar.js +4 -4
  178. package/es/src/charts/plotBuffers/Bar.js.map +1 -1
  179. package/es/src/charts/plotBuffers/Box.js +4 -4
  180. package/es/src/charts/plotBuffers/Box.js.map +1 -1
  181. package/es/src/charts/plotBuffers/Circle.js +2 -2
  182. package/es/src/charts/plotBuffers/Circle.js.map +1 -1
  183. package/es/src/charts/plotBuffers/Line.js +5 -5
  184. package/es/src/charts/plotBuffers/Line.js.map +1 -1
  185. package/es/src/charts/plotBuffers/Rect.js +2 -2
  186. package/es/src/charts/plotBuffers/Rect.js.map +1 -1
  187. package/es/src/charts/plotBuffers/discreteBuffer.js +1 -2
  188. package/es/src/charts/plotBuffers/discreteBuffer.js.map +1 -1
  189. package/es/src/charts/plotBuffers/numericBuffer.js +1 -2
  190. package/es/src/charts/plotBuffers/numericBuffer.js.map +1 -1
  191. package/es/src/charts/viz/Viz.js +985 -0
  192. package/es/src/charts/viz/Viz.js.map +1 -0
  193. package/es/src/charts/viz/VizBase.js +447 -0
  194. package/es/src/charts/viz/VizBase.js.map +1 -0
  195. package/es/src/charts/viz/VizBaseConfig.js +504 -0
  196. package/es/src/charts/viz/VizBaseConfig.js.map +1 -0
  197. package/es/src/charts/viz/interactionOpacity.js +247 -0
  198. package/es/src/charts/viz/interactionOpacity.js.map +1 -0
  199. package/es/src/charts/viz/ordinalColor.js +71 -0
  200. package/es/src/charts/viz/ordinalColor.js.map +1 -0
  201. package/es/src/charts/viz/trailCatchup.js +127 -0
  202. package/es/src/charts/viz/trailCatchup.js.map +1 -0
  203. package/es/src/charts/viz/vizDefaults.js +602 -0
  204. package/es/src/charts/viz/vizDefaults.js.map +1 -0
  205. package/es/src/charts/viz/vizRender.js +251 -0
  206. package/es/src/charts/viz/vizRender.js.map +1 -0
  207. package/es/src/charts/viz/vizTypes.js +28 -0
  208. package/es/src/charts/viz/vizTypes.js.map +1 -0
  209. package/es/src/components/Axis/Axis.js +691 -0
  210. package/es/src/components/Axis/Axis.js.map +1 -0
  211. package/es/src/components/Axis/AxisBottom.js.map +1 -0
  212. package/es/src/components/Axis/AxisLeft.js.map +1 -0
  213. package/es/src/components/Axis/AxisRight.js.map +1 -0
  214. package/es/src/components/Axis/AxisTop.js.map +1 -0
  215. package/es/src/components/Axis/axisLayout.js +208 -0
  216. package/es/src/components/Axis/axisLayout.js.map +1 -0
  217. package/es/src/components/Axis/axisLayoutLabels.js +177 -0
  218. package/es/src/components/Axis/axisLayoutLabels.js.map +1 -0
  219. package/es/src/components/Axis/axisLayoutScale.js +374 -0
  220. package/es/src/components/Axis/axisLayoutScale.js.map +1 -0
  221. package/es/src/components/Axis/axisRender.js +535 -0
  222. package/es/src/components/Axis/axisRender.js.map +1 -0
  223. package/es/src/components/ColorScale/ColorScale.js +506 -0
  224. package/es/src/components/ColorScale/ColorScale.js.map +1 -0
  225. package/es/src/components/ColorScale/colorScaleRender.js +277 -0
  226. package/es/src/components/ColorScale/colorScaleRender.js.map +1 -0
  227. package/es/src/components/ColorScale/colorScaleScale.js +274 -0
  228. package/es/src/components/ColorScale/colorScaleScale.js.map +1 -0
  229. package/es/src/components/Legend/Legend.js +445 -0
  230. package/es/src/components/Legend/Legend.js.map +1 -0
  231. package/es/src/components/Legend/legendConfig.js +87 -0
  232. package/es/src/components/Legend/legendConfig.js.map +1 -0
  233. package/es/src/components/Legend/legendRender.js +245 -0
  234. package/es/src/components/Legend/legendRender.js.map +1 -0
  235. package/es/src/components/Message.js.map +1 -1
  236. package/es/src/components/TextBox.js +639 -453
  237. package/es/src/components/TextBox.js.map +1 -1
  238. package/es/src/components/Timeline/Timeline.js +674 -0
  239. package/es/src/components/Timeline/Timeline.js.map +1 -0
  240. package/es/src/components/Timeline/timelineConfig.js +115 -0
  241. package/es/src/components/Timeline/timelineConfig.js.map +1 -0
  242. package/es/src/components/Timeline/timelineRender.js +267 -0
  243. package/es/src/components/Timeline/timelineRender.js.map +1 -0
  244. package/es/src/components/Tooltip.js +288 -249
  245. package/es/src/components/Tooltip.js.map +1 -1
  246. package/es/src/components/index.js +8 -8
  247. package/es/src/components/index.js.map +1 -1
  248. package/es/src/fluent.js +265 -0
  249. package/es/src/fluent.js.map +1 -0
  250. package/es/src/shapes/Area.js +96 -114
  251. package/es/src/shapes/Area.js.map +1 -1
  252. package/es/src/shapes/Bar.js +71 -86
  253. package/es/src/shapes/Bar.js.map +1 -1
  254. package/es/src/shapes/Box.js +295 -190
  255. package/es/src/shapes/Box.js.map +1 -1
  256. package/es/src/shapes/Circle.js +72 -31
  257. package/es/src/shapes/Circle.js.map +1 -1
  258. package/es/src/shapes/Image.js +164 -85
  259. package/es/src/shapes/Image.js.map +1 -1
  260. package/es/src/shapes/Line.js +51 -94
  261. package/es/src/shapes/Line.js.map +1 -1
  262. package/es/src/shapes/Path.js +33 -41
  263. package/es/src/shapes/Path.js.map +1 -1
  264. package/es/src/shapes/Rect.js +86 -37
  265. package/es/src/shapes/Rect.js.map +1 -1
  266. package/es/src/shapes/Shape.js +655 -678
  267. package/es/src/shapes/Shape.js.map +1 -1
  268. package/es/src/shapes/Whisker.js +156 -61
  269. package/es/src/shapes/Whisker.js.map +1 -1
  270. package/es/src/shapes/buildLabelData.js +70 -0
  271. package/es/src/shapes/buildLabelData.js.map +1 -0
  272. package/es/src/shapes/emitLabels.js +84 -0
  273. package/es/src/shapes/emitLabels.js.map +1 -0
  274. package/es/src/shapes/hitAreaNode.js +37 -0
  275. package/es/src/shapes/hitAreaNode.js.map +1 -0
  276. package/es/src/shapes/sceneSort.js +57 -0
  277. package/es/src/shapes/sceneSort.js.map +1 -0
  278. package/es/src/shapes/shapeConfig.js +31 -0
  279. package/es/src/shapes/shapeConfig.js.map +1 -0
  280. package/es/src/utils/BaseClass.js +35 -19
  281. package/es/src/utils/BaseClass.js.map +1 -1
  282. package/es/src/utils/D3Scale.js +16 -0
  283. package/es/src/utils/D3Scale.js.map +1 -0
  284. package/es/src/utils/D3plusConfig.js.map +1 -1
  285. package/es/src/utils/configPrep.js +8 -3
  286. package/es/src/utils/configPrep.js.map +1 -1
  287. package/es/src/utils/getProp.js +1 -1
  288. package/es/src/utils/getProp.js.map +1 -1
  289. package/es/src/utils/index.js +1 -0
  290. package/es/src/utils/index.js.map +1 -1
  291. package/es/src/utils/paintComponentScene.js +59 -0
  292. package/es/src/utils/paintComponentScene.js.map +1 -0
  293. package/es/umd-entry.js +16 -0
  294. package/es/umd-entry.js.map +1 -0
  295. package/package.json +14 -9
  296. package/types/index.d.ts +3 -1
  297. package/types/internal.d.ts +54 -0
  298. package/types/src/charts/AreaPlot/index.d.ts +10 -0
  299. package/types/src/charts/BarChart/index.d.ts +10 -0
  300. package/types/src/charts/BoxWhisker/index.d.ts +11 -0
  301. package/types/src/charts/BumpChart/index.d.ts +11 -0
  302. package/types/src/charts/ChartDefinition.d.ts +75 -0
  303. package/types/src/charts/Donut/index.d.ts +13 -0
  304. package/types/src/charts/Geomap/applyLayout.d.ts +7 -0
  305. package/types/src/charts/Geomap/emit.d.ts +7 -0
  306. package/types/src/charts/Geomap/index.d.ts +14 -0
  307. package/types/src/charts/Geomap.d.ts +6 -0
  308. package/types/src/charts/LinePlot/index.d.ts +10 -0
  309. package/types/src/charts/Matrix/applyLayout.d.ts +9 -0
  310. package/types/src/charts/Matrix/emit.d.ts +6 -0
  311. package/types/src/charts/Matrix/index.d.ts +14 -0
  312. package/types/src/charts/Matrix.d.ts +0 -26
  313. package/types/src/charts/Network/applyLayout.d.ts +10 -0
  314. package/types/src/charts/Network/emit.d.ts +6 -0
  315. package/types/src/charts/Network/index.d.ts +7 -0
  316. package/types/src/charts/Network.d.ts +0 -24
  317. package/types/src/charts/Pack/applyLayout.d.ts +16 -0
  318. package/types/src/charts/Pack/emit.d.ts +6 -0
  319. package/types/src/charts/Pack/index.d.ts +15 -0
  320. package/types/src/charts/Pack/recursionCircles.d.ts +7 -0
  321. package/types/src/charts/Pack.d.ts +0 -13
  322. package/types/src/charts/Pie/applyLayout.d.ts +8 -0
  323. package/types/src/charts/Pie/emit.d.ts +5 -0
  324. package/types/src/charts/Pie/index.d.ts +14 -0
  325. package/types/src/charts/Pie.d.ts +0 -27
  326. package/types/src/charts/Plot/draw.d.ts +2 -0
  327. package/types/src/charts/Plot/index.d.ts +167 -0
  328. package/types/src/charts/Plot/labelPlacement.d.ts +15 -0
  329. package/types/src/charts/Plot/pipeline.d.ts +70 -0
  330. package/types/src/charts/Plot/pipelineDomains.d.ts +2 -0
  331. package/types/src/charts/Plot/pipelineLineLabels.d.ts +2 -0
  332. package/types/src/charts/Plot/shapeDefaults.d.ts +64 -0
  333. package/types/src/charts/Plot/stackHelpers.d.ts +24 -0
  334. package/types/src/charts/Plot.d.ts +23 -72
  335. package/types/src/charts/Priestley/applyLayout.d.ts +21 -0
  336. package/types/src/charts/Priestley/emit.d.ts +6 -0
  337. package/types/src/charts/Priestley/index.d.ts +14 -0
  338. package/types/src/charts/Radar/applyLayout.d.ts +10 -0
  339. package/types/src/charts/Radar/emit.d.ts +7 -0
  340. package/types/src/charts/Radar/index.d.ts +14 -0
  341. package/types/src/charts/RadialMatrix/applyLayout.d.ts +11 -0
  342. package/types/src/charts/RadialMatrix/emit.d.ts +6 -0
  343. package/types/src/charts/RadialMatrix/index.d.ts +14 -0
  344. package/types/src/charts/RadialMatrix.d.ts +0 -15
  345. package/types/src/charts/Rings/applyLayout.d.ts +2 -0
  346. package/types/src/charts/Rings/emit.d.ts +7 -0
  347. package/types/src/charts/Rings/index.d.ts +15 -0
  348. package/types/src/charts/Rings.d.ts +0 -13
  349. package/types/src/charts/Sankey/applyLayout.d.ts +7 -0
  350. package/types/src/charts/Sankey/emit.d.ts +6 -0
  351. package/types/src/charts/Sankey/index.d.ts +7 -0
  352. package/types/src/charts/Sankey.d.ts +0 -4
  353. package/types/src/charts/StackedArea/index.d.ts +10 -0
  354. package/types/src/charts/Tree/applyLayout.d.ts +2 -0
  355. package/types/src/charts/Tree/emit.d.ts +7 -0
  356. package/types/src/charts/Tree/index.d.ts +14 -0
  357. package/types/src/charts/Tree.d.ts +0 -16
  358. package/types/src/charts/Treemap/applyLayout.d.ts +16 -0
  359. package/types/src/charts/Treemap/emit.d.ts +6 -0
  360. package/types/src/charts/Treemap/index.d.ts +18 -0
  361. package/types/src/charts/Treemap/thresholdFunction.d.ts +25 -0
  362. package/types/src/charts/Treemap.d.ts +4 -13
  363. package/types/src/charts/Viz.d.ts +49 -361
  364. package/types/src/charts/VizBase.d.ts +158 -0
  365. package/types/src/charts/VizBaseConfig.d.ts +148 -0
  366. package/types/src/charts/applyDefinition.d.ts +13 -0
  367. package/types/src/charts/axes.d.ts +134 -0
  368. package/types/src/charts/chartGeometry.d.ts +58 -0
  369. package/types/src/charts/definition/ChartDefinition.d.ts +84 -0
  370. package/types/src/charts/definition/applyDefinition.d.ts +13 -0
  371. package/types/src/charts/definition/makeChart.d.ts +22 -0
  372. package/types/src/charts/drawSteps/zoomControls.d.ts +25 -5
  373. package/types/src/charts/emitHelpers.d.ts +122 -0
  374. package/types/src/charts/ensureZoomDom.d.ts +39 -0
  375. package/types/src/charts/events/click.legend.d.ts +1 -1
  376. package/types/src/charts/events/click.shape.d.ts +1 -1
  377. package/types/src/charts/events/mouseenter.d.ts +1 -1
  378. package/types/src/charts/events/mouseleave.d.ts +1 -1
  379. package/types/src/charts/events/mousemove.legend.d.ts +1 -1
  380. package/types/src/charts/events/mousemove.shape.d.ts +1 -1
  381. package/types/src/charts/events/touchstart.body.d.ts +1 -1
  382. package/types/src/charts/factories.d.ts +73 -0
  383. package/types/src/charts/features/axes.d.ts +134 -0
  384. package/types/src/charts/features/chartGeometry.d.ts +58 -0
  385. package/types/src/charts/features/colorScaleBucket.d.ts +43 -0
  386. package/types/src/charts/features/colorScaleBucketShare.d.ts +16 -0
  387. package/types/src/charts/features/emitHelpers.d.ts +123 -0
  388. package/types/src/charts/features/ensureZoomDom.d.ts +39 -0
  389. package/types/src/charts/features/features.d.ts +152 -0
  390. package/types/src/charts/features/featuresLegend.d.ts +12 -0
  391. package/types/src/charts/features/legendLabel.d.ts +11 -0
  392. package/types/src/charts/features/lineLabels.d.ts +40 -0
  393. package/types/src/charts/features/plotPaint.d.ts +233 -0
  394. package/types/src/charts/features/shapeEmit.d.ts +61 -0
  395. package/types/src/charts/features.d.ts +152 -0
  396. package/types/src/charts/featuresLegend.d.ts +12 -0
  397. package/types/src/charts/helpers/matrixData.d.ts +1 -1
  398. package/types/src/charts/index.d.ts +21 -21
  399. package/types/src/charts/legendLabel.d.ts +11 -0
  400. package/types/src/charts/lineLabels.d.ts +40 -0
  401. package/types/src/charts/makeChart.d.ts +22 -0
  402. package/types/src/charts/pipeline/resolveSpec.d.ts +51 -0
  403. package/types/src/charts/pipeline/runChartDraw.d.ts +38 -0
  404. package/types/src/charts/pipeline/runVizPipeline.d.ts +31 -0
  405. package/types/src/charts/pipeline/stages.d.ts +160 -0
  406. package/types/src/charts/pipeline/vizContext.d.ts +45 -0
  407. package/types/src/charts/pipeline/vizDraw.d.ts +25 -0
  408. package/types/src/charts/pipeline/vizDrawPure.d.ts +46 -0
  409. package/types/src/charts/pipeline/vizPreDraw.d.ts +22 -0
  410. package/types/src/charts/pipeline/vizPreDrawPure.d.ts +68 -0
  411. package/types/src/charts/plotBuffers/Bar.d.ts +6 -5
  412. package/types/src/charts/plotBuffers/Box.d.ts +6 -5
  413. package/types/src/charts/plotBuffers/Circle.d.ts +6 -5
  414. package/types/src/charts/plotBuffers/Line.d.ts +6 -5
  415. package/types/src/charts/plotBuffers/Rect.d.ts +6 -5
  416. package/types/src/charts/plotBuffers/discreteBuffer.d.ts +2 -1
  417. package/types/src/charts/plotBuffers/numericBuffer.d.ts +2 -1
  418. package/types/src/charts/plotPaint.d.ts +233 -0
  419. package/types/src/charts/resolveSpec.d.ts +50 -0
  420. package/types/src/charts/runChartDraw.d.ts +38 -0
  421. package/types/src/charts/runVizPipeline.d.ts +31 -0
  422. package/types/src/charts/shapeEmit.d.ts +61 -0
  423. package/types/src/charts/stages.d.ts +117 -0
  424. package/types/src/charts/viz/Viz.d.ts +111 -0
  425. package/types/src/charts/viz/VizBase.d.ts +160 -0
  426. package/types/src/charts/viz/VizBaseConfig.d.ts +156 -0
  427. package/types/src/charts/viz/interactionOpacity.d.ts +23 -0
  428. package/types/src/charts/viz/ordinalColor.d.ts +14 -0
  429. package/types/src/charts/viz/trailCatchup.d.ts +14 -0
  430. package/types/src/charts/viz/vizDefaults.d.ts +8 -0
  431. package/types/src/charts/viz/vizRender.d.ts +8 -0
  432. package/types/src/charts/viz/vizTypes.d.ts +250 -0
  433. package/types/src/charts/vizContext.d.ts +46 -0
  434. package/types/src/charts/vizDefaults.d.ts +8 -0
  435. package/types/src/charts/vizDraw.d.ts +25 -0
  436. package/types/src/charts/vizDrawPure.d.ts +17 -0
  437. package/types/src/charts/vizPreDraw.d.ts +22 -0
  438. package/types/src/charts/vizPreDrawPure.d.ts +40 -0
  439. package/types/src/charts/vizRender.d.ts +8 -0
  440. package/types/src/charts/vizTypes.d.ts +202 -0
  441. package/types/src/components/Axis/Axis.d.ts +182 -0
  442. package/types/src/components/Axis/AxisBottom.d.ts +11 -0
  443. package/types/src/components/Axis/AxisLeft.d.ts +11 -0
  444. package/types/src/components/Axis/AxisRight.d.ts +11 -0
  445. package/types/src/components/Axis/AxisTop.d.ts +11 -0
  446. package/types/src/components/Axis/axisLayout.d.ts +29 -0
  447. package/types/src/components/Axis/axisLayoutLabels.d.ts +70 -0
  448. package/types/src/components/Axis/axisLayoutScale.d.ts +14 -0
  449. package/types/src/components/Axis/axisRender.d.ts +68 -0
  450. package/types/src/components/Axis.d.ts +68 -194
  451. package/types/src/components/ColorScale/ColorScale.d.ts +100 -0
  452. package/types/src/components/ColorScale/colorScaleRender.d.ts +15 -0
  453. package/types/src/components/ColorScale/colorScaleScale.d.ts +19 -0
  454. package/types/src/components/ColorScale.d.ts +1 -129
  455. package/types/src/components/Legend/Legend.d.ts +95 -0
  456. package/types/src/components/Legend/legendConfig.d.ts +7 -0
  457. package/types/src/components/Legend/legendRender.d.ts +16 -0
  458. package/types/src/components/Legend.d.ts +9 -73
  459. package/types/src/components/TextBox.d.ts +25 -218
  460. package/types/src/components/Timeline/Timeline.d.ts +118 -0
  461. package/types/src/components/Timeline/timelineConfig.d.ts +6 -0
  462. package/types/src/components/Timeline/timelineRender.d.ts +24 -0
  463. package/types/src/components/Timeline.d.ts +7 -81
  464. package/types/src/components/Tooltip.d.ts +20 -200
  465. package/types/src/components/axisLayout.d.ts +27 -0
  466. package/types/src/components/axisLayoutLabels.d.ts +42 -0
  467. package/types/src/components/axisLayoutScale.d.ts +12 -0
  468. package/types/src/components/axisRender.d.ts +65 -0
  469. package/types/src/components/colorScaleRender.d.ts +15 -0
  470. package/types/src/components/colorScaleScale.d.ts +19 -0
  471. package/types/src/components/index.d.ts +8 -8
  472. package/types/src/components/legendConfig.d.ts +7 -0
  473. package/types/src/components/legendRender.d.ts +16 -0
  474. package/types/src/components/timelineConfig.d.ts +6 -0
  475. package/types/src/components/timelineRender.d.ts +14 -0
  476. package/types/src/fluent.d.ts +94 -0
  477. package/types/src/shapes/Area.d.ts +15 -27
  478. package/types/src/shapes/Bar.d.ts +13 -33
  479. package/types/src/shapes/Box.d.ts +17 -56
  480. package/types/src/shapes/Circle.d.ts +11 -17
  481. package/types/src/shapes/Image.d.ts +18 -84
  482. package/types/src/shapes/Line.d.ts +12 -22
  483. package/types/src/shapes/Path.d.ts +12 -19
  484. package/types/src/shapes/Rect.d.ts +11 -27
  485. package/types/src/shapes/Shape.d.ts +46 -257
  486. package/types/src/shapes/Whisker.d.ts +15 -42
  487. package/types/src/shapes/buildLabelData.d.ts +50 -0
  488. package/types/src/shapes/emitLabels.d.ts +16 -0
  489. package/types/src/shapes/hitAreaNode.d.ts +19 -0
  490. package/types/src/shapes/sceneSort.d.ts +20 -0
  491. package/types/src/shapes/shapeConfig.d.ts +226 -0
  492. package/types/src/utils/BaseClass.d.ts +13 -7
  493. package/types/src/utils/D3Scale.d.ts +48 -0
  494. package/types/src/utils/D3plusConfig.d.ts +230 -3
  495. package/types/src/utils/configPrep.d.ts +7 -4
  496. package/types/src/utils/getProp.d.ts +3 -1
  497. package/types/src/utils/index.d.ts +3 -1
  498. package/types/src/utils/paintComponentScene.d.ts +28 -0
  499. package/types/umd-entry.d.ts +15 -0
  500. package/umd/d3plus-core.full.js +31148 -19484
  501. package/umd/d3plus-core.full.js.map +1 -1
  502. package/umd/d3plus-core.full.min.js +5309 -2944
  503. package/umd/d3plus-core.js +17379 -10578
  504. package/umd/d3plus-core.js.map +1 -1
  505. package/umd/d3plus-core.min.js +3470 -1876
  506. package/es/src/charts/AreaPlot.js +0 -85
  507. package/es/src/charts/AreaPlot.js.map +0 -1
  508. package/es/src/charts/BarChart.js +0 -92
  509. package/es/src/charts/BarChart.js.map +0 -1
  510. package/es/src/charts/BoxWhisker.js +0 -92
  511. package/es/src/charts/BoxWhisker.js.map +0 -1
  512. package/es/src/charts/BumpChart.js +0 -147
  513. package/es/src/charts/BumpChart.js.map +0 -1
  514. package/es/src/charts/Donut.js +0 -84
  515. package/es/src/charts/Donut.js.map +0 -1
  516. package/es/src/charts/Geomap.js +0 -766
  517. package/es/src/charts/Geomap.js.map +0 -1
  518. package/es/src/charts/LinePlot.js +0 -83
  519. package/es/src/charts/LinePlot.js.map +0 -1
  520. package/es/src/charts/Matrix.js +0 -341
  521. package/es/src/charts/Matrix.js.map +0 -1
  522. package/es/src/charts/Network.js +0 -796
  523. package/es/src/charts/Network.js.map +0 -1
  524. package/es/src/charts/Pack.js +0 -308
  525. package/es/src/charts/Pack.js.map +0 -1
  526. package/es/src/charts/Pie.js +0 -232
  527. package/es/src/charts/Pie.js.map +0 -1
  528. package/es/src/charts/Plot.js +0 -2114
  529. package/es/src/charts/Plot.js.map +0 -1
  530. package/es/src/charts/Priestley.js +0 -296
  531. package/es/src/charts/Priestley.js.map +0 -1
  532. package/es/src/charts/Radar.js +0 -420
  533. package/es/src/charts/Radar.js.map +0 -1
  534. package/es/src/charts/RadialMatrix.js +0 -383
  535. package/es/src/charts/RadialMatrix.js.map +0 -1
  536. package/es/src/charts/Rings.js +0 -788
  537. package/es/src/charts/Rings.js.map +0 -1
  538. package/es/src/charts/Sankey.js +0 -461
  539. package/es/src/charts/Sankey.js.map +0 -1
  540. package/es/src/charts/StackedArea.js +0 -80
  541. package/es/src/charts/StackedArea.js.map +0 -1
  542. package/es/src/charts/Tree.js +0 -347
  543. package/es/src/charts/Tree.js.map +0 -1
  544. package/es/src/charts/Treemap.js +0 -454
  545. package/es/src/charts/Treemap.js.map +0 -1
  546. package/es/src/charts/Viz.js +0 -1832
  547. package/es/src/charts/Viz.js.map +0 -1
  548. package/es/src/charts/drawSteps/drawAttribution.js +0 -16
  549. package/es/src/charts/drawSteps/drawAttribution.js.map +0 -1
  550. package/es/src/charts/drawSteps/drawBack.js +0 -24
  551. package/es/src/charts/drawSteps/drawBack.js.map +0 -1
  552. package/es/src/charts/drawSteps/drawColorScale.js +0 -75
  553. package/es/src/charts/drawSteps/drawColorScale.js.map +0 -1
  554. package/es/src/charts/drawSteps/drawLegend.js +0 -122
  555. package/es/src/charts/drawSteps/drawLegend.js.map +0 -1
  556. package/es/src/charts/drawSteps/drawSubtitle.js +0 -31
  557. package/es/src/charts/drawSteps/drawSubtitle.js.map +0 -1
  558. package/es/src/charts/drawSteps/drawTimeline.js +0 -85
  559. package/es/src/charts/drawSteps/drawTimeline.js.map +0 -1
  560. package/es/src/charts/drawSteps/drawTitle.js +0 -31
  561. package/es/src/charts/drawSteps/drawTitle.js.map +0 -1
  562. package/es/src/charts/drawSteps/drawTotal.js +0 -32
  563. package/es/src/charts/drawSteps/drawTotal.js.map +0 -1
  564. package/es/src/components/Axis.js +0 -1457
  565. package/es/src/components/Axis.js.map +0 -1
  566. package/es/src/components/AxisBottom.js.map +0 -1
  567. package/es/src/components/AxisLeft.js.map +0 -1
  568. package/es/src/components/AxisRight.js.map +0 -1
  569. package/es/src/components/AxisTop.js.map +0 -1
  570. package/es/src/components/ColorScale.js +0 -843
  571. package/es/src/components/ColorScale.js.map +0 -1
  572. package/es/src/components/Legend.js +0 -622
  573. package/es/src/components/Legend.js.map +0 -1
  574. package/es/src/components/Timeline.js +0 -695
  575. package/es/src/components/Timeline.js.map +0 -1
  576. /package/es/src/components/{AxisBottom.js → Axis/AxisBottom.js} +0 -0
  577. /package/es/src/components/{AxisLeft.js → Axis/AxisLeft.js} +0 -0
  578. /package/es/src/components/{AxisRight.js → Axis/AxisRight.js} +0 -0
  579. /package/es/src/components/{AxisTop.js → Axis/AxisTop.js} +0 -0
@@ -0,0 +1,39 @@
1
+ /**
2
+ `ensureZoomDom(viz, kind)` — sets up the inner `<svg>` + zoom group +
3
+ hitArea that d3-zoom and tile-loading need.
4
+
5
+ This is the lifecycle half of v4 zoom support. The CONTROLS (zoom-in/
6
+ zoom-out/etc.) ride the scene graph as an HtmlOverlay (see
7
+ `drawSteps/zoomControls.ts`). The zoom-transform application also
8
+ rides the scene graph (`viz._zoomTransform` composed into
9
+ `Viz.toScene()`). But d3-zoom's *event binding* needs a real DOM
10
+ element to bind to, and Geomap's tile-loading mutates the inner
11
+ `<g>` directly — so this helper exists as the documented home for
12
+ that imperative setup.
13
+
14
+ Idempotent: calling it again returns the existing nodes. Mutates the
15
+ viz instance with `_container` / `_zoomGroup` (and the Network
16
+ variant also wires the hitArea click handler).
17
+
18
+ The helper stays as long as d3-zoom owns event binding and Geomap's
19
+ tile-loading mounts `<g>` elements directly. An eventual fully
20
+ scene-graph-native interaction path (renderer.on(...) dispatch +
21
+ tile-data → image scene nodes) would let this go away; until then,
22
+ it's the documented home for the imperative half of v4 zoom.
23
+ */
24
+ import type { VizInstance as Viz } from "./vizTypes.js";
25
+ export type ZoomDomKind = "network" | "geomap";
26
+ interface SetupOpts {
27
+ /** "network" or "geomap" — picks the css class + behavior tweaks. */
28
+ kind: ZoomDomKind;
29
+ /** Chart-area width (margin-adjusted). */
30
+ width: number;
31
+ /** Chart-area height (margin-adjusted). */
32
+ height: number;
33
+ /** Transition duration for fade-in. */
34
+ duration: number;
35
+ /** Geomap-only: ocean fill color (also used as the svg background). */
36
+ ocean?: string;
37
+ }
38
+ export declare function ensureZoomDom(viz: Viz, opts: SetupOpts): void;
39
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { DataPoint } from "@d3plus/data";
2
- import type Viz from "../Viz.js";
2
+ import type Viz from "../viz/Viz.js";
3
3
  /**
4
4
  @module clickLegend
5
5
  On click event for all legend shapes in a Viz.
@@ -1,5 +1,5 @@
1
1
  import type { DataPoint } from "@d3plus/data";
2
- import type Viz from "../Viz.js";
2
+ import type Viz from "../viz/Viz.js";
3
3
  /**
4
4
  @module clickShape
5
5
  On click event for all shapes in a Viz.
@@ -1,5 +1,5 @@
1
1
  import type { DataPoint } from "@d3plus/data";
2
- import type Viz from "../Viz.js";
2
+ import type Viz from "../viz/Viz.js";
3
3
  /**
4
4
  @module mouseEnter
5
5
  On mouseenter event for all shapes in a Viz.
@@ -1,5 +1,5 @@
1
1
  import type { DataPoint } from "@d3plus/data";
2
- import type Viz from "../Viz.js";
2
+ import type Viz from "../viz/Viz.js";
3
3
  /**
4
4
  @module mouseLeave
5
5
  On mouseleave event for all shapes in a Viz.
@@ -1,5 +1,5 @@
1
1
  import type { DataPoint } from "@d3plus/data";
2
- import type Viz from "../Viz.js";
2
+ import type Viz from "../viz/Viz.js";
3
3
  /**
4
4
  @module mouseMoveLegend
5
5
  Tooltip logic for a specified data point.
@@ -1,5 +1,5 @@
1
1
  import type { DataPoint } from "@d3plus/data";
2
- import type Viz from "../Viz.js";
2
+ import type Viz from "../viz/Viz.js";
3
3
  /**
4
4
  @module mouseMoveShape
5
5
  Tooltip logic for a specified data point.
@@ -1,4 +1,4 @@
1
- import type Viz from "../Viz.js";
1
+ import type Viz from "../viz/Viz.js";
2
2
  /**
3
3
  @module touchStartBody
4
4
  On touchstart event for the Body element.
@@ -0,0 +1,73 @@
1
+ /**
2
+ Factory functions for each chart — the v4 RFC §3.3 / strangler step 4
3
+ surface. Today these are thin aliases over the existing class
4
+ constructors so consumers can write `barChart().data(...).render()`
5
+ instead of `new BarChart().data(...).render()`.
6
+
7
+ The factories are the **stable v4 entry point.** Class constructors
8
+ (`new BarChart()`) remain working byte-for-byte through all of v4 (per
9
+ RFC §8.6, deprecated with a v5 removal horizon). When the eventual
10
+ decoupling lands (extract `runPipeline(def, config)` as a free function;
11
+ remove the class hierarchy), the factories' return value gets swapped
12
+ transparently — consumer code unchanged.
13
+
14
+ The conformance test (`test/charts/BarChart-config-snapshot-test.js`)
15
+ asserts `barChart().config()` reproduces `new BarChart().config()` byte-
16
+ for-byte, so any future refactor that drifts from the class behavior
17
+ fails the test.
18
+
19
+ NAMING CLASHES with d3 modules — three factories share lowercase names
20
+ with d3 modules: `pack` (d3-hierarchy), `pie` (d3-shape), `tree`
21
+ (d3-hierarchy). If you import both in the same file:
22
+
23
+ import {pack as d3Pack} from "d3-hierarchy";
24
+ import {pack} from "@d3plus/core";
25
+
26
+ use renamed aliases or namespace imports (`import * as d3p from
27
+ "@d3plus/core"`). The Pascal-cased class exports
28
+ (`Pack`/`Pie`/`Tree`) don't clash and remain available.
29
+
30
+ @module
31
+ */
32
+ import AreaPlot from "./AreaPlot.js";
33
+ import BarChart from "./BarChart.js";
34
+ import BoxWhisker from "./BoxWhisker.js";
35
+ import BumpChart from "./BumpChart.js";
36
+ import Donut from "./Donut.js";
37
+ import Geomap from "./Geomap.js";
38
+ import LinePlot from "./LinePlot.js";
39
+ import Matrix from "./Matrix.js";
40
+ import Network from "./Network.js";
41
+ import Pack from "./Pack.js";
42
+ import Pie from "./Pie.js";
43
+ import Plot from "./Plot.js";
44
+ import Priestley from "./Priestley.js";
45
+ import Radar from "./Radar.js";
46
+ import RadialMatrix from "./RadialMatrix.js";
47
+ import Rings from "./Rings.js";
48
+ import Sankey from "./Sankey.js";
49
+ import StackedArea from "./StackedArea.js";
50
+ import Tree from "./Tree.js";
51
+ import Treemap from "./Treemap.js";
52
+ import Viz from "./Viz.js";
53
+ export declare const areaPlot: () => AreaPlot;
54
+ export declare const barChart: () => BarChart;
55
+ export declare const boxWhisker: () => BoxWhisker;
56
+ export declare const bumpChart: () => BumpChart;
57
+ export declare const donut: () => Donut;
58
+ export declare const geomap: () => Geomap;
59
+ export declare const linePlot: () => LinePlot;
60
+ export declare const matrix: () => Matrix;
61
+ export declare const network: () => Network;
62
+ export declare const pack: () => Pack;
63
+ export declare const pie: () => Pie;
64
+ export declare const plot: () => Plot;
65
+ export declare const priestley: () => Priestley;
66
+ export declare const radar: () => Radar;
67
+ export declare const radialMatrix: () => RadialMatrix;
68
+ export declare const rings: () => Rings;
69
+ export declare const sankey: () => Sankey;
70
+ export declare const stackedArea: () => StackedArea;
71
+ export declare const tree: () => Tree;
72
+ export declare const treemap: () => Treemap;
73
+ export declare const viz: () => Viz;
@@ -0,0 +1,134 @@
1
+ /**
2
+ The Plot-family axes module: the production-axis render + joint range
3
+ solve, factored out of the Plot paint phase so any viz that lays out
4
+ against d3plus `Axis` instances can reuse it.
5
+
6
+ Plot's four axes (`x`/`x2`/`y`/`y2`) are NOT four independent margin
7
+ claims — they are a single coupled solve. The y-axis label width sets
8
+ where the x range starts (`xOffsetLeft = max([yWidth, …])`); the
9
+ x2-axis height shifts the y range's top and the whole chart transform;
10
+ the x range start in turn moves where the y axis sits (`xTrans`). So
11
+ this module owns the joint solve internally and reports one unit, rather
12
+ than exposing four separable features.
13
+
14
+ The module exposes the joint solve as two halves:
15
+
16
+ - `measureAxes` — the MEASURE half: throwaway test axes measure label
17
+ widths/heights, the coupled offsets are solved
18
+ (`xOffsetLeft = max([yWidth, …])`, `x2Height`, `topOffset`,
19
+ `xHeight`), and the four-side claim is written to `viz._padding.*`
20
+ and returned. Runs BEFORE the base `Viz` draw finalizes margins.
21
+ The line-label width measure interleaves mid-solve via an injected
22
+ callback (it is Plot-pipeline-specific, so the axes module doesn't
23
+ own it).
24
+ - `renderAxes` — the EMIT half: runs AFTER margins are finalized,
25
+ rendering the production axes
26
+ (`viz._xAxis`/`_yAxis`/`_x2Axis`/`_y2Axis`) in compute mode against
27
+ the final ranges, setting `viz._xFunc`/`_yFunc` (with their
28
+ log-scale zero handling), and queueing the axis scene nodes for the
29
+ caller to drain after the shape loop (so axes layer above shapes).
30
+
31
+ Both halves degrade to a single axis (or any subset) through the
32
+ `showX`/`showY`/`x2Exists`/`y2Exists` guards: a consumer that wants only
33
+ an x-axis passes the other sides' flags as `false`, and the `max([…])`
34
+ offsets collapse accordingly.
35
+
36
+ @module
37
+ */
38
+ import type Axis from "../../components/Axis/Axis.js";
39
+ import type { LabelWidth, PlotMeasureResult, PlotPaintContext } from "./plotPaint.js";
40
+ import type { VizInstance as Viz } from "../viz/vizTypes.js";
41
+ /** A measured axis's outer bounding box. */
42
+ type AxisBounds = {
43
+ width: number;
44
+ height: number;
45
+ x: number;
46
+ y: number;
47
+ };
48
+ /**
49
+ The line-label measurement the joint solve interleaves between the first
50
+ and second x-axis measure passes. Plot supplies this via a callback that
51
+ runs the `measurePlotLineLabels` pipeline stage; a consumer with no line
52
+ labels returns empty widths and an undefined `xRangeMax`.
53
+ */
54
+ export interface LineLabelMeasurement {
55
+ labelWidths: LabelWidth[];
56
+ largestLabel: number | undefined;
57
+ xRangeMax: number | undefined;
58
+ }
59
+ /**
60
+ The stable per-draw inputs the joint margin solve reads — exactly the
61
+ values the Plot pipeline stages (`computePlotScales`,
62
+ `preparePlotAxisLayout`) already produce. The four `*Test` axes are
63
+ throwaway instances the caller allocates per draw; `measureAxes`
64
+ configures and measures them, then the caller discards them.
65
+ */
66
+ export interface AxisMeasureInputs {
67
+ xTest: Axis;
68
+ yTest: Axis;
69
+ x2Test: Axis;
70
+ y2Test: Axis;
71
+ xDomain: number[];
72
+ x2Domain: number[];
73
+ yDomain: number[];
74
+ y2Domain: number[];
75
+ xTicks: unknown[] | null;
76
+ x2Ticks: unknown[] | null;
77
+ yTicks: unknown[] | null;
78
+ y2Ticks: unknown[] | null;
79
+ xConfigScale: string;
80
+ x2ConfigScale: string;
81
+ yConfigScale: string;
82
+ y2ConfigScale: string;
83
+ defaultX2Config: Record<string, unknown>;
84
+ defaultY2Config: Record<string, unknown>;
85
+ yC: Record<string, unknown>;
86
+ showX: boolean;
87
+ showY: boolean;
88
+ x2Exists: boolean;
89
+ y2Exists: boolean;
90
+ height: number;
91
+ width: number;
92
+ xData: unknown[];
93
+ /** `x.padding()` when the x scale is banded, else 0 — feeds the x config. */
94
+ xScalePadding: number;
95
+ }
96
+ /** The four-side margin claim + offsets the joint solve produces. */
97
+ export interface AxisMeasureResult {
98
+ yBounds: AxisBounds;
99
+ y2Bounds: AxisBounds;
100
+ yWidth: number | undefined;
101
+ y2Width: number | undefined;
102
+ xC: Record<string, unknown>;
103
+ xRangeMax: number | undefined;
104
+ labelWidths: LabelWidth[];
105
+ largestLabel: number | undefined;
106
+ xTestRange: number[];
107
+ x2TestRange: number[];
108
+ x2Height: number;
109
+ xOffsetLeft: number;
110
+ xOffsetRight: number;
111
+ topOffset: number;
112
+ xHeight: number;
113
+ }
114
+ /**
115
+ MEASURE half of the joint axis solve. Configures + measures the four
116
+ throwaway test axes, solves the coupled offsets, writes the resulting
117
+ four-side claim to `viz._padding.*`, and returns the offsets + the
118
+ measured bounds + the line-label measurement for the paint phase.
119
+
120
+ `measureLineLabels` is invoked once, after the first x-axis measure and
121
+ before the re-measure, so its `xRangeMax` can re-bound the x range.
122
+ */
123
+ export declare function measureAxes(viz: Viz, inputs: AxisMeasureInputs, measureLineLabels: () => LineLabelMeasurement): AxisMeasureResult;
124
+ /**
125
+ Render the production axes and solve the final ranges/offsets.
126
+
127
+ Reads `pCtx`, runs each production-mode axis through
128
+ `renderMode("compute").select(null).render()`, computes the final
129
+ `xRange`/`yRange` + offsets, sets `viz._xFunc` / `viz._yFunc` accessors,
130
+ bumps the line labels, and queues axis scenes for the emit phase.
131
+ Returns everything `plotEmit` needs to consume.
132
+ */
133
+ export declare function renderAxes(viz: Viz, pCtx: PlotPaintContext): PlotMeasureResult;
134
+ export {};
@@ -0,0 +1,58 @@
1
+ /**
2
+ Shared geometry helpers for chart `_draw` methods and layout stages.
3
+
4
+ Three patterns repeat across every chart subclass + layout stage:
5
+
6
+ 1. Compute the margin-adjusted chart-area width/height.
7
+ 2. Compute the chart's `_chartTransform` (where the chart-cells
8
+ group sits relative to the svg origin).
9
+ 3. Pull the nested data slice for the current draw depth.
10
+
11
+ Centralizing these into one module:
12
+ - removes 14+ lines of duplication across the codebase
13
+ - gives one place to fix coord-system bugs
14
+ - makes the chart classes' `_draw` bodies easier to scan
15
+ - removes the temptation to inline a slightly-different variant
16
+
17
+ @module
18
+ */
19
+ import type { Transform } from "@d3plus/render";
20
+ import type { VizInstance as Viz } from "../viz/vizTypes.js";
21
+ /**
22
+ Margin-adjusted chart-area dimensions. Replaces the pattern:
23
+
24
+ const height = viz.schema.height - viz._margin.top - viz._margin.bottom;
25
+ const width = viz.schema.width - viz._margin.left - viz._margin.right;
26
+ */
27
+ export declare function chartBounds(viz: Viz): {
28
+ width: number;
29
+ height: number;
30
+ };
31
+ /**
32
+ Build a `_chartTransform` that places the chart-cells group at the
33
+ margin origin. Replaces the pattern:
34
+
35
+ this._chartTransform = {x: this._margin.left, y: this._margin.top};
36
+
37
+ Used by Tree, Network, Rings, Sankey, Treemap, etc. — every
38
+ rectangular chart whose data lays out from the top-left of the
39
+ chart area.
40
+ */
41
+ export declare function marginOriginTransform(viz: Viz): Transform;
42
+ /**
43
+ Build a `_chartTransform` that centers the chart-cells group within
44
+ the chart area. Replaces the pattern:
45
+
46
+ this._chartTransform = {
47
+ x: this._margin.left + width / 2,
48
+ y: this._margin.top + height / 2,
49
+ };
50
+
51
+ Used by Pie, Donut, RadialMatrix, Radar — every chart whose data
52
+ lays out around a center point (polar / circular geometry).
53
+
54
+ Width and height are the margin-adjusted chart-area dimensions —
55
+ callers usually have them on hand from `chartBounds(viz)` or from
56
+ fields a stage stashed (e.g. `_pieWidth` / `_radialMatrixWidth`).
57
+ */
58
+ export declare function centerChartTransform(viz: Viz, width: number, height: number): Transform;
@@ -0,0 +1,43 @@
1
+ import type { DataPoint } from "@d3plus/data";
2
+ import type { VizInstance } from "../viz/vizTypes.js";
3
+ /**
4
+ Sums the share (size fraction of the grand total) of every datum whose
5
+ ColorScale value falls in `bucketColor`'s range, so a chart tooltip
6
+ (Treemap, Pie) can report the aggregate share of a hovered colorScale
7
+ swatch instead of a blank row.
8
+
9
+ Computed at hover time from the colorScale's own data + threshold scale —
10
+ NOT from a pre-stamped `share` — because the colorScale lays out before
11
+ the chart's layout stage writes `share`, so no per-row share exists yet
12
+ when the swatch is built. `sizeFn` is the chart's size metric (Treemap's
13
+ `sum`, Pie's `value`). Returns null when there's no colorScale to read or
14
+ the total is zero.
15
+ */
16
+ export declare function colorScaleBucketShare(viz: VizInstance, bucketColor: unknown, sizeFn: (d: DataPoint, i: number) => number): number | null;
17
+ /**
18
+ Unwraps a scene/handler datum to its colorScale-bucket source, or null when
19
+ it isn't a bucket. A swatch (or its label) reaches a handler wrapped one or
20
+ more levels deep (label → shape-row → bucket), so walk the `__d3plus__`
21
+ chain before reading `_isColorScaleBucket`. Shared by `mouseenter` (to build
22
+ the highlight predicate) and the chart `mousemove.shape` overrides (to skip
23
+ their row/column hover so the bucket highlight isn't clobbered on move).
24
+ */
25
+ export declare function colorScaleBucketOf(d: unknown): (DataPoint & {
26
+ color?: unknown;
27
+ }) | null;
28
+ /**
29
+ Predicate matching every datum whose ColorScale value falls in
30
+ `bucketColor`'s range — used to highlight the data shapes when a colorScale
31
+ swatch is hovered (it has no groupBy id to match on, unlike a normal
32
+ legend). Returns null when there's no colorScale to read.
33
+ */
34
+ export declare function colorScaleBucketPredicate(viz: VizInstance, bucketColor: unknown): ((d: DataPoint, i: number) => boolean) | null;
35
+ /**
36
+ The set of bucket colors that contain at least one datum satisfying
37
+ `predicate` — i.e. the swatches that should stay bright while the rest dim.
38
+ Lets the colorScale self-dim consistently for any hover source: hovering a
39
+ swatch lights only that color; hovering a data shape (or legend item)
40
+ lights the swatch whose range contains it. Returns null without a
41
+ colorScale.
42
+ */
43
+ export declare function activeBucketColors(viz: VizInstance, predicate: (d: DataPoint, i: number) => boolean): Set<unknown> | null;
@@ -0,0 +1,16 @@
1
+ import type { DataPoint } from "@d3plus/data";
2
+ import type { VizInstance } from "../viz/vizTypes.js";
3
+ /**
4
+ Sums the share (size fraction of the grand total) of every datum whose
5
+ ColorScale value falls in `bucketColor`'s range, so a chart tooltip
6
+ (Treemap, Pie) can report the aggregate share of a hovered colorScale
7
+ swatch instead of a blank row.
8
+
9
+ Computed at hover time from the colorScale's own data + threshold scale —
10
+ NOT from a pre-stamped `share` — because the colorScale lays out before
11
+ the chart's layout stage writes `share`, so no per-row share exists yet
12
+ when the swatch is built. `sizeFn` is the chart's size metric (Treemap's
13
+ `sum`, Pie's `value`). Returns null when there's no colorScale to read or
14
+ the total is zero.
15
+ */
16
+ export declare function colorScaleBucketShare(viz: VizInstance, bucketColor: unknown, sizeFn: (d: DataPoint, i: number) => number): number | null;
@@ -0,0 +1,123 @@
1
+ /**
2
+ Helpers for `ChartDefinition.emit` functions.
3
+
4
+ Most chart-as-data emits follow the same shape-compute pattern:
5
+ instantiate a Shape (Rect/Circle/Path/…) in `renderMode("compute")`,
6
+ feed it the laid-out data + per-emit config + viz-level shapeConfig,
7
+ call `render()` (which short-circuits before DOM mutation in compute
8
+ mode but populates internal state), then extract:
9
+
10
+ - the shape's own scene via `shape.toScene().children`
11
+ - its labels via `shape._labelClass.toScene().children`
12
+
13
+ These two helpers reduce that boilerplate to a single call and
14
+ centralize the `configPrep.bind(viz)(viz.schema.shapeConfig, "shape", key)`
15
+ incantation. The helpers swallow exceptions (returning `[]`) to
16
+ preserve the existing pure-Node fallback: tests that run without
17
+ loading the shape registry continue to see an empty emit instead
18
+ of crashing.
19
+
20
+ @module
21
+ */
22
+ import type { DataPoint } from "@d3plus/data";
23
+ import type { GroupNode, SceneNode } from "@d3plus/render";
24
+ import * as shapes from "../../shapes/index.js";
25
+ /** Construct a shape instance by its registry key (e.g. "Bar", "Line"). */
26
+ export declare const makeShape: (key: string) => shapes.Shape;
27
+ /**
28
+ Structural minimum a Shape (or shape-like component: TextBox, Axis)
29
+ must satisfy for the helpers below to work with it. Captures only the
30
+ members the helpers touch — `render()`, optional `toScene()`, and an
31
+ optional inner `_labelClass` with its own `toScene()`.
32
+
33
+ Replaces the previous `shape: any` parameter on `collectComputed` and
34
+ `absorbShapeIntoChartScene` — both helpers consume the same surface
35
+ regardless of whether the actual instance is a `Shape` subclass, a
36
+ `TextBox`, an `Axis`, or anything else that exposes these members.
37
+ */
38
+ export interface ShapeLike {
39
+ render(): unknown;
40
+ toScene?: () => GroupNode | null | undefined;
41
+ _labelClass?: {
42
+ toScene?: () => GroupNode | null | undefined;
43
+ };
44
+ }
45
+ /**
46
+ Structural minimum a Viz instance must satisfy for these helpers to
47
+ work. Each chart subclass has many more fields; the helpers only need
48
+ `_chartScene` (mutated by `absorbShapeIntoChartScene`) and
49
+ `schema.shapeConfig` (read by `shapeConfigFor`'s default-config branch).
50
+ */
51
+ export interface VizLike {
52
+ _chartScene?: SceneNode[];
53
+ schema: Record<string, unknown>;
54
+ }
55
+ /**
56
+ Resolve a per-datum accessor — either a function `(d, i) => T` or a bare
57
+ value. The pattern repeats in every flat-data emit (Treemap, Pack, Pie,
58
+ Priestley, …). Centralized here so each emit doesn't need its own copy.
59
+ */
60
+ export declare function resolveAccessor<T>(val: unknown, d: DataPoint, i: number | undefined): T | undefined;
61
+ /**
62
+ Resolve the standard paint properties (`fill`, `stroke`, `strokeWidth`,
63
+ `opacity`) from a shape-config record for a single datum. Returns a
64
+ `Paint`-shaped object compatible with `SceneNode.paint`. `fill` is
65
+ forced to `string | undefined` to match `Paint.fill` (texture/object
66
+ fills fall through to `undefined`; the existing flat-data emits already
67
+ do this same coercion).
68
+ */
69
+ export declare function paintFromShapeConfig(sc: Record<string, unknown>, d: DataPoint, i: number | undefined): {
70
+ fill?: string;
71
+ stroke?: string;
72
+ strokeWidth?: number;
73
+ opacity?: number;
74
+ vectorEffect?: "none" | "non-scaling-stroke";
75
+ };
76
+ /**
77
+ Apply a shape-config object to a chart-specific shape key, returning the
78
+ configPrep-massaged object suitable for `.config(...)`. Equivalent to
79
+ `(configPrep as any).bind(viz)(config, "shape", key)`. When `config` is
80
+ omitted it defaults to `viz.schema.shapeConfig` (the common case — 11 sites);
81
+ callers that compose a transient config object (e.g. Plot's confidence
82
+ bands) pass it explicitly.
83
+
84
+ `kind` is the second `configPrep` argument (the property to filter by).
85
+ Defaults to `"shape"` — the standard call shape. Network's link config
86
+ uses `"edge"` instead.
87
+ */
88
+ export declare function shapeConfigFor(viz: VizLike, shapeKey: string, config?: Record<string, unknown>, kind?: string): Record<string, unknown>;
89
+ /**
90
+ Run `shape.render()` in compute mode and collect the resulting scene
91
+ nodes — shape children and/or label children — in a single flat array.
92
+ Returns `[]` if `shape` is missing or rendering throws (pure-Node
93
+ fallback for tests that don't load the shape registry).
94
+
95
+ @param shape A shape instance already configured (data, accessors,
96
+ config) and set to `renderMode("compute")`.
97
+ @param opts.shape Include `shape.toScene().children` (default true).
98
+ @param opts.labels Include `shape._labelClass.toScene().children`
99
+ (default true).
100
+ */
101
+ export declare function collectComputed(shape: ShapeLike | null | undefined, opts?: {
102
+ shape?: boolean;
103
+ labels?: boolean;
104
+ }): SceneNode[];
105
+ /**
106
+ Push a compute-mode shape's scene nodes onto `viz._chartScene`. Used
107
+ inside chart-specific layout stages that need to mount axis decorations,
108
+ background rects, or other helper geometry alongside the main shape
109
+ emit. The shape MUST already be in `renderMode("compute")`; this helper
110
+ calls `shape.render()` and then absorbs both the shape and label scenes.
111
+
112
+ Lives here (not in Plot.ts) so any chart stage can call it. Optionally
113
+ wraps the absorbed nodes in a group with the given key + transform,
114
+ useful when the decoration needs its own coordinate system that's
115
+ distinct from the chart-wide `_chartTransform`.
116
+ */
117
+ export declare function absorbShapeIntoChartScene(viz: VizLike, shape: ShapeLike | null | undefined, wrap?: {
118
+ key: string;
119
+ transform?: {
120
+ x: number;
121
+ y: number;
122
+ };
123
+ }): void;
@@ -0,0 +1,39 @@
1
+ /**
2
+ `ensureZoomDom(viz, kind)` — sets up the inner `<svg>` + zoom group +
3
+ hitArea that d3-zoom and tile-loading need.
4
+
5
+ This is the lifecycle half of v4 zoom support. The CONTROLS (zoom-in/
6
+ zoom-out/etc.) ride the scene graph as an HtmlOverlay (see
7
+ `drawSteps/zoomControls.ts`). The zoom-transform application also
8
+ rides the scene graph (`viz._zoomTransform` composed into
9
+ `Viz.toScene()`). But d3-zoom's *event binding* needs a real DOM
10
+ element to bind to, and Geomap's tile-loading mutates the inner
11
+ `<g>` directly — so this helper exists as the documented home for
12
+ that imperative setup.
13
+
14
+ Idempotent: calling it again returns the existing nodes. Mutates the
15
+ viz instance with `_container` / `_zoomGroup` (and the Network
16
+ variant also wires the hitArea click handler).
17
+
18
+ The helper stays as long as d3-zoom owns event binding and Geomap's
19
+ tile-loading mounts `<g>` elements directly. An eventual fully
20
+ scene-graph-native interaction path (renderer.on(...) dispatch +
21
+ tile-data → image scene nodes) would let this go away; until then,
22
+ it's the documented home for the imperative half of v4 zoom.
23
+ */
24
+ import type { VizInstance as Viz } from "../viz/vizTypes.js";
25
+ export type ZoomDomKind = "network" | "geomap";
26
+ interface SetupOpts {
27
+ /** "network" or "geomap" — picks the css class + behavior tweaks. */
28
+ kind: ZoomDomKind;
29
+ /** Chart-area width (margin-adjusted). */
30
+ width: number;
31
+ /** Chart-area height (margin-adjusted). */
32
+ height: number;
33
+ /** Transition duration for fade-in. */
34
+ duration: number;
35
+ /** Geomap-only: ocean fill color (also used as the svg background). */
36
+ ocean?: string;
37
+ }
38
+ export declare function ensureZoomDom(viz: Viz, opts: SetupOpts): void;
39
+ export {};