@antv/g2plot 2.4.26 → 2.4.28

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 (756) hide show
  1. package/dist/g2plot.min.js +2 -2
  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 +5 -5
  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 +12 -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/layout.ts +1 -1
  748. package/src/plots/scatter/adaptor.ts +20 -2
  749. package/src/plots/scatter/types.ts +16 -0
  750. package/src/plots/scatter/util.ts +55 -2
  751. package/src/plots/sunburst/adaptor.ts +2 -1
  752. package/src/plots/sunburst/types.ts +9 -1
  753. package/src/plots/waterfall/adaptor.ts +20 -4
  754. package/src/plots/waterfall/types.ts +7 -1
  755. package/src/utils/hierarchy/partition.ts +1 -1
  756. package/CHANGELOG.md +0 -1669
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrG,QAAQ;AACR,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,0CAA0C;AAC1C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE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E,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,uEAAuE;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,2BAA2B;AAC3B,mEAAmE;AACnE,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAC7B,SAAS;AACT,cAAc,SAAS,CAAC;AACxB,uCAAuC;AACvC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACjD,8BAA8B;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,CAAC;AACd,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,8BAA8B;AAC9B,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAEtC,MAAM,CAAC,IAAM,QAAQ,GAAG,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,WAAW,aAAA,EAAE,KAAK,OAAA,EAAE,SAAS,WAAA,EAAE,CAAC","sourcesContent":["export const version = '2.4.26';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { animation, annotation, interaction, legend, scale, theme, tooltip } from './adaptor/common';\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { area, interval, line, point, polygon, schema } from './adaptor/geometries';\nexport type {\n AreaGeometryOptions,\n IntervalGeometryOptions,\n LineGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\n// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ), [visiky](https://github.com/visiky)\nexport { Box } from './plots/box';\nexport type { BoxOptions } from './plots/box';\n// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\n// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu), [visiky](https://github.com/visiky)\nexport { Chord } from './plots/chord';\nexport type { ChordOptions } from './plots/chord';\n// circle-packing 及类型定义 | author by [visiky](https://github.com/visiky), [Angeli](https://github.com/Angelii)\nexport { CirclePacking } from './plots/circle-packing';\nexport type { CirclePackingOptions } from './plots/circle-packing';\n// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\n// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1), [visiky](https://github.com/visiky)\nexport { Histogram } from './plots/histogram';\nexport type { HistogramOptions } from './plots/histogram';\n// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { addWaterWave, Liquid } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n// 已经废弃,更名为 Mix\nexport { Mix as Mix, Mix as MultiView } from './plots/mix';\nexport type { MixOptions, MixOptions as MultiViewOptions } from './plots/mix';\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\n// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)\nexport { RadialBar } from './plots/radial-bar';\nexport type { RadialBarOptions } from './plots/radial-bar';\n// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\n// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong), [visiky](https://github.com/visiky)\nexport { Stock } from './plots/stock';\nexport type { StockOptions } from './plots/stock';\n// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\n// 小提琴图及类型定义 | author by [YiSiWang](https://github.com/YiSiWang), [visiky](https://github.com/visiky)\nexport { Violin } from './plots/violin';\nexport type { ViolinOptions } from './plots/violin';\n// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n// 类型定义导出\nexport * from './types';\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\nexport { G2 };\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrG,QAAQ;AACR,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,0CAA0C;AAC1C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAWpF,WAAW;AACX,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,uBAAuB;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,oDAAoD;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,2DAA2D;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,yDAAyD;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa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AAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,CAAC;AACd,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,8BAA8B;AAC9B,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAEtC,MAAM,CAAC,IAAM,QAAQ,GAAG,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,WAAW,aAAA,EAAE,KAAK,OAAA,EAAE,SAAS,WAAA,EAAE,CAAC","sourcesContent":["export const version = '2.4.28';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { animation, annotation, interaction, legend, scale, theme, tooltip } from './adaptor/common';\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { area, interval, line, point, polygon, schema } from './adaptor/geometries';\nexport type {\n AreaGeometryOptions,\n IntervalGeometryOptions,\n LineGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\n// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ), [visiky](https://github.com/visiky)\nexport { Box } from './plots/box';\nexport type { BoxOptions } from './plots/box';\n// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\n// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu), [visiky](https://github.com/visiky)\nexport { Chord } from './plots/chord';\nexport type { ChordOptions } from './plots/chord';\n// circle-packing 及类型定义 | author by [visiky](https://github.com/visiky), [Angeli](https://github.com/Angelii)\nexport { CirclePacking } from './plots/circle-packing';\nexport type { CirclePackingOptions } from './plots/circle-packing';\n// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\n// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1), [visiky](https://github.com/visiky)\nexport { Histogram } from './plots/histogram';\nexport type { HistogramOptions } from './plots/histogram';\n// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { addWaterWave, Liquid } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n// 已经废弃,更名为 Mix\nexport { Mix as Mix, Mix as MultiView } from './plots/mix';\nexport type { MixOptions, MixOptions as MultiViewOptions } from './plots/mix';\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\n// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)\nexport { RadialBar } from './plots/radial-bar';\nexport type { RadialBarOptions } from './plots/radial-bar';\n// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\n// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong), [visiky](https://github.com/visiky)\nexport { Stock } from './plots/stock';\nexport type { StockOptions } from './plots/stock';\n// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\n// 小提琴图及类型定义 | author by [YiSiWang](https://github.com/YiSiWang), [visiky](https://github.com/visiky)\nexport { Violin } from './plots/violin';\nexport type { ViolinOptions } from './plots/violin';\n// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n// 类型定义导出\nexport * from './types';\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\nexport { G2 };\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n"]}
@@ -12,7 +12,7 @@ export declare const HIERARCHY_DATA_TRANSFORM_PARAMS = "hierarchy-data-transform
12
12
  /**
13
13
  * Hierarchy plot 节点的数据
14
14
  */
15
- export declare type HierarchyNode<N = any /** 节点 */> = {
15
+ export type HierarchyNode<N = any /** 节点 */> = {
16
16
  /** 节点的原始数据,树型结构(todo 是否更正 key 为 origin) */
17
17
  data: {
18
18
  name: string;
@@ -31,7 +31,7 @@ export declare type HierarchyNode<N = any /** 节点 */> = {
31
31
  parent: N;
32
32
  children: N[];
33
33
  };
34
- declare type HistoryCache = {
34
+ type HistoryCache = {
35
35
  name: string;
36
36
  id: string;
37
37
  children: Data;
@@ -119,7 +119,7 @@ var DrillDownAction = /** @class */ (function (_super) {
119
119
  while (node) {
120
120
  var nodeData = node.data;
121
121
  historyCache.unshift({
122
- id: nodeData.name + "_" + node.height + "_" + node.depth,
122
+ id: "".concat(nodeData.name, "_").concat(node.height, "_").concat(node.depth),
123
123
  name: nodeData.name,
124
124
  // children 是实际数据
125
125
  children: transformData(__assign({ data: nodeData }, nodeInfo[HIERARCHY_DATA_TRANSFORM_PARAMS])),
@@ -188,7 +188,7 @@ var DrillDownAction = /** @class */ (function (_super) {
188
188
  var textShape = _this.breadCrumbGroup.addShape({
189
189
  type: 'text',
190
190
  id: record.id,
191
- name: BREAD_CRUMB_NAME + "_" + record.name + "_text",
191
+ name: "".concat(BREAD_CRUMB_NAME, "_").concat(record.name, "_text"),
192
192
  attrs: __assign(__assign({ text: index === 0 && !isNil(config.rootText) ? config.rootText : record.name }, config.textStyle), { x: left, y: 0 }),
193
193
  });
194
194
  var textShapeBox = textShape.getBBox();
@@ -220,7 +220,7 @@ var DrillDownAction = /** @class */ (function (_super) {
220
220
  // 添加反斜杠
221
221
  var dividerShape = _this.breadCrumbGroup.addShape({
222
222
  type: 'text',
223
- name: config.name + "_" + record.name + "_divider",
223
+ name: "".concat(config.name, "_").concat(record.name, "_divider"),
224
224
  attrs: __assign(__assign({ text: config.dividerText }, config.textStyle), { x: left, y: 0 }),
225
225
  });
226
226
  var dividerBox = dividerShape.getBBox();
@@ -1 +1 @@
1
- {"version":3,"file":"drill-down.js","sourceRoot":"","sources":["../../../src/interactions/actions/drill-down.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAU,IAAI,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,oBAAoB;AACpB,IAAM,OAAO,GAAG,CAAC,CAAC;AAClB,eAAe;AACf,IAAM,YAAY,GAAG,CAAC,CAAC;AACvB,iBAAiB;AACjB,MAAM,CAAC,IAAM,WAAW,GAAG,CAAC,CAAC;AAE7B,oCAAoC;AACpC,MAAM,CAAC,IAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAExD,UAAU;AACV,MAAM,CAAC,IAAM,0BAA0B,GAA+B;IACpE,gBAAgB;IAChB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,SAAS;KAClB;IACD,eAAe,EAAE;QACf,IAAI,EAAE,SAAS;KAChB;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,+BAA+B,GAAG,iCAAiC,CAAC;AAwBjF;;;;;GAKG;AACH;IAAqC,mCAAM;IAA3C;QAAA,qEA6OC;QA5OC,kBAAkB;QACX,UAAI,GAAG,YAAY,CAAC;QAE3B,WAAW;QACD,kBAAY,GAAiB,EAAE,CAAC;QAC1C,YAAY;QACJ,qBAAe,GAAW,IAAI,CAAC;QACvC,UAAU;QACF,mBAAa,GAA+B,0BAA0B,CAAC;;IAoOjF,CAAC;IAlOC;;OAEG;IACI,+BAAK,GAAZ;QACE,IAAM,IAAI,GAAG,GAAG,CA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K,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC5B,QAAQ;gBACR,IAAM,YAAY,GAAG,KAAI,CAAC,eAAe,CAAC,QAAQ,CAAC;oBACjD,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAK,MAAM,CAAC,IAAI,SAAI,MAAM,CAAC,IAAI,aAAU;oBAC7C,KAAK,sBACH,IAAI,EAAE,MAAM,CAAC,WAAW,IACrB,MAAM,CAAC,SAAS,KACnB,CAAC,EAAE,IAAI,EACP,CAAC,EAAE,CAAC,GACL;iBACF,CAAC,CAAC;gBAEH,IAAM,UAAU,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC;gBAC1C,IAAI,IAAI,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC;aACpC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,wCAAc,GAAtB;QACE,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;SAC7B;IACH,CAAC;IAED;;;OAGG;IACI,iCAAO,GAAd;QACE,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;SAC/B;QACD,iBAAM,OAAO,WAAE,CAAC;IAClB,CAAC;IACH,sBAAC;AAAD,CAAC,AA7OD,CAAqC,MAAM,GA6O1C","sourcesContent":["import { Action, IGroup, Util } from '@antv/g2';\nimport { get, isNil, last, size } from '@antv/util';\nimport { Data } from '../../types';\nimport { DrillDownCfg } from '../../types/drill-down';\nimport { deepAssign } from '../../utils/deep-assign';\n\n// 面包屑文字和分割符'/'之间的距离\nconst PADDING = 4;\n// 面包屑位置距离树图的距离\nconst PADDING_LEFT = 0;\n// 面包屑位置距离树图的顶部距离\nexport const PADDING_TOP = 5;\n\n/** Group name of breadCrumb: 面包屑 */\nexport const BREAD_CRUMB_NAME = 'drilldown-bread-crumb';\n\n// 面包屑默认配置\nexport const DEFAULT_BREAD_CRUMB_CONFIG: DrillDownCfg['breadCrumb'] = {\n /** 位置,默认:左上角 */\n position: 'top-left',\n dividerText: '/',\n textStyle: {\n fontSize: 12,\n fill: 'rgba(0, 0, 0, 0.65)',\n cursor: 'pointer',\n },\n activeTextStyle: {\n fill: '#87B5FF',\n },\n};\n\n/**\n * hierarchy 数据转换的参数\n */\nexport const HIERARCHY_DATA_TRANSFORM_PARAMS = 'hierarchy-data-transform-params';\n\n/**\n * Hierarchy plot 节点的数据\n */\nexport type HierarchyNode<N = any /** 节点 */> = {\n /** 节点的原始数据,树型结构(todo 是否更正 key 为 origin) */\n data: { name: string; value?: any; children: { name: string; value?: any }[] };\n /** 在构建节点数据时候,增加的扩展配置, 用于存储 transformData 的入参配置 */\n [HIERARCHY_DATA_TRANSFORM_PARAMS]: object;\n /** 当前的层级结构,每一次下钻都会更新. 不是 unique */\n depth: number;\n /** 当前所处高度,depth + height = 总的层级 */\n height: number;\n parent: N;\n children: N[];\n};\n\ntype HistoryCache = {\n name: string;\n id: string;\n children: Data;\n}[];\n\n/**\n * @description 下钻交互的 action\n * @author liuzhenying\n *\n * 适用于:hierarchy plot\n */\nexport class DrillDownAction extends Action {\n /** Action name */\n public name = 'drill-down';\n\n // 存储历史下钻数据\n protected historyCache: HistoryCache = [];\n // 面包屑 group\n private breadCrumbGroup: IGroup = null;\n // 面包屑基础配置\n private breadCrumbCfg: DrillDownCfg['breadCrumb'] = DEFAULT_BREAD_CRUMB_CONFIG;\n\n /**\n * 点击事件, 下钻数据,并绘制面包屑\n */\n public click() {\n const data = get(this.context, ['event', 'data', 'data']);\n if (!data) return false;\n\n this.drill(data);\n this.drawBreadCrumb();\n }\n\n /**\n * 重置位置,初始化及触发 chart afterchangesize 回调时使用\n */\n public resetPosition() {\n // 当在第一层级未绘制面包屑,此时 changedata 触发 resetPosition 函数,需判断 this.breadCrumbGroup 是否存在\n if (!this.breadCrumbGroup) return;\n const coordinate = this.context.view.getCoordinate();\n const breadCrumbGroup = this.breadCrumbGroup;\n const bbox = breadCrumbGroup.getBBox();\n\n const { position } = this.getButtonCfg();\n\n // @todo 后续抽取一个函数来处理,以及增加 margin 或者 padding 的设置\n // 非 polar 的,需要使用 coordinate,除却图表组件\n let point = { x: coordinate.start.x, y: coordinate.end.y - (bbox.height + PADDING_TOP * 2) };\n if (coordinate.isPolar) {\n // 默认,左上角直接出发\n point = { x: 0, y: 0 };\n }\n if (position === 'bottom-left') {\n // 涉及到坐标反转的问题\n point = { x: coordinate.start.x, y: coordinate.start.y };\n }\n /** PADDING_LEFT, PADDING_TOP 与画布边缘的距离 */\n const matrix = Util.transform(null, [['t', point.x + PADDING_LEFT, point.y + bbox.height + PADDING_TOP]]);\n breadCrumbGroup.setMatrix(matrix);\n }\n\n /**\n * 返回上一层\n */\n public back(): void {\n if (size(this.historyCache)) {\n this.backTo(this.historyCache.slice(0, -1));\n }\n }\n\n /**\n * 重置\n */\n public reset(): void {\n if (this.historyCache[0]) {\n this.backTo(this.historyCache.slice(0, 1));\n }\n // 清空\n this.historyCache = [];\n this.hideCrumbGroup();\n }\n\n /**\n * 下钻数据并更新 view 显示层\n * @param nodeInfo 下钻数据\n */\n protected drill(nodeInfo: HierarchyNode) {\n const { view } = this.context;\n const transformData = get(view, ['interactions', 'drill-down', 'cfg', 'transformData'], (v) => v);\n\n // 重新 update 数据\n const drillData = transformData({ data: nodeInfo.data, ...nodeInfo[HIERARCHY_DATA_TRANSFORM_PARAMS] });\n view.changeData(drillData);\n\n // 存储历史记录\n const historyCache: HistoryCache = [];\n\n let node = nodeInfo;\n while (node) {\n const nodeData = node.data;\n historyCache.unshift({\n id: `${nodeData.name}_${node.height}_${node.depth}`,\n name: nodeData.name,\n // children 是实际数据\n children: transformData({ data: nodeData, ...nodeInfo[HIERARCHY_DATA_TRANSFORM_PARAMS] }),\n });\n node = node.parent;\n }\n\n this.historyCache = (this.historyCache || []).slice(0, -1).concat(historyCache);\n }\n\n /**\n * 回退事件,点击面包屑时触发\n * @param historyCache 当前要回退到的历史\n */\n protected backTo(historyCache: HistoryCache) {\n if (!historyCache || historyCache.length <= 0) {\n return;\n }\n\n const { view } = this.context;\n const data = last(historyCache).children; // 处理后的数组\n view.changeData(data);\n\n if (historyCache.length > 1) {\n this.historyCache = historyCache;\n this.drawBreadCrumb();\n } else {\n // 清空\n this.historyCache = [];\n this.hideCrumbGroup();\n }\n }\n\n /**\n * 获取 mix 默认的配置和用户配置\n */\n private getButtonCfg() {\n const { view } = this.context;\n const drillDownConfig: DrillDownCfg = get(view, ['interactions', 'drill-down', 'cfg', 'drillDownConfig']);\n\n return deepAssign(this.breadCrumbCfg, drillDownConfig?.breadCrumb, this.cfg);\n }\n\n /**\n * 显示面包屑\n */\n private drawBreadCrumb() {\n this.drawBreadCrumbGroup();\n this.resetPosition();\n this.breadCrumbGroup.show();\n }\n\n /**\n * 绘制 Button 和 文本\n */\n private drawBreadCrumbGroup() {\n const config = this.getButtonCfg();\n const cache = this.historyCache;\n\n // 初始化面包屑 group\n if (!this.breadCrumbGroup) {\n this.breadCrumbGroup = this.context.view.foregroundGroup.addGroup({\n name: BREAD_CRUMB_NAME,\n });\n } else {\n this.breadCrumbGroup.clear();\n }\n\n // 绘制面包屑\n let left = 0;\n cache.forEach((record, index) => {\n // 添加文本\n const textShape = this.breadCrumbGroup.addShape({\n type: 'text',\n id: record.id,\n name: `${BREAD_CRUMB_NAME}_${record.name}_text`,\n attrs: {\n text: index === 0 && !isNil(config.rootText) ? config.rootText : record.name,\n ...config.textStyle,\n x: left,\n y: 0,\n },\n });\n\n const textShapeBox = textShape.getBBox();\n left += textShapeBox.width + PADDING;\n\n // 增加文本事件\n textShape.on('click', (event) => {\n const targetId = event.target.get('id');\n if (targetId !== last(cache)?.id) {\n const newHistoryCache = cache.slice(0, cache.findIndex((d) => d.id === targetId) + 1);\n this.backTo(newHistoryCache);\n }\n });\n // active 效果内置\n textShape.on('mouseenter', (event) => {\n const targetId = event.target.get('id');\n if (targetId !== last(cache)?.id) {\n textShape.attr(config.activeTextStyle);\n } else {\n textShape.attr({ cursor: 'default' });\n }\n });\n textShape.on('mouseleave', () => {\n textShape.attr(config.textStyle);\n });\n\n if (index < cache.length - 1) {\n // 添加反斜杠\n const dividerShape = this.breadCrumbGroup.addShape({\n type: 'text',\n name: `${config.name}_${record.name}_divider`,\n attrs: {\n text: config.dividerText,\n ...config.textStyle,\n x: left,\n y: 0,\n },\n });\n\n const dividerBox = dividerShape.getBBox();\n left += dividerBox.width + PADDING;\n }\n });\n }\n\n /**\n * 隐藏面包屑\n */\n private hideCrumbGroup() {\n if (this.breadCrumbGroup) {\n this.breadCrumbGroup.hide();\n }\n }\n\n /**\n * @override\n * destroy: 销毁资源\n */\n public destroy() {\n if (this.breadCrumbGroup) {\n this.breadCrumbGroup.remove();\n }\n super.destroy();\n }\n}\n"]}
1
+ {"version":3,"file":"drill-down.js","sourceRoot":"","sources":["../../../src/interactions/actions/drill-down.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAU,IAAI,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,oBAAoB;AACpB,IAAM,OAAO,GAAG,CAAC,CAAC;AAClB,eAAe;AACf,IAAM,YAAY,GAAG,CAAC,CAAC;AACvB,iBAAiB;AACjB,MAAM,CAAC,IAAM,WAAW,GAAG,CAAC,CAAC;AAE7B,oCAAoC;AACpC,MAAM,CAAC,IAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAExD,UAAU;AACV,MAAM,CAAC,IAAM,0BAA0B,GAA+B;IACpE,gBAAgB;IAChB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,SAAS;KAClB;IACD,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C/B;QACD,iBAAM,OAAO,WAAE,CAAC;IAClB,CAAC;IACH,sBAAC;AAAD,CAAC,AA7OD,CAAqC,MAAM,GA6O1C","sourcesContent":["import { Action, IGroup, Util } from '@antv/g2';\nimport { get, isNil, last, size } from '@antv/util';\nimport { Data } from '../../types';\nimport { DrillDownCfg } from '../../types/drill-down';\nimport { deepAssign } from '../../utils/deep-assign';\n\n// 面包屑文字和分割符'/'之间的距离\nconst PADDING = 4;\n// 面包屑位置距离树图的距离\nconst PADDING_LEFT = 0;\n// 面包屑位置距离树图的顶部距离\nexport const PADDING_TOP = 5;\n\n/** Group name of breadCrumb: 面包屑 */\nexport const BREAD_CRUMB_NAME = 'drilldown-bread-crumb';\n\n// 面包屑默认配置\nexport const DEFAULT_BREAD_CRUMB_CONFIG: DrillDownCfg['breadCrumb'] = {\n /** 位置,默认:左上角 */\n position: 'top-left',\n dividerText: '/',\n textStyle: {\n fontSize: 12,\n fill: 'rgba(0, 0, 0, 0.65)',\n cursor: 'pointer',\n },\n activeTextStyle: {\n fill: '#87B5FF',\n },\n};\n\n/**\n * hierarchy 数据转换的参数\n */\nexport const HIERARCHY_DATA_TRANSFORM_PARAMS = 'hierarchy-data-transform-params';\n\n/**\n * Hierarchy plot 节点的数据\n */\nexport type HierarchyNode<N = any /** 节点 */> = {\n /** 节点的原始数据,树型结构(todo 是否更正 key 为 origin) */\n data: { name: string; value?: any; children: { name: string; value?: any }[] };\n /** 在构建节点数据时候,增加的扩展配置, 用于存储 transformData 的入参配置 */\n [HIERARCHY_DATA_TRANSFORM_PARAMS]: object;\n /** 当前的层级结构,每一次下钻都会更新. 不是 unique */\n depth: number;\n /** 当前所处高度,depth + height = 总的层级 */\n height: number;\n parent: N;\n children: N[];\n};\n\ntype HistoryCache = {\n name: string;\n id: string;\n children: Data;\n}[];\n\n/**\n * @description 下钻交互的 action\n * @author liuzhenying\n *\n * 适用于:hierarchy plot\n */\nexport class DrillDownAction extends Action {\n /** Action name */\n public name = 'drill-down';\n\n // 存储历史下钻数据\n protected historyCache: HistoryCache = [];\n // 面包屑 group\n private breadCrumbGroup: IGroup = null;\n // 面包屑基础配置\n private breadCrumbCfg: DrillDownCfg['breadCrumb'] = DEFAULT_BREAD_CRUMB_CONFIG;\n\n /**\n * 点击事件, 下钻数据,并绘制面包屑\n */\n public click() {\n const data = get(this.context, ['event', 'data', 'data']);\n if (!data) return false;\n\n this.drill(data);\n this.drawBreadCrumb();\n }\n\n /**\n * 重置位置,初始化及触发 chart afterchangesize 回调时使用\n */\n public resetPosition() {\n // 当在第一层级未绘制面包屑,此时 changedata 触发 resetPosition 函数,需判断 this.breadCrumbGroup 是否存在\n if (!this.breadCrumbGroup) return;\n const coordinate = this.context.view.getCoordinate();\n const breadCrumbGroup = this.breadCrumbGroup;\n const bbox = breadCrumbGroup.getBBox();\n\n const { position } = this.getButtonCfg();\n\n // @todo 后续抽取一个函数来处理,以及增加 margin 或者 padding 的设置\n // 非 polar 的,需要使用 coordinate,除却图表组件\n let point = { x: coordinate.start.x, y: coordinate.end.y - (bbox.height + PADDING_TOP * 2) };\n if (coordinate.isPolar) {\n // 默认,左上角直接出发\n point = { x: 0, y: 0 };\n }\n if (position === 'bottom-left') {\n // 涉及到坐标反转的问题\n point = { x: coordinate.start.x, y: coordinate.start.y };\n }\n /** PADDING_LEFT, PADDING_TOP 与画布边缘的距离 */\n const matrix = Util.transform(null, [['t', point.x + PADDING_LEFT, point.y + bbox.height + PADDING_TOP]]);\n breadCrumbGroup.setMatrix(matrix);\n }\n\n /**\n * 返回上一层\n */\n public back(): void {\n if (size(this.historyCache)) {\n this.backTo(this.historyCache.slice(0, -1));\n }\n }\n\n /**\n * 重置\n */\n public reset(): void {\n if (this.historyCache[0]) {\n this.backTo(this.historyCache.slice(0, 1));\n }\n // 清空\n this.historyCache = [];\n this.hideCrumbGroup();\n }\n\n /**\n * 下钻数据并更新 view 显示层\n * @param nodeInfo 下钻数据\n */\n protected drill(nodeInfo: HierarchyNode) {\n const { view } = this.context;\n const transformData = get(view, ['interactions', 'drill-down', 'cfg', 'transformData'], (v) => v);\n\n // 重新 update 数据\n const drillData = transformData({ data: nodeInfo.data, ...nodeInfo[HIERARCHY_DATA_TRANSFORM_PARAMS] });\n view.changeData(drillData);\n\n // 存储历史记录\n const historyCache: HistoryCache = [];\n\n let node = nodeInfo;\n while (node) {\n const nodeData = node.data;\n historyCache.unshift({\n id: `${nodeData.name}_${node.height}_${node.depth}`,\n name: nodeData.name,\n // children 是实际数据\n children: transformData({ data: nodeData, ...nodeInfo[HIERARCHY_DATA_TRANSFORM_PARAMS] }),\n });\n node = node.parent;\n }\n\n this.historyCache = (this.historyCache || []).slice(0, -1).concat(historyCache);\n }\n\n /**\n * 回退事件,点击面包屑时触发\n * @param historyCache 当前要回退到的历史\n */\n protected backTo(historyCache: HistoryCache) {\n if (!historyCache || historyCache.length <= 0) {\n return;\n }\n\n const { view } = this.context;\n const data = last(historyCache).children; // 处理后的数组\n view.changeData(data);\n\n if (historyCache.length > 1) {\n this.historyCache = historyCache;\n this.drawBreadCrumb();\n } else {\n // 清空\n this.historyCache = [];\n this.hideCrumbGroup();\n }\n }\n\n /**\n * 获取 mix 默认的配置和用户配置\n */\n private getButtonCfg() {\n const { view } = this.context;\n const drillDownConfig: DrillDownCfg = get(view, ['interactions', 'drill-down', 'cfg', 'drillDownConfig']);\n\n return deepAssign(this.breadCrumbCfg, drillDownConfig?.breadCrumb, this.cfg);\n }\n\n /**\n * 显示面包屑\n */\n private drawBreadCrumb() {\n this.drawBreadCrumbGroup();\n this.resetPosition();\n this.breadCrumbGroup.show();\n }\n\n /**\n * 绘制 Button 和 文本\n */\n private drawBreadCrumbGroup() {\n const config = this.getButtonCfg();\n const cache = this.historyCache;\n\n // 初始化面包屑 group\n if (!this.breadCrumbGroup) {\n this.breadCrumbGroup = this.context.view.foregroundGroup.addGroup({\n name: BREAD_CRUMB_NAME,\n });\n } else {\n this.breadCrumbGroup.clear();\n }\n\n // 绘制面包屑\n let left = 0;\n cache.forEach((record, index) => {\n // 添加文本\n const textShape = this.breadCrumbGroup.addShape({\n type: 'text',\n id: record.id,\n name: `${BREAD_CRUMB_NAME}_${record.name}_text`,\n attrs: {\n text: index === 0 && !isNil(config.rootText) ? config.rootText : record.name,\n ...config.textStyle,\n x: left,\n y: 0,\n },\n });\n\n const textShapeBox = textShape.getBBox();\n left += textShapeBox.width + PADDING;\n\n // 增加文本事件\n textShape.on('click', (event) => {\n const targetId = event.target.get('id');\n if (targetId !== last(cache)?.id) {\n const newHistoryCache = cache.slice(0, cache.findIndex((d) => d.id === targetId) + 1);\n this.backTo(newHistoryCache);\n }\n });\n // active 效果内置\n textShape.on('mouseenter', (event) => {\n const targetId = event.target.get('id');\n if (targetId !== last(cache)?.id) {\n textShape.attr(config.activeTextStyle);\n } else {\n textShape.attr({ cursor: 'default' });\n }\n });\n textShape.on('mouseleave', () => {\n textShape.attr(config.textStyle);\n });\n\n if (index < cache.length - 1) {\n // 添加反斜杠\n const dividerShape = this.breadCrumbGroup.addShape({\n type: 'text',\n name: `${config.name}_${record.name}_divider`,\n attrs: {\n text: config.dividerText,\n ...config.textStyle,\n x: left,\n y: 0,\n },\n });\n\n const dividerBox = dividerShape.getBBox();\n left += dividerBox.width + PADDING;\n }\n });\n }\n\n /**\n * 隐藏面包屑\n */\n private hideCrumbGroup() {\n if (this.breadCrumbGroup) {\n this.breadCrumbGroup.hide();\n }\n }\n\n /**\n * @override\n * destroy: 销毁资源\n */\n public destroy() {\n if (this.breadCrumbGroup) {\n this.breadCrumbGroup.remove();\n }\n super.destroy();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"reset-button.js","sourceRoot":"","sources":["../../../src/interactions/actions/reset-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAU,IAAI,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,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X;QACE,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;SACzB;IACH,CAAC;IAED;;OAEG;IACI,8BAAO,GAAd;QACE,IAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,IAAI,WAAW,EAAE;YACf,WAAW,CAAC,MAAM,EAAE,CAAC;SACtB;QACD,iBAAM,OAAO,WAAE,CAAC;IAClB,CAAC;IACH,mBAAC;AAAD,CAAC,AAtHD,CAA2B,MAAM,GAsHhC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { Action, IGroup, Util } from '@antv/g2';\nimport { get } from '@antv/util';\nimport { BBox, ButtonCfg } from '../../types';\nimport { deepAssign, normalPadding } from '../../utils';\n\nconst PADDING_RIGHT = 10;\nconst PADDING_TOP = 5;\n\n/**\n * Action 中的 Button 按钮配置\n *\n * 可能的使用场景:brush filter\n */\nexport const BUTTON_ACTION_CONFIG: ButtonCfg = {\n padding: [8, 10],\n text: 'reset',\n textStyle: {\n default: {\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#333333',\n cursor: 'pointer',\n },\n },\n buttonStyle: {\n default: {\n fill: '#f7f7f7',\n stroke: '#cccccc',\n cursor: 'pointer',\n },\n active: {\n fill: '#e6e6e6',\n },\n },\n};\n\n/**\n * @override 复写 G2 Button Action, 后续直接使用 GUI\n */\nclass ButtonAction extends Action {\n private buttonGroup: IGroup = null;\n private buttonCfg = {\n name: 'button',\n ...BUTTON_ACTION_CONFIG,\n };\n\n /**\n * 获取 mix 默认的配置和用户配置\n */\n private getButtonCfg(): ButtonCfg & { name: string } {\n const { view } = this.context;\n const buttonCfg: ButtonCfg = get(view, ['interactions', 'filter-action', 'cfg', 'buttonConfig']);\n\n return deepAssign(this.buttonCfg, buttonCfg, this.cfg);\n }\n\n /**\n * 绘制 Button 和 文本\n */\n private drawButton() {\n const config = this.getButtonCfg();\n const group = this.context.view.foregroundGroup.addGroup({\n name: config.name,\n });\n const textShape = this.drawText(group);\n this.drawBackground(group, textShape.getBBox());\n\n this.buttonGroup = group;\n }\n\n /**\n * 绘制文本\n */\n private drawText(group: IGroup) {\n const config = this.getButtonCfg();\n // 添加文本\n return group.addShape({\n type: 'text',\n name: 'button-text',\n attrs: {\n text: config.text,\n ...config.textStyle?.default,\n },\n });\n }\n\n private drawBackground(group: IGroup, bbox: BBox) {\n const config = this.getButtonCfg();\n const padding = normalPadding(config.padding);\n // 添加背景按钮\n const buttonShape = group.addShape({\n type: 'rect',\n name: 'button-rect',\n attrs: {\n x: bbox.x - padding[3],\n y: bbox.y - padding[0],\n width: bbox.width + padding[1] + padding[3],\n height: bbox.height + padding[0] + padding[2],\n ...config.buttonStyle?.default,\n },\n });\n buttonShape.toBack(); // 在后面\n\n // active 效果内置\n group.on('mouseenter', () => {\n buttonShape.attr(config.buttonStyle?.active);\n });\n group.on('mouseleave', () => {\n buttonShape.attr(config.buttonStyle?.default);\n });\n\n return buttonShape;\n }\n\n // 重置位置\n private resetPosition() {\n const view = this.context.view;\n const coord = view.getCoordinate();\n const point = coord.convert({ x: 1, y: 1 }); // 后面直接改成左上角\n const buttonGroup = this.buttonGroup;\n const bbox = buttonGroup.getBBox();\n const matrix = Util.transform(null, [\n ['t', point.x - bbox.width - PADDING_RIGHT, point.y + bbox.height + PADDING_TOP],\n ]);\n buttonGroup.setMatrix(matrix);\n }\n\n /**\n * 显示\n */\n public show() {\n if (!this.buttonGroup) {\n this.drawButton();\n }\n this.resetPosition();\n this.buttonGroup.show();\n }\n\n /**\n * 隐藏\n */\n public hide() {\n if (this.buttonGroup) {\n this.buttonGroup.hide();\n }\n }\n\n /**\n * 销毁\n */\n public destroy() {\n const buttonGroup = this.buttonGroup;\n if (buttonGroup) {\n buttonGroup.remove();\n }\n super.destroy();\n }\n}\n\nexport { ButtonAction };\n"]}
1
+ {"version":3,"file":"reset-button.js","sourceRoot":"","sources":["../../../src/interactions/actions/reset-button.ts"],"names":[],"mappings":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AAC,WAAW,EAAE;YACrB,IAAI,CAAC,UAAU,EAAE,CAAC;SACnB;QACD,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,2BAAI,GAAX;QACE,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;SACzB;IACH,CAAC;IAED;;OAEG;IACI,8BAAO,GAAd;QACE,IAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,IAAI,WAAW,EAAE;YACf,WAAW,CAAC,MAAM,EAAE,CAAC;SACtB;QACD,iBAAM,OAAO,WAAE,CAAC;IAClB,CAAC;IACH,mBAAC;AAAD,CAAC,AAtHD,CAA2B,MAAM,GAsHhC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { Action, IGroup, Util } from '@antv/g2';\nimport { get } from '@antv/util';\nimport { BBox, ButtonCfg } from '../../types';\nimport { deepAssign, normalPadding } from '../../utils';\n\nconst PADDING_RIGHT = 10;\nconst PADDING_TOP = 5;\n\n/**\n * Action 中的 Button 按钮配置\n *\n * 可能的使用场景:brush filter\n */\nexport const BUTTON_ACTION_CONFIG: ButtonCfg = {\n padding: [8, 10],\n text: 'reset',\n textStyle: {\n default: {\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#333333',\n cursor: 'pointer',\n },\n },\n buttonStyle: {\n default: {\n fill: '#f7f7f7',\n stroke: '#cccccc',\n cursor: 'pointer',\n },\n active: {\n fill: '#e6e6e6',\n },\n },\n};\n\n/**\n * @override 复写 G2 Button Action, 后续直接使用 GUI\n */\nclass ButtonAction extends Action {\n private buttonGroup: IGroup = null;\n private buttonCfg = {\n name: 'button',\n ...BUTTON_ACTION_CONFIG,\n };\n\n /**\n * 获取 mix 默认的配置和用户配置\n */\n private getButtonCfg(): ButtonCfg & { name: string } {\n const { view } = this.context;\n const buttonCfg: ButtonCfg = get(view, ['interactions', 'filter-action', 'cfg', 'buttonConfig']);\n\n return deepAssign(this.buttonCfg, buttonCfg, this.cfg);\n }\n\n /**\n * 绘制 Button 和 文本\n */\n private drawButton() {\n const config = this.getButtonCfg();\n const group = this.context.view.foregroundGroup.addGroup({\n name: config.name,\n });\n const textShape = this.drawText(group);\n this.drawBackground(group, textShape.getBBox());\n\n this.buttonGroup = group;\n }\n\n /**\n * 绘制文本\n */\n private drawText(group: IGroup) {\n const config = this.getButtonCfg();\n // 添加文本\n return group.addShape({\n type: 'text',\n name: 'button-text',\n attrs: {\n text: config.text,\n ...config.textStyle?.default,\n },\n });\n }\n\n private drawBackground(group: IGroup, bbox: BBox) {\n const config = this.getButtonCfg();\n const padding = normalPadding(config.padding);\n // 添加背景按钮\n const buttonShape = group.addShape({\n type: 'rect',\n name: 'button-rect',\n attrs: {\n x: bbox.x - padding[3],\n y: bbox.y - padding[0],\n width: bbox.width + padding[1] + padding[3],\n height: bbox.height + padding[0] + padding[2],\n ...config.buttonStyle?.default,\n },\n });\n buttonShape.toBack(); // 在后面\n\n // active 效果内置\n group.on('mouseenter', () => {\n buttonShape.attr(config.buttonStyle?.active);\n });\n group.on('mouseleave', () => {\n buttonShape.attr(config.buttonStyle?.default);\n });\n\n return buttonShape;\n }\n\n // 重置位置\n private resetPosition() {\n const view = this.context.view;\n const coord = view.getCoordinate();\n const point = coord.convert({ x: 1, y: 1 }); // 后面直接改成左上角\n const buttonGroup = this.buttonGroup;\n const bbox = buttonGroup.getBBox();\n const matrix = Util.transform(null, [\n ['t', point.x - bbox.width - PADDING_RIGHT, point.y + bbox.height + PADDING_TOP],\n ]);\n buttonGroup.setMatrix(matrix);\n }\n\n /**\n * 显示\n */\n public show() {\n if (!this.buttonGroup) {\n this.drawButton();\n }\n this.resetPosition();\n this.buttonGroup.show();\n }\n\n /**\n * 隐藏\n */\n public hide() {\n if (this.buttonGroup) {\n this.buttonGroup.hide();\n }\n }\n\n /**\n * 销毁\n */\n public destroy() {\n const buttonGroup = this.buttonGroup;\n if (buttonGroup) {\n buttonGroup.remove();\n }\n super.destroy();\n }\n}\n\nexport { ButtonAction };\n"]}
@@ -13,7 +13,7 @@ export declare function getInteractionCfg(interactionType: string, brushType?: s
13
13
  showEnable: ({
14
14
  trigger: string;
15
15
  action: string;
16
- isEnable: ((context: any) => boolean) | (() => true);
16
+ isEnable: (context: any) => boolean;
17
17
  } | {
18
18
  trigger: string;
19
19
  action: string;
@@ -45,7 +45,7 @@ export declare function getInteractionCfg(interactionType: string, brushType?: s
45
45
  showEnable: ({
46
46
  trigger: string;
47
47
  action: string;
48
- isEnable: ((context: any) => boolean) | (() => true);
48
+ isEnable: (context: any) => boolean;
49
49
  } | {
50
50
  trigger: string;
51
51
  action: string;
@@ -30,7 +30,7 @@ export function getInteractionCfg(interactionType, brushType, options) {
30
30
  {
31
31
  trigger: 'mousedown',
32
32
  isEnable: isStartEnable || isPointInView,
33
- action: ['brush:start', maskType + "-mask:start", maskType + "-mask:show"],
33
+ action: ['brush:start', "".concat(maskType, "-mask:start"), "".concat(maskType, "-mask:show")],
34
34
  // 对应第二个action的参数
35
35
  arg: [null, { maskStyle: mask === null || mask === void 0 ? void 0 : mask.style }],
36
36
  },
@@ -39,7 +39,7 @@ export function getInteractionCfg(interactionType, brushType, options) {
39
39
  {
40
40
  trigger: 'mousemove',
41
41
  isEnable: isPointInView,
42
- action: [maskType + "-mask:resize"],
42
+ action: ["".concat(maskType, "-mask:resize")],
43
43
  },
44
44
  ],
45
45
  end: [
@@ -49,8 +49,8 @@ export function getInteractionCfg(interactionType, brushType, options) {
49
49
  action: [
50
50
  'brush:filter',
51
51
  'brush:end',
52
- maskType + "-mask:end",
53
- maskType + "-mask:hide",
52
+ "".concat(maskType, "-mask:end"),
53
+ "".concat(maskType, "-mask:hide"),
54
54
  'brush-reset-button:show',
55
55
  ],
56
56
  },
@@ -84,23 +84,23 @@ export function getInteractionCfg(interactionType, brushType, options) {
84
84
  // 不要点击在 mask 上重新开始
85
85
  return !context.isInShape('mask');
86
86
  }),
87
- action: [maskType + "-mask:start", maskType + "-mask:show"],
87
+ action: ["".concat(maskType, "-mask:start"), "".concat(maskType, "-mask:show")],
88
88
  // 对应第 1 个action的参数
89
89
  arg: [{ maskStyle: mask === null || mask === void 0 ? void 0 : mask.style }],
90
90
  },
91
91
  {
92
92
  trigger: 'mask:dragstart',
93
- action: [maskType + "-mask:moveStart"],
93
+ action: ["".concat(maskType, "-mask:moveStart")],
94
94
  },
95
95
  ],
96
96
  processing: [
97
97
  {
98
98
  trigger: 'plot:mousemove',
99
- action: [maskType + "-mask:resize"],
99
+ action: ["".concat(maskType, "-mask:resize")],
100
100
  },
101
101
  {
102
102
  trigger: 'mask:drag',
103
- action: [maskType + "-mask:move"],
103
+ action: ["".concat(maskType, "-mask:move")],
104
104
  },
105
105
  {
106
106
  trigger: 'mask:change',
@@ -108,17 +108,17 @@ export function getInteractionCfg(interactionType, brushType, options) {
108
108
  },
109
109
  ],
110
110
  end: [
111
- { trigger: 'plot:mouseup', action: [maskType + "-mask:end"] },
112
- { trigger: 'mask:dragend', action: [maskType + "-mask:moveEnd"] },
111
+ { trigger: 'plot:mouseup', action: ["".concat(maskType, "-mask:end")] },
112
+ { trigger: 'mask:dragend', action: ["".concat(maskType, "-mask:moveEnd")] },
113
113
  {
114
114
  trigger: 'document:mouseup',
115
115
  isEnable: function (context) {
116
116
  return !context.isInPlot();
117
117
  },
118
- action: ['element-range-highlight:clear', maskType + "-mask:end", maskType + "-mask:hide"],
118
+ action: ['element-range-highlight:clear', "".concat(maskType, "-mask:end"), "".concat(maskType, "-mask:hide")],
119
119
  },
120
120
  ],
121
- rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', maskType + "-mask:hide"] }],
121
+ rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', "".concat(maskType, "-mask:hide")] }],
122
122
  };
123
123
  case 'brush-x':
124
124
  return {
@@ -130,7 +130,7 @@ export function getInteractionCfg(interactionType, brushType, options) {
130
130
  {
131
131
  trigger: 'mousedown',
132
132
  isEnable: isStartEnable || isPointInView,
133
- action: ['brush-x:start', maskType + "-mask:start", maskType + "-mask:show"],
133
+ action: ['brush-x:start', "".concat(maskType, "-mask:start"), "".concat(maskType, "-mask:show")],
134
134
  // 对应第二个action的参数
135
135
  arg: [null, { maskStyle: mask === null || mask === void 0 ? void 0 : mask.style }],
136
136
  },
@@ -139,14 +139,14 @@ export function getInteractionCfg(interactionType, brushType, options) {
139
139
  {
140
140
  trigger: 'mousemove',
141
141
  isEnable: isPointInView,
142
- action: [maskType + "-mask:resize"],
142
+ action: ["".concat(maskType, "-mask:resize")],
143
143
  },
144
144
  ],
145
145
  end: [
146
146
  {
147
147
  trigger: 'mouseup',
148
148
  isEnable: isPointInView,
149
- action: ['brush-x:filter', 'brush-x:end', maskType + "-mask:end", maskType + "-mask:hide"],
149
+ action: ['brush-x:filter', 'brush-x:end', "".concat(maskType, "-mask:end"), "".concat(maskType, "-mask:hide")],
150
150
  },
151
151
  ],
152
152
  rollback: [{ trigger: 'dblclick', action: ['brush-x:reset'] }],
@@ -167,23 +167,23 @@ export function getInteractionCfg(interactionType, brushType, options) {
167
167
  // 不要点击在 mask 上重新开始
168
168
  return !context.isInShape('mask');
169
169
  }),
170
- action: [maskType + "-mask:start", maskType + "-mask:show"],
170
+ action: ["".concat(maskType, "-mask:start"), "".concat(maskType, "-mask:show")],
171
171
  // 对应第 1 个action的参数
172
172
  arg: [{ maskStyle: mask === null || mask === void 0 ? void 0 : mask.style }],
173
173
  },
174
174
  {
175
175
  trigger: 'mask:dragstart',
176
- action: [maskType + "-mask:moveStart"],
176
+ action: ["".concat(maskType, "-mask:moveStart")],
177
177
  },
178
178
  ],
179
179
  processing: [
180
180
  {
181
181
  trigger: 'plot:mousemove',
182
- action: [maskType + "-mask:resize"],
182
+ action: ["".concat(maskType, "-mask:resize")],
183
183
  },
184
184
  {
185
185
  trigger: 'mask:drag',
186
- action: [maskType + "-mask:move"],
186
+ action: ["".concat(maskType, "-mask:move")],
187
187
  },
188
188
  {
189
189
  trigger: 'mask:change',
@@ -191,17 +191,17 @@ export function getInteractionCfg(interactionType, brushType, options) {
191
191
  },
192
192
  ],
193
193
  end: [
194
- { trigger: 'plot:mouseup', action: [maskType + "-mask:end"] },
195
- { trigger: 'mask:dragend', action: [maskType + "-mask:moveEnd"] },
194
+ { trigger: 'plot:mouseup', action: ["".concat(maskType, "-mask:end")] },
195
+ { trigger: 'mask:dragend', action: ["".concat(maskType, "-mask:moveEnd")] },
196
196
  {
197
197
  trigger: 'document:mouseup',
198
198
  isEnable: function (context) {
199
199
  return !context.isInPlot();
200
200
  },
201
- action: ['element-range-highlight:clear', maskType + "-mask:end", maskType + "-mask:hide"],
201
+ action: ['element-range-highlight:clear', "".concat(maskType, "-mask:end"), "".concat(maskType, "-mask:hide")],
202
202
  },
203
203
  ],
204
- rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', maskType + "-mask:hide"] }],
204
+ rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', "".concat(maskType, "-mask:hide")] }],
205
205
  };
206
206
  case 'brush-y':
207
207
  return {
@@ -213,7 +213,7 @@ export function getInteractionCfg(interactionType, brushType, options) {
213
213
  {
214
214
  trigger: 'mousedown',
215
215
  isEnable: isStartEnable || isPointInView,
216
- action: ['brush-y:start', maskType + "-mask:start", maskType + "-mask:show"],
216
+ action: ['brush-y:start', "".concat(maskType, "-mask:start"), "".concat(maskType, "-mask:show")],
217
217
  // 对应第二个action的参数
218
218
  arg: [null, { maskStyle: mask === null || mask === void 0 ? void 0 : mask.style }],
219
219
  },
@@ -222,14 +222,14 @@ export function getInteractionCfg(interactionType, brushType, options) {
222
222
  {
223
223
  trigger: 'mousemove',
224
224
  isEnable: isPointInView,
225
- action: [maskType + "-mask:resize"],
225
+ action: ["".concat(maskType, "-mask:resize")],
226
226
  },
227
227
  ],
228
228
  end: [
229
229
  {
230
230
  trigger: 'mouseup',
231
231
  isEnable: isPointInView,
232
- action: ['brush-y:filter', 'brush-y:end', maskType + "-mask:end", maskType + "-mask:hide"],
232
+ action: ['brush-y:filter', 'brush-y:end', "".concat(maskType, "-mask:end"), "".concat(maskType, "-mask:hide")],
233
233
  },
234
234
  ],
235
235
  rollback: [{ trigger: 'dblclick', action: ['brush-y:reset'] }],
@@ -250,23 +250,23 @@ export function getInteractionCfg(interactionType, brushType, options) {
250
250
  // 不要点击在 mask 上重新开始
251
251
  return !context.isInShape('mask');
252
252
  }),
253
- action: [maskType + "-mask:start", maskType + "-mask:show"],
253
+ action: ["".concat(maskType, "-mask:start"), "".concat(maskType, "-mask:show")],
254
254
  // 对应第 1 个action的参数
255
255
  arg: [{ maskStyle: mask === null || mask === void 0 ? void 0 : mask.style }],
256
256
  },
257
257
  {
258
258
  trigger: 'mask:dragstart',
259
- action: [maskType + "-mask:moveStart"],
259
+ action: ["".concat(maskType, "-mask:moveStart")],
260
260
  },
261
261
  ],
262
262
  processing: [
263
263
  {
264
264
  trigger: 'plot:mousemove',
265
- action: [maskType + "-mask:resize"],
265
+ action: ["".concat(maskType, "-mask:resize")],
266
266
  },
267
267
  {
268
268
  trigger: 'mask:drag',
269
- action: [maskType + "-mask:move"],
269
+ action: ["".concat(maskType, "-mask:move")],
270
270
  },
271
271
  {
272
272
  trigger: 'mask:change',
@@ -274,17 +274,17 @@ export function getInteractionCfg(interactionType, brushType, options) {
274
274
  },
275
275
  ],
276
276
  end: [
277
- { trigger: 'plot:mouseup', action: [maskType + "-mask:end"] },
278
- { trigger: 'mask:dragend', action: [maskType + "-mask:moveEnd"] },
277
+ { trigger: 'plot:mouseup', action: ["".concat(maskType, "-mask:end")] },
278
+ { trigger: 'mask:dragend', action: ["".concat(maskType, "-mask:moveEnd")] },
279
279
  {
280
280
  trigger: 'document:mouseup',
281
281
  isEnable: function (context) {
282
282
  return !context.isInPlot();
283
283
  },
284
- action: ['element-range-highlight:clear', maskType + "-mask:end", maskType + "-mask:hide"],
284
+ action: ['element-range-highlight:clear', "".concat(maskType, "-mask:end"), "".concat(maskType, "-mask:hide")],
285
285
  },
286
286
  ],
287
- rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', maskType + "-mask:hide"] }],
287
+ rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', "".concat(maskType, "-mask:hide")] }],
288
288
  };
289
289
  default:
290
290
  return {};
@@ -1 +1 @@
1
- {"version":3,"file":"brush.js","sourceRoot":"","sources":["../../src/interactions/brush.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,cAAc,CAAC,oBAAoB,EAAE,YAAY,EAAE;IACjD,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAC;AAEH,mBAAmB,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;AAEzC;;;;;GAKG;AAEH,SAAS,aAAa,CAAC,OAAO;IAC5B,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,eAAuB,EAAE,SAAkB,EAAE,OAAkB;IACzF,IAAA,KAA0B,OAAO,IAAI,EAAE,EAArC,IAAI,UAAA,EAAE,aAAa,mBAAkB,CAAC;IAC9C,IAAM,QAAQ,GAAG,SAAS,IAAI,MAAM,CAAC;IAErC,QAAQ,eAAe,EAAE;QACvB,KAAK,OAAO;YACV,OAAO;gBACL,UAAU,EAAE;oBACV,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,aAAa,IAAI,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC,EAAE;oBACnG,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,gBAAgB,EAAE;iBACzD;gBACD,KAAK,EAAE;oBACL;wBACE,OAAO,EAAE,WAAW;wBACpB,QA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,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AACvE,aAAa;AACb,mBAAmB,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC3F,aAAa;AACb,mBAAmB,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC,CAAC","sourcesContent":["import { registerAction, registerInteraction } from '@antv/g2';\nimport { BrushCfg } from '../types';\nimport { ButtonAction } from './actions/reset-button';\n\nregisterAction('brush-reset-button', ButtonAction, {\n name: 'brush-reset-button',\n});\n\nregisterInteraction('filter-action', {});\n\n/**\n * G2 已经内置了 brush、brush-x、brush-y 等交互,其它:\n *\n * 1. element-range-highlight 是否可用重命名为 brush-highlight?(mask 可以移动)\n * 2. brush-visible 与 brush 的区别是?\n */\n\nfunction isPointInView(context) {\n return context.isInPlot();\n}\n\n/**\n * 获取 交互 start 阶段的相关配置\n */\nexport function getInteractionCfg(interactionType: string, brushType?: string, options?: BrushCfg) {\n const { mask, isStartEnable } = options || {};\n const maskType = brushType || 'rect';\n\n switch (interactionType) {\n case 'brush':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n ],\n start: [\n {\n trigger: 'mousedown',\n isEnable: isStartEnable || isPointInView,\n action: ['brush:start', `${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第二个action的参数\n arg: [null, { maskStyle: mask?.style }],\n },\n ],\n processing: [\n {\n trigger: 'mousemove',\n isEnable: isPointInView,\n action: [`${maskType}-mask:resize`],\n },\n ],\n end: [\n {\n trigger: 'mouseup',\n isEnable: isPointInView,\n action: [\n 'brush:filter',\n 'brush:end',\n `${maskType}-mask:end`,\n `${maskType}-mask:hide`,\n 'brush-reset-button:show',\n ],\n },\n ],\n rollback: [\n {\n trigger: 'brush-reset-button:click',\n action: ['brush:reset', 'brush-reset-button:hide', 'cursor:crosshair'],\n },\n ],\n };\n case 'brush-highlight':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mousemove', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n {\n trigger: 'plot:mousemove',\n action: 'cursor:default',\n isEnable: (context) => (isStartEnable ? !isStartEnable(context) : false),\n },\n { trigger: 'mask:mouseenter', action: 'cursor:move', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n { trigger: 'mask:mouseleave', action: 'cursor:crosshair' },\n ],\n start: [\n {\n trigger: 'plot:mousedown',\n isEnable:\n isStartEnable ||\n ((context) => {\n // 不要点击在 mask 上重新开始\n return !context.isInShape('mask');\n }),\n action: [`${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第 1 个action的参数\n arg: [{ maskStyle: mask?.style }],\n },\n {\n trigger: 'mask:dragstart',\n action: [`${maskType}-mask:moveStart`],\n },\n ],\n processing: [\n {\n trigger: 'plot:mousemove',\n action: [`${maskType}-mask:resize`],\n },\n {\n trigger: 'mask:drag',\n action: [`${maskType}-mask:move`],\n },\n {\n trigger: 'mask:change',\n action: ['element-range-highlight:highlight'],\n },\n ],\n end: [\n { trigger: 'plot:mouseup', action: [`${maskType}-mask:end`] },\n { trigger: 'mask:dragend', action: [`${maskType}-mask:moveEnd`] },\n {\n trigger: 'document:mouseup',\n isEnable(context) {\n return !context.isInPlot();\n },\n action: ['element-range-highlight:clear', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', `${maskType}-mask:hide`] }],\n };\n case 'brush-x':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n ],\n start: [\n {\n trigger: 'mousedown',\n isEnable: isStartEnable || isPointInView,\n action: ['brush-x:start', `${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第二个action的参数\n arg: [null, { maskStyle: mask?.style }],\n },\n ],\n processing: [\n {\n trigger: 'mousemove',\n isEnable: isPointInView,\n action: [`${maskType}-mask:resize`],\n },\n ],\n end: [\n {\n trigger: 'mouseup',\n isEnable: isPointInView,\n action: ['brush-x:filter', 'brush-x:end', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['brush-x:reset'] }],\n };\n case 'brush-x-highlight':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'mask:mouseenter', action: 'cursor:move', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n { trigger: 'mask:mouseleave', action: 'cursor:crosshair' },\n ],\n start: [\n {\n trigger: 'plot:mousedown',\n isEnable:\n isStartEnable ||\n ((context) => {\n // 不要点击在 mask 上重新开始\n return !context.isInShape('mask');\n }),\n action: [`${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第 1 个action的参数\n arg: [{ maskStyle: mask?.style }],\n },\n {\n trigger: 'mask:dragstart',\n action: [`${maskType}-mask:moveStart`],\n },\n ],\n processing: [\n {\n trigger: 'plot:mousemove',\n action: [`${maskType}-mask:resize`],\n },\n {\n trigger: 'mask:drag',\n action: [`${maskType}-mask:move`],\n },\n {\n trigger: 'mask:change',\n action: ['element-range-highlight:highlight'],\n },\n ],\n end: [\n { trigger: 'plot:mouseup', action: [`${maskType}-mask:end`] },\n { trigger: 'mask:dragend', action: [`${maskType}-mask:moveEnd`] },\n {\n trigger: 'document:mouseup',\n isEnable(context) {\n return !context.isInPlot();\n },\n action: ['element-range-highlight:clear', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', `${maskType}-mask:hide`] }],\n };\n case 'brush-y':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n ],\n start: [\n {\n trigger: 'mousedown',\n isEnable: isStartEnable || isPointInView,\n action: ['brush-y:start', `${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第二个action的参数\n arg: [null, { maskStyle: mask?.style }],\n },\n ],\n processing: [\n {\n trigger: 'mousemove',\n isEnable: isPointInView,\n action: [`${maskType}-mask:resize`],\n },\n ],\n end: [\n {\n trigger: 'mouseup',\n isEnable: isPointInView,\n action: ['brush-y:filter', 'brush-y:end', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['brush-y:reset'] }],\n };\n case 'brush-y-highlight':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'mask:mouseenter', action: 'cursor:move', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n { trigger: 'mask:mouseleave', action: 'cursor:crosshair' },\n ],\n start: [\n {\n trigger: 'plot:mousedown',\n isEnable:\n isStartEnable ||\n ((context) => {\n // 不要点击在 mask 上重新开始\n return !context.isInShape('mask');\n }),\n action: [`${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第 1 个action的参数\n arg: [{ maskStyle: mask?.style }],\n },\n {\n trigger: 'mask:dragstart',\n action: [`${maskType}-mask:moveStart`],\n },\n ],\n processing: [\n {\n trigger: 'plot:mousemove',\n action: [`${maskType}-mask:resize`],\n },\n {\n trigger: 'mask:drag',\n action: [`${maskType}-mask:move`],\n },\n {\n trigger: 'mask:change',\n action: ['element-range-highlight:highlight'],\n },\n ],\n end: [\n { trigger: 'plot:mouseup', action: [`${maskType}-mask:end`] },\n { trigger: 'mask:dragend', action: [`${maskType}-mask:moveEnd`] },\n {\n trigger: 'document:mouseup',\n isEnable(context) {\n return !context.isInPlot();\n },\n action: ['element-range-highlight:clear', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', `${maskType}-mask:hide`] }],\n };\n\n default:\n return {};\n }\n}\n\n// 直接拷贝过来的\nregisterInteraction('brush', getInteractionCfg('brush'));\n// 复写 element-range-highlight interaction\nregisterInteraction('brush-highlight', getInteractionCfg('brush-highlight'));\n// 复写\nregisterInteraction('brush-x', getInteractionCfg('brush-x', 'x-rect'));\n// 复写\nregisterInteraction('brush-y', getInteractionCfg('brush-y', 'y-rect'));\n// 新增, x 框选高亮\nregisterInteraction('brush-x-highlight', getInteractionCfg('brush-x-highlight', 'x-rect'));\n// 新增, y 框选高亮\nregisterInteraction('brush-y-highlight', getInteractionCfg('brush-y-highlight', 'y-rect'));\n"]}
1
+ {"version":3,"file":"brush.js","sourceRoot":"","sources":["../../src/interactions/brush.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,cAAc,CAAC,oBAAoB,EAAE,YAAY,EAAE;IACjD,IAAI,EAAE,oBAAoB;CAC3B,CAAC,CAAC;AAEH,mBAAmB,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;AAEzC;;;;;GAKG;AAEH,SAAS,aAAa,CAAC,OAAO;IAC5B,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,eAAuB,EAAE,SAAkB,EAAE,OAAkB;IACzF,IAAA,KAA0B,OAAO,IAAI,EAAE,EAArC,IAAI,UAAA,EAAE,aAAa,mBAAkB,CAAC;IAC9C,IAAM,QAAQ,GAAG,SAAS,IAAI,MAAM,CAAC;IAErC,QAAQ,eAAe,EA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E,CAAC;wBAC7B,CAAC;wBACD,MAAM,EAAE,CAAC,+BAA+B,EAAE,UAAG,QAAQ,cAAW,EAAE,UAAG,QAAQ,eAAY,CAAC;qBAC3F;iBACF;gBACD,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,+BAA+B,EAAE,UAAG,QAAQ,eAAY,CAAC,EAAE,CAAC;aACxG,CAAC;QAEJ;YACE,OAAO,EAAE,CAAC;KACb;AACH,CAAC;AAED,UAAU;AACV,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;AACzD,yCAAyC;AACzC,mBAAmB,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAC7E,KAAK;AACL,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AACvE,KAAK;AACL,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AACvE,aAAa;AACb,mBAAmB,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC3F,aAAa;AACb,mBAAmB,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC,CAAC","sourcesContent":["import { registerAction, registerInteraction } from '@antv/g2';\nimport { BrushCfg } from '../types';\nimport { ButtonAction } from './actions/reset-button';\n\nregisterAction('brush-reset-button', ButtonAction, {\n name: 'brush-reset-button',\n});\n\nregisterInteraction('filter-action', {});\n\n/**\n * G2 已经内置了 brush、brush-x、brush-y 等交互,其它:\n *\n * 1. element-range-highlight 是否可用重命名为 brush-highlight?(mask 可以移动)\n * 2. brush-visible 与 brush 的区别是?\n */\n\nfunction isPointInView(context) {\n return context.isInPlot();\n}\n\n/**\n * 获取 交互 start 阶段的相关配置\n */\nexport function getInteractionCfg(interactionType: string, brushType?: string, options?: BrushCfg) {\n const { mask, isStartEnable } = options || {};\n const maskType = brushType || 'rect';\n\n switch (interactionType) {\n case 'brush':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n ],\n start: [\n {\n trigger: 'mousedown',\n isEnable: isStartEnable || isPointInView,\n action: ['brush:start', `${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第二个action的参数\n arg: [null, { maskStyle: mask?.style }],\n },\n ],\n processing: [\n {\n trigger: 'mousemove',\n isEnable: isPointInView,\n action: [`${maskType}-mask:resize`],\n },\n ],\n end: [\n {\n trigger: 'mouseup',\n isEnable: isPointInView,\n action: [\n 'brush:filter',\n 'brush:end',\n `${maskType}-mask:end`,\n `${maskType}-mask:hide`,\n 'brush-reset-button:show',\n ],\n },\n ],\n rollback: [\n {\n trigger: 'brush-reset-button:click',\n action: ['brush:reset', 'brush-reset-button:hide', 'cursor:crosshair'],\n },\n ],\n };\n case 'brush-highlight':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mousemove', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n {\n trigger: 'plot:mousemove',\n action: 'cursor:default',\n isEnable: (context) => (isStartEnable ? !isStartEnable(context) : false),\n },\n { trigger: 'mask:mouseenter', action: 'cursor:move', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n { trigger: 'mask:mouseleave', action: 'cursor:crosshair' },\n ],\n start: [\n {\n trigger: 'plot:mousedown',\n isEnable:\n isStartEnable ||\n ((context) => {\n // 不要点击在 mask 上重新开始\n return !context.isInShape('mask');\n }),\n action: [`${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第 1 个action的参数\n arg: [{ maskStyle: mask?.style }],\n },\n {\n trigger: 'mask:dragstart',\n action: [`${maskType}-mask:moveStart`],\n },\n ],\n processing: [\n {\n trigger: 'plot:mousemove',\n action: [`${maskType}-mask:resize`],\n },\n {\n trigger: 'mask:drag',\n action: [`${maskType}-mask:move`],\n },\n {\n trigger: 'mask:change',\n action: ['element-range-highlight:highlight'],\n },\n ],\n end: [\n { trigger: 'plot:mouseup', action: [`${maskType}-mask:end`] },\n { trigger: 'mask:dragend', action: [`${maskType}-mask:moveEnd`] },\n {\n trigger: 'document:mouseup',\n isEnable(context) {\n return !context.isInPlot();\n },\n action: ['element-range-highlight:clear', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', `${maskType}-mask:hide`] }],\n };\n case 'brush-x':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n ],\n start: [\n {\n trigger: 'mousedown',\n isEnable: isStartEnable || isPointInView,\n action: ['brush-x:start', `${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第二个action的参数\n arg: [null, { maskStyle: mask?.style }],\n },\n ],\n processing: [\n {\n trigger: 'mousemove',\n isEnable: isPointInView,\n action: [`${maskType}-mask:resize`],\n },\n ],\n end: [\n {\n trigger: 'mouseup',\n isEnable: isPointInView,\n action: ['brush-x:filter', 'brush-x:end', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['brush-x:reset'] }],\n };\n case 'brush-x-highlight':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'mask:mouseenter', action: 'cursor:move', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n { trigger: 'mask:mouseleave', action: 'cursor:crosshair' },\n ],\n start: [\n {\n trigger: 'plot:mousedown',\n isEnable:\n isStartEnable ||\n ((context) => {\n // 不要点击在 mask 上重新开始\n return !context.isInShape('mask');\n }),\n action: [`${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第 1 个action的参数\n arg: [{ maskStyle: mask?.style }],\n },\n {\n trigger: 'mask:dragstart',\n action: [`${maskType}-mask:moveStart`],\n },\n ],\n processing: [\n {\n trigger: 'plot:mousemove',\n action: [`${maskType}-mask:resize`],\n },\n {\n trigger: 'mask:drag',\n action: [`${maskType}-mask:move`],\n },\n {\n trigger: 'mask:change',\n action: ['element-range-highlight:highlight'],\n },\n ],\n end: [\n { trigger: 'plot:mouseup', action: [`${maskType}-mask:end`] },\n { trigger: 'mask:dragend', action: [`${maskType}-mask:moveEnd`] },\n {\n trigger: 'document:mouseup',\n isEnable(context) {\n return !context.isInPlot();\n },\n action: ['element-range-highlight:clear', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', `${maskType}-mask:hide`] }],\n };\n case 'brush-y':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n ],\n start: [\n {\n trigger: 'mousedown',\n isEnable: isStartEnable || isPointInView,\n action: ['brush-y:start', `${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第二个action的参数\n arg: [null, { maskStyle: mask?.style }],\n },\n ],\n processing: [\n {\n trigger: 'mousemove',\n isEnable: isPointInView,\n action: [`${maskType}-mask:resize`],\n },\n ],\n end: [\n {\n trigger: 'mouseup',\n isEnable: isPointInView,\n action: ['brush-y:filter', 'brush-y:end', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['brush-y:reset'] }],\n };\n case 'brush-y-highlight':\n return {\n showEnable: [\n { trigger: 'plot:mouseenter', action: 'cursor:crosshair', isEnable: isStartEnable || (() => true) },\n { trigger: 'mask:mouseenter', action: 'cursor:move', isEnable: isStartEnable || (() => true) },\n { trigger: 'plot:mouseleave', action: 'cursor:default' },\n { trigger: 'mask:mouseleave', action: 'cursor:crosshair' },\n ],\n start: [\n {\n trigger: 'plot:mousedown',\n isEnable:\n isStartEnable ||\n ((context) => {\n // 不要点击在 mask 上重新开始\n return !context.isInShape('mask');\n }),\n action: [`${maskType}-mask:start`, `${maskType}-mask:show`],\n // 对应第 1 个action的参数\n arg: [{ maskStyle: mask?.style }],\n },\n {\n trigger: 'mask:dragstart',\n action: [`${maskType}-mask:moveStart`],\n },\n ],\n processing: [\n {\n trigger: 'plot:mousemove',\n action: [`${maskType}-mask:resize`],\n },\n {\n trigger: 'mask:drag',\n action: [`${maskType}-mask:move`],\n },\n {\n trigger: 'mask:change',\n action: ['element-range-highlight:highlight'],\n },\n ],\n end: [\n { trigger: 'plot:mouseup', action: [`${maskType}-mask:end`] },\n { trigger: 'mask:dragend', action: [`${maskType}-mask:moveEnd`] },\n {\n trigger: 'document:mouseup',\n isEnable(context) {\n return !context.isInPlot();\n },\n action: ['element-range-highlight:clear', `${maskType}-mask:end`, `${maskType}-mask:hide`],\n },\n ],\n rollback: [{ trigger: 'dblclick', action: ['element-range-highlight:clear', `${maskType}-mask:hide`] }],\n };\n\n default:\n return {};\n }\n}\n\n// 直接拷贝过来的\nregisterInteraction('brush', getInteractionCfg('brush'));\n// 复写 element-range-highlight interaction\nregisterInteraction('brush-highlight', getInteractionCfg('brush-highlight'));\n// 复写\nregisterInteraction('brush-x', getInteractionCfg('brush-x', 'x-rect'));\n// 复写\nregisterInteraction('brush-y', getInteractionCfg('brush-y', 'y-rect'));\n// 新增, x 框选高亮\nregisterInteraction('brush-x-highlight', getInteractionCfg('brush-x-highlight', 'x-rect'));\n// 新增, y 框选高亮\nregisterInteraction('brush-y-highlight', getInteractionCfg('brush-y-highlight', 'y-rect'));\n"]}
package/esm/lab.js CHANGED
@@ -12,11 +12,11 @@ export var Stage;
12
12
  */
13
13
  export function notice(stage, plotType) {
14
14
  console.warn(stage === Stage.DEV
15
- ? "Plot '" + plotType + "' is in DEV stage, just give us issues."
15
+ ? "Plot '".concat(plotType, "' is in DEV stage, just give us issues.")
16
16
  : stage === Stage.BETA
17
- ? "Plot '" + plotType + "' is in BETA stage, DO NOT use it in production env."
17
+ ? "Plot '".concat(plotType, "' is in BETA stage, DO NOT use it in production env.")
18
18
  : stage === Stage.STABLE
19
- ? "Plot '" + plotType + "' is in STABLE stage, import it by \"import { " + plotType + " } from '@antv/g2plot'\"."
19
+ ? "Plot '".concat(plotType, "' is in STABLE stage, import it by \"import { ").concat(plotType, " } from '@antv/g2plot'\".")
20
20
  : 'invalid Stage type.');
21
21
  }
22
22
  /**