@antv/g2plot 2.4.25 → 2.4.27

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 (757) hide show
  1. package/dist/g2plot.min.js +2 -17
  2. package/dist/g2plot.min.js.map +1 -1
  3. package/esm/adaptor/brush.d.ts +1 -1
  4. package/esm/adaptor/common.js +2 -2
  5. package/esm/adaptor/common.js.map +1 -1
  6. package/esm/adaptor/conversion-tag.js +4 -4
  7. package/esm/adaptor/conversion-tag.js.map +1 -1
  8. package/esm/adaptor/geometries/area.js +5 -2
  9. package/esm/adaptor/geometries/area.js.map +1 -1
  10. package/esm/adaptor/geometries/base.d.ts +3 -3
  11. package/esm/adaptor/geometries/base.js +6 -6
  12. package/esm/adaptor/geometries/base.js.map +1 -1
  13. package/esm/adaptor/pattern.d.ts +6 -1
  14. package/esm/adaptor/pattern.js +2 -2
  15. package/esm/adaptor/pattern.js.map +1 -1
  16. package/esm/core/adaptor.d.ts +2 -2
  17. package/esm/core/adaptor.js +1 -0
  18. package/esm/core/plot.d.ts +1 -1
  19. package/esm/core/plot.js +2 -2
  20. package/esm/core/plot.js.map +1 -1
  21. package/esm/index.d.ts +1 -1
  22. package/esm/index.js +1 -1
  23. package/esm/index.js.map +1 -1
  24. package/esm/interactions/actions/drill-down.d.ts +2 -2
  25. package/esm/interactions/actions/drill-down.js +3 -3
  26. package/esm/interactions/actions/drill-down.js.map +1 -1
  27. package/esm/interactions/actions/reset-button.js.map +1 -1
  28. package/esm/interactions/brush.d.ts +2 -2
  29. package/esm/interactions/brush.js +34 -34
  30. package/esm/interactions/brush.js.map +1 -1
  31. package/esm/lab.js +3 -3
  32. package/esm/lab.js.map +1 -1
  33. package/esm/plots/_template/adaptor.js +1 -1
  34. package/esm/plots/_template/adaptor.js.map +1 -1
  35. package/esm/plots/_template/types.js +1 -0
  36. package/esm/plots/area/adaptor.js +6 -2
  37. package/esm/plots/area/adaptor.js.map +1 -1
  38. package/esm/plots/area/types.d.ts +5 -1
  39. package/esm/plots/area/types.js +1 -0
  40. package/esm/plots/area/types.js.map +1 -1
  41. package/esm/plots/bar/types.js +1 -0
  42. package/esm/plots/bidirectional-bar/adaptor.js.map +1 -1
  43. package/esm/plots/bidirectional-bar/types.js +1 -0
  44. package/esm/plots/box/types.js +1 -0
  45. package/esm/plots/bullet/adaptor.js +11 -11
  46. package/esm/plots/bullet/adaptor.js.map +1 -1
  47. package/esm/plots/bullet/types.d.ts +2 -2
  48. package/esm/plots/bullet/types.js +1 -0
  49. package/esm/plots/bullet/utils.d.ts +1 -1
  50. package/esm/plots/bullet/utils.js +2 -2
  51. package/esm/plots/bullet/utils.js.map +1 -1
  52. package/esm/plots/chord/adaptor.js +3 -3
  53. package/esm/plots/chord/adaptor.js.map +1 -1
  54. package/esm/plots/chord/constant.js +1 -1
  55. package/esm/plots/chord/constant.js.map +1 -1
  56. package/esm/plots/chord/types.js +1 -0
  57. package/esm/plots/circle-packing/adaptor.js +5 -5
  58. package/esm/plots/circle-packing/adaptor.js.map +1 -1
  59. package/esm/plots/circle-packing/types.js +1 -0
  60. package/esm/plots/circle-packing/utils.js +1 -1
  61. package/esm/plots/circle-packing/utils.js.map +1 -1
  62. package/esm/plots/column/adaptor.js +10 -6
  63. package/esm/plots/column/adaptor.js.map +1 -1
  64. package/esm/plots/column/types.d.ts +1 -1
  65. package/esm/plots/column/types.js +1 -0
  66. package/esm/plots/dual-axes/adaptor.js.map +1 -1
  67. package/esm/plots/dual-axes/types.d.ts +5 -5
  68. package/esm/plots/dual-axes/util/legend.js +1 -1
  69. package/esm/plots/dual-axes/util/legend.js.map +1 -1
  70. package/esm/plots/dual-axes/util/option.js.map +1 -1
  71. package/esm/plots/facet/adaptor.d.ts +1 -1
  72. package/esm/plots/facet/index.d.ts +1 -1
  73. package/esm/plots/facet/types.d.ts +5 -5
  74. package/esm/plots/facet/types.js +1 -0
  75. package/esm/plots/funnel/adaptor.js +3 -3
  76. package/esm/plots/funnel/adaptor.js.map +1 -1
  77. package/esm/plots/funnel/geometries/compare.js.map +1 -1
  78. package/esm/plots/funnel/interactions/index.js +1 -1
  79. package/esm/plots/funnel/interactions/index.js.map +1 -1
  80. package/esm/plots/funnel/types.d.ts +1 -1
  81. package/esm/plots/funnel/types.js +1 -0
  82. package/esm/plots/gauge/adaptor.js +4 -4
  83. package/esm/plots/gauge/adaptor.js.map +1 -1
  84. package/esm/plots/gauge/shapes/indicator.js.map +1 -1
  85. package/esm/plots/gauge/shapes/meter-gauge.js.map +1 -1
  86. package/esm/plots/gauge/types.d.ts +4 -4
  87. package/esm/plots/gauge/utils.js +1 -1
  88. package/esm/plots/gauge/utils.js.map +1 -1
  89. package/esm/plots/heatmap/adaptor.js.map +1 -1
  90. package/esm/plots/heatmap/shapes/circle.js.map +1 -1
  91. package/esm/plots/heatmap/shapes/square.js.map +1 -1
  92. package/esm/plots/heatmap/types.js +1 -0
  93. package/esm/plots/histogram/types.js +1 -0
  94. package/esm/plots/line/types.js +1 -0
  95. package/esm/plots/liquid/adaptor.js +1 -1
  96. package/esm/plots/liquid/adaptor.js.map +1 -1
  97. package/esm/plots/liquid/shapes/liquid.js +5 -5
  98. package/esm/plots/liquid/shapes/liquid.js.map +1 -1
  99. package/esm/plots/liquid/types.d.ts +4 -4
  100. package/esm/plots/liquid/types.js +1 -0
  101. package/esm/plots/mix/interactions/association.js.map +1 -1
  102. package/esm/plots/mix/types.d.ts +3 -3
  103. package/esm/plots/mix/types.js +1 -0
  104. package/esm/plots/mix/utils.d.ts +2 -2
  105. package/esm/plots/mix/utils.js +1 -1
  106. package/esm/plots/mix/utils.js.map +1 -1
  107. package/esm/plots/pie/adaptor.js +2 -2
  108. package/esm/plots/pie/adaptor.js.map +1 -1
  109. package/esm/plots/pie/types.d.ts +1 -1
  110. package/esm/plots/pie/types.js +1 -0
  111. package/esm/plots/progress/types.js +1 -0
  112. package/esm/plots/progress/utils.js +2 -2
  113. package/esm/plots/progress/utils.js.map +1 -1
  114. package/esm/plots/radar/types.js +1 -0
  115. package/esm/plots/radial-bar/adaptor.js +2 -2
  116. package/esm/plots/radial-bar/adaptor.js.map +1 -1
  117. package/esm/plots/radial-bar/types.d.ts +7 -1
  118. package/esm/plots/radial-bar/types.js +1 -0
  119. package/esm/plots/radial-bar/types.js.map +1 -1
  120. package/esm/plots/ring-progress/adaptor.js +1 -1
  121. package/esm/plots/ring-progress/adaptor.js.map +1 -1
  122. package/esm/plots/ring-progress/types.js +1 -0
  123. package/esm/plots/rose/adaptor.js +2 -1
  124. package/esm/plots/rose/adaptor.js.map +1 -1
  125. package/esm/plots/rose/types.d.ts +7 -1
  126. package/esm/plots/rose/types.js +1 -0
  127. package/esm/plots/rose/types.js.map +1 -1
  128. package/esm/plots/sankey/adaptor.js +7 -6
  129. package/esm/plots/sankey/adaptor.js.map +1 -1
  130. package/esm/plots/sankey/circle.js +3 -3
  131. package/esm/plots/sankey/circle.js.map +1 -1
  132. package/esm/plots/sankey/helper.js +3 -3
  133. package/esm/plots/sankey/helper.js.map +1 -1
  134. package/esm/plots/sankey/interactions/actions/node-drag.js +2 -2
  135. package/esm/plots/sankey/interactions/actions/node-drag.js.map +1 -1
  136. package/esm/plots/sankey/layout.d.ts +11 -11
  137. package/esm/plots/sankey/layout.js.map +1 -1
  138. package/esm/plots/sankey/sankey/sankey.d.ts +1 -1
  139. package/esm/plots/sankey/types.d.ts +1 -1
  140. package/esm/plots/sankey/types.js +1 -0
  141. package/esm/plots/scatter/adaptor.js +18 -4
  142. package/esm/plots/scatter/adaptor.js.map +1 -1
  143. package/esm/plots/scatter/index.js.map +1 -1
  144. package/esm/plots/scatter/types.d.ts +16 -1
  145. package/esm/plots/scatter/types.js +1 -0
  146. package/esm/plots/scatter/types.js.map +1 -1
  147. package/esm/plots/scatter/util.d.ts +15 -1
  148. package/esm/plots/scatter/util.js +45 -2
  149. package/esm/plots/scatter/util.js.map +1 -1
  150. package/esm/plots/stock/types.js +1 -0
  151. package/esm/plots/sunburst/adaptor.js +6 -5
  152. package/esm/plots/sunburst/adaptor.js.map +1 -1
  153. package/esm/plots/sunburst/types.d.ts +7 -1
  154. package/esm/plots/sunburst/types.js +1 -0
  155. package/esm/plots/sunburst/types.js.map +1 -1
  156. package/esm/plots/sunburst/utils.js +4 -4
  157. package/esm/plots/sunburst/utils.js.map +1 -1
  158. package/esm/plots/tiny-area/types.js +1 -0
  159. package/esm/plots/tiny-column/constants.js +1 -1
  160. package/esm/plots/tiny-column/constants.js.map +1 -1
  161. package/esm/plots/tiny-column/types.js +1 -0
  162. package/esm/plots/tiny-line/constants.js +1 -1
  163. package/esm/plots/tiny-line/constants.js.map +1 -1
  164. package/esm/plots/tiny-line/types.js +1 -0
  165. package/esm/plots/tiny-line/utils.js +1 -1
  166. package/esm/plots/tiny-line/utils.js.map +1 -1
  167. package/esm/plots/treemap/adaptor.js +3 -3
  168. package/esm/plots/treemap/adaptor.js.map +1 -1
  169. package/esm/plots/treemap/types.js +1 -0
  170. package/esm/plots/venn/layout/layout.js +1 -0
  171. package/esm/plots/venn/layout/layout.js.map +1 -1
  172. package/esm/plots/venn/shape.js.map +1 -1
  173. package/esm/plots/venn/types.d.ts +2 -2
  174. package/esm/plots/venn/utils.d.ts +1 -1
  175. package/esm/plots/violin/constant.js +2 -0
  176. package/esm/plots/violin/constant.js.map +1 -1
  177. package/esm/plots/violin/types.js +1 -0
  178. package/esm/plots/violin/utils.d.ts +2 -2
  179. package/esm/plots/waterfall/adaptor.js +5 -4
  180. package/esm/plots/waterfall/adaptor.js.map +1 -1
  181. package/esm/plots/waterfall/shape.js.map +1 -1
  182. package/esm/plots/waterfall/types.d.ts +9 -3
  183. package/esm/plots/waterfall/types.js +1 -0
  184. package/esm/plots/waterfall/types.js.map +1 -1
  185. package/esm/plots/waterfall/utils.js +1 -1
  186. package/esm/plots/waterfall/utils.js.map +1 -1
  187. package/esm/plots/word-cloud/adaptor.js +2 -2
  188. package/esm/plots/word-cloud/adaptor.js.map +1 -1
  189. package/esm/plots/word-cloud/shapes/word-cloud.js.map +1 -1
  190. package/esm/plots/word-cloud/types.d.ts +2 -2
  191. package/esm/plots/word-cloud/types.js +1 -0
  192. package/esm/types/animation.d.ts +1 -1
  193. package/esm/types/animation.js +1 -0
  194. package/esm/types/annotation.d.ts +2 -2
  195. package/esm/types/annotation.js +1 -0
  196. package/esm/types/attr.d.ts +7 -7
  197. package/esm/types/attr.js +1 -0
  198. package/esm/types/axis.d.ts +1 -1
  199. package/esm/types/axis.js +1 -0
  200. package/esm/types/button.d.ts +1 -1
  201. package/esm/types/button.js +1 -0
  202. package/esm/types/common.d.ts +13 -13
  203. package/esm/types/common.js +1 -0
  204. package/esm/types/coordinate.d.ts +1 -1
  205. package/esm/types/coordinate.js +1 -0
  206. package/esm/types/drill-down.d.ts +1 -1
  207. package/esm/types/drill-down.js +1 -0
  208. package/esm/types/index.d.ts +1 -1
  209. package/esm/types/interaction.d.ts +2 -2
  210. package/esm/types/interaction.js +1 -0
  211. package/esm/types/label.d.ts +1 -1
  212. package/esm/types/label.js +1 -0
  213. package/esm/types/legend.d.ts +1 -1
  214. package/esm/types/legend.js +1 -0
  215. package/esm/types/locale.d.ts +1 -1
  216. package/esm/types/locale.js +1 -0
  217. package/esm/types/meta.d.ts +1 -1
  218. package/esm/types/meta.js +1 -0
  219. package/esm/types/pattern.d.ts +4 -4
  220. package/esm/types/pattern.js +1 -0
  221. package/esm/types/relation-data.d.ts +3 -3
  222. package/esm/types/relation-data.js +1 -0
  223. package/esm/types/scrollbar.d.ts +1 -1
  224. package/esm/types/scrollbar.js +1 -0
  225. package/esm/types/slider.d.ts +1 -1
  226. package/esm/types/slider.js +1 -0
  227. package/esm/types/state.d.ts +4 -4
  228. package/esm/types/state.js +1 -0
  229. package/esm/types/statistic.d.ts +3 -3
  230. package/esm/types/statistic.js +1 -0
  231. package/esm/types/tooltip.d.ts +3 -3
  232. package/esm/types/tooltip.js +1 -0
  233. package/esm/utils/color/blend.js +1 -1
  234. package/esm/utils/color/blend.js.map +1 -1
  235. package/esm/utils/conversion.js +1 -1
  236. package/esm/utils/conversion.js.map +1 -1
  237. package/esm/utils/flow.d.ts +1 -1
  238. package/esm/utils/hierarchy/pack.d.ts +1 -1
  239. package/esm/utils/hierarchy/partition.d.ts +1 -1
  240. package/esm/utils/hierarchy/partition.js.map +1 -1
  241. package/esm/utils/hierarchy/types.js +1 -0
  242. package/esm/utils/hierarchy/util.js +1 -1
  243. package/esm/utils/hierarchy/util.js.map +1 -1
  244. package/esm/utils/invariant.js +4 -4
  245. package/esm/utils/invariant.js.map +1 -1
  246. package/esm/utils/matrix.js +2 -2
  247. package/esm/utils/matrix.js.map +1 -1
  248. package/esm/utils/measure-text.js +3 -3
  249. package/esm/utils/measure-text.js.map +1 -1
  250. package/esm/utils/pattern/index.d.ts +1 -1
  251. package/esm/utils/pattern/line.js +1 -1
  252. package/esm/utils/pattern/line.js.map +1 -1
  253. package/esm/utils/pattern/util.js +2 -2
  254. package/esm/utils/pattern/util.js.map +1 -1
  255. package/esm/utils/statistic.js +9 -9
  256. package/esm/utils/statistic.js.map +1 -1
  257. package/esm/utils/template.js +1 -1
  258. package/esm/utils/template.js.map +1 -1
  259. package/esm/utils/tooltip.js +1 -1
  260. package/esm/utils/tooltip.js.map +1 -1
  261. package/esm/utils/transform/chord.d.ts +4 -4
  262. package/esm/utils/transform/chord.js +4 -4
  263. package/esm/utils/transform/chord.js.map +1 -1
  264. package/esm/utils/transform/histogram.d.ts +1 -1
  265. package/esm/utils/transform/histogram.js +3 -3
  266. package/esm/utils/transform/histogram.js.map +1 -1
  267. package/esm/utils/transform/percent.js +2 -2
  268. package/esm/utils/transform/percent.js.map +1 -1
  269. package/esm/utils/transform/word-cloud.d.ts +1 -1
  270. package/esm/utils/transform/word-cloud.js +2 -1
  271. package/esm/utils/transform/word-cloud.js.map +1 -1
  272. package/lib/adaptor/brush.d.ts +1 -1
  273. package/lib/adaptor/brush.js +3 -3
  274. package/lib/adaptor/brush.js.map +1 -1
  275. package/lib/adaptor/common.js +10 -10
  276. package/lib/adaptor/common.js.map +1 -1
  277. package/lib/adaptor/connected-area.js +2 -2
  278. package/lib/adaptor/connected-area.js.map +1 -1
  279. package/lib/adaptor/conversion-tag.js +9 -9
  280. package/lib/adaptor/conversion-tag.js.map +1 -1
  281. package/lib/adaptor/geometries/area.js +7 -4
  282. package/lib/adaptor/geometries/area.js.map +1 -1
  283. package/lib/adaptor/geometries/base.d.ts +3 -3
  284. package/lib/adaptor/geometries/base.js +17 -17
  285. package/lib/adaptor/geometries/base.js.map +1 -1
  286. package/lib/adaptor/geometries/edge.js +2 -2
  287. package/lib/adaptor/geometries/edge.js.map +1 -1
  288. package/lib/adaptor/geometries/index.js +1 -0
  289. package/lib/adaptor/geometries/index.js.map +1 -1
  290. package/lib/adaptor/geometries/interval.js +4 -4
  291. package/lib/adaptor/geometries/interval.js.map +1 -1
  292. package/lib/adaptor/geometries/line.js +3 -3
  293. package/lib/adaptor/geometries/line.js.map +1 -1
  294. package/lib/adaptor/geometries/point.js +2 -2
  295. package/lib/adaptor/geometries/point.js.map +1 -1
  296. package/lib/adaptor/geometries/polygon.js +2 -2
  297. package/lib/adaptor/geometries/polygon.js.map +1 -1
  298. package/lib/adaptor/geometries/schema.js +2 -2
  299. package/lib/adaptor/geometries/schema.js.map +1 -1
  300. package/lib/adaptor/geometries/violin.js +2 -2
  301. package/lib/adaptor/geometries/violin.js.map +1 -1
  302. package/lib/adaptor/pattern.d.ts +6 -1
  303. package/lib/adaptor/pattern.js +4 -4
  304. package/lib/adaptor/pattern.js.map +1 -1
  305. package/lib/core/adaptor.d.ts +2 -2
  306. package/lib/core/global.js +1 -1
  307. package/lib/core/global.js.map +1 -1
  308. package/lib/core/locale.js +1 -1
  309. package/lib/core/locale.js.map +1 -1
  310. package/lib/core/plot.d.ts +1 -1
  311. package/lib/core/plot.js +13 -13
  312. package/lib/core/plot.js.map +1 -1
  313. package/lib/index.d.ts +1 -1
  314. package/lib/index.js +5 -4
  315. package/lib/index.js.map +1 -1
  316. package/lib/interactions/actions/drill-down.d.ts +2 -2
  317. package/lib/interactions/actions/drill-down.js +12 -12
  318. package/lib/interactions/actions/drill-down.js.map +1 -1
  319. package/lib/interactions/actions/reset-button.js +3 -3
  320. package/lib/interactions/actions/reset-button.js.map +1 -1
  321. package/lib/interactions/brush.d.ts +2 -2
  322. package/lib/interactions/brush.js +42 -42
  323. package/lib/interactions/brush.js.map +1 -1
  324. package/lib/interactions/drag-move.js +1 -1
  325. package/lib/interactions/drag-move.js.map +1 -1
  326. package/lib/interactions/drill-down.js +4 -4
  327. package/lib/interactions/drill-down.js.map +1 -1
  328. package/lib/lab.js +3 -3
  329. package/lib/lab.js.map +1 -1
  330. package/lib/plots/_template/adaptor.js +3 -3
  331. package/lib/plots/_template/adaptor.js.map +1 -1
  332. package/lib/plots/area/adaptor.js +17 -13
  333. package/lib/plots/area/adaptor.js.map +1 -1
  334. package/lib/plots/area/constants.js +1 -1
  335. package/lib/plots/area/constants.js.map +1 -1
  336. package/lib/plots/area/index.js +2 -2
  337. package/lib/plots/area/index.js.map +1 -1
  338. package/lib/plots/area/types.d.ts +5 -1
  339. package/lib/plots/area/types.js.map +1 -1
  340. package/lib/plots/bar/adaptor.js +6 -6
  341. package/lib/plots/bar/adaptor.js.map +1 -1
  342. package/lib/plots/bar/constants.js +1 -1
  343. package/lib/plots/bar/constants.js.map +1 -1
  344. package/lib/plots/bar/index.js +2 -2
  345. package/lib/plots/bar/index.js.map +1 -1
  346. package/lib/plots/bidirectional-bar/adaptor.js +41 -41
  347. package/lib/plots/bidirectional-bar/adaptor.js.map +1 -1
  348. package/lib/plots/bidirectional-bar/index.js +4 -4
  349. package/lib/plots/bidirectional-bar/index.js.map +1 -1
  350. package/lib/plots/bidirectional-bar/utils.js +1 -1
  351. package/lib/plots/bidirectional-bar/utils.js.map +1 -1
  352. package/lib/plots/box/adaptor.js +10 -10
  353. package/lib/plots/box/adaptor.js.map +1 -1
  354. package/lib/plots/box/constant.js +1 -1
  355. package/lib/plots/box/constant.js.map +1 -1
  356. package/lib/plots/box/index.js +1 -1
  357. package/lib/plots/box/index.js.map +1 -1
  358. package/lib/plots/box/utils.js +3 -2
  359. package/lib/plots/box/utils.js.map +1 -1
  360. package/lib/plots/bullet/adaptor.js +37 -37
  361. package/lib/plots/bullet/adaptor.js.map +1 -1
  362. package/lib/plots/bullet/constant.js +1 -1
  363. package/lib/plots/bullet/constant.js.map +1 -1
  364. package/lib/plots/bullet/index.js +2 -2
  365. package/lib/plots/bullet/index.js.map +1 -1
  366. package/lib/plots/bullet/types.d.ts +2 -2
  367. package/lib/plots/bullet/utils.d.ts +1 -1
  368. package/lib/plots/bullet/utils.js +2 -2
  369. package/lib/plots/bullet/utils.js.map +1 -1
  370. package/lib/plots/chord/adaptor.js +8 -8
  371. package/lib/plots/chord/adaptor.js.map +1 -1
  372. package/lib/plots/chord/constant.js +2 -2
  373. package/lib/plots/chord/constant.js.map +1 -1
  374. package/lib/plots/circle-packing/adaptor.js +20 -20
  375. package/lib/plots/circle-packing/adaptor.js.map +1 -1
  376. package/lib/plots/circle-packing/utils.js +4 -4
  377. package/lib/plots/circle-packing/utils.js.map +1 -1
  378. package/lib/plots/column/adaptor.js +23 -19
  379. package/lib/plots/column/adaptor.js.map +1 -1
  380. package/lib/plots/column/constants.js +1 -1
  381. package/lib/plots/column/constants.js.map +1 -1
  382. package/lib/plots/column/index.js +2 -2
  383. package/lib/plots/column/index.js.map +1 -1
  384. package/lib/plots/column/types.d.ts +1 -1
  385. package/lib/plots/dual-axes/adaptor.js +63 -63
  386. package/lib/plots/dual-axes/adaptor.js.map +1 -1
  387. package/lib/plots/dual-axes/index.js +1 -1
  388. package/lib/plots/dual-axes/index.js.map +1 -1
  389. package/lib/plots/dual-axes/types.d.ts +5 -5
  390. package/lib/plots/dual-axes/util/geometry.js +9 -9
  391. package/lib/plots/dual-axes/util/geometry.js.map +1 -1
  392. package/lib/plots/dual-axes/util/legend.js +9 -9
  393. package/lib/plots/dual-axes/util/legend.js.map +1 -1
  394. package/lib/plots/dual-axes/util/option.js +8 -8
  395. package/lib/plots/dual-axes/util/option.js.map +1 -1
  396. package/lib/plots/dual-axes/util/render-sider.js +6 -5
  397. package/lib/plots/dual-axes/util/render-sider.js.map +1 -1
  398. package/lib/plots/facet/adaptor.d.ts +1 -1
  399. package/lib/plots/facet/adaptor.js +10 -10
  400. package/lib/plots/facet/adaptor.js.map +1 -1
  401. package/lib/plots/facet/index.d.ts +1 -1
  402. package/lib/plots/facet/types.d.ts +5 -5
  403. package/lib/plots/facet/utils.js +9 -9
  404. package/lib/plots/facet/utils.js.map +1 -1
  405. package/lib/plots/funnel/adaptor.js +14 -14
  406. package/lib/plots/funnel/adaptor.js.map +1 -1
  407. package/lib/plots/funnel/geometries/basic.js +10 -10
  408. package/lib/plots/funnel/geometries/basic.js.map +1 -1
  409. package/lib/plots/funnel/geometries/common.js +6 -6
  410. package/lib/plots/funnel/geometries/common.js.map +1 -1
  411. package/lib/plots/funnel/geometries/compare.js +12 -12
  412. package/lib/plots/funnel/geometries/compare.js.map +1 -1
  413. package/lib/plots/funnel/geometries/dynamic-height.js +9 -9
  414. package/lib/plots/funnel/geometries/dynamic-height.js.map +1 -1
  415. package/lib/plots/funnel/geometries/facet.js +2 -2
  416. package/lib/plots/funnel/geometries/facet.js.map +1 -1
  417. package/lib/plots/funnel/index.js +5 -5
  418. package/lib/plots/funnel/index.js.map +1 -1
  419. package/lib/plots/funnel/interactions/funnel-conversion-tag.js +5 -5
  420. package/lib/plots/funnel/interactions/funnel-conversion-tag.js.map +1 -1
  421. package/lib/plots/funnel/interactions/index.js +3 -3
  422. package/lib/plots/funnel/interactions/index.js.map +1 -1
  423. package/lib/plots/funnel/types.d.ts +1 -1
  424. package/lib/plots/gauge/adaptor.js +16 -16
  425. package/lib/plots/gauge/adaptor.js.map +1 -1
  426. package/lib/plots/gauge/index.js +3 -3
  427. package/lib/plots/gauge/index.js.map +1 -1
  428. package/lib/plots/gauge/shapes/indicator.js +1 -1
  429. package/lib/plots/gauge/shapes/indicator.js.map +1 -1
  430. package/lib/plots/gauge/shapes/meter-gauge.js +2 -2
  431. package/lib/plots/gauge/shapes/meter-gauge.js.map +1 -1
  432. package/lib/plots/gauge/types.d.ts +4 -4
  433. package/lib/plots/gauge/utils.js +4 -4
  434. package/lib/plots/gauge/utils.js.map +1 -1
  435. package/lib/plots/heatmap/adaptor.js +10 -10
  436. package/lib/plots/heatmap/adaptor.js.map +1 -1
  437. package/lib/plots/heatmap/constant.js +1 -1
  438. package/lib/plots/heatmap/constant.js.map +1 -1
  439. package/lib/plots/heatmap/shapes/circle.js +1 -1
  440. package/lib/plots/heatmap/shapes/circle.js.map +1 -1
  441. package/lib/plots/heatmap/shapes/square.js +1 -1
  442. package/lib/plots/heatmap/shapes/square.js.map +1 -1
  443. package/lib/plots/histogram/adaptor.js +7 -7
  444. package/lib/plots/histogram/adaptor.js.map +1 -1
  445. package/lib/plots/histogram/constant.js +1 -1
  446. package/lib/plots/histogram/constant.js.map +1 -1
  447. package/lib/plots/histogram/index.js +1 -1
  448. package/lib/plots/histogram/index.js.map +1 -1
  449. package/lib/plots/line/adaptor.js +13 -13
  450. package/lib/plots/line/adaptor.js.map +1 -1
  451. package/lib/plots/line/constants.js +1 -1
  452. package/lib/plots/line/constants.js.map +1 -1
  453. package/lib/plots/line/index.js +1 -1
  454. package/lib/plots/line/index.js.map +1 -1
  455. package/lib/plots/line/interactions/index.js +2 -2
  456. package/lib/plots/line/interactions/index.js.map +1 -1
  457. package/lib/plots/line/interactions/marker-active.js +5 -5
  458. package/lib/plots/line/interactions/marker-active.js.map +1 -1
  459. package/lib/plots/liquid/adaptor.js +8 -8
  460. package/lib/plots/liquid/adaptor.js.map +1 -1
  461. package/lib/plots/liquid/index.js +3 -3
  462. package/lib/plots/liquid/index.js.map +1 -1
  463. package/lib/plots/liquid/shapes/liquid.js +12 -12
  464. package/lib/plots/liquid/shapes/liquid.js.map +1 -1
  465. package/lib/plots/liquid/types.d.ts +4 -4
  466. package/lib/plots/mix/adaptor.js +17 -17
  467. package/lib/plots/mix/adaptor.js.map +1 -1
  468. package/lib/plots/mix/interactions/association.js +22 -22
  469. package/lib/plots/mix/interactions/association.js.map +1 -1
  470. package/lib/plots/mix/interactions/utils.js +3 -3
  471. package/lib/plots/mix/interactions/utils.js.map +1 -1
  472. package/lib/plots/mix/types.d.ts +3 -3
  473. package/lib/plots/mix/utils.d.ts +2 -2
  474. package/lib/plots/mix/utils.js +2 -2
  475. package/lib/plots/mix/utils.js.map +1 -1
  476. package/lib/plots/pie/adaptor.js +38 -38
  477. package/lib/plots/pie/adaptor.js.map +1 -1
  478. package/lib/plots/pie/contants.js +1 -1
  479. package/lib/plots/pie/contants.js.map +1 -1
  480. package/lib/plots/pie/index.js +4 -4
  481. package/lib/plots/pie/index.js.map +1 -1
  482. package/lib/plots/pie/interactions/actions/legend-active.js +3 -3
  483. package/lib/plots/pie/interactions/actions/legend-active.js.map +1 -1
  484. package/lib/plots/pie/interactions/actions/statistic-active.js +7 -7
  485. package/lib/plots/pie/interactions/actions/statistic-active.js.map +1 -1
  486. package/lib/plots/pie/interactions/index.js +4 -4
  487. package/lib/plots/pie/interactions/index.js.map +1 -1
  488. package/lib/plots/pie/types.d.ts +1 -1
  489. package/lib/plots/pie/utils.js +4 -4
  490. package/lib/plots/pie/utils.js.map +1 -1
  491. package/lib/plots/progress/adaptor.js +5 -5
  492. package/lib/plots/progress/adaptor.js.map +1 -1
  493. package/lib/plots/progress/index.js +1 -1
  494. package/lib/plots/progress/index.js.map +1 -1
  495. package/lib/plots/progress/utils.js +3 -3
  496. package/lib/plots/progress/utils.js.map +1 -1
  497. package/lib/plots/radar/adaptor.js +10 -10
  498. package/lib/plots/radar/adaptor.js.map +1 -1
  499. package/lib/plots/radar/index.js +1 -1
  500. package/lib/plots/radar/index.js.map +1 -1
  501. package/lib/plots/radar/interactions/index.js +2 -2
  502. package/lib/plots/radar/interactions/index.js.map +1 -1
  503. package/lib/plots/radar/interactions/radar-tooltip-action.js +3 -3
  504. package/lib/plots/radar/interactions/radar-tooltip-action.js.map +1 -1
  505. package/lib/plots/radial-bar/adaptor.js +13 -13
  506. package/lib/plots/radial-bar/adaptor.js.map +1 -1
  507. package/lib/plots/radial-bar/constant.js +1 -1
  508. package/lib/plots/radial-bar/constant.js.map +1 -1
  509. package/lib/plots/radial-bar/index.js +1 -1
  510. package/lib/plots/radial-bar/index.js.map +1 -1
  511. package/lib/plots/radial-bar/types.d.ts +7 -1
  512. package/lib/plots/radial-bar/types.js.map +1 -1
  513. package/lib/plots/ring-progress/adaptor.js +5 -5
  514. package/lib/plots/ring-progress/adaptor.js.map +1 -1
  515. package/lib/plots/ring-progress/index.js +2 -2
  516. package/lib/plots/ring-progress/index.js.map +1 -1
  517. package/lib/plots/rose/adaptor.js +11 -10
  518. package/lib/plots/rose/adaptor.js.map +1 -1
  519. package/lib/plots/rose/constant.js +1 -1
  520. package/lib/plots/rose/constant.js.map +1 -1
  521. package/lib/plots/rose/types.d.ts +7 -1
  522. package/lib/plots/rose/types.js.map +1 -1
  523. package/lib/plots/sankey/adaptor.js +13 -12
  524. package/lib/plots/sankey/adaptor.js.map +1 -1
  525. package/lib/plots/sankey/circle.js +4 -4
  526. package/lib/plots/sankey/circle.js.map +1 -1
  527. package/lib/plots/sankey/helper.js +6 -6
  528. package/lib/plots/sankey/helper.js.map +1 -1
  529. package/lib/plots/sankey/index.js +4 -4
  530. package/lib/plots/sankey/index.js.map +1 -1
  531. package/lib/plots/sankey/interactions/actions/node-drag.js +8 -8
  532. package/lib/plots/sankey/interactions/actions/node-drag.js.map +1 -1
  533. package/lib/plots/sankey/interactions/node-draggable.js +2 -2
  534. package/lib/plots/sankey/interactions/node-draggable.js.map +1 -1
  535. package/lib/plots/sankey/layout.d.ts +11 -11
  536. package/lib/plots/sankey/layout.js +3 -3
  537. package/lib/plots/sankey/layout.js.map +1 -1
  538. package/lib/plots/sankey/sankey/align.js +1 -1
  539. package/lib/plots/sankey/sankey/align.js.map +1 -1
  540. package/lib/plots/sankey/sankey/index.js +1 -1
  541. package/lib/plots/sankey/sankey/sankey.d.ts +1 -1
  542. package/lib/plots/sankey/sankey/sankey.js +9 -9
  543. package/lib/plots/sankey/sankey/sankey.js.map +1 -1
  544. package/lib/plots/sankey/types.d.ts +1 -1
  545. package/lib/plots/scatter/adaptor.js +33 -19
  546. package/lib/plots/scatter/adaptor.js.map +1 -1
  547. package/lib/plots/scatter/constant.js +1 -1
  548. package/lib/plots/scatter/constant.js.map +1 -1
  549. package/lib/plots/scatter/index.js +4 -4
  550. package/lib/plots/scatter/index.js.map +1 -1
  551. package/lib/plots/scatter/types.d.ts +16 -1
  552. package/lib/plots/scatter/types.js.map +1 -1
  553. package/lib/plots/scatter/util.d.ts +15 -1
  554. package/lib/plots/scatter/util.js +61 -15
  555. package/lib/plots/scatter/util.js.map +1 -1
  556. package/lib/plots/stock/adaptor.js +7 -7
  557. package/lib/plots/stock/adaptor.js.map +1 -1
  558. package/lib/plots/stock/constant.js +1 -1
  559. package/lib/plots/stock/constant.js.map +1 -1
  560. package/lib/plots/stock/index.js +1 -1
  561. package/lib/plots/stock/index.js.map +1 -1
  562. package/lib/plots/stock/utils.js +2 -2
  563. package/lib/plots/stock/utils.js.map +1 -1
  564. package/lib/plots/sunburst/adaptor.js +22 -21
  565. package/lib/plots/sunburst/adaptor.js.map +1 -1
  566. package/lib/plots/sunburst/constant.js +1 -1
  567. package/lib/plots/sunburst/constant.js.map +1 -1
  568. package/lib/plots/sunburst/types.d.ts +7 -1
  569. package/lib/plots/sunburst/types.js.map +1 -1
  570. package/lib/plots/sunburst/utils.js +4 -4
  571. package/lib/plots/sunburst/utils.js.map +1 -1
  572. package/lib/plots/tiny-area/adaptor.js +11 -11
  573. package/lib/plots/tiny-area/adaptor.js.map +1 -1
  574. package/lib/plots/tiny-area/index.js +2 -2
  575. package/lib/plots/tiny-area/index.js.map +1 -1
  576. package/lib/plots/tiny-column/adaptor.js +4 -4
  577. package/lib/plots/tiny-column/adaptor.js.map +1 -1
  578. package/lib/plots/tiny-column/constants.js +1 -1
  579. package/lib/plots/tiny-column/constants.js.map +1 -1
  580. package/lib/plots/tiny-column/index.js +2 -2
  581. package/lib/plots/tiny-column/index.js.map +1 -1
  582. package/lib/plots/tiny-line/adaptor.js +6 -6
  583. package/lib/plots/tiny-line/adaptor.js.map +1 -1
  584. package/lib/plots/tiny-line/constants.js +1 -1
  585. package/lib/plots/tiny-line/constants.js.map +1 -1
  586. package/lib/plots/tiny-line/index.js +2 -2
  587. package/lib/plots/tiny-line/index.js.map +1 -1
  588. package/lib/plots/tiny-line/utils.js +1 -1
  589. package/lib/plots/tiny-line/utils.js.map +1 -1
  590. package/lib/plots/treemap/adaptor.js +13 -13
  591. package/lib/plots/treemap/adaptor.js.map +1 -1
  592. package/lib/plots/treemap/index.js +3 -3
  593. package/lib/plots/treemap/index.js.map +1 -1
  594. package/lib/plots/treemap/utils.js +4 -4
  595. package/lib/plots/treemap/utils.js.map +1 -1
  596. package/lib/plots/venn/adaptor.js +18 -18
  597. package/lib/plots/venn/adaptor.js.map +1 -1
  598. package/lib/plots/venn/interactions/actions/active.js +2 -2
  599. package/lib/plots/venn/interactions/actions/active.js.map +1 -1
  600. package/lib/plots/venn/interactions/actions/highlight.js +2 -2
  601. package/lib/plots/venn/interactions/actions/highlight.js.map +1 -1
  602. package/lib/plots/venn/interactions/actions/selected.js +4 -4
  603. package/lib/plots/venn/interactions/actions/selected.js.map +1 -1
  604. package/lib/plots/venn/interactions/index.js +10 -10
  605. package/lib/plots/venn/interactions/index.js.map +1 -1
  606. package/lib/plots/venn/label.js +1 -1
  607. package/lib/plots/venn/label.js.map +1 -1
  608. package/lib/plots/venn/layout/diagram.js +10 -10
  609. package/lib/plots/venn/layout/diagram.js.map +1 -1
  610. package/lib/plots/venn/layout/layout.js +14 -13
  611. package/lib/plots/venn/layout/layout.js.map +1 -1
  612. package/lib/plots/venn/shape.js +3 -3
  613. package/lib/plots/venn/shape.js.map +1 -1
  614. package/lib/plots/venn/types.d.ts +2 -2
  615. package/lib/plots/venn/utils.d.ts +1 -1
  616. package/lib/plots/venn/utils.js +8 -8
  617. package/lib/plots/venn/utils.js.map +1 -1
  618. package/lib/plots/violin/adaptor.js +22 -22
  619. package/lib/plots/violin/adaptor.js.map +1 -1
  620. package/lib/plots/violin/constant.js +3 -1
  621. package/lib/plots/violin/constant.js.map +1 -1
  622. package/lib/plots/violin/index.js +1 -1
  623. package/lib/plots/violin/index.js.map +1 -1
  624. package/lib/plots/violin/utils.d.ts +2 -2
  625. package/lib/plots/violin/utils.js +18 -15
  626. package/lib/plots/violin/utils.js.map +1 -1
  627. package/lib/plots/waterfall/adaptor.js +21 -20
  628. package/lib/plots/waterfall/adaptor.js.map +1 -1
  629. package/lib/plots/waterfall/index.js +1 -1
  630. package/lib/plots/waterfall/index.js.map +1 -1
  631. package/lib/plots/waterfall/shape.js +3 -3
  632. package/lib/plots/waterfall/shape.js.map +1 -1
  633. package/lib/plots/waterfall/types.d.ts +9 -3
  634. package/lib/plots/waterfall/types.js.map +1 -1
  635. package/lib/plots/waterfall/utils.js +5 -5
  636. package/lib/plots/waterfall/utils.js.map +1 -1
  637. package/lib/plots/word-cloud/adaptor.js +6 -6
  638. package/lib/plots/word-cloud/adaptor.js.map +1 -1
  639. package/lib/plots/word-cloud/constant.js +1 -1
  640. package/lib/plots/word-cloud/constant.js.map +1 -1
  641. package/lib/plots/word-cloud/index.js +2 -2
  642. package/lib/plots/word-cloud/index.js.map +1 -1
  643. package/lib/plots/word-cloud/shapes/word-cloud.js +1 -1
  644. package/lib/plots/word-cloud/shapes/word-cloud.js.map +1 -1
  645. package/lib/plots/word-cloud/types.d.ts +2 -2
  646. package/lib/plots/word-cloud/utils.js +13 -13
  647. package/lib/plots/word-cloud/utils.js.map +1 -1
  648. package/lib/plugin/index.js +1 -1
  649. package/lib/plugin/index.js.map +1 -1
  650. package/lib/types/animation.d.ts +1 -1
  651. package/lib/types/annotation.d.ts +2 -2
  652. package/lib/types/attr.d.ts +7 -7
  653. package/lib/types/axis.d.ts +1 -1
  654. package/lib/types/button.d.ts +1 -1
  655. package/lib/types/common.d.ts +13 -13
  656. package/lib/types/coordinate.d.ts +1 -1
  657. package/lib/types/drill-down.d.ts +1 -1
  658. package/lib/types/index.d.ts +1 -1
  659. package/lib/types/interaction.d.ts +2 -2
  660. package/lib/types/label.d.ts +1 -1
  661. package/lib/types/legend.d.ts +1 -1
  662. package/lib/types/locale.d.ts +1 -1
  663. package/lib/types/meta.d.ts +1 -1
  664. package/lib/types/pattern.d.ts +4 -4
  665. package/lib/types/relation-data.d.ts +3 -3
  666. package/lib/types/scrollbar.d.ts +1 -1
  667. package/lib/types/slider.d.ts +1 -1
  668. package/lib/types/state.d.ts +4 -4
  669. package/lib/types/statistic.d.ts +3 -3
  670. package/lib/types/tooltip.d.ts +3 -3
  671. package/lib/utils/color/blend.js +4 -3
  672. package/lib/utils/color/blend.js.map +1 -1
  673. package/lib/utils/conversion.js +2 -2
  674. package/lib/utils/conversion.js.map +1 -1
  675. package/lib/utils/data.js +7 -7
  676. package/lib/utils/data.js.map +1 -1
  677. package/lib/utils/deep-assign.js +2 -1
  678. package/lib/utils/deep-assign.js.map +1 -1
  679. package/lib/utils/flow.d.ts +1 -1
  680. package/lib/utils/geometry.js +5 -5
  681. package/lib/utils/geometry.js.map +1 -1
  682. package/lib/utils/hierarchy/pack.d.ts +1 -1
  683. package/lib/utils/hierarchy/pack.js +4 -4
  684. package/lib/utils/hierarchy/pack.js.map +1 -1
  685. package/lib/utils/hierarchy/partition.d.ts +1 -1
  686. package/lib/utils/hierarchy/partition.js +6 -6
  687. package/lib/utils/hierarchy/partition.js.map +1 -1
  688. package/lib/utils/hierarchy/treemap.js +4 -4
  689. package/lib/utils/hierarchy/treemap.js.map +1 -1
  690. package/lib/utils/hierarchy/util.js +6 -6
  691. package/lib/utils/hierarchy/util.js.map +1 -1
  692. package/lib/utils/index.js +1 -0
  693. package/lib/utils/index.js.map +1 -1
  694. package/lib/utils/invariant.js +3 -3
  695. package/lib/utils/invariant.js.map +1 -1
  696. package/lib/utils/label.js +1 -1
  697. package/lib/utils/label.js.map +1 -1
  698. package/lib/utils/matrix.js +1 -1
  699. package/lib/utils/matrix.js.map +1 -1
  700. package/lib/utils/measure-text.js +5 -5
  701. package/lib/utils/measure-text.js.map +1 -1
  702. package/lib/utils/padding.js +2 -2
  703. package/lib/utils/padding.js.map +1 -1
  704. package/lib/utils/path.js +3 -2
  705. package/lib/utils/path.js.map +1 -1
  706. package/lib/utils/pattern/dot.js +7 -7
  707. package/lib/utils/pattern/dot.js.map +1 -1
  708. package/lib/utils/pattern/index.d.ts +1 -1
  709. package/lib/utils/pattern/index.js +3 -3
  710. package/lib/utils/pattern/index.js.map +1 -1
  711. package/lib/utils/pattern/line.js +6 -6
  712. package/lib/utils/pattern/line.js.map +1 -1
  713. package/lib/utils/pattern/square.js +7 -7
  714. package/lib/utils/pattern/square.js.map +1 -1
  715. package/lib/utils/pattern/util.js +2 -2
  716. package/lib/utils/pattern/util.js.map +1 -1
  717. package/lib/utils/statistic.js +24 -22
  718. package/lib/utils/statistic.js.map +1 -1
  719. package/lib/utils/template.js +2 -2
  720. package/lib/utils/template.js.map +1 -1
  721. package/lib/utils/tooltip.js +3 -3
  722. package/lib/utils/tooltip.js.map +1 -1
  723. package/lib/utils/transform/chord.d.ts +4 -4
  724. package/lib/utils/transform/chord.js +8 -8
  725. package/lib/utils/transform/chord.js.map +1 -1
  726. package/lib/utils/transform/histogram.d.ts +1 -1
  727. package/lib/utils/transform/histogram.js +14 -14
  728. package/lib/utils/transform/histogram.js.map +1 -1
  729. package/lib/utils/transform/percent.js +10 -10
  730. package/lib/utils/transform/percent.js.map +1 -1
  731. package/lib/utils/transform/word-cloud.d.ts +1 -1
  732. package/lib/utils/transform/word-cloud.js +5 -4
  733. package/lib/utils/transform/word-cloud.js.map +1 -1
  734. package/lib/utils/view.js +2 -2
  735. package/lib/utils/view.js.map +1 -1
  736. package/package.json +7 -7
  737. package/src/adaptor/geometries/area.ts +8 -5
  738. package/src/index.ts +1 -1
  739. package/src/plots/area/adaptor.ts +6 -1
  740. package/src/plots/area/types.ts +10 -1
  741. package/src/plots/bidirectional-bar/adaptor.ts +1 -1
  742. package/src/plots/column/adaptor.ts +1 -1
  743. package/src/plots/radial-bar/adaptor.ts +2 -2
  744. package/src/plots/radial-bar/types.ts +10 -1
  745. package/src/plots/rose/adaptor.ts +2 -1
  746. package/src/plots/rose/types.ts +7 -1
  747. package/src/plots/sankey/adaptor.ts +2 -1
  748. package/src/plots/sankey/layout.ts +1 -1
  749. package/src/plots/scatter/adaptor.ts +20 -2
  750. package/src/plots/scatter/types.ts +16 -0
  751. package/src/plots/scatter/util.ts +55 -2
  752. package/src/plots/sunburst/adaptor.ts +2 -1
  753. package/src/plots/sunburst/types.ts +9 -1
  754. package/src/plots/waterfall/adaptor.ts +20 -4
  755. package/src/plots/waterfall/types.ts +7 -1
  756. package/src/utils/hierarchy/partition.ts +1 -1
  757. package/CHANGELOG.md +0 -1659
@@ -1 +1 @@
1
- {"version":3,"file":"word-cloud.js","sourceRoot":"","sources":["../../../src/utils/transform/word-cloud.ts"],"names":[],"mappings":";;;AAAA,mCAAuD;AAkBvD,IAAM,eAAe,GAAY;IAC/B,IAAI,EAAE,cAAM,OAAA,OAAO,EAAP,CAAO;IACnB,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;IAChB,MAAM,EAAE,aAAa;IACrB,6CAA6C;IAC7C,YAAY,EAAE,IAAI;CAEnB,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,KAAa,EAAE,OAA0B;IACjE,SAAS;IACT,OAAO,GAAG,aAAM,CAAC,EAAa,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IAC1D,OAAO,SAAS,CAAC,KAAK,EAAE,OAAkB,CAAC,CAAC;AAC9C,CAAC;AAJD,8BAIC;AAED;;;;GAI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../../plots/word-cloud/types';\r\n\r\ntype FontWeight = number | 'normal' | 'bold' | 'bolder' | 'lighter';\r\n\r\nexport interface Options {\r\n size: [number, number];\r\n font?: string | ((row: Word, index?: number, words?: Word[]) => string);\r\n fontSize?: number | ((row: Word, index?: number, words?: Word[]) => number);\r\n fontWeight?: FontWeight | ((row: Word, index?: number, words?: Word[]) => FontWeight);\r\n rotate?: number | ((row: Word, index?: number, words?: Word[]) => number);\r\n padding?: number | ((row: Word, index?: number, words?: Word[]) => number);\r\n spiral?: 'archimedean' | 'rectangular' | ((size: [number, number]) => (t: number) => number[]);\r\n random?: number | (() => number);\r\n timeInterval?: number;\r\n imageMask?: HTMLImageElement;\r\n}\r\n\r\nconst DEFAULT_OPTIONS: Options = {\r\n font: () => 'serif',\r\n padding: 1,\r\n size: [500, 500],\r\n spiral: 'archimedean', // 'archimedean' || 'rectangular' || {function}\r\n // timeInterval: Infinity // max execute time\r\n timeInterval: 3000, // max execute time\r\n // imageMask: '', // instance of Image, must be loaded\r\n};\r\n\r\n/**\r\n * 根据对应的数据对象,计算每个\r\n * 词语在画布中的渲染位置,并返回\r\n * 计算后的数据对象\r\n * @param words\r\n * @param options\r\n */\r\nexport function wordCloud(words: Word[], options?: Partial<Options>): Tag[] {\r\n // 混入默认配置\r\n options = assign({} as Options, DEFAULT_OPTIONS, options);\r\n return transform(words, options as Options);\r\n}\r\n\r\n/**\r\n * 抛出没有混入默认配置的方法,用于测试。\r\n * @param words\r\n * @param options\r\n */\r\nexport function transform(words: Word[], options: Options) {\r\n // 布局对象\r\n const layout = tagCloud();\r\n ['font', 'fontSize', 'fontWeight', 'padding', 'rotate', 'size', 'spiral', 'timeInterval', 'random'].forEach(\r\n (key: string) => {\r\n if (!isNil(options[key])) {\r\n layout[key](options[key]);\r\n }\r\n }\r\n );\r\n\r\n layout.words(words);\r\n if (options.imageMask) {\r\n layout.createMask(options.imageMask);\r\n }\r\n\r\n const result = layout.start();\r\n const tags: any[] = result._tags;\r\n\r\n tags.forEach((tag) => {\r\n tag.x += options.size[0] / 2;\r\n tag.y += options.size[1] / 2;\r\n });\r\n\r\n const [w, h] = options.size;\r\n // 添加两个参照数据,分别表示左上角和右下角。\r\n // 不添加的话不会按照真实的坐标渲染,而是以\r\n // 数据中的边界坐标为边界进行拉伸,以铺满画布。\r\n // 这样的后果会导致词语之间的重叠。\r\n tags.push({\r\n text: '',\r\n value: 0,\r\n x: 0,\r\n y: 0,\r\n opacity: 0,\r\n });\r\n tags.push({\r\n text: '',\r\n value: 0,\r\n x: w,\r\n y: h,\r\n opacity: 0,\r\n });\r\n\r\n return tags;\r\n}\r\n\r\n/*\r\n * Synchronous version of d3-cloud\r\n */\r\n// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\r\n// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf\r\n/* eslint-disable no-return-assign, no-cond-assign */\r\n\r\ninterface Item {\r\n value: number;\r\n text: string;\r\n sprite: boolean;\r\n}\r\n\r\nconst cloudRadians = Math.PI / 180,\r\n cw = (1 << 11) >> 5,\r\n ch = 1 << 11;\r\n\r\nfunction cloudText(d: Item) {\r\n return d.text;\r\n}\r\n\r\nfunction cloudFont() {\r\n return 'serif';\r\n}\r\n\r\nfunction cloudFontNormal() {\r\n return 'normal';\r\n}\r\n\r\nfunction cloudFontSize(d: Item) {\r\n return d.value;\r\n}\r\n\r\nfunction cloudRotate() {\r\n return ~~(Math.random() * 2) * 90;\r\n}\r\n\r\nfunction cloudPadding() {\r\n return 1;\r\n}\r\n\r\n// Fetches a monochrome sprite bitmap for the specified text.\r\n// Load in batches for speed.\r\nfunction cloudSprite(contextAndRatio, d, data, di) {\r\n if (d.sprite) return;\r\n const c = contextAndRatio.context,\r\n ratio = contextAndRatio.ratio;\r\n\r\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\r\n let x = 0,\r\n y = 0,\r\n maxh = 0;\r\n const n = data.length;\r\n --di;\r\n while (++di < n) {\r\n d = data[di];\r\n c.save();\r\n c.font = d.style + ' ' + d.weight + ' ' + ~~((d.size + 1) / ratio) + 'px ' + d.font;\r\n let w = c.measureText(d.text + 'm').width * ratio,\r\n h = d.size << 1;\r\n if (d.rotate) {\r\n const sr = Math.sin(d.rotate * cloudRadians),\r\n cr = Math.cos(d.rotate * cloudRadians),\r\n wcr = w * cr,\r\n wsr = w * sr,\r\n hcr = h * cr,\r\n hsr = h * sr;\r\n w = ((Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f) >> 5) << 5;\r\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\r\n } else {\r\n w = ((w + 0x1f) >> 5) << 5;\r\n }\r\n if (h > maxh) maxh = h;\r\n if (x + w >= cw << 5) {\r\n x = 0;\r\n y += maxh;\r\n maxh = 0;\r\n }\r\n if (y + h >= ch) break;\r\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\r\n if (d.rotate) c.rotate(d.rotate * cloudRadians);\r\n c.fillText(d.text, 0, 0);\r\n if (d.padding) {\r\n c.lineWidth = 2 * d.padding;\r\n c.strokeText(d.text, 0, 0);\r\n }\r\n c.restore();\r\n d.width = w;\r\n d.height = h;\r\n d.xoff = x;\r\n d.yoff = y;\r\n d.x1 = w >> 1;\r\n d.y1 = h >> 1;\r\n d.x0 = -d.x1;\r\n d.y0 = -d.y1;\r\n d.hasText = true;\r\n x += w;\r\n }\r\n const pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data,\r\n sprite = [];\r\n while (--di >= 0) {\r\n d = data[di];\r\n if (!d.hasText) continue;\r\n const w = d.width,\r\n w32 = w >> 5;\r\n let h = d.y1 - d.y0;\r\n // Zero the buffer\r\n for (let i = 0; i < h * w32; i++) sprite[i] = 0;\r\n x = d.xoff;\r\n if (x == null) return;\r\n y = d.yoff;\r\n let seen = 0,\r\n seenRow = -1;\r\n for (let j = 0; j < h; j++) {\r\n for (let i = 0; i < w; i++) {\r\n const k = w32 * j + (i >> 5),\r\n m = pixels[((y + j) * (cw << 5) + (x + i)) << 2] ? 1 << (31 - (i % 32)) : 0;\r\n sprite[k] |= m;\r\n seen |= m;\r\n }\r\n if (seen) seenRow = j;\r\n else {\r\n d.y0++;\r\n h--;\r\n j--;\r\n y++;\r\n }\r\n }\r\n d.y1 = d.y0 + seenRow;\r\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\r\n }\r\n}\r\n\r\n// Use mask-based collision detection.\r\nfunction cloudCollide(tag, board, sw) {\r\n sw >>= 5;\r\n const sprite = tag.sprite,\r\n w = tag.width >> 5,\r\n lx = tag.x - (w << 4),\r\n sx = lx & 0x7f,\r\n msx = 32 - sx,\r\n h = tag.y1 - tag.y0;\r\n let x = (tag.y + tag.y0) * sw + (lx >> 5),\r\n last;\r\n for (let j = 0; j < h; j++) {\r\n last = 0;\r\n for (let i = 0; i <= w; i++) {\r\n if (((last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0)) & board[x + i]) return true;\r\n }\r\n x += sw;\r\n }\r\n return false;\r\n}\r\n\r\nfunction cloudBounds(bounds, d) {\r\n const b0 = bounds[0],\r\n b1 = bounds[1];\r\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\r\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\r\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\r\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\r\n}\r\n\r\nfunction collideRects(a, b) {\r\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\r\n}\r\n\r\nfunction archimedeanSpiral(size) {\r\n const e = size[0] / size[1];\r\n return function (t) {\r\n return [e * (t *= 0.1) * Math.cos(t), t * Math.sin(t)];\r\n };\r\n}\r\n\r\nfunction rectangularSpiral(size) {\r\n const dy = 4,\r\n dx = (dy * size[0]) / size[1];\r\n let x = 0,\r\n y = 0;\r\n return function (t) {\r\n const sign = t < 0 ? -1 : 1;\r\n // See triangular numbers: T_n = n * (n + 1) / 2.\r\n switch ((Math.sqrt(1 + 4 * sign * t) - sign) & 3) {\r\n case 0:\r\n x += dx;\r\n break;\r\n case 1:\r\n y += dy;\r\n break;\r\n case 2:\r\n x -= dx;\r\n break;\r\n default:\r\n y -= dy;\r\n break;\r\n }\r\n return [x, y];\r\n };\r\n}\r\n\r\n// TODO reuse arrays?\r\nfunction zeroArray(n) {\r\n const a = [];\r\n let i = -1;\r\n while (++i < n) a[i] = 0;\r\n return a;\r\n}\r\n\r\nfunction cloudCanvas() {\r\n return document.createElement('canvas');\r\n}\r\n\r\nexport function functor(d) {\r\n return isFunction(d)\r\n ? d\r\n : function () {\r\n return d;\r\n };\r\n}\r\n\r\nconst spirals = {\r\n archimedean: archimedeanSpiral,\r\n rectangular: rectangularSpiral,\r\n};\r\n\r\nfunction tagCloud() {\r\n let size = [256, 256],\r\n font = cloudFont,\r\n fontSize = cloudFontSize,\r\n fontWeight = cloudFontNormal,\r\n rotate = cloudRotate,\r\n padding = cloudPadding,\r\n spiral = archimedeanSpiral,\r\n random = Math.random,\r\n words = [],\r\n timeInterval = Infinity;\r\n\r\n const text = cloudText;\r\n const fontStyle = cloudFontNormal;\r\n const canvas = cloudCanvas;\r\n const cloud: any = {};\r\n\r\n cloud.start = function () {\r\n const [width, height] = size;\r\n const contextAndRatio = getContext(canvas()),\r\n board = cloud.board ? cloud.board : zeroArray((size[0] >> 5) * size[1]),\r\n n = words.length,\r\n tags = [],\r\n data = words\r\n .map(function (d, i, data) {\r\n d.text = text.call(this, d, i, data);\r\n d.font = font.call(this, d, i, data);\r\n d.style = fontStyle.call(this, d, i, data);\r\n d.weight = fontWeight.call(this, d, i, data);\r\n d.rotate = rotate.call(this, d, i, data);\r\n d.size = ~~fontSize.call(this, d, i, data);\r\n d.padding = padding.call(this, d, i, data);\r\n return d;\r\n })\r\n .sort(function (a, b) {\r\n return b.size - a.size;\r\n });\r\n let i = -1,\r\n bounds = !cloud.board\r\n ? null\r\n : [\r\n {\r\n x: 0,\r\n y: 0,\r\n },\r\n {\r\n x: width,\r\n y: height,\r\n },\r\n ];\r\n\r\n step();\r\n\r\n function step() {\r\n const start = Date.now();\r\n while (Date.now() - start < timeInterval && ++i < n) {\r\n const d = data[i];\r\n d.x = (width * (random() + 0.5)) >> 1;\r\n d.y = (height * (random() + 0.5)) >> 1;\r\n cloudSprite(contextAndRatio, d, data, i);\r\n if (d.hasText && place(board, d, bounds)) {\r\n tags.push(d);\r\n if (bounds) {\r\n if (!cloud.hasImage) {\r\n // update bounds if image mask not set\r\n cloudBounds(bounds, d);\r\n }\r\n } else {\r\n bounds = [\r\n { x: d.x + d.x0, y: d.y + d.y0 },\r\n { x: d.x + d.x1, y: d.y + d.y1 },\r\n ];\r\n }\r\n // Temporary hack\r\n d.x -= size[0] >> 1;\r\n d.y -= size[1] >> 1;\r\n }\r\n }\r\n cloud._tags = tags;\r\n cloud._bounds = bounds;\r\n }\r\n\r\n return cloud;\r\n };\r\n\r\n function getContext(canvas: HTMLCanvasElement) {\r\n canvas.width = canvas.height = 1;\r\n const ratio = Math.sqrt(\r\n (canvas.getContext('2d', { willReadFrequently: true }) as CanvasRenderingContext2D)!.getImageData(0, 0, 1, 1).data\r\n .length >> 2\r\n );\r\n canvas.width = (cw << 5) / ratio;\r\n canvas.height = ch / ratio;\r\n\r\n const context = canvas.getContext('2d', { willReadFrequently: true }) as CanvasRenderingContext2D;\r\n context.fillStyle = context.strokeStyle = 'red';\r\n context.textAlign = 'center';\r\n return { context, ratio };\r\n }\r\n\r\n function place(board, tag, bounds) {\r\n // const perimeter = [{ x: 0, y: 0 }, { x: size[0], y: size[1] }],\r\n const startX = tag.x,\r\n startY = tag.y,\r\n maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]),\r\n s = spiral(size),\r\n dt = random() < 0.5 ? 1 : -1;\r\n let dxdy,\r\n t = -dt,\r\n dx,\r\n dy;\r\n\r\n while ((dxdy = s((t += dt)))) {\r\n dx = ~~dxdy[0];\r\n dy = ~~dxdy[1];\r\n\r\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\r\n\r\n tag.x = startX + dx;\r\n tag.y = startY + dy;\r\n\r\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 || tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue;\r\n // TODO only check for collisions within current bounds.\r\n if (!bounds || !cloudCollide(tag, board, size[0])) {\r\n if (!bounds || collideRects(tag, bounds)) {\r\n const sprite = tag.sprite,\r\n w = tag.width >> 5,\r\n sw = size[0] >> 5,\r\n lx = tag.x - (w << 4),\r\n sx = lx & 0x7f,\r\n msx = 32 - sx,\r\n h = tag.y1 - tag.y0;\r\n let last,\r\n x = (tag.y + tag.y0) * sw + (lx >> 5);\r\n for (let j = 0; j < h; j++) {\r\n last = 0;\r\n for (let i = 0; i <= w; i++) {\r\n board[x + i] |= (last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\r\n }\r\n x += sw;\r\n }\r\n delete tag.sprite;\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n cloud.createMask = (img: HTMLImageElement) => {\r\n const can: HTMLCanvasElement = document.createElement('canvas');\r\n const [width, height] = size;\r\n\r\n // 当 width 或 height 为 0 时,调用 cxt.getImageData 会报错\r\n if (!width || !height) {\r\n return;\r\n }\r\n const w32 = width >> 5;\r\n const board = zeroArray((width >> 5) * height);\r\n can.width = width;\r\n can.height = height;\r\n const cxt = can.getContext('2d') as CanvasRenderingContext2D;\r\n cxt.drawImage(img, 0, 0, img.width, img.height, 0, 0, width, height);\r\n const imageData = cxt.getImageData(0, 0, width, height).data;\r\n for (let j = 0; j < height; j++) {\r\n for (let i = 0; i < width; i++) {\r\n const k = w32 * j + (i >> 5);\r\n const tmp = (j * width + i) << 2;\r\n const flag = imageData[tmp] >= 250 && imageData[tmp + 1] >= 250 && imageData[tmp + 2] >= 250;\r\n const m = flag ? 1 << (31 - (i % 32)) : 0;\r\n board[k] |= m;\r\n }\r\n }\r\n cloud.board = board;\r\n cloud.hasImage = true;\r\n };\r\n\r\n cloud.timeInterval = function (_) {\r\n timeInterval = _ == null ? Infinity : _;\r\n };\r\n\r\n cloud.words = function (_) {\r\n words = _;\r\n };\r\n\r\n cloud.size = function (_) {\r\n size = [+_[0], +_[1]];\r\n };\r\n\r\n cloud.font = function (_) {\r\n font = functor(_);\r\n };\r\n\r\n cloud.fontWeight = function (_) {\r\n fontWeight = functor(_);\r\n };\r\n\r\n cloud.rotate = function (_) {\r\n rotate = functor(_);\r\n };\r\n\r\n cloud.spiral = function (_) {\r\n spiral = spirals[_] || _;\r\n };\r\n\r\n cloud.fontSize = function (_) {\r\n fontSize = functor(_);\r\n };\r\n\r\n cloud.padding = function (_) {\r\n padding = functor(_);\r\n };\r\n\r\n cloud.random = function (_) {\r\n random = functor(_);\r\n };\r\n\r\n return cloud;\r\n}\r\n"]}
1
+ {"version":3,"file":"word-cloud.js","sourceRoot":"","sources":["../../../src/utils/transform/word-cloud.ts"],"names":[],"mappings":";;;AAAA,mCAAuD;AAkBvD,IAAM,eAAe,GAAY;IAC/B,IAAI,EAAE,cAAM,OAAA,OAAO,EAAP,CAAO;IACnB,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;IAChB,MAAM,EAAE,aAAa;IACrB,6CAA6C;IAC7C,YAAY,EAAE,IAAI,EAAE,mBAAmB;IACvC,sDAAsD;CACvD,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,KAAa,EAAE,OAA0B;IACjE,SAAS;IACT,OAAO,GAAG,IAAA,aAAM,EAAC,EAAa,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IAC1D,OAAO,SAAS,CAAC,KAAK,EAAE,OAAkB,CAAC,CAAC;AAC9C,CAAC;AAJD,8BAIC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,KAAa,EA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\ntype FontWeight = number | 'normal' | 'bold' | 'bolder' | 'lighter';\r\n\r\nexport interface Options {\r\n size: [number, number];\r\n font?: string | ((row: Word, index?: number, words?: Word[]) => string);\r\n fontSize?: number | ((row: Word, index?: number, words?: Word[]) => number);\r\n fontWeight?: FontWeight | ((row: Word, index?: number, words?: Word[]) => FontWeight);\r\n rotate?: number | ((row: Word, index?: number, words?: Word[]) => number);\r\n padding?: number | ((row: Word, index?: number, words?: Word[]) => number);\r\n spiral?: 'archimedean' | 'rectangular' | ((size: [number, number]) => (t: number) => number[]);\r\n random?: number | (() => number);\r\n timeInterval?: number;\r\n imageMask?: HTMLImageElement;\r\n}\r\n\r\nconst DEFAULT_OPTIONS: Options = {\r\n font: () => 'serif',\r\n padding: 1,\r\n size: [500, 500],\r\n spiral: 'archimedean', // 'archimedean' || 'rectangular' || {function}\r\n // timeInterval: Infinity // max execute time\r\n timeInterval: 3000, // max execute time\r\n // imageMask: '', // instance of Image, must be loaded\r\n};\r\n\r\n/**\r\n * 根据对应的数据对象,计算每个\r\n * 词语在画布中的渲染位置,并返回\r\n * 计算后的数据对象\r\n * @param words\r\n * @param options\r\n */\r\nexport function wordCloud(words: Word[], options?: Partial<Options>): Tag[] {\r\n // 混入默认配置\r\n options = assign({} as Options, DEFAULT_OPTIONS, options);\r\n return transform(words, options as Options);\r\n}\r\n\r\n/**\r\n * 抛出没有混入默认配置的方法,用于测试。\r\n * @param words\r\n * @param options\r\n */\r\nexport function transform(words: Word[], options: Options) {\r\n // 布局对象\r\n const layout = tagCloud();\r\n ['font', 'fontSize', 'fontWeight', 'padding', 'rotate', 'size', 'spiral', 'timeInterval', 'random'].forEach(\r\n (key: string) => {\r\n if (!isNil(options[key])) {\r\n layout[key](options[key]);\r\n }\r\n }\r\n );\r\n\r\n layout.words(words);\r\n if (options.imageMask) {\r\n layout.createMask(options.imageMask);\r\n }\r\n\r\n const result = layout.start();\r\n const tags: any[] = result._tags;\r\n\r\n tags.forEach((tag) => {\r\n tag.x += options.size[0] / 2;\r\n tag.y += options.size[1] / 2;\r\n });\r\n\r\n const [w, h] = options.size;\r\n // 添加两个参照数据,分别表示左上角和右下角。\r\n // 不添加的话不会按照真实的坐标渲染,而是以\r\n // 数据中的边界坐标为边界进行拉伸,以铺满画布。\r\n // 这样的后果会导致词语之间的重叠。\r\n tags.push({\r\n text: '',\r\n value: 0,\r\n x: 0,\r\n y: 0,\r\n opacity: 0,\r\n });\r\n tags.push({\r\n text: '',\r\n value: 0,\r\n x: w,\r\n y: h,\r\n opacity: 0,\r\n });\r\n\r\n return tags;\r\n}\r\n\r\n/*\r\n * Synchronous version of d3-cloud\r\n */\r\n// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/\r\n// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf\r\n/* eslint-disable no-return-assign, no-cond-assign */\r\n\r\ninterface Item {\r\n value: number;\r\n text: string;\r\n sprite: boolean;\r\n}\r\n\r\nconst cloudRadians = Math.PI / 180,\r\n cw = (1 << 11) >> 5,\r\n ch = 1 << 11;\r\n\r\nfunction cloudText(d: Item) {\r\n return d.text;\r\n}\r\n\r\nfunction cloudFont() {\r\n return 'serif';\r\n}\r\n\r\nfunction cloudFontNormal() {\r\n return 'normal';\r\n}\r\n\r\nfunction cloudFontSize(d: Item) {\r\n return d.value;\r\n}\r\n\r\nfunction cloudRotate() {\r\n return ~~(Math.random() * 2) * 90;\r\n}\r\n\r\nfunction cloudPadding() {\r\n return 1;\r\n}\r\n\r\n// Fetches a monochrome sprite bitmap for the specified text.\r\n// Load in batches for speed.\r\nfunction cloudSprite(contextAndRatio, d, data, di) {\r\n if (d.sprite) return;\r\n const c = contextAndRatio.context,\r\n ratio = contextAndRatio.ratio;\r\n\r\n c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio);\r\n let x = 0,\r\n y = 0,\r\n maxh = 0;\r\n const n = data.length;\r\n --di;\r\n while (++di < n) {\r\n d = data[di];\r\n c.save();\r\n c.font = d.style + ' ' + d.weight + ' ' + ~~((d.size + 1) / ratio) + 'px ' + d.font;\r\n let w = c.measureText(d.text + 'm').width * ratio,\r\n h = d.size << 1;\r\n if (d.rotate) {\r\n const sr = Math.sin(d.rotate * cloudRadians),\r\n cr = Math.cos(d.rotate * cloudRadians),\r\n wcr = w * cr,\r\n wsr = w * sr,\r\n hcr = h * cr,\r\n hsr = h * sr;\r\n w = ((Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f) >> 5) << 5;\r\n h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr));\r\n } else {\r\n w = ((w + 0x1f) >> 5) << 5;\r\n }\r\n if (h > maxh) maxh = h;\r\n if (x + w >= cw << 5) {\r\n x = 0;\r\n y += maxh;\r\n maxh = 0;\r\n }\r\n if (y + h >= ch) break;\r\n c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio);\r\n if (d.rotate) c.rotate(d.rotate * cloudRadians);\r\n c.fillText(d.text, 0, 0);\r\n if (d.padding) {\r\n c.lineWidth = 2 * d.padding;\r\n c.strokeText(d.text, 0, 0);\r\n }\r\n c.restore();\r\n d.width = w;\r\n d.height = h;\r\n d.xoff = x;\r\n d.yoff = y;\r\n d.x1 = w >> 1;\r\n d.y1 = h >> 1;\r\n d.x0 = -d.x1;\r\n d.y0 = -d.y1;\r\n d.hasText = true;\r\n x += w;\r\n }\r\n const pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data,\r\n sprite = [];\r\n while (--di >= 0) {\r\n d = data[di];\r\n if (!d.hasText) continue;\r\n const w = d.width,\r\n w32 = w >> 5;\r\n let h = d.y1 - d.y0;\r\n // Zero the buffer\r\n for (let i = 0; i < h * w32; i++) sprite[i] = 0;\r\n x = d.xoff;\r\n if (x == null) return;\r\n y = d.yoff;\r\n let seen = 0,\r\n seenRow = -1;\r\n for (let j = 0; j < h; j++) {\r\n for (let i = 0; i < w; i++) {\r\n const k = w32 * j + (i >> 5),\r\n m = pixels[((y + j) * (cw << 5) + (x + i)) << 2] ? 1 << (31 - (i % 32)) : 0;\r\n sprite[k] |= m;\r\n seen |= m;\r\n }\r\n if (seen) seenRow = j;\r\n else {\r\n d.y0++;\r\n h--;\r\n j--;\r\n y++;\r\n }\r\n }\r\n d.y1 = d.y0 + seenRow;\r\n d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32);\r\n }\r\n}\r\n\r\n// Use mask-based collision detection.\r\nfunction cloudCollide(tag, board, sw) {\r\n sw >>= 5;\r\n const sprite = tag.sprite,\r\n w = tag.width >> 5,\r\n lx = tag.x - (w << 4),\r\n sx = lx & 0x7f,\r\n msx = 32 - sx,\r\n h = tag.y1 - tag.y0;\r\n let x = (tag.y + tag.y0) * sw + (lx >> 5),\r\n last;\r\n for (let j = 0; j < h; j++) {\r\n last = 0;\r\n for (let i = 0; i <= w; i++) {\r\n if (((last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0)) & board[x + i]) return true;\r\n }\r\n x += sw;\r\n }\r\n return false;\r\n}\r\n\r\nfunction cloudBounds(bounds, d) {\r\n const b0 = bounds[0],\r\n b1 = bounds[1];\r\n if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;\r\n if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;\r\n if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;\r\n if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;\r\n}\r\n\r\nfunction collideRects(a, b) {\r\n return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;\r\n}\r\n\r\nfunction archimedeanSpiral(size) {\r\n const e = size[0] / size[1];\r\n return function (t) {\r\n return [e * (t *= 0.1) * Math.cos(t), t * Math.sin(t)];\r\n };\r\n}\r\n\r\nfunction rectangularSpiral(size) {\r\n const dy = 4,\r\n dx = (dy * size[0]) / size[1];\r\n let x = 0,\r\n y = 0;\r\n return function (t) {\r\n const sign = t < 0 ? -1 : 1;\r\n // See triangular numbers: T_n = n * (n + 1) / 2.\r\n switch ((Math.sqrt(1 + 4 * sign * t) - sign) & 3) {\r\n case 0:\r\n x += dx;\r\n break;\r\n case 1:\r\n y += dy;\r\n break;\r\n case 2:\r\n x -= dx;\r\n break;\r\n default:\r\n y -= dy;\r\n break;\r\n }\r\n return [x, y];\r\n };\r\n}\r\n\r\n// TODO reuse arrays?\r\nfunction zeroArray(n) {\r\n const a = [];\r\n let i = -1;\r\n while (++i < n) a[i] = 0;\r\n return a;\r\n}\r\n\r\nfunction cloudCanvas() {\r\n return document.createElement('canvas');\r\n}\r\n\r\nexport function functor(d) {\r\n return isFunction(d)\r\n ? d\r\n : function () {\r\n return d;\r\n };\r\n}\r\n\r\nconst spirals = {\r\n archimedean: archimedeanSpiral,\r\n rectangular: rectangularSpiral,\r\n};\r\n\r\nfunction tagCloud() {\r\n let size = [256, 256],\r\n font = cloudFont,\r\n fontSize = cloudFontSize,\r\n fontWeight = cloudFontNormal,\r\n rotate = cloudRotate,\r\n padding = cloudPadding,\r\n spiral = archimedeanSpiral,\r\n random = Math.random,\r\n words = [],\r\n timeInterval = Infinity;\r\n\r\n const text = cloudText;\r\n const fontStyle = cloudFontNormal;\r\n const canvas = cloudCanvas;\r\n const cloud: any = {};\r\n\r\n cloud.start = function () {\r\n const [width, height] = size;\r\n const contextAndRatio = getContext(canvas()),\r\n board = cloud.board ? cloud.board : zeroArray((size[0] >> 5) * size[1]),\r\n n = words.length,\r\n tags = [],\r\n data = words\r\n .map(function (d, i, data) {\r\n d.text = text.call(this, d, i, data);\r\n d.font = font.call(this, d, i, data);\r\n d.style = fontStyle.call(this, d, i, data);\r\n d.weight = fontWeight.call(this, d, i, data);\r\n d.rotate = rotate.call(this, d, i, data);\r\n d.size = ~~fontSize.call(this, d, i, data);\r\n d.padding = padding.call(this, d, i, data);\r\n return d;\r\n })\r\n .sort(function (a, b) {\r\n return b.size - a.size;\r\n });\r\n let i = -1,\r\n bounds = !cloud.board\r\n ? null\r\n : [\r\n {\r\n x: 0,\r\n y: 0,\r\n },\r\n {\r\n x: width,\r\n y: height,\r\n },\r\n ];\r\n\r\n step();\r\n\r\n function step() {\r\n const start = Date.now();\r\n while (Date.now() - start < timeInterval && ++i < n) {\r\n const d = data[i];\r\n d.x = (width * (random() + 0.5)) >> 1;\r\n d.y = (height * (random() + 0.5)) >> 1;\r\n cloudSprite(contextAndRatio, d, data, i);\r\n if (d.hasText && place(board, d, bounds)) {\r\n tags.push(d);\r\n if (bounds) {\r\n if (!cloud.hasImage) {\r\n // update bounds if image mask not set\r\n cloudBounds(bounds, d);\r\n }\r\n } else {\r\n bounds = [\r\n { x: d.x + d.x0, y: d.y + d.y0 },\r\n { x: d.x + d.x1, y: d.y + d.y1 },\r\n ];\r\n }\r\n // Temporary hack\r\n d.x -= size[0] >> 1;\r\n d.y -= size[1] >> 1;\r\n }\r\n }\r\n cloud._tags = tags;\r\n cloud._bounds = bounds;\r\n }\r\n\r\n return cloud;\r\n };\r\n\r\n function getContext(canvas: HTMLCanvasElement) {\r\n canvas.width = canvas.height = 1;\r\n const ratio = Math.sqrt(\r\n (canvas.getContext('2d', { willReadFrequently: true }) as CanvasRenderingContext2D)!.getImageData(0, 0, 1, 1).data\r\n .length >> 2\r\n );\r\n canvas.width = (cw << 5) / ratio;\r\n canvas.height = ch / ratio;\r\n\r\n const context = canvas.getContext('2d', { willReadFrequently: true }) as CanvasRenderingContext2D;\r\n context.fillStyle = context.strokeStyle = 'red';\r\n context.textAlign = 'center';\r\n return { context, ratio };\r\n }\r\n\r\n function place(board, tag, bounds) {\r\n // const perimeter = [{ x: 0, y: 0 }, { x: size[0], y: size[1] }],\r\n const startX = tag.x,\r\n startY = tag.y,\r\n maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]),\r\n s = spiral(size),\r\n dt = random() < 0.5 ? 1 : -1;\r\n let dxdy,\r\n t = -dt,\r\n dx,\r\n dy;\r\n\r\n while ((dxdy = s((t += dt)))) {\r\n dx = ~~dxdy[0];\r\n dy = ~~dxdy[1];\r\n\r\n if (Math.min(Math.abs(dx), Math.abs(dy)) >= maxDelta) break;\r\n\r\n tag.x = startX + dx;\r\n tag.y = startY + dy;\r\n\r\n if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 || tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue;\r\n // TODO only check for collisions within current bounds.\r\n if (!bounds || !cloudCollide(tag, board, size[0])) {\r\n if (!bounds || collideRects(tag, bounds)) {\r\n const sprite = tag.sprite,\r\n w = tag.width >> 5,\r\n sw = size[0] >> 5,\r\n lx = tag.x - (w << 4),\r\n sx = lx & 0x7f,\r\n msx = 32 - sx,\r\n h = tag.y1 - tag.y0;\r\n let last,\r\n x = (tag.y + tag.y0) * sw + (lx >> 5);\r\n for (let j = 0; j < h; j++) {\r\n last = 0;\r\n for (let i = 0; i <= w; i++) {\r\n board[x + i] |= (last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0);\r\n }\r\n x += sw;\r\n }\r\n delete tag.sprite;\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n cloud.createMask = (img: HTMLImageElement) => {\r\n const can: HTMLCanvasElement = document.createElement('canvas');\r\n const [width, height] = size;\r\n\r\n // 当 width 或 height 为 0 时,调用 cxt.getImageData 会报错\r\n if (!width || !height) {\r\n return;\r\n }\r\n const w32 = width >> 5;\r\n const board = zeroArray((width >> 5) * height);\r\n can.width = width;\r\n can.height = height;\r\n const cxt = can.getContext('2d') as CanvasRenderingContext2D;\r\n cxt.drawImage(img, 0, 0, img.width, img.height, 0, 0, width, height);\r\n const imageData = cxt.getImageData(0, 0, width, height).data;\r\n for (let j = 0; j < height; j++) {\r\n for (let i = 0; i < width; i++) {\r\n const k = w32 * j + (i >> 5);\r\n const tmp = (j * width + i) << 2;\r\n const flag = imageData[tmp] >= 250 && imageData[tmp + 1] >= 250 && imageData[tmp + 2] >= 250;\r\n const m = flag ? 1 << (31 - (i % 32)) : 0;\r\n board[k] |= m;\r\n }\r\n }\r\n cloud.board = board;\r\n cloud.hasImage = true;\r\n };\r\n\r\n cloud.timeInterval = function (_) {\r\n timeInterval = _ == null ? Infinity : _;\r\n };\r\n\r\n cloud.words = function (_) {\r\n words = _;\r\n };\r\n\r\n cloud.size = function (_) {\r\n size = [+_[0], +_[1]];\r\n };\r\n\r\n cloud.font = function (_) {\r\n font = functor(_);\r\n };\r\n\r\n cloud.fontWeight = function (_) {\r\n fontWeight = functor(_);\r\n };\r\n\r\n cloud.rotate = function (_) {\r\n rotate = functor(_);\r\n };\r\n\r\n cloud.spiral = function (_) {\r\n spiral = spirals[_] || _;\r\n };\r\n\r\n cloud.fontSize = function (_) {\r\n fontSize = functor(_);\r\n };\r\n\r\n cloud.padding = function (_) {\r\n padding = functor(_);\r\n };\r\n\r\n cloud.random = function (_) {\r\n random = functor(_);\r\n };\r\n\r\n return cloud;\r\n}\r\n"]}
package/lib/utils/view.js CHANGED
@@ -47,9 +47,9 @@ function addViewAnimation(view, animation, geometries) {
47
47
  view.animate(true);
48
48
  }
49
49
  // 所有的 Geometry 都使用同一动画(各个图形如有区别,自行覆盖)
50
- util_1.each(geometries, function (g) {
50
+ (0, util_1.each)(geometries, function (g) {
51
51
  var animationCfg;
52
- if (util_1.isFunction(animation)) {
52
+ if ((0, util_1.isFunction)(animation)) {
53
53
  animationCfg = animation(g.type || g.shapeType, g) || true;
54
54
  }
55
55
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"view.js","sourceRoot":"","sources":["../../src/utils/view.ts"],"names":[],"mappings":";;;AACA,mCAA8C;AAI9C;;;;GAIG;AACH,SAAgB,YAAY,CAAC,KAAW,EAAE,EAAU;IAClD,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,UAAC,IAAU,IAAK,OAAA,IAAI,CAAC,EAAE,KAAK,EAAE,EAAd,CAAc,CAAC,CAAC;AAC1D,CAAC;AAFD,oCAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAU;IACjC,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACpC,CAAC;AAHD,4BAGC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,IAAU;IACxC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,KAAK,IAAI,EAAZ,CAAY,CAAC,CAAC;AACtD,CAAC;AAFD,0CAEC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAC9B,IAAU,EACV,SAA+B,EAC/B,UAA0D;IAA1D,2BAAA,EAAA,aAA2C,IAAI,CAAC,UAAU;IAE1D,mBAAmB;IACnB,IAAI,OAAO,SAAS,KAAK,SAAS,EAAE;QAClC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;KACzB;SAAM;QACL,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACpB;IAED,sCAAsC;IACtC,WAAI,CAAC,UAAU,EAAE,UAAC,CAAW;QAC3B,IAAI,YAAY,CAAC;QACjB,IAAI,iBAAU,CAAC,SAAS,CAAC,EAAE;YACzB,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC;SAC5D;aAAM;YACL,YAAY,GAAG,SAAS,CAAC;SAC1B;QAED,CAAC,CAAC,OAAO,CAAC,YAAyB,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC;AAvBD,4CAuBC","sourcesContent":["import { Geometry, Types, View } from '@antv/g2';\nimport { each, isFunction } from '@antv/util';\nimport { Options } from '../types';\nimport { Animation } from '../types/animation';\n\n/**\n * 在 Chart 中查找特定 id 的子 View\n * @param chart\n * @param id\n */\nexport function findViewById(chart: View, id: string): View {\n return chart.views.find((view: View) => view.id === id);\n}\n\n/**\n * 获取同 view 同一级的所有 views\n * @param view 当前 view\n * @returns 同一级的 views\n * @ignore\n */\nexport function getViews(view: View): View[] {\n const parent = view.parent;\n return parent ? parent.views : [];\n}\n\n/**\n * 获取同 view 同一级的 views,不包括自身\n * @param view 当前 view\n * @returns 同一级的 views\n * @ignore\n */\nexport function getSiblingViews(view: View): View[] {\n return getViews(view).filter((sub) => sub !== view);\n}\n\n/**\n * 所有的 Geometries 都使用同一动画(各个图形如有区别,自行覆盖)并添加处理动画回调\n * @param view View\n * @param animation 动画配置\n */\nexport function addViewAnimation(\n view: View,\n animation: Options['animation'],\n geometries: Geometry<Types.ShapePoint>[] = view.geometries\n) {\n // 同时设置整个 view 动画选项\n if (typeof animation === 'boolean') {\n view.animate(animation);\n } else {\n view.animate(true);\n }\n\n // 所有的 Geometry 都使用同一动画(各个图形如有区别,自行覆盖)\n each(geometries, (g: Geometry) => {\n let animationCfg;\n if (isFunction(animation)) {\n animationCfg = animation(g.type || g.shapeType, g) || true;\n } else {\n animationCfg = animation;\n }\n\n g.animate(animationCfg as Animation);\n });\n}\n"]}
1
+ {"version":3,"file":"view.js","sourceRoot":"","sources":["../../src/utils/view.ts"],"names":[],"mappings":";;;AACA,mCAA8C;AAI9C;;;;GAIG;AACH,SAAgB,YAAY,CAAC,KAAW,EAAE,EAAU;IAClD,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,UAAC,IAAU,IAAK,OAAA,IAAI,CAAC,EAAE,KAAK,EAAE,EAAd,CAAc,CAAC,CAAC;AAC1D,CAAC;AAFD,oCAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAU;IACjC,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACpC,CAAC;AAHD,4BAGC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,IAAU;IACxC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,KAAK,IAAI,EAAZ,CAAY,CAAC,CAAC;AACtD,CAAC;AAFD,0CAEC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAC9B,IAAU,EACV,SAA+B,EAC/B,UAA0D;IAA1D,2BAAA,EAAA,aAA2C,IAAI,CAAC,UAAU;IAE1D,mBAAmB;IACnB,IAAI,OAAO,SAAS,KAAK,SAAS,EAAE;QAClC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;KACzB;SAAM;QACL,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACpB;IAED,sCAAsC;IACtC,IAAA,WAAI,EAAC,UAAU,EAAE,UAAC,CAAW;QAC3B,IAAI,YAAY,CAAC;QACjB,IAAI,IAAA,iBAAU,EAAC,SAAS,CAAC,EAAE;YACzB,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC;SAC5D;aAAM;YACL,YAAY,GAAG,SAAS,CAAC;SAC1B;QAED,CAAC,CAAC,OAAO,CAAC,YAAyB,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC;AAvBD,4CAuBC","sourcesContent":["import { Geometry, Types, View } from '@antv/g2';\nimport { each, isFunction } from '@antv/util';\nimport { Options } from '../types';\nimport { Animation } from '../types/animation';\n\n/**\n * 在 Chart 中查找特定 id 的子 View\n * @param chart\n * @param id\n */\nexport function findViewById(chart: View, id: string): View {\n return chart.views.find((view: View) => view.id === id);\n}\n\n/**\n * 获取同 view 同一级的所有 views\n * @param view 当前 view\n * @returns 同一级的 views\n * @ignore\n */\nexport function getViews(view: View): View[] {\n const parent = view.parent;\n return parent ? parent.views : [];\n}\n\n/**\n * 获取同 view 同一级的 views,不包括自身\n * @param view 当前 view\n * @returns 同一级的 views\n * @ignore\n */\nexport function getSiblingViews(view: View): View[] {\n return getViews(view).filter((sub) => sub !== view);\n}\n\n/**\n * 所有的 Geometries 都使用同一动画(各个图形如有区别,自行覆盖)并添加处理动画回调\n * @param view View\n * @param animation 动画配置\n */\nexport function addViewAnimation(\n view: View,\n animation: Options['animation'],\n geometries: Geometry<Types.ShapePoint>[] = view.geometries\n) {\n // 同时设置整个 view 动画选项\n if (typeof animation === 'boolean') {\n view.animate(animation);\n } else {\n view.animate(true);\n }\n\n // 所有的 Geometry 都使用同一动画(各个图形如有区别,自行覆盖)\n each(geometries, (g: Geometry) => {\n let animationCfg;\n if (isFunction(animation)) {\n animationCfg = animation(g.type || g.shapeType, g) || true;\n } else {\n animationCfg = animation;\n }\n\n g.animate(animationCfg as Animation);\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g2plot",
3
- "version": "2.4.25",
3
+ "version": "2.4.27",
4
4
  "description": "An interactive and responsive charting library",
5
5
  "keywords": [
6
6
  "chart",
@@ -73,16 +73,16 @@
73
73
  "@commitlint/cli": "^8.2.0",
74
74
  "@commitlint/config-angular": "^8.2.0",
75
75
  "@types/jest": "^25.2.1",
76
- "@typescript-eslint/eslint-plugin": "^2.0.0",
77
- "@typescript-eslint/parser": "^2.0.0",
76
+ "@typescript-eslint/eslint-plugin": "^5.54.1",
77
+ "@typescript-eslint/parser": "^5.54.1",
78
78
  "antd": "^4.8.4",
79
79
  "babel-loader": "^8.1.0",
80
80
  "conventional-changelog-cli": "^2.0.34",
81
81
  "cross-env": "^7.0.2",
82
- "eslint": "^6.1.0",
83
- "eslint-config-prettier": "^6.0.0",
82
+ "eslint": "^8.35.0",
83
+ "eslint-config-prettier": "^8.7.0",
84
84
  "eslint-plugin-import": "^2.22.0",
85
- "eslint-plugin-prettier": "^3.1.0",
85
+ "eslint-plugin-prettier": "^4.2.0",
86
86
  "generate-changelog": "^1.8.0",
87
87
  "husky": "^4.2.3",
88
88
  "jest": "^26.0.1",
@@ -101,7 +101,7 @@
101
101
  "rimraf": "^3.0.0",
102
102
  "ts-jest": "^25.4.0",
103
103
  "ts-loader": "^7.0.0",
104
- "typescript": "^3.5.3",
104
+ "typescript": "^4",
105
105
  "webpack": "^4.44.2",
106
106
  "webpack-bundle-analyzer": "^3.9.0",
107
107
  "webpack-cli": "^3.3.7",
@@ -1,3 +1,4 @@
1
+ import { deepMix } from '@antv/util';
1
2
  import { Params } from '../../core/adaptor';
2
3
  import { deepAssign } from '../../utils';
3
4
  import { getTooltipMapping } from '../../utils/tooltip';
@@ -34,11 +35,13 @@ export function area<O extends AreaGeometryOptions>(params: Params<O>): Params<O
34
35
  type: 'area',
35
36
  colorField: seriesField,
36
37
  tooltipFields: fields,
37
- mapping: {
38
- shape: smooth ? 'smooth' : 'area',
39
- tooltip: formatter,
40
- ...area,
41
- },
38
+ mapping: deepMix(
39
+ {
40
+ shape: smooth ? 'smooth' : 'area',
41
+ tooltip: formatter,
42
+ },
43
+ area
44
+ ),
42
45
  args: { useDeferredLabel },
43
46
  },
44
47
  })
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export const version = '2.4.25';
1
+ export const version = '2.4.27';
2
2
 
3
3
  // G2 自定义能力透出
4
4
  import * as G2 from '@antv/g2';
@@ -30,6 +30,7 @@ function geometry(params: Params<AreaOptions>): Params<AreaOptions> {
30
30
  const {
31
31
  data,
32
32
  areaStyle,
33
+ areaShape,
33
34
  color,
34
35
  point: pointMapping,
35
36
  line: lineMapping,
@@ -56,7 +57,11 @@ function geometry(params: Params<AreaOptions>): Params<AreaOptions> {
56
57
  : tooltip;
57
58
  const primary = deepAssign({}, params, {
58
59
  options: {
59
- area: { color, style: areaStyle },
60
+ area: {
61
+ color,
62
+ style: areaStyle,
63
+ shape: areaShape,
64
+ },
60
65
  point: pointMapping && {
61
66
  color,
62
67
  ...pointMapping,
@@ -1,4 +1,9 @@
1
- import { GeometryOptions, LineGeometryOptions, PointGeometryOptions } from '../../adaptor/geometries';
1
+ import {
2
+ GeometryOptions,
3
+ AreaGeometryOptions,
4
+ LineGeometryOptions,
5
+ PointGeometryOptions,
6
+ } from '../../adaptor/geometries';
2
7
  import { Options, StyleAttr } from '../../types';
3
8
  import { Transformations } from '../../types/coordinate';
4
9
 
@@ -35,6 +40,10 @@ export interface AreaOptions extends Options, Pick<GeometryOptions, 'customInfo'
35
40
  * @title 面积图形样式
36
41
  */
37
42
  readonly areaStyle?: StyleAttr;
43
+ /**
44
+ * @title 面积 shape 配置
45
+ */
46
+ readonly areaShape?: Required<AreaGeometryOptions>['area']['shape'];
38
47
  /**
39
48
  * @title 面积中折线的样式
40
49
  */
@@ -314,7 +314,7 @@ function label(params: Params<BidirectionalBarOptions>): Params<BidirectionalBar
314
314
  if (typeof cfg.position === 'string') {
315
315
  cfg.position = positionMap[cfg.position];
316
316
  } else if (typeof cfg.position === 'function') {
317
- cfg.position = (...args) => positionMap[(cfg.position as Function).apply(this, args)];
317
+ cfg.position = (...args) => positionMap[(cfg.position as any).apply(this, args)];
318
318
  }
319
319
  // 设置 textBaseline 默认值
320
320
  const textBaseline = leftLabelCfg.style?.textBaseline || 'bottom';
@@ -99,7 +99,7 @@ function geometry(params: Params<ColumnOptions>): Params<ColumnOptions> {
99
99
  ? {
100
100
  formatter: (datum: Datum) => ({
101
101
  name:
102
- isGroup && isStack ? `${datum[seriesField]} - ${datum[groupField]}` : datum[seriesField] || datum[xField],
102
+ isGroup && isStack ? `${datum[seriesField]} - ${datum[groupField]}` : datum[seriesField] ?? datum[xField],
103
103
  value: (Number(datum[yField]) * 100).toFixed(2) + '%',
104
104
  }),
105
105
  ...tooltip,
@@ -12,7 +12,7 @@ import { getScaleMax, getStackedData } from './utils';
12
12
  */
13
13
  function geometry(params: Params<RadialBarOptions>): Params<RadialBarOptions> {
14
14
  const { chart, options } = params;
15
- const { barStyle: style, color, tooltip, colorField, type, xField, yField, data } = options;
15
+ const { barStyle: style, color, tooltip, colorField, type, xField, yField, data, shape } = options;
16
16
 
17
17
  // 处理不合法的数据
18
18
  const processData = processIllegalData(data, yField);
@@ -25,7 +25,7 @@ function geometry(params: Params<RadialBarOptions>): Params<RadialBarOptions> {
25
25
  interval: {
26
26
  style,
27
27
  color,
28
- shape: type === 'line' ? 'line' : 'intervel',
28
+ shape: shape || (type === 'line' ? 'line' : 'intervel'),
29
29
  },
30
30
  // 柱子的一些样式设置:柱子最小宽度、柱子最大宽度、柱子背景
31
31
  minColumnWidth: options.minBarWidth,
@@ -1,9 +1,13 @@
1
1
  import { ShapeAttrs } from '@antv/g-base';
2
+ import { GeometryOptions } from '../../adaptor/geometries';
2
3
  import { Options } from '../../types';
3
4
  import { BarOptions } from '../bar';
4
5
 
5
6
  /** 配置类型定义 */
6
- export interface RadialBarOptions extends Options, Pick<BarOptions, 'barBackground' | 'minBarWidth' | 'maxBarWidth'> {
7
+ export interface RadialBarOptions
8
+ extends Options,
9
+ Pick<BarOptions, 'barBackground' | 'minBarWidth' | 'maxBarWidth'>,
10
+ Pick<GeometryOptions, 'customInfo'> {
7
11
  /**
8
12
  * @title x轴字段
9
13
  */
@@ -55,4 +59,9 @@ export interface RadialBarOptions extends Options, Pick<BarOptions, 'barBackgrou
55
59
  * @default false
56
60
  */
57
61
  readonly isGroup?: boolean;
62
+ /**
63
+ * @title 自定义玉珏图
64
+ * @description interval/line 图形元素展示形状
65
+ */
66
+ readonly shape?: string;
58
67
  }
@@ -11,7 +11,7 @@ import { RoseOptions } from './types';
11
11
  */
12
12
  function geometry(params: Params<RoseOptions>): Params<RoseOptions> {
13
13
  const { chart, options } = params;
14
- const { data, sectorStyle, color } = options;
14
+ const { data, sectorStyle, shape, color } = options;
15
15
 
16
16
  // 装载数据
17
17
  chart.data(data);
@@ -23,6 +23,7 @@ function geometry(params: Params<RoseOptions>): Params<RoseOptions> {
23
23
  interval: {
24
24
  style: sectorStyle,
25
25
  color,
26
+ shape: shape,
26
27
  },
27
28
  },
28
29
  })
@@ -1,6 +1,7 @@
1
+ import { GeometryOptions, IntervalGeometryOptions } from '../../adaptor/geometries';
1
2
  import { Options, StyleAttr } from '../../types';
2
3
 
3
- export interface RoseOptions extends Options {
4
+ export interface RoseOptions extends Options, Pick<GeometryOptions, 'customInfo'> {
4
5
  /**
5
6
  * @title 扇形切片分类所对应的数据字段名
6
7
  * @description 每个扇形的弧度相等
@@ -47,4 +48,9 @@ export interface RoseOptions extends Options {
47
48
  * @description sectorStyle 中的fill会覆盖 color 的配置,sectorStyle 可以直接指定,也可以通过 callback 的方式,根据数据为每个扇形切片指定单独的样式
48
49
  */
49
50
  readonly sectorStyle?: StyleAttr;
51
+ /**
52
+ * @title 扇形自定义形状
53
+ * @description interval 图形元素展示形状
54
+ */
55
+ readonly shape?: Required<IntervalGeometryOptions>['interval']['shape'];
50
56
  }
@@ -38,7 +38,7 @@ function defaultOptions(params: Params<SankeyOptions>): Params<SankeyOptions> {
38
38
  */
39
39
  function geometry(params: Params<SankeyOptions>): Params<SankeyOptions> {
40
40
  const { chart, options } = params;
41
- const { color, nodeStyle, edgeStyle, label, tooltip, nodeState, edgeState } = options;
41
+ const { color, nodeStyle, edgeStyle, label, tooltip, nodeState, edgeState, rawFields = [] } = options;
42
42
 
43
43
  // 1. 组件,优先设置,因为子 view 会继承配置
44
44
  chart.legend(false);
@@ -62,6 +62,7 @@ function geometry(params: Params<SankeyOptions>): Params<SankeyOptions> {
62
62
  xField: X_FIELD,
63
63
  yField: Y_FIELD,
64
64
  seriesField: COLOR_FIELD,
65
+ rawFields: ['source', 'target', ...rawFields],
65
66
  edge: {
66
67
  color,
67
68
  style: edgeStyle,
@@ -62,7 +62,7 @@ type SankeyLayoutOutputData = {
62
62
  /**
63
63
  * 对齐方式的类型定义
64
64
  */
65
- export type NodeAlign = keyof typeof ALIGN_METHOD | Function;
65
+ export type NodeAlign = keyof typeof ALIGN_METHOD | ((...args: any[]) => any);
66
66
 
67
67
  /**
68
68
  * 节点的 depth 自定义
@@ -261,12 +261,20 @@ function regressionLine(params: Params<ScatterOptions>): Params<ScatterOptions>
261
261
  const { options, chart } = params;
262
262
  const { regressionLine } = options;
263
263
  if (regressionLine) {
264
- const { style, top = false } = regressionLine;
264
+ const { style, equationStyle = {}, top = false, showEquation = false } = regressionLine;
265
265
  const defaultStyle = {
266
266
  stroke: '#9ba29a',
267
267
  lineWidth: 2,
268
268
  opacity: 0.5,
269
269
  };
270
+ const defaulEquationStyle = {
271
+ x: 20,
272
+ y: 20,
273
+ textAlign: 'left' as const,
274
+ textBaseline: 'middle' as const,
275
+ fontSize: 14,
276
+ fillOpacity: 0.5,
277
+ };
270
278
  chart.annotation().shape({
271
279
  top,
272
280
  render: (container, view) => {
@@ -274,7 +282,7 @@ function regressionLine(params: Params<ScatterOptions>): Params<ScatterOptions>
274
282
  id: `${chart.id}-regression-line`,
275
283
  name: 'regression-line-group',
276
284
  });
277
- const path = getPath({
285
+ const [path, equation] = getPath({
278
286
  view,
279
287
  options,
280
288
  });
@@ -286,6 +294,16 @@ function regressionLine(params: Params<ScatterOptions>): Params<ScatterOptions>
286
294
  ...style,
287
295
  },
288
296
  });
297
+ if (showEquation) {
298
+ group.addShape('text', {
299
+ name: 'regression-equation',
300
+ attrs: {
301
+ ...defaulEquationStyle,
302
+ ...equationStyle,
303
+ text: equation,
304
+ },
305
+ });
306
+ }
289
307
  },
290
308
  });
291
309
  }
@@ -8,6 +8,7 @@ import {
8
8
  SizeAttr,
9
9
  StyleAttr,
10
10
  TextOption,
11
+ TextStyle,
11
12
  } from '../../types';
12
13
 
13
14
  interface Labels extends Omit<TextOption, 'position'> {
@@ -60,6 +61,21 @@ export interface RegressionLineOptions {
60
61
  * @description [[0,0],[100,100]]
61
62
  */
62
63
  readonly algorithm?: Array<[number, number]> | ((data: any) => Array<[number, number]>);
64
+ /**
65
+ * @title 显示回归方程式
66
+ * @description 默认为不显示回归方程式
67
+ */
68
+ readonly showEquation?: boolean;
69
+ /**
70
+ * @title 自定义回归方程式
71
+ * @description 只有当自定义 algorithm 时生效
72
+ */
73
+ readonly equation?: string;
74
+ /**
75
+ * @title 回归线方程式样式
76
+ * @description 自定义文本样式,请参考 TextStyle 配置
77
+ */
78
+ readonly equationStyle?: TextStyle;
63
79
  }
64
80
 
65
81
  export interface ScatterOptions extends Options {
@@ -27,6 +27,14 @@ type RenderOptions = {
27
27
  options: ScatterOptions;
28
28
  };
29
29
 
30
+ type D3RegressionResult = {
31
+ a?: number;
32
+ b?: number;
33
+ c?: number;
34
+ coefficients?: number[];
35
+ rSquared?: number;
36
+ };
37
+
30
38
  /**
31
39
  * 获取四象限默认配置
32
40
  * @param {number} xBaseline
@@ -149,17 +157,20 @@ const splinePath = (data: number[][], config: RenderOptions) => {
149
157
  export const getPath = (config: RenderOptions) => {
150
158
  const { options } = config;
151
159
  const { xField, yField, data, regressionLine } = options;
152
- const { type = 'linear', algorithm } = regressionLine;
160
+ const { type = 'linear', algorithm, equation: customEquation } = regressionLine;
153
161
  let pathData: Array<[number, number]>;
162
+ let equation = null;
154
163
  if (algorithm) {
155
164
  pathData = isArray(algorithm) ? algorithm : algorithm(data);
165
+ equation = customEquation;
156
166
  } else {
157
167
  const reg = REGRESSION_MAP[type]()
158
168
  .x((d) => d[xField])
159
169
  .y((d) => d[yField]);
160
170
  pathData = reg(data);
171
+ equation = getRegressionEquation(type, pathData as D3RegressionResult);
161
172
  }
162
- return splinePath(pathData, config);
173
+ return [splinePath(pathData, config), equation];
163
174
  };
164
175
 
165
176
  /**
@@ -227,3 +238,45 @@ export const getMeta = (
227
238
  },
228
239
  };
229
240
  };
241
+
242
+ /**
243
+ * 获取回归函数表达式
244
+ * @param {string} type - 回归函数类型
245
+ * @param {D3RegressionResult} res - 回归计算结果集
246
+ * @return {string}
247
+ */
248
+ export function getRegressionEquation(type: string, res: D3RegressionResult) {
249
+ const roundByPrecision = (n, p = 4) => Math.round(n * Math.pow(10, p)) / Math.pow(10, p);
250
+ const safeFormat = (value) => (Number.isFinite(value) ? roundByPrecision(value) : '?');
251
+
252
+ switch (type) {
253
+ case 'linear':
254
+ // y = ax + b
255
+ return `y = ${safeFormat(res.a)}x + ${safeFormat(res.b)}, R^2 = ${safeFormat(res.rSquared)}`;
256
+ case 'exp':
257
+ // y = ae^(bx)
258
+ return `y = ${safeFormat(res.a)}e^(${safeFormat(res.b)}x), R^2 = ${safeFormat(res.rSquared)}`;
259
+ case 'log':
260
+ // y = a · ln(x) + b
261
+ return `y = ${safeFormat(res.a)}ln(x) + ${safeFormat(res.b)}, R^2 = ${safeFormat(res.rSquared)}`;
262
+ case 'quad':
263
+ // y = ax^2 + bx + c
264
+ return `y = ${safeFormat(res.a)}x^2 + ${safeFormat(res.b)}x + ${safeFormat(res.c)}, R^2 = ${safeFormat(
265
+ res.rSquared
266
+ )}`;
267
+ case 'poly':
268
+ // y = anx^n + ... + a1x + a0
269
+ // eslint-disable-next-line no-case-declarations
270
+ let temp = `y = ${safeFormat(res.coefficients?.[0])} + ${safeFormat(res.coefficients?.[1])}x + ${safeFormat(
271
+ res.coefficients?.[2]
272
+ )}x^2`;
273
+ for (let i = 3; i < res.coefficients.length; ++i) {
274
+ temp += ` + ${safeFormat(res.coefficients[i])}x^${i}`;
275
+ }
276
+ return `${temp}, R^2 = ${safeFormat(res.rSquared)}`;
277
+ case 'pow':
278
+ // y = ax^b
279
+ return `y = ${safeFormat(res.a)}x^${safeFormat(res.b)}, R^2 = ${safeFormat(res.rSquared)}`;
280
+ }
281
+ return null;
282
+ }
@@ -24,7 +24,7 @@ import { transformData } from './utils';
24
24
  */
25
25
  function geometry(params: Params<SunburstOptions>): Params<SunburstOptions> {
26
26
  const { chart, options } = params;
27
- const { color, colorField = SUNBURST_ANCESTOR_FIELD, sunburstStyle, rawFields = [] } = options;
27
+ const { color, colorField = SUNBURST_ANCESTOR_FIELD, sunburstStyle, rawFields = [], shape } = options;
28
28
  const data = transformData(options);
29
29
  chart.data(data);
30
30
 
@@ -53,6 +53,7 @@ function geometry(params: Params<SunburstOptions>): Params<SunburstOptions> {
53
53
  polygon: {
54
54
  color,
55
55
  style,
56
+ shape,
56
57
  },
57
58
  },
58
59
  })
@@ -1,8 +1,11 @@
1
+ import { GeometryOptions } from '../../adaptor/geometries';
1
2
  import { ColorAttr, Options, StyleAttr } from '../../types';
2
3
  import { DrillDownCfg } from '../../types/drill-down';
3
4
  import { HierarchyOption } from '../../utils/hierarchy/types';
4
5
 
5
- export interface SunburstOptions extends Omit<Options, 'data' | 'slider' | 'scrollbar' | 'xAxis' | 'yAxis'> {
6
+ export interface SunburstOptions
7
+ extends Omit<Options, 'data' | 'slider' | 'scrollbar' | 'xAxis' | 'yAxis'>,
8
+ Pick<GeometryOptions, 'customInfo'> {
6
9
  /**
7
10
  * @title 旭日图数据
8
11
  */
@@ -65,4 +68,9 @@ export interface SunburstOptions extends Omit<Options, 'data' | 'slider' | 'scro
65
68
  * @title 下钻交互
66
69
  */
67
70
  readonly drilldown?: DrillDownCfg;
71
+ /**
72
+ * @title 自定义旭日图形状
73
+ * @description polygon 图形元素展示形状
74
+ */
75
+ readonly shape?: string;
68
76
  }