@d3plus/core 4.7.0 → 4.9.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 (963) hide show
  1. package/README.md +1 -26117
  2. package/es/index.js +1 -3
  3. package/es/internal.js +148 -7
  4. package/es/src/charts/AreaPlot/index.js +7 -10
  5. package/es/src/charts/BarChart/index.js +50 -17
  6. package/es/src/charts/Beeswarm/index.js +39 -0
  7. package/es/src/charts/BoxWhisker/index.js +6 -16
  8. package/es/src/charts/Bullet/applyLayout.js +157 -0
  9. package/es/src/charts/Bullet/bulletGeometry.js +215 -0
  10. package/es/src/charts/Bullet/bulletLayout.js +111 -0
  11. package/es/src/charts/Bullet/bulletStyle.js +44 -0
  12. package/es/src/charts/Bullet/emit.js +258 -0
  13. package/es/src/charts/Bullet/index.js +268 -0
  14. package/es/src/charts/BumpChart/index.js +21 -49
  15. package/es/src/charts/Calendar/applyLayout.js +120 -0
  16. package/es/src/charts/Calendar/calendarDates.js +151 -0
  17. package/es/src/charts/Calendar/calendarFormat.js +40 -0
  18. package/es/src/charts/Calendar/calendarGrid.js +138 -0
  19. package/es/src/charts/Calendar/calendarInset.js +22 -0
  20. package/es/src/charts/Calendar/calendarLayout.js +242 -0
  21. package/es/src/charts/Calendar/emit.js +179 -0
  22. package/es/src/charts/Calendar/index.js +206 -0
  23. package/es/src/charts/Candlestick/aggregate.js +154 -0
  24. package/es/src/charts/Candlestick/buffer.js +83 -0
  25. package/es/src/charts/Candlestick/emit.js +198 -0
  26. package/es/src/charts/Candlestick/index.js +257 -0
  27. package/es/src/charts/Candlestick/ohlc.js +114 -0
  28. package/es/src/charts/Candlestick/periods.js +191 -0
  29. package/es/src/charts/Candlestick/tooltip.js +116 -0
  30. package/es/src/charts/Candlestick/volume.js +278 -0
  31. package/es/src/charts/Chord/applyLayout.js +75 -111
  32. package/es/src/charts/Chord/emit.js +82 -173
  33. package/es/src/charts/Chord/index.js +92 -106
  34. package/es/src/charts/Donut/index.js +6 -12
  35. package/es/src/charts/Dumbbell/emit.js +106 -0
  36. package/es/src/charts/Dumbbell/gapSort.js +79 -0
  37. package/es/src/charts/Dumbbell/index.js +84 -0
  38. package/es/src/charts/FanChart/index.js +28 -0
  39. package/es/src/charts/Funnel/applyLayout.js +103 -0
  40. package/es/src/charts/Funnel/emit.js +99 -0
  41. package/es/src/charts/Funnel/funnelFacet.js +53 -0
  42. package/es/src/charts/Funnel/funnelGeometry.js +171 -0
  43. package/es/src/charts/Funnel/funnelLabels.js +118 -0
  44. package/es/src/charts/Funnel/index.js +180 -0
  45. package/es/src/charts/Funnel/labelNodes.js +202 -0
  46. package/es/src/charts/Gauge/applyLayout.js +70 -0
  47. package/es/src/charts/Gauge/dialLayout.js +106 -0
  48. package/es/src/charts/Gauge/emit.js +214 -0
  49. package/es/src/charts/Gauge/emitDial.js +167 -0
  50. package/es/src/charts/Gauge/gaugeGeometry.js +157 -0
  51. package/es/src/charts/Gauge/index.js +148 -0
  52. package/es/src/charts/Geomap/applyLayout.js +42 -73
  53. package/es/src/charts/Geomap/basemapTheme.js +16 -31
  54. package/es/src/charts/Geomap/emit.js +94 -162
  55. package/es/src/charts/Geomap/index.js +186 -193
  56. package/es/src/charts/Geomap/projections.js +37 -0
  57. package/es/src/charts/Histogram/binData.js +60 -209
  58. package/es/src/charts/Histogram/index.js +104 -137
  59. package/es/src/charts/Icicle/applyLayout.js +124 -0
  60. package/es/src/charts/Icicle/emit.js +162 -0
  61. package/es/src/charts/Icicle/enterStagger.js +55 -0
  62. package/es/src/charts/Icicle/geometry.js +101 -0
  63. package/es/src/charts/Icicle/index.js +130 -0
  64. package/es/src/charts/Icicle/interaction.js +20 -0
  65. package/es/src/charts/Icicle/labelFit.js +55 -0
  66. package/es/src/charts/Icicle/layout.js +20 -0
  67. package/es/src/charts/LinePlot/index.js +1 -9
  68. package/es/src/charts/Lollipop/emit.js +85 -0
  69. package/es/src/charts/Lollipop/index.js +97 -0
  70. package/es/src/charts/Lollipop/stemLayout.js +97 -0
  71. package/es/src/charts/Marimekko/axis.js +46 -0
  72. package/es/src/charts/Marimekko/index.js +77 -0
  73. package/es/src/charts/Matrix/applyLayout.js +22 -27
  74. package/es/src/charts/Matrix/emit.js +33 -34
  75. package/es/src/charts/Matrix/index.js +56 -80
  76. package/es/src/charts/Network/applyLayout.js +95 -172
  77. package/es/src/charts/Network/emit.js +132 -266
  78. package/es/src/charts/Network/index.js +148 -132
  79. package/es/src/charts/Pack/applyLayout.js +12 -17
  80. package/es/src/charts/Pack/emit.js +44 -106
  81. package/es/src/charts/Pack/index.js +63 -107
  82. package/es/src/charts/Pack/recursionCircles.js +2 -5
  83. package/es/src/charts/ParallelCoordinates/applyLayout.js +99 -0
  84. package/es/src/charts/ParallelCoordinates/axes.js +213 -0
  85. package/es/src/charts/ParallelCoordinates/brushDom.js +187 -0
  86. package/es/src/charts/ParallelCoordinates/brushFilter.js +79 -0
  87. package/es/src/charts/ParallelCoordinates/dimensions.js +102 -0
  88. package/es/src/charts/ParallelCoordinates/emit.js +72 -0
  89. package/es/src/charts/ParallelCoordinates/format.js +23 -0
  90. package/es/src/charts/ParallelCoordinates/index.js +190 -0
  91. package/es/src/charts/ParallelCoordinates/lineStates.js +62 -0
  92. package/es/src/charts/ParallelCoordinates/paths.js +31 -0
  93. package/es/src/charts/ParallelCoordinates/titles.js +56 -0
  94. package/es/src/charts/Pie/applyLayout.js +20 -28
  95. package/es/src/charts/Pie/emit.js +109 -219
  96. package/es/src/charts/Pie/index.js +49 -78
  97. package/es/src/charts/Plot/axisInk.js +31 -0
  98. package/es/src/charts/Plot/barConfidence.js +273 -0
  99. package/es/src/charts/Plot/barWidth.js +255 -0
  100. package/es/src/charts/Plot/baselineBreak.js +139 -0
  101. package/es/src/charts/Plot/baselineDomain.js +120 -0
  102. package/es/src/charts/Plot/columnHighlight.js +39 -0
  103. package/es/src/charts/Plot/confidenceBands.js +143 -0
  104. package/es/src/charts/Plot/confidenceConfig.js +50 -0
  105. package/es/src/charts/Plot/confidenceTooltip.js +102 -0
  106. package/es/src/charts/Plot/curveLength.js +97 -0
  107. package/es/src/charts/Plot/discreteDomain.js +19 -0
  108. package/es/src/charts/Plot/discreteSpan.js +6 -24
  109. package/es/src/charts/Plot/domainClip.js +190 -0
  110. package/es/src/charts/Plot/draw.js +164 -295
  111. package/es/src/charts/Plot/facetScales.js +27 -0
  112. package/es/src/charts/Plot/fillBetween.js +233 -0
  113. package/es/src/charts/Plot/forecast.js +211 -0
  114. package/es/src/charts/Plot/forecastScene.js +316 -0
  115. package/es/src/charts/Plot/index.js +355 -930
  116. package/es/src/charts/Plot/insetRegion.js +5 -10
  117. package/es/src/charts/Plot/labelPlacement.js +12 -14
  118. package/es/src/charts/Plot/lineBands.js +48 -0
  119. package/es/src/charts/Plot/lineCurve.js +25 -0
  120. package/es/src/charts/Plot/openDomainEnds.js +92 -0
  121. package/es/src/charts/Plot/pipeline.js +143 -480
  122. package/es/src/charts/Plot/pipelineAxisLayout.js +132 -0
  123. package/es/src/charts/Plot/pipelineDomains.js +121 -239
  124. package/es/src/charts/Plot/pipelineLineLabels.js +81 -147
  125. package/es/src/charts/Plot/pipelineScales.js +177 -0
  126. package/es/src/charts/Plot/plotBreaks.js +223 -0
  127. package/es/src/charts/Plot/plotFacet.js +172 -0
  128. package/es/src/charts/Plot/plotInit.js +252 -0
  129. package/es/src/charts/Plot/plotZoom.js +105 -206
  130. package/es/src/charts/Plot/shapeDefaults.js +66 -81
  131. package/es/src/charts/Plot/sharedHover.js +185 -308
  132. package/es/src/charts/Plot/sharedHoverScene.js +115 -157
  133. package/es/src/charts/Plot/sharedTooltip.js +96 -104
  134. package/es/src/charts/Plot/stackEnter.js +87 -0
  135. package/es/src/charts/Plot/stackHelpers.js +36 -69
  136. package/es/src/charts/Plot/stackShareLabels.js +34 -88
  137. package/es/src/charts/Plot/stackShareTooltip.js +10 -15
  138. package/es/src/charts/Plot/swarm.js +96 -0
  139. package/es/src/charts/Plot/swarmLayout.js +102 -0
  140. package/es/src/charts/Plot/trendLines.js +105 -321
  141. package/es/src/charts/Plot/trendProjection.js +27 -69
  142. package/es/src/charts/Plot/trendScene.js +27 -171
  143. package/es/src/charts/Plot/trendTooltip.js +50 -132
  144. package/es/src/charts/PolarArea/applyLayout.js +26 -0
  145. package/es/src/charts/PolarArea/emit.js +12 -0
  146. package/es/src/charts/PolarArea/index.js +183 -0
  147. package/es/src/charts/Priestley/applyLayout.js +33 -53
  148. package/es/src/charts/Priestley/emit.js +50 -111
  149. package/es/src/charts/Priestley/index.js +35 -35
  150. package/es/src/charts/Pyramid/gutter.js +208 -0
  151. package/es/src/charts/Pyramid/index.js +373 -0
  152. package/es/src/charts/Pyramid/pyramidData.js +65 -0
  153. package/es/src/charts/Pyramid/scene.js +224 -0
  154. package/es/src/charts/Pyramid/stackOrder.js +39 -0
  155. package/es/src/charts/Radar/applyLayout.js +52 -291
  156. package/es/src/charts/Radar/axisDecorations.js +200 -0
  157. package/es/src/charts/Radar/axisLabels.js +109 -0
  158. package/es/src/charts/Radar/emit.js +23 -19
  159. package/es/src/charts/Radar/index.js +64 -45
  160. package/es/src/charts/Radar/levels.js +136 -0
  161. package/es/src/charts/Radar/rings.js +72 -0
  162. package/es/src/charts/RadialBar/applyLayout.js +47 -0
  163. package/es/src/charts/RadialBar/emit.js +38 -0
  164. package/es/src/charts/RadialBar/index.js +221 -0
  165. package/es/src/charts/RadialBar/trackLayout.js +330 -0
  166. package/es/src/charts/RadialBar/tracks.js +53 -0
  167. package/es/src/charts/RadialMatrix/applyLayout.js +42 -80
  168. package/es/src/charts/RadialMatrix/emit.js +23 -23
  169. package/es/src/charts/RadialMatrix/index.js +65 -67
  170. package/es/src/charts/Ridgeline/emit.js +75 -0
  171. package/es/src/charts/Ridgeline/index.js +55 -0
  172. package/es/src/charts/Rings/applyLayout.js +124 -266
  173. package/es/src/charts/Rings/emit.js +127 -236
  174. package/es/src/charts/Rings/index.js +118 -98
  175. package/es/src/charts/Rings/ringsGraph.js +88 -0
  176. package/es/src/charts/Rings/ringsSizing.js +41 -89
  177. package/es/src/charts/Sankey/applyLayout.js +32 -60
  178. package/es/src/charts/Sankey/emit.js +94 -150
  179. package/es/src/charts/Sankey/index.js +130 -104
  180. package/es/src/charts/Sankey/sankeyLayout.js +283 -0
  181. package/es/src/charts/StackedArea/index.js +3 -10
  182. package/es/src/charts/Sunburst/applyLayout.js +116 -0
  183. package/es/src/charts/Sunburst/emit.js +181 -0
  184. package/es/src/charts/Sunburst/geometry.js +98 -0
  185. package/es/src/charts/Sunburst/index.js +168 -0
  186. package/es/src/charts/Sunburst/interaction.js +23 -0
  187. package/es/src/charts/Sunburst/labelFit.js +159 -0
  188. package/es/src/charts/Sunburst/partition.js +32 -0
  189. package/es/src/charts/Tree/applyLayout.js +78 -130
  190. package/es/src/charts/Tree/emit.js +76 -184
  191. package/es/src/charts/Tree/index.js +26 -37
  192. package/es/src/charts/Treemap/applyLayout.js +34 -57
  193. package/es/src/charts/Treemap/emit.js +57 -136
  194. package/es/src/charts/Treemap/index.js +57 -95
  195. package/es/src/charts/Treemap/thresholdFunction.js +14 -75
  196. package/es/src/charts/Violin/emit.js +80 -0
  197. package/es/src/charts/Violin/index.js +88 -0
  198. package/es/src/charts/Violin/inner.js +196 -0
  199. package/es/src/charts/Violin/violinLayout.js +80 -0
  200. package/es/src/charts/Waffle/applyLayout.js +90 -0
  201. package/es/src/charts/Waffle/emit.js +89 -0
  202. package/es/src/charts/Waffle/index.js +170 -0
  203. package/es/src/charts/Waffle/tooltip.js +37 -0
  204. package/es/src/charts/Waffle/waffleLayout.js +104 -0
  205. package/es/src/charts/Waterfall/buffer.js +65 -0
  206. package/es/src/charts/Waterfall/connectors.js +103 -0
  207. package/es/src/charts/Waterfall/index.js +211 -0
  208. package/es/src/charts/Waterfall/labels.js +82 -0
  209. package/es/src/charts/Waterfall/state.js +147 -0
  210. package/es/src/charts/Waterfall/steps.js +138 -0
  211. package/es/src/charts/definition/ChartDefinition.js +2 -4
  212. package/es/src/charts/definition/applyDefinition.js +4 -88
  213. package/es/src/charts/definition/makeChart.js +35 -141
  214. package/es/src/charts/drawSteps/backControl.js +15 -14
  215. package/es/src/charts/drawSteps/bottomRightControls.js +39 -115
  216. package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +60 -174
  217. package/es/src/charts/drawSteps/controlButtonStyle.js +39 -63
  218. package/es/src/charts/drawSteps/minimap.js +82 -139
  219. package/es/src/charts/drawSteps/minimapMarkup.js +13 -93
  220. package/es/src/charts/drawSteps/searchControls.js +48 -105
  221. package/es/src/charts/drawSteps/searchControlsMarkup.js +62 -176
  222. package/es/src/charts/drawSteps/tableView.js +23 -40
  223. package/es/src/charts/drawSteps/tableViewControl.js +2 -8
  224. package/es/src/charts/drawSteps/tableViewMarkup.js +152 -233
  225. package/es/src/charts/drawSteps/topLeftControls.js +8 -28
  226. package/es/src/charts/drawSteps/topLeftControlsMarkup.js +49 -119
  227. package/es/src/charts/drawSteps/zoomControls.js +72 -145
  228. package/es/src/charts/drawSteps/zoomControlsMarkup.js +59 -124
  229. package/es/src/charts/drawSteps/zoomGesture.js +17 -0
  230. package/es/src/charts/drawSteps/zoomShown.js +40 -0
  231. package/es/src/charts/events/click.legend.js +12 -23
  232. package/es/src/charts/events/click.shape.js +6 -11
  233. package/es/src/charts/events/mouseenter.js +14 -24
  234. package/es/src/charts/events/mouseleave.js +29 -14
  235. package/es/src/charts/events/mousemove.legend.js +20 -30
  236. package/es/src/charts/events/mousemove.shape.js +12 -21
  237. package/es/src/charts/events/touchstart.body.js +0 -2
  238. package/es/src/charts/facet/drawFacets.js +332 -0
  239. package/es/src/charts/facet/facetConfig.js +72 -0
  240. package/es/src/charts/facet/facetData.js +97 -0
  241. package/es/src/charts/facet/facetGrid.js +107 -0
  242. package/es/src/charts/facet/facetGutter.js +131 -0
  243. package/es/src/charts/facet/facetPanel.js +56 -0
  244. package/es/src/charts/facet/facetScene.js +111 -0
  245. package/es/src/charts/features/attributionFeature.js +38 -38
  246. package/es/src/charts/features/axes.js +105 -304
  247. package/es/src/charts/features/axesFinal.js +134 -0
  248. package/es/src/charts/features/axesMeasure.js +138 -0
  249. package/es/src/charts/features/backgroundImageEmit.js +61 -0
  250. package/es/src/charts/features/chartGeometry.js +3 -5
  251. package/es/src/charts/features/colorScaleBucket.js +17 -21
  252. package/es/src/charts/features/edgeArrows.js +36 -70
  253. package/es/src/charts/features/emitHelpers.js +42 -137
  254. package/es/src/charts/features/ensureZoomDom.js +27 -40
  255. package/es/src/charts/features/features.js +216 -256
  256. package/es/src/charts/features/featuresColorScale.js +40 -39
  257. package/es/src/charts/features/featuresLegend.js +152 -188
  258. package/es/src/charts/features/frozenAxis.js +14 -0
  259. package/es/src/charts/features/insetState.js +25 -90
  260. package/es/src/charts/features/legendCategory.js +61 -0
  261. package/es/src/charts/features/legendLabel.js +5 -9
  262. package/es/src/charts/features/lineLabels.js +20 -87
  263. package/es/src/charts/features/plotAnnotations.js +105 -0
  264. package/es/src/charts/features/plotEndLabels.js +209 -0
  265. package/es/src/charts/features/plotPaint.js +192 -404
  266. package/es/src/charts/features/sceneBounds.js +57 -164
  267. package/es/src/charts/features/shapeEmit.js +183 -184
  268. package/es/src/charts/features/shareKey.js +32 -0
  269. package/es/src/charts/features/sharedFields.js +38 -0
  270. package/es/src/charts/features/tooltipSwatch.js +99 -42
  271. package/es/src/charts/features/xAxisConfig.js +19 -0
  272. package/es/src/charts/features/zoomExtent.js +23 -108
  273. package/es/src/charts/helpers/densityChart.js +267 -0
  274. package/es/src/charts/helpers/densityData.js +116 -0
  275. package/es/src/charts/helpers/densityEnter.js +64 -0
  276. package/es/src/charts/helpers/matrixData.js +11 -82
  277. package/es/src/charts/helpers/tileAttributions.js +1 -3
  278. package/es/src/charts/helpers/valueTitle.js +29 -0
  279. package/es/src/charts/index.js +20 -2
  280. package/es/src/charts/partition/chartFields.js +43 -0
  281. package/es/src/charts/partition/hierarchy.js +174 -0
  282. package/es/src/charts/partition/interaction.js +158 -0
  283. package/es/src/charts/partition/labelWords.js +95 -0
  284. package/es/src/charts/partition/shade.js +56 -0
  285. package/es/src/charts/partition/zoom.js +80 -0
  286. package/es/src/charts/pipeline/drillMorph.js +16 -37
  287. package/es/src/charts/pipeline/insetPlacement.js +95 -188
  288. package/es/src/charts/pipeline/preDrawData.js +74 -0
  289. package/es/src/charts/pipeline/resolveSpec.js +1 -3
  290. package/es/src/charts/pipeline/runChartDraw.js +14 -69
  291. package/es/src/charts/pipeline/runVizPipeline.js +13 -35
  292. package/es/src/charts/pipeline/stages.js +24 -61
  293. package/es/src/charts/pipeline/vizDraw.js +165 -30
  294. package/es/src/charts/pipeline/vizPreDraw.js +145 -106
  295. package/es/src/charts/plotBuffers/Bar.js +7 -108
  296. package/es/src/charts/plotBuffers/Box.js +6 -102
  297. package/es/src/charts/plotBuffers/Circle.js +11 -14
  298. package/es/src/charts/plotBuffers/Line.js +7 -13
  299. package/es/src/charts/plotBuffers/Rect.js +11 -15
  300. package/es/src/charts/plotBuffers/defaultBuffers.js +12 -0
  301. package/es/src/charts/plotBuffers/discreteBuffer.js +5 -9
  302. package/es/src/charts/plotBuffers/numericBuffer.js +24 -33
  303. package/es/src/charts/plotBuffers/rectLikeBuffer.js +39 -0
  304. package/es/src/charts/polar/chrome.js +170 -0
  305. package/es/src/charts/polar/config.js +82 -0
  306. package/es/src/charts/polar/geometry.js +92 -0
  307. package/es/src/charts/polar/labels.js +124 -0
  308. package/es/src/charts/polar/polarFacet.js +43 -0
  309. package/es/src/charts/polar/wedgeLayout.js +140 -0
  310. package/es/src/charts/viz/Viz.js +503 -991
  311. package/es/src/charts/viz/VizBase.js +260 -613
  312. package/es/src/charts/viz/backgroundInk.js +17 -0
  313. package/es/src/charts/viz/interactionOpacity.js +92 -135
  314. package/es/src/charts/viz/labelDefaults.js +61 -0
  315. package/es/src/charts/viz/linkGroup.js +63 -237
  316. package/es/src/charts/viz/ordinalColor.js +12 -44
  317. package/es/src/charts/viz/reserveContainerSize.js +49 -0
  318. package/es/src/charts/viz/resetChromeBoxes.js +41 -0
  319. package/es/src/charts/viz/sceneRows.js +7 -9
  320. package/es/src/charts/viz/shapeClassTargets.js +33 -0
  321. package/es/src/charts/viz/shapeHover.js +9 -0
  322. package/es/src/charts/viz/simpleHover.js +14 -0
  323. package/es/src/charts/viz/trailCatchup.js +28 -87
  324. package/es/src/charts/viz/vizDefaults.js +113 -385
  325. package/es/src/charts/viz/vizFields.js +197 -0
  326. package/es/src/charts/viz/vizRender.js +84 -78
  327. package/es/src/charts/viz/vizTypes.js +1 -3
  328. package/es/src/charts/viz/vizVisibility.js +32 -51
  329. package/es/src/components/Axis/Axis.js +304 -469
  330. package/es/src/components/Axis/AxisBottom.js +9 -74
  331. package/es/src/components/Axis/AxisLeft.js +9 -74
  332. package/es/src/components/Axis/AxisRight.js +9 -74
  333. package/es/src/components/Axis/AxisTop.js +9 -74
  334. package/es/src/components/Axis/axisBreak.js +243 -0
  335. package/es/src/components/Axis/axisDefaults.js +65 -0
  336. package/es/src/components/Axis/axisEndLabels.js +60 -0
  337. package/es/src/components/Axis/axisLabelThinning.js +123 -0
  338. package/es/src/components/Axis/axisLayout.js +211 -160
  339. package/es/src/components/Axis/axisLayoutLabels.js +187 -108
  340. package/es/src/components/Axis/axisLayoutScale.js +130 -247
  341. package/es/src/components/Axis/axisRender.js +82 -411
  342. package/es/src/components/Axis/axisRounding.js +68 -0
  343. package/es/src/components/Axis/axisScene.js +184 -0
  344. package/es/src/components/Axis/brokenScale.js +183 -0
  345. package/es/src/components/Axis/gridStroke.js +10 -0
  346. package/es/src/components/Axis/timeValues.js +155 -0
  347. package/es/src/components/Axis/yearValues.js +32 -0
  348. package/es/src/components/ColorScale/ColorScale.js +187 -345
  349. package/es/src/components/ColorScale/colorScaleRender.js +72 -108
  350. package/es/src/components/ColorScale/colorScaleScale.js +101 -164
  351. package/es/src/components/Legend/Legend.js +164 -352
  352. package/es/src/components/Legend/legendConfig.js +43 -55
  353. package/es/src/components/Legend/legendRender.js +61 -109
  354. package/es/src/components/Message.js +50 -98
  355. package/es/src/components/SizeLegend/SizeLegend.js +188 -330
  356. package/es/src/components/SizeLegend/sizeLegendLayout.js +65 -161
  357. package/es/src/components/TextBox.js +156 -615
  358. package/es/src/components/Timeline/Timeline.js +345 -554
  359. package/es/src/components/Timeline/timelineConfig.js +23 -56
  360. package/es/src/components/Timeline/timelineRender.js +58 -112
  361. package/es/src/components/Tooltip.js +128 -607
  362. package/es/src/components/index.js +0 -2
  363. package/es/src/components/textBoxLayout.js +230 -0
  364. package/es/src/components/tooltipDom.js +218 -0
  365. package/es/src/fluent.js +177 -203
  366. package/es/src/shapes/Area.js +128 -329
  367. package/es/src/shapes/Bar.js +92 -245
  368. package/es/src/shapes/Box.js +231 -405
  369. package/es/src/shapes/Circle.js +46 -199
  370. package/es/src/shapes/Image.js +98 -210
  371. package/es/src/shapes/Line.js +73 -251
  372. package/es/src/shapes/Path.js +34 -149
  373. package/es/src/shapes/Rect.js +57 -210
  374. package/es/src/shapes/Shape.js +328 -655
  375. package/es/src/shapes/Whisker.js +166 -371
  376. package/es/src/shapes/buildLabelData.js +31 -80
  377. package/es/src/shapes/emitLabels.js +17 -49
  378. package/es/src/shapes/hitAreaNode.js +8 -10
  379. package/es/src/shapes/index.js +0 -2
  380. package/es/src/shapes/interactionPoints.js +5 -7
  381. package/es/src/shapes/sceneSort.js +61 -161
  382. package/es/src/shapes/shapeConfig.js +0 -2
  383. package/es/src/shapes/shapeOwners.js +37 -0
  384. package/es/src/shapes/shapeStandalone.js +71 -0
  385. package/es/src/shapes/textureKey.js +11 -61
  386. package/es/src/shapes/uniqueIds.js +19 -0
  387. package/es/src/shapes/validateShapeConfig.js +23 -119
  388. package/es/src/utils/AccessorFn.js +0 -2
  389. package/es/src/utils/BaseClass.js +114 -262
  390. package/es/src/utils/D3Scale.js +0 -2
  391. package/es/src/utils/D3plusConfig.js +0 -2
  392. package/es/src/utils/RESET.js +1 -3
  393. package/es/src/utils/accessor.js +2 -8
  394. package/es/src/utils/configDefault.js +1 -3
  395. package/es/src/utils/configPrep.js +15 -35
  396. package/es/src/utils/configWarnings.js +11 -13
  397. package/es/src/utils/constant.js +0 -2
  398. package/es/src/utils/getProp.js +0 -2
  399. package/es/src/utils/index.js +0 -2
  400. package/es/src/utils/paintComponentScene.js +12 -23
  401. package/es/src/utils/wholeWords.js +44 -0
  402. package/package.json +16 -25
  403. package/types/index.d.ts +12 -4
  404. package/types/internal.d.ts +210 -12
  405. package/types/src/charts/AreaPlot/index.d.ts +2 -1
  406. package/types/src/charts/BarChart/index.d.ts +4 -2
  407. package/types/src/charts/Beeswarm/index.d.ts +15 -0
  408. package/types/src/charts/Bullet/applyLayout.d.ts +65 -0
  409. package/types/src/charts/Bullet/bulletGeometry.d.ts +91 -0
  410. package/types/src/charts/Bullet/bulletLayout.d.ts +54 -0
  411. package/types/src/charts/Bullet/bulletStyle.d.ts +33 -0
  412. package/types/src/charts/Bullet/emit.d.ts +25 -0
  413. package/types/src/charts/Bullet/index.d.ts +40 -0
  414. package/types/src/charts/Calendar/applyLayout.d.ts +37 -0
  415. package/types/src/charts/Calendar/calendarDates.d.ts +68 -0
  416. package/types/src/charts/Calendar/calendarFormat.d.ts +24 -0
  417. package/types/src/charts/Calendar/calendarGrid.d.ts +84 -0
  418. package/types/src/charts/Calendar/calendarInset.d.ts +13 -0
  419. package/types/src/charts/Calendar/calendarLayout.d.ts +84 -0
  420. package/types/src/charts/Calendar/emit.d.ts +31 -0
  421. package/types/src/charts/Calendar/index.d.ts +26 -0
  422. package/types/src/charts/Candlestick/aggregate.d.ts +91 -0
  423. package/types/src/charts/Candlestick/buffer.d.ts +37 -0
  424. package/types/src/charts/Candlestick/emit.d.ts +54 -0
  425. package/types/src/charts/Candlestick/index.d.ts +16 -0
  426. package/types/src/charts/Candlestick/ohlc.d.ts +94 -0
  427. package/types/src/charts/Candlestick/periods.d.ts +84 -0
  428. package/types/src/charts/Candlestick/tooltip.d.ts +50 -0
  429. package/types/src/charts/Candlestick/volume.d.ts +129 -0
  430. package/types/src/charts/Chord/emit.d.ts +2 -2
  431. package/types/src/charts/Dumbbell/emit.d.ts +34 -0
  432. package/types/src/charts/Dumbbell/gapSort.d.ts +47 -0
  433. package/types/src/charts/Dumbbell/index.d.ts +21 -0
  434. package/types/src/charts/FanChart/index.d.ts +17 -0
  435. package/types/src/charts/Funnel/applyLayout.d.ts +89 -0
  436. package/types/src/charts/Funnel/emit.d.ts +29 -0
  437. package/types/src/charts/Funnel/funnelFacet.d.ts +33 -0
  438. package/types/src/charts/Funnel/funnelGeometry.d.ts +78 -0
  439. package/types/src/charts/Funnel/funnelLabels.d.ts +101 -0
  440. package/types/src/charts/Funnel/index.d.ts +30 -0
  441. package/types/src/charts/Funnel/labelNodes.d.ts +57 -0
  442. package/types/src/charts/Gauge/applyLayout.d.ts +41 -0
  443. package/types/src/charts/Gauge/dialLayout.d.ts +78 -0
  444. package/types/src/charts/Gauge/emit.d.ts +22 -0
  445. package/types/src/charts/Gauge/emitDial.d.ts +41 -0
  446. package/types/src/charts/Gauge/gaugeGeometry.d.ts +89 -0
  447. package/types/src/charts/Gauge/index.d.ts +21 -0
  448. package/types/src/charts/Geomap/projections.d.ts +8 -0
  449. package/types/src/charts/Histogram/binData.d.ts +9 -1
  450. package/types/src/charts/Icicle/applyLayout.d.ts +54 -0
  451. package/types/src/charts/Icicle/emit.d.ts +20 -0
  452. package/types/src/charts/Icicle/enterStagger.d.ts +30 -0
  453. package/types/src/charts/Icicle/geometry.d.ts +72 -0
  454. package/types/src/charts/Icicle/index.d.ts +25 -0
  455. package/types/src/charts/Icicle/interaction.d.ts +16 -0
  456. package/types/src/charts/Icicle/labelFit.d.ts +37 -0
  457. package/types/src/charts/Icicle/layout.d.ts +21 -0
  458. package/types/src/charts/Lollipop/emit.d.ts +19 -0
  459. package/types/src/charts/Lollipop/index.d.ts +17 -0
  460. package/types/src/charts/Lollipop/stemLayout.d.ts +82 -0
  461. package/types/src/charts/Marimekko/axis.d.ts +27 -0
  462. package/types/src/charts/Marimekko/index.d.ts +19 -0
  463. package/types/src/charts/ParallelCoordinates/applyLayout.d.ts +27 -0
  464. package/types/src/charts/ParallelCoordinates/axes.d.ts +40 -0
  465. package/types/src/charts/ParallelCoordinates/brushDom.d.ts +47 -0
  466. package/types/src/charts/ParallelCoordinates/brushFilter.d.ts +39 -0
  467. package/types/src/charts/ParallelCoordinates/dimensions.d.ts +63 -0
  468. package/types/src/charts/ParallelCoordinates/emit.d.ts +27 -0
  469. package/types/src/charts/ParallelCoordinates/format.d.ts +13 -0
  470. package/types/src/charts/ParallelCoordinates/index.d.ts +27 -0
  471. package/types/src/charts/ParallelCoordinates/lineStates.d.ts +21 -0
  472. package/types/src/charts/ParallelCoordinates/paths.d.ts +27 -0
  473. package/types/src/charts/ParallelCoordinates/titles.d.ts +21 -0
  474. package/types/src/charts/Plot/axisInk.d.ts +8 -0
  475. package/types/src/charts/Plot/barConfidence.d.ts +120 -0
  476. package/types/src/charts/Plot/barWidth.d.ts +119 -0
  477. package/types/src/charts/Plot/baselineBreak.d.ts +52 -0
  478. package/types/src/charts/Plot/baselineDomain.d.ts +67 -0
  479. package/types/src/charts/Plot/columnHighlight.d.ts +23 -0
  480. package/types/src/charts/Plot/confidenceBands.d.ts +72 -0
  481. package/types/src/charts/Plot/confidenceConfig.d.ts +16 -0
  482. package/types/src/charts/Plot/confidenceTooltip.d.ts +70 -0
  483. package/types/src/charts/Plot/curveLength.d.ts +27 -0
  484. package/types/src/charts/Plot/discreteDomain.d.ts +14 -0
  485. package/types/src/charts/Plot/domainClip.d.ts +21 -0
  486. package/types/src/charts/Plot/facetScales.d.ts +27 -0
  487. package/types/src/charts/Plot/fillBetween.d.ts +69 -0
  488. package/types/src/charts/Plot/forecast.d.ts +102 -0
  489. package/types/src/charts/Plot/forecastScene.d.ts +88 -0
  490. package/types/src/charts/Plot/index.d.ts +24 -5
  491. package/types/src/charts/Plot/lineBands.d.ts +7 -0
  492. package/types/src/charts/Plot/lineCurve.d.ts +15 -0
  493. package/types/src/charts/Plot/openDomainEnds.d.ts +25 -0
  494. package/types/src/charts/Plot/pipeline.d.ts +5 -30
  495. package/types/src/charts/Plot/pipelineAxisLayout.d.ts +2 -0
  496. package/types/src/charts/Plot/pipelineScales.d.ts +20 -0
  497. package/types/src/charts/Plot/plotBreaks.d.ts +61 -0
  498. package/types/src/charts/Plot/plotFacet.d.ts +36 -0
  499. package/types/src/charts/Plot/plotInit.d.ts +44 -0
  500. package/types/src/charts/Plot/plotZoom.d.ts +14 -8
  501. package/types/src/charts/Plot/sharedHover.d.ts +5 -0
  502. package/types/src/charts/Plot/sharedHoverScene.d.ts +3 -6
  503. package/types/src/charts/Plot/sharedTooltip.d.ts +13 -8
  504. package/types/src/charts/Plot/stackEnter.d.ts +42 -0
  505. package/types/src/charts/Plot/swarm.d.ts +66 -0
  506. package/types/src/charts/Plot/swarmLayout.d.ts +59 -0
  507. package/types/src/charts/PolarArea/applyLayout.d.ts +17 -0
  508. package/types/src/charts/PolarArea/emit.d.ts +3 -0
  509. package/types/src/charts/PolarArea/index.d.ts +19 -0
  510. package/types/src/charts/Pyramid/gutter.d.ts +76 -0
  511. package/types/src/charts/Pyramid/index.d.ts +19 -0
  512. package/types/src/charts/Pyramid/pyramidData.d.ts +48 -0
  513. package/types/src/charts/Pyramid/scene.d.ts +106 -0
  514. package/types/src/charts/Pyramid/stackOrder.d.ts +9 -0
  515. package/types/src/charts/Radar/applyLayout.d.ts +7 -5
  516. package/types/src/charts/Radar/axisDecorations.d.ts +67 -0
  517. package/types/src/charts/Radar/axisLabels.d.ts +79 -0
  518. package/types/src/charts/Radar/emit.d.ts +2 -2
  519. package/types/src/charts/Radar/index.d.ts +5 -1
  520. package/types/src/charts/Radar/levels.d.ts +68 -0
  521. package/types/src/charts/Radar/rings.d.ts +30 -0
  522. package/types/src/charts/RadialBar/applyLayout.d.ts +19 -0
  523. package/types/src/charts/RadialBar/emit.d.ts +6 -0
  524. package/types/src/charts/RadialBar/index.d.ts +21 -0
  525. package/types/src/charts/RadialBar/trackLayout.d.ts +46 -0
  526. package/types/src/charts/RadialBar/tracks.d.ts +32 -0
  527. package/types/src/charts/Ridgeline/emit.d.ts +11 -0
  528. package/types/src/charts/Ridgeline/index.d.ts +16 -0
  529. package/types/src/charts/Rings/index.d.ts +2 -0
  530. package/types/src/charts/Rings/ringsGraph.d.ts +72 -0
  531. package/types/src/charts/Sankey/applyLayout.d.ts +1 -1
  532. package/types/src/charts/Sankey/sankeyLayout.d.ts +57 -0
  533. package/types/src/charts/StackedArea/index.d.ts +2 -1
  534. package/types/src/charts/Sunburst/applyLayout.d.ts +67 -0
  535. package/types/src/charts/Sunburst/emit.d.ts +29 -0
  536. package/types/src/charts/Sunburst/geometry.d.ts +65 -0
  537. package/types/src/charts/Sunburst/index.d.ts +21 -0
  538. package/types/src/charts/Sunburst/interaction.d.ts +20 -0
  539. package/types/src/charts/Sunburst/labelFit.d.ts +73 -0
  540. package/types/src/charts/Sunburst/partition.d.ts +34 -0
  541. package/types/src/charts/Violin/emit.d.ts +4 -0
  542. package/types/src/charts/Violin/index.d.ts +16 -0
  543. package/types/src/charts/Violin/inner.d.ts +31 -0
  544. package/types/src/charts/Violin/violinLayout.d.ts +64 -0
  545. package/types/src/charts/Waffle/applyLayout.d.ts +36 -0
  546. package/types/src/charts/Waffle/emit.d.ts +29 -0
  547. package/types/src/charts/Waffle/index.d.ts +21 -0
  548. package/types/src/charts/Waffle/tooltip.d.ts +20 -0
  549. package/types/src/charts/Waffle/waffleLayout.d.ts +81 -0
  550. package/types/src/charts/Waterfall/buffer.d.ts +31 -0
  551. package/types/src/charts/Waterfall/connectors.d.ts +40 -0
  552. package/types/src/charts/Waterfall/index.d.ts +24 -0
  553. package/types/src/charts/Waterfall/labels.d.ts +59 -0
  554. package/types/src/charts/Waterfall/state.d.ts +62 -0
  555. package/types/src/charts/Waterfall/steps.d.ts +84 -0
  556. package/types/src/charts/definition/ChartDefinition.d.ts +28 -7
  557. package/types/src/charts/definition/makeChart.d.ts +3 -1
  558. package/types/src/charts/drawSteps/bottomRightControls.d.ts +19 -0
  559. package/types/src/charts/drawSteps/bottomRightControlsMarkup.d.ts +1 -1
  560. package/types/src/charts/drawSteps/controlButtonStyle.d.ts +21 -0
  561. package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +2 -6
  562. package/types/src/charts/drawSteps/topLeftControlsMarkup.d.ts +10 -2
  563. package/types/src/charts/drawSteps/zoomControlsMarkup.d.ts +9 -0
  564. package/types/src/charts/drawSteps/zoomGesture.d.ts +17 -0
  565. package/types/src/charts/drawSteps/zoomShown.d.ts +32 -0
  566. package/types/src/charts/facet/drawFacets.d.ts +52 -0
  567. package/types/src/charts/facet/facetConfig.d.ts +178 -0
  568. package/types/src/charts/facet/facetData.d.ts +47 -0
  569. package/types/src/charts/facet/facetGrid.d.ts +62 -0
  570. package/types/src/charts/facet/facetGutter.d.ts +68 -0
  571. package/types/src/charts/facet/facetPanel.d.ts +24 -0
  572. package/types/src/charts/facet/facetScene.d.ts +39 -0
  573. package/types/src/charts/features/axes.d.ts +4 -89
  574. package/types/src/charts/features/axesFinal.d.ts +66 -0
  575. package/types/src/charts/features/axesMeasure.d.ts +88 -0
  576. package/types/src/charts/features/backgroundImageEmit.d.ts +32 -0
  577. package/types/src/charts/features/features.d.ts +40 -12
  578. package/types/src/charts/features/featuresLegend.d.ts +10 -2
  579. package/types/src/charts/features/frozenAxis.d.ts +8 -0
  580. package/types/src/charts/features/insetState.d.ts +3 -4
  581. package/types/src/charts/features/legendCategory.d.ts +36 -0
  582. package/types/src/charts/features/legendLabel.d.ts +3 -6
  583. package/types/src/charts/features/plotAnnotations.d.ts +38 -0
  584. package/types/src/charts/features/plotEndLabels.d.ts +108 -0
  585. package/types/src/charts/features/plotPaint.d.ts +10 -25
  586. package/types/src/charts/features/sceneBounds.d.ts +8 -2
  587. package/types/src/charts/features/shapeEmit.d.ts +14 -1
  588. package/types/src/charts/features/shareKey.d.ts +24 -0
  589. package/types/src/charts/features/sharedFields.d.ts +22 -0
  590. package/types/src/charts/features/tooltipSwatch.d.ts +36 -4
  591. package/types/src/charts/features/xAxisConfig.d.ts +6 -0
  592. package/types/src/charts/helpers/densityChart.d.ts +62 -0
  593. package/types/src/charts/helpers/densityData.d.ts +88 -0
  594. package/types/src/charts/helpers/densityEnter.d.ts +23 -0
  595. package/types/src/charts/helpers/valueTitle.d.ts +23 -0
  596. package/types/src/charts/index.d.ts +20 -0
  597. package/types/src/charts/partition/chartFields.d.ts +29 -0
  598. package/types/src/charts/partition/hierarchy.d.ts +109 -0
  599. package/types/src/charts/partition/interaction.d.ts +57 -0
  600. package/types/src/charts/partition/labelWords.d.ts +50 -0
  601. package/types/src/charts/partition/shade.d.ts +61 -0
  602. package/types/src/charts/partition/zoom.d.ts +51 -0
  603. package/types/src/charts/pipeline/preDrawData.d.ts +34 -0
  604. package/types/src/charts/pipeline/stages.d.ts +11 -3
  605. package/types/src/charts/pipeline/vizDraw.d.ts +25 -20
  606. package/types/src/charts/pipeline/vizPreDraw.d.ts +23 -17
  607. package/types/src/charts/plotBuffers/Bar.d.ts +9 -12
  608. package/types/src/charts/plotBuffers/Box.d.ts +8 -11
  609. package/types/src/charts/plotBuffers/defaultBuffers.d.ts +25 -0
  610. package/types/src/charts/plotBuffers/numericBuffer.d.ts +1 -1
  611. package/types/src/charts/plotBuffers/rectLikeBuffer.d.ts +25 -0
  612. package/types/src/charts/polar/chrome.d.ts +62 -0
  613. package/types/src/charts/polar/config.d.ts +21 -0
  614. package/types/src/charts/polar/geometry.d.ts +68 -0
  615. package/types/src/charts/polar/labels.d.ts +87 -0
  616. package/types/src/charts/polar/polarFacet.d.ts +33 -0
  617. package/types/src/charts/polar/wedgeLayout.d.ts +81 -0
  618. package/types/src/charts/viz/Viz.d.ts +24 -24
  619. package/types/src/charts/viz/VizBase.d.ts +59 -204
  620. package/types/src/charts/viz/backgroundInk.d.ts +15 -0
  621. package/types/src/charts/viz/labelDefaults.d.ts +11 -0
  622. package/types/src/charts/viz/reserveContainerSize.d.ts +15 -0
  623. package/types/src/charts/viz/resetChromeBoxes.d.ts +4 -0
  624. package/types/src/charts/viz/shapeClassTargets.d.ts +25 -0
  625. package/types/src/charts/viz/shapeHover.d.ts +10 -0
  626. package/types/src/charts/viz/simpleHover.d.ts +9 -0
  627. package/types/src/charts/viz/vizDefaults.d.ts +10 -0
  628. package/types/src/charts/viz/vizFields.d.ts +199 -0
  629. package/types/src/charts/viz/vizTypes.d.ts +107 -39
  630. package/types/src/components/Axis/Axis.d.ts +59 -4
  631. package/types/src/components/Axis/axisBreak.d.ts +86 -0
  632. package/types/src/components/Axis/axisDefaults.d.ts +11 -0
  633. package/types/src/components/Axis/axisEndLabels.d.ts +37 -0
  634. package/types/src/components/Axis/axisLabelThinning.d.ts +48 -0
  635. package/types/src/components/Axis/axisLayout.d.ts +10 -0
  636. package/types/src/components/Axis/axisLayoutLabels.d.ts +30 -0
  637. package/types/src/components/Axis/axisLayoutScale.d.ts +13 -2
  638. package/types/src/components/Axis/axisRender.d.ts +1 -30
  639. package/types/src/components/Axis/axisRounding.d.ts +14 -0
  640. package/types/src/components/Axis/axisScene.d.ts +33 -0
  641. package/types/src/components/Axis/brokenScale.d.ts +66 -0
  642. package/types/src/components/Axis/gridStroke.d.ts +8 -0
  643. package/types/src/components/Axis/timeValues.d.ts +63 -0
  644. package/types/src/components/Axis/yearValues.d.ts +21 -0
  645. package/types/src/components/TextBox.d.ts +1 -36
  646. package/types/src/components/textBoxLayout.d.ts +45 -0
  647. package/types/src/components/tooltipDom.d.ts +30 -0
  648. package/types/src/fluent.d.ts +103 -34
  649. package/types/src/shapes/Box.d.ts +12 -1
  650. package/types/src/shapes/Shape.d.ts +2 -3
  651. package/types/src/shapes/Whisker.d.ts +4 -1
  652. package/types/src/shapes/emitLabels.d.ts +15 -0
  653. package/types/src/shapes/shapeConfig.d.ts +35 -5
  654. package/types/src/shapes/shapeOwners.d.ts +10 -0
  655. package/types/src/shapes/shapeStandalone.d.ts +7 -0
  656. package/types/src/shapes/uniqueIds.d.ts +6 -0
  657. package/types/src/shapes/validateShapeConfig.d.ts +20 -3
  658. package/types/src/utils/BaseClass.d.ts +6 -0
  659. package/types/src/utils/D3Scale.d.ts +3 -0
  660. package/types/src/utils/D3plusConfig.d.ts +940 -99
  661. package/types/src/utils/configPrep.d.ts +3 -2
  662. package/types/src/utils/configWarnings.d.ts +5 -0
  663. package/types/src/utils/index.d.ts +1 -1
  664. package/types/src/utils/wholeWords.d.ts +28 -0
  665. package/umd/d3plus-core.full.js +74785 -75059
  666. package/umd/d3plus-core.full.min.js +2 -10702
  667. package/umd/d3plus-core.js +44707 -23629
  668. package/umd/d3plus-core.min.js +2 -6671
  669. package/es/index.js.map +0 -1
  670. package/es/internal.js.map +0 -1
  671. package/es/src/charts/AreaPlot/index.js.map +0 -1
  672. package/es/src/charts/BarChart/index.js.map +0 -1
  673. package/es/src/charts/BoxWhisker/index.js.map +0 -1
  674. package/es/src/charts/BumpChart/index.js.map +0 -1
  675. package/es/src/charts/Chord/applyLayout.js.map +0 -1
  676. package/es/src/charts/Chord/emit.js.map +0 -1
  677. package/es/src/charts/Chord/index.js.map +0 -1
  678. package/es/src/charts/Donut/index.js.map +0 -1
  679. package/es/src/charts/Geomap/applyLayout.js.map +0 -1
  680. package/es/src/charts/Geomap/basemapTheme.js.map +0 -1
  681. package/es/src/charts/Geomap/emit.js.map +0 -1
  682. package/es/src/charts/Geomap/index.js.map +0 -1
  683. package/es/src/charts/Histogram/binData.js.map +0 -1
  684. package/es/src/charts/Histogram/index.js.map +0 -1
  685. package/es/src/charts/LinePlot/index.js.map +0 -1
  686. package/es/src/charts/Matrix/applyLayout.js.map +0 -1
  687. package/es/src/charts/Matrix/emit.js.map +0 -1
  688. package/es/src/charts/Matrix/index.js.map +0 -1
  689. package/es/src/charts/Network/applyLayout.js.map +0 -1
  690. package/es/src/charts/Network/emit.js.map +0 -1
  691. package/es/src/charts/Network/index.js.map +0 -1
  692. package/es/src/charts/Pack/applyLayout.js.map +0 -1
  693. package/es/src/charts/Pack/emit.js.map +0 -1
  694. package/es/src/charts/Pack/index.js.map +0 -1
  695. package/es/src/charts/Pack/recursionCircles.js.map +0 -1
  696. package/es/src/charts/Pie/applyLayout.js.map +0 -1
  697. package/es/src/charts/Pie/emit.js.map +0 -1
  698. package/es/src/charts/Pie/index.js.map +0 -1
  699. package/es/src/charts/Plot/discreteSpan.js.map +0 -1
  700. package/es/src/charts/Plot/draw.js.map +0 -1
  701. package/es/src/charts/Plot/index.js.map +0 -1
  702. package/es/src/charts/Plot/insetRegion.js.map +0 -1
  703. package/es/src/charts/Plot/labelPlacement.js.map +0 -1
  704. package/es/src/charts/Plot/pipeline.js.map +0 -1
  705. package/es/src/charts/Plot/pipelineDomains.js.map +0 -1
  706. package/es/src/charts/Plot/pipelineLineLabels.js.map +0 -1
  707. package/es/src/charts/Plot/plotZoom.js.map +0 -1
  708. package/es/src/charts/Plot/shapeDefaults.js.map +0 -1
  709. package/es/src/charts/Plot/sharedHover.js.map +0 -1
  710. package/es/src/charts/Plot/sharedHoverScene.js.map +0 -1
  711. package/es/src/charts/Plot/sharedTooltip.js.map +0 -1
  712. package/es/src/charts/Plot/stackHelpers.js.map +0 -1
  713. package/es/src/charts/Plot/stackShareLabels.js.map +0 -1
  714. package/es/src/charts/Plot/stackShareTooltip.js.map +0 -1
  715. package/es/src/charts/Plot/trendLines.js.map +0 -1
  716. package/es/src/charts/Plot/trendProjection.js.map +0 -1
  717. package/es/src/charts/Plot/trendScene.js.map +0 -1
  718. package/es/src/charts/Plot/trendTooltip.js.map +0 -1
  719. package/es/src/charts/Priestley/applyLayout.js.map +0 -1
  720. package/es/src/charts/Priestley/emit.js.map +0 -1
  721. package/es/src/charts/Priestley/index.js.map +0 -1
  722. package/es/src/charts/Radar/applyLayout.js.map +0 -1
  723. package/es/src/charts/Radar/emit.js.map +0 -1
  724. package/es/src/charts/Radar/index.js.map +0 -1
  725. package/es/src/charts/RadialMatrix/applyLayout.js.map +0 -1
  726. package/es/src/charts/RadialMatrix/emit.js.map +0 -1
  727. package/es/src/charts/RadialMatrix/index.js.map +0 -1
  728. package/es/src/charts/Rings/applyLayout.js.map +0 -1
  729. package/es/src/charts/Rings/emit.js.map +0 -1
  730. package/es/src/charts/Rings/index.js.map +0 -1
  731. package/es/src/charts/Rings/ringsSizing.js.map +0 -1
  732. package/es/src/charts/Sankey/applyLayout.js.map +0 -1
  733. package/es/src/charts/Sankey/emit.js.map +0 -1
  734. package/es/src/charts/Sankey/index.js.map +0 -1
  735. package/es/src/charts/StackedArea/index.js.map +0 -1
  736. package/es/src/charts/Tree/applyLayout.js.map +0 -1
  737. package/es/src/charts/Tree/emit.js.map +0 -1
  738. package/es/src/charts/Tree/index.js.map +0 -1
  739. package/es/src/charts/Treemap/applyLayout.js.map +0 -1
  740. package/es/src/charts/Treemap/emit.js.map +0 -1
  741. package/es/src/charts/Treemap/index.js.map +0 -1
  742. package/es/src/charts/Treemap/thresholdFunction.js.map +0 -1
  743. package/es/src/charts/definition/ChartDefinition.js.map +0 -1
  744. package/es/src/charts/definition/applyDefinition.js.map +0 -1
  745. package/es/src/charts/definition/makeChart.js.map +0 -1
  746. package/es/src/charts/drawSteps/backControl.js.map +0 -1
  747. package/es/src/charts/drawSteps/bottomRightControls.js.map +0 -1
  748. package/es/src/charts/drawSteps/bottomRightControlsMarkup.js.map +0 -1
  749. package/es/src/charts/drawSteps/controlButtonStyle.js.map +0 -1
  750. package/es/src/charts/drawSteps/minimap.js.map +0 -1
  751. package/es/src/charts/drawSteps/minimapMarkup.js.map +0 -1
  752. package/es/src/charts/drawSteps/searchControls.js.map +0 -1
  753. package/es/src/charts/drawSteps/searchControlsMarkup.js.map +0 -1
  754. package/es/src/charts/drawSteps/tableView.js.map +0 -1
  755. package/es/src/charts/drawSteps/tableViewControl.js.map +0 -1
  756. package/es/src/charts/drawSteps/tableViewMarkup.js.map +0 -1
  757. package/es/src/charts/drawSteps/topLeftControls.js.map +0 -1
  758. package/es/src/charts/drawSteps/topLeftControlsMarkup.js.map +0 -1
  759. package/es/src/charts/drawSteps/zoomControls.js.map +0 -1
  760. package/es/src/charts/drawSteps/zoomControlsMarkup.js.map +0 -1
  761. package/es/src/charts/events/click.legend.js.map +0 -1
  762. package/es/src/charts/events/click.shape.js.map +0 -1
  763. package/es/src/charts/events/mouseenter.js.map +0 -1
  764. package/es/src/charts/events/mouseleave.js.map +0 -1
  765. package/es/src/charts/events/mousemove.legend.js.map +0 -1
  766. package/es/src/charts/events/mousemove.shape.js.map +0 -1
  767. package/es/src/charts/events/touchstart.body.js.map +0 -1
  768. package/es/src/charts/features/attributionFeature.js.map +0 -1
  769. package/es/src/charts/features/axes.js.map +0 -1
  770. package/es/src/charts/features/chartGeometry.js.map +0 -1
  771. package/es/src/charts/features/colorScaleBucket.js.map +0 -1
  772. package/es/src/charts/features/edgeArrows.js.map +0 -1
  773. package/es/src/charts/features/emitHelpers.js.map +0 -1
  774. package/es/src/charts/features/ensureZoomDom.js.map +0 -1
  775. package/es/src/charts/features/features.js.map +0 -1
  776. package/es/src/charts/features/featuresColorScale.js.map +0 -1
  777. package/es/src/charts/features/featuresLegend.js.map +0 -1
  778. package/es/src/charts/features/insetState.js.map +0 -1
  779. package/es/src/charts/features/legendLabel.js.map +0 -1
  780. package/es/src/charts/features/lineLabels.js.map +0 -1
  781. package/es/src/charts/features/plotPaint.js.map +0 -1
  782. package/es/src/charts/features/sceneBounds.js.map +0 -1
  783. package/es/src/charts/features/shapeEmit.js.map +0 -1
  784. package/es/src/charts/features/tooltipSwatch.js.map +0 -1
  785. package/es/src/charts/features/zoomExtent.js.map +0 -1
  786. package/es/src/charts/helpers/matrixData.js.map +0 -1
  787. package/es/src/charts/helpers/tileAttributions.js.map +0 -1
  788. package/es/src/charts/index.js.map +0 -1
  789. package/es/src/charts/pipeline/drillMorph.js.map +0 -1
  790. package/es/src/charts/pipeline/insetPlacement.js.map +0 -1
  791. package/es/src/charts/pipeline/resolveSpec.js.map +0 -1
  792. package/es/src/charts/pipeline/runChartDraw.js.map +0 -1
  793. package/es/src/charts/pipeline/runVizPipeline.js.map +0 -1
  794. package/es/src/charts/pipeline/stages.js.map +0 -1
  795. package/es/src/charts/pipeline/vizContext.js +0 -29
  796. package/es/src/charts/pipeline/vizContext.js.map +0 -1
  797. package/es/src/charts/pipeline/vizDraw.js.map +0 -1
  798. package/es/src/charts/pipeline/vizDrawPure.js +0 -220
  799. package/es/src/charts/pipeline/vizDrawPure.js.map +0 -1
  800. package/es/src/charts/pipeline/vizPreDraw.js.map +0 -1
  801. package/es/src/charts/pipeline/vizPreDrawPure.js +0 -279
  802. package/es/src/charts/pipeline/vizPreDrawPure.js.map +0 -1
  803. package/es/src/charts/plotBuffers/Bar.js.map +0 -1
  804. package/es/src/charts/plotBuffers/Box.js.map +0 -1
  805. package/es/src/charts/plotBuffers/Circle.js.map +0 -1
  806. package/es/src/charts/plotBuffers/Line.js.map +0 -1
  807. package/es/src/charts/plotBuffers/Rect.js.map +0 -1
  808. package/es/src/charts/plotBuffers/discreteBuffer.js.map +0 -1
  809. package/es/src/charts/plotBuffers/numericBuffer.js.map +0 -1
  810. package/es/src/charts/viz/Viz.js.map +0 -1
  811. package/es/src/charts/viz/VizBase.js.map +0 -1
  812. package/es/src/charts/viz/VizBaseConfig.js +0 -538
  813. package/es/src/charts/viz/VizBaseConfig.js.map +0 -1
  814. package/es/src/charts/viz/interactionOpacity.js.map +0 -1
  815. package/es/src/charts/viz/linkGroup.js.map +0 -1
  816. package/es/src/charts/viz/ordinalColor.js.map +0 -1
  817. package/es/src/charts/viz/sceneRows.js.map +0 -1
  818. package/es/src/charts/viz/trailCatchup.js.map +0 -1
  819. package/es/src/charts/viz/vizDefaults.js.map +0 -1
  820. package/es/src/charts/viz/vizRender.js.map +0 -1
  821. package/es/src/charts/viz/vizTypes.js.map +0 -1
  822. package/es/src/charts/viz/vizVisibility.js.map +0 -1
  823. package/es/src/components/Axis/Axis.js.map +0 -1
  824. package/es/src/components/Axis/AxisBottom.js.map +0 -1
  825. package/es/src/components/Axis/AxisLeft.js.map +0 -1
  826. package/es/src/components/Axis/AxisRight.js.map +0 -1
  827. package/es/src/components/Axis/AxisTop.js.map +0 -1
  828. package/es/src/components/Axis/axisLayout.js.map +0 -1
  829. package/es/src/components/Axis/axisLayoutLabels.js.map +0 -1
  830. package/es/src/components/Axis/axisLayoutScale.js.map +0 -1
  831. package/es/src/components/Axis/axisRender.js.map +0 -1
  832. package/es/src/components/ColorScale/ColorScale.js.map +0 -1
  833. package/es/src/components/ColorScale/colorScaleRender.js.map +0 -1
  834. package/es/src/components/ColorScale/colorScaleScale.js.map +0 -1
  835. package/es/src/components/Legend/Legend.js.map +0 -1
  836. package/es/src/components/Legend/legendConfig.js.map +0 -1
  837. package/es/src/components/Legend/legendRender.js.map +0 -1
  838. package/es/src/components/Message.js.map +0 -1
  839. package/es/src/components/SizeLegend/SizeLegend.js.map +0 -1
  840. package/es/src/components/SizeLegend/sizeLegendLayout.js.map +0 -1
  841. package/es/src/components/TextBox.js.map +0 -1
  842. package/es/src/components/Timeline/Timeline.js.map +0 -1
  843. package/es/src/components/Timeline/timelineConfig.js.map +0 -1
  844. package/es/src/components/Timeline/timelineRender.js.map +0 -1
  845. package/es/src/components/Tooltip.js.map +0 -1
  846. package/es/src/components/index.js.map +0 -1
  847. package/es/src/fluent.js.map +0 -1
  848. package/es/src/shapes/Area.js.map +0 -1
  849. package/es/src/shapes/Bar.js.map +0 -1
  850. package/es/src/shapes/Box.js.map +0 -1
  851. package/es/src/shapes/Circle.js.map +0 -1
  852. package/es/src/shapes/Image.js.map +0 -1
  853. package/es/src/shapes/Line.js.map +0 -1
  854. package/es/src/shapes/Path.js.map +0 -1
  855. package/es/src/shapes/Rect.js.map +0 -1
  856. package/es/src/shapes/Shape.js.map +0 -1
  857. package/es/src/shapes/Whisker.js.map +0 -1
  858. package/es/src/shapes/buildLabelData.js.map +0 -1
  859. package/es/src/shapes/emitLabels.js.map +0 -1
  860. package/es/src/shapes/hitAreaNode.js.map +0 -1
  861. package/es/src/shapes/index.js.map +0 -1
  862. package/es/src/shapes/interactionPoints.js.map +0 -1
  863. package/es/src/shapes/sceneSort.js.map +0 -1
  864. package/es/src/shapes/shapeConfig.js.map +0 -1
  865. package/es/src/shapes/textureKey.js.map +0 -1
  866. package/es/src/shapes/validateShapeConfig.js.map +0 -1
  867. package/es/src/utils/AccessorFn.js.map +0 -1
  868. package/es/src/utils/BaseClass.js.map +0 -1
  869. package/es/src/utils/D3Scale.js.map +0 -1
  870. package/es/src/utils/D3plusConfig.js.map +0 -1
  871. package/es/src/utils/RESET.js.map +0 -1
  872. package/es/src/utils/accessor.js.map +0 -1
  873. package/es/src/utils/configDefault.js.map +0 -1
  874. package/es/src/utils/configPrep.js.map +0 -1
  875. package/es/src/utils/configWarnings.js.map +0 -1
  876. package/es/src/utils/constant.js.map +0 -1
  877. package/es/src/utils/getProp.js.map +0 -1
  878. package/es/src/utils/index.js.map +0 -1
  879. package/es/src/utils/paintComponentScene.js.map +0 -1
  880. package/es/umd-entry.js +0 -16
  881. package/es/umd-entry.js.map +0 -1
  882. package/types/src/charts/AreaPlot.d.ts +0 -16
  883. package/types/src/charts/BarChart.d.ts +0 -16
  884. package/types/src/charts/BoxWhisker.d.ts +0 -11
  885. package/types/src/charts/BumpChart.d.ts +0 -36
  886. package/types/src/charts/ChartDefinition.d.ts +0 -75
  887. package/types/src/charts/Donut.d.ts +0 -11
  888. package/types/src/charts/Geomap.d.ts +0 -126
  889. package/types/src/charts/LinePlot.d.ts +0 -15
  890. package/types/src/charts/Matrix.d.ts +0 -48
  891. package/types/src/charts/Network.d.ts +0 -54
  892. package/types/src/charts/Pack.d.ts +0 -34
  893. package/types/src/charts/Pie.d.ts +0 -17
  894. package/types/src/charts/Plot.d.ts +0 -150
  895. package/types/src/charts/Priestley.d.ts +0 -37
  896. package/types/src/charts/Radar.d.ts +0 -38
  897. package/types/src/charts/RadialMatrix.d.ts +0 -63
  898. package/types/src/charts/Rings.d.ts +0 -61
  899. package/types/src/charts/Sankey.d.ts +0 -77
  900. package/types/src/charts/StackedArea.d.ts +0 -14
  901. package/types/src/charts/Tree.d.ts +0 -17
  902. package/types/src/charts/Treemap.d.ts +0 -42
  903. package/types/src/charts/Viz.d.ts +0 -90
  904. package/types/src/charts/VizBase.d.ts +0 -158
  905. package/types/src/charts/VizBaseConfig.d.ts +0 -148
  906. package/types/src/charts/applyDefinition.d.ts +0 -13
  907. package/types/src/charts/axes.d.ts +0 -134
  908. package/types/src/charts/chartGeometry.d.ts +0 -58
  909. package/types/src/charts/drawSteps/drawAttribution.d.ts +0 -7
  910. package/types/src/charts/drawSteps/drawBack.d.ts +0 -6
  911. package/types/src/charts/drawSteps/drawColorScale.d.ts +0 -6
  912. package/types/src/charts/drawSteps/drawLegend.d.ts +0 -12
  913. package/types/src/charts/drawSteps/drawSubtitle.d.ts +0 -7
  914. package/types/src/charts/drawSteps/drawTimeline.d.ts +0 -7
  915. package/types/src/charts/drawSteps/drawTitle.d.ts +0 -7
  916. package/types/src/charts/drawSteps/drawTotal.d.ts +0 -7
  917. package/types/src/charts/emitHelpers.d.ts +0 -122
  918. package/types/src/charts/ensureZoomDom.d.ts +0 -39
  919. package/types/src/charts/factories.d.ts +0 -73
  920. package/types/src/charts/features/colorScaleBucketShare.d.ts +0 -16
  921. package/types/src/charts/features.d.ts +0 -152
  922. package/types/src/charts/featuresLegend.d.ts +0 -12
  923. package/types/src/charts/legendLabel.d.ts +0 -11
  924. package/types/src/charts/lineLabels.d.ts +0 -40
  925. package/types/src/charts/makeChart.d.ts +0 -22
  926. package/types/src/charts/pipeline/vizContext.d.ts +0 -45
  927. package/types/src/charts/pipeline/vizDrawPure.d.ts +0 -46
  928. package/types/src/charts/pipeline/vizPreDrawPure.d.ts +0 -68
  929. package/types/src/charts/plotPaint.d.ts +0 -233
  930. package/types/src/charts/resolveSpec.d.ts +0 -50
  931. package/types/src/charts/runChartDraw.d.ts +0 -38
  932. package/types/src/charts/runVizPipeline.d.ts +0 -31
  933. package/types/src/charts/shapeEmit.d.ts +0 -61
  934. package/types/src/charts/stages.d.ts +0 -117
  935. package/types/src/charts/viz/VizBaseConfig.d.ts +0 -175
  936. package/types/src/charts/vizContext.d.ts +0 -46
  937. package/types/src/charts/vizDefaults.d.ts +0 -8
  938. package/types/src/charts/vizDraw.d.ts +0 -25
  939. package/types/src/charts/vizDrawPure.d.ts +0 -17
  940. package/types/src/charts/vizPreDraw.d.ts +0 -22
  941. package/types/src/charts/vizPreDrawPure.d.ts +0 -40
  942. package/types/src/charts/vizRender.d.ts +0 -8
  943. package/types/src/charts/vizTypes.d.ts +0 -202
  944. package/types/src/components/Axis.d.ts +0 -183
  945. package/types/src/components/AxisBottom.d.ts +0 -11
  946. package/types/src/components/AxisLeft.d.ts +0 -11
  947. package/types/src/components/AxisRight.d.ts +0 -11
  948. package/types/src/components/AxisTop.d.ts +0 -11
  949. package/types/src/components/ColorScale.d.ts +0 -80
  950. package/types/src/components/Legend.d.ts +0 -93
  951. package/types/src/components/Timeline.d.ts +0 -83
  952. package/types/src/components/axisLayout.d.ts +0 -27
  953. package/types/src/components/axisLayoutLabels.d.ts +0 -42
  954. package/types/src/components/axisLayoutScale.d.ts +0 -12
  955. package/types/src/components/axisRender.d.ts +0 -65
  956. package/types/src/components/colorScaleRender.d.ts +0 -15
  957. package/types/src/components/colorScaleScale.d.ts +0 -19
  958. package/types/src/components/legendConfig.d.ts +0 -7
  959. package/types/src/components/legendRender.d.ts +0 -16
  960. package/types/src/components/timelineConfig.d.ts +0 -6
  961. package/types/src/components/timelineRender.d.ts +0 -14
  962. package/umd/d3plus-core.full.js.map +0 -1
  963. package/umd/d3plus-core.js.map +0 -1
@@ -1,322 +1,3 @@
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
1
  import { select } from "d3-selection";
321
2
  import { date, getSize } from "@d3plus/dom";
322
3
  import { computeTrailCatchup } from "./trailCatchup.js";
@@ -328,36 +9,19 @@ import { initInsetDefaults, insetComponentScene } from "../features/insetState.j
328
9
  import { applyZoomPointerEvents, bindCanvasZoom } from "../drawSteps/zoomControls.js";
329
10
  import { initVizDefaults } from "./vizDefaults.js";
330
11
  import { unregisterLink } from "./linkGroup.js";
12
+ import { facetPanelAt, withFacetPanel } from "../facet/facetPanel.js";
331
13
  import { vizRender } from "./vizRender.js";
332
14
  import { vizDraw } from "../pipeline/vizDraw.js";
333
15
  import { vizPreDraw } from "../pipeline/vizPreDraw.js";
16
+ import { handlerDatum, shapeClassTargets } from "./shapeClassTargets.js";
334
17
  /**
335
18
  Stamps `interactionGroup` onto a component's scene subtree so the pointer
336
19
  bridge can route its nodes to component-scoped handlers (e.g. legend) on
337
20
  every backend — including Canvas, where there is no per-shape DOM to walk.
338
21
  */ function tagInteractionGroup(node, group) {
339
22
  node.interactionGroup = group;
340
- var kids = node.children;
341
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
342
- if (kids) try {
343
- for(var _iterator = kids[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
344
- var child = _step.value;
345
- tagInteractionGroup(child, group);
346
- }
347
- } catch (err) {
348
- _didIteratorError = true;
349
- _iteratorError = err;
350
- } finally{
351
- try {
352
- if (!_iteratorNormalCompletion && _iterator.return != null) {
353
- _iterator.return();
354
- }
355
- } finally{
356
- if (_didIteratorError) {
357
- throw _iteratorError;
358
- }
359
- }
360
- }
23
+ const kids = node.children;
24
+ if (kids) for (const child of kids)tagInteractionGroup(child, group);
361
25
  }
362
26
  /**
363
27
  Resolves the element a renderer mounts into. A `<canvas>` cannot paint inside
@@ -365,529 +29,344 @@ import { vizPreDraw } from "../pipeline/vizPreDraw.js";
365
29
  into that svg's parent (the user's element); the emptied, position:absolute
366
30
  compute svg overlays the same top-left box. SVG mounts into the target as-is.
367
31
  */ function mountTargetFor(kind, target) {
368
- var _target_parentNode;
369
- 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;
32
+ if (kind === "canvas" && typeof Element !== "undefined" && target instanceof Element && target.tagName.toLowerCase() === "svg") return target.parentNode ?? target;
370
33
  return target;
371
34
  }
372
- var Viz = /*#__PURE__*/ function(VizBase) {
373
- "use strict";
374
- _inherits(Viz, VizBase);
375
- function Viz() {
376
- _class_call_check(this, Viz);
377
- var _this;
378
- _this = _call_super(this, Viz);
379
- initVizDefaults(_this);
380
- initInsetDefaults(_this);
381
- return _this;
35
+ /**
36
+ The base class every d3plus chart extends. Owns the shared configuration surface (data, groupBy, size and color accessors, title, legend, tooltip, timeline, zoom, table view) and the render lifecycle that each chart type's definition plugs its layout into. Not used directly; see the chart classes (BarChart, Treemap, …).
37
+ */ export default class Viz extends VizBase {
38
+ /**
39
+ Invoked when creating a new class instance, and sets any default parameters.
40
+ @private
41
+ */ constructor(){
42
+ super();
43
+ initVizDefaults(this);
44
+ initInsetDefaults(this);
382
45
  }
383
- _create_class(Viz, [
384
- {
385
- /**
46
+ /**
386
47
  Called by draw before anything is drawn. Formats the data and performs preparations for draw.
387
48
  @private
388
- */ key: "_preDraw",
389
- value: function _preDraw() {
390
- vizPreDraw(this);
391
- }
392
- },
393
- {
394
- /**
49
+ */ _preDraw() {
50
+ vizPreDraw(this);
51
+ }
52
+ /**
395
53
  Composes a backend-agnostic scene graph from the shapes/features produced
396
54
  by the most recent render. Combines:
397
55
  - `_chartScene` (cells from `chartDef.emit`, or `Plot._paint` for the
398
56
  paint-driven Plot family) wrapped in viz-chart-cells
399
- - `_shapes` (still used by some charts) — each shape's toScene
400
57
  - chart-level components (Legend/ColorScale/Timeline) via their toScene
401
58
  - `_featurePanels` (from FeatureModule layouts) wrapped in viz-features
402
- */ key: "toScene",
403
- value: function toScene() {
404
- var children = [];
405
- // Chart cells stashed on _chartScene — via `chartDef.emit(ctx)` for
406
- // data-driven charts, or `Plot._paint` for the paint-driven Plot family.
407
- // Wraps in three groups:
408
- // viz-chart-cells (clip window, untransformed)
409
- // viz-zoom (zoom transform — pan/scale from d3-zoom)
410
- // viz-chart-body (chart-positioning transform)
411
- // … chart scene children
412
- // This lets zoom apply to the chart content WITHOUT moving legend/
413
- // title/total/etc. (which live in sibling viz-* groups, not under
414
- // viz-chart-cells). The zoom transform sits above the chart transform so
415
- // it lives in the same surface space d3-zoom measures the pointer in —
416
- // a wheel zoom stays anchored under the cursor regardless of margins or
417
- // a chart's own centering transform (Pie, Radar, …).
418
- if (this._chartScene && this._chartScene.length) {
419
- var _this__zoomTransform, _this__chartClip;
420
- var sliced = applyInteractionOpacity(this._chartScene, this);
421
- // Always emit the viz-zoom group (identity transform when no zoom is
422
- // active) so its key is stable across the first zoom. Otherwise the first
423
- // zoom adds a brand-new group → the renderer treats the chart cells as
424
- // exit+enter (teardown/rebuild) instead of tweening the group transform,
425
- // so the zoom snaps in instead of animating.
426
- var zoomNode = [
59
+ */ toScene() {
60
+ const children = [];
61
+ // Chart cells stashed on _chartScene — via `chartDef.emit(ctx)` for
62
+ // data-driven charts, or `Plot._paint` for the paint-driven Plot family.
63
+ // Wraps in three groups:
64
+ // viz-chart-cells (clip window, untransformed)
65
+ // viz-zoom (zoom transform — pan/scale from d3-zoom)
66
+ // viz-chart-body (chart-positioning transform)
67
+ // … chart scene children
68
+ // This lets zoom apply to the chart content WITHOUT moving legend/
69
+ // title/total/etc. (which live in sibling viz-* groups, not under
70
+ // viz-chart-cells). The zoom transform sits above the chart transform so
71
+ // it lives in the same surface space d3-zoom measures the pointer in —
72
+ // a wheel zoom stays anchored under the cursor regardless of margins or
73
+ // a chart's own centering transform (Pie, Radar, …).
74
+ if (this._chartScene && this._chartScene.length) {
75
+ const sliced = applyInteractionOpacity(this._chartScene, this);
76
+ // Always emit the viz-zoom group (identity transform when no zoom is
77
+ // active) so its key is stable across the first zoom. Otherwise the first
78
+ // zoom adds a brand-new group → the renderer treats the chart cells as
79
+ // exit+enter (teardown/rebuild) instead of tweening the group transform,
80
+ // so the zoom snaps in instead of animating.
81
+ const zoomNode = [
82
+ {
83
+ type: "group",
84
+ key: "viz-zoom",
85
+ transform: this._zoomTransform ?? {
86
+ x: 0,
87
+ y: 0,
88
+ scale: 1
89
+ },
90
+ children: [
427
91
  {
428
92
  type: "group",
429
- key: "viz-zoom",
430
- transform: (_this__zoomTransform = this._zoomTransform) !== null && _this__zoomTransform !== void 0 ? _this__zoomTransform : {
431
- x: 0,
432
- y: 0,
433
- scale: 1
434
- },
435
- children: [
436
- _object_spread_props(_object_spread({
437
- type: "group",
438
- key: "viz-chart-body"
439
- }, this._chartTransform ? {
440
- transform: this._chartTransform
441
- } : {}), {
442
- children: sliced
443
- })
444
- ]
445
- }
446
- ];
447
- // Fixed clip window (e.g. Geomap's map rect): stays put in scene space
448
- // while the viz-zoom child transform pans/scales content beneath it.
449
- // Any zoomable chart without its own clip is clipped to the chart area,
450
- // so zoomed content can't spill over the legend/title/timeline.
451
- var clip = (_this__chartClip = this._chartClip) !== null && _this__chartClip !== void 0 ? _this__chartClip : this.schema.zoom && this._margin ? chartAreaRect(this) : undefined;
452
- children.push(_object_spread_props(_object_spread({
453
- type: "group",
454
- key: "viz-chart-cells"
455
- }, clip ? {
456
- clip: clip
457
- } : {}), {
458
- children: zoomNode
459
- }));
460
- }
461
- // `_shapes` collection (Treemap/Pack/etc. route through `_chartScene`
462
- // instead, as does Plot's `absorbShapeIntoChartScene`). Any caller
463
- // pushing into `_shapes` gets its `toScene()` walked here; we read the
464
- // shape's `_select` transform via d3's transform baseVal if present,
465
- // otherwise emit without a transform.
466
- (this._shapes || []).forEach(function(shape, si) {
467
- if (!shape || typeof shape.toScene !== "function") return;
468
- var group = shape.toScene();
469
- var transform;
470
- var sel = shape._select;
471
- if (sel && typeof sel.attr === "function") {
472
- // Parse `translate(x, y)` from the selection's transform attr.
473
- // Falls back to undefined for non-translate transforms — the
474
- // `_shapes` path only uses translate.
475
- var t = sel.attr("transform");
476
- if (typeof t === "string") {
477
- var m = t.match(/translate\(\s*(-?[\d.]+)[, ]\s*(-?[\d.]+)\s*\)/);
478
- if (m) transform = {
479
- x: parseFloat(m[1]),
480
- y: parseFloat(m[2])
481
- };
93
+ key: "viz-chart-body",
94
+ ...this._chartTransform ? {
95
+ transform: this._chartTransform
96
+ } : {},
97
+ children: sliced
482
98
  }
483
- }
484
- children.push(_object_spread_props(_object_spread({
485
- type: "group",
486
- key: "".concat(group.key || "shape", "-").concat(si)
487
- }, transform ? {
488
- transform: transform
489
- } : {}), {
490
- children: group.children
491
- }));
492
- });
493
- // Chart-level components that have their own toScene.
494
- var components = [
495
- [
496
- "legend",
497
- this._legendClass
498
- ],
499
- [
500
- "colorScale",
501
- this._colorScaleClass
502
- ],
503
- [
504
- "timeline",
505
- this._timelineClass
506
99
  ]
507
- ];
508
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
509
- try {
510
- for(var _iterator = components[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
511
- var _step_value = _sliced_to_array(_step.value, 2), name = _step_value[0], comp = _step_value[1];
512
- if (comp && typeof comp.toScene === "function" && comp._select && typeof comp._select.node === "function" && comp._select.node()) {
513
- var compScene = comp.toScene();
514
- // Tag the legend subtree so its swatches route to legend handlers via
515
- // the node stamp (renderer-independent), not just SVG DOM ancestry.
516
- if (name === "legend") {
517
- tagInteractionGroup(compScene, "legend");
518
- // Hovering a legend swatch dims the others, like the chart marks:
519
- // run the legend subtree through the same interaction-opacity pass
520
- // (a no-op when no hover/active predicate is set).
521
- compScene = applyInteractionOpacity([
522
- compScene
523
- ], this)[0];
524
- } else if (name === "colorScale") {
525
- compScene = applyColorScaleBucketOpacity([
526
- compScene
527
- ], this)[0];
528
- } else if (name === "timeline") tagInteractionGroup(compScene, "timeline");
529
- children.push({
530
- type: "group",
531
- key: "viz-".concat(name),
532
- children: name === "timeline" ? [
533
- compScene
534
- ] : insetComponentScene(this, name, compScene, comp.outerBounds())
535
- });
536
- }
537
- }
538
- } catch (err) {
539
- _didIteratorError = true;
540
- _iteratorError = err;
541
- } finally{
542
- try {
543
- if (!_iteratorNormalCompletion && _iterator.return != null) {
544
- _iterator.return();
545
- }
546
- } finally{
547
- if (_didIteratorError) {
548
- throw _iteratorError;
549
- }
550
- }
551
100
  }
552
- // E2: FeatureModule.layout() panels (title/subtitle/total, plus the
553
- // zoom/top-left-controls/attribution overlays appended post-draw).
554
- if (this._featurePanels && this._featurePanels.length) {
555
- children.push({
556
- type: "group",
557
- key: "viz-features",
558
- children: this._featurePanels
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
- };
101
+ ];
102
+ // Fixed clip window (e.g. Geomap's map rect): stays put in scene space
103
+ // while the viz-zoom child transform pans/scales content beneath it.
104
+ // Any zoomable chart without its own clip is clipped to the chart area,
105
+ // so zoomed content can't spill over the legend/title/timeline.
106
+ const clip = this._chartClip ?? (this.schema.zoom && this._margin ? chartAreaRect(this) : undefined);
107
+ children.push({
108
+ type: "group",
109
+ key: "viz-chart-cells",
110
+ ...clip ? {
111
+ clip
112
+ } : {},
113
+ children: zoomNode
114
+ });
115
+ }
116
+ // Chart-level components that have their own toScene.
117
+ const components = [
118
+ [
119
+ "legend",
120
+ this._legendClass
121
+ ],
122
+ [
123
+ "colorScale",
124
+ this._colorScaleClass
125
+ ],
126
+ [
127
+ "timeline",
128
+ this._timelineClass
129
+ ]
130
+ ];
131
+ for (const [name, comp] of components){
132
+ if (comp && typeof comp.toScene === "function" && comp._select && typeof comp._select.node === "function" && comp._select.node()) {
133
+ let compScene = comp.toScene();
134
+ // Tag the legend subtree so its swatches route to legend handlers via
135
+ // the node stamp (renderer-independent), not just SVG DOM ancestry.
136
+ if (name === "legend") {
137
+ tagInteractionGroup(compScene, "legend");
138
+ // Hovering a legend swatch dims the others, like the chart marks:
139
+ // run the legend subtree through the same interaction-opacity pass
140
+ // (a no-op when no hover/active predicate is set).
141
+ compScene = applyInteractionOpacity([
142
+ compScene
143
+ ], this)[0];
144
+ } else if (name === "colorScale") {
145
+ compScene = applyColorScaleBucketOpacity([
146
+ compScene
147
+ ], this)[0];
148
+ } else if (name === "timeline") tagInteractionGroup(compScene, "timeline");
149
+ children.push({
150
+ type: "group",
151
+ key: `viz-${name}`,
152
+ children: name === "timeline" ? [
153
+ compScene
154
+ ] : insetComponentScene(this, name, compScene, comp.outerBounds())
155
+ });
570
156
  }
571
- },
572
- {
573
- /**
157
+ }
158
+ // E2: FeatureModule.layout() panels (title/subtitle/total, plus the
159
+ // zoom/top-left-controls/attribution overlays appended post-draw).
160
+ if (this._featurePanels && this._featurePanels.length) {
161
+ children.push({
162
+ type: "group",
163
+ key: "viz-features",
164
+ children: this._featurePanels
165
+ });
166
+ }
167
+ return {
168
+ width: this.schema.width,
169
+ height: this.schema.height,
170
+ root: {
171
+ type: "group",
172
+ key: "viz-root",
173
+ children
174
+ }
175
+ };
176
+ }
177
+ /**
574
178
  Called by render once all checks are passed.
575
179
  @private
576
- */ key: "_draw",
577
- value: function _draw() {
578
- vizDraw(this);
579
- }
580
- },
581
- {
582
- /**
180
+ */ _draw() {
181
+ vizDraw(this);
182
+ }
183
+ /**
583
184
  The chart's size-legend radius scale (see `ChartDefinition.sizeLegendScale`).
584
185
  Charts that size marks override this; the base chart sizes nothing.
585
186
  @private
586
- */ key: "_sizeLegendScale",
587
- value: function _sizeLegendScale(_available) {
588
- return null;
589
- }
590
- },
591
- {
592
- /**
187
+ */ _sizeLegendScale(_available) {
188
+ return null;
189
+ }
190
+ /**
593
191
  The region chart chrome may be drawn inside, with the chart's mark boxes
594
192
  as obstacles (see `ChartDefinition.insetRegion`). Charts that leave
595
193
  negative space override this; the base chart offers none.
596
194
  @private
597
- */ key: "_insetRegion",
598
- value: function _insetRegion() {
599
- return null;
600
- }
601
- },
602
- {
603
- /**
195
+ */ _insetRegion() {
196
+ return null;
197
+ }
198
+ /**
604
199
  * Applies the threshold algorithm according to the type of chart used.
605
200
  * @param {Array} data The data to process.
606
201
  * @private
607
- */ key: "_thresholdFunction",
608
- value: function _thresholdFunction(data, _tree) {
609
- return data;
610
- }
611
- },
612
- {
613
- /**
202
+ */ _thresholdFunction(data, _tree) {
203
+ return data;
204
+ }
205
+ /**
614
206
  * Detects width and height and sets SVG properties
615
207
  * @private
616
- */ key: "_setSVGSize",
617
- value: function _setSVGSize(width, height) {
618
- var _ref = _sliced_to_array(width && height ? [
619
- width,
620
- height
621
- ] : getSize(this._select.node().parentNode), 2), w = _ref[0], h = _ref[1];
622
- w -= parseFloat(this._select.style("border-left-width"));
623
- w -= parseFloat(this._select.style("border-right-width"));
624
- h -= parseFloat(this._select.style("border-top-width"));
625
- h -= parseFloat(this._select.style("border-bottom-width"));
626
- if (this._autoWidth && this.schema.width !== w) {
627
- this.width(w);
628
- this._select.style("width", "".concat(this.schema.width, "px")).attr("width", "".concat(this.schema.width, "px"));
629
- }
630
- if (this._autoHeight && this.schema.height !== h) {
631
- this.height(h);
632
- this._select.style("height", "".concat(this.schema.height, "px")).attr("height", "".concat(this.schema.height, "px"));
633
- }
634
- }
635
- },
636
- {
637
- /**
208
+ */ _setSVGSize(width, height) {
209
+ let [w, h] = width && height ? [
210
+ width,
211
+ height
212
+ ] : getSize(this._select.node().parentNode);
213
+ w -= parseFloat(this._select.style("border-left-width"));
214
+ w -= parseFloat(this._select.style("border-right-width"));
215
+ h -= parseFloat(this._select.style("border-top-width"));
216
+ h -= parseFloat(this._select.style("border-bottom-width"));
217
+ if (this._autoWidth) this._measuredWidth = w;
218
+ if (this._autoHeight) this._measuredHeight = h;
219
+ if (this._autoWidth && this.schema.width !== w) {
220
+ this.width(w);
221
+ this._select.style("width", `${this.schema.width}px`).attr("width", `${this.schema.width}px`);
222
+ }
223
+ if (this._autoHeight && this.schema.height !== h) {
224
+ this.height(h);
225
+ this._select.style("height", `${this.schema.height}px`).attr("height", `${this.schema.height}px`);
226
+ }
227
+ }
228
+ /**
638
229
  Draws the visualization given the specified configuration.
639
230
  @param callback Optional callback invoked after rendering completes.
640
- */ key: "render",
641
- value: function render(callback) {
642
- return vizRender(this, callback);
643
- }
644
- },
645
- {
646
- /**
231
+ */ render(callback) {
232
+ return vizRender(this, callback);
233
+ }
234
+ /**
647
235
  Serializes the most recently rendered output to an SVG string. Returns
648
236
  `""` if the chart has not been rendered yet. Both backends support this:
649
237
  the SVG backend returns its live `<svg>`, the canvas backend re-renders the
650
238
  retained scene through a throwaway SVG backend. Primarily used for
651
239
  server-side rendering (see `@d3plus/ssr`).
652
- */ key: "toSVGString",
653
- value: function toSVGString() {
654
- var _ref;
655
- var _this__sceneRenderer_toSVGString, _this__sceneRenderer;
656
- return (_ref = (_this__sceneRenderer = this._sceneRenderer) === null || _this__sceneRenderer === void 0 ? void 0 : (_this__sceneRenderer_toSVGString = _this__sceneRenderer.toSVGString) === null || _this__sceneRenderer_toSVGString === void 0 ? void 0 : _this__sceneRenderer_toSVGString.call(_this__sceneRenderer)) !== null && _ref !== void 0 ? _ref : "";
657
- }
658
- },
659
- {
660
- /**
240
+ */ toSVGString() {
241
+ return this._sceneRenderer?.toSVGString?.() ?? "";
242
+ }
243
+ /**
661
244
  Returns the underlying canvas element of the most recent render when the
662
245
  canvas backend is active (`renderer("canvas")`), or `undefined` otherwise.
663
246
  Server-side callers cast this to their native canvas to encode a raster
664
247
  (see `@d3plus/ssr`).
665
- */ key: "toCanvas",
666
- value: function toCanvas() {
667
- var _this__sceneRenderer_toCanvas, _this__sceneRenderer;
668
- return this._renderer === "canvas" ? (_this__sceneRenderer = this._sceneRenderer) === null || _this__sceneRenderer === void 0 ? void 0 : (_this__sceneRenderer_toCanvas = _this__sceneRenderer.toCanvas) === null || _this__sceneRenderer_toCanvas === void 0 ? void 0 : _this__sceneRenderer_toCanvas.call(_this__sceneRenderer) : undefined;
669
- }
670
- },
671
- {
672
- key: "renderer",
673
- value: function renderer(_) {
674
- if (!arguments.length) return this._renderer;
675
- this._renderer = _ === "canvas" ? "canvas" : "svg";
676
- return this;
677
- }
678
- },
679
- {
680
- key: "renderMode",
681
- value: function renderMode(_) {
682
- if (!arguments.length) return this._renderMode || "full";
683
- this._renderMode = _;
684
- return this;
685
- }
686
- },
687
- {
688
- key: "renderScene",
689
- value: /**
690
- Public entry point that renders this chart through the @d3plus/render
691
- pluggable backends. The compute pass happens via render() (in an svg
692
- auto-created inside the target div); SvgRenderer/CanvasRenderer paints
693
- the scene to the target. Returns `{renderer, scene}` so callers can
694
- interact with the renderer (e.g. for picking) or read the scene data.
695
- */ function renderScene(target, opts) {
696
- return _async_to_generator(function() {
697
- var _this, kind;
698
- return _ts_generator(this, function(_state) {
699
- switch(_state.label){
700
- case 0:
701
- _this = this;
702
- kind = (opts === null || opts === void 0 ? void 0 : opts.kind) || (this._renderer === "canvas" ? "canvas" : "svg");
703
- this._sceneTarget = target;
704
- this._renderer = kind;
705
- this.select(target);
706
- return [
707
- 4,
708
- new Promise(function(resolve) {
709
- return _this.render(function() {
710
- return resolve();
711
- });
712
- })
713
- ];
714
- case 1:
715
- _state.sent();
716
- return [
717
- 2,
718
- {
719
- renderer: this._sceneRenderer,
720
- scene: this._lastSceneRendered
721
- }
722
- ];
723
- }
724
- });
725
- }).call(this);
726
- }
727
- },
728
- {
729
- /**
248
+ */ toCanvas() {
249
+ return this._renderer === "canvas" ? this._sceneRenderer?.toCanvas?.() : undefined;
250
+ }
251
+ renderer(_) {
252
+ if (!arguments.length) return this._renderer;
253
+ this._renderer = _ === "canvas" ? "canvas" : "svg";
254
+ return this;
255
+ }
256
+ /**
730
257
  Renders this chart through the @d3plus/render pluggable backends. Called
731
258
  automatically by `render()`. The compute pass draws into `this._select`
732
259
  (an auto-created svg INSIDE the user's target div) — that svg is the
733
260
  off-stage detached compute svg. SvgRenderer mounts to the user's target
734
261
  div (the parent), as a sibling to the detached compute svg. The compute
735
262
  svg's children get cleared so only the scene output is visible.
736
- */ key: "_drawSceneToTarget",
737
- value: function _drawSceneToTarget(durationOverride) {
738
- var _this = this;
739
- var _Math;
740
- var _this__sceneRenderer, _this__sceneRenderer_target, _this__sceneRenderer1;
741
- var kind = this._renderer === "canvas" ? "canvas" : "svg";
742
- var computeSvg = this._select && this._select.node ? this._select.node() : null;
743
- if (!computeSvg) return;
744
- // Mount renderer INSIDE the user's `_select` (svg or div). Tests like
745
- // `svgA.querySelector('[data-key="viz-legend"]')` need the scene output
746
- // to live inside the user's container, not as a sibling.
747
- var userTarget = this._sceneTarget || computeSvg;
748
- if (!userTarget) return;
749
- var mountTarget = mountTargetFor(kind, userTarget);
750
- var scene = this.toScene();
751
- var w = this.schema.width || 400;
752
- var h = this.schema.height || 300;
753
- // Reuse the renderer instance if it matches the kind, to avoid mount
754
- // churn. `target()` is the public Renderer-interface method (no
755
- // reaching into renderer-private slots). It's optional on the
756
- // interface; third-party renderers without it fall through to
757
- // remount on every draw — correct but with mount churn.
758
- 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;
759
- var containerChanged = ((_this__sceneRenderer1 = this._sceneRenderer) === null || _this__sceneRenderer1 === void 0 ? void 0 : _this__sceneRenderer1.target) ? currentContainer !== mountTarget : false;
760
- if (!this._sceneRenderer || this._sceneRenderer.kind !== kind || containerChanged) {
761
- // Tear down the outgoing renderer before mounting a fresh one. It owns
762
- // its own DOM (canvas/svg + overlay host), pointer listeners, and
763
- // transition timers; without this, switching kind (svg<->canvas) or
764
- // container orphans that DOM in the user's element, stacking the old
765
- // mode's output behind the new one and accumulating on every switch.
766
- if (this._sceneRenderer && typeof this._sceneRenderer.destroy === "function") this._sceneRenderer.destroy();
767
- var Ctor = kind === "canvas" ? CanvasRenderer : SvgRenderer;
768
- this._sceneRenderer = new Ctor();
769
- // `_scenePixelRatio`, when set (e.g. by @d3plus/ssr for hi-res PNG output),
770
- // fixes the canvas backing-store scale; otherwise the renderer falls back
771
- // to `devicePixelRatio`.
772
- this._sceneRenderer.mount({
773
- container: mountTarget,
774
- width: w,
775
- height: h,
776
- pixelRatio: this._scenePixelRatio
777
- });
778
- // Bridge renderer pointer events → viz.schema.on handlers. Without this,
779
- // tooltips never fire on the v4 scene-rendered path because
780
- // `shape.on(evt, fn)` in plotPaint only wires d3-selection
781
- // listeners on DOM nodes the scene renderer doesn't create.
782
- // Renderer events carry the picked scene node; the routing lives in
783
- // `_routeSceneEvent` (kept out of this method so the mount path stays
784
- // readable). `_lastScenePick` remembers the most recently hovered node
785
- // so `mouseleave` — fired with a null pick — can still tell the matching
786
- // handlers which shape/legend item was left (so the tooltip clears).
787
- this._lastScenePick = null;
788
- this._sceneRenderer.on(function(event) {
789
- return _this._routeSceneEvent(event);
790
- });
791
- } else {
792
- this._sceneRenderer.resize(w, h);
793
- }
794
- // `durationOverride` defaults to the chart's `_duration` for normal
795
- // re-renders. Interaction handlers (zoomed, hover, etc.) pass 0 to
796
- // skip the transition machinery — animating every wheel/drag tick
797
- // accumulates `setTimeout(duration+10)` per event.
798
- var drawDuration = durationOverride !== undefined ? durationOverride : this._instantNextDraw ? 0 : this.schema.duration;
799
- // A duration>0 render (drill-down, zoom, re-center) must win over any
800
- // pending coalesced duration-0 repaint — otherwise that repaint fires on
801
- // the next frame and interrupts this transition, snapping shapes to their
802
- // final geometry.
803
- if (drawDuration > 0 && this._sceneRepaintRAF != null) {
804
- cancelAnimationFrame(this._sceneRepaintRAF);
805
- this._sceneRepaintRAF = undefined;
806
- }
807
- // Mark the window during which an animated transition is in flight, so the
808
- // pointer bridge can ignore interaction until it settles. A hover/click
809
- // mid-transition would schedule a duration-0 repaint that interrupts the
810
- // running transition and snaps it to its end (the glitchy jump). Matches
811
- // the SvgRenderer/CanvasRenderer `duration + 10` end timer, plus a small
812
- // buffer so events re-enable just after the paint completes.
813
- if (drawDuration > 0) this._transitionEndsAt = Date.now() + drawDuration + 30;
814
- // Order persistent motion trails in time by the current timeline period, so
815
- // they grow only as playback moves forward and rewind when it steps back.
816
- // Only when the timeline selects a single period (`brushing: false`): a range
817
- // selection has no single "current time", which would scramble the step
818
- // logic, so we withhold the sequence and trails fall back to ephemeral.
819
- // Normalize to milliseconds via `date()` — the selection mixes Date objects
820
- // (brush/initial) and raw period numbers (playback), which compare on wildly
821
- // different scales otherwise, scrambling the forward/backward test.
822
- var sel = this._timelineSelection;
823
- var brushing = this._timelineClass ? this._timelineClass.schema.brushing !== false : true;
824
- var sequence = !brushing && Array.isArray(sel) && sel.length ? (_Math = Math).max.apply(_Math, _to_consumable_array(sel.map(function(v) {
825
- return Number(date(Number(v)));
826
- }))) : undefined;
827
- // A forward jump that skips periods (manual click, not single-step play) draws
828
- // one coarse segment; compute the marks' real positions at the skipped periods
829
- // so the trail bends through them (see render commitTrailCatchups).
830
- var trailCatchup = sequence !== undefined && this._trailSeq !== undefined && sequence > this._trailSeq ? computeTrailCatchup(this, scene, this._trailSeq, sequence) : undefined;
831
- if (sequence !== undefined) this._trailSeq = sequence;
832
- this._sceneRenderer.drawScene(scene, {
833
- duration: drawDuration,
834
- sequence: sequence,
835
- trailCatchup: trailCatchup,
836
- // The drill-down morph's resolved boxes for this draw, if a drill
837
- // click armed one (resolveDrillMorph, run just before this method via
838
- // runVizPipeline). One-shot: cleared right below so a later repaint
839
- // that reaches this method by some OTHER path (a zoom/pan tick, a
840
- // coalesced hover repaint, Rings' click-to-recenter) never inherits a
841
- // stale box from an earlier drill click.
842
- enterFrom: this._resolvedEnterFrom,
843
- enterFromBody: this._resolvedEnterFromBody,
844
- exitTo: this._resolvedExitTo,
845
- exitToBody: this._resolvedExitToBody,
846
- instantExitKey: this._resolvedInstantExitKey,
847
- reunionEnterKey: this._resolvedReunionEnterKey,
848
- reunionEnterFrom: this._resolvedReunionEnterFrom,
849
- instantExitAll: this._resolvedInstantExitAll
850
- });
851
- this._resolvedEnterFrom = undefined;
852
- this._resolvedEnterFromBody = undefined;
853
- this._resolvedExitTo = undefined;
854
- this._resolvedExitToBody = undefined;
855
- this._resolvedInstantExitKey = undefined;
856
- this._resolvedReunionEnterKey = undefined;
857
- this._resolvedReunionEnterFrom = undefined;
858
- this._resolvedInstantExitAll = undefined;
859
- this._lastSceneRendered = scene;
860
- // Canvas backend: the compute <svg> (`_select`) is an emptied overlay
861
- // sitting on top of the <canvas>. An svg root hit-tests its whole box, so
862
- // even empty it swallows the pointer events the canvas needs for
863
- // tooltip/hover/legend picking — the symptom being "renders fine, no
864
- // tooltips." Make the overlay transparent to pointer events so the canvas
865
- // is the sole interaction surface. The only interactive DOM that still
866
- // lives in this svg is the timeline's d3-brush (the canvas can't host the
867
- // native brush handles), so re-enable events on just that group. On the
868
- // SVG backend `_select` IS the scene host, so events must stay enabled
869
- // (except while the zoom brush is active — see `applyZoomPointerEvents`).
870
- applyZoomPointerEvents(this);
871
- if (this._select && kind === "canvas") this._select.select("g.d3plus-viz-timeline").style("pointer-events", "auto");
872
- if (kind === "canvas") bindCanvasZoom(this);
873
- // The timeline brush (d3-brush DOM, mounted in `g.d3plus-viz-timeline` in
874
- // the outer svg) must paint above the scene-rendered timeline buttons/ticks
875
- // so its selection tint + handles sit on top of them (matching v3). The
876
- // renderer appends its scene <svg> last, so without this the brush layer
877
- // ends up behind it — the selection's translucent fill is then hidden by
878
- // the opaque buttons and only the edge handles peek out.
879
- if (kind === "svg") {
880
- var host = userTarget && typeof userTarget.querySelector === "function" ? userTarget : null;
881
- var tlGroup = host ? host.querySelector(":scope > g.d3plus-viz-timeline") : null;
882
- if (tlGroup) host.appendChild(tlGroup);
883
- // Likewise the zoom brush, so its selection box draws over the shapes.
884
- var zoomBrush = host ? host.querySelector(":scope > g.d3plus-zoom-brush") : null;
885
- if (zoomBrush && zoomBrush !== host.lastElementChild) host.appendChild(zoomBrush);
886
- }
887
- }
888
- },
889
- {
890
- /**
263
+ */ _drawSceneToTarget(durationOverride) {
264
+ const kind = this._renderer === "canvas" ? "canvas" : "svg";
265
+ const computeSvg = this._select && this._select.node ? this._select.node() : null;
266
+ if (!computeSvg) return;
267
+ // Mount renderer INSIDE the user's `_select` (svg or div). Tests like
268
+ // `svgA.querySelector('[data-key="viz-legend"]')` need the scene output
269
+ // to live inside the user's container, not as a sibling.
270
+ const mountTarget = mountTargetFor(kind, computeSvg);
271
+ const scene = this.toScene();
272
+ this._paintedScene = scene;
273
+ const w = this.schema.width || 400;
274
+ const h = this.schema.height || 300;
275
+ this._ensureSceneRenderer(kind, mountTarget, w, h);
276
+ // `durationOverride` defaults to the chart's `_duration` for normal
277
+ // re-renders. Interaction handlers (zoomed, hover, etc.) pass 0 to
278
+ // skip the transition machinery — animating every wheel/drag tick
279
+ // accumulates `setTimeout(duration+10)` per event.
280
+ const drawDuration = durationOverride !== undefined ? durationOverride : this._instantNextDraw ? 0 : this.schema.duration;
281
+ // A duration>0 render (drill-down, zoom, re-center) must win over any
282
+ // pending coalesced duration-0 repaint — otherwise that repaint fires on
283
+ // the next frame and interrupts this transition, snapping shapes to their
284
+ // final geometry.
285
+ if (drawDuration > 0 && this._sceneRepaintRAF != null) {
286
+ cancelAnimationFrame(this._sceneRepaintRAF);
287
+ this._sceneRepaintRAF = undefined;
288
+ }
289
+ // Mark the window during which an animated transition is in flight, so the
290
+ // pointer bridge can ignore interaction until it settles. A hover/click
291
+ // mid-transition would schedule a duration-0 repaint that interrupts the
292
+ // running transition and snaps it to its end (the glitchy jump). Matches
293
+ // the SvgRenderer/CanvasRenderer `duration + 10` end timer, plus a small
294
+ // buffer so events re-enable just after the paint completes.
295
+ if (drawDuration > 0) this._transitionEndsAt = Date.now() + drawDuration + 30;
296
+ // Order persistent motion trails in time by the current timeline period, so
297
+ // they grow only as playback moves forward and rewind when it steps back.
298
+ // Only when the timeline selects a single period (`brushing: false`): a range
299
+ // selection has no single "current time", which would scramble the step
300
+ // logic, so we withhold the sequence and trails fall back to ephemeral.
301
+ // Normalize to milliseconds via `date()` — the selection mixes Date objects
302
+ // (brush/initial) and raw period numbers (playback), which compare on wildly
303
+ // different scales otherwise, scrambling the forward/backward test.
304
+ const sel = this._timelineSelection;
305
+ const brushing = this._timelineClass ? this._timelineClass.schema.brushing !== false : true;
306
+ const sequence = !brushing && Array.isArray(sel) && sel.length ? Math.max(...sel.map((v)=>Number(date(Number(v))))) : undefined;
307
+ // A forward jump that skips periods (manual click, not single-step play) draws
308
+ // one coarse segment; compute the marks' real positions at the skipped periods
309
+ // so the trail bends through them (see render commitTrailCatchups).
310
+ const trailCatchup = sequence !== undefined && this._trailSeq !== undefined && sequence > this._trailSeq ? computeTrailCatchup(this, scene, this._trailSeq, sequence) : undefined;
311
+ if (sequence !== undefined) this._trailSeq = sequence;
312
+ this._sceneRenderer.drawScene(scene, {
313
+ duration: drawDuration,
314
+ sequence,
315
+ trailCatchup,
316
+ // The drill-down morph's resolved boxes for this draw, if a drill
317
+ // click armed one (resolveDrillMorph, run just before this method via
318
+ // runVizPipeline). One-shot: cleared right below so a later repaint
319
+ // that reaches this method by some OTHER path (a zoom/pan tick, a
320
+ // coalesced hover repaint, Rings' click-to-recenter) never inherits a
321
+ // stale box from an earlier drill click.
322
+ enterFrom: this._resolvedEnterFrom,
323
+ enterFromBody: this._resolvedEnterFromBody,
324
+ exitTo: this._resolvedExitTo,
325
+ exitToBody: this._resolvedExitToBody,
326
+ instantExitKey: this._resolvedInstantExitKey,
327
+ reunionEnterKey: this._resolvedReunionEnterKey,
328
+ reunionEnterFrom: this._resolvedReunionEnterFrom,
329
+ instantExitAll: this._resolvedInstantExitAll
330
+ });
331
+ this._resolvedEnterFrom = undefined;
332
+ this._resolvedEnterFromBody = undefined;
333
+ this._resolvedExitTo = undefined;
334
+ this._resolvedExitToBody = undefined;
335
+ this._resolvedInstantExitKey = undefined;
336
+ this._resolvedReunionEnterKey = undefined;
337
+ this._resolvedReunionEnterFrom = undefined;
338
+ this._resolvedInstantExitAll = undefined;
339
+ this._lastSceneRendered = scene;
340
+ // Canvas backend: the compute <svg> (`_select`) is an emptied overlay
341
+ // sitting on top of the <canvas>. An svg root hit-tests its whole box, so
342
+ // even empty it swallows the pointer events the canvas needs for
343
+ // tooltip/hover/legend picking — the symptom being "renders fine, no
344
+ // tooltips." Make the overlay transparent to pointer events so the canvas
345
+ // is the sole interaction surface. The only interactive DOM that still
346
+ // lives in this svg is the timeline's d3-brush (the canvas can't host the
347
+ // native brush handles), so re-enable events on just that group. On the
348
+ // SVG backend `_select` IS the scene host, so events must stay enabled
349
+ // (except while the zoom brush is active — see `applyZoomPointerEvents`).
350
+ applyZoomPointerEvents(this);
351
+ if (this._select && kind === "canvas") this._select.selectAll("g.d3plus-viz-timeline, g.d3plus-viz-brush").style("pointer-events", "auto");
352
+ if (kind === "canvas") bindCanvasZoom(this);
353
+ // The timeline brush (d3-brush DOM, mounted in `g.d3plus-viz-timeline` in
354
+ // the outer svg) must paint above the scene-rendered timeline buttons/ticks
355
+ // so its selection tint + handles sit on top of them (matching v3). The
356
+ // renderer appends its scene <svg> last, so without this the brush layer
357
+ // ends up behind it — the selection's translucent fill is then hidden by
358
+ // the opaque buttons and only the edge handles peek out.
359
+ if (kind === "svg") {
360
+ const host = typeof computeSvg.querySelector === "function" ? computeSvg : null;
361
+ const tlGroup = host ? host.querySelector(":scope > g.d3plus-viz-timeline") : null;
362
+ if (tlGroup) host.appendChild(tlGroup);
363
+ // Likewise the zoom brush and any chart-owned brush layer (`g.d3plus-viz-brush`), so their selections draw over the shapes.
364
+ host?.querySelectorAll(":scope > g.d3plus-zoom-brush, :scope > g.d3plus-viz-brush").forEach((layer)=>{
365
+ if (layer !== host.lastElementChild) host.appendChild(layer);
366
+ });
367
+ }
368
+ }
369
+ /**
891
370
  Resolves the `(d, i, x)` a picked scene node reports to interaction
892
371
  handlers (tooltip, click, user `on` handlers). `pick.datum` is the raw
893
372
  scene datum; for a Plot shape that's the wrapped record `{data, i}`, which
@@ -896,30 +375,79 @@ var Viz = /*#__PURE__*/ function(VizBase) {
896
375
  multi-point shapes (Line/Area) so a series tooltip reflects the hovered
897
376
  x rather than the whole-series aggregate.
898
377
  @private
899
- */ key: "_interactionDatum",
900
- value: function _interactionDatum(pick, _event) {
901
- var _pick_index;
902
- var rawDatum = pick.datum;
903
- var sourceDatum = rawDatum && rawDatum.data ? rawDatum.data : rawDatum;
904
- var sourceIndex = rawDatum && typeof rawDatum.i === "number" ? rawDatum.i : (_pick_index = pick.index) !== null && _pick_index !== void 0 ? _pick_index : 0;
905
- return {
906
- d: sourceDatum,
907
- i: sourceIndex,
908
- x: rawDatum
909
- };
910
- }
911
- },
912
- {
913
- /**
378
+ */ _interactionDatum(pick, _event) {
379
+ return handlerDatum(pick.datum, pick.index ?? 0);
380
+ }
381
+ /**
914
382
  Pointer hook run by `_routeSceneEvent` before any handler routing, for
915
383
  every event including ones over empty space. No-op here; Plot overrides
916
384
  it to drive the shared multi-series tooltip and crosshair.
917
385
  @private
918
- */ key: "_sharedHover",
919
- value: function _sharedHover(_event) {}
920
- },
921
- {
922
- /**
386
+ */ _sharedHover(_event) {}
387
+ /**
388
+ The chart's small-multiple hooks (see `ChartDefinition.facet`). The base
389
+ chart has none: each panel draws the way the whole chart does.
390
+ @private
391
+ */ _facetHooks() {
392
+ return {};
393
+ }
394
+ /**
395
+ Reuses the scene renderer when it matches `kind` and `mountTarget`
396
+ (resizing it to `w` × `h`), or tears it down and mounts a fresh one
397
+ bridged to the chart's pointer handlers.
398
+ @private
399
+ */ _ensureSceneRenderer(kind, mountTarget, w, h) {
400
+ // Reuse the renderer instance if it matches the kind, to avoid mount
401
+ // churn. `target()` is the public Renderer-interface method (no
402
+ // reaching into renderer-private slots). It's optional on the
403
+ // interface; third-party renderers without it fall through to
404
+ // remount on every draw — correct but with mount churn.
405
+ const currentContainer = this._sceneRenderer?.target ? this._sceneRenderer.target()?.container : undefined;
406
+ const containerChanged = this._sceneRenderer?.target ? currentContainer !== mountTarget : false;
407
+ if (!this._sceneRenderer || this._sceneRenderer.kind !== kind || containerChanged) {
408
+ // Tear down the outgoing renderer before mounting a fresh one. It owns
409
+ // its own DOM (canvas/svg + overlay host), pointer listeners, and
410
+ // transition timers; without this, switching kind (svg<->canvas) or
411
+ // container orphans that DOM in the user's element, stacking the old
412
+ // mode's output behind the new one and accumulating on every switch.
413
+ if (this._sceneRenderer && typeof this._sceneRenderer.destroy === "function") this._sceneRenderer.destroy();
414
+ const Ctor = kind === "canvas" ? CanvasRenderer : SvgRenderer;
415
+ this._sceneRenderer = new Ctor();
416
+ // `_scenePixelRatio`, when set (e.g. by @d3plus/ssr for hi-res PNG output),
417
+ // fixes the canvas backing-store scale; otherwise the renderer falls back
418
+ // to `devicePixelRatio`.
419
+ this._sceneRenderer.mount({
420
+ container: mountTarget,
421
+ width: w,
422
+ height: h,
423
+ pixelRatio: this._scenePixelRatio
424
+ });
425
+ // Bridge renderer pointer events → viz.schema.on handlers. Without this,
426
+ // tooltips never fire on the v4 scene-rendered path because
427
+ // `shape.on(evt, fn)` in plotPaint only wires d3-selection
428
+ // listeners on DOM nodes the scene renderer doesn't create.
429
+ // Renderer events carry the picked scene node; the routing lives in
430
+ // `_routeSceneEvent` (kept out of this method so the mount path stays
431
+ // readable). `_lastScenePick` remembers the most recently hovered node
432
+ // so `mouseleave` — fired with a null pick — can still tell the matching
433
+ // handlers which shape/legend item was left (so the tooltip clears).
434
+ this._lastScenePick = null;
435
+ this._sceneRenderer.on((event)=>this._routeSceneEvent(event));
436
+ } else {
437
+ this._sceneRenderer.resize(w, h);
438
+ }
439
+ }
440
+ /**
441
+ Routes a renderer pointer event to the chart's handlers. Over a
442
+ small-multiples panel, the handlers run with that panel's chart state in
443
+ place (see `facet/facetPanel.ts`), so code written for one chart reads the
444
+ panel under the pointer.
445
+ @private
446
+ */ _routeSceneEvent(event) {
447
+ const viz = this;
448
+ withFacetPanel(viz, facetPanelAt(viz, event.point), ()=>this._dispatchSceneEvent(event));
449
+ }
450
+ /**
923
451
  Routes a renderer pointer event to the matching `viz.schema.on` handlers.
924
452
  Bridges the v4 scene-rendered path (SvgRenderer/CanvasRenderer), where
925
453
  compute-mode shapes mount no per-shape DOM, so `shape.on(evt, fn)`
@@ -928,99 +456,97 @@ var Viz = /*#__PURE__*/ function(VizBase) {
928
456
  shape (+ shape-class-scoped) handlers, and chrome (axis/timeline/back) is
929
457
  excluded. Split out of `_drawSceneToTarget` to keep that method small.
930
458
  @private
931
- */ key: "_routeSceneEvent",
932
- value: function _routeSceneEvent(event) {
933
- var _this = this;
934
- // Ignore all pointer interaction while an animated transition (zoom,
935
- // re-center, drill-down, entrance) is in flight. Hovering or clicking a
936
- // shape mid-transition would fire a handler that schedules a duration-0
937
- // repaint, interrupting the running transition and snapping it to its end
938
- // — the glitchy jump. `_transitionEndsAt` is stamped by `_drawSceneToTarget`
939
- // for the transition's duration; it lapses on its own, so interaction
940
- // resumes the instant the transition settles.
941
- // Runs for every event, picked or not, so a chart can track the pointer
942
- // across empty space (Plot's shared tooltip + crosshair) — and ahead of
943
- // the transition guard below, so leaving mid-transition still clears it.
944
- this._sharedHover(event);
945
- if (this._transitionEndsAt && Date.now() < this._transitionEndsAt) return;
946
- var pick = event.pick;
947
- // Dispatch helper shared by the live-pick path and the leave path.
948
- var fire = function fire(key, d, i, x) {
949
- var fn = _this.schema.on && _this.schema.on[key];
950
- if (typeof fn === "function") {
951
- try {
952
- fn.call(_this, d, i, x, event.nativeEvent);
953
- } catch (unused) {
954
- // swallow per-event errors so one bad handler doesn't
955
- // break subsequent events.
956
- }
957
- }
958
- };
959
- if (event.type === "mouseleave") {
960
- var lastPick = this._lastScenePick;
961
- if (lastPick) {
962
- fire("mouseleave.".concat(lastPick.isLegend ? "legend" : "shape"), lastPick.d, lastPick.i, lastPick.x);
963
- if (!lastPick.isLegend && lastPick.shapeType) fire("mouseleave.".concat(lastPick.shapeType), lastPick.d, lastPick.i, lastPick.x);
964
- fire("mouseleave", lastPick.d, lastPick.i, lastPick.x);
965
- }
966
- this._lastScenePick = null;
967
- // Cleared here, then re-set by the enter/move the renderer fires
968
- // synchronously when the pointer crosses to an adjacent node — so a
969
- // shape→label hand-off leaves `_hoverDatum` pointing at the new node
970
- // (same datum), which `mouseleave` reads to suppress a flicker.
971
- this._hoverDatum = null;
972
- return;
973
- }
974
- if (!pick || !pick.node) return;
975
- // Scene nodes carry interaction metadata stamped by Viz.toScene.
976
- var nodeAny = pick.node;
977
- // Axis ticks/labels, the timeline, and Plot's trend lines are chrome —
978
- // they carry data but are not chart shapes, so they must not fire shape
979
- // tooltips/handlers (a trend line's own tooltip runs in `_sharedHover`).
980
- if (nodeAny.interactionGroup === "axis" || nodeAny.interactionGroup === "timeline" || nodeAny.interactionGroup === "trend") return;
981
- // Prefer the node's stamped interaction group (set by Viz.toScene), so
982
- // legend swatches route to legend handlers on Canvas too — where the
983
- // single canvas element has no per-shape DOM to walk. Fall back to SVG
984
- // DOM ancestry for nodes the stamp didn't reach.
985
- var target = event.nativeEvent && event.nativeEvent.target;
986
- var isLegendNode = nodeAny.interactionGroup === "legend" || (target && typeof target.closest === "function" ? !!target.closest('[data-key="viz-legend"]') : false);
987
- var suffix = isLegendNode ? "legend" : "shape";
988
- var handlerKey = "".concat(event.type, ".").concat(suffix);
989
- // Resolve the datum + index this pick reports to handlers, ONCE, and reuse
990
- // it for every handler fired below so tooltip/click/user handlers agree on
991
- // which datum the pointer is over. The base unwraps the node's raw datum to
992
- // its source row; Plot overrides `_interactionDatum` to report the point
993
- // nearest the cursor for multi-point shapes (Line/Area).
994
- var _this__interactionDatum = this._interactionDatum(pick, event), sourceDatum = _this__interactionDatum.d, sourceIndex = _this__interactionDatum.i, rawDatum = _this__interactionDatum.x;
995
- var shapeType = typeof nodeAny.shapeType === "string" ? nodeAny.shapeType : null;
996
- this._lastScenePick = {
997
- d: sourceDatum,
998
- i: sourceIndex,
999
- x: rawDatum,
1000
- isLegend: isLegendNode,
1001
- shapeType: shapeType,
1002
- // The live picked node's own geometry, read synchronously by clickShape
1003
- // (before the drill-down re-render replaces this frame) to arm the
1004
- // forward drill-down morph.
1005
- node: pick.node
1006
- };
1007
- this._hoverDatum = rawDatum;
1008
- fire(handlerKey, sourceDatum, sourceIndex, rawDatum);
1009
- // Shape-class-scoped handlers (`"click.Bar"`, `"mousemove.Circle"`). The
1010
- // emitting shape stamps its type onto the node; on the scene path this is
1011
- // the only place these fire (compute-mode shapes wire no DOM listeners).
1012
- // Legend nodes are excluded so a legend swatch's shape type can't
1013
- // masquerade as a chart-shape handler.
1014
- if (!isLegendNode && shapeType) {
1015
- fire("".concat(event.type, ".").concat(shapeType), sourceDatum, sourceIndex, rawDatum);
459
+ */ _dispatchSceneEvent(event) {
460
+ // Ignore all pointer interaction while an animated transition (zoom,
461
+ // re-center, drill-down, entrance) is in flight. Hovering or clicking a
462
+ // shape mid-transition would fire a handler that schedules a duration-0
463
+ // repaint, interrupting the running transition and snapping it to its end
464
+ // — the glitchy jump. `_transitionEndsAt` is stamped by `_drawSceneToTarget`
465
+ // for the transition's duration; it lapses on its own, so interaction
466
+ // resumes the instant the transition settles.
467
+ // Runs for every event, picked or not, so a chart can track the pointer
468
+ // across empty space (Plot's shared tooltip + crosshair) — and ahead of
469
+ // the transition guard below, so leaving mid-transition still clears it.
470
+ this._sharedHover(event);
471
+ if (this._transitionEndsAt && Date.now() < this._transitionEndsAt) return;
472
+ const pick = event.pick;
473
+ // Dispatch helper shared by the live-pick path and the leave path.
474
+ const fire = (key, d, i, x)=>{
475
+ const fn = this.schema.on && this.schema.on[key];
476
+ if (typeof fn === "function") {
477
+ try {
478
+ fn.call(this, d, i, x, event.nativeEvent);
479
+ } catch {
480
+ // swallow per-event errors so one bad handler doesn't
481
+ // break subsequent events.
1016
482
  }
1017
- // Also fire the un-suffixed handler (e.g. "mousemove") so user-registered
1018
- // global handlers see the event too.
1019
- fire(event.type, sourceDatum, sourceIndex, rawDatum);
1020
483
  }
1021
- },
1022
- {
1023
- /**
484
+ };
485
+ if (event.type === "mouseleave") {
486
+ const lastPick = this._lastScenePick;
487
+ if (lastPick) {
488
+ fire(`mouseleave.${lastPick.isLegend ? "legend" : "shape"}`, lastPick.d, lastPick.i, lastPick.x);
489
+ for (const t of lastPick.shapeTargets)fire(`mouseleave.${t.shapeType}`, t.d, t.i, t.x);
490
+ fire("mouseleave", lastPick.d, lastPick.i, lastPick.x);
491
+ }
492
+ this._lastScenePick = null;
493
+ // Cleared here, then re-set by the enter/move the renderer fires
494
+ // synchronously when the pointer crosses to an adjacent node — so a
495
+ // shape→label hand-off leaves `_hoverDatum` pointing at the new node
496
+ // (same datum), which `mouseleave` reads to suppress a flicker.
497
+ this._hoverDatum = null;
498
+ return;
499
+ }
500
+ if (!pick || !pick.node) return;
501
+ // Scene nodes carry interaction metadata stamped by Viz.toScene.
502
+ const nodeAny = pick.node;
503
+ // Axis ticks/labels, the timeline, and Plot's trend lines are chrome —
504
+ // they carry data but are not chart shapes, so they must not fire shape
505
+ // tooltips/handlers (a trend line's own tooltip runs in `_sharedHover`).
506
+ if (nodeAny.interactionGroup === "axis" || nodeAny.interactionGroup === "timeline" || nodeAny.interactionGroup === "trend") return;
507
+ // Prefer the node's stamped interaction group (set by Viz.toScene), so
508
+ // legend swatches route to legend handlers on Canvas too — where the
509
+ // single canvas element has no per-shape DOM to walk. Fall back to SVG
510
+ // DOM ancestry for nodes the stamp didn't reach.
511
+ const target = event.nativeEvent && event.nativeEvent.target;
512
+ const isLegendNode = nodeAny.interactionGroup === "legend" || (target && typeof target.closest === "function" ? !!target.closest('[data-key="viz-legend"]') : false);
513
+ const suffix = isLegendNode ? "legend" : "shape";
514
+ const handlerKey = `${event.type}.${suffix}`;
515
+ // Resolve the datum + index this pick reports to handlers, ONCE, and reuse
516
+ // it for every handler fired below so tooltip/click/user handlers agree on
517
+ // which datum the pointer is over. The base unwraps the node's raw datum to
518
+ // its source row; Plot overrides `_interactionDatum` to report the point
519
+ // nearest the cursor for multi-point shapes (Line/Area).
520
+ const { d: sourceDatum, i: sourceIndex, x: rawDatum } = this._interactionDatum(pick, event);
521
+ // Shape-class-scoped handlers (`"click.Bar"`, `"mousemove.Circle"`): the
522
+ // node's own shape type, then any composite it is a part of (`"click.Box"`
523
+ // on a box's whisker). On the scene path this is the only place these fire
524
+ // (compute-mode shapes wire no DOM listeners). Legend nodes are excluded so
525
+ // a legend swatch's shape type can't masquerade as a chart-shape handler.
526
+ const shapeTargets = isLegendNode ? [] : shapeClassTargets(pick.node, {
527
+ d: sourceDatum,
528
+ i: sourceIndex,
529
+ x: rawDatum
530
+ });
531
+ this._lastScenePick = {
532
+ d: sourceDatum,
533
+ i: sourceIndex,
534
+ x: rawDatum,
535
+ isLegend: isLegendNode,
536
+ shapeTargets,
537
+ // The live picked node's own geometry, read synchronously by clickShape
538
+ // (before the drill-down re-render replaces this frame) to arm the
539
+ // forward drill-down morph.
540
+ node: pick.node
541
+ };
542
+ this._hoverDatum = rawDatum;
543
+ fire(handlerKey, sourceDatum, sourceIndex, rawDatum);
544
+ for (const t of shapeTargets)fire(`${event.type}.${t.shapeType}`, t.d, t.i, t.x);
545
+ // Also fire the un-suffixed handler (e.g. "mousemove") so user-registered
546
+ // global handlers see the event too.
547
+ fire(event.type, sourceDatum, sourceIndex, rawDatum);
548
+ }
549
+ /**
1024
550
  Coalesces interaction-driven scene repaints (hover/active dimming) into a
1025
551
  single paint per animation frame. A fast pointer sweep across a dense
1026
552
  chart fires a hover transition per shape crossed; painting each one
@@ -1028,70 +554,56 @@ var Viz = /*#__PURE__*/ function(VizBase) {
1028
554
  thread (~200ms stalls) so the tooltip couldn't reposition and appeared
1029
555
  stuck at its last spot. Only the latest hover state is visible, so the
1030
556
  intermediate paints are wasted — collapse them to one rAF-scheduled draw.
1031
- */ key: "_scheduleSceneRepaint",
1032
- value: function _scheduleSceneRepaint() {
1033
- var _this = this;
1034
- if (!this._sceneRenderer) return;
1035
- if (typeof requestAnimationFrame !== "function") {
1036
- this._drawSceneToTarget(0);
1037
- return;
1038
- }
1039
- if (this._sceneRepaintRAF != null) return;
1040
- this._sceneRepaintRAF = requestAnimationFrame(function() {
1041
- _this._sceneRepaintRAF = undefined;
1042
- _this._drawSceneToTarget(0);
1043
- });
1044
- }
1045
- },
1046
- {
1047
- /**
557
+ */ _scheduleSceneRepaint() {
558
+ if (!this._sceneRenderer) return;
559
+ if (typeof requestAnimationFrame !== "function") {
560
+ this._drawSceneToTarget(0);
561
+ return;
562
+ }
563
+ if (this._sceneRepaintRAF != null) return;
564
+ this._sceneRepaintRAF = requestAnimationFrame(()=>{
565
+ this._sceneRepaintRAF = undefined;
566
+ this._drawSceneToTarget(0);
567
+ });
568
+ }
569
+ /**
1048
570
  Tears down the visualization: disconnects the ResizeObserver, stops listening for web font loads, and removes DOM event listeners. Call this when unmounting to avoid memory leaks.
1049
- */ key: "destroy",
1050
- value: function destroy() {
1051
- var _this__resizeObserver, _this__fontsUnsubscribe, _this, _this__visibleUnobserve, _this1, _this__unloadUnobserve, _this2;
1052
- unregisterLink(this);
1053
- (_this__resizeObserver = this._resizeObserver) === null || _this__resizeObserver === void 0 ? void 0 : _this__resizeObserver.disconnect();
1054
- (_this__fontsUnsubscribe = (_this = this)._fontsUnsubscribe) === null || _this__fontsUnsubscribe === void 0 ? void 0 : _this__fontsUnsubscribe.call(_this);
1055
- this._fontsUnsubscribe = undefined;
1056
- this._tooltipClass.data([]).render();
1057
- select("body").on("touchstart.".concat(this._uuid), null);
1058
- // Clear the visibility/resize/scroll poll timers + scroll listener
1059
- // so a destroyed chart doesn't keep firing intervals/timeouts that
1060
- // hold the entire viz instance alive. Without this, an SPA that
1061
- // mounts/unmounts charts on tab switches leaks the scene tree +
1062
- // a 200ms-interval timer per leaked chart.
1063
- if (this._visiblePoll) {
1064
- this._visiblePoll = clearInterval(this._visiblePoll);
1065
- }
1066
- if (this._resizePoll) {
1067
- this._resizePoll = clearTimeout(this._resizePoll);
1068
- }
1069
- if (this._scrollPoll) {
1070
- this._scrollPoll = clearTimeout(this._scrollPoll);
1071
- }
1072
- (_this__visibleUnobserve = (_this1 = this)._visibleUnobserve) === null || _this__visibleUnobserve === void 0 ? void 0 : _this__visibleUnobserve.call(_this1);
1073
- this._visibleUnobserve = undefined;
1074
- (_this__unloadUnobserve = (_this2 = this)._unloadUnobserve) === null || _this__unloadUnobserve === void 0 ? void 0 : _this__unloadUnobserve.call(_this2);
1075
- this._unloadUnobserve = undefined;
1076
- if (this._sceneRepaintRAF != null) {
1077
- if (typeof cancelAnimationFrame === "function") cancelAnimationFrame(this._sceneRepaintRAF);
1078
- this._sceneRepaintRAF = undefined;
1079
- }
1080
- if (this.schema.scrollContainer) select(this.schema.scrollContainer).on("scroll.".concat(this._uuid), null);
1081
- // Destroy the active scene renderer (clears its own pointer-rect
1082
- // listeners, overlay host, canvas/svg DOM, timers).
1083
- if (this._sceneRenderer && typeof this._sceneRenderer.destroy === "function") {
1084
- this._sceneRenderer.destroy();
1085
- this._sceneRenderer = undefined;
1086
- }
1087
- return this;
1088
- }
571
+ */ destroy() {
572
+ unregisterLink(this);
573
+ this._resizeObserver?.disconnect();
574
+ this._fontsUnsubscribe?.();
575
+ this._fontsUnsubscribe = undefined;
576
+ this._tooltipClass.data([]).render();
577
+ select("body").on(`touchstart.${this._uuid}`, null);
578
+ // Clear the visibility/resize/scroll poll timers + scroll listener
579
+ // so a destroyed chart doesn't keep firing intervals/timeouts that
580
+ // hold the entire viz instance alive. Without this, an SPA that
581
+ // mounts/unmounts charts on tab switches leaks the scene tree +
582
+ // a 200ms-interval timer per leaked chart.
583
+ if (this._visiblePoll) {
584
+ this._visiblePoll = clearInterval(this._visiblePoll);
1089
585
  }
1090
- ]);
1091
- return Viz;
1092
- }(VizBase);
1093
- /**
1094
- The base class every d3plus chart extends. Owns the shared configuration surface (data, groupBy, size and color accessors, title, legend, tooltip, timeline, zoom, table view) and the render lifecycle that each chart type's definition plugs its layout into. Not used directly; see the chart classes (BarChart, Treemap, …).
1095
- */ export { Viz as default };
1096
-
1097
- //# sourceMappingURL=Viz.js.map
586
+ if (this._resizePoll) {
587
+ this._resizePoll = clearTimeout(this._resizePoll);
588
+ }
589
+ if (this._scrollPoll) {
590
+ this._scrollPoll = clearTimeout(this._scrollPoll);
591
+ }
592
+ this._visibleUnobserve?.();
593
+ this._visibleUnobserve = undefined;
594
+ this._unloadUnobserve?.();
595
+ this._unloadUnobserve = undefined;
596
+ if (this._sceneRepaintRAF != null) {
597
+ if (typeof cancelAnimationFrame === "function") cancelAnimationFrame(this._sceneRepaintRAF);
598
+ this._sceneRepaintRAF = undefined;
599
+ }
600
+ if (this.schema.scrollContainer) select(this.schema.scrollContainer).on(`scroll.${this._uuid}`, null);
601
+ // Destroy the active scene renderer (clears its own pointer-rect
602
+ // listeners, overlay host, canvas/svg DOM, timers).
603
+ if (this._sceneRenderer && typeof this._sceneRenderer.destroy === "function") {
604
+ this._sceneRenderer.destroy();
605
+ this._sceneRenderer = undefined;
606
+ }
607
+ return this;
608
+ }
609
+ }