@d3plus/core 4.3.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/README.md +7406 -3676
  2. package/es/index.js +3 -3
  3. package/es/index.js.map +1 -1
  4. package/es/internal.js +13 -2
  5. package/es/internal.js.map +1 -1
  6. package/es/src/charts/AreaPlot/index.js +1 -2
  7. package/es/src/charts/AreaPlot/index.js.map +1 -1
  8. package/es/src/charts/BarChart/index.js +9 -3
  9. package/es/src/charts/BarChart/index.js.map +1 -1
  10. package/es/src/charts/BoxWhisker/index.js +6 -2
  11. package/es/src/charts/BoxWhisker/index.js.map +1 -1
  12. package/es/src/charts/BumpChart/index.js +1 -2
  13. package/es/src/charts/BumpChart/index.js.map +1 -1
  14. package/es/src/charts/Chord/applyLayout.js +205 -0
  15. package/es/src/charts/Chord/applyLayout.js.map +1 -0
  16. package/es/src/charts/Chord/emit.js +220 -0
  17. package/es/src/charts/Chord/emit.js.map +1 -0
  18. package/es/src/charts/Chord/index.js +249 -0
  19. package/es/src/charts/Chord/index.js.map +1 -0
  20. package/es/src/charts/Geomap/applyLayout.js +17 -10
  21. package/es/src/charts/Geomap/applyLayout.js.map +1 -1
  22. package/es/src/charts/Geomap/basemapTheme.js +78 -0
  23. package/es/src/charts/Geomap/basemapTheme.js.map +1 -0
  24. package/es/src/charts/Geomap/emit.js +18 -9
  25. package/es/src/charts/Geomap/emit.js.map +1 -1
  26. package/es/src/charts/Geomap/index.js +74 -105
  27. package/es/src/charts/Geomap/index.js.map +1 -1
  28. package/es/src/charts/Histogram/binData.js +225 -0
  29. package/es/src/charts/Histogram/binData.js.map +1 -0
  30. package/es/src/charts/Histogram/index.js +271 -0
  31. package/es/src/charts/Histogram/index.js.map +1 -0
  32. package/es/src/charts/LinePlot/index.js +1 -2
  33. package/es/src/charts/LinePlot/index.js.map +1 -1
  34. package/es/src/charts/Matrix/emit.js +6 -0
  35. package/es/src/charts/Matrix/emit.js.map +1 -1
  36. package/es/src/charts/Matrix/index.js +1 -2
  37. package/es/src/charts/Matrix/index.js.map +1 -1
  38. package/es/src/charts/Network/applyLayout.js +52 -4
  39. package/es/src/charts/Network/applyLayout.js.map +1 -1
  40. package/es/src/charts/Network/emit.js +61 -27
  41. package/es/src/charts/Network/emit.js.map +1 -1
  42. package/es/src/charts/Network/index.js +40 -55
  43. package/es/src/charts/Network/index.js.map +1 -1
  44. package/es/src/charts/Pack/emit.js +40 -2
  45. package/es/src/charts/Pack/emit.js.map +1 -1
  46. package/es/src/charts/Pack/index.js +14 -2
  47. package/es/src/charts/Pack/index.js.map +1 -1
  48. package/es/src/charts/Pie/applyLayout.js +20 -2
  49. package/es/src/charts/Pie/applyLayout.js.map +1 -1
  50. package/es/src/charts/Pie/emit.js +277 -32
  51. package/es/src/charts/Pie/emit.js.map +1 -1
  52. package/es/src/charts/Pie/index.js +47 -3
  53. package/es/src/charts/Pie/index.js.map +1 -1
  54. package/es/src/charts/Plot/discreteSpan.js +42 -0
  55. package/es/src/charts/Plot/discreteSpan.js.map +1 -0
  56. package/es/src/charts/Plot/draw.js +3 -1
  57. package/es/src/charts/Plot/draw.js.map +1 -1
  58. package/es/src/charts/Plot/index.js +152 -17
  59. package/es/src/charts/Plot/index.js.map +1 -1
  60. package/es/src/charts/Plot/pipeline.js +48 -22
  61. package/es/src/charts/Plot/pipeline.js.map +1 -1
  62. package/es/src/charts/Plot/pipelineDomains.js +84 -8
  63. package/es/src/charts/Plot/pipelineDomains.js.map +1 -1
  64. package/es/src/charts/Plot/plotZoom.js +278 -0
  65. package/es/src/charts/Plot/plotZoom.js.map +1 -0
  66. package/es/src/charts/Plot/shapeDefaults.js +3 -3
  67. package/es/src/charts/Plot/shapeDefaults.js.map +1 -1
  68. package/es/src/charts/Plot/sharedHover.js +431 -0
  69. package/es/src/charts/Plot/sharedHover.js.map +1 -0
  70. package/es/src/charts/Plot/sharedHoverScene.js +230 -0
  71. package/es/src/charts/Plot/sharedHoverScene.js.map +1 -0
  72. package/es/src/charts/Plot/sharedTooltip.js +163 -0
  73. package/es/src/charts/Plot/sharedTooltip.js.map +1 -0
  74. package/es/src/charts/Plot/stackShareLabels.js +137 -0
  75. package/es/src/charts/Plot/stackShareLabels.js.map +1 -0
  76. package/es/src/charts/Plot/stackShareTooltip.js +31 -0
  77. package/es/src/charts/Plot/stackShareTooltip.js.map +1 -0
  78. package/es/src/charts/Plot/trendLines.js +367 -0
  79. package/es/src/charts/Plot/trendLines.js.map +1 -0
  80. package/es/src/charts/Plot/trendScene.js +220 -0
  81. package/es/src/charts/Plot/trendScene.js.map +1 -0
  82. package/es/src/charts/Plot/trendTooltip.js +160 -0
  83. package/es/src/charts/Plot/trendTooltip.js.map +1 -0
  84. package/es/src/charts/Priestley/emit.js +36 -3
  85. package/es/src/charts/Priestley/emit.js.map +1 -1
  86. package/es/src/charts/Priestley/index.js +1 -2
  87. package/es/src/charts/Priestley/index.js.map +1 -1
  88. package/es/src/charts/Radar/emit.js +4 -1
  89. package/es/src/charts/Radar/emit.js.map +1 -1
  90. package/es/src/charts/Radar/index.js +16 -4
  91. package/es/src/charts/Radar/index.js.map +1 -1
  92. package/es/src/charts/RadialMatrix/emit.js +6 -0
  93. package/es/src/charts/RadialMatrix/emit.js.map +1 -1
  94. package/es/src/charts/RadialMatrix/index.js +18 -3
  95. package/es/src/charts/RadialMatrix/index.js.map +1 -1
  96. package/es/src/charts/Rings/applyLayout.js +72 -116
  97. package/es/src/charts/Rings/applyLayout.js.map +1 -1
  98. package/es/src/charts/Rings/emit.js +75 -10
  99. package/es/src/charts/Rings/emit.js.map +1 -1
  100. package/es/src/charts/Rings/index.js +24 -5
  101. package/es/src/charts/Rings/index.js.map +1 -1
  102. package/es/src/charts/Rings/ringsSizing.js +189 -0
  103. package/es/src/charts/Rings/ringsSizing.js.map +1 -0
  104. package/es/src/charts/Sankey/emit.js +55 -11
  105. package/es/src/charts/Sankey/emit.js.map +1 -1
  106. package/es/src/charts/Sankey/index.js +8 -2
  107. package/es/src/charts/Sankey/index.js.map +1 -1
  108. package/es/src/charts/StackedArea/index.js +9 -3
  109. package/es/src/charts/StackedArea/index.js.map +1 -1
  110. package/es/src/charts/Tree/emit.js +10 -4
  111. package/es/src/charts/Tree/emit.js.map +1 -1
  112. package/es/src/charts/Tree/index.js +6 -5
  113. package/es/src/charts/Tree/index.js.map +1 -1
  114. package/es/src/charts/Treemap/emit.js +56 -3
  115. package/es/src/charts/Treemap/emit.js.map +1 -1
  116. package/es/src/charts/Treemap/index.js +1 -2
  117. package/es/src/charts/Treemap/index.js.map +1 -1
  118. package/es/src/charts/definition/ChartDefinition.js.map +1 -1
  119. package/es/src/charts/definition/makeChart.js +8 -1
  120. package/es/src/charts/definition/makeChart.js.map +1 -1
  121. package/es/src/charts/drawSteps/backControl.js +85 -0
  122. package/es/src/charts/drawSteps/backControl.js.map +1 -0
  123. package/es/src/charts/drawSteps/bottomRightControls.js +193 -0
  124. package/es/src/charts/drawSteps/bottomRightControls.js.map +1 -0
  125. package/es/src/charts/drawSteps/bottomRightControlsMarkup.js +161 -0
  126. package/es/src/charts/drawSteps/bottomRightControlsMarkup.js.map +1 -0
  127. package/es/src/charts/drawSteps/controlButtonStyle.js +108 -0
  128. package/es/src/charts/drawSteps/controlButtonStyle.js.map +1 -0
  129. package/es/src/charts/drawSteps/minimap.js +395 -0
  130. package/es/src/charts/drawSteps/minimap.js.map +1 -0
  131. package/es/src/charts/drawSteps/minimapMarkup.js +147 -0
  132. package/es/src/charts/drawSteps/minimapMarkup.js.map +1 -0
  133. package/es/src/charts/drawSteps/searchControls.js +358 -0
  134. package/es/src/charts/drawSteps/searchControls.js.map +1 -0
  135. package/es/src/charts/drawSteps/searchControlsMarkup.js +430 -0
  136. package/es/src/charts/drawSteps/searchControlsMarkup.js.map +1 -0
  137. package/es/src/charts/drawSteps/tableView.js +173 -0
  138. package/es/src/charts/drawSteps/tableView.js.map +1 -0
  139. package/es/src/charts/drawSteps/tableViewControl.js +39 -0
  140. package/es/src/charts/drawSteps/tableViewControl.js.map +1 -0
  141. package/es/src/charts/drawSteps/tableViewMarkup.js +647 -0
  142. package/es/src/charts/drawSteps/tableViewMarkup.js.map +1 -0
  143. package/es/src/charts/drawSteps/topLeftControls.js +73 -0
  144. package/es/src/charts/drawSteps/topLeftControls.js.map +1 -0
  145. package/es/src/charts/drawSteps/topLeftControlsMarkup.js +227 -0
  146. package/es/src/charts/drawSteps/topLeftControlsMarkup.js.map +1 -0
  147. package/es/src/charts/drawSteps/zoomControls.js +317 -175
  148. package/es/src/charts/drawSteps/zoomControls.js.map +1 -1
  149. package/es/src/charts/drawSteps/zoomControlsMarkup.js +280 -0
  150. package/es/src/charts/drawSteps/zoomControlsMarkup.js.map +1 -0
  151. package/es/src/charts/events/click.shape.js +24 -1
  152. package/es/src/charts/events/click.shape.js.map +1 -1
  153. package/es/src/charts/events/mouseenter.js +3 -0
  154. package/es/src/charts/events/mouseenter.js.map +1 -1
  155. package/es/src/charts/events/mouseleave.js +3 -0
  156. package/es/src/charts/events/mouseleave.js.map +1 -1
  157. package/es/src/charts/events/mousemove.shape.js +2 -0
  158. package/es/src/charts/events/mousemove.shape.js.map +1 -1
  159. package/es/src/charts/features/attributionFeature.js +137 -0
  160. package/es/src/charts/features/attributionFeature.js.map +1 -0
  161. package/es/src/charts/features/axes.js +24 -9
  162. package/es/src/charts/features/axes.js.map +1 -1
  163. package/es/src/charts/features/chartGeometry.js +16 -2
  164. package/es/src/charts/features/chartGeometry.js.map +1 -1
  165. package/es/src/charts/features/edgeArrows.js +155 -0
  166. package/es/src/charts/features/edgeArrows.js.map +1 -0
  167. package/es/src/charts/features/emitHelpers.js +32 -0
  168. package/es/src/charts/features/emitHelpers.js.map +1 -1
  169. package/es/src/charts/features/ensureZoomDom.js +63 -12
  170. package/es/src/charts/features/ensureZoomDom.js.map +1 -1
  171. package/es/src/charts/features/features.js +89 -112
  172. package/es/src/charts/features/features.js.map +1 -1
  173. package/es/src/charts/features/featuresLegend.js +53 -17
  174. package/es/src/charts/features/featuresLegend.js.map +1 -1
  175. package/es/src/charts/features/plotPaint.js +81 -29
  176. package/es/src/charts/features/plotPaint.js.map +1 -1
  177. package/es/src/charts/features/shapeEmit.js +20 -2
  178. package/es/src/charts/features/shapeEmit.js.map +1 -1
  179. package/es/src/charts/features/zoomExtent.js +185 -0
  180. package/es/src/charts/features/zoomExtent.js.map +1 -0
  181. package/es/src/charts/helpers/tileAttributions.js +26 -0
  182. package/es/src/charts/helpers/tileAttributions.js.map +1 -1
  183. package/es/src/charts/index.js +2 -0
  184. package/es/src/charts/index.js.map +1 -1
  185. package/es/src/charts/pipeline/drillMorph.js +159 -0
  186. package/es/src/charts/pipeline/drillMorph.js.map +1 -0
  187. package/es/src/charts/pipeline/runChartDraw.js +35 -1
  188. package/es/src/charts/pipeline/runChartDraw.js.map +1 -1
  189. package/es/src/charts/pipeline/runVizPipeline.js +49 -15
  190. package/es/src/charts/pipeline/runVizPipeline.js.map +1 -1
  191. package/es/src/charts/pipeline/vizDrawPure.js +52 -6
  192. package/es/src/charts/pipeline/vizDrawPure.js.map +1 -1
  193. package/es/src/charts/viz/Viz.js +103 -59
  194. package/es/src/charts/viz/Viz.js.map +1 -1
  195. package/es/src/charts/viz/VizBase.js +186 -5
  196. package/es/src/charts/viz/VizBase.js.map +1 -1
  197. package/es/src/charts/viz/VizBaseConfig.js +41 -3
  198. package/es/src/charts/viz/VizBaseConfig.js.map +1 -1
  199. package/es/src/charts/viz/ordinalColor.js +2 -2
  200. package/es/src/charts/viz/ordinalColor.js.map +1 -1
  201. package/es/src/charts/viz/vizDefaults.js +270 -58
  202. package/es/src/charts/viz/vizDefaults.js.map +1 -1
  203. package/es/src/charts/viz/vizRender.js +54 -4
  204. package/es/src/charts/viz/vizRender.js.map +1 -1
  205. package/es/src/charts/viz/vizTypes.js.map +1 -1
  206. package/es/src/charts/viz/vizVisibility.js +145 -0
  207. package/es/src/charts/viz/vizVisibility.js.map +1 -0
  208. package/es/src/components/Axis/Axis.js +18 -9
  209. package/es/src/components/Axis/Axis.js.map +1 -1
  210. package/es/src/components/Axis/axisLayoutLabels.js +2 -1
  211. package/es/src/components/Axis/axisLayoutLabels.js.map +1 -1
  212. package/es/src/components/Axis/axisRender.js +5 -1
  213. package/es/src/components/Axis/axisRender.js.map +1 -1
  214. package/es/src/components/ColorScale/ColorScale.js +11 -11
  215. package/es/src/components/ColorScale/ColorScale.js.map +1 -1
  216. package/es/src/components/ColorScale/colorScaleScale.js +22 -10
  217. package/es/src/components/ColorScale/colorScaleScale.js.map +1 -1
  218. package/es/src/components/Legend/Legend.js +8 -5
  219. package/es/src/components/Legend/Legend.js.map +1 -1
  220. package/es/src/components/Legend/legendConfig.js +87 -21
  221. package/es/src/components/Legend/legendConfig.js.map +1 -1
  222. package/es/src/components/Legend/legendRender.js +29 -22
  223. package/es/src/components/Legend/legendRender.js.map +1 -1
  224. package/es/src/components/SizeLegend/SizeLegend.js +411 -0
  225. package/es/src/components/SizeLegend/SizeLegend.js.map +1 -0
  226. package/es/src/components/SizeLegend/sizeLegendLayout.js +285 -0
  227. package/es/src/components/SizeLegend/sizeLegendLayout.js.map +1 -0
  228. package/es/src/components/Timeline/timelineConfig.js +8 -4
  229. package/es/src/components/Timeline/timelineConfig.js.map +1 -1
  230. package/es/src/components/Timeline/timelineRender.js +1 -2
  231. package/es/src/components/Timeline/timelineRender.js.map +1 -1
  232. package/es/src/components/Tooltip.js +27 -7
  233. package/es/src/components/Tooltip.js.map +1 -1
  234. package/es/src/components/index.js +1 -0
  235. package/es/src/components/index.js.map +1 -1
  236. package/es/src/shapes/Box.js +4 -2
  237. package/es/src/shapes/Box.js.map +1 -1
  238. package/es/src/shapes/Shape.js +1 -1
  239. package/es/src/shapes/Shape.js.map +1 -1
  240. package/es/src/shapes/Whisker.js +3 -2
  241. package/es/src/shapes/Whisker.js.map +1 -1
  242. package/es/src/shapes/validateShapeConfig.js +141 -0
  243. package/es/src/shapes/validateShapeConfig.js.map +1 -0
  244. package/es/src/utils/BaseClass.js +134 -4
  245. package/es/src/utils/BaseClass.js.map +1 -1
  246. package/es/src/utils/D3plusConfig.js.map +1 -1
  247. package/es/src/utils/configDefault.js +17 -0
  248. package/es/src/utils/configDefault.js.map +1 -0
  249. package/es/src/utils/configPrep.js +2 -1
  250. package/es/src/utils/configPrep.js.map +1 -1
  251. package/es/src/utils/configWarnings.js +37 -0
  252. package/es/src/utils/configWarnings.js.map +1 -0
  253. package/es/src/utils/index.js +1 -0
  254. package/es/src/utils/index.js.map +1 -1
  255. package/package.json +13 -11
  256. package/types/index.d.ts +4 -4
  257. package/types/internal.d.ts +16 -2
  258. package/types/src/charts/BarChart/index.d.ts +2 -1
  259. package/types/src/charts/Chord/applyLayout.d.ts +43 -0
  260. package/types/src/charts/Chord/emit.d.ts +10 -0
  261. package/types/src/charts/Chord/index.d.ts +19 -0
  262. package/types/src/charts/Geomap/applyLayout.d.ts +9 -1
  263. package/types/src/charts/Geomap/basemapTheme.d.ts +35 -0
  264. package/types/src/charts/Histogram/binData.d.ts +37 -0
  265. package/types/src/charts/Histogram/index.d.ts +14 -0
  266. package/types/src/charts/Network/applyLayout.d.ts +8 -0
  267. package/types/src/charts/Plot/discreteSpan.d.ts +9 -0
  268. package/types/src/charts/Plot/index.d.ts +51 -3
  269. package/types/src/charts/Plot/pipeline.d.ts +14 -0
  270. package/types/src/charts/Plot/plotZoom.d.ts +65 -0
  271. package/types/src/charts/Plot/sharedHover.d.ts +79 -0
  272. package/types/src/charts/Plot/sharedHoverScene.d.ts +11 -0
  273. package/types/src/charts/Plot/sharedTooltip.d.ts +26 -0
  274. package/types/src/charts/Plot/stackShareLabels.d.ts +21 -0
  275. package/types/src/charts/Plot/stackShareTooltip.d.ts +9 -0
  276. package/types/src/charts/Plot/trendLines.d.ts +70 -0
  277. package/types/src/charts/Plot/trendScene.d.ts +18 -0
  278. package/types/src/charts/Plot/trendTooltip.d.ts +19 -0
  279. package/types/src/charts/Rings/applyLayout.d.ts +9 -0
  280. package/types/src/charts/Rings/ringsSizing.d.ts +49 -0
  281. package/types/src/charts/StackedArea/index.d.ts +2 -1
  282. package/types/src/charts/definition/ChartDefinition.d.ts +33 -1
  283. package/types/src/charts/definition/makeChart.d.ts +2 -1
  284. package/types/src/charts/drawSteps/backControl.d.ts +29 -0
  285. package/types/src/charts/drawSteps/bottomRightControls.d.ts +26 -0
  286. package/types/src/charts/drawSteps/bottomRightControlsMarkup.d.ts +108 -0
  287. package/types/src/charts/drawSteps/controlButtonStyle.d.ts +45 -0
  288. package/types/src/charts/drawSteps/minimap.d.ts +19 -0
  289. package/types/src/charts/drawSteps/minimapMarkup.d.ts +45 -0
  290. package/types/src/charts/drawSteps/searchControls.d.ts +3 -0
  291. package/types/src/charts/drawSteps/searchControlsMarkup.d.ts +111 -0
  292. package/types/src/charts/drawSteps/tableView.d.ts +23 -0
  293. package/types/src/charts/drawSteps/tableViewControl.d.ts +21 -0
  294. package/types/src/charts/drawSteps/tableViewMarkup.d.ts +119 -0
  295. package/types/src/charts/drawSteps/topLeftControls.d.ts +32 -0
  296. package/types/src/charts/drawSteps/topLeftControlsMarkup.d.ts +72 -0
  297. package/types/src/charts/drawSteps/zoomControls.d.ts +48 -8
  298. package/types/src/charts/drawSteps/zoomControlsMarkup.d.ts +138 -0
  299. package/types/src/charts/features/attributionFeature.d.ts +21 -0
  300. package/types/src/charts/features/axes.d.ts +1 -1
  301. package/types/src/charts/features/chartGeometry.d.ts +9 -3
  302. package/types/src/charts/features/edgeArrows.d.ts +92 -0
  303. package/types/src/charts/features/emitHelpers.d.ts +19 -0
  304. package/types/src/charts/features/ensureZoomDom.d.ts +6 -2
  305. package/types/src/charts/features/features.d.ts +32 -17
  306. package/types/src/charts/features/featuresLegend.d.ts +15 -0
  307. package/types/src/charts/features/plotPaint.d.ts +40 -2
  308. package/types/src/charts/features/zoomExtent.d.ts +25 -0
  309. package/types/src/charts/index.d.ts +2 -0
  310. package/types/src/charts/pipeline/drillMorph.d.ts +29 -0
  311. package/types/src/charts/pipeline/runVizPipeline.d.ts +14 -3
  312. package/types/src/charts/viz/Viz.d.ts +18 -1
  313. package/types/src/charts/viz/VizBase.d.ts +99 -4
  314. package/types/src/charts/viz/VizBaseConfig.d.ts +25 -3
  315. package/types/src/charts/viz/vizDefaults.d.ts +155 -0
  316. package/types/src/charts/viz/vizTypes.d.ts +204 -4
  317. package/types/src/charts/viz/vizVisibility.d.ts +34 -0
  318. package/types/src/components/Axis/Axis.d.ts +2 -0
  319. package/types/src/components/Legend/legendRender.d.ts +8 -2
  320. package/types/src/components/SizeLegend/SizeLegend.d.ts +107 -0
  321. package/types/src/components/SizeLegend/sizeLegendLayout.d.ts +101 -0
  322. package/types/src/components/Tooltip.d.ts +18 -3
  323. package/types/src/components/index.d.ts +1 -0
  324. package/types/src/shapes/validateShapeConfig.d.ts +10 -0
  325. package/types/src/utils/BaseClass.d.ts +15 -1
  326. package/types/src/utils/D3plusConfig.d.ts +200 -8
  327. package/types/src/utils/configDefault.d.ts +11 -0
  328. package/types/src/utils/configWarnings.d.ts +28 -0
  329. package/types/src/utils/index.d.ts +2 -1
  330. package/umd/d3plus-core.full.js +44507 -35766
  331. package/umd/d3plus-core.full.js.map +1 -1
  332. package/umd/d3plus-core.full.min.js +7073 -4410
  333. package/umd/d3plus-core.js +16718 -9634
  334. package/umd/d3plus-core.js.map +1 -1
  335. package/umd/d3plus-core.min.js +4615 -2322
@@ -0,0 +1,411 @@
1
+ function _assert_this_initialized(self) {
2
+ if (self === void 0) {
3
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
+ }
5
+ return self;
6
+ }
7
+ function _call_super(_this, derived, args) {
8
+ derived = _get_prototype_of(derived);
9
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
10
+ }
11
+ function _class_call_check(instance, Constructor) {
12
+ if (!(instance instanceof Constructor)) {
13
+ throw new TypeError("Cannot call a class as a function");
14
+ }
15
+ }
16
+ function _defineProperties(target, props) {
17
+ for(var i = 0; i < props.length; i++){
18
+ var descriptor = props[i];
19
+ descriptor.enumerable = descriptor.enumerable || false;
20
+ descriptor.configurable = true;
21
+ if ("value" in descriptor) descriptor.writable = true;
22
+ Object.defineProperty(target, descriptor.key, descriptor);
23
+ }
24
+ }
25
+ function _create_class(Constructor, protoProps, staticProps) {
26
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
27
+ if (staticProps) _defineProperties(Constructor, staticProps);
28
+ return Constructor;
29
+ }
30
+ function _define_property(obj, key, value) {
31
+ if (key in obj) {
32
+ Object.defineProperty(obj, key, {
33
+ value: value,
34
+ enumerable: true,
35
+ configurable: true,
36
+ writable: true
37
+ });
38
+ } else {
39
+ obj[key] = value;
40
+ }
41
+ return obj;
42
+ }
43
+ function _get_prototype_of(o) {
44
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
45
+ return o.__proto__ || Object.getPrototypeOf(o);
46
+ };
47
+ return _get_prototype_of(o);
48
+ }
49
+ function _inherits(subClass, superClass) {
50
+ if (typeof superClass !== "function" && superClass !== null) {
51
+ throw new TypeError("Super expression must either be null or a function");
52
+ }
53
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
54
+ constructor: {
55
+ value: subClass,
56
+ writable: true,
57
+ configurable: true
58
+ }
59
+ });
60
+ if (superClass) _set_prototype_of(subClass, superClass);
61
+ }
62
+ function _object_spread(target) {
63
+ for(var i = 1; i < arguments.length; i++){
64
+ var source = arguments[i] != null ? arguments[i] : {};
65
+ var ownKeys = Object.keys(source);
66
+ if (typeof Object.getOwnPropertySymbols === "function") {
67
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
68
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
69
+ }));
70
+ }
71
+ ownKeys.forEach(function(key) {
72
+ _define_property(target, key, source[key]);
73
+ });
74
+ }
75
+ return target;
76
+ }
77
+ function _possible_constructor_return(self, call) {
78
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
79
+ return call;
80
+ }
81
+ return _assert_this_initialized(self);
82
+ }
83
+ function _set_prototype_of(o, p) {
84
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
85
+ o.__proto__ = p;
86
+ return o;
87
+ };
88
+ return _set_prototype_of(o, p);
89
+ }
90
+ function _type_of(obj) {
91
+ "@swc/helpers - typeof";
92
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
93
+ }
94
+ function _is_native_reflect_construct() {
95
+ try {
96
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
97
+ } catch (_) {}
98
+ return (_is_native_reflect_construct = function() {
99
+ return !!result;
100
+ })();
101
+ }
102
+ import { select } from "d3-selection";
103
+ import { colorDefaults } from "@d3plus/color";
104
+ import { formatAbbreviate } from "@d3plus/format";
105
+ import { fontFamily as defaultFontFamily, fontFamilyStringify } from "@d3plus/text";
106
+ import { BaseClass, paintComponentScene } from "../../utils/index.js";
107
+ import { installFluent } from "../../fluent.js";
108
+ import { computeSizeLegend, emptySizeLegendLayout } from "./sizeLegendLayout.js";
109
+ var sizeLegendSchema = [
110
+ {
111
+ key: "labelPadding",
112
+ coerce: "identity",
113
+ default: 4
114
+ },
115
+ {
116
+ key: "lineLength",
117
+ coerce: "identity",
118
+ default: 6
119
+ },
120
+ {
121
+ key: "padding",
122
+ coerce: "identity",
123
+ default: 4
124
+ },
125
+ {
126
+ key: "renderMode",
127
+ coerce: "identity",
128
+ default: "full"
129
+ },
130
+ {
131
+ key: "scale",
132
+ coerce: "identity"
133
+ },
134
+ {
135
+ key: "tickFormat",
136
+ coerce: "identity"
137
+ },
138
+ {
139
+ key: "title",
140
+ coerce: "identity"
141
+ },
142
+ {
143
+ key: "values",
144
+ coerce: "identity"
145
+ }
146
+ ];
147
+ var familyString = function familyString(f) {
148
+ return fontFamilyStringify(f === undefined ? defaultFontFamily : Array.isArray(f) ? f : [
149
+ f
150
+ ]);
151
+ };
152
+ var SizeLegend = /*#__PURE__*/ function(BaseClass) {
153
+ "use strict";
154
+ _inherits(SizeLegend, BaseClass);
155
+ function SizeLegend() {
156
+ _class_call_check(this, SizeLegend);
157
+ var _this;
158
+ _this = _call_super(this, SizeLegend), _define_property(_this, "_layout", void 0), /** Drops values whose circles would outgrow this radius; set by a zoomed chart. */ _define_property(_this, "_maxRadius", void 0), _define_property(_this, "_select", void 0), _define_property(_this, "_sceneRenderer", void 0);
159
+ installFluent(_this, sizeLegendSchema);
160
+ _this._layout = emptySizeLegendLayout();
161
+ _this.schema.labelConfig = {
162
+ fontColor: colorDefaults.dark,
163
+ fontSize: 10
164
+ };
165
+ _this.schema.lineConfig = {
166
+ stroke: colorDefaults.dark,
167
+ strokeOpacity: 0.5,
168
+ strokeWidth: 1
169
+ };
170
+ _this.schema.shapeConfig = {
171
+ fill: colorDefaults.dark,
172
+ fillOpacity: 0.05,
173
+ stroke: colorDefaults.dark,
174
+ strokeOpacity: 0.6,
175
+ strokeWidth: 1
176
+ };
177
+ _this.schema.titleConfig = {
178
+ fontColor: colorDefaults.dark,
179
+ fontSize: 11,
180
+ fontWeight: 600
181
+ };
182
+ return _this;
183
+ }
184
+ _create_class(SizeLegend, [
185
+ {
186
+ key: "labelConfig",
187
+ value: function labelConfig(_) {
188
+ return arguments.length ? (this.schema.labelConfig = _object_spread({}, this.schema.labelConfig, _), this) : this.schema.labelConfig;
189
+ }
190
+ },
191
+ {
192
+ key: "lineConfig",
193
+ value: function lineConfig(_) {
194
+ return arguments.length ? (this.schema.lineConfig = _object_spread({}, this.schema.lineConfig, _), this) : this.schema.lineConfig;
195
+ }
196
+ },
197
+ {
198
+ key: "shapeConfig",
199
+ value: function shapeConfig(_) {
200
+ return arguments.length ? (this.schema.shapeConfig = _object_spread({}, this.schema.shapeConfig, _), this) : this.schema.shapeConfig;
201
+ }
202
+ },
203
+ {
204
+ key: "titleConfig",
205
+ value: function titleConfig(_) {
206
+ return arguments.length ? (this.schema.titleConfig = _object_spread({}, this.schema.titleConfig, _), this) : this.schema.titleConfig;
207
+ }
208
+ },
209
+ {
210
+ key: "select",
211
+ value: function select1(_) {
212
+ if (arguments.length) {
213
+ this._select = select(_);
214
+ return this;
215
+ }
216
+ return this._select;
217
+ }
218
+ },
219
+ {
220
+ /**
221
+ Lays the legend out from the current config and returns the result
222
+ (circles, leader lines, labels, overall width/height). Pure: reads no
223
+ DOM, so a chart can measure the legend before it draws.
224
+ */ key: "layout",
225
+ value: function layout() {
226
+ var _this_schema_tickFormat, _label_fontSize, _title_fontSize, _title_fontWeight;
227
+ var scale = this.schema.scale;
228
+ if (!scale || typeof scale.domain !== "function") return this._layout = emptySizeLegendLayout();
229
+ var label = this.schema.labelConfig;
230
+ var title = this.schema.titleConfig;
231
+ var locale = this.schema.locale;
232
+ this._layout = computeSizeLegend({
233
+ scale: scale,
234
+ values: this.schema.values,
235
+ tickFormat: (_this_schema_tickFormat = this.schema.tickFormat) !== null && _this_schema_tickFormat !== void 0 ? _this_schema_tickFormat : function(v) {
236
+ return formatAbbreviate(v, locale);
237
+ },
238
+ fontFamily: familyString(label.fontFamily),
239
+ fontSize: (_label_fontSize = label.fontSize) !== null && _label_fontSize !== void 0 ? _label_fontSize : 10,
240
+ title: this.schema.title,
241
+ titleFontFamily: familyString(title.fontFamily),
242
+ titleFontSize: (_title_fontSize = title.fontSize) !== null && _title_fontSize !== void 0 ? _title_fontSize : 11,
243
+ titleFontWeight: (_title_fontWeight = title.fontWeight) !== null && _title_fontWeight !== void 0 ? _title_fontWeight : 600,
244
+ lineLength: this.schema.lineLength,
245
+ labelPadding: this.schema.labelPadding,
246
+ padding: this.schema.padding,
247
+ maxRadius: this._maxRadius
248
+ });
249
+ return this._layout;
250
+ }
251
+ },
252
+ {
253
+ /**
254
+ The width and height of the last layout, in pixels.
255
+ */ key: "outerBounds",
256
+ value: function outerBounds() {
257
+ return {
258
+ width: this._layout.width,
259
+ height: this._layout.height
260
+ };
261
+ }
262
+ },
263
+ {
264
+ /**
265
+ Produces a backend-agnostic scene graph of the last layout, offset by the
266
+ optional transform.
267
+ @param x Horizontal offset of the legend's top-left corner.
268
+ @param y Vertical offset of the legend's top-left corner.
269
+ */ key: "toScene",
270
+ value: function toScene() {
271
+ var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
272
+ var _title_fontSize, _title_fontWeight;
273
+ var layout = this._layout;
274
+ var shape = this.schema.shapeConfig;
275
+ var line = this.schema.lineConfig;
276
+ var label = this.schema.labelConfig;
277
+ var title = this.schema.titleConfig;
278
+ var labelFamily = familyString(label.fontFamily);
279
+ var children = [];
280
+ layout.circles.forEach(function(c) {
281
+ return children.push({
282
+ type: "circle",
283
+ key: "circle-".concat(c.value),
284
+ interactive: false,
285
+ cx: c.cx,
286
+ cy: c.cy,
287
+ r: c.r,
288
+ paint: _object_spread({}, shape)
289
+ });
290
+ });
291
+ layout.lines.forEach(function(l) {
292
+ return children.push({
293
+ type: "line",
294
+ key: "line-".concat(l.value),
295
+ interactive: false,
296
+ points: l.points,
297
+ paint: _object_spread({
298
+ fill: "none"
299
+ }, line)
300
+ });
301
+ });
302
+ layout.labels.forEach(function(l) {
303
+ var _label_fontSize;
304
+ return children.push({
305
+ type: "text",
306
+ key: "label-".concat(l.value),
307
+ interactive: false,
308
+ x: 0,
309
+ y: 0,
310
+ transform: {
311
+ x: l.x,
312
+ y: l.y
313
+ },
314
+ lines: [
315
+ {
316
+ text: l.text,
317
+ x: 0,
318
+ y: 0,
319
+ width: l.width
320
+ }
321
+ ],
322
+ font: {
323
+ family: labelFamily,
324
+ size: (_label_fontSize = label.fontSize) !== null && _label_fontSize !== void 0 ? _label_fontSize : 10,
325
+ anchor: "start",
326
+ baseline: "middle"
327
+ },
328
+ paint: {
329
+ fill: label.fontColor
330
+ }
331
+ });
332
+ });
333
+ if (layout.title) children.push({
334
+ type: "text",
335
+ key: "title",
336
+ interactive: false,
337
+ x: 0,
338
+ y: 0,
339
+ transform: {
340
+ x: layout.title.x,
341
+ y: layout.title.y
342
+ },
343
+ lines: [
344
+ {
345
+ text: layout.title.text,
346
+ x: 0,
347
+ y: 0,
348
+ width: layout.title.width
349
+ }
350
+ ],
351
+ font: {
352
+ family: familyString(title.fontFamily),
353
+ size: (_title_fontSize = title.fontSize) !== null && _title_fontSize !== void 0 ? _title_fontSize : 11,
354
+ weight: (_title_fontWeight = title.fontWeight) !== null && _title_fontWeight !== void 0 ? _title_fontWeight : 600,
355
+ anchor: "middle",
356
+ baseline: "alphabetic"
357
+ },
358
+ paint: {
359
+ fill: title.fontColor
360
+ }
361
+ });
362
+ return {
363
+ type: "group",
364
+ key: "SizeLegend-".concat(this._uuid.slice(0, 8)),
365
+ transform: {
366
+ x: x,
367
+ y: y
368
+ },
369
+ children: children
370
+ };
371
+ }
372
+ },
373
+ {
374
+ /**
375
+ Renders the legend. Standalone, it paints into the `select` container
376
+ (sized to the legend); inside a chart (`renderMode("compute")`) it only
377
+ lays out, and the chart composes `toScene()`.
378
+ @param callback Optional callback invoked after rendering completes.
379
+ */ key: "render",
380
+ value: function render(callback) {
381
+ this.layout();
382
+ if (this.schema.renderMode !== "compute") {
383
+ if (this._select === undefined) this.select(select("body").append("div").node());
384
+ this.schema.width = this._layout.width;
385
+ this.schema.height = this._layout.height;
386
+ paintComponentScene(this);
387
+ }
388
+ if (callback) setTimeout(callback, 0);
389
+ return this;
390
+ }
391
+ }
392
+ ]);
393
+ return SizeLegend;
394
+ }(BaseClass);
395
+ /**
396
+ A nested-circle legend for a size scale: concentric circles sharing a
397
+ bottom tangent, each labeled with the value its radius encodes.
398
+
399
+ Charts that size marks by a `size` accessor (bubble plots, Geomap points,
400
+ Network, Rings) draw one automatically in their bottom-right corner (see
401
+ `sizeLegend` and `sizeLegendConfig` on the chart). On its own, give it
402
+ any d3 continuous scale that maps values to pixel radii.
403
+ @example
404
+ new SizeLegend()
405
+ .scale(d3.scaleSqrt().domain([0, 1000]).range([2, 30]))
406
+ .title("Population")
407
+ .select("#container")
408
+ .render();
409
+ */ export { SizeLegend as default };
410
+
411
+ //# sourceMappingURL=SizeLegend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/SizeLegend/SizeLegend.ts"],"sourcesContent":["import {select} from \"d3-selection\";\n\nimport {colorDefaults} from \"@d3plus/color\";\nimport {formatAbbreviate} from \"@d3plus/format\";\nimport type {D3Selection} from \"@d3plus/dom\";\nimport type {GroupNode, SceneNode, SvgRenderer} from \"@d3plus/render\";\nimport {fontFamily as defaultFontFamily, fontFamilyStringify} from \"@d3plus/text\";\n\nimport {BaseClass, paintComponentScene} from \"../../utils/index.js\";\nimport {installFluent} from \"../../fluent.js\";\nimport type {ConfigField} from \"../../fluent.js\";\n\nimport {computeSizeLegend, emptySizeLegendLayout} from \"./sizeLegendLayout.js\";\nimport type {SizeLegendLayout, SizeLegendScale, SizeLegendValues} from \"./sizeLegendLayout.js\";\n\n/** Circle paint for the legend's nested circles. */\nexport interface SizeLegendShapeConfig {\n [key: string]: unknown;\n fill?: string;\n fillOpacity?: number;\n stroke?: string;\n strokeOpacity?: number;\n strokeWidth?: number;\n}\n\n/** Paint for the leader lines running from each circle to its label. */\nexport interface SizeLegendLineConfig {\n stroke?: string;\n strokeDasharray?: number[];\n strokeOpacity?: number;\n strokeWidth?: number;\n}\n\n/** Font settings for the value labels and the title. */\nexport interface SizeLegendTextConfig {\n fontColor?: string;\n fontFamily?: string | string[];\n fontSize?: number;\n fontWeight?: number | string;\n}\n\nconst sizeLegendSchema: ConfigField[] = [\n {key: \"labelPadding\", coerce: \"identity\", default: 4},\n {key: \"lineLength\", coerce: \"identity\", default: 6},\n {key: \"padding\", coerce: \"identity\", default: 4},\n {key: \"renderMode\", coerce: \"identity\", default: \"full\"},\n {key: \"scale\", coerce: \"identity\"},\n {key: \"tickFormat\", coerce: \"identity\"},\n {key: \"title\", coerce: \"identity\"},\n {key: \"values\", coerce: \"identity\"},\n];\n\nconst familyString = (f: string | string[] | undefined): string =>\n fontFamilyStringify(f === undefined ? defaultFontFamily : Array.isArray(f) ? f : [f]);\n\n/**\n A nested-circle legend for a size scale: concentric circles sharing a\n bottom tangent, each labeled with the value its radius encodes.\n\n Charts that size marks by a `size` accessor (bubble plots, Geomap points,\n Network, Rings) draw one automatically in their bottom-right corner (see\n `sizeLegend` and `sizeLegendConfig` on the chart). On its own, give it\n any d3 continuous scale that maps values to pixel radii.\n @example\nnew SizeLegend()\n .scale(d3.scaleSqrt().domain([0, 1000]).range([2, 30]))\n .title(\"Population\")\n .select(\"#container\")\n .render();\n*/\nexport default class SizeLegend extends BaseClass {\n // installFluent generates the config accessors at runtime; the index\n // signature lets callers reach them through the type.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n _layout: SizeLegendLayout;\n /** Drops values whose circles would outgrow this radius; set by a zoomed chart. */\n _maxRadius?: number;\n _select?: D3Selection;\n _sceneRenderer?: SvgRenderer;\n\n /**\n Invoked when creating a new class instance, and sets any default parameters.\n @private\n */\n constructor() {\n super();\n installFluent(this, sizeLegendSchema);\n this._layout = emptySizeLegendLayout();\n this.schema.labelConfig = {fontColor: colorDefaults.dark, fontSize: 10};\n this.schema.lineConfig = {stroke: colorDefaults.dark, strokeOpacity: 0.5, strokeWidth: 1};\n this.schema.shapeConfig = {\n fill: colorDefaults.dark,\n fillOpacity: 0.05,\n stroke: colorDefaults.dark,\n strokeOpacity: 0.6,\n strokeWidth: 1,\n };\n this.schema.titleConfig = {fontColor: colorDefaults.dark, fontSize: 11, fontWeight: 600};\n }\n\n /**\n Font settings for the value labels: `fontColor`, `fontFamily`, `fontSize`. Merged into the current settings.\n */\n labelConfig(): SizeLegendTextConfig;\n labelConfig(_: SizeLegendTextConfig): this;\n labelConfig(_?: SizeLegendTextConfig): SizeLegendTextConfig | this {\n return arguments.length\n ? ((this.schema.labelConfig = {...this.schema.labelConfig, ..._}), this)\n : this.schema.labelConfig;\n }\n\n /**\n Paint for the leader lines: `stroke`, `strokeWidth`, `strokeOpacity`, `strokeDasharray`. Merged into the current settings.\n */\n lineConfig(): SizeLegendLineConfig;\n lineConfig(_: SizeLegendLineConfig): this;\n lineConfig(_?: SizeLegendLineConfig): SizeLegendLineConfig | this {\n return arguments.length\n ? ((this.schema.lineConfig = {...this.schema.lineConfig, ..._}), this)\n : this.schema.lineConfig;\n }\n\n /**\n Paint for the circles: `fill`, `fillOpacity`, `stroke`, `strokeWidth`, `strokeOpacity`. Merged into the current settings.\n */\n shapeConfig(): SizeLegendShapeConfig;\n shapeConfig(_: SizeLegendShapeConfig): this;\n shapeConfig(_?: SizeLegendShapeConfig): SizeLegendShapeConfig | this {\n return arguments.length\n ? ((this.schema.shapeConfig = {...this.schema.shapeConfig, ..._}), this)\n : this.schema.shapeConfig;\n }\n\n /**\n Font settings for the title: `fontColor`, `fontFamily`, `fontSize`, `fontWeight`. Merged into the current settings.\n */\n titleConfig(): SizeLegendTextConfig;\n titleConfig(_: SizeLegendTextConfig): this;\n titleConfig(_?: SizeLegendTextConfig): SizeLegendTextConfig | this {\n return arguments.length\n ? ((this.schema.titleConfig = {...this.schema.titleConfig, ..._}), this)\n : this.schema.titleConfig;\n }\n\n /**\n The container element for a standalone render, as a d3 selector or DOM element.\n */\n select(): D3Selection | undefined;\n select(_: string | HTMLElement | SVGElement): this;\n select(_?: string | HTMLElement | SVGElement): D3Selection | undefined | this {\n if (arguments.length) {\n this._select = select(_ as string) as unknown as D3Selection;\n return this;\n }\n return this._select;\n }\n\n /**\n Lays the legend out from the current config and returns the result\n (circles, leader lines, labels, overall width/height). Pure: reads no\n DOM, so a chart can measure the legend before it draws.\n */\n layout(): SizeLegendLayout {\n const scale = this.schema.scale as SizeLegendScale | undefined;\n if (!scale || typeof scale.domain !== \"function\") return (this._layout = emptySizeLegendLayout());\n const label = this.schema.labelConfig as SizeLegendTextConfig;\n const title = this.schema.titleConfig as SizeLegendTextConfig;\n const locale = this.schema.locale;\n this._layout = computeSizeLegend({\n scale,\n values: this.schema.values as SizeLegendValues | undefined,\n tickFormat: (this.schema.tickFormat as ((v: number) => string) | undefined) ??\n ((v: number) => formatAbbreviate(v, locale)),\n fontFamily: familyString(label.fontFamily),\n fontSize: label.fontSize ?? 10,\n title: this.schema.title as string | undefined,\n titleFontFamily: familyString(title.fontFamily),\n titleFontSize: title.fontSize ?? 11,\n titleFontWeight: title.fontWeight ?? 600,\n lineLength: this.schema.lineLength,\n labelPadding: this.schema.labelPadding,\n padding: this.schema.padding,\n maxRadius: this._maxRadius,\n });\n return this._layout;\n }\n\n /**\n The width and height of the last layout, in pixels.\n */\n outerBounds(): {width: number; height: number} {\n return {width: this._layout.width, height: this._layout.height};\n }\n\n /**\n Produces a backend-agnostic scene graph of the last layout, offset by the\n optional transform.\n @param x Horizontal offset of the legend's top-left corner.\n @param y Vertical offset of the legend's top-left corner.\n */\n toScene(x = 0, y = 0): GroupNode {\n const layout = this._layout;\n const shape = this.schema.shapeConfig as SizeLegendShapeConfig;\n const line = this.schema.lineConfig as SizeLegendLineConfig;\n const label = this.schema.labelConfig as SizeLegendTextConfig;\n const title = this.schema.titleConfig as SizeLegendTextConfig;\n const labelFamily = familyString(label.fontFamily);\n const children: SceneNode[] = [];\n\n layout.circles.forEach(c =>\n children.push({\n type: \"circle\",\n key: `circle-${c.value}`,\n interactive: false,\n cx: c.cx,\n cy: c.cy,\n r: c.r,\n paint: {...shape},\n }),\n );\n layout.lines.forEach(l =>\n children.push({\n type: \"line\",\n key: `line-${l.value}`,\n interactive: false,\n points: l.points,\n paint: {fill: \"none\", ...line},\n }),\n );\n layout.labels.forEach(l =>\n children.push({\n type: \"text\",\n key: `label-${l.value}`,\n interactive: false,\n x: 0,\n y: 0,\n transform: {x: l.x, y: l.y},\n lines: [{text: l.text, x: 0, y: 0, width: l.width}],\n font: {family: labelFamily, size: label.fontSize ?? 10, anchor: \"start\", baseline: \"middle\"},\n paint: {fill: label.fontColor},\n }),\n );\n if (layout.title)\n children.push({\n type: \"text\",\n key: \"title\",\n interactive: false,\n x: 0,\n y: 0,\n transform: {x: layout.title.x, y: layout.title.y},\n lines: [{text: layout.title.text, x: 0, y: 0, width: layout.title.width}],\n font: {\n family: familyString(title.fontFamily),\n size: title.fontSize ?? 11,\n weight: title.fontWeight ?? 600,\n anchor: \"middle\",\n baseline: \"alphabetic\",\n },\n paint: {fill: title.fontColor},\n });\n\n return {\n type: \"group\",\n key: `SizeLegend-${this._uuid.slice(0, 8)}`,\n transform: {x, y},\n children,\n };\n }\n\n /**\n Renders the legend. Standalone, it paints into the `select` container\n (sized to the legend); inside a chart (`renderMode(\"compute\")`) it only\n lays out, and the chart composes `toScene()`.\n @param callback Optional callback invoked after rendering completes.\n */\n render(callback?: () => void): this {\n this.layout();\n if (this.schema.renderMode !== \"compute\") {\n if (this._select === undefined) this.select(select(\"body\").append(\"div\").node() as HTMLElement);\n this.schema.width = this._layout.width;\n this.schema.height = this._layout.height;\n paintComponentScene(this);\n }\n if (callback) setTimeout(callback, 0);\n return this;\n }\n}\n"],"names":["select","colorDefaults","formatAbbreviate","fontFamily","defaultFontFamily","fontFamilyStringify","BaseClass","paintComponentScene","installFluent","computeSizeLegend","emptySizeLegendLayout","sizeLegendSchema","key","coerce","default","familyString","f","undefined","Array","isArray","SizeLegend","_layout","_maxRadius","_select","_sceneRenderer","schema","labelConfig","fontColor","dark","fontSize","lineConfig","stroke","strokeOpacity","strokeWidth","shapeConfig","fill","fillOpacity","titleConfig","fontWeight","_","arguments","length","layout","label","title","scale","domain","locale","values","tickFormat","v","titleFontFamily","titleFontSize","titleFontWeight","lineLength","labelPadding","padding","maxRadius","outerBounds","width","height","toScene","x","y","shape","line","labelFamily","children","circles","forEach","c","push","type","value","interactive","cx","cy","r","paint","lines","l","points","labels","transform","text","font","family","size","anchor","baseline","weight","_uuid","slice","render","callback","renderMode","append","node","setTimeout"],"mappings":";;;;;;;;;;;;;;;;;;;;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