@d3plus/core 3.1.5 → 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 +17 -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 -19470
  501. package/umd/d3plus-core.full.js.map +1 -1
  502. package/umd/d3plus-core.full.min.js +5315 -2939
  503. package/umd/d3plus-core.js +17379 -10575
  504. package/umd/d3plus-core.js.map +1 -1
  505. package/umd/d3plus-core.min.js +3470 -1873
  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 -1454
  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,985 @@
1
+ function _array_like_to_array(arr, len) {
2
+ if (len == null || len > arr.length) len = arr.length;
3
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
+ return arr2;
5
+ }
6
+ function _array_with_holes(arr) {
7
+ if (Array.isArray(arr)) return arr;
8
+ }
9
+ function _array_without_holes(arr) {
10
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
11
+ }
12
+ function _assert_this_initialized(self) {
13
+ if (self === void 0) {
14
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
15
+ }
16
+ return self;
17
+ }
18
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
19
+ try {
20
+ var info = gen[key](arg);
21
+ var value = info.value;
22
+ } catch (error) {
23
+ reject(error);
24
+ return;
25
+ }
26
+ if (info.done) {
27
+ resolve(value);
28
+ } else {
29
+ Promise.resolve(value).then(_next, _throw);
30
+ }
31
+ }
32
+ function _async_to_generator(fn) {
33
+ return function() {
34
+ var self = this, args = arguments;
35
+ return new Promise(function(resolve, reject) {
36
+ var gen = fn.apply(self, args);
37
+ function _next(value) {
38
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
39
+ }
40
+ function _throw(err) {
41
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
42
+ }
43
+ _next(undefined);
44
+ });
45
+ };
46
+ }
47
+ function _call_super(_this, derived, args) {
48
+ derived = _get_prototype_of(derived);
49
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
50
+ }
51
+ function _class_call_check(instance, Constructor) {
52
+ if (!(instance instanceof Constructor)) {
53
+ throw new TypeError("Cannot call a class as a function");
54
+ }
55
+ }
56
+ function _defineProperties(target, props) {
57
+ for(var i = 0; i < props.length; i++){
58
+ var descriptor = props[i];
59
+ descriptor.enumerable = descriptor.enumerable || false;
60
+ descriptor.configurable = true;
61
+ if ("value" in descriptor) descriptor.writable = true;
62
+ Object.defineProperty(target, descriptor.key, descriptor);
63
+ }
64
+ }
65
+ function _create_class(Constructor, protoProps, staticProps) {
66
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
67
+ if (staticProps) _defineProperties(Constructor, staticProps);
68
+ return Constructor;
69
+ }
70
+ function _define_property(obj, key, value) {
71
+ if (key in obj) {
72
+ Object.defineProperty(obj, key, {
73
+ value: value,
74
+ enumerable: true,
75
+ configurable: true,
76
+ writable: true
77
+ });
78
+ } else {
79
+ obj[key] = value;
80
+ }
81
+ return obj;
82
+ }
83
+ function _get_prototype_of(o) {
84
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
85
+ return o.__proto__ || Object.getPrototypeOf(o);
86
+ };
87
+ return _get_prototype_of(o);
88
+ }
89
+ function _inherits(subClass, superClass) {
90
+ if (typeof superClass !== "function" && superClass !== null) {
91
+ throw new TypeError("Super expression must either be null or a function");
92
+ }
93
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
94
+ constructor: {
95
+ value: subClass,
96
+ writable: true,
97
+ configurable: true
98
+ }
99
+ });
100
+ if (superClass) _set_prototype_of(subClass, superClass);
101
+ }
102
+ function _instanceof(left, right) {
103
+ "@swc/helpers - instanceof";
104
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
105
+ return !!right[Symbol.hasInstance](left);
106
+ } else {
107
+ return left instanceof right;
108
+ }
109
+ }
110
+ function _iterable_to_array(iter) {
111
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
112
+ }
113
+ function _iterable_to_array_limit(arr, i) {
114
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
115
+ if (_i == null) return;
116
+ var _arr = [];
117
+ var _n = true;
118
+ var _d = false;
119
+ var _s, _e;
120
+ try {
121
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
122
+ _arr.push(_s.value);
123
+ if (i && _arr.length === i) break;
124
+ }
125
+ } catch (err) {
126
+ _d = true;
127
+ _e = err;
128
+ } finally{
129
+ try {
130
+ if (!_n && _i["return"] != null) _i["return"]();
131
+ } finally{
132
+ if (_d) throw _e;
133
+ }
134
+ }
135
+ return _arr;
136
+ }
137
+ function _non_iterable_rest() {
138
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
139
+ }
140
+ function _non_iterable_spread() {
141
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
142
+ }
143
+ function _object_spread(target) {
144
+ for(var i = 1; i < arguments.length; i++){
145
+ var source = arguments[i] != null ? arguments[i] : {};
146
+ var ownKeys = Object.keys(source);
147
+ if (typeof Object.getOwnPropertySymbols === "function") {
148
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
149
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
150
+ }));
151
+ }
152
+ ownKeys.forEach(function(key) {
153
+ _define_property(target, key, source[key]);
154
+ });
155
+ }
156
+ return target;
157
+ }
158
+ function ownKeys(object, enumerableOnly) {
159
+ var keys = Object.keys(object);
160
+ if (Object.getOwnPropertySymbols) {
161
+ var symbols = Object.getOwnPropertySymbols(object);
162
+ if (enumerableOnly) {
163
+ symbols = symbols.filter(function(sym) {
164
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
165
+ });
166
+ }
167
+ keys.push.apply(keys, symbols);
168
+ }
169
+ return keys;
170
+ }
171
+ function _object_spread_props(target, source) {
172
+ source = source != null ? source : {};
173
+ if (Object.getOwnPropertyDescriptors) {
174
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
175
+ } else {
176
+ ownKeys(Object(source)).forEach(function(key) {
177
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
178
+ });
179
+ }
180
+ return target;
181
+ }
182
+ function _possible_constructor_return(self, call) {
183
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
184
+ return call;
185
+ }
186
+ return _assert_this_initialized(self);
187
+ }
188
+ function _set_prototype_of(o, p) {
189
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
190
+ o.__proto__ = p;
191
+ return o;
192
+ };
193
+ return _set_prototype_of(o, p);
194
+ }
195
+ function _sliced_to_array(arr, i) {
196
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
197
+ }
198
+ function _to_consumable_array(arr) {
199
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
200
+ }
201
+ function _type_of(obj) {
202
+ "@swc/helpers - typeof";
203
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
204
+ }
205
+ function _unsupported_iterable_to_array(o, minLen) {
206
+ if (!o) return;
207
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
208
+ var n = Object.prototype.toString.call(o).slice(8, -1);
209
+ if (n === "Object" && o.constructor) n = o.constructor.name;
210
+ if (n === "Map" || n === "Set") return Array.from(n);
211
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
212
+ }
213
+ function _is_native_reflect_construct() {
214
+ try {
215
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
216
+ } catch (_) {}
217
+ return (_is_native_reflect_construct = function() {
218
+ return !!result;
219
+ })();
220
+ }
221
+ function _ts_generator(thisArg, body) {
222
+ var f, y, t, _ = {
223
+ label: 0,
224
+ sent: function() {
225
+ if (t[0] & 1) throw t[1];
226
+ return t[1];
227
+ },
228
+ trys: [],
229
+ ops: []
230
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
231
+ return d(g, "next", {
232
+ value: verb(0)
233
+ }), d(g, "throw", {
234
+ value: verb(1)
235
+ }), d(g, "return", {
236
+ value: verb(2)
237
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
238
+ value: function() {
239
+ return this;
240
+ }
241
+ }), g;
242
+ function verb(n) {
243
+ return function(v) {
244
+ return step([
245
+ n,
246
+ v
247
+ ]);
248
+ };
249
+ }
250
+ function step(op) {
251
+ if (f) throw new TypeError("Generator is already executing.");
252
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
253
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
254
+ if (y = 0, t) op = [
255
+ op[0] & 2,
256
+ t.value
257
+ ];
258
+ switch(op[0]){
259
+ case 0:
260
+ case 1:
261
+ t = op;
262
+ break;
263
+ case 4:
264
+ _.label++;
265
+ return {
266
+ value: op[1],
267
+ done: false
268
+ };
269
+ case 5:
270
+ _.label++;
271
+ y = op[1];
272
+ op = [
273
+ 0
274
+ ];
275
+ continue;
276
+ case 7:
277
+ op = _.ops.pop();
278
+ _.trys.pop();
279
+ continue;
280
+ default:
281
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
282
+ _ = 0;
283
+ continue;
284
+ }
285
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
286
+ _.label = op[1];
287
+ break;
288
+ }
289
+ if (op[0] === 6 && _.label < t[1]) {
290
+ _.label = t[1];
291
+ t = op;
292
+ break;
293
+ }
294
+ if (t && _.label < t[2]) {
295
+ _.label = t[2];
296
+ _.ops.push(op);
297
+ break;
298
+ }
299
+ if (t[2]) _.ops.pop();
300
+ _.trys.pop();
301
+ continue;
302
+ }
303
+ op = body.call(thisArg, _);
304
+ } catch (e) {
305
+ op = [
306
+ 6,
307
+ e
308
+ ];
309
+ y = 0;
310
+ } finally{
311
+ f = t = 0;
312
+ }
313
+ if (op[0] & 5) throw op[1];
314
+ return {
315
+ value: op[0] ? op[1] : void 0,
316
+ done: true
317
+ };
318
+ }
319
+ }
320
+ import { select } from "d3-selection";
321
+ import { date, getSize } from "@d3plus/dom";
322
+ import { computeTrailCatchup } from "./trailCatchup.js";
323
+ import { CanvasRenderer, SvgRenderer } from "@d3plus/render";
324
+ import VizBase from "./VizBase.js";
325
+ import { applyColorScaleBucketOpacity, applyInteractionOpacity } from "./interactionOpacity.js";
326
+ import { initVizDefaults } from "./vizDefaults.js";
327
+ import { vizRender } from "./vizRender.js";
328
+ import { vizDraw } from "../pipeline/vizDraw.js";
329
+ import { vizPreDraw } from "../pipeline/vizPreDraw.js";
330
+ /**
331
+ Stamps `interactionGroup` onto a component's scene subtree so the pointer
332
+ bridge can route its nodes to component-scoped handlers (e.g. legend) on
333
+ every backend — including Canvas, where there is no per-shape DOM to walk.
334
+ */ function tagInteractionGroup(node, group) {
335
+ node.interactionGroup = group;
336
+ var kids = node.children;
337
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
338
+ if (kids) try {
339
+ for(var _iterator = kids[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
340
+ var child = _step.value;
341
+ tagInteractionGroup(child, group);
342
+ }
343
+ } catch (err) {
344
+ _didIteratorError = true;
345
+ _iteratorError = err;
346
+ } finally{
347
+ try {
348
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
349
+ _iterator.return();
350
+ }
351
+ } finally{
352
+ if (_didIteratorError) {
353
+ throw _iteratorError;
354
+ }
355
+ }
356
+ }
357
+ }
358
+ /**
359
+ Resolves the element a renderer mounts into. A `<canvas>` cannot paint inside
360
+ an `<svg>`, so when the scene target is the compute svg, the canvas mounts
361
+ into that svg's parent (the user's element); the emptied, position:absolute
362
+ compute svg overlays the same top-left box. SVG mounts into the target as-is.
363
+ */ function mountTargetFor(kind, target) {
364
+ var _target_parentNode;
365
+ if (kind === "canvas" && typeof Element !== "undefined" && _instanceof(target, Element) && target.tagName.toLowerCase() === "svg") return (_target_parentNode = target.parentNode) !== null && _target_parentNode !== void 0 ? _target_parentNode : target;
366
+ return target;
367
+ }
368
+ var Viz = /*#__PURE__*/ function(VizBase) {
369
+ "use strict";
370
+ _inherits(Viz, VizBase);
371
+ function Viz() {
372
+ _class_call_check(this, Viz);
373
+ var _this;
374
+ _this = _call_super(this, Viz);
375
+ initVizDefaults(_this);
376
+ return _this;
377
+ }
378
+ _create_class(Viz, [
379
+ {
380
+ /**
381
+ Called by draw before anything is drawn. Formats the data and performs preparations for draw.
382
+ @private
383
+ */ key: "_preDraw",
384
+ value: function _preDraw() {
385
+ vizPreDraw(this);
386
+ }
387
+ },
388
+ {
389
+ /**
390
+ Composes a backend-agnostic scene graph from the shapes/features produced
391
+ by the most recent render. Combines:
392
+ - `_chartScene` (cells from `chartDef.emit`, or `Plot._paint` for the
393
+ paint-driven Plot family) wrapped in viz-chart-cells
394
+ - `_shapes` (still used by some charts) — each shape's toScene
395
+ - chart-level components (Legend/ColorScale/Timeline) via their toScene
396
+ - `_featurePanels` (from FeatureModule layouts) wrapped in viz-features
397
+ */ key: "toScene",
398
+ value: function toScene() {
399
+ var children = [];
400
+ // Chart cells stashed on _chartScene — via `chartDef.emit(ctx)` for
401
+ // data-driven charts, or `Plot._paint` for the paint-driven Plot family.
402
+ // Wraps in two groups when a zoom transform is active:
403
+ // viz-chart-cells (chart-positioning transform)
404
+ // viz-zoom (zoom transform — pan/scale from d3-zoom)
405
+ // … chart scene children
406
+ // This lets zoom apply to the chart content WITHOUT moving legend/
407
+ // title/total/etc. (which live in sibling viz-* groups, not under
408
+ // viz-chart-cells).
409
+ if (this._chartScene && this._chartScene.length) {
410
+ var _this__zoomTransform;
411
+ var sliced = applyInteractionOpacity(this._chartScene, this);
412
+ // Always emit the viz-zoom group (identity transform when no zoom is
413
+ // active) so its key is stable across the first zoom. Otherwise the first
414
+ // zoom adds a brand-new group → the renderer treats the chart cells as
415
+ // exit+enter (teardown/rebuild) instead of tweening the group transform,
416
+ // so the zoom snaps in instead of animating.
417
+ var zoomNode = [
418
+ {
419
+ type: "group",
420
+ key: "viz-zoom",
421
+ transform: (_this__zoomTransform = this._zoomTransform) !== null && _this__zoomTransform !== void 0 ? _this__zoomTransform : {
422
+ x: 0,
423
+ y: 0,
424
+ scale: 1
425
+ },
426
+ children: sliced
427
+ }
428
+ ];
429
+ children.push(_object_spread_props(_object_spread({
430
+ type: "group",
431
+ key: "viz-chart-cells"
432
+ }, this._chartTransform ? {
433
+ transform: this._chartTransform
434
+ } : {}, this._chartClip ? {
435
+ clip: this._chartClip
436
+ } : {}), {
437
+ children: zoomNode
438
+ }));
439
+ }
440
+ // `_shapes` collection (Treemap/Pack/etc. route through `_chartScene`
441
+ // instead, as does Plot's `absorbShapeIntoChartScene`). Any caller
442
+ // pushing into `_shapes` gets its `toScene()` walked here; we read the
443
+ // shape's `_select` transform via d3's transform baseVal if present,
444
+ // otherwise emit without a transform.
445
+ (this._shapes || []).forEach(function(shape, si) {
446
+ if (!shape || typeof shape.toScene !== "function") return;
447
+ var group = shape.toScene();
448
+ var transform;
449
+ var sel = shape._select;
450
+ if (sel && typeof sel.attr === "function") {
451
+ // Parse `translate(x, y)` from the selection's transform attr.
452
+ // Falls back to undefined for non-translate transforms — the
453
+ // `_shapes` path only uses translate.
454
+ var t = sel.attr("transform");
455
+ if (typeof t === "string") {
456
+ var m = t.match(/translate\(\s*(-?[\d.]+)[, ]\s*(-?[\d.]+)\s*\)/);
457
+ if (m) transform = {
458
+ x: parseFloat(m[1]),
459
+ y: parseFloat(m[2])
460
+ };
461
+ }
462
+ }
463
+ children.push(_object_spread_props(_object_spread({
464
+ type: "group",
465
+ key: "".concat(group.key || "shape", "-").concat(si)
466
+ }, transform ? {
467
+ transform: transform
468
+ } : {}), {
469
+ children: group.children
470
+ }));
471
+ });
472
+ // Chart-level components that have their own toScene.
473
+ var components = [
474
+ [
475
+ "legend",
476
+ this._legendClass
477
+ ],
478
+ [
479
+ "colorScale",
480
+ this._colorScaleClass
481
+ ],
482
+ [
483
+ "timeline",
484
+ this._timelineClass
485
+ ]
486
+ ];
487
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
488
+ try {
489
+ for(var _iterator = components[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
490
+ var _step_value = _sliced_to_array(_step.value, 2), name = _step_value[0], comp = _step_value[1];
491
+ if (comp && typeof comp.toScene === "function" && comp._select && typeof comp._select.node === "function" && comp._select.node()) {
492
+ var compScene = comp.toScene();
493
+ // Tag the legend subtree so its swatches route to legend handlers via
494
+ // the node stamp (renderer-independent), not just SVG DOM ancestry.
495
+ if (name === "legend") {
496
+ tagInteractionGroup(compScene, "legend");
497
+ // Hovering a legend swatch dims the others, like the chart marks:
498
+ // run the legend subtree through the same interaction-opacity pass
499
+ // (a no-op when no hover/active predicate is set).
500
+ compScene = applyInteractionOpacity([
501
+ compScene
502
+ ], this)[0];
503
+ } else if (name === "colorScale") {
504
+ compScene = applyColorScaleBucketOpacity([
505
+ compScene
506
+ ], this)[0];
507
+ } else if (name === "timeline") tagInteractionGroup(compScene, "timeline");
508
+ children.push({
509
+ type: "group",
510
+ key: "viz-".concat(name),
511
+ children: [
512
+ compScene
513
+ ]
514
+ });
515
+ }
516
+ }
517
+ } catch (err) {
518
+ _didIteratorError = true;
519
+ _iteratorError = err;
520
+ } finally{
521
+ try {
522
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
523
+ _iterator.return();
524
+ }
525
+ } finally{
526
+ if (_didIteratorError) {
527
+ throw _iteratorError;
528
+ }
529
+ }
530
+ }
531
+ // E2: FeatureModule.layout() panels (title/subtitle/total/back).
532
+ if (this._featurePanels && this._featurePanels.length) {
533
+ var panels = this._featurePanels.slice();
534
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
535
+ try {
536
+ // Tag the back-button panel so the pointer bridge can route its click.
537
+ for(var _iterator1 = panels[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
538
+ var panel = _step1.value;
539
+ if (panel && typeof panel.key === "string" && panel.key.toLowerCase().includes("back")) tagInteractionGroup(panel, "back");
540
+ }
541
+ } catch (err) {
542
+ _didIteratorError1 = true;
543
+ _iteratorError1 = err;
544
+ } finally{
545
+ try {
546
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
547
+ _iterator1.return();
548
+ }
549
+ } finally{
550
+ if (_didIteratorError1) {
551
+ throw _iteratorError1;
552
+ }
553
+ }
554
+ }
555
+ children.push({
556
+ type: "group",
557
+ key: "viz-features",
558
+ children: panels
559
+ });
560
+ }
561
+ return {
562
+ width: this.schema.width,
563
+ height: this.schema.height,
564
+ root: {
565
+ type: "group",
566
+ key: "viz-root",
567
+ children: children
568
+ }
569
+ };
570
+ }
571
+ },
572
+ {
573
+ /**
574
+ Called by render once all checks are passed.
575
+ @private
576
+ */ key: "_draw",
577
+ value: function _draw() {
578
+ vizDraw(this);
579
+ }
580
+ },
581
+ {
582
+ /**
583
+ * Applies the threshold algorithm according to the type of chart used.
584
+ * @param {Array} data The data to process.
585
+ * @private
586
+ */ key: "_thresholdFunction",
587
+ value: function _thresholdFunction(data, _tree) {
588
+ return data;
589
+ }
590
+ },
591
+ {
592
+ /**
593
+ * Detects width and height and sets SVG properties
594
+ * @private
595
+ */ key: "_setSVGSize",
596
+ value: function _setSVGSize(width, height) {
597
+ var _ref = _sliced_to_array(width && height ? [
598
+ width,
599
+ height
600
+ ] : getSize(this._select.node().parentNode), 2), w = _ref[0], h = _ref[1];
601
+ w -= parseFloat(this._select.style("border-left-width"));
602
+ w -= parseFloat(this._select.style("border-right-width"));
603
+ h -= parseFloat(this._select.style("border-top-width"));
604
+ h -= parseFloat(this._select.style("border-bottom-width"));
605
+ if (this._autoWidth && this.schema.width !== w) {
606
+ this.width(w);
607
+ this._select.style("width", "".concat(this.schema.width, "px")).attr("width", "".concat(this.schema.width, "px"));
608
+ }
609
+ if (this._autoHeight && this.schema.height !== h) {
610
+ this.height(h);
611
+ this._select.style("height", "".concat(this.schema.height, "px")).attr("height", "".concat(this.schema.height, "px"));
612
+ }
613
+ }
614
+ },
615
+ {
616
+ /**
617
+ Draws the visualization given the specified configuration.
618
+ @param callback Optional callback invoked after rendering completes.
619
+ */ key: "render",
620
+ value: function render(callback) {
621
+ return vizRender(this, callback);
622
+ }
623
+ },
624
+ {
625
+ key: "renderer",
626
+ value: function renderer(_) {
627
+ if (!arguments.length) return this._renderer;
628
+ this._renderer = _ === "canvas" ? "canvas" : "svg";
629
+ return this;
630
+ }
631
+ },
632
+ {
633
+ key: "renderMode",
634
+ value: function renderMode(_) {
635
+ if (!arguments.length) return this._renderMode || "full";
636
+ this._renderMode = _;
637
+ return this;
638
+ }
639
+ },
640
+ {
641
+ key: "renderScene",
642
+ value: /**
643
+ Public entry point that renders this chart through the @d3plus/render
644
+ pluggable backends. The compute pass happens via render() (in an svg
645
+ auto-created inside the target div); SvgRenderer/CanvasRenderer paints
646
+ the scene to the target. Returns `{renderer, scene}` so callers can
647
+ interact with the renderer (e.g. for picking) or read the scene data.
648
+ */ function renderScene(target, opts) {
649
+ return _async_to_generator(function() {
650
+ var _this, kind;
651
+ return _ts_generator(this, function(_state) {
652
+ switch(_state.label){
653
+ case 0:
654
+ _this = this;
655
+ kind = (opts === null || opts === void 0 ? void 0 : opts.kind) || (this._renderer === "canvas" ? "canvas" : "svg");
656
+ this._sceneTarget = target;
657
+ this._renderer = kind;
658
+ this.select(target);
659
+ return [
660
+ 4,
661
+ new Promise(function(resolve) {
662
+ return _this.render(function() {
663
+ return resolve();
664
+ });
665
+ })
666
+ ];
667
+ case 1:
668
+ _state.sent();
669
+ return [
670
+ 2,
671
+ {
672
+ renderer: this._sceneRenderer,
673
+ scene: this._lastSceneRendered
674
+ }
675
+ ];
676
+ }
677
+ });
678
+ }).call(this);
679
+ }
680
+ },
681
+ {
682
+ /**
683
+ Renders this chart through the @d3plus/render pluggable backends. Called
684
+ automatically by `render()`. The compute pass draws into `this._select`
685
+ (an auto-created svg INSIDE the user's target div) — that svg is the
686
+ off-stage detached compute svg. SvgRenderer mounts to the user's target
687
+ div (the parent), as a sibling to the detached compute svg. The compute
688
+ svg's children get cleared so only the scene output is visible.
689
+ */ key: "_drawSceneToTarget",
690
+ value: function _drawSceneToTarget(durationOverride) {
691
+ var _this = this;
692
+ var _Math;
693
+ var _this__sceneRenderer, _this__sceneRenderer_target, _this__sceneRenderer1;
694
+ var kind = this._renderer === "canvas" ? "canvas" : "svg";
695
+ var computeSvg = this._select && this._select.node ? this._select.node() : null;
696
+ if (!computeSvg) return;
697
+ // Mount renderer INSIDE the user's `_select` (svg or div). Tests like
698
+ // `svgA.querySelector('[data-key="viz-legend"]')` need the scene output
699
+ // to live inside the user's container, not as a sibling.
700
+ var userTarget = this._sceneTarget || computeSvg;
701
+ if (!userTarget) return;
702
+ var mountTarget = mountTargetFor(kind, userTarget);
703
+ var scene = this.toScene();
704
+ var w = this.schema.width || 400;
705
+ var h = this.schema.height || 300;
706
+ // Reuse the renderer instance if it matches the kind, to avoid mount
707
+ // churn. `target()` is the public Renderer-interface method (no
708
+ // reaching into renderer-private slots). It's optional on the
709
+ // interface; third-party renderers without it fall through to
710
+ // remount on every draw — correct but with mount churn.
711
+ var currentContainer = ((_this__sceneRenderer = this._sceneRenderer) === null || _this__sceneRenderer === void 0 ? void 0 : _this__sceneRenderer.target) ? (_this__sceneRenderer_target = this._sceneRenderer.target()) === null || _this__sceneRenderer_target === void 0 ? void 0 : _this__sceneRenderer_target.container : undefined;
712
+ var containerChanged = ((_this__sceneRenderer1 = this._sceneRenderer) === null || _this__sceneRenderer1 === void 0 ? void 0 : _this__sceneRenderer1.target) ? currentContainer !== mountTarget : false;
713
+ if (!this._sceneRenderer || this._sceneRenderer.kind !== kind || containerChanged) {
714
+ // Tear down the outgoing renderer before mounting a fresh one. It owns
715
+ // its own DOM (canvas/svg + overlay host), pointer listeners, and
716
+ // transition timers; without this, switching kind (svg<->canvas) or
717
+ // container orphans that DOM in the user's element, stacking the old
718
+ // mode's output behind the new one and accumulating on every switch.
719
+ if (this._sceneRenderer && typeof this._sceneRenderer.destroy === "function") this._sceneRenderer.destroy();
720
+ var Ctor = kind === "canvas" ? CanvasRenderer : SvgRenderer;
721
+ this._sceneRenderer = new Ctor();
722
+ this._sceneRenderer.mount({
723
+ container: mountTarget,
724
+ width: w,
725
+ height: h
726
+ });
727
+ // Bridge renderer pointer events → viz.schema.on handlers. Without this,
728
+ // tooltips never fire on the v4 scene-rendered path because
729
+ // `shape.on(evt, fn)` in plotPaint only wires d3-selection
730
+ // listeners on DOM nodes the scene renderer doesn't create.
731
+ // Renderer events carry the picked scene node; the routing lives in
732
+ // `_routeSceneEvent` (kept out of this method so the mount path stays
733
+ // readable). `_lastScenePick` remembers the most recently hovered node
734
+ // so `mouseleave` — fired with a null pick — can still tell the matching
735
+ // handlers which shape/legend item was left (so the tooltip clears).
736
+ this._lastScenePick = null;
737
+ this._sceneRenderer.on(function(event) {
738
+ return _this._routeSceneEvent(event);
739
+ });
740
+ } else {
741
+ this._sceneRenderer.resize(w, h);
742
+ }
743
+ // `durationOverride` defaults to the chart's `_duration` for normal
744
+ // re-renders. Interaction handlers (zoomed, hover, etc.) pass 0 to
745
+ // skip the transition machinery — animating every wheel/drag tick
746
+ // accumulates `setTimeout(duration+10)` per event.
747
+ var drawDuration = durationOverride !== undefined ? durationOverride : this.schema.duration;
748
+ // A duration>0 render (drill-down, zoom, re-center) must win over any
749
+ // pending coalesced duration-0 repaint — otherwise that repaint fires on
750
+ // the next frame and interrupts this transition, snapping shapes to their
751
+ // final geometry.
752
+ if (drawDuration > 0 && this._sceneRepaintRAF != null) {
753
+ cancelAnimationFrame(this._sceneRepaintRAF);
754
+ this._sceneRepaintRAF = undefined;
755
+ }
756
+ // Mark the window during which an animated transition is in flight, so the
757
+ // pointer bridge can ignore interaction until it settles. A hover/click
758
+ // mid-transition would schedule a duration-0 repaint that interrupts the
759
+ // running transition and snaps it to its end (the glitchy jump). Matches
760
+ // the SvgRenderer/CanvasRenderer `duration + 10` end timer, plus a small
761
+ // buffer so events re-enable just after the paint completes.
762
+ if (drawDuration > 0) this._transitionEndsAt = Date.now() + drawDuration + 30;
763
+ // Order persistent motion trails in time by the current timeline period, so
764
+ // they grow only as playback moves forward and rewind when it steps back.
765
+ // Only when the timeline selects a single period (`brushing: false`): a range
766
+ // selection has no single "current time", which would scramble the step
767
+ // logic, so we withhold the sequence and trails fall back to ephemeral.
768
+ // Normalize to milliseconds via `date()` — the selection mixes Date objects
769
+ // (brush/initial) and raw period numbers (playback), which compare on wildly
770
+ // different scales otherwise, scrambling the forward/backward test.
771
+ var sel = this._timelineSelection;
772
+ var brushing = this._timelineClass ? this._timelineClass.schema.brushing !== false : true;
773
+ var sequence = !brushing && Array.isArray(sel) && sel.length ? (_Math = Math).max.apply(_Math, _to_consumable_array(sel.map(function(v) {
774
+ return Number(date(Number(v)));
775
+ }))) : undefined;
776
+ // A forward jump that skips periods (manual click, not single-step play) draws
777
+ // one coarse segment; compute the marks' real positions at the skipped periods
778
+ // so the trail bends through them (see render commitTrailCatchups).
779
+ var trailCatchup = sequence !== undefined && this._trailSeq !== undefined && sequence > this._trailSeq ? computeTrailCatchup(this, scene, this._trailSeq, sequence) : undefined;
780
+ if (sequence !== undefined) this._trailSeq = sequence;
781
+ this._sceneRenderer.drawScene(scene, {
782
+ duration: drawDuration,
783
+ sequence: sequence,
784
+ trailCatchup: trailCatchup
785
+ });
786
+ this._lastSceneRendered = scene;
787
+ // Canvas backend: the compute <svg> (`_select`) is an emptied overlay
788
+ // sitting on top of the <canvas>. An svg root hit-tests its whole box, so
789
+ // even empty it swallows the pointer events the canvas needs for
790
+ // tooltip/hover/legend picking — the symptom being "renders fine, no
791
+ // tooltips." Make the overlay transparent to pointer events so the canvas
792
+ // is the sole interaction surface. The only interactive DOM that still
793
+ // lives in this svg is the timeline's d3-brush (the canvas can't host the
794
+ // native brush handles), so re-enable events on just that group. On the
795
+ // SVG backend `_select` IS the scene host, so events must stay enabled.
796
+ if (this._select) {
797
+ this._select.style("pointer-events", kind === "canvas" ? "none" : null);
798
+ if (this._container) this._container.style("pointer-events", kind === "canvas" ? "none" : null);
799
+ if (kind === "canvas") this._select.select("g.d3plus-viz-timeline").style("pointer-events", "auto");
800
+ }
801
+ // The timeline brush (d3-brush DOM, mounted in `g.d3plus-viz-timeline` in
802
+ // the outer svg) must paint above the scene-rendered timeline buttons/ticks
803
+ // so its selection tint + handles sit on top of them (matching v3). The
804
+ // renderer appends its scene <svg> last, so without this the brush layer
805
+ // ends up behind it — the selection's translucent fill is then hidden by
806
+ // the opaque buttons and only the edge handles peek out.
807
+ if (kind === "svg") {
808
+ var host = userTarget && typeof userTarget.querySelector === "function" ? userTarget : null;
809
+ var tlGroup = host ? host.querySelector(":scope > g.d3plus-viz-timeline") : null;
810
+ if (tlGroup) host.appendChild(tlGroup);
811
+ }
812
+ }
813
+ },
814
+ {
815
+ /**
816
+ Routes a renderer pointer event to the matching `viz.schema.on` handlers.
817
+ Bridges the v4 scene-rendered path (SvgRenderer/CanvasRenderer), where
818
+ compute-mode shapes mount no per-shape DOM, so `shape.on(evt, fn)`
819
+ listeners never fire. We look up the appropriate `on` key from the picked
820
+ scene node: legend swatches route to legend handlers, chart shapes to
821
+ shape (+ shape-class-scoped) handlers, and chrome (axis/timeline/back) is
822
+ excluded. Split out of `_drawSceneToTarget` to keep that method small.
823
+ @private
824
+ */ key: "_routeSceneEvent",
825
+ value: function _routeSceneEvent(event) {
826
+ var _this = this;
827
+ var _pick_index;
828
+ // Ignore all pointer interaction while an animated transition (zoom,
829
+ // re-center, drill-down, entrance) is in flight. Hovering or clicking a
830
+ // shape mid-transition would fire a handler that schedules a duration-0
831
+ // repaint, interrupting the running transition and snapping it to its end
832
+ // — the glitchy jump. `_transitionEndsAt` is stamped by `_drawSceneToTarget`
833
+ // for the transition's duration; it lapses on its own, so interaction
834
+ // resumes the instant the transition settles.
835
+ if (this._transitionEndsAt && Date.now() < this._transitionEndsAt) return;
836
+ var pick = event.pick;
837
+ // Dispatch helper shared by the live-pick path and the leave path.
838
+ var fire = function fire(key, d, i, x) {
839
+ var fn = _this.schema.on && _this.schema.on[key];
840
+ if (typeof fn === "function") {
841
+ try {
842
+ fn.call(_this, d, i, x, event.nativeEvent);
843
+ } catch (unused) {
844
+ // swallow per-event errors so one bad handler doesn't
845
+ // break subsequent events.
846
+ }
847
+ }
848
+ };
849
+ if (event.type === "mouseleave") {
850
+ var lastPick = this._lastScenePick;
851
+ if (lastPick) {
852
+ fire("mouseleave.".concat(lastPick.isLegend ? "legend" : "shape"), lastPick.d, lastPick.i, lastPick.x);
853
+ if (!lastPick.isLegend && lastPick.shapeType) fire("mouseleave.".concat(lastPick.shapeType), lastPick.d, lastPick.i, lastPick.x);
854
+ fire("mouseleave", lastPick.d, lastPick.i, lastPick.x);
855
+ }
856
+ this._lastScenePick = null;
857
+ // Cleared here, then re-set by the enter/move the renderer fires
858
+ // synchronously when the pointer crosses to an adjacent node — so a
859
+ // shape→label hand-off leaves `_hoverDatum` pointing at the new node
860
+ // (same datum), which `mouseleave` reads to suppress a flicker.
861
+ this._hoverDatum = null;
862
+ return;
863
+ }
864
+ if (!pick || !pick.node) return;
865
+ // Scene nodes carry interaction metadata stamped by Viz.toScene.
866
+ var nodeAny = pick.node;
867
+ // Back-button panel: its d3-selection click listener never fires in the
868
+ // scene path (it's a plain text node), so route its click here to pop
869
+ // the drill-down history / step up a level.
870
+ if (nodeAny.interactionGroup === "back") {
871
+ if (event.type === "click") {
872
+ var self = this;
873
+ if (self._history.length) self.config(self._history.pop()).render();
874
+ else self.depth(self._drawDepth - 1).filter(false).render();
875
+ }
876
+ return;
877
+ }
878
+ // Axis ticks/labels and the timeline are chrome — they carry data but
879
+ // are not chart shapes, so they must not fire shape tooltips/handlers.
880
+ if (nodeAny.interactionGroup === "axis" || nodeAny.interactionGroup === "timeline") return;
881
+ // Prefer the node's stamped interaction group (set by Viz.toScene), so
882
+ // legend swatches route to legend handlers on Canvas too — where the
883
+ // single canvas element has no per-shape DOM to walk. Fall back to SVG
884
+ // DOM ancestry for nodes the stamp didn't reach.
885
+ var target = event.nativeEvent && event.nativeEvent.target;
886
+ var isLegendNode = nodeAny.interactionGroup === "legend" || (target && typeof target.closest === "function" ? !!target.closest('[data-key="viz-legend"]') : false);
887
+ var suffix = isLegendNode ? "legend" : "shape";
888
+ var handlerKey = "".concat(event.type, ".").concat(suffix);
889
+ // Resolve the source datum + index. `pick.datum` is the raw scene datum
890
+ // (which Shape._sceneXxx populated). For Plot shapes that's the wrapped
891
+ // record; the handlers expect `(d.data, d.i, x, event)`.
892
+ var rawDatum = pick.datum;
893
+ var sourceDatum = rawDatum && rawDatum.data ? rawDatum.data : rawDatum;
894
+ var sourceIndex = rawDatum && typeof rawDatum.i === "number" ? rawDatum.i : (_pick_index = pick.index) !== null && _pick_index !== void 0 ? _pick_index : 0;
895
+ var shapeType = typeof nodeAny.shapeType === "string" ? nodeAny.shapeType : null;
896
+ this._lastScenePick = {
897
+ d: sourceDatum,
898
+ i: sourceIndex,
899
+ x: rawDatum,
900
+ isLegend: isLegendNode,
901
+ shapeType: shapeType
902
+ };
903
+ this._hoverDatum = rawDatum;
904
+ fire(handlerKey, sourceDatum, sourceIndex, rawDatum);
905
+ // Shape-class-scoped handlers (`"click.Bar"`, `"mousemove.Circle"`). The
906
+ // emitting shape stamps its type onto the node; on the scene path this is
907
+ // the only place these fire (compute-mode shapes wire no DOM listeners).
908
+ // Legend nodes are excluded so a legend swatch's shape type can't
909
+ // masquerade as a chart-shape handler.
910
+ if (!isLegendNode && shapeType) {
911
+ fire("".concat(event.type, ".").concat(shapeType), sourceDatum, sourceIndex, rawDatum);
912
+ }
913
+ // Also fire the un-suffixed handler (e.g. "mousemove") so user-registered
914
+ // global handlers see the event too.
915
+ fire(event.type, sourceDatum, sourceIndex, rawDatum);
916
+ }
917
+ },
918
+ {
919
+ /**
920
+ Coalesces interaction-driven scene repaints (hover/active dimming) into a
921
+ single paint per animation frame. A fast pointer sweep across a dense
922
+ chart fires a hover transition per shape crossed; painting each one
923
+ synchronously rebuilt the whole scene back-to-back, saturating the main
924
+ thread (~200ms stalls) so the tooltip couldn't reposition and appeared
925
+ stuck at its last spot. Only the latest hover state is visible, so the
926
+ intermediate paints are wasted — collapse them to one rAF-scheduled draw.
927
+ */ key: "_scheduleSceneRepaint",
928
+ value: function _scheduleSceneRepaint() {
929
+ var _this = this;
930
+ if (!this._sceneRenderer) return;
931
+ if (typeof requestAnimationFrame !== "function") {
932
+ this._drawSceneToTarget(0);
933
+ return;
934
+ }
935
+ if (this._sceneRepaintRAF != null) return;
936
+ this._sceneRepaintRAF = requestAnimationFrame(function() {
937
+ _this._sceneRepaintRAF = undefined;
938
+ _this._drawSceneToTarget(0);
939
+ });
940
+ }
941
+ },
942
+ {
943
+ /**
944
+ Tears down the visualization: disconnects the ResizeObserver and removes DOM event listeners. Call this when unmounting to avoid memory leaks.
945
+ */ key: "destroy",
946
+ value: function destroy() {
947
+ this._resizeObserver.disconnect();
948
+ this._tooltipClass.data([]).render();
949
+ select("body").on("touchstart.".concat(this._uuid), null);
950
+ // Clear the visibility/resize/scroll poll timers + scroll listener
951
+ // so a destroyed chart doesn't keep firing intervals/timeouts that
952
+ // hold the entire viz instance alive. Without this, an SPA that
953
+ // mounts/unmounts charts on tab switches leaks the scene tree +
954
+ // a 200ms-interval timer per leaked chart.
955
+ if (this._visiblePoll) {
956
+ this._visiblePoll = clearInterval(this._visiblePoll);
957
+ }
958
+ if (this._resizePoll) {
959
+ this._resizePoll = clearTimeout(this._resizePoll);
960
+ }
961
+ if (this._scrollPoll) {
962
+ this._scrollPoll = clearTimeout(this._scrollPoll);
963
+ }
964
+ if (this._sceneRepaintRAF != null) {
965
+ if (typeof cancelAnimationFrame === "function") cancelAnimationFrame(this._sceneRepaintRAF);
966
+ this._sceneRepaintRAF = undefined;
967
+ }
968
+ select(this.schema.scrollContainer).on("scroll.".concat(this._uuid), null);
969
+ // Destroy the active scene renderer (clears its own pointer-rect
970
+ // listeners, overlay host, canvas/svg DOM, timers).
971
+ if (this._sceneRenderer && typeof this._sceneRenderer.destroy === "function") {
972
+ this._sceneRenderer.destroy();
973
+ this._sceneRenderer = undefined;
974
+ }
975
+ return this;
976
+ }
977
+ }
978
+ ]);
979
+ return Viz;
980
+ }(VizBase);
981
+ /**
982
+ Creates an x/y plot based on an array of data. See [this example](https://d3plus.org/examples/d3plus-treemap/getting-started/) for help getting started using the treemap generator.
983
+ */ export { Viz as default };
984
+
985
+ //# sourceMappingURL=Viz.js.map