@d3plus/core 3.1.6 → 4.1.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 +9924 -78528
  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 +655 -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 +84 -35
  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 +125 -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 +15 -10
  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 +157 -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 +270 -15
  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 +30966 -19051
  501. package/umd/d3plus-core.full.js.map +1 -1
  502. package/umd/d3plus-core.full.min.js +5400 -2949
  503. package/umd/d3plus-core.js +17364 -10534
  504. package/umd/d3plus-core.js.map +1 -1
  505. package/umd/d3plus-core.min.js +3494 -1877
  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
@@ -1,34 +1,18 @@
1
1
  import { transition } from "d3-transition";
2
2
  import type { D3Selection } from "@d3plus/dom";
3
+ import type { GroupNode } from "@d3plus/render";
3
4
  import { TextBox } from "../components/index.js";
4
5
  import { BaseClass } from "../utils/index.js";
5
6
  /**
6
7
  Creates an SVG scale based on an array of data.
7
8
  */
8
9
  export default class Axis extends BaseClass {
10
+ [key: string]: any;
9
11
  _select: D3Selection;
10
- _align: string;
11
- _barConfig: Record<string, unknown>;
12
12
  _data: any[];
13
- _domain: any[];
14
- _duration: number;
15
- _gridConfig: Record<string, unknown>;
16
- _gridLog: boolean;
17
- _gridSize: number | undefined;
18
- _grid: unknown[] | undefined;
19
- _height: number;
20
- _labelOffset: boolean;
21
13
  _labelRotation: boolean | undefined;
22
- _labels: unknown[] | undefined;
23
- _locale: any;
24
14
  _margin: Record<string, number>;
25
- _maxSize: number;
26
- _minSize: number;
27
- _orient: string;
28
15
  _outerBounds: Record<string, number>;
29
- _padding: number;
30
- _paddingInner: number;
31
- _paddingOuter: number;
32
16
  _position: {
33
17
  horizontal: boolean;
34
18
  width: string;
@@ -37,26 +21,15 @@ export default class Axis extends BaseClass {
37
21
  y: string;
38
22
  opposite: string;
39
23
  };
40
- _range: (number | undefined)[] | undefined;
41
- _rounding: string;
42
- _roundingInsideMinPrefix: string;
43
- _roundingInsideMinSuffix: string;
44
- _roundingInsideMaxPrefix: string;
45
- _roundingInsideMaxSuffix: string;
46
- _scale: string;
47
- _scalePadding: number;
48
- _shape: string;
49
- _shapeConfig: Record<string, any>;
50
- _tickFormat: any;
51
- _ticks: unknown[] | undefined;
52
- _tickSize: number;
53
- _tickSuffix: string;
54
24
  _tickUnit: number;
55
- _timeLocale: Record<string, unknown> | undefined;
56
- _title: string | undefined;
57
25
  _titleClass: TextBox;
58
- _titleConfig: Record<string, any>;
59
- _width: number;
26
+ _tickShape?: {
27
+ toScene?: () => GroupNode;
28
+ _data?: unknown[];
29
+ } | any;
30
+ _gridLineData?: {
31
+ id: unknown;
32
+ }[];
60
33
  _d3Scale: any;
61
34
  _d3ScaleNegative: any;
62
35
  _group: D3Selection;
@@ -70,11 +43,6 @@ export default class Axis extends BaseClass {
70
43
  @private
71
44
  */
72
45
  constructor();
73
- /**
74
- Sets positioning for the axis bar.
75
- @param bar @private
76
- */
77
- _barPosition(bar: any): void;
78
46
  /**
79
47
  Returns the scale's domain, taking into account negative and positive log scales.
80
48
  @private
@@ -101,20 +69,16 @@ export default class Axis extends BaseClass {
101
69
  */
102
70
  _getTicks(): unknown[];
103
71
  /**
104
- Sets positioning for the grid lines.
105
- @param lines @private
72
+ Produces a backend-agnostic scene graph for this axis with no DOM dependency:
73
+ gridlines + domain bar emitted natively, tick marks/labels composed from the
74
+ tick Shape's toScene(), and the title from the title TextBox's toScene().
106
75
  */
107
- _gridPosition(lines: any, last?: boolean): void;
76
+ toScene(): GroupNode;
108
77
  /**
109
78
  Renders the current Axis to the page.
110
79
  @param callback Optional callback invoked after rendering completes.
111
80
  */
112
81
  render(callback?: (...args: unknown[]) => unknown): this;
113
- /**
114
- The horizontal alignment.
115
- */
116
- align(): string;
117
- align(_: string): this;
118
82
  /**
119
83
  Axis line style.
120
84
  */
@@ -125,66 +89,16 @@ export default class Axis extends BaseClass {
125
89
  */
126
90
  data(): any[];
127
91
  data(_: any[]): this;
128
- /**
129
- Scale domain of the axis.
130
- */
131
- domain(): any[];
132
- domain(_: any[]): this;
133
- /**
134
- Transition duration of the axis.
135
- */
136
- duration(): number;
137
- duration(_: number): this;
138
- /**
139
- Grid values of the axis.
140
- */
141
- grid(): unknown[] | undefined;
142
- grid(_: unknown[]): this;
143
92
  /**
144
93
  Grid config of the axis.
145
94
  */
146
95
  gridConfig(): Record<string, unknown>;
147
96
  gridConfig(_: Record<string, unknown>): this;
148
- /**
149
- Grid behavior of the axis when scale is logarithmic.
150
- */
151
- gridLog(): boolean;
152
- gridLog(_: boolean): this;
153
- /**
154
- Grid size of the axis.
155
- */
156
- gridSize(): number | undefined;
157
- gridSize(_: number): this;
158
- /**
159
- Overall height of the axis.
160
- */
161
- height(): number;
162
- height(_: number): this;
163
- /**
164
- Visible tick labels of the axis.
165
- */
166
- labels(): unknown[] | undefined;
167
- labels(_: unknown[]): this;
168
- /**
169
- Whether to offset overlapping labels further from the axis to prevent collisions.
170
- */
171
- labelOffset(): boolean;
172
- labelOffset(_: boolean): this;
173
97
  /**
174
98
  Whether to rotate horizontal axis labels -90 degrees.
175
99
  */
176
100
  labelRotation(): boolean | undefined;
177
101
  labelRotation(_: boolean): this;
178
- /**
179
- Maximum size allowed for the space that contains the axis tick labels and title.
180
- */
181
- maxSize(): number;
182
- maxSize(_: number): this;
183
- /**
184
- Minimum size alloted for the space that contains the axis tick labels and title.
185
- */
186
- minSize(): number;
187
- minSize(_: number): this;
188
102
  /**
189
103
  The orientation of the shape.
190
104
  */
@@ -197,113 +111,73 @@ export default class Axis extends BaseClass {
197
111
  */
198
112
  outerBounds(): Record<string, number>;
199
113
  /**
200
- The padding between each tick label.
201
- */
202
- padding(): number;
203
- padding(_: number): this;
204
- /**
205
- The inner padding of band scale.
206
- */
207
- paddingInner(): number;
208
- paddingInner(_: number): this;
209
- /**
210
- The outer padding of band scales.
211
- */
212
- paddingOuter(): number;
213
- paddingOuter(_: number): this;
214
- /**
215
- Scale range (in pixels) of the axis. The given array must have 2 values, but one may be `undefined` to allow the default behavior for that value.
216
- */
217
- range(): (number | undefined)[] | undefined;
218
- range(_: (number | undefined)[]): this;
219
- /**
220
- The rounding method for more evenly spaced ticks at the extents of the scale. Can be "none" (default), "outside", or "inside".
221
- */
222
- rounding(): string;
223
- rounding(_: string): this;
224
- /**
225
- The prefix for the minimum value of "inside" rounding scales.
226
- */
227
- roundingInsideMinPrefix(): string;
228
- roundingInsideMinPrefix(_: string): this;
229
- /**
230
- The suffix for the minimum value of "inside" rounding scales.
231
- */
232
- roundingInsideMinSuffix(): string;
233
- roundingInsideMinSuffix(_: string): this;
234
- /**
235
- The prefix for the maximum value of "inside" rounding scales.
236
- */
237
- roundingInsideMaxPrefix(): string;
238
- roundingInsideMaxPrefix(_: string): this;
239
- /**
240
- The suffix for the maximum value of "inside" rounding scales.
241
- */
242
- roundingInsideMaxSuffix(): string;
243
- roundingInsideMaxSuffix(_: string): this;
244
- /**
245
- Scale of the axis.
246
- */
247
- scale(): string;
248
- scale(_: string): this;
249
- /**
250
- The "padding" property of the scale, often used in point scales.
251
- */
252
- scalePadding(): number;
253
- scalePadding(_: number): this;
114
+ Phase-E: runs the layout pass only — scale construction, tick selection,
115
+ label textWrap, and outerBounds — with **no DOM access**. After it
116
+ returns, `outerBounds()` / `_d3Scale` / `_getPosition()` are populated
117
+ exactly as they would be after a full `render()`, but no `<svg>`, `<g>`,
118
+ tick shapes, or label TextBoxes are created.
119
+
120
+ This is the v4 path for "how much room will this axis need?" without
121
+ the temp-DOM dance — see `Plot._draw`'s test-axes for the production
122
+ caller. Internally it delegates to the standalone `measureAxis(axis)`
123
+ function in axisLayout.ts; the free function shape means Plot (and
124
+ future callers) can run layout without owning an Axis instance.
125
+ */
126
+ measure(): this;
254
127
  /**
255
128
  The SVG container element as a d3 selector or DOM element.
129
+
130
+ Passing `null` or `undefined` deliberately leaves the axis unmounted
131
+ — `renderMode("compute")` plus `select(null)` produces a
132
+ scene-only axis (no detached SVG fallback). This is the formal
133
+ contract callers in `plotPaint` use to compute axis layout without
134
+ mounting DOM.
256
135
  */
257
136
  select(): D3Selection;
258
- select(_: string | HTMLElement): this;
259
- /**
260
- Tick shape constructor.
261
- */
262
- shape(): string;
263
- shape(_: string): this;
137
+ select(_: string | HTMLElement | null | undefined): this;
264
138
  /**
265
139
  Tick style of the axis.
266
140
  */
267
141
  shapeConfig(): Record<string, any>;
268
142
  shapeConfig(_: Record<string, any>): this;
269
- /**
270
- Tick formatter.
271
- */
272
- tickFormat(): any;
273
- tickFormat(_: any): this;
274
- /**
275
- Tick values of the axis.
276
- */
277
- ticks(): unknown[] | undefined;
278
- ticks(_: unknown[]): this;
279
- /**
280
- Tick size of the axis.
281
- */
282
- tickSize(): number;
283
- tickSize(_: number): this;
284
- /**
285
- The tick abbreviation behavior for linear scales. Accepts "normal" (uses formatAbbreviate) or "smallest" (uses the suffix from the smallest tick as reference for every tick).
286
- */
287
- tickSuffix(): string;
288
- tickSuffix(_: string): this;
289
- /**
290
- Defines a custom locale object to be used in time scale. This object must include the following properties: dateTime, date, time, periods, days, shortDays, months, shortMonths. For more information, you can revise [d3p.d3-time-format](https://github.com/d3/d3-time-format/blob/master/README.md#timeFormatLocale).
291
- */
292
- timeLocale(): Record<string, unknown> | undefined;
293
- timeLocale(_: Record<string, unknown>): this;
294
- /**
295
- Title of the axis.
296
- */
297
- title(): string | undefined;
298
- title(_: string): this;
299
143
  /**
300
144
  Title configuration of the axis.
301
145
  */
302
146
  titleConfig(): Record<string, unknown>;
303
147
  titleConfig(_: Record<string, unknown>): this;
304
- /**
305
- Overall width of the axis.
306
- */
307
- width(): number;
308
- width(_: number): this;
309
148
  }
149
+ /**
150
+ Pure-function entry point for axis layout. Given a fully configured
151
+ `Axis` instance, runs the layout pass (no DOM) and returns a fresh result
152
+ bag — bounds, the d3 scale(s), a `getPosition` projector, plus the
153
+ laid-out tick state.
154
+
155
+ Callers who don't want to manage an Axis instance long-term can build
156
+ one on the fly, call this, and discard:
157
+
158
+ ```ts
159
+ const axis = new AxisBottom()
160
+ .domain([0, 100])
161
+ .width(800).height(400)
162
+ .data(data)
163
+ .config(userAxisConfig);
164
+ const layout = computeAxisLayout(axis);
165
+ // layout.bounds, layout.getPosition, layout.d3Scale all populated.
166
+ ```
167
+
168
+ This is the "no temp DOM, no test svg" path Plot's `_xTest`/`_yTest`
169
+ consume — see Plot._draw. Internally this is a thin wrapper over
170
+ `axis.measure()` returning a frozen snapshot of the laid-out state.
171
+ */
172
+ export interface AxisLayout {
173
+ bounds: Record<string, number>;
174
+ d3Scale: any;
175
+ d3ScaleNegative: any;
176
+ getPosition: (d: unknown) => number;
177
+ availableTicks: unknown[];
178
+ visibleTicks: unknown[];
179
+ margin: Record<string, number>;
180
+ }
181
+ export declare function computeAxisLayout(axis: any): AxisLayout;
182
+ export { measureAxis } from "./axisLayout.js";
183
+ export type { AxisLayoutResult } from "./axisLayout.js";
@@ -0,0 +1,100 @@
1
+ import type { D3Selection } from "@d3plus/dom";
2
+ import type { DataPoint } from "@d3plus/data";
3
+ import type { GroupNode } from "@d3plus/render";
4
+ import type { SvgRenderer } from "@d3plus/render";
5
+ import { Axis, TextBox } from "../index.js";
6
+ import { Rect } from "../../shapes/index.js";
7
+ import { BaseClass } from "../../utils/index.js";
8
+ import type { D3Scale } from "../../utils/index.js";
9
+ import Legend from "../Legend/Legend.js";
10
+ /**
11
+ Creates an SVG color scale based on an array of data.
12
+ */
13
+ export default class ColorScale extends BaseClass {
14
+ [key: string]: any;
15
+ _select: D3Selection;
16
+ _axisClass: Axis;
17
+ _axisTest: Axis;
18
+ _colorScale?: D3Scale<string>;
19
+ _data: DataPoint[];
20
+ _group: D3Selection;
21
+ _labelClass: TextBox;
22
+ _labelMin: string | undefined;
23
+ _labelMax: string | undefined;
24
+ _legendClass: Legend;
25
+ _outerBounds: Record<string, number>;
26
+ _rectClass: Rect;
27
+ /** Smooth-gradient fill token (`gradient:<json>`), set by renderGradientStops. */
28
+ _gradientFill?: string;
29
+ _sceneRenderer?: SvgRenderer;
30
+ /**
31
+ Invoked when creating a new class instance, and sets any default parameters.
32
+ @private
33
+ */
34
+ constructor();
35
+ /**
36
+ Renders the current ColorScale to the page.
37
+ @param callback Optional callback invoked after rendering completes.
38
+ */
39
+ render(callback?: (...args: unknown[]) => unknown): this;
40
+ /**
41
+ Produces a backend-agnostic scene graph for this ColorScale with no DOM
42
+ dependency. The discrete variant (jenks/buckets/quantile) delegates to the
43
+ internal Legend's toScene(); the gradient variant composes the Rect, Axis,
44
+ and label TextBox scenes. The scaleGroup's translate (set by the chart's
45
+ colorScale feature on `g.d3plus-viz-colorScale`) is read off `_select` so
46
+ the content lands at its on-screen position.
47
+
48
+ A smooth (non-bucketed) gradient paints its Rect with a `gradient:<json>`
49
+ fill token (see renderGradientStops); the backend materializes it into a
50
+ `<linearGradient>` (SVG) or a CanvasGradient (Canvas). Bucketed gradients
51
+ and the discrete variant use concrete per-bucket fills.
52
+ */
53
+ toScene(): GroupNode;
54
+ /**
55
+ The [ColorScale](http://d3plus.org/docs/#ColorScale) is constructed by combining an [Axis](http://d3plus.org/docs/#Axis) for the ticks/labels and a [Rect](http://d3plus.org/docs/#Rect) for the actual color box (or multiple boxes, as in a jenks scale). Because of this, there are separate configs for the [Axis](http://d3plus.org/docs/#Axis) class used to display the text ([axisConfig](http://d3plus.org/docs/#ColorScale.axisConfig)) and the [Rect](http://d3plus.org/docs/#Rect) class used to draw the color breaks ([rectConfig](http://d3plus.org/docs/#ColorScale.rectConfig)). This method acts as a pass-through to the config method of the [Axis](http://d3plus.org/docs/#Axis). An example usage of this method can be seen [here](http://d3plus.org/examples/d3plus-legend/colorScale-dark/).
56
+ */
57
+ axisConfig(): Record<string, unknown>;
58
+ axisConfig(_: Record<string, unknown>): this;
59
+ /**
60
+ The data array used to create shapes. A shape key will be drawn for each object in the array.
61
+ */
62
+ data(): DataPoint[];
63
+ data(_: DataPoint[]): this;
64
+ /**
65
+ A pass-through for the [TextBox](http://d3plus.org/docs/#TextBox) class used to style the labelMin and labelMax text.
66
+ */
67
+ labelConfig(): Record<string, unknown>;
68
+ labelConfig(_: Record<string, unknown>): this;
69
+ /**
70
+ Defines a text label to be displayed off of the end of the minimum point in the scale (currently only available in horizontal orientation).
71
+ */
72
+ labelMin(): string | undefined;
73
+ labelMin(_: string): this;
74
+ /**
75
+ Defines a text label to be displayed off of the end of the maximum point in the scale (currently only available in horizontal orientation).
76
+ */
77
+ labelMax(): string | undefined;
78
+ labelMax(_: string): this;
79
+ /**
80
+ The [ColorScale](http://d3plus.org/docs/#ColorScale) is constructed by combining an [Axis](http://d3plus.org/docs/#Axis) for the ticks/labels and a [Rect](http://d3plus.org/docs/#Rect) for the actual color box (or multiple boxes, as in a jenks scale). Because of this, there are separate configs for the [Axis](http://d3plus.org/docs/#Axis) class used to display the text ([axisConfig](http://d3plus.org/docs/#ColorScale.axisConfig)) and the [Rect](http://d3plus.org/docs/#Rect) class used to draw the color breaks ([rectConfig](http://d3plus.org/docs/#ColorScale.rectConfig)). This method acts as a pass-through to the config method of the [Axis](http://d3plus.org/docs/#Axis). An example usage of this method can be seen [here](http://d3plus.org/examples/d3plus-legend/colorScale-dark/).
81
+ */
82
+ legendConfig(): Record<string, unknown>;
83
+ legendConfig(_: Record<string, unknown>): this;
84
+ /**
85
+ Returns the outer bounds of the ColorScale content. Must be called after rendering.
86
+ @example
87
+ {"width": 180, "height": 24, "x": 10, "y": 20}
88
+ */
89
+ outerBounds(): Record<string, number>;
90
+ /**
91
+ The [ColorScale](http://d3plus.org/docs/#ColorScale) is constructed by combining an [Axis](http://d3plus.org/docs/#Axis) for the ticks/labels and a [Rect](http://d3plus.org/docs/#Rect) for the actual color box (or multiple boxes, as in a jenks scale). Because of this, there are separate configs for the [Axis](http://d3plus.org/docs/#Axis) class used to display the text ([axisConfig](http://d3plus.org/docs/#ColorScale.axisConfig)) and the [Rect](http://d3plus.org/docs/#Rect) class used to draw the color breaks ([rectConfig](http://d3plus.org/docs/#ColorScale.rectConfig)). This method acts as a pass-through to the config method of the [Rect](http://d3plus.org/docs/#Rect). An example usage of this method can be seen [here](http://d3plus.org/examples/d3plus-legend/colorScale-dark/).
92
+ */
93
+ rectConfig(): Record<string, unknown>;
94
+ rectConfig(_: Record<string, unknown>): this;
95
+ /**
96
+ The SVG container element for this visualization. 3 selector or DOM element.
97
+ */
98
+ select(): D3Selection;
99
+ select(_: string | HTMLElement): this;
100
+ }
@@ -0,0 +1,15 @@
1
+ import type { D3Selection } from "@d3plus/dom";
2
+ import type ColorScale from "./ColorScale.js";
3
+ import type { ColorScaleCompute } from "./colorScaleScale.js";
4
+ /** Shared <g> groups and transition params created by ColorScale.render. */
5
+ export interface ColorScaleGroups {
6
+ labelGroup: D3Selection;
7
+ rectGroup: D3Selection;
8
+ legendGroup: D3Selection;
9
+ groupParams: Record<string, unknown>;
10
+ gradient: boolean;
11
+ }
12
+ /** Renders the smooth-gradient (and bucketed-rect) ColorScale variant. */
13
+ export declare function renderGradient(cs: ColorScale, compute: ColorScaleCompute, groups: ColorScaleGroups): void;
14
+ /** Renders the discrete legend ColorScale variant (jenks/buckets/quantile). */
15
+ export declare function renderLegendVariant(cs: ColorScale, compute: ColorScaleCompute, groups: ColorScaleGroups): void;
@@ -0,0 +1,19 @@
1
+ import type ColorScale from "./ColorScale.js";
2
+ /** Computed values shared between the scale solve and the render branches. */
3
+ export interface ColorScaleCompute {
4
+ allValues: number[];
5
+ domain: number[];
6
+ ticks: number[] | undefined;
7
+ labels: number[] | undefined;
8
+ colors: string[];
9
+ horizontal: boolean;
10
+ height: string;
11
+ width: string;
12
+ x: string;
13
+ y: string;
14
+ }
15
+ /**
16
+ Solves the color scale (jenks or linear) for the current ColorScale config,
17
+ assigning `_colorScale` and returning the values the render branches need.
18
+ */
19
+ export declare function computeColorScale(cs: ColorScale): ColorScaleCompute;
@@ -8,42 +8,19 @@ import Legend from "./Legend.js";
8
8
  Creates an SVG color scale based on an array of data.
9
9
  */
10
10
  export default class ColorScale extends BaseClass {
11
+ [key: string]: any;
11
12
  _select: D3Selection;
12
13
  _axisClass: Axis;
13
- _axisConfig: Record<string, unknown>;
14
14
  _axisTest: Axis;
15
- _align: string;
16
- _buckets: number | number[];
17
- _bucketAxis: boolean;
18
- _bucketFormat: (tick: number, i: number, ticks: number[], allValues: number[]) => string;
19
- _bucketJoiner: (a: string, b: string) => string;
20
- _centered: boolean;
21
- _color: string | string[];
22
- _colorMax: string;
23
- _colorMid: string;
24
- _colorMin: string;
25
15
  _colorScale: any;
26
16
  _data: DataPoint[];
27
- _domain: number[] | undefined;
28
- _duration: number;
29
17
  _group: D3Selection;
30
- _height: number;
31
18
  _labelClass: TextBox;
32
- _labelConfig: Record<string, unknown>;
33
19
  _labelMin: string | undefined;
34
20
  _labelMax: string | undefined;
35
21
  _legendClass: Legend;
36
- _legendConfig: Record<string, unknown>;
37
- _midpoint: number;
38
- _orient: string;
39
22
  _outerBounds: Record<string, number>;
40
- _padding: number;
41
23
  _rectClass: Rect;
42
- _rectConfig: Record<string, unknown>;
43
- _scale: string;
44
- _size: number;
45
- _value: (d: DataPoint, i?: number) => unknown;
46
- _width: number;
47
24
  /**
48
25
  Invoked when creating a new class instance, and sets any default parameters.
49
26
  @private
@@ -59,76 +36,11 @@ export default class ColorScale extends BaseClass {
59
36
  */
60
37
  axisConfig(): Record<string, unknown>;
61
38
  axisConfig(_: Record<string, unknown>): this;
62
- /**
63
- The horizontal alignment.
64
- */
65
- align(): string;
66
- align(_: string): this;
67
- /**
68
- The number of discrete buckets to create in a bucketed color scale. Will be overridden by any custom Array of colors passed to the `color` method. Optionally, users can supply an Array of values used to separate buckets, such as `[0, 10, 25, 50, 90]` for a percentage scale. This value would create 4 buckets, with each value representing the break point between each bucket (so 5 values makes 4 buckets).
69
- */
70
- buckets(): number | number[];
71
- buckets(_: number | number[]): this;
72
- /**
73
- Determines whether or not to use an Axis to display bucket scales (both "buckets" and "jenks"). When set to `false`, bucketed scales will use the `Legend` class to display squares for each range of data. When set to `true`, bucketed scales will be displayed on an `Axis`, similar to "linear" scales.
74
- */
75
- bucketAxis(): boolean;
76
- bucketAxis(_: boolean): this;
77
- /**
78
- A function for formatting the labels associated to each bucket in a bucket-type scale ("jenks", "quantile", etc). The function is passed four arguments: the start value of the current bucket, it's index in the full Array of buckets, the full Array of buckets, and an Array of every value present in the data used to construct the buckets. Keep in mind that the end value for the bucket is not actually the next bucket in the list, but includes every value up until that next bucket value (less than, but not equal to). By default, d3plus will make the end value slightly less than it's current value, so that it does not overlap with the start label for the next bucket.
79
- */
80
- bucketFormat(): (tick: number, i: number, ticks: number[], allValues: number[]) => string;
81
- bucketFormat(_: (tick: number, i: number, ticks: number[], allValues: number[]) => string): this;
82
- /**
83
- A function that receives the minimum and maximum values of a bucket, and is expected to return the full label.
84
- */
85
- bucketJoiner(): (a: string, b: string) => string;
86
- bucketJoiner(_: (a: string, b: string) => string): this;
87
- /**
88
- Determines whether or not to display a midpoint centered Axis. Does not apply to quantile scales.
89
- */
90
- centered(): boolean;
91
- centered(_: boolean): this;
92
- /**
93
- Overrides the default internal logic of `colorMin`, `colorMid`, and `colorMax` to only use just this specified color. If a single color is given as a String, then the scale is interpolated by lightening that color. Otherwise, the function expects an Array of color values to be used in order for the scale.
94
- */
95
- color(): string | string[];
96
- color(_: string | string[]): this;
97
- /**
98
- Defines the color to be used for numbers greater than the value of the `midpoint` on the scale (defaults to `0`). Colors in between this value and the value of `colorMid` will be interpolated, unless a custom Array of colors has been specified using the `color` method.
99
- */
100
- colorMax(): string;
101
- colorMax(_: string): this;
102
- /**
103
- Defines the color to be used for the midpoint of a diverging scale, based on the current value of the `midpoint` method (defaults to `0`). Colors in between this value and the values of `colorMin` and `colorMax` will be interpolated, unless a custom Array of colors has been specified using the `color` method.
104
- */
105
- colorMid(): string;
106
- colorMid(_: string): this;
107
- /**
108
- Defines the color to be used for numbers less than the value of the `midpoint` on the scale (defaults to `0`). Colors in between this value and the value of `colorMid` will be interpolated, unless a custom Array of colors has been specified using the `color` method.
109
- */
110
- colorMin(): string;
111
- colorMin(_: string): this;
112
39
  /**
113
40
  The data array used to create shapes. A shape key will be drawn for each object in the array.
114
41
  */
115
42
  data(): DataPoint[];
116
43
  data(_: DataPoint[]): this;
117
- /**
118
- In a linear scale, this Array of 2 values defines the min and max values used in the color scale. Any values outside of this range will be mapped to the nearest color value.
119
- */
120
- domain(): number[] | undefined;
121
- domain(_: number[]): this;
122
- /**
123
- Transition duration of the ColorScale.
124
- */
125
- duration(): number;
126
- duration(_: number): this;
127
- /**
128
- Overall height of the ColorScale.
129
- */
130
- height(): number;
131
- height(_: number): this;
132
44
  /**
133
45
  A pass-through for the [TextBox](http://d3plus.org/docs/#TextBox) class used to style the labelMin and labelMax text.
134
46
  */
@@ -149,60 +61,20 @@ export default class ColorScale extends BaseClass {
149
61
  */
150
62
  legendConfig(): Record<string, unknown>;
151
63
  legendConfig(_: Record<string, unknown>): this;
152
- /**
153
- The number value to be used as the anchor for `colorMid`, and defines the center point of the diverging color scale.
154
- */
155
- midpoint(): number;
156
- midpoint(_: number): this;
157
- /**
158
- The flow orientation of the ColorScale items.
159
- */
160
- orient(): string;
161
- orient(_: string): this;
162
64
  /**
163
65
  Returns the outer bounds of the ColorScale content. Must be called after rendering.
164
66
  @example
165
67
  {"width": 180, "height": 24, "x": 10, "y": 20}
166
68
  */
167
69
  outerBounds(): Record<string, number>;
168
- /**
169
- The padding between each key.
170
- */
171
- padding(): number;
172
- padding(_: number): this;
173
70
  /**
174
71
  The [ColorScale](http://d3plus.org/docs/#ColorScale) is constructed by combining an [Axis](http://d3plus.org/docs/#Axis) for the ticks/labels and a [Rect](http://d3plus.org/docs/#Rect) for the actual color box (or multiple boxes, as in a jenks scale). Because of this, there are separate configs for the [Axis](http://d3plus.org/docs/#Axis) class used to display the text ([axisConfig](http://d3plus.org/docs/#ColorScale.axisConfig)) and the [Rect](http://d3plus.org/docs/#Rect) class used to draw the color breaks ([rectConfig](http://d3plus.org/docs/#ColorScale.rectConfig)). This method acts as a pass-through to the config method of the [Rect](http://d3plus.org/docs/#Rect). An example usage of this method can be seen [here](http://d3plus.org/examples/d3plus-legend/colorScale-dark/).
175
72
  */
176
73
  rectConfig(): Record<string, unknown>;
177
74
  rectConfig(_: Record<string, unknown>): this;
178
- /**
179
- Scale of the ColorScale.
180
- */
181
- scale(): string;
182
- scale(_: string): this;
183
75
  /**
184
76
  The SVG container element for this visualization. 3 selector or DOM element.
185
77
  */
186
78
  select(): D3Selection;
187
79
  select(_: string | HTMLElement): this;
188
- /**
189
- The height of horizontal color scales, and width when positioned vertical.
190
- */
191
- size(): number;
192
- size(_: number): this;
193
- /**
194
- The value accessor used to determine each data point's position on the color scale.
195
-
196
- @example
197
- function value(d) {
198
- return d.value;
199
- }
200
- */
201
- value(): (d: DataPoint, i?: number) => DataPoint[keyof DataPoint];
202
- value(_: ((d: DataPoint, i?: number) => DataPoint[keyof DataPoint]) | string): this;
203
- /**
204
- Overall width of the ColorScale.
205
- */
206
- width(): number;
207
- width(_: number): this;
208
80
  }