@d3plus/core 3.1.5 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (579) hide show
  1. package/README.md +9922 -78537
  2. package/es/index.js +8 -0
  3. package/es/index.js.map +1 -1
  4. package/es/internal.js +54 -0
  5. package/es/internal.js.map +1 -0
  6. package/es/src/charts/AreaPlot/index.js +36 -0
  7. package/es/src/charts/AreaPlot/index.js.map +1 -0
  8. package/es/src/charts/BarChart/index.js +48 -0
  9. package/es/src/charts/BarChart/index.js.map +1 -0
  10. package/es/src/charts/BoxWhisker/index.js +52 -0
  11. package/es/src/charts/BoxWhisker/index.js.map +1 -0
  12. package/es/src/charts/BumpChart/index.js +81 -0
  13. package/es/src/charts/BumpChart/index.js.map +1 -0
  14. package/es/src/charts/Donut/index.js +42 -0
  15. package/es/src/charts/Donut/index.js.map +1 -0
  16. package/es/src/charts/Geomap/applyLayout.js +208 -0
  17. package/es/src/charts/Geomap/applyLayout.js.map +1 -0
  18. package/es/src/charts/Geomap/emit.js +169 -0
  19. package/es/src/charts/Geomap/emit.js.map +1 -0
  20. package/es/src/charts/Geomap/index.js +521 -0
  21. package/es/src/charts/Geomap/index.js.map +1 -0
  22. package/es/src/charts/LinePlot/index.js +32 -0
  23. package/es/src/charts/LinePlot/index.js.map +1 -0
  24. package/es/src/charts/Matrix/applyLayout.js +92 -0
  25. package/es/src/charts/Matrix/applyLayout.js.map +1 -0
  26. package/es/src/charts/Matrix/emit.js +44 -0
  27. package/es/src/charts/Matrix/emit.js.map +1 -0
  28. package/es/src/charts/Matrix/index.js +154 -0
  29. package/es/src/charts/Matrix/index.js.map +1 -0
  30. package/es/src/charts/Network/applyLayout.js +322 -0
  31. package/es/src/charts/Network/applyLayout.js.map +1 -0
  32. package/es/src/charts/Network/emit.js +273 -0
  33. package/es/src/charts/Network/emit.js.map +1 -0
  34. package/es/src/charts/Network/index.js +422 -0
  35. package/es/src/charts/Network/index.js.map +1 -0
  36. package/es/src/charts/Pack/applyLayout.js +46 -0
  37. package/es/src/charts/Pack/applyLayout.js.map +1 -0
  38. package/es/src/charts/Pack/emit.js +116 -0
  39. package/es/src/charts/Pack/emit.js.map +1 -0
  40. package/es/src/charts/Pack/index.js +194 -0
  41. package/es/src/charts/Pack/index.js.map +1 -0
  42. package/es/src/charts/Pack/recursionCircles.js +18 -0
  43. package/es/src/charts/Pack/recursionCircles.js.map +1 -0
  44. package/es/src/charts/Pie/applyLayout.js +44 -0
  45. package/es/src/charts/Pie/applyLayout.js.map +1 -0
  46. package/es/src/charts/Pie/emit.js +111 -0
  47. package/es/src/charts/Pie/emit.js.map +1 -0
  48. package/es/src/charts/Pie/index.js +134 -0
  49. package/es/src/charts/Pie/index.js.map +1 -0
  50. package/es/src/charts/Plot/draw.js +424 -0
  51. package/es/src/charts/Plot/draw.js.map +1 -0
  52. package/es/src/charts/Plot/index.js +827 -0
  53. package/es/src/charts/Plot/index.js.map +1 -0
  54. package/es/src/charts/Plot/labelPlacement.js +36 -0
  55. package/es/src/charts/Plot/labelPlacement.js.map +1 -0
  56. package/es/src/charts/Plot/pipeline.js +594 -0
  57. package/es/src/charts/Plot/pipeline.js.map +1 -0
  58. package/es/src/charts/Plot/pipelineDomains.js +254 -0
  59. package/es/src/charts/Plot/pipelineDomains.js.map +1 -0
  60. package/es/src/charts/Plot/pipelineLineLabels.js +210 -0
  61. package/es/src/charts/Plot/pipelineLineLabels.js.map +1 -0
  62. package/es/src/charts/Plot/shapeDefaults.js +189 -0
  63. package/es/src/charts/Plot/shapeDefaults.js.map +1 -0
  64. package/es/src/charts/Plot/stackHelpers.js +52 -0
  65. package/es/src/charts/Plot/stackHelpers.js.map +1 -0
  66. package/es/src/charts/Priestley/applyLayout.js +121 -0
  67. package/es/src/charts/Priestley/applyLayout.js.map +1 -0
  68. package/es/src/charts/Priestley/emit.js +129 -0
  69. package/es/src/charts/Priestley/emit.js.map +1 -0
  70. package/es/src/charts/Priestley/index.js +97 -0
  71. package/es/src/charts/Priestley/index.js.map +1 -0
  72. package/es/src/charts/Radar/applyLayout.js +326 -0
  73. package/es/src/charts/Radar/applyLayout.js.map +1 -0
  74. package/es/src/charts/Radar/emit.js +28 -0
  75. package/es/src/charts/Radar/emit.js.map +1 -0
  76. package/es/src/charts/Radar/index.js +98 -0
  77. package/es/src/charts/Radar/index.js.map +1 -0
  78. package/es/src/charts/RadialMatrix/applyLayout.js +132 -0
  79. package/es/src/charts/RadialMatrix/applyLayout.js.map +1 -0
  80. package/es/src/charts/RadialMatrix/emit.js +33 -0
  81. package/es/src/charts/RadialMatrix/emit.js.map +1 -0
  82. package/es/src/charts/RadialMatrix/index.js +144 -0
  83. package/es/src/charts/RadialMatrix/index.js.map +1 -0
  84. package/es/src/charts/Rings/applyLayout.js +508 -0
  85. package/es/src/charts/Rings/applyLayout.js.map +1 -0
  86. package/es/src/charts/Rings/emit.js +222 -0
  87. package/es/src/charts/Rings/emit.js.map +1 -0
  88. package/es/src/charts/Rings/index.js +245 -0
  89. package/es/src/charts/Rings/index.js.map +1 -0
  90. package/es/src/charts/Sankey/applyLayout.js +107 -0
  91. package/es/src/charts/Sankey/applyLayout.js.map +1 -0
  92. package/es/src/charts/Sankey/emit.js +134 -0
  93. package/es/src/charts/Sankey/emit.js.map +1 -0
  94. package/es/src/charts/Sankey/index.js +219 -0
  95. package/es/src/charts/Sankey/index.js.map +1 -0
  96. package/es/src/charts/StackedArea/index.js +27 -0
  97. package/es/src/charts/StackedArea/index.js.map +1 -0
  98. package/es/src/charts/Tree/applyLayout.js +233 -0
  99. package/es/src/charts/Tree/applyLayout.js.map +1 -0
  100. package/es/src/charts/Tree/emit.js +257 -0
  101. package/es/src/charts/Tree/emit.js.map +1 -0
  102. package/es/src/charts/Tree/index.js +105 -0
  103. package/es/src/charts/Tree/index.js.map +1 -0
  104. package/es/src/charts/Treemap/applyLayout.js +85 -0
  105. package/es/src/charts/Treemap/applyLayout.js.map +1 -0
  106. package/es/src/charts/Treemap/emit.js +141 -0
  107. package/es/src/charts/Treemap/emit.js.map +1 -0
  108. package/es/src/charts/Treemap/index.js +177 -0
  109. package/es/src/charts/Treemap/index.js.map +1 -0
  110. package/es/src/charts/Treemap/thresholdFunction.js +112 -0
  111. package/es/src/charts/Treemap/thresholdFunction.js.map +1 -0
  112. package/es/src/charts/definition/ChartDefinition.js +12 -0
  113. package/es/src/charts/definition/ChartDefinition.js.map +1 -0
  114. package/es/src/charts/definition/applyDefinition.js +107 -0
  115. package/es/src/charts/definition/applyDefinition.js.map +1 -0
  116. package/es/src/charts/definition/makeChart.js +153 -0
  117. package/es/src/charts/definition/makeChart.js.map +1 -0
  118. package/es/src/charts/drawSteps/zoomControls.js +231 -96
  119. package/es/src/charts/drawSteps/zoomControls.js.map +1 -1
  120. package/es/src/charts/events/click.legend.js +2 -2
  121. package/es/src/charts/events/click.legend.js.map +1 -1
  122. package/es/src/charts/events/click.shape.js +5 -5
  123. package/es/src/charts/events/click.shape.js.map +1 -1
  124. package/es/src/charts/events/mouseenter.js +20 -1
  125. package/es/src/charts/events/mouseenter.js.map +1 -1
  126. package/es/src/charts/events/mouseleave.js +19 -4
  127. package/es/src/charts/events/mouseleave.js.map +1 -1
  128. package/es/src/charts/events/mousemove.legend.js +10 -10
  129. package/es/src/charts/events/mousemove.legend.js.map +1 -1
  130. package/es/src/charts/events/mousemove.shape.js +14 -8
  131. package/es/src/charts/events/mousemove.shape.js.map +1 -1
  132. package/es/src/charts/events/touchstart.body.js.map +1 -1
  133. package/es/src/charts/features/axes.js +432 -0
  134. package/es/src/charts/features/axes.js.map +1 -0
  135. package/es/src/charts/features/chartGeometry.js +66 -0
  136. package/es/src/charts/features/chartGeometry.js.map +1 -0
  137. package/es/src/charts/features/colorScaleBucket.js +92 -0
  138. package/es/src/charts/features/colorScaleBucket.js.map +1 -0
  139. package/es/src/charts/features/emitHelpers.js +217 -0
  140. package/es/src/charts/features/emitHelpers.js.map +1 -0
  141. package/es/src/charts/features/ensureZoomDom.js +71 -0
  142. package/es/src/charts/features/ensureZoomDom.js.map +1 -0
  143. package/es/src/charts/features/features.js +650 -0
  144. package/es/src/charts/features/features.js.map +1 -0
  145. package/es/src/charts/features/featuresLegend.js +180 -0
  146. package/es/src/charts/features/featuresLegend.js.map +1 -0
  147. package/es/src/charts/features/legendLabel.js +12 -0
  148. package/es/src/charts/features/legendLabel.js.map +1 -0
  149. package/es/src/charts/features/lineLabels.js +154 -0
  150. package/es/src/charts/features/lineLabels.js.map +1 -0
  151. package/es/src/charts/features/plotPaint.js +512 -0
  152. package/es/src/charts/features/plotPaint.js.map +1 -0
  153. package/es/src/charts/features/shapeEmit.js +273 -0
  154. package/es/src/charts/features/shapeEmit.js.map +1 -0
  155. package/es/src/charts/helpers/matrixData.js +3 -3
  156. package/es/src/charts/helpers/matrixData.js.map +1 -1
  157. package/es/src/charts/index.js +21 -21
  158. package/es/src/charts/index.js.map +1 -1
  159. package/es/src/charts/pipeline/resolveSpec.js +44 -0
  160. package/es/src/charts/pipeline/resolveSpec.js.map +1 -0
  161. package/es/src/charts/pipeline/runChartDraw.js +109 -0
  162. package/es/src/charts/pipeline/runChartDraw.js.map +1 -0
  163. package/es/src/charts/pipeline/runVizPipeline.js +84 -0
  164. package/es/src/charts/pipeline/runVizPipeline.js.map +1 -0
  165. package/es/src/charts/pipeline/stages.js +103 -0
  166. package/es/src/charts/pipeline/stages.js.map +1 -0
  167. package/es/src/charts/pipeline/vizContext.js +29 -0
  168. package/es/src/charts/pipeline/vizContext.js.map +1 -0
  169. package/es/src/charts/pipeline/vizDraw.js +37 -0
  170. package/es/src/charts/pipeline/vizDraw.js.map +1 -0
  171. package/es/src/charts/pipeline/vizDrawPure.js +174 -0
  172. package/es/src/charts/pipeline/vizDrawPure.js.map +1 -0
  173. package/es/src/charts/pipeline/vizPreDraw.js +145 -0
  174. package/es/src/charts/pipeline/vizPreDraw.js.map +1 -0
  175. package/es/src/charts/pipeline/vizPreDrawPure.js +279 -0
  176. package/es/src/charts/pipeline/vizPreDrawPure.js.map +1 -0
  177. package/es/src/charts/plotBuffers/Bar.js +4 -4
  178. package/es/src/charts/plotBuffers/Bar.js.map +1 -1
  179. package/es/src/charts/plotBuffers/Box.js +4 -4
  180. package/es/src/charts/plotBuffers/Box.js.map +1 -1
  181. package/es/src/charts/plotBuffers/Circle.js +2 -2
  182. package/es/src/charts/plotBuffers/Circle.js.map +1 -1
  183. package/es/src/charts/plotBuffers/Line.js +5 -5
  184. package/es/src/charts/plotBuffers/Line.js.map +1 -1
  185. package/es/src/charts/plotBuffers/Rect.js +2 -2
  186. package/es/src/charts/plotBuffers/Rect.js.map +1 -1
  187. package/es/src/charts/plotBuffers/discreteBuffer.js +1 -2
  188. package/es/src/charts/plotBuffers/discreteBuffer.js.map +1 -1
  189. package/es/src/charts/plotBuffers/numericBuffer.js +1 -2
  190. package/es/src/charts/plotBuffers/numericBuffer.js.map +1 -1
  191. package/es/src/charts/viz/Viz.js +985 -0
  192. package/es/src/charts/viz/Viz.js.map +1 -0
  193. package/es/src/charts/viz/VizBase.js +447 -0
  194. package/es/src/charts/viz/VizBase.js.map +1 -0
  195. package/es/src/charts/viz/VizBaseConfig.js +504 -0
  196. package/es/src/charts/viz/VizBaseConfig.js.map +1 -0
  197. package/es/src/charts/viz/interactionOpacity.js +247 -0
  198. package/es/src/charts/viz/interactionOpacity.js.map +1 -0
  199. package/es/src/charts/viz/ordinalColor.js +71 -0
  200. package/es/src/charts/viz/ordinalColor.js.map +1 -0
  201. package/es/src/charts/viz/trailCatchup.js +127 -0
  202. package/es/src/charts/viz/trailCatchup.js.map +1 -0
  203. package/es/src/charts/viz/vizDefaults.js +602 -0
  204. package/es/src/charts/viz/vizDefaults.js.map +1 -0
  205. package/es/src/charts/viz/vizRender.js +251 -0
  206. package/es/src/charts/viz/vizRender.js.map +1 -0
  207. package/es/src/charts/viz/vizTypes.js +28 -0
  208. package/es/src/charts/viz/vizTypes.js.map +1 -0
  209. package/es/src/components/Axis/Axis.js +691 -0
  210. package/es/src/components/Axis/Axis.js.map +1 -0
  211. package/es/src/components/Axis/AxisBottom.js.map +1 -0
  212. package/es/src/components/Axis/AxisLeft.js.map +1 -0
  213. package/es/src/components/Axis/AxisRight.js.map +1 -0
  214. package/es/src/components/Axis/AxisTop.js.map +1 -0
  215. package/es/src/components/Axis/axisLayout.js +208 -0
  216. package/es/src/components/Axis/axisLayout.js.map +1 -0
  217. package/es/src/components/Axis/axisLayoutLabels.js +177 -0
  218. package/es/src/components/Axis/axisLayoutLabels.js.map +1 -0
  219. package/es/src/components/Axis/axisLayoutScale.js +374 -0
  220. package/es/src/components/Axis/axisLayoutScale.js.map +1 -0
  221. package/es/src/components/Axis/axisRender.js +535 -0
  222. package/es/src/components/Axis/axisRender.js.map +1 -0
  223. package/es/src/components/ColorScale/ColorScale.js +506 -0
  224. package/es/src/components/ColorScale/ColorScale.js.map +1 -0
  225. package/es/src/components/ColorScale/colorScaleRender.js +277 -0
  226. package/es/src/components/ColorScale/colorScaleRender.js.map +1 -0
  227. package/es/src/components/ColorScale/colorScaleScale.js +274 -0
  228. package/es/src/components/ColorScale/colorScaleScale.js.map +1 -0
  229. package/es/src/components/Legend/Legend.js +445 -0
  230. package/es/src/components/Legend/Legend.js.map +1 -0
  231. package/es/src/components/Legend/legendConfig.js +87 -0
  232. package/es/src/components/Legend/legendConfig.js.map +1 -0
  233. package/es/src/components/Legend/legendRender.js +245 -0
  234. package/es/src/components/Legend/legendRender.js.map +1 -0
  235. package/es/src/components/Message.js.map +1 -1
  236. package/es/src/components/TextBox.js +639 -453
  237. package/es/src/components/TextBox.js.map +1 -1
  238. package/es/src/components/Timeline/Timeline.js +674 -0
  239. package/es/src/components/Timeline/Timeline.js.map +1 -0
  240. package/es/src/components/Timeline/timelineConfig.js +115 -0
  241. package/es/src/components/Timeline/timelineConfig.js.map +1 -0
  242. package/es/src/components/Timeline/timelineRender.js +267 -0
  243. package/es/src/components/Timeline/timelineRender.js.map +1 -0
  244. package/es/src/components/Tooltip.js +288 -249
  245. package/es/src/components/Tooltip.js.map +1 -1
  246. package/es/src/components/index.js +8 -8
  247. package/es/src/components/index.js.map +1 -1
  248. package/es/src/fluent.js +265 -0
  249. package/es/src/fluent.js.map +1 -0
  250. package/es/src/shapes/Area.js +96 -114
  251. package/es/src/shapes/Area.js.map +1 -1
  252. package/es/src/shapes/Bar.js +71 -86
  253. package/es/src/shapes/Bar.js.map +1 -1
  254. package/es/src/shapes/Box.js +295 -190
  255. package/es/src/shapes/Box.js.map +1 -1
  256. package/es/src/shapes/Circle.js +72 -31
  257. package/es/src/shapes/Circle.js.map +1 -1
  258. package/es/src/shapes/Image.js +164 -85
  259. package/es/src/shapes/Image.js.map +1 -1
  260. package/es/src/shapes/Line.js +51 -94
  261. package/es/src/shapes/Line.js.map +1 -1
  262. package/es/src/shapes/Path.js +33 -41
  263. package/es/src/shapes/Path.js.map +1 -1
  264. package/es/src/shapes/Rect.js +86 -37
  265. package/es/src/shapes/Rect.js.map +1 -1
  266. package/es/src/shapes/Shape.js +655 -678
  267. package/es/src/shapes/Shape.js.map +1 -1
  268. package/es/src/shapes/Whisker.js +156 -61
  269. package/es/src/shapes/Whisker.js.map +1 -1
  270. package/es/src/shapes/buildLabelData.js +70 -0
  271. package/es/src/shapes/buildLabelData.js.map +1 -0
  272. package/es/src/shapes/emitLabels.js +84 -0
  273. package/es/src/shapes/emitLabels.js.map +1 -0
  274. package/es/src/shapes/hitAreaNode.js +37 -0
  275. package/es/src/shapes/hitAreaNode.js.map +1 -0
  276. package/es/src/shapes/sceneSort.js +57 -0
  277. package/es/src/shapes/sceneSort.js.map +1 -0
  278. package/es/src/shapes/shapeConfig.js +31 -0
  279. package/es/src/shapes/shapeConfig.js.map +1 -0
  280. package/es/src/utils/BaseClass.js +35 -19
  281. package/es/src/utils/BaseClass.js.map +1 -1
  282. package/es/src/utils/D3Scale.js +16 -0
  283. package/es/src/utils/D3Scale.js.map +1 -0
  284. package/es/src/utils/D3plusConfig.js.map +1 -1
  285. package/es/src/utils/configPrep.js +8 -3
  286. package/es/src/utils/configPrep.js.map +1 -1
  287. package/es/src/utils/getProp.js +1 -1
  288. package/es/src/utils/getProp.js.map +1 -1
  289. package/es/src/utils/index.js +1 -0
  290. package/es/src/utils/index.js.map +1 -1
  291. package/es/src/utils/paintComponentScene.js +59 -0
  292. package/es/src/utils/paintComponentScene.js.map +1 -0
  293. package/es/umd-entry.js +16 -0
  294. package/es/umd-entry.js.map +1 -0
  295. package/package.json +17 -9
  296. package/types/index.d.ts +3 -1
  297. package/types/internal.d.ts +54 -0
  298. package/types/src/charts/AreaPlot/index.d.ts +10 -0
  299. package/types/src/charts/BarChart/index.d.ts +10 -0
  300. package/types/src/charts/BoxWhisker/index.d.ts +11 -0
  301. package/types/src/charts/BumpChart/index.d.ts +11 -0
  302. package/types/src/charts/ChartDefinition.d.ts +75 -0
  303. package/types/src/charts/Donut/index.d.ts +13 -0
  304. package/types/src/charts/Geomap/applyLayout.d.ts +7 -0
  305. package/types/src/charts/Geomap/emit.d.ts +7 -0
  306. package/types/src/charts/Geomap/index.d.ts +14 -0
  307. package/types/src/charts/Geomap.d.ts +6 -0
  308. package/types/src/charts/LinePlot/index.d.ts +10 -0
  309. package/types/src/charts/Matrix/applyLayout.d.ts +9 -0
  310. package/types/src/charts/Matrix/emit.d.ts +6 -0
  311. package/types/src/charts/Matrix/index.d.ts +14 -0
  312. package/types/src/charts/Matrix.d.ts +0 -26
  313. package/types/src/charts/Network/applyLayout.d.ts +10 -0
  314. package/types/src/charts/Network/emit.d.ts +6 -0
  315. package/types/src/charts/Network/index.d.ts +7 -0
  316. package/types/src/charts/Network.d.ts +0 -24
  317. package/types/src/charts/Pack/applyLayout.d.ts +16 -0
  318. package/types/src/charts/Pack/emit.d.ts +6 -0
  319. package/types/src/charts/Pack/index.d.ts +15 -0
  320. package/types/src/charts/Pack/recursionCircles.d.ts +7 -0
  321. package/types/src/charts/Pack.d.ts +0 -13
  322. package/types/src/charts/Pie/applyLayout.d.ts +8 -0
  323. package/types/src/charts/Pie/emit.d.ts +5 -0
  324. package/types/src/charts/Pie/index.d.ts +14 -0
  325. package/types/src/charts/Pie.d.ts +0 -27
  326. package/types/src/charts/Plot/draw.d.ts +2 -0
  327. package/types/src/charts/Plot/index.d.ts +167 -0
  328. package/types/src/charts/Plot/labelPlacement.d.ts +15 -0
  329. package/types/src/charts/Plot/pipeline.d.ts +70 -0
  330. package/types/src/charts/Plot/pipelineDomains.d.ts +2 -0
  331. package/types/src/charts/Plot/pipelineLineLabels.d.ts +2 -0
  332. package/types/src/charts/Plot/shapeDefaults.d.ts +64 -0
  333. package/types/src/charts/Plot/stackHelpers.d.ts +24 -0
  334. package/types/src/charts/Plot.d.ts +23 -72
  335. package/types/src/charts/Priestley/applyLayout.d.ts +21 -0
  336. package/types/src/charts/Priestley/emit.d.ts +6 -0
  337. package/types/src/charts/Priestley/index.d.ts +14 -0
  338. package/types/src/charts/Radar/applyLayout.d.ts +10 -0
  339. package/types/src/charts/Radar/emit.d.ts +7 -0
  340. package/types/src/charts/Radar/index.d.ts +14 -0
  341. package/types/src/charts/RadialMatrix/applyLayout.d.ts +11 -0
  342. package/types/src/charts/RadialMatrix/emit.d.ts +6 -0
  343. package/types/src/charts/RadialMatrix/index.d.ts +14 -0
  344. package/types/src/charts/RadialMatrix.d.ts +0 -15
  345. package/types/src/charts/Rings/applyLayout.d.ts +2 -0
  346. package/types/src/charts/Rings/emit.d.ts +7 -0
  347. package/types/src/charts/Rings/index.d.ts +15 -0
  348. package/types/src/charts/Rings.d.ts +0 -13
  349. package/types/src/charts/Sankey/applyLayout.d.ts +7 -0
  350. package/types/src/charts/Sankey/emit.d.ts +6 -0
  351. package/types/src/charts/Sankey/index.d.ts +7 -0
  352. package/types/src/charts/Sankey.d.ts +0 -4
  353. package/types/src/charts/StackedArea/index.d.ts +10 -0
  354. package/types/src/charts/Tree/applyLayout.d.ts +2 -0
  355. package/types/src/charts/Tree/emit.d.ts +7 -0
  356. package/types/src/charts/Tree/index.d.ts +14 -0
  357. package/types/src/charts/Tree.d.ts +0 -16
  358. package/types/src/charts/Treemap/applyLayout.d.ts +16 -0
  359. package/types/src/charts/Treemap/emit.d.ts +6 -0
  360. package/types/src/charts/Treemap/index.d.ts +18 -0
  361. package/types/src/charts/Treemap/thresholdFunction.d.ts +25 -0
  362. package/types/src/charts/Treemap.d.ts +4 -13
  363. package/types/src/charts/Viz.d.ts +49 -361
  364. package/types/src/charts/VizBase.d.ts +158 -0
  365. package/types/src/charts/VizBaseConfig.d.ts +148 -0
  366. package/types/src/charts/applyDefinition.d.ts +13 -0
  367. package/types/src/charts/axes.d.ts +134 -0
  368. package/types/src/charts/chartGeometry.d.ts +58 -0
  369. package/types/src/charts/definition/ChartDefinition.d.ts +84 -0
  370. package/types/src/charts/definition/applyDefinition.d.ts +13 -0
  371. package/types/src/charts/definition/makeChart.d.ts +22 -0
  372. package/types/src/charts/drawSteps/zoomControls.d.ts +25 -5
  373. package/types/src/charts/emitHelpers.d.ts +122 -0
  374. package/types/src/charts/ensureZoomDom.d.ts +39 -0
  375. package/types/src/charts/events/click.legend.d.ts +1 -1
  376. package/types/src/charts/events/click.shape.d.ts +1 -1
  377. package/types/src/charts/events/mouseenter.d.ts +1 -1
  378. package/types/src/charts/events/mouseleave.d.ts +1 -1
  379. package/types/src/charts/events/mousemove.legend.d.ts +1 -1
  380. package/types/src/charts/events/mousemove.shape.d.ts +1 -1
  381. package/types/src/charts/events/touchstart.body.d.ts +1 -1
  382. package/types/src/charts/factories.d.ts +73 -0
  383. package/types/src/charts/features/axes.d.ts +134 -0
  384. package/types/src/charts/features/chartGeometry.d.ts +58 -0
  385. package/types/src/charts/features/colorScaleBucket.d.ts +43 -0
  386. package/types/src/charts/features/colorScaleBucketShare.d.ts +16 -0
  387. package/types/src/charts/features/emitHelpers.d.ts +123 -0
  388. package/types/src/charts/features/ensureZoomDom.d.ts +39 -0
  389. package/types/src/charts/features/features.d.ts +152 -0
  390. package/types/src/charts/features/featuresLegend.d.ts +12 -0
  391. package/types/src/charts/features/legendLabel.d.ts +11 -0
  392. package/types/src/charts/features/lineLabels.d.ts +40 -0
  393. package/types/src/charts/features/plotPaint.d.ts +233 -0
  394. package/types/src/charts/features/shapeEmit.d.ts +61 -0
  395. package/types/src/charts/features.d.ts +152 -0
  396. package/types/src/charts/featuresLegend.d.ts +12 -0
  397. package/types/src/charts/helpers/matrixData.d.ts +1 -1
  398. package/types/src/charts/index.d.ts +21 -21
  399. package/types/src/charts/legendLabel.d.ts +11 -0
  400. package/types/src/charts/lineLabels.d.ts +40 -0
  401. package/types/src/charts/makeChart.d.ts +22 -0
  402. package/types/src/charts/pipeline/resolveSpec.d.ts +51 -0
  403. package/types/src/charts/pipeline/runChartDraw.d.ts +38 -0
  404. package/types/src/charts/pipeline/runVizPipeline.d.ts +31 -0
  405. package/types/src/charts/pipeline/stages.d.ts +160 -0
  406. package/types/src/charts/pipeline/vizContext.d.ts +45 -0
  407. package/types/src/charts/pipeline/vizDraw.d.ts +25 -0
  408. package/types/src/charts/pipeline/vizDrawPure.d.ts +46 -0
  409. package/types/src/charts/pipeline/vizPreDraw.d.ts +22 -0
  410. package/types/src/charts/pipeline/vizPreDrawPure.d.ts +68 -0
  411. package/types/src/charts/plotBuffers/Bar.d.ts +6 -5
  412. package/types/src/charts/plotBuffers/Box.d.ts +6 -5
  413. package/types/src/charts/plotBuffers/Circle.d.ts +6 -5
  414. package/types/src/charts/plotBuffers/Line.d.ts +6 -5
  415. package/types/src/charts/plotBuffers/Rect.d.ts +6 -5
  416. package/types/src/charts/plotBuffers/discreteBuffer.d.ts +2 -1
  417. package/types/src/charts/plotBuffers/numericBuffer.d.ts +2 -1
  418. package/types/src/charts/plotPaint.d.ts +233 -0
  419. package/types/src/charts/resolveSpec.d.ts +50 -0
  420. package/types/src/charts/runChartDraw.d.ts +38 -0
  421. package/types/src/charts/runVizPipeline.d.ts +31 -0
  422. package/types/src/charts/shapeEmit.d.ts +61 -0
  423. package/types/src/charts/stages.d.ts +117 -0
  424. package/types/src/charts/viz/Viz.d.ts +111 -0
  425. package/types/src/charts/viz/VizBase.d.ts +160 -0
  426. package/types/src/charts/viz/VizBaseConfig.d.ts +156 -0
  427. package/types/src/charts/viz/interactionOpacity.d.ts +23 -0
  428. package/types/src/charts/viz/ordinalColor.d.ts +14 -0
  429. package/types/src/charts/viz/trailCatchup.d.ts +14 -0
  430. package/types/src/charts/viz/vizDefaults.d.ts +8 -0
  431. package/types/src/charts/viz/vizRender.d.ts +8 -0
  432. package/types/src/charts/viz/vizTypes.d.ts +250 -0
  433. package/types/src/charts/vizContext.d.ts +46 -0
  434. package/types/src/charts/vizDefaults.d.ts +8 -0
  435. package/types/src/charts/vizDraw.d.ts +25 -0
  436. package/types/src/charts/vizDrawPure.d.ts +17 -0
  437. package/types/src/charts/vizPreDraw.d.ts +22 -0
  438. package/types/src/charts/vizPreDrawPure.d.ts +40 -0
  439. package/types/src/charts/vizRender.d.ts +8 -0
  440. package/types/src/charts/vizTypes.d.ts +202 -0
  441. package/types/src/components/Axis/Axis.d.ts +182 -0
  442. package/types/src/components/Axis/AxisBottom.d.ts +11 -0
  443. package/types/src/components/Axis/AxisLeft.d.ts +11 -0
  444. package/types/src/components/Axis/AxisRight.d.ts +11 -0
  445. package/types/src/components/Axis/AxisTop.d.ts +11 -0
  446. package/types/src/components/Axis/axisLayout.d.ts +29 -0
  447. package/types/src/components/Axis/axisLayoutLabels.d.ts +70 -0
  448. package/types/src/components/Axis/axisLayoutScale.d.ts +14 -0
  449. package/types/src/components/Axis/axisRender.d.ts +68 -0
  450. package/types/src/components/Axis.d.ts +68 -194
  451. package/types/src/components/ColorScale/ColorScale.d.ts +100 -0
  452. package/types/src/components/ColorScale/colorScaleRender.d.ts +15 -0
  453. package/types/src/components/ColorScale/colorScaleScale.d.ts +19 -0
  454. package/types/src/components/ColorScale.d.ts +1 -129
  455. package/types/src/components/Legend/Legend.d.ts +95 -0
  456. package/types/src/components/Legend/legendConfig.d.ts +7 -0
  457. package/types/src/components/Legend/legendRender.d.ts +16 -0
  458. package/types/src/components/Legend.d.ts +9 -73
  459. package/types/src/components/TextBox.d.ts +25 -218
  460. package/types/src/components/Timeline/Timeline.d.ts +118 -0
  461. package/types/src/components/Timeline/timelineConfig.d.ts +6 -0
  462. package/types/src/components/Timeline/timelineRender.d.ts +24 -0
  463. package/types/src/components/Timeline.d.ts +7 -81
  464. package/types/src/components/Tooltip.d.ts +20 -200
  465. package/types/src/components/axisLayout.d.ts +27 -0
  466. package/types/src/components/axisLayoutLabels.d.ts +42 -0
  467. package/types/src/components/axisLayoutScale.d.ts +12 -0
  468. package/types/src/components/axisRender.d.ts +65 -0
  469. package/types/src/components/colorScaleRender.d.ts +15 -0
  470. package/types/src/components/colorScaleScale.d.ts +19 -0
  471. package/types/src/components/index.d.ts +8 -8
  472. package/types/src/components/legendConfig.d.ts +7 -0
  473. package/types/src/components/legendRender.d.ts +16 -0
  474. package/types/src/components/timelineConfig.d.ts +6 -0
  475. package/types/src/components/timelineRender.d.ts +14 -0
  476. package/types/src/fluent.d.ts +94 -0
  477. package/types/src/shapes/Area.d.ts +15 -27
  478. package/types/src/shapes/Bar.d.ts +13 -33
  479. package/types/src/shapes/Box.d.ts +17 -56
  480. package/types/src/shapes/Circle.d.ts +11 -17
  481. package/types/src/shapes/Image.d.ts +18 -84
  482. package/types/src/shapes/Line.d.ts +12 -22
  483. package/types/src/shapes/Path.d.ts +12 -19
  484. package/types/src/shapes/Rect.d.ts +11 -27
  485. package/types/src/shapes/Shape.d.ts +46 -257
  486. package/types/src/shapes/Whisker.d.ts +15 -42
  487. package/types/src/shapes/buildLabelData.d.ts +50 -0
  488. package/types/src/shapes/emitLabels.d.ts +16 -0
  489. package/types/src/shapes/hitAreaNode.d.ts +19 -0
  490. package/types/src/shapes/sceneSort.d.ts +20 -0
  491. package/types/src/shapes/shapeConfig.d.ts +226 -0
  492. package/types/src/utils/BaseClass.d.ts +13 -7
  493. package/types/src/utils/D3Scale.d.ts +48 -0
  494. package/types/src/utils/D3plusConfig.d.ts +230 -3
  495. package/types/src/utils/configPrep.d.ts +7 -4
  496. package/types/src/utils/getProp.d.ts +3 -1
  497. package/types/src/utils/index.d.ts +3 -1
  498. package/types/src/utils/paintComponentScene.d.ts +28 -0
  499. package/types/umd-entry.d.ts +15 -0
  500. package/umd/d3plus-core.full.js +31148 -19470
  501. package/umd/d3plus-core.full.js.map +1 -1
  502. package/umd/d3plus-core.full.min.js +5315 -2939
  503. package/umd/d3plus-core.js +17379 -10575
  504. package/umd/d3plus-core.js.map +1 -1
  505. package/umd/d3plus-core.min.js +3470 -1873
  506. package/es/src/charts/AreaPlot.js +0 -85
  507. package/es/src/charts/AreaPlot.js.map +0 -1
  508. package/es/src/charts/BarChart.js +0 -92
  509. package/es/src/charts/BarChart.js.map +0 -1
  510. package/es/src/charts/BoxWhisker.js +0 -92
  511. package/es/src/charts/BoxWhisker.js.map +0 -1
  512. package/es/src/charts/BumpChart.js +0 -147
  513. package/es/src/charts/BumpChart.js.map +0 -1
  514. package/es/src/charts/Donut.js +0 -84
  515. package/es/src/charts/Donut.js.map +0 -1
  516. package/es/src/charts/Geomap.js +0 -766
  517. package/es/src/charts/Geomap.js.map +0 -1
  518. package/es/src/charts/LinePlot.js +0 -83
  519. package/es/src/charts/LinePlot.js.map +0 -1
  520. package/es/src/charts/Matrix.js +0 -341
  521. package/es/src/charts/Matrix.js.map +0 -1
  522. package/es/src/charts/Network.js +0 -796
  523. package/es/src/charts/Network.js.map +0 -1
  524. package/es/src/charts/Pack.js +0 -308
  525. package/es/src/charts/Pack.js.map +0 -1
  526. package/es/src/charts/Pie.js +0 -232
  527. package/es/src/charts/Pie.js.map +0 -1
  528. package/es/src/charts/Plot.js +0 -2114
  529. package/es/src/charts/Plot.js.map +0 -1
  530. package/es/src/charts/Priestley.js +0 -296
  531. package/es/src/charts/Priestley.js.map +0 -1
  532. package/es/src/charts/Radar.js +0 -420
  533. package/es/src/charts/Radar.js.map +0 -1
  534. package/es/src/charts/RadialMatrix.js +0 -383
  535. package/es/src/charts/RadialMatrix.js.map +0 -1
  536. package/es/src/charts/Rings.js +0 -788
  537. package/es/src/charts/Rings.js.map +0 -1
  538. package/es/src/charts/Sankey.js +0 -461
  539. package/es/src/charts/Sankey.js.map +0 -1
  540. package/es/src/charts/StackedArea.js +0 -80
  541. package/es/src/charts/StackedArea.js.map +0 -1
  542. package/es/src/charts/Tree.js +0 -347
  543. package/es/src/charts/Tree.js.map +0 -1
  544. package/es/src/charts/Treemap.js +0 -454
  545. package/es/src/charts/Treemap.js.map +0 -1
  546. package/es/src/charts/Viz.js +0 -1832
  547. package/es/src/charts/Viz.js.map +0 -1
  548. package/es/src/charts/drawSteps/drawAttribution.js +0 -16
  549. package/es/src/charts/drawSteps/drawAttribution.js.map +0 -1
  550. package/es/src/charts/drawSteps/drawBack.js +0 -24
  551. package/es/src/charts/drawSteps/drawBack.js.map +0 -1
  552. package/es/src/charts/drawSteps/drawColorScale.js +0 -75
  553. package/es/src/charts/drawSteps/drawColorScale.js.map +0 -1
  554. package/es/src/charts/drawSteps/drawLegend.js +0 -122
  555. package/es/src/charts/drawSteps/drawLegend.js.map +0 -1
  556. package/es/src/charts/drawSteps/drawSubtitle.js +0 -31
  557. package/es/src/charts/drawSteps/drawSubtitle.js.map +0 -1
  558. package/es/src/charts/drawSteps/drawTimeline.js +0 -85
  559. package/es/src/charts/drawSteps/drawTimeline.js.map +0 -1
  560. package/es/src/charts/drawSteps/drawTitle.js +0 -31
  561. package/es/src/charts/drawSteps/drawTitle.js.map +0 -1
  562. package/es/src/charts/drawSteps/drawTotal.js +0 -32
  563. package/es/src/charts/drawSteps/drawTotal.js.map +0 -1
  564. package/es/src/components/Axis.js +0 -1454
  565. package/es/src/components/Axis.js.map +0 -1
  566. package/es/src/components/AxisBottom.js.map +0 -1
  567. package/es/src/components/AxisLeft.js.map +0 -1
  568. package/es/src/components/AxisRight.js.map +0 -1
  569. package/es/src/components/AxisTop.js.map +0 -1
  570. package/es/src/components/ColorScale.js +0 -843
  571. package/es/src/components/ColorScale.js.map +0 -1
  572. package/es/src/components/Legend.js +0 -622
  573. package/es/src/components/Legend.js.map +0 -1
  574. package/es/src/components/Timeline.js +0 -695
  575. package/es/src/components/Timeline.js.map +0 -1
  576. /package/es/src/components/{AxisBottom.js → Axis/AxisBottom.js} +0 -0
  577. /package/es/src/components/{AxisLeft.js → Axis/AxisLeft.js} +0 -0
  578. /package/es/src/components/{AxisRight.js → Axis/AxisRight.js} +0 -0
  579. /package/es/src/components/{AxisTop.js → Axis/AxisTop.js} +0 -0
@@ -0,0 +1,506 @@
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 ownKeys(object, enumerableOnly) {
78
+ var keys = Object.keys(object);
79
+ if (Object.getOwnPropertySymbols) {
80
+ var symbols = Object.getOwnPropertySymbols(object);
81
+ if (enumerableOnly) {
82
+ symbols = symbols.filter(function(sym) {
83
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
84
+ });
85
+ }
86
+ keys.push.apply(keys, symbols);
87
+ }
88
+ return keys;
89
+ }
90
+ function _object_spread_props(target, source) {
91
+ source = source != null ? source : {};
92
+ if (Object.getOwnPropertyDescriptors) {
93
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
94
+ } else {
95
+ ownKeys(Object(source)).forEach(function(key) {
96
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
97
+ });
98
+ }
99
+ return target;
100
+ }
101
+ function _possible_constructor_return(self, call) {
102
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
103
+ return call;
104
+ }
105
+ return _assert_this_initialized(self);
106
+ }
107
+ function _set_prototype_of(o, p) {
108
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
109
+ o.__proto__ = p;
110
+ return o;
111
+ };
112
+ return _set_prototype_of(o, p);
113
+ }
114
+ function _type_of(obj) {
115
+ "@swc/helpers - typeof";
116
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
117
+ }
118
+ function _is_native_reflect_construct() {
119
+ try {
120
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
121
+ } catch (_) {}
122
+ return (_is_native_reflect_construct = function() {
123
+ return !!result;
124
+ })();
125
+ }
126
+ import { max, min } from "d3-array";
127
+ import { select } from "d3-selection";
128
+ import { transition } from "d3-transition";
129
+ import { colorContrast, colorDefaults } from "@d3plus/color";
130
+ import { assign, backgroundColor, elem } from "@d3plus/dom";
131
+ import { formatAbbreviate } from "@d3plus/format";
132
+ import { Axis, TextBox } from "../index.js";
133
+ import { Rect } from "../../shapes/index.js";
134
+ import { accessor, BaseClass, paintComponentScene } from "../../utils/index.js";
135
+ import { installFluent } from "../../fluent.js";
136
+ import Legend from "../Legend/Legend.js";
137
+ import { computeColorScale } from "./colorScaleScale.js";
138
+ import { renderGradient, renderLegendVariant } from "./colorScaleRender.js";
139
+ /** ColorScale's fluent accessor schema. Config storage lives on `this.schema.<key>`. */ var colorScaleSchema = [
140
+ {
141
+ key: "align",
142
+ coerce: "identity",
143
+ default: "middle"
144
+ },
145
+ {
146
+ key: "buckets",
147
+ coerce: "identity",
148
+ default: 5
149
+ },
150
+ {
151
+ key: "bucketAxis",
152
+ coerce: "identity",
153
+ default: false
154
+ },
155
+ {
156
+ key: "bucketFormat",
157
+ coerce: "identity"
158
+ },
159
+ {
160
+ key: "bucketJoiner",
161
+ coerce: "identity",
162
+ default: function _default(a, b) {
163
+ return a !== b ? "".concat(a, " - ").concat(b) : "".concat(a);
164
+ }
165
+ },
166
+ {
167
+ key: "centered",
168
+ coerce: "identity",
169
+ default: true
170
+ },
171
+ // No default palette: an unset `color` falls through to the single-hue
172
+ // (colorMax / colorMin) ramp or the diverging (min↔mid↔max) construction,
173
+ // so magnitude reads as one hue getting darker rather than a multi-hue ramp.
174
+ {
175
+ key: "color",
176
+ coerce: "identity"
177
+ },
178
+ // Blue high pole (and default sequential hue), gray "nothing" midpoint, red
179
+ // low pole — warm/cool poles that stay distinct under color-vision deficiency.
180
+ {
181
+ key: "colorMax",
182
+ coerce: "identity",
183
+ default: colorDefaults.sequential
184
+ },
185
+ {
186
+ key: "colorMid",
187
+ coerce: "identity",
188
+ default: colorDefaults.light
189
+ },
190
+ {
191
+ key: "colorMin",
192
+ coerce: "identity",
193
+ default: colorDefaults.off
194
+ },
195
+ {
196
+ key: "domain",
197
+ coerce: "identity"
198
+ },
199
+ {
200
+ key: "duration",
201
+ coerce: "identity",
202
+ default: 600
203
+ },
204
+ {
205
+ key: "height",
206
+ coerce: "identity",
207
+ default: 200
208
+ },
209
+ {
210
+ key: "midpoint",
211
+ coerce: "identity",
212
+ default: 0
213
+ },
214
+ {
215
+ key: "orient",
216
+ coerce: "identity",
217
+ default: "bottom"
218
+ },
219
+ {
220
+ key: "padding",
221
+ coerce: "identity",
222
+ default: 5
223
+ },
224
+ {
225
+ key: "renderMode",
226
+ coerce: "identity",
227
+ default: "full"
228
+ },
229
+ {
230
+ key: "scale",
231
+ coerce: "identity",
232
+ default: "linear"
233
+ },
234
+ {
235
+ key: "size",
236
+ coerce: "identity",
237
+ default: 10
238
+ },
239
+ {
240
+ key: "value",
241
+ coerce: "const",
242
+ default: accessor("value")
243
+ },
244
+ {
245
+ key: "width",
246
+ coerce: "identity",
247
+ default: 400
248
+ }
249
+ ];
250
+ var ColorScale = /*#__PURE__*/ function(BaseClass) {
251
+ "use strict";
252
+ _inherits(ColorScale, BaseClass);
253
+ function ColorScale() {
254
+ _class_call_check(this, ColorScale);
255
+ var _this;
256
+ _this = _call_super(this, ColorScale), _define_property(_this, "_select", void 0), _define_property(_this, "_axisClass", void 0), _define_property(_this, "_axisTest", void 0), _define_property(_this, "_colorScale", void 0), _define_property(_this, "_data", void 0), _define_property(_this, "_group", void 0), _define_property(_this, "_labelClass", void 0), _define_property(_this, "_labelMin", void 0), _define_property(_this, "_labelMax", void 0), _define_property(_this, "_legendClass", void 0), _define_property(_this, "_outerBounds", void 0), _define_property(_this, "_rectClass", void 0), /** Smooth-gradient fill token (`gradient:<json>`), set by renderGradientStops. */ _define_property(_this, "_gradientFill", void 0), // Standalone scene renderer (used when rendered on its own, not inside a
257
+ // Viz). Reused across re-renders by paintComponentScene().
258
+ _define_property(_this, "_sceneRenderer", void 0);
259
+ installFluent(_this, colorScaleSchema);
260
+ _this._axisClass = new Axis();
261
+ _this.schema.axisConfig = {
262
+ gridSize: 0
263
+ };
264
+ _this._axisTest = new Axis();
265
+ _this.schema.bucketFormat = function(tick, i, ticks, allValues) {
266
+ var format = _this.schema.axisConfig.tickFormat ? _this.schema.axisConfig.tickFormat : formatAbbreviate;
267
+ var next = ticks[i + 1];
268
+ var prev = i ? ticks[i - 1] : false;
269
+ var last = i === ticks.length - 1;
270
+ if (tick === next || last) {
271
+ var suffix = last && tick < max(allValues) ? "+" : "";
272
+ return "".concat(format(tick)).concat(suffix);
273
+ } else {
274
+ var mod = next ? next / 100 : tick / 100;
275
+ var pow = mod >= 1 || mod <= -1 ? Math.round(mod).toString().length - 1 : mod.toString().split(".")[1].replace(/([1-9])[1-9].*$/, "$1").length * -1;
276
+ var ten = Math.pow(10, pow);
277
+ var prevValue = prev === tick && i === 1 ? format(min([
278
+ tick + ten,
279
+ allValues.find(function(d) {
280
+ return d > tick && d < next;
281
+ })
282
+ ])) : format(tick);
283
+ var nextValue = tick && i === 1 ? format(next) : format(max([
284
+ next - ten,
285
+ allValues.reverse().find(function(d) {
286
+ return d > tick && d < next;
287
+ })
288
+ ]));
289
+ return _this.schema.bucketJoiner(prevValue, nextValue);
290
+ }
291
+ };
292
+ _this._data = [];
293
+ _this._labelClass = new TextBox();
294
+ _this.schema.labelConfig = {
295
+ fontColor: function fontColor() {
296
+ var bg = _this._select ? backgroundColor(_this._select.node()) : "rgb(255, 255, 255)";
297
+ return colorContrast(bg);
298
+ },
299
+ fontSize: 12
300
+ };
301
+ _this._legendClass = new Legend();
302
+ _this.schema.legendConfig = {
303
+ shapeConfig: {
304
+ stroke: colorDefaults.dark,
305
+ strokeWidth: 1
306
+ }
307
+ };
308
+ _this._outerBounds = {
309
+ width: 0,
310
+ height: 0,
311
+ x: 0,
312
+ y: 0
313
+ };
314
+ _this._rectClass = new Rect().parent(_this);
315
+ _this.schema.rectConfig = {
316
+ stroke: "#999",
317
+ strokeWidth: 1
318
+ };
319
+ return _this;
320
+ }
321
+ _create_class(ColorScale, [
322
+ {
323
+ /**
324
+ Renders the current ColorScale to the page.
325
+ @param callback Optional callback invoked after rendering completes.
326
+ */ key: "render",
327
+ value: function render(callback) {
328
+ // Standalone full-render fallback: mount into a <div> appended to <body> so
329
+ // `paintComponentScene` creates the single <svg> inside it — mounting the
330
+ // renderer into an <svg> container would nest a second one. Skipped in
331
+ // compute mode, where the caller reads `toScene()` and no DOM is created.
332
+ if (this._select === void 0 && this.schema.renderMode !== "compute") this.select(select("body").append("div").node());
333
+ // Shape <g> Group
334
+ this._group = elem("g.d3plus-ColorScale", {
335
+ parent: this._select
336
+ });
337
+ var compute = computeColorScale(this);
338
+ var gradient = this.schema.bucketAxis || ![
339
+ "buckets",
340
+ "jenks",
341
+ "quantile"
342
+ ].includes(this.schema.scale);
343
+ var t = transition().duration(this.schema.duration);
344
+ var groupParams = {
345
+ enter: {
346
+ opacity: 0
347
+ },
348
+ exit: {
349
+ opacity: 0
350
+ },
351
+ parent: this._group,
352
+ transition: t,
353
+ update: {
354
+ opacity: 1
355
+ }
356
+ };
357
+ var labelGroup = elem("g.d3plus-ColorScale-labels", Object.assign({
358
+ condition: gradient
359
+ }, groupParams));
360
+ var rectGroup = elem("g.d3plus-ColorScale-Rect", Object.assign({
361
+ condition: gradient
362
+ }, groupParams));
363
+ var legendGroup = elem("g.d3plus-ColorScale-legend", Object.assign({
364
+ condition: !gradient
365
+ }, groupParams));
366
+ var groups = {
367
+ labelGroup: labelGroup,
368
+ rectGroup: rectGroup,
369
+ legendGroup: legendGroup,
370
+ groupParams: groupParams,
371
+ gradient: gradient
372
+ };
373
+ if (gradient) renderGradient(this, compute, groups);
374
+ else renderLegendVariant(this, compute, groups);
375
+ // Standalone render: paint the scene into the user's `_select`. Inside a
376
+ // Viz the color scale runs in compute mode and the Viz composes its
377
+ // toScene().
378
+ if (this.schema.renderMode !== "compute") paintComponentScene(this);
379
+ if (callback) setTimeout(callback, this.schema.duration + 100);
380
+ return this;
381
+ }
382
+ },
383
+ {
384
+ /**
385
+ Produces a backend-agnostic scene graph for this ColorScale with no DOM
386
+ dependency. The discrete variant (jenks/buckets/quantile) delegates to the
387
+ internal Legend's toScene(); the gradient variant composes the Rect, Axis,
388
+ and label TextBox scenes. The scaleGroup's translate (set by the chart's
389
+ colorScale feature on `g.d3plus-viz-colorScale`) is read off `_select` so
390
+ the content lands at its on-screen position.
391
+
392
+ A smooth (non-bucketed) gradient paints its Rect with a `gradient:<json>`
393
+ fill token (see renderGradientStops); the backend materializes it into a
394
+ `<linearGradient>` (SVG) or a CanvasGradient (Canvas). Bucketed gradients
395
+ and the discrete variant use concrete per-bucket fills.
396
+ */ key: "toScene",
397
+ value: function toScene() {
398
+ var children = [];
399
+ var gradient = this.schema.bucketAxis || ![
400
+ "buckets",
401
+ "jenks",
402
+ "quantile"
403
+ ].includes(this.schema.scale);
404
+ var pushScene = function pushScene(cls) {
405
+ if (cls && typeof cls.toScene === "function") {
406
+ var s = cls.toScene();
407
+ if (s) children.push(s);
408
+ }
409
+ };
410
+ if (gradient) {
411
+ pushScene(this._rectClass);
412
+ pushScene(this._axisClass);
413
+ pushScene(this._labelClass);
414
+ } else {
415
+ pushScene(this._legendClass);
416
+ }
417
+ // Preserve the placement of the scaleGroup the chart's colorScale feature
418
+ // positioned (translate on `g.d3plus-viz-colorScale`).
419
+ var transform;
420
+ var node = this._select && typeof this._select.node === "function" ? this._select.node() : null;
421
+ if (node && typeof node.getAttribute === "function") {
422
+ var attr = node.getAttribute("transform");
423
+ if (attr) {
424
+ var m = /translate\(\s*([-\d.eE]+)[\s,]+([-\d.eE]+)/.exec(attr);
425
+ if (m) transform = {
426
+ x: Number(m[1]),
427
+ y: Number(m[2])
428
+ };
429
+ }
430
+ }
431
+ return _object_spread_props(_object_spread({
432
+ type: "group",
433
+ key: "ColorScale-".concat(this._uuid.slice(0, 8))
434
+ }, transform ? {
435
+ transform: transform
436
+ } : {}), {
437
+ children: children
438
+ });
439
+ }
440
+ },
441
+ {
442
+ key: "axisConfig",
443
+ value: function axisConfig(_) {
444
+ return arguments.length ? (this.schema.axisConfig = assign(this.schema.axisConfig, _), this) : this.schema.axisConfig;
445
+ }
446
+ },
447
+ {
448
+ key: "data",
449
+ value: function data(_) {
450
+ return arguments.length ? (this._data = _, this) : this._data;
451
+ }
452
+ },
453
+ {
454
+ key: "labelConfig",
455
+ value: function labelConfig(_) {
456
+ return arguments.length ? (this.schema.labelConfig = assign(this.schema.labelConfig, _), this) : this.schema.labelConfig;
457
+ }
458
+ },
459
+ {
460
+ key: "labelMin",
461
+ value: function labelMin(_) {
462
+ return arguments.length ? (this._labelMin = _, this) : this._labelMin;
463
+ }
464
+ },
465
+ {
466
+ key: "labelMax",
467
+ value: function labelMax(_) {
468
+ return arguments.length ? (this._labelMax = _, this) : this._labelMax;
469
+ }
470
+ },
471
+ {
472
+ key: "legendConfig",
473
+ value: function legendConfig(_) {
474
+ return arguments.length ? (this.schema.legendConfig = assign(this.schema.legendConfig, _), this) : this.schema.legendConfig;
475
+ }
476
+ },
477
+ {
478
+ /**
479
+ Returns the outer bounds of the ColorScale content. Must be called after rendering.
480
+ @example
481
+ {"width": 180, "height": 24, "x": 10, "y": 20}
482
+ */ key: "outerBounds",
483
+ value: function outerBounds() {
484
+ return this._outerBounds;
485
+ }
486
+ },
487
+ {
488
+ key: "rectConfig",
489
+ value: function rectConfig(_) {
490
+ return arguments.length ? (this.schema.rectConfig = assign(this.schema.rectConfig, _), this) : this.schema.rectConfig;
491
+ }
492
+ },
493
+ {
494
+ key: "select",
495
+ value: function select1(_) {
496
+ return arguments.length ? (this._select = select(_), this) : this._select;
497
+ }
498
+ }
499
+ ]);
500
+ return ColorScale;
501
+ }(BaseClass);
502
+ /**
503
+ Creates an SVG color scale based on an array of data.
504
+ */ export { ColorScale as default };
505
+
506
+ //# sourceMappingURL=ColorScale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ColorScale/ColorScale.ts"],"sourcesContent":["import {max, min} from \"d3-array\";\nimport {select} from \"d3-selection\";\nimport {transition} from \"d3-transition\";\n\nimport {colorContrast, colorDefaults} from \"@d3plus/color\";\nimport {assign, backgroundColor, elem} from \"@d3plus/dom\";\nimport type {D3Selection} from \"@d3plus/dom\";\nimport {formatAbbreviate} from \"@d3plus/format\";\n\nimport type {DataPoint} from \"@d3plus/data\";\nimport type {GroupNode, SceneNode, Transform} from \"@d3plus/render\";\nimport type {SvgRenderer} from \"@d3plus/render\";\n\nimport {Axis, TextBox} from \"../index.js\";\nimport {Rect} from \"../../shapes/index.js\";\nimport {accessor, BaseClass, paintComponentScene} from \"../../utils/index.js\";\nimport type {D3Scale} from \"../../utils/index.js\";\nimport {installFluent} from \"../../fluent.js\";\nimport type {ConfigField} from \"../../fluent.js\";\n\nimport Legend from \"../Legend/Legend.js\";\nimport {computeColorScale} from \"./colorScaleScale.js\";\nimport {renderGradient, renderLegendVariant} from \"./colorScaleRender.js\";\nimport type {ColorScaleGroups} from \"./colorScaleRender.js\";\n\n/** ColorScale's fluent accessor schema. Config storage lives on `this.schema.<key>`. */\nconst colorScaleSchema: ConfigField[] = [\n {key: \"align\", coerce: \"identity\", default: \"middle\"},\n {key: \"buckets\", coerce: \"identity\", default: 5},\n {key: \"bucketAxis\", coerce: \"identity\", default: false},\n {key: \"bucketFormat\", coerce: \"identity\"},\n {\n key: \"bucketJoiner\",\n coerce: \"identity\",\n default: (a: string, b: string): string => (a !== b ? `${a} - ${b}` : `${a}`),\n },\n {key: \"centered\", coerce: \"identity\", default: true},\n // No default palette: an unset `color` falls through to the single-hue\n // (colorMax / colorMin) ramp or the diverging (min↔mid↔max) construction,\n // so magnitude reads as one hue getting darker rather than a multi-hue ramp.\n {key: \"color\", coerce: \"identity\"},\n // Blue high pole (and default sequential hue), gray \"nothing\" midpoint, red\n // low pole — warm/cool poles that stay distinct under color-vision deficiency.\n {key: \"colorMax\", coerce: \"identity\", default: colorDefaults.sequential},\n {key: \"colorMid\", coerce: \"identity\", default: colorDefaults.light},\n {key: \"colorMin\", coerce: \"identity\", default: colorDefaults.off},\n {key: \"domain\", coerce: \"identity\"},\n {key: \"duration\", coerce: \"identity\", default: 600},\n {key: \"height\", coerce: \"identity\", default: 200},\n {key: \"midpoint\", coerce: \"identity\", default: 0},\n {key: \"orient\", coerce: \"identity\", default: \"bottom\"},\n {key: \"padding\", coerce: \"identity\", default: 5},\n {key: \"renderMode\", coerce: \"identity\", default: \"full\"},\n {key: \"scale\", coerce: \"identity\", default: \"linear\"},\n {key: \"size\", coerce: \"identity\", default: 10},\n {key: \"value\", coerce: \"const\", default: accessor(\"value\")},\n {key: \"width\", coerce: \"identity\", default: 400},\n];\n\n/**\n Creates an SVG color scale based on an array of data.\n*/\nexport default class ColorScale extends BaseClass {\n // installFluent generates the config accessors (align, buckets, …) at\n // runtime; the index signature lets callers reach them through the type.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n _select!: D3Selection;\n _axisClass: Axis;\n _axisTest: Axis;\n _colorScale?: D3Scale<string>;\n _data: DataPoint[];\n _group!: D3Selection;\n _labelClass: TextBox;\n _labelMin: string | undefined;\n _labelMax: string | undefined;\n _legendClass: Legend;\n _outerBounds: Record<string, number>;\n _rectClass: Rect;\n /** Smooth-gradient fill token (`gradient:<json>`), set by renderGradientStops. */\n _gradientFill?: string;\n // Standalone scene renderer (used when rendered on its own, not inside a\n // Viz). Reused across re-renders by paintComponentScene().\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, colorScaleSchema);\n\n this._axisClass = new Axis();\n this.schema.axisConfig = {\n gridSize: 0,\n };\n this._axisTest = new Axis();\n this.schema.bucketFormat = (\n tick: number,\n i: number,\n ticks: number[],\n allValues: number[],\n ): string => {\n const format = (this.schema.axisConfig.tickFormat\n ? this.schema.axisConfig.tickFormat\n : formatAbbreviate) as (v: number | undefined) => string;\n\n const next = ticks[i + 1];\n const prev = i ? ticks[i - 1] : false;\n const last = i === ticks.length - 1;\n if (tick === next || last) {\n const suffix = last && tick < max(allValues)! ? \"+\" : \"\";\n return `${format(tick)}${suffix}`;\n } else {\n const mod = next ? next / 100 : tick / 100;\n\n const pow =\n mod >= 1 || mod <= -1\n ? Math.round(mod).toString().length - 1\n : mod\n .toString()\n .split(\".\")[1]\n .replace(/([1-9])[1-9].*$/, \"$1\").length * -1;\n const ten = Math.pow(10, pow);\n\n const prevValue =\n prev === tick && i === 1\n ? format(\n min([\n tick + ten,\n allValues.find((d: number) => d > tick && d < next),\n ] as number[]),\n )\n : format(tick);\n\n const nextValue =\n tick && i === 1\n ? format(next)\n : format(\n max([\n next - ten,\n allValues.reverse().find((d: number) => d > tick && d < next),\n ] as number[]),\n );\n\n return this.schema.bucketJoiner(prevValue, nextValue);\n }\n };\n this._data = [];\n this._labelClass = new TextBox();\n this.schema.labelConfig = {\n fontColor: () => {\n const bg = this._select ? backgroundColor(this._select.node()) : \"rgb(255, 255, 255)\";\n return colorContrast(bg);\n },\n fontSize: 12,\n };\n this._legendClass = new Legend();\n this.schema.legendConfig = {\n shapeConfig: {\n stroke: colorDefaults.dark,\n strokeWidth: 1,\n },\n };\n this._outerBounds = {width: 0, height: 0, x: 0, y: 0};\n this._rectClass = new Rect().parent(\n this as unknown as Record<string, unknown>,\n );\n this.schema.rectConfig = {\n stroke: \"#999\",\n strokeWidth: 1,\n };\n }\n\n /**\n Renders the current ColorScale to the page.\n @param callback Optional callback invoked after rendering completes.\n*/\n render(callback?: (...args: unknown[]) => unknown): this {\n // Standalone full-render fallback: mount into a <div> appended to <body> so\n // `paintComponentScene` creates the single <svg> inside it — mounting the\n // renderer into an <svg> container would nest a second one. Skipped in\n // compute mode, where the caller reads `toScene()` and no DOM is created.\n if (this._select === void 0 && this.schema.renderMode !== \"compute\")\n this.select(select(\"body\").append(\"div\").node() as unknown as HTMLElement);\n\n // Shape <g> Group\n this._group = elem(\"g.d3plus-ColorScale\", {parent: this._select});\n\n const compute = computeColorScale(this);\n\n const gradient =\n this.schema.bucketAxis ||\n ![\"buckets\", \"jenks\", \"quantile\"].includes(this.schema.scale);\n const t = transition().duration(this.schema.duration);\n const groupParams: Record<string, unknown> = {\n enter: {opacity: 0},\n exit: {opacity: 0},\n parent: this._group,\n transition: t,\n update: {opacity: 1},\n };\n const labelGroup = elem(\n \"g.d3plus-ColorScale-labels\",\n Object.assign({condition: gradient}, groupParams),\n );\n const rectGroup = elem(\n \"g.d3plus-ColorScale-Rect\",\n Object.assign({condition: gradient}, groupParams),\n );\n const legendGroup = elem(\n \"g.d3plus-ColorScale-legend\",\n Object.assign({condition: !gradient}, groupParams),\n );\n\n const groups: ColorScaleGroups = {\n labelGroup,\n rectGroup,\n legendGroup,\n groupParams,\n gradient,\n };\n\n if (gradient) renderGradient(this, compute, groups);\n else renderLegendVariant(this, compute, groups);\n\n // Standalone render: paint the scene into the user's `_select`. Inside a\n // Viz the color scale runs in compute mode and the Viz composes its\n // toScene().\n if (this.schema.renderMode !== \"compute\") paintComponentScene(this);\n\n if (callback) setTimeout(callback, this.schema.duration + 100);\n\n return this;\n }\n\n /**\n Produces a backend-agnostic scene graph for this ColorScale with no DOM\n dependency. The discrete variant (jenks/buckets/quantile) delegates to the\n internal Legend's toScene(); the gradient variant composes the Rect, Axis,\n and label TextBox scenes. The scaleGroup's translate (set by the chart's\n colorScale feature on `g.d3plus-viz-colorScale`) is read off `_select` so\n the content lands at its on-screen position.\n\n A smooth (non-bucketed) gradient paints its Rect with a `gradient:<json>`\n fill token (see renderGradientStops); the backend materializes it into a\n `<linearGradient>` (SVG) or a CanvasGradient (Canvas). Bucketed gradients\n and the discrete variant use concrete per-bucket fills.\n */\n toScene(): GroupNode {\n const children: SceneNode[] = [];\n const gradient =\n this.schema.bucketAxis ||\n ![\"buckets\", \"jenks\", \"quantile\"].includes(this.schema.scale);\n\n const pushScene = (\n cls: {toScene?: () => GroupNode} | undefined,\n ): void => {\n if (cls && typeof cls.toScene === \"function\") {\n const s = cls.toScene();\n if (s) children.push(s);\n }\n };\n\n if (gradient) {\n pushScene(this._rectClass as unknown as {toScene?: () => GroupNode});\n pushScene(this._axisClass as unknown as {toScene?: () => GroupNode});\n pushScene(this._labelClass as unknown as {toScene?: () => GroupNode});\n } else {\n pushScene(this._legendClass as unknown as {toScene?: () => GroupNode});\n }\n\n // Preserve the placement of the scaleGroup the chart's colorScale feature\n // positioned (translate on `g.d3plus-viz-colorScale`).\n let transform: Transform | undefined;\n const node =\n this._select && typeof this._select.node === \"function\"\n ? (this._select.node() as Element | null)\n : null;\n if (node && typeof node.getAttribute === \"function\") {\n const attr = node.getAttribute(\"transform\");\n if (attr) {\n const m = /translate\\(\\s*([-\\d.eE]+)[\\s,]+([-\\d.eE]+)/.exec(attr);\n if (m) transform = {x: Number(m[1]), y: Number(m[2])};\n }\n }\n\n return {\n type: \"group\",\n key: `ColorScale-${this._uuid.slice(0, 8)}`,\n ...(transform ? {transform} : {}),\n children,\n };\n }\n\n /**\n The [ColorScale](http://d3plus.org/docs/#ColorScale) is constructed by combining an [Axis](http://d3plus.org/docs/#Axis) for the ticks/labels and a [Rect](http://d3plus.org/docs/#Rect) for the actual color box (or multiple boxes, as in a jenks scale). Because of this, there are separate configs for the [Axis](http://d3plus.org/docs/#Axis) class used to display the text ([axisConfig](http://d3plus.org/docs/#ColorScale.axisConfig)) and the [Rect](http://d3plus.org/docs/#Rect) class used to draw the color breaks ([rectConfig](http://d3plus.org/docs/#ColorScale.rectConfig)). This method acts as a pass-through to the config method of the [Axis](http://d3plus.org/docs/#Axis). An example usage of this method can be seen [here](http://d3plus.org/examples/d3plus-legend/colorScale-dark/).\n*/\n axisConfig(): Record<string, unknown>;\n axisConfig(_: Record<string, unknown>): this;\n axisConfig(_?: Record<string, unknown>): unknown {\n return arguments.length\n ? ((this.schema.axisConfig = assign(this.schema.axisConfig, _!)), this)\n : this.schema.axisConfig;\n }\n\n /**\n The data array used to create shapes. A shape key will be drawn for each object in the array.\n*/\n data(): DataPoint[];\n data(_: DataPoint[]): this;\n data(_?: DataPoint[]): unknown {\n return arguments.length ? ((this._data = _!), this) : this._data;\n }\n\n /**\n A pass-through for the [TextBox](http://d3plus.org/docs/#TextBox) class used to style the labelMin and labelMax text.\n*/\n labelConfig(): Record<string, unknown>;\n labelConfig(_: Record<string, unknown>): this;\n labelConfig(_?: Record<string, unknown>): unknown {\n return arguments.length\n ? ((this.schema.labelConfig = assign(this.schema.labelConfig, _!)), this)\n : this.schema.labelConfig;\n }\n\n /**\n Defines a text label to be displayed off of the end of the minimum point in the scale (currently only available in horizontal orientation).\n*/\n labelMin(): string | undefined;\n labelMin(_: string): this;\n labelMin(_?: string): unknown {\n return arguments.length ? ((this._labelMin = _), this) : this._labelMin;\n }\n\n /**\n Defines a text label to be displayed off of the end of the maximum point in the scale (currently only available in horizontal orientation).\n*/\n labelMax(): string | undefined;\n labelMax(_: string): this;\n labelMax(_?: string): unknown {\n return arguments.length ? ((this._labelMax = _), this) : this._labelMax;\n }\n\n /**\n The [ColorScale](http://d3plus.org/docs/#ColorScale) is constructed by combining an [Axis](http://d3plus.org/docs/#Axis) for the ticks/labels and a [Rect](http://d3plus.org/docs/#Rect) for the actual color box (or multiple boxes, as in a jenks scale). Because of this, there are separate configs for the [Axis](http://d3plus.org/docs/#Axis) class used to display the text ([axisConfig](http://d3plus.org/docs/#ColorScale.axisConfig)) and the [Rect](http://d3plus.org/docs/#Rect) class used to draw the color breaks ([rectConfig](http://d3plus.org/docs/#ColorScale.rectConfig)). This method acts as a pass-through to the config method of the [Axis](http://d3plus.org/docs/#Axis). An example usage of this method can be seen [here](http://d3plus.org/examples/d3plus-legend/colorScale-dark/).\n*/\n legendConfig(): Record<string, unknown>;\n legendConfig(_: Record<string, unknown>): this;\n legendConfig(_?: Record<string, unknown>): unknown {\n return arguments.length\n ? ((this.schema.legendConfig = assign(this.schema.legendConfig, _!)), this)\n : this.schema.legendConfig;\n }\n\n /**\n Returns the outer bounds of the ColorScale content. Must be called after rendering.\n @example\n{\"width\": 180, \"height\": 24, \"x\": 10, \"y\": 20}\n*/\n outerBounds(): Record<string, number> {\n return this._outerBounds;\n }\n\n /**\n The [ColorScale](http://d3plus.org/docs/#ColorScale) is constructed by combining an [Axis](http://d3plus.org/docs/#Axis) for the ticks/labels and a [Rect](http://d3plus.org/docs/#Rect) for the actual color box (or multiple boxes, as in a jenks scale). Because of this, there are separate configs for the [Axis](http://d3plus.org/docs/#Axis) class used to display the text ([axisConfig](http://d3plus.org/docs/#ColorScale.axisConfig)) and the [Rect](http://d3plus.org/docs/#Rect) class used to draw the color breaks ([rectConfig](http://d3plus.org/docs/#ColorScale.rectConfig)). This method acts as a pass-through to the config method of the [Rect](http://d3plus.org/docs/#Rect). An example usage of this method can be seen [here](http://d3plus.org/examples/d3plus-legend/colorScale-dark/).\n*/\n rectConfig(): Record<string, unknown>;\n rectConfig(_: Record<string, unknown>): this;\n rectConfig(_?: Record<string, unknown>): unknown {\n return arguments.length\n ? ((this.schema.rectConfig = assign(this.schema.rectConfig, _!)), this)\n : this.schema.rectConfig;\n }\n\n /**\n The SVG container element for this visualization. 3 selector or DOM element.\n*/\n select(): D3Selection;\n select(_: string | HTMLElement): this;\n select(_?: string | HTMLElement): unknown {\n return arguments.length\n ? ((this._select = select(_ as never) as unknown as D3Selection), this)\n : this._select;\n }\n}\n"],"names":["max","min","select","transition","colorContrast","colorDefaults","assign","backgroundColor","elem","formatAbbreviate","Axis","TextBox","Rect","accessor","BaseClass","paintComponentScene","installFluent","Legend","computeColorScale","renderGradient","renderLegendVariant","colorScaleSchema","key","coerce","default","a","b","sequential","light","off","ColorScale","_select","_axisClass","_axisTest","_colorScale","_data","_group","_labelClass","_labelMin","_labelMax","_legendClass","_outerBounds","_rectClass","_gradientFill","_sceneRenderer","schema","axisConfig","gridSize","bucketFormat","tick","i","ticks","allValues","format","tickFormat","next","prev","last","length","suffix","mod","pow","Math","round","toString","split","replace","ten","prevValue","find","d","nextValue","reverse","bucketJoiner","labelConfig","fontColor","bg","node","fontSize","legendConfig","shapeConfig","stroke","dark","strokeWidth","width","height","x","y","parent","rectConfig","render","callback","renderMode","append","compute","gradient","bucketAxis","includes","scale","t","duration","groupParams","enter","opacity","exit","update","labelGroup","Object","condition","rectGroup","legendGroup","groups","setTimeout","toScene","children","pushScene","cls","s","push","transform","getAttribute","attr","m","exec","Number","type","_uuid","slice","_","arguments","data","labelMin","labelMax","outerBounds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAQA,GAAG,EAAEC,GAAG,QAAO,WAAW;AAClC,SAAQC,MAAM,QAAO,eAAe;AACpC,SAAQC,UAAU,QAAO,gBAAgB;AAEzC,SAAQC,aAAa,EAAEC,aAAa,QAAO,gBAAgB;AAC3D,SAAQC,MAAM,EAAEC,eAAe,EAAEC,IAAI,QAAO,cAAc;AAE1D,SAAQC,gBAAgB,QAAO,iBAAiB;AAMhD,SAAQC,IAAI,EAAEC,OAAO,QAAO,cAAc;AAC1C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