@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
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plots/dual-axes/index.ts"],"names":[],"mappings":";;;;AACA,wCAAuC;AACvC,qCAAyC;AACzC,qCAAoC;AAKpC;IAA8B,oCAAqB;IAAnD;QAAA,qEAoBC;QAnBC,gBAAgB;QACT,UAAI,GAAW,WAAW,CAAC;;IAkBpC,CAAC;IAhBC;;OAEG;IACO,oCAAiB,GAA3B;QACE,OAAO,kBAAU,CAAC,EAAE,EAAE,iBAAM,iBAAiB,WAAE,EAAE;YAC/C,KAAK,EAAE,EAAE;YACT,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACO,mCAAgB,GAA1B;QACE,OAAO,iBAAO,CAAC;IACjB,CAAC;IACH,eAAC;AAAD,CAAC,AApBD,CAA8B,WAAI,GAoBjC;AApBY,4BAAQ","sourcesContent":["import { Adaptor } from '../../core/adaptor';\nimport { Plot } from '../../core/plot';\nimport { deepAssign } from '../../utils';\nimport { adaptor } from './adaptor';\nimport { DualAxesOptions } from './types';\n\nexport type { DualAxesOptions };\n\nexport class DualAxes extends Plot<DualAxesOptions> {\n /** 图表类型: 双轴图 */\n public type: string = 'dual-axes';\n\n /**\n * 获取 双轴图 默认配置\n */\n protected getDefaultOptions(): Partial<DualAxesOptions> {\n return deepAssign({}, super.getDefaultOptions(), {\n yAxis: [],\n syncViewPadding: true,\n });\n }\n\n /**\n * 获取双轴图的适配器\n */\n protected getSchemaAdaptor(): Adaptor<DualAxesOptions> {\n return adaptor;\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plots/dual-axes/index.ts"],"names":[],"mappings":";;;;AACA,wCAAuC;AACvC,qCAAyC;AACzC,qCAAoC;AAKpC;IAA8B,oCAAqB;IAAnD;QAAA,qEAoBC;QAnBC,gBAAgB;QACT,UAAI,GAAW,WAAW,CAAC;;IAkBpC,CAAC;IAhBC;;OAEG;IACO,oCAAiB,GAA3B;QACE,OAAO,IAAA,kBAAU,EAAC,EAAE,EAAE,iBAAM,iBAAiB,WAAE,EAAE;YAC/C,KAAK,EAAE,EAAE;YACT,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACO,mCAAgB,GAA1B;QACE,OAAO,iBAAO,CAAC;IACjB,CAAC;IACH,eAAC;AAAD,CAAC,AApBD,CAA8B,WAAI,GAoBjC;AApBY,4BAAQ","sourcesContent":["import { Adaptor } from '../../core/adaptor';\nimport { Plot } from '../../core/plot';\nimport { deepAssign } from '../../utils';\nimport { adaptor } from './adaptor';\nimport { DualAxesOptions } from './types';\n\nexport type { DualAxesOptions };\n\nexport class DualAxes extends Plot<DualAxesOptions> {\n /** 图表类型: 双轴图 */\n public type: string = 'dual-axes';\n\n /**\n * 获取 双轴图 默认配置\n */\n protected getDefaultOptions(): Partial<DualAxesOptions> {\n return deepAssign({}, super.getDefaultOptions(), {\n yAxis: [],\n syncViewPadding: true,\n });\n }\n\n /**\n * 获取双轴图的适配器\n */\n protected getSchemaAdaptor(): Adaptor<DualAxesOptions> {\n return adaptor;\n }\n}\n"]}
@@ -14,7 +14,7 @@ export interface PointConfig {
14
14
  readonly size?: SizeAttr;
15
15
  readonly style?: StyleAttr;
16
16
  }
17
- declare type CommonGeometryOption = {
17
+ type CommonGeometryOption = {
18
18
  /**
19
19
  * @title 图形类型
20
20
  */
@@ -42,10 +42,10 @@ declare type CommonGeometryOption = {
42
42
  */
43
43
  readonly groupField?: string;
44
44
  };
45
- export declare type GeometryLineOption = Pick<LineOptions, 'seriesField' | 'smooth' | 'connectNulls' | 'lineStyle' | 'point' | 'isStack' | 'stepType'> & CommonGeometryOption;
46
- export declare type GeometryColumnOption = Pick<ColumnOptions, 'seriesField' | 'isGroup' | 'isStack' | 'isRange' | 'isPercent' | 'columnWidthRatio' | 'marginRatio' | 'columnStyle' | 'pattern'> & CommonGeometryOption;
47
- export declare type GeometryOption = GeometryColumnOption | GeometryLineOption;
48
- export declare type DualAxesOptions = Omit<Options, 'data' | 'yAxis' | 'color' | 'annotations'> & {
45
+ export type GeometryLineOption = Pick<LineOptions, 'seriesField' | 'smooth' | 'connectNulls' | 'lineStyle' | 'point' | 'isStack' | 'stepType'> & CommonGeometryOption;
46
+ export type GeometryColumnOption = Pick<ColumnOptions, 'seriesField' | 'isGroup' | 'isStack' | 'isRange' | 'isPercent' | 'columnWidthRatio' | 'marginRatio' | 'columnStyle' | 'pattern'> & CommonGeometryOption;
47
+ export type GeometryOption = GeometryColumnOption | GeometryLineOption;
48
+ export type DualAxesOptions = Omit<Options, 'data' | 'yAxis' | 'color' | 'annotations'> & {
49
49
  /**
50
50
  * @title 数据
51
51
  * @description 具体的数据,左右两边的数据
@@ -16,17 +16,17 @@ function drawSingleGeometry(params) {
16
16
  var geometryOption = options.geometryOption;
17
17
  var isStack = geometryOption.isStack, color = geometryOption.color, seriesField = geometryOption.seriesField, groupField = geometryOption.groupField, isGroup = geometryOption.isGroup;
18
18
  var FIELD_KEY = ['xField', 'yField'];
19
- if (option_1.isLine(geometryOption)) {
19
+ if ((0, option_1.isLine)(geometryOption)) {
20
20
  // 绘制线
21
- geometries_1.line(utils_1.deepAssign({}, params, {
22
- options: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, utils_1.pick(options, FIELD_KEY)), geometryOption), { line: {
21
+ (0, geometries_1.line)((0, utils_1.deepAssign)({}, params, {
22
+ options: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, (0, utils_1.pick)(options, FIELD_KEY)), geometryOption), { line: {
23
23
  color: geometryOption.color,
24
24
  style: geometryOption.lineStyle,
25
25
  } }),
26
26
  }));
27
27
  // 绘制点
28
- geometries_1.point(utils_1.deepAssign({}, params, {
29
- options: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, utils_1.pick(options, FIELD_KEY)), geometryOption), { point: geometryOption.point && tslib_1.__assign({ color: color, shape: 'circle' }, geometryOption.point) }),
28
+ (0, geometries_1.point)((0, utils_1.deepAssign)({}, params, {
29
+ options: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, (0, utils_1.pick)(options, FIELD_KEY)), geometryOption), { point: geometryOption.point && tslib_1.__assign({ color: color, shape: 'circle' }, geometryOption.point) }),
30
30
  }));
31
31
  // adjust
32
32
  var adjust_1 = [];
@@ -43,14 +43,14 @@ function drawSingleGeometry(params) {
43
43
  });
44
44
  }
45
45
  if (adjust_1.length) {
46
- util_1.each(chart.geometries, function (g) {
46
+ (0, util_1.each)(chart.geometries, function (g) {
47
47
  g.adjust(adjust_1);
48
48
  });
49
49
  }
50
50
  }
51
- if (option_1.isColumn(geometryOption)) {
52
- adaptor_1.adaptor(utils_1.deepAssign({}, params, {
53
- options: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, utils_1.pick(options, FIELD_KEY)), geometryOption), { widthRatio: geometryOption.columnWidthRatio, interval: tslib_1.__assign(tslib_1.__assign({}, utils_1.pick(geometryOption, ['color'])), { style: geometryOption.columnStyle }) }),
51
+ if ((0, option_1.isColumn)(geometryOption)) {
52
+ (0, adaptor_1.adaptor)((0, utils_1.deepAssign)({}, params, {
53
+ options: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, (0, utils_1.pick)(options, FIELD_KEY)), geometryOption), { widthRatio: geometryOption.columnWidthRatio, interval: tslib_1.__assign(tslib_1.__assign({}, (0, utils_1.pick)(geometryOption, ['color'])), { style: geometryOption.columnStyle }) }),
54
54
  }));
55
55
  }
56
56
  return params;
@@ -1 +1 @@
1
- {"version":3,"file":"geometry.js","sourceRoot":"","sources":["../../../../src/plots/dual-axes/util/geometry.ts"],"names":[],"mappings":";;;;AACA,mCAAkC;AAClC,0DAA0D;AAE1D,wCAAkD;AAClD,gDAAgE;AAEhE,mCAA4C;AAE5C;;;GAGG;AACH,SAAgB,kBAAkB,CAChC,MAAiB;IAET,IAAA,OAAO,GAAY,MAAM,QAAlB,EAAE,KAAK,GAAK,MAAM,MAAX,CAAY;IAC1B,IAAA,cAAc,GAAK,OAAO,eAAZ,CAAa;IAC3B,IAAA,OAAO,GAA8C,cAAc,QAA5D,EAAE,KAAK,GAAuC,cAAc,MAArD,EAAE,WAAW,GAA0B,cAAc,YAAxC,EAAE,UAAU,GAAc,cAAc,WAA5B,EAAE,OAAO,GAAK,cAAc,QAAnB,CAAoB;IAE5E,IAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACvC,IAAI,eAAM,CAAC,cAAc,CAAC,EAAE;QAC1B,MAAM;QACN,iBAAI,CACF,kBAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,yDACF,YAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GACxB,cAAc,KACjB,IAAI,EAAE;oBACJ,KAAK,EAAE,cAAc,CAAC,KAAK;oBAC3B,KAAK,EAAE,cAAc,CAAC,SAAS;iBAChC,GACF;SACF,CAAC,CACH,CAAC;QACF,MAAM;QACN,kBAAK,CACH,kBAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,yDACF,YAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GACxB,cAAc,KACjB,KAAK,EAAE,cAAc,CAAC,KAAK,uBACzB,KAAK,OAAA,EACL,KAAK,EAAE,QAAQ,IACZ,cAAc,CAAC,KAAK,CACxB,GACF;SACF,CAAC,CACH,CAAC;QACF,SAAS;QACT,IAAM,QAAM,GAAG,EAAE,CAAC;QAClB,IAAI,OAAO,EAAE;YACX,QAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,UAAU,IAAI,WAAW;gBAClC,YAAY,EAAE,CAAC;aAChB,CAAC,CAAC;SACJ;QACD,IAAI,OAAO,EAAE;YACX,QAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,OAAO;aACd,CAAC,CAAC;SACJ;QACD,IAAI,QAAM,CAAC,MAAM,EAAE;YACjB,WAAI,CAAC,KAAK,CAAC,UAAU,EAAE,UAAC,CAAW;gBACjC,CAAC,CAAC,MAAM,CAAC,QAAM,CAAC,CAAC;YACnB,CAAC,CAAC,CAAC;SACJ;KACF;IAED,IAAI,iBAAQ,CAAC,cAAc,CAAC,EAAE;QAC5B,iBAAa,CACX,kBAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,yDACF,YAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GACxB,cAAc,KACjB,UAAU,EAAE,cAAc,CAAC,gBAAgB,EAC3C,QAAQ,wCACH,YAAI,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,CAAC,KAClC,KAAK,EAAE,cAAc,CAAC,WAAW,MAEpC;SACF,CAAC,CACH,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA1ED,gDA0EC","sourcesContent":["import { Geometry } from '@antv/g2';\nimport { each } from '@antv/util';\nimport { line, point } from '../../../adaptor/geometries';\nimport { Params } from '../../../core/adaptor';\nimport { deepAssign, pick } from '../../../utils';\nimport { adaptor as columnAdaptor } from '../../column/adaptor';\nimport { GeometryOption } from '../types';\nimport { isColumn, isLine } from './option';\n\n/**\n * 绘制单个图形\n * @param params\n */\nexport function drawSingleGeometry<O extends { xField: string; yField: string; geometryOption: GeometryOption }>(\n params: Params<O>\n): Params<O> {\n const { options, chart } = params;\n const { geometryOption } = options;\n const { isStack, color, seriesField, groupField, isGroup } = geometryOption;\n\n const FIELD_KEY = ['xField', 'yField'];\n if (isLine(geometryOption)) {\n // 绘制线\n line(\n deepAssign({}, params, {\n options: {\n ...pick(options, FIELD_KEY),\n ...geometryOption,\n line: {\n color: geometryOption.color,\n style: geometryOption.lineStyle,\n },\n },\n })\n );\n // 绘制点\n point(\n deepAssign({}, params, {\n options: {\n ...pick(options, FIELD_KEY),\n ...geometryOption,\n point: geometryOption.point && {\n color,\n shape: 'circle',\n ...geometryOption.point,\n },\n },\n })\n );\n // adjust\n const adjust = [];\n if (isGroup) {\n adjust.push({\n type: 'dodge',\n dodgeBy: groupField || seriesField,\n customOffset: 0,\n });\n }\n if (isStack) {\n adjust.push({\n type: 'stack',\n });\n }\n if (adjust.length) {\n each(chart.geometries, (g: Geometry) => {\n g.adjust(adjust);\n });\n }\n }\n\n if (isColumn(geometryOption)) {\n columnAdaptor(\n deepAssign({}, params, {\n options: {\n ...pick(options, FIELD_KEY),\n ...geometryOption,\n widthRatio: geometryOption.columnWidthRatio,\n interval: {\n ...pick(geometryOption, ['color']),\n style: geometryOption.columnStyle,\n },\n },\n })\n );\n }\n\n return params;\n}\n"]}
1
+ {"version":3,"file":"geometry.js","sourceRoot":"","sources":["../../../../src/plots/dual-axes/util/geometry.ts"],"names":[],"mappings":";;;;AACA,mCAAkC;AAClC,0DAA0D;AAE1D,wCAAkD;AAClD,gDAAgE;AAEhE,mCAA4C;AAE5C;;;GAGG;AACH,SAAgB,kBAAkB,CAChC,MAAiB;IAET,IAAA,OAAO,GAAY,MAAM,QAAlB,EAAE,KAAK,GAAK,MAAM,MAAX,C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M,EAAE;YACjB,IAAA,WAAI,EAAC,KAAK,CAAC,UAAU,EAAE,UAAC,CAAW;gBACjC,CAAC,CAAC,MAAM,CAAC,QAAM,CAAC,CAAC;YACnB,CAAC,CAAC,CAAC;SACJ;KACF;IAED,IAAI,IAAA,iBAAQ,EAAC,cAAc,CAAC,EAAE;QAC5B,IAAA,iBAAa,EACX,IAAA,kBAAU,EAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,yDACF,IAAA,YAAI,EAAC,OAAO,EAAE,SAAS,CAAC,GACxB,cAAc,KACjB,UAAU,EAAE,cAAc,CAAC,gBAAgB,EAC3C,QAAQ,wCACH,IAAA,YAAI,EAAC,cAAc,EAAE,CAAC,OAAO,CAAC,CAAC,KAClC,KAAK,EAAE,cAAc,CAAC,WAAW,MAEpC;SACF,CAAC,CACH,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA1ED,gDA0EC","sourcesContent":["import { Geometry } from '@antv/g2';\nimport { each } from '@antv/util';\nimport { line, point } from '../../../adaptor/geometries';\nimport { Params } from '../../../core/adaptor';\nimport { deepAssign, pick } from '../../../utils';\nimport { adaptor as columnAdaptor } from '../../column/adaptor';\nimport { GeometryOption } from '../types';\nimport { isColumn, isLine } from './option';\n\n/**\n * 绘制单个图形\n * @param params\n */\nexport function drawSingleGeometry<O extends { xField: string; yField: string; geometryOption: GeometryOption }>(\n params: Params<O>\n): Params<O> {\n const { options, chart } = params;\n const { geometryOption } = options;\n const { isStack, color, seriesField, groupField, isGroup } = geometryOption;\n\n const FIELD_KEY = ['xField', 'yField'];\n if (isLine(geometryOption)) {\n // 绘制线\n line(\n deepAssign({}, params, {\n options: {\n ...pick(options, FIELD_KEY),\n ...geometryOption,\n line: {\n color: geometryOption.color,\n style: geometryOption.lineStyle,\n },\n },\n })\n );\n // 绘制点\n point(\n deepAssign({}, params, {\n options: {\n ...pick(options, FIELD_KEY),\n ...geometryOption,\n point: geometryOption.point && {\n color,\n shape: 'circle',\n ...geometryOption.point,\n },\n },\n })\n );\n // adjust\n const adjust = [];\n if (isGroup) {\n adjust.push({\n type: 'dodge',\n dodgeBy: groupField || seriesField,\n customOffset: 0,\n });\n }\n if (isStack) {\n adjust.push({\n type: 'stack',\n });\n }\n if (adjust.length) {\n each(chart.geometries, (g: Geometry) => {\n g.adjust(adjust);\n });\n }\n }\n\n if (isColumn(geometryOption)) {\n columnAdaptor(\n deepAssign({}, params, {\n options: {\n ...pick(options, FIELD_KEY),\n ...geometryOption,\n widthRatio: geometryOption.columnWidthRatio,\n interval: {\n ...pick(geometryOption, ['color']),\n style: geometryOption.columnStyle,\n },\n },\n })\n );\n }\n\n return params;\n}\n"]}
@@ -11,26 +11,26 @@ var option_1 = require("./option");
11
11
  */
12
12
  function getViewLegendItems(params) {
13
13
  var view = params.view, geometryOption = params.geometryOption, yField = params.yField, legend = params.legend;
14
- var userMarker = util_1.get(legend, 'marker');
15
- var geometry = utils_1.findGeometry(view, option_1.isLine(geometryOption) ? 'line' : 'interval');
14
+ var userMarker = (0, util_1.get)(legend, 'marker');
15
+ var geometry = (0, utils_1.findGeometry)(view, (0, option_1.isLine)(geometryOption) ? 'line' : 'interval');
16
16
  if (!geometryOption.seriesField) {
17
- var legendItemName = util_1.get(view, "options.scales." + yField + ".alias") || yField;
17
+ var legendItemName = (0, util_1.get)(view, "options.scales.".concat(yField, ".alias")) || yField;
18
18
  // 返回 g2 设置的图例
19
19
  var colorAttribute = geometry.getAttribute('color');
20
20
  var color = view.getTheme().defaultColor;
21
21
  if (colorAttribute) {
22
- color = g2_1.Util.getMappingValue(colorAttribute, legendItemName, util_1.get(colorAttribute, ['values', 0], color));
22
+ color = g2_1.Util.getMappingValue(colorAttribute, legendItemName, (0, util_1.get)(colorAttribute, ['values', 0], color));
23
23
  }
24
- var marker = (util_1.isFunction(userMarker)
24
+ var marker = ((0, util_1.isFunction)(userMarker)
25
25
  ? userMarker
26
- : !util_1.isEmpty(userMarker) &&
27
- utils_1.deepAssign({}, {
26
+ : !(0, util_1.isEmpty)(userMarker) &&
27
+ (0, utils_1.deepAssign)({}, {
28
28
  style: {
29
29
  stroke: color,
30
30
  fill: color,
31
31
  },
32
32
  }, userMarker)) ||
33
- (option_1.isLine(geometryOption)
33
+ ((0, option_1.isLine)(geometryOption)
34
34
  ? {
35
35
  symbol: function (x, y, r) {
36
36
  return [
@@ -61,7 +61,7 @@ function getViewLegendItems(params) {
61
61
  ];
62
62
  }
63
63
  var attributes = geometry.getGroupAttributes();
64
- return util_1.reduce(attributes, function (items, attr) {
64
+ return (0, util_1.reduce)(attributes, function (items, attr) {
65
65
  var attrItems = g2_1.Util.getLegendItems(view, geometry, attr, view.getTheme(), userMarker);
66
66
  return items.concat(attrItems);
67
67
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"legend.js","sourceRoot":"","sources":["../../../../src/plots/dual-axes/util/legend.ts"],"names":[],"mappings":";;;AAAA,+BAAsC;AACtC,mCAA8D;AAE9D,wCAA0D;AAE1D,mCAAkC;AAElC;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,MAKlC;IACS,IAAA,IAAI,GAAqC,MAAM,KAA3C,EAAE,cAAc,GAAqB,MAAM,eAA3B,EAAE,MAAM,GAAa,MAAM,OAAnB,EAAE,MAAM,GAAK,MAAM,OAAX,CAAY;IACxD,IAAM,UAAU,GAAG,UAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEzC,IAAM,QAAQ,GAAG,oBAAY,CAAC,IAAI,EAAE,eAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAClF,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE;QAC/B,IAAM,cAAc,GAAG,UAAG,CAAC,IAAI,EAAE,oBAAkB,MAAM,WAAQ,CAAC,IAAI,MAAM,CAAC;QAC7E,cAAc;QACd,IAAM,cAAc,GAAG,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACtD,IA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,EACV,UAAC,KAAK,EAAE,IAAI;QACV,IAAM,SAAS,GAAG,SAAI,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,UAAU,CAAC,CAAC;QACzF,OAAO,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC,EACD,EAAE,CACH,CAAC;AACJ,CAAC;AAzED,gDAyEC","sourcesContent":["import { Util, View } from '@antv/g2';\nimport { get, isEmpty, isFunction, reduce } from '@antv/util';\nimport { Legend } from '../../../types/legend';\nimport { deepAssign, findGeometry } from '../../../utils';\nimport { GeometryOption } from '../types';\nimport { isLine } from './option';\n\n/**\n * 获取 view 的 legendItem,供存在不含有 seriesField 的图形使用\n * @param params\n */\nexport function getViewLegendItems(params: {\n view: View;\n yField: string;\n geometryOption: GeometryOption;\n legend: Legend;\n}) {\n const { view, geometryOption, yField, legend } = params;\n const userMarker = get(legend, 'marker');\n\n const geometry = findGeometry(view, isLine(geometryOption) ? 'line' : 'interval');\n if (!geometryOption.seriesField) {\n const legendItemName = get(view, `options.scales.${yField}.alias`) || yField;\n // 返回 g2 设置的图例\n const colorAttribute = geometry.getAttribute('color');\n let color = view.getTheme().defaultColor;\n if (colorAttribute) {\n color = Util.getMappingValue(colorAttribute, legendItemName, get(colorAttribute, ['values', 0], color));\n }\n\n const marker =\n (isFunction(userMarker)\n ? userMarker\n : !isEmpty(userMarker) &&\n deepAssign(\n {},\n {\n style: {\n stroke: color,\n fill: color,\n },\n },\n userMarker\n )) ||\n (isLine(geometryOption)\n ? {\n symbol: (x: number, y: number, r: number) => {\n return [\n ['M', x - r, y],\n ['L', x + r, y],\n ];\n },\n style: {\n lineWidth: 2,\n r: 6,\n stroke: color,\n },\n }\n : {\n symbol: 'square',\n style: {\n fill: color,\n },\n });\n return [\n {\n value: yField,\n name: legendItemName,\n marker,\n isGeometry: true,\n viewId: view.id,\n },\n ];\n }\n\n const attributes = geometry.getGroupAttributes();\n return reduce(\n attributes,\n (items, attr) => {\n const attrItems = Util.getLegendItems(view, geometry, attr, view.getTheme(), userMarker);\n return items.concat(attrItems);\n },\n []\n );\n}\n"]}
1
+ {"version":3,"file":"legend.js","sourceRoot":"","sources":["../../../../src/plots/dual-axes/util/legend.ts"],"names":[],"mappings":";;;AAAA,+BAAsC;AACtC,mCAA8D;AAE9D,wCAA0D;AAE1D,mCAAkC;AAElC;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,MAKlC;IACS,IAAA,IAAI,GAAqC,MAAM,KAA3C,EAAE,cAAc,GAAqB,MAAM,eAA3B,EAAE,MAAM,GAAa,MAAM,OAAnB,EAAE,MAAM,GAAK,MAAM,OAAX,CAAY;IACxD,IAAM,UAAU,GAAG,IAAA,UAAG,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEzC,IAAM,QAAQ,GAAG,IAAA,oBAAY,EAAC,IAAI,EAAE,IAAA,eAAM,EAAC,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAClF,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE;QAC/B,IAAM,cAAc,GAAG,IAAA,UAAG,EAAC,IAAI,EAAE,yBAAkB,MAAM,WAAQ,CAAC,IAAI,MAAM,CAAC;QAC7E,cAAc;QACd,IAAM,cAAc,GAAG,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,YAAY,CAAC;QACzC,IAAI,cAAc,EAAE;YAClB,KAAK,GAAG,SAAI,CAAC,eAAe,CAAC,cAAc,EAAE,cAAc,EAAE,IAAA,UAAG,EAAC,cAAc,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;SACzG;QAED,IAAM,MAAM,GACV,CAAC,IAAA,iBAAU,EAAC,UAAU,CAAC;YACrB,CAAC,CAAC,UAAU;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View } from '@antv/g2';\nimport { get, isEmpty, isFunction, reduce } from '@antv/util';\nimport { Legend } from '../../../types/legend';\nimport { deepAssign, findGeometry } from '../../../utils';\nimport { GeometryOption } from '../types';\nimport { isLine } from './option';\n\n/**\n * 获取 view 的 legendItem,供存在不含有 seriesField 的图形使用\n * @param params\n */\nexport function getViewLegendItems(params: {\n view: View;\n yField: string;\n geometryOption: GeometryOption;\n legend: Legend;\n}) {\n const { view, geometryOption, yField, legend } = params;\n const userMarker = get(legend, 'marker');\n\n const geometry = findGeometry(view, isLine(geometryOption) ? 'line' : 'interval');\n if (!geometryOption.seriesField) {\n const legendItemName = get(view, `options.scales.${yField}.alias`) || yField;\n // 返回 g2 设置的图例\n const colorAttribute = geometry.getAttribute('color');\n let color = view.getTheme().defaultColor;\n if (colorAttribute) {\n color = Util.getMappingValue(colorAttribute, legendItemName, get(colorAttribute, ['values', 0], color));\n }\n\n const marker =\n (isFunction(userMarker)\n ? userMarker\n : !isEmpty(userMarker) &&\n deepAssign(\n {},\n {\n style: {\n stroke: color,\n fill: color,\n },\n },\n userMarker\n )) ||\n (isLine(geometryOption)\n ? {\n symbol: (x: number, y: number, r: number) => {\n return [\n ['M', x - r, y],\n ['L', x + r, y],\n ];\n },\n style: {\n lineWidth: 2,\n r: 6,\n stroke: color,\n },\n }\n : {\n symbol: 'square',\n style: {\n fill: color,\n },\n });\n return [\n {\n value: yField,\n name: legendItemName,\n marker,\n isGeometry: true,\n viewId: view.id,\n },\n ];\n }\n\n const attributes = geometry.getGroupAttributes();\n return reduce(\n attributes,\n (items, attr) => {\n const attrItems = Util.getLegendItems(view, geometry, attr, view.getTheme(), userMarker);\n return items.concat(attrItems);\n },\n []\n );\n}\n"]}
@@ -10,14 +10,14 @@ var types_1 = require("../types");
10
10
  * 根据 GeometryOption 判断 geometry 是否为 line
11
11
  */
12
12
  function isLine(geometryOption) {
13
- return util_1.get(geometryOption, 'geometry') === types_1.DualAxesGeometry.Line;
13
+ return (0, util_1.get)(geometryOption, 'geometry') === types_1.DualAxesGeometry.Line;
14
14
  }
15
15
  exports.isLine = isLine;
16
16
  /**
17
17
  * 根据 GeometryOption 判断 geometry 是否为 Column
18
18
  */
19
19
  function isColumn(geometryOption) {
20
- return util_1.get(geometryOption, 'geometry') === types_1.DualAxesGeometry.Column;
20
+ return (0, util_1.get)(geometryOption, 'geometry') === types_1.DualAxesGeometry.Column;
21
21
  }
22
22
  exports.isColumn = isColumn;
23
23
  /**
@@ -28,7 +28,7 @@ exports.isColumn = isColumn;
28
28
  function getGeometryOption(xField, yField, geometryOption) {
29
29
  // 空默认为线
30
30
  return isColumn(geometryOption)
31
- ? utils_1.deepAssign({}, {
31
+ ? (0, utils_1.deepAssign)({}, {
32
32
  geometry: types_1.DualAxesGeometry.Column,
33
33
  label: geometryOption.label && geometryOption.isRange
34
34
  ? {
@@ -50,13 +50,13 @@ exports.getGeometryOption = getGeometryOption;
50
50
  */
51
51
  function transformObjectToArray(yField, transformAttribute) {
52
52
  var y1 = yField[0], y2 = yField[1];
53
- if (util_1.isArray(transformAttribute)) {
53
+ if ((0, util_1.isArray)(transformAttribute)) {
54
54
  // 将数组补齐为两个
55
55
  var a1_1 = transformAttribute[0], a2_1 = transformAttribute[1];
56
56
  return [a1_1, a2_1];
57
57
  }
58
- var a1 = util_1.get(transformAttribute, y1);
59
- var a2 = util_1.get(transformAttribute, y2);
58
+ var a1 = (0, util_1.get)(transformAttribute, y1);
59
+ var a2 = (0, util_1.get)(transformAttribute, y2);
60
60
  return [a1, a2];
61
61
  }
62
62
  exports.transformObjectToArray = transformObjectToArray;
@@ -67,10 +67,10 @@ exports.transformObjectToArray = transformObjectToArray;
67
67
  */
68
68
  function getYAxisWithDefault(yAxis, axisType) {
69
69
  if (axisType === types_1.AxisType.Left) {
70
- return yAxis === false ? false : utils_1.deepAssign({}, constant_1.DEFAULT_LEFT_YAXIS_CONFIG, yAxis);
70
+ return yAxis === false ? false : (0, utils_1.deepAssign)({}, constant_1.DEFAULT_LEFT_YAXIS_CONFIG, yAxis);
71
71
  }
72
72
  else if (axisType === types_1.AxisType.Right) {
73
- return yAxis === false ? false : utils_1.deepAssign({}, constant_1.DEFAULT_RIGHT_YAXIS_CONFIG, yAxis);
73
+ return yAxis === false ? false : (0, utils_1.deepAssign)({}, constant_1.DEFAULT_RIGHT_YAXIS_CONFIG, yAxis);
74
74
  }
75
75
  return yAxis;
76
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"option.js","sourceRoot":"","sources":["../../../../src/plots/dual-axes/util/option.ts"],"names":[],"mappings":";;;;AAAA,mCAA0C;AAE1C,wCAA4C;AAC5C,wCAAoF;AACpF,kCAOkB;AAElB;;GAEG;AACH,SAAgB,MAAM,CAAC,cAA8B;IACnD,OAAO,UAAG,CAAC,cAAc,EAAE,UAAU,CAAC,KAAK,wBAAgB,CAAC,IAAI,CAAC;AACnE,CAAC;AAFD,wBAEC;AAED;;GAEG;AACH,SAAgB,QAAQ,CAAC,cAA8B;IACrD,OAAO,UAAG,CAAC,cAAc,EAAE,UAAU,CAAC,KAAK,wBAAgB,CAAC,MAAM,CAAC;AACrE,CAAC;AAFD,4BAEC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,MAAc,EAAE,MAAc,EAAE,cAA8B;IAC9F,QAAQ;IACR,OAAO,QAAQ,CAAC,cAAc,CAAC;QAC7B,CAAC,CAAC,kBAAU,CACR,EAAE,EACF;YACE,QAAQ,EAAE,wBAAgB,CAAC,MAAM;YACjC,KAAK,EACH,cAAc,CAAC,KAAK,IAAI,cAAc,CAAC,OAAO;gBAC5C,CAAC,CAAC;oBACE,OAAO,EAAE,UAAC,IAAY;;wBACpB,aAAO,IAAI,CAAC,MAAM,CAAC,0CAAE,IAAI,CAAC,GAAG,EAAE;oBACjC,CAAC;iBACF;gBACH,CAAC,CAAC,SAAS;SAChB,EACD,cAAc,CACf;QACH,CAAC,oBACG,QAAQ,EAAE,wBAAgB,CAAC,IAAI,IAC5B,cAAc,CAClB,CAAC;AACR,CAAC;AAtBD,8CAsBC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CACpC,MAAiC,EACjC,kBAA+C;IAExC,IAAA,EAAE,GAAQ,MAAM,GAAd,EAAE,EAAE,GAAI,MAAM,GAAV,CAAW;IAExB,IAAI,cAAO,CAAC,kBAAkB,CAAC,EAAE;QAC/B,WAAW;QACJ,IAAA,IAAE,GAAQ,kBAAkB,GAA1B,EAAE,IAAE,GAAI,kBAAkB,GAAtB,CAAuB;QACpC,OAAO,CAAC,IAAE,EAAE,IAAE,CAAC,CAAC;KACjB;IACD,IAAM,EAAE,GAAG,UAAG,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACvC,IAAM,EAAE,GAAG,UAAG,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAClB,CAAC;AAdD,wDAcC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,KAAW,EAAE,QAAkB;IACjE,IAAI,QAAQ,KAAK,gBAAQ,CAAC,IAAI,EAAE;QAC9B,OAAO,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAU,CAAC,EAAE,EAAE,oCAAyB,EAAE,KAAK,CAAC,CAAC;KACnF;SAAM,IAAI,QAAQ,KAAK,gBAAQ,CAAC,KAAK,EAAE;QACtC,OAAO,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAU,CAAC,EAAE,EAAE,qCAA0B,EAAE,KAAK,CAAC,CAAC;KACpF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAPD,kDAOC","sourcesContent":["import { get, isArray } from '@antv/util';\nimport { Axis } from '../../../types/axis';\nimport { deepAssign } from '../../../utils';\nimport { DEFAULT_LEFT_YAXIS_CONFIG, DEFAULT_RIGHT_YAXIS_CONFIG } from '../constant';\nimport {\n AxisType,\n DualAxesGeometry,\n DualAxesOptions,\n GeometryColumnOption,\n GeometryLineOption,\n GeometryOption,\n} from '../types';\n\n/**\n * 根据 GeometryOption 判断 geometry 是否为 line\n */\nexport function isLine(geometryOption: GeometryOption): geometryOption is GeometryLineOption {\n return get(geometryOption, 'geometry') === DualAxesGeometry.Line;\n}\n\n/**\n * 根据 GeometryOption 判断 geometry 是否为 Column\n */\nexport function isColumn(geometryOption: GeometryOption): geometryOption is GeometryColumnOption {\n return get(geometryOption, 'geometry') === DualAxesGeometry.Column;\n}\n\n/**\n * 获取 GeometryOption\n * @param geometryOption\n * @param axis\n */\nexport function getGeometryOption(xField: string, yField: string, geometryOption: GeometryOption): GeometryOption {\n // 空默认为线\n return isColumn(geometryOption)\n ? deepAssign(\n {},\n {\n geometry: DualAxesGeometry.Column,\n label:\n geometryOption.label && geometryOption.isRange\n ? {\n content: (item: object) => {\n return item[yField]?.join('-');\n },\n }\n : undefined,\n },\n geometryOption\n )\n : {\n geometry: DualAxesGeometry.Line,\n ...geometryOption,\n };\n}\n\n/**\n * 兼容一些属性 为 arr 和 obj 的两种情况, 如 yAxis,annotations\n * 为了防止左右 yField 相同,导致变成 object 之后被覆盖,所以都转变成数组的形式\n * @param yField\n * @param transformAttribute\n */\nexport function transformObjectToArray(\n yField: DualAxesOptions['yField'],\n transformAttribute: Record<string, any> | any[]\n): any[] {\n const [y1, y2] = yField;\n\n if (isArray(transformAttribute)) {\n // 将数组补齐为两个\n const [a1, a2] = transformAttribute;\n return [a1, a2];\n }\n const a1 = get(transformAttribute, y1);\n const a2 = get(transformAttribute, y2);\n return [a1, a2];\n}\n\n/**\n * 获取默认值\n * @param yAxis\n * @param axisType\n */\nexport function getYAxisWithDefault(yAxis: Axis, axisType: AxisType): Axis {\n if (axisType === AxisType.Left) {\n return yAxis === false ? false : deepAssign({}, DEFAULT_LEFT_YAXIS_CONFIG, yAxis);\n } else if (axisType === AxisType.Right) {\n return yAxis === false ? false : deepAssign({}, DEFAULT_RIGHT_YAXIS_CONFIG, yAxis);\n }\n return yAxis;\n}\n"]}
1
+ {"version":3,"file":"option.js","sourceRoot":"","sources":["../../../../src/plots/dual-axes/util/option.ts"],"names":[],"mappings":";;;;AAAA,mCAA0C;AAE1C,wCAA4C;AAC5C,wCAAoF;AACpF,kCAOkB;AAElB;;GAEG;AACH,SAAgB,MAAM,CAAC,cAA8B;IACnD,OAAO,IAAA,UAAG,EAAC,cAAc,EAAE,UAAU,CAAC,KAAK,wBAAgB,CAAC,IAAI,CAAC;AACnE,CAAC;AAFD,wBAEC;AAED;;GAEG;AACH,SAAgB,QAAQ,CAAC,cAA8B;IACrD,OAAO,IAAA,UAAG,EAAC,cAAc,EAAE,UAAU,CAAC,KAAK,wBAAgB,CAAC,MAAM,CAAC;AACrE,CAAC;AAFD,4BAEC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,MAAc,EAAE,MAAc,EAAE,cAA8B;IAC9F,QAAQ;IACR,OAAO,QAAQ,CAAC,cAAc,CAAC;QAC7B,CAAC,CAAC,IAAA,kBAAU,EACR,EAAE,EACF;YACE,QAAQ,EAAE,wBAAgB,CAAC,MAAM;YACjC,KAAK,EACH,cAAc,CAAC,KAAK,IAAI,cAAc,CAAC,OAAO;gBAC5C,CAAC,CAAC;oBACE,OAAO,EAAE,UAAC,IAAY;;wBACpB,OAAO,MAAA,IAAI,CAAC,MAAM,CAAC,0CAAE,IAAI,CAAC,GAAG,CAAC,CAAC;oBACjC,CAAC;iBACF;gBACH,CAAC,CAAC,SAAS;SAChB,EACD,cAAc,CACf;QACH,CAAC,oBACG,QAAQ,EAAE,wBAAgB,CAAC,IAAI,IAC5B,cAAc,CAClB,CAAC;AACR,CAAC;AAtBD,8CAsBC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CACpC,MAAiC,EACjC,kBAA+C;IAExC,IAAA,EAAE,GAAQ,MAAM,GAAd,EAAE,EAAE,GAAI,MAAM,GAAV,CAAW;IAExB,IAAI,IAAA,cAAO,EAAC,kBAAkB,CAAC,EAAE;QAC/B,WAAW;QACJ,IAAA,IAAE,GAAQ,kBAAkB,GAA1B,EAAE,IAAE,GAAI,kBAAkB,GAAtB,CAAuB;QACpC,OAAO,CAAC,IAAE,EAAE,IAAE,CAAC,CAAC;KACjB;IACD,IAAM,EAAE,GAAG,IAAA,UAAG,EAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACvC,IAAM,EAAE,GAAG,IAAA,UAAG,EAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAClB,CAAC;AAdD,wDAcC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,KAAW,EAAE,QAAkB;IACjE,IAAI,QAAQ,KAAK,gBAAQ,CAAC,IAAI,EAAE;QAC9B,OAAO,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,kBAAU,EAAC,EAAE,EAAE,oCAAyB,EAAE,KAAK,CAAC,CAAC;KACnF;SAAM,IAAI,QAAQ,KAAK,gBAAQ,CAAC,KAAK,EAAE;QACtC,OAAO,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,kBAAU,EAAC,EAAE,EAAE,qCAA0B,EAAE,KAAK,CAAC,CAAC;KACpF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAPD,kDAOC","sourcesContent":["import { get, isArray } from '@antv/util';\nimport { Axis } from '../../../types/axis';\nimport { deepAssign } from '../../../utils';\nimport { DEFAULT_LEFT_YAXIS_CONFIG, DEFAULT_RIGHT_YAXIS_CONFIG } from '../constant';\nimport {\n AxisType,\n DualAxesGeometry,\n DualAxesOptions,\n GeometryColumnOption,\n GeometryLineOption,\n GeometryOption,\n} from '../types';\n\n/**\n * 根据 GeometryOption 判断 geometry 是否为 line\n */\nexport function isLine(geometryOption: GeometryOption): geometryOption is GeometryLineOption {\n return get(geometryOption, 'geometry') === DualAxesGeometry.Line;\n}\n\n/**\n * 根据 GeometryOption 判断 geometry 是否为 Column\n */\nexport function isColumn(geometryOption: GeometryOption): geometryOption is GeometryColumnOption {\n return get(geometryOption, 'geometry') === DualAxesGeometry.Column;\n}\n\n/**\n * 获取 GeometryOption\n * @param geometryOption\n * @param axis\n */\nexport function getGeometryOption(xField: string, yField: string, geometryOption: GeometryOption): GeometryOption {\n // 空默认为线\n return isColumn(geometryOption)\n ? deepAssign(\n {},\n {\n geometry: DualAxesGeometry.Column,\n label:\n geometryOption.label && geometryOption.isRange\n ? {\n content: (item: object) => {\n return item[yField]?.join('-');\n },\n }\n : undefined,\n },\n geometryOption\n )\n : {\n geometry: DualAxesGeometry.Line,\n ...geometryOption,\n };\n}\n\n/**\n * 兼容一些属性 为 arr 和 obj 的两种情况, 如 yAxis,annotations\n * 为了防止左右 yField 相同,导致变成 object 之后被覆盖,所以都转变成数组的形式\n * @param yField\n * @param transformAttribute\n */\nexport function transformObjectToArray(\n yField: DualAxesOptions['yField'],\n transformAttribute: Record<string, any> | any[]\n): any[] {\n const [y1, y2] = yField;\n\n if (isArray(transformAttribute)) {\n // 将数组补齐为两个\n const [a1, a2] = transformAttribute;\n return [a1, a2];\n }\n const a1 = get(transformAttribute, y1);\n const a2 = get(transformAttribute, y2);\n return [a1, a2];\n}\n\n/**\n * 获取默认值\n * @param yAxis\n * @param axisType\n */\nexport function getYAxisWithDefault(yAxis: Axis, axisType: AxisType): Axis {\n if (axisType === AxisType.Left) {\n return yAxis === false ? false : deepAssign({}, DEFAULT_LEFT_YAXIS_CONFIG, yAxis);\n } else if (axisType === AxisType.Right) {\n return yAxis === false ? false : deepAssign({}, DEFAULT_RIGHT_YAXIS_CONFIG, yAxis);\n }\n return yAxis;\n}\n"]}
@@ -10,25 +10,26 @@ var utils_1 = require("../../../utils");
10
10
  * @param { number[] } sliderValue 滑块当前值
11
11
  * @returns void
12
12
  */
13
- exports.doSliderFilter = function (view, sliderValue) {
13
+ var doSliderFilter = function (view, sliderValue) {
14
14
  var min = sliderValue[0], max = sliderValue[1];
15
15
  var data = view.getOptions().data;
16
16
  var xScale = view.getXScale();
17
- var dataSize = util_1.size(data);
17
+ var dataSize = (0, util_1.size)(data);
18
18
  if (!xScale || !dataSize) {
19
19
  return;
20
20
  }
21
21
  var isHorizontal = true;
22
- var values = util_1.valuesOfKey(data, xScale.field);
22
+ var values = (0, util_1.valuesOfKey)(data, xScale.field);
23
23
  var xValues = isHorizontal ? values : values.reverse();
24
- var xTickCount = util_1.size(xValues);
24
+ var xTickCount = (0, util_1.size)(xValues);
25
25
  var minIndex = Math.floor(min * (xTickCount - 1));
26
26
  var maxIndex = Math.floor(max * (xTickCount - 1));
27
27
  // 增加 x 轴的过滤器
28
28
  view.filter(xScale.field, function (value) {
29
29
  var idx = xValues.indexOf(value);
30
- return idx > -1 ? utils_1.isBetween(idx, minIndex, maxIndex) : true;
30
+ return idx > -1 ? (0, utils_1.isBetween)(idx, minIndex, maxIndex) : true;
31
31
  });
32
32
  view.getRootView().render(true);
33
33
  };
34
+ exports.doSliderFilter = doSliderFilter;
34
35
  //# sourceMappingURL=render-sider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-sider.js","sourceRoot":"","sources":["../../../../src/plots/dual-axes/util/render-sider.ts"],"names":[],"mappings":";;;AACA,mCAA+C;AAC/C,wCAA2C;AAE3C;;;;;;GAMG;AACU,QAAA,cAAc,GAAG,UAAC,IAAU,EAAE,WAA6B;IAC/D,IAAA,GAAG,GAAS,WAAW,GAApB,EAAE,GAAG,GAAI,WAAW,GAAf,CAAgB;IAC/B,IAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC;IACpC,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IAChC,IAAM,QAAQ,GAAG,WAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE;QACxB,OAAO;KACR;IACD,IAAM,YAAY,GAAG,IAAI,CAAC;IAC1B,IAAM,MAAM,GAAG,kBAAW,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IACzD,IAAM,UAAU,GAAG,WAAI,CAAC,OAAO,CAAC,CAAC;IACjC,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IACpD,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IAEpD,aAAa;IACb,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,UAAC,KAAU;QACnC,IAAM,GAAG,GAAW,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3C,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9D,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import { View } from '@antv/g2';\nimport { size, valuesOfKey } from '@antv/util';\nimport { isBetween } from '../../../utils';\n\n/**\n * 右侧 View 进行 slider 过滤\n * 由于双轴图是多 View , 需要监听左侧 Slider 的 change 事件来同步右侧 View\n * @param { View } view 右侧视图\n * @param { number[] } sliderValue 滑块当前值\n * @returns void\n */\nexport const doSliderFilter = (view: View, sliderValue: [number, number]) => {\n const [min, max] = sliderValue;\n const data = view.getOptions().data;\n const xScale = view.getXScale();\n const dataSize = size(data);\n if (!xScale || !dataSize) {\n return;\n }\n const isHorizontal = true;\n const values = valuesOfKey(data, xScale.field);\n const xValues = isHorizontal ? values : values.reverse();\n const xTickCount = size(xValues);\n const minIndex = Math.floor(min * (xTickCount - 1));\n const maxIndex = Math.floor(max * (xTickCount - 1));\n\n // 增加 x 轴的过滤器\n view.filter(xScale.field, (value: any) => {\n const idx: number = xValues.indexOf(value);\n return idx > -1 ? isBetween(idx, minIndex, maxIndex) : true;\n });\n view.getRootView().render(true);\n};\n"]}
1
+ {"version":3,"file":"render-sider.js","sourceRoot":"","sources":["../../../../src/plots/dual-axes/util/render-sider.ts"],"names":[],"mappings":";;;AACA,mCAA+C;AAC/C,wCAA2C;AAE3C;;;;;;GAMG;AACI,IAAM,cAAc,GAAG,UAAC,IAAU,EAAE,WAA6B;IAC/D,IAAA,GAAG,GAAS,WAAW,GAApB,EAAE,GAAG,GAAI,WAAW,GAAf,CAAgB;IAC/B,IAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC;IACpC,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IAChC,IAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE;QACxB,OAAO;KACR;IACD,IAAM,YAAY,GAAG,IAAI,CAAC;IAC1B,IAAM,MAAM,GAAG,IAAA,kBAAW,EAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IACzD,IAAM,UAAU,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,CAAC;IACjC,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IACpD,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IAEpD,aAAa;IACb,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,UAAC,KAAU;QACnC,IAAM,GAAG,GAAW,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3C,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAS,EAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9D,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC,CAAC;AArBW,QAAA,cAAc,kBAqBzB","sourcesContent":["import { View } from '@antv/g2';\nimport { size, valuesOfKey } from '@antv/util';\nimport { isBetween } from '../../../utils';\n\n/**\n * 右侧 View 进行 slider 过滤\n * 由于双轴图是多 View , 需要监听左侧 Slider 的 change 事件来同步右侧 View\n * @param { View } view 右侧视图\n * @param { number[] } sliderValue 滑块当前值\n * @returns void\n */\nexport const doSliderFilter = (view: View, sliderValue: [number, number]) => {\n const [min, max] = sliderValue;\n const data = view.getOptions().data;\n const xScale = view.getXScale();\n const dataSize = size(data);\n if (!xScale || !dataSize) {\n return;\n }\n const isHorizontal = true;\n const values = valuesOfKey(data, xScale.field);\n const xValues = isHorizontal ? values : values.reverse();\n const xTickCount = size(xValues);\n const minIndex = Math.floor(min * (xTickCount - 1));\n const maxIndex = Math.floor(max * (xTickCount - 1));\n\n // 增加 x 轴的过滤器\n view.filter(xScale.field, (value: any) => {\n const idx: number = xValues.indexOf(value);\n return idx > -1 ? isBetween(idx, minIndex, maxIndex) : true;\n });\n view.getRootView().render(true);\n};\n"]}
@@ -5,4 +5,4 @@ import { FacetOptions } from './types';
5
5
  * @param chart
6
6
  * @param options
7
7
  */
8
- export declare function adaptor(params: Params<FacetOptions>): Params<FacetOptions<"rect" | "circle" | "mirror" | "list" | "matrix" | "tree">>;
8
+ export declare function adaptor(params: Params<FacetOptions>): Params<FacetOptions<keyof import("@antv/g2/lib/interface").FacetCfgMap>>;
@@ -11,7 +11,7 @@ var utils_3 = require("./utils");
11
11
  function facetAdaptor(params) {
12
12
  var chart = params.chart, options = params.options;
13
13
  var facetType = options.type, data = options.data, fields = options.fields, eachView = options.eachView;
14
- var restFacetCfg = util_1.omit(options, [
14
+ var restFacetCfg = (0, util_1.omit)(options, [
15
15
  'type',
16
16
  'data',
17
17
  'fields',
@@ -31,7 +31,7 @@ function facetAdaptor(params) {
31
31
  chart.facet(facetType, tslib_1.__assign(tslib_1.__assign({}, restFacetCfg), { fields: fields, eachView: function (viewOfG2, facet) {
32
32
  var viewOptions = eachView(viewOfG2, facet);
33
33
  if (viewOptions.geometries) {
34
- utils_3.execViewAdaptor(viewOfG2, viewOptions);
34
+ (0, utils_3.execViewAdaptor)(viewOfG2, viewOptions);
35
35
  }
36
36
  else {
37
37
  var plot = viewOptions;
@@ -41,7 +41,7 @@ function facetAdaptor(params) {
41
41
  // 配置 tooltip 交互
42
42
  viewOfG2.interaction('tooltip');
43
43
  }
44
- utils_2.execPlotAdaptor(plot.type, viewOfG2, plotOptions);
44
+ (0, utils_2.execPlotAdaptor)(plot.type, viewOfG2, plotOptions);
45
45
  }
46
46
  } }));
47
47
  return params;
@@ -52,11 +52,11 @@ function component(params) {
52
52
  // 3. meta 配置
53
53
  var scales = {};
54
54
  if (axes) {
55
- util_1.each(axes, function (axis, field) {
56
- scales[field] = utils_1.pick(axis, constant_1.AXIS_META_CONFIG_KEYS);
55
+ (0, util_1.each)(axes, function (axis, field) {
56
+ scales[field] = (0, utils_1.pick)(axis, constant_1.AXIS_META_CONFIG_KEYS);
57
57
  });
58
58
  }
59
- scales = utils_1.deepAssign({}, meta, scales);
59
+ scales = (0, utils_1.deepAssign)({}, meta, scales);
60
60
  chart.scale(scales);
61
61
  // 4. coordinate 配置
62
62
  chart.coordinate(coordinate);
@@ -65,7 +65,7 @@ function component(params) {
65
65
  chart.axis(false);
66
66
  }
67
67
  else {
68
- util_1.each(axes, function (axis, field) {
68
+ (0, util_1.each)(axes, function (axis, field) {
69
69
  chart.axis(field, axis);
70
70
  });
71
71
  }
@@ -84,7 +84,7 @@ function component(params) {
84
84
  chart.theme(theme);
85
85
  }
86
86
  // 8. interactions
87
- util_1.each(interactions, function (interaction) {
87
+ (0, util_1.each)(interactions, function (interaction) {
88
88
  if (interaction.enable === false) {
89
89
  chart.removeInteraction(interaction.type);
90
90
  }
@@ -93,7 +93,7 @@ function component(params) {
93
93
  }
94
94
  });
95
95
  // 9. annotations
96
- util_1.each(annotations, function (annotation) {
96
+ (0, util_1.each)(annotations, function (annotation) {
97
97
  chart.annotation()[annotation.type](tslib_1.__assign({}, annotation));
98
98
  });
99
99
  return params;
@@ -105,7 +105,7 @@ function component(params) {
105
105
  */
106
106
  function adaptor(params) {
107
107
  // flow 的方式处理所有的配置到 G2 API
108
- return utils_1.flow(common_1.theme, facetAdaptor, component)(params);
108
+ return (0, utils_1.flow)(common_1.theme, facetAdaptor, component)(params);
109
109
  }
110
110
  exports.adaptor = adaptor;
111
111
  //# sourceMappingURL=adaptor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/facet/adaptor.ts"],"names":[],"mappings":";;;;AAAA,mCAAwC;AACxC,+CAA6C;AAC7C,2CAAuD;AAGvD,qCAAqD;AACrD,sCAA+C;AAE/C,iCAA0C;AAE1C,SAAS,YAAY,CAAC,MAA4B;IACxC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC1B,IAAM,SAAS,GAA6B,OAAO,KAApC,EAAE,IAAI,GAAuB,OAAO,KAA9B,EAAE,MAAM,GAAe,OAAO,OAAtB,EAAE,QAAQ,GAAK,OAAO,SAAZ,CAAa;IAE5D,IAAM,YAAY,GAAG,WAAI,CAAC,OAAc,EAAE;QACxC,MAAM;QACN,MAAM;QACN,QAAQ;QACR,U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C,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;SACtD;IACH,CAAC,CAAC,CAAC;IAEH,iBAAiB;IACjB,WAAI,CAAC,WAAW,EAAE,UAAC,UAAU;QAC3B,KAAK,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,sBAC9B,UAAU,EACb,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,MAA4B;IAClD,0BAA0B;IAC1B,OAAO,YAAI,CAAC,cAAK,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AACtD,CAAC;AAHD,0BAGC","sourcesContent":["import { each, omit } from '@antv/util';\nimport { theme } from '../../adaptor/common';\nimport { AXIS_META_CONFIG_KEYS } from '../../constant';\nimport { Params } from '../../core/adaptor';\nimport { Axis, Interaction } from '../../types';\nimport { deepAssign, flow, pick } from '../../utils';\nimport { execPlotAdaptor } from '../mix/utils';\nimport { FacetOptions, IPlot, IView } from './types';\nimport { execViewAdaptor } from './utils';\n\nfunction facetAdaptor(params: Params<FacetOptions>): Params<FacetOptions> {\n const { chart, options } = params;\n const { type: facetType, data, fields, eachView } = options;\n\n const restFacetCfg = omit(options as any, [\n 'type',\n 'data',\n 'fields',\n 'eachView',\n 'axes',\n 'meta',\n 'tooltip',\n 'coordinate',\n 'theme',\n 'legend',\n 'interactions',\n 'annotations',\n ]);\n\n // 1. data\n chart.data(data);\n\n // 2. facet\n chart.facet(facetType, {\n ...restFacetCfg,\n fields,\n eachView: (viewOfG2, facet) => {\n const viewOptions = eachView(viewOfG2, facet);\n if ((viewOptions as IView).geometries) {\n execViewAdaptor(viewOfG2, viewOptions as IView);\n } else {\n const plot = viewOptions as IPlot;\n const plotOptions = plot.options;\n // @ts-ignore 仪表盘没 tooltip\n if (plotOptions.tooltip) {\n // 配置 tooltip 交互\n viewOfG2.interaction('tooltip');\n }\n execPlotAdaptor(plot.type, viewOfG2, plotOptions);\n }\n },\n });\n\n return params;\n}\n\nfunction component(params: Params<FacetOptions>): Params<FacetOptions> {\n const { chart, options } = params;\n const { axes, meta, tooltip, coordinate, theme, legend, interactions, annotations } = options;\n\n // 3. meta 配置\n let scales: Record<string, any> = {};\n if (axes) {\n each(axes, (axis: Axis, field: string) => {\n scales[field] = pick(axis, AXIS_META_CONFIG_KEYS);\n });\n }\n\n scales = deepAssign({}, meta, scales);\n chart.scale(scales);\n\n // 4. coordinate 配置\n chart.coordinate(coordinate);\n\n // 5. axis 轴配置 (默认不展示)\n if (!axes) {\n chart.axis(false);\n } else {\n each(axes, (axis: Axis, field: string) => {\n chart.axis(field, axis);\n });\n }\n\n // 6. tooltip 配置\n if (tooltip) {\n chart.interaction('tooltip');\n chart.tooltip(tooltip);\n } else if (tooltip === false) {\n chart.removeInteraction('tooltip');\n }\n\n // 7. legend 配置(默认展示)\n chart.legend(legend);\n\n // theme 配置\n if (theme) {\n chart.theme(theme);\n }\n\n // 8. interactions\n each(interactions, (interaction: Interaction) => {\n if (interaction.enable === false) {\n chart.removeInteraction(interaction.type);\n } else {\n chart.interaction(interaction.type, interaction.cfg);\n }\n });\n\n // 9. annotations\n each(annotations, (annotation) => {\n chart.annotation()[annotation.type]({\n ...annotation,\n });\n });\n\n return params;\n}\n\n/**\n * 分面图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<FacetOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(theme, facetAdaptor, component)(params);\n}\n"]}
1
+ {"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/facet/adaptor.ts"],"names":[],"mappings":";;;;AAAA,mCAAwC;AACxC,+CAA6C;AAC7C,2CAAuD;AAGvD,qCAAqD;AACrD,sCAA+C;AAE/C,iCAA0C;AAE1C,SAAS,YAAY,CAAC,MAA4B;IACxC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC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,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACpB;IAED,kBAAkB;IAClB,IAAA,WAAI,EAAC,YAAY,EAAE,UAAC,WAAwB;QAC1C,IAAI,WAAW,CAAC,MAAM,KAAK,KAAK,EAAE;YAChC,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAC3C;aAAM;YACL,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;SACtD;IACH,CAAC,CAAC,CAAC;IAEH,iBAAiB;IACjB,IAAA,WAAI,EAAC,WAAW,EAAE,UAAC,UAAU;QAC3B,KAAK,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,sBAC9B,UAAU,EACb,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,MAA4B;IAClD,0BAA0B;IAC1B,OAAO,IAAA,YAAI,EAAC,cAAK,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AACtD,CAAC;AAHD,0BAGC","sourcesContent":["import { each, omit } from '@antv/util';\nimport { theme } from '../../adaptor/common';\nimport { AXIS_META_CONFIG_KEYS } from '../../constant';\nimport { Params } from '../../core/adaptor';\nimport { Axis, Interaction } from '../../types';\nimport { deepAssign, flow, pick } from '../../utils';\nimport { execPlotAdaptor } from '../mix/utils';\nimport { FacetOptions, IPlot, IView } from './types';\nimport { execViewAdaptor } from './utils';\n\nfunction facetAdaptor(params: Params<FacetOptions>): Params<FacetOptions> {\n const { chart, options } = params;\n const { type: facetType, data, fields, eachView } = options;\n\n const restFacetCfg = omit(options as any, [\n 'type',\n 'data',\n 'fields',\n 'eachView',\n 'axes',\n 'meta',\n 'tooltip',\n 'coordinate',\n 'theme',\n 'legend',\n 'interactions',\n 'annotations',\n ]);\n\n // 1. data\n chart.data(data);\n\n // 2. facet\n chart.facet(facetType, {\n ...restFacetCfg,\n fields,\n eachView: (viewOfG2, facet) => {\n const viewOptions = eachView(viewOfG2, facet);\n if ((viewOptions as IView).geometries) {\n execViewAdaptor(viewOfG2, viewOptions as IView);\n } else {\n const plot = viewOptions as IPlot;\n const plotOptions = plot.options;\n // @ts-ignore 仪表盘没 tooltip\n if (plotOptions.tooltip) {\n // 配置 tooltip 交互\n viewOfG2.interaction('tooltip');\n }\n execPlotAdaptor(plot.type, viewOfG2, plotOptions);\n }\n },\n });\n\n return params;\n}\n\nfunction component(params: Params<FacetOptions>): Params<FacetOptions> {\n const { chart, options } = params;\n const { axes, meta, tooltip, coordinate, theme, legend, interactions, annotations } = options;\n\n // 3. meta 配置\n let scales: Record<string, any> = {};\n if (axes) {\n each(axes, (axis: Axis, field: string) => {\n scales[field] = pick(axis, AXIS_META_CONFIG_KEYS);\n });\n }\n\n scales = deepAssign({}, meta, scales);\n chart.scale(scales);\n\n // 4. coordinate 配置\n chart.coordinate(coordinate);\n\n // 5. axis 轴配置 (默认不展示)\n if (!axes) {\n chart.axis(false);\n } else {\n each(axes, (axis: Axis, field: string) => {\n chart.axis(field, axis);\n });\n }\n\n // 6. tooltip 配置\n if (tooltip) {\n chart.interaction('tooltip');\n chart.tooltip(tooltip);\n } else if (tooltip === false) {\n chart.removeInteraction('tooltip');\n }\n\n // 7. legend 配置(默认展示)\n chart.legend(legend);\n\n // theme 配置\n if (theme) {\n chart.theme(theme);\n }\n\n // 8. interactions\n each(interactions, (interaction: Interaction) => {\n if (interaction.enable === false) {\n chart.removeInteraction(interaction.type);\n } else {\n chart.interaction(interaction.type, interaction.cfg);\n }\n });\n\n // 9. annotations\n each(annotations, (annotation) => {\n chart.annotation()[annotation.type]({\n ...annotation,\n });\n });\n\n return params;\n}\n\n/**\n * 分面图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<FacetOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(theme, facetAdaptor, component)(params);\n}\n"]}
@@ -13,7 +13,7 @@ export declare class Facet extends Plot<FacetOptions> {
13
13
  /**
14
14
  * 获取 分面图 默认配置
15
15
  */
16
- protected getDefaultOptions(): Partial<FacetOptions<"rect" | "circle" | "mirror" | "list" | "matrix" | "tree">>;
16
+ protected getDefaultOptions(): Partial<FacetOptions<keyof import("@antv/g2/lib/interface").FacetCfgMap>>;
17
17
  /**
18
18
  * 获取 分面图 的适配器
19
19
  */
@@ -9,14 +9,14 @@ import { IPlotTypes } from '../mix/utils';
9
9
  /**
10
10
  * @title geometry 映射信息
11
11
  */
12
- export declare type IGeometry = Geometry & {
12
+ export type IGeometry = Geometry & {
13
13
  adjust?: Types.AdjustOption;
14
14
  };
15
15
  /**
16
16
  * @title 子 view 的配置
17
17
  * @description 1. 暂时不开嵌套 view 的情况 2. 暂不开放 分面子 view 的 meta 独立设置
18
18
  */
19
- export declare type IView = {
19
+ export type IView = {
20
20
  /**
21
21
  * @title 图形
22
22
  * @description geometry 及映射配置
@@ -60,11 +60,11 @@ export declare type IView = {
60
60
  /**
61
61
  * @title 子 plot 的配置
62
62
  */
63
- export declare type IPlot = IPlotTypes;
63
+ export type IPlot = IPlotTypes;
64
64
  /**
65
65
  * @title facetData map
66
66
  */
67
- declare type FacetDataMap = {
67
+ type FacetDataMap = {
68
68
  /**
69
69
  * @title rect 类型分面配置
70
70
  */
@@ -90,7 +90,7 @@ declare type FacetDataMap = {
90
90
  */
91
91
  readonly tree: Types.TreeData;
92
92
  };
93
- declare type FacetCfg = Types.MirrorCfg & Types.RectCfg & Types.TreeCfg & Types.ListCfg & Types.CircleCfg & Types.MatrixCfg;
93
+ type FacetCfg = Types.MirrorCfg & Types.RectCfg & Types.TreeCfg & Types.ListCfg & Types.CircleCfg & Types.MatrixCfg;
94
94
  /**
95
95
  * @title 分面图的配置类型定义
96
96
  */
@@ -20,11 +20,11 @@ function execViewAdaptor(viewOfG2, options) {
20
20
  // 2. meta 配置
21
21
  var scales = {};
22
22
  if (axes) {
23
- util_1.each(axes, function (axis, field) {
24
- scales[field] = utils_1.pick(axis, constant_1.AXIS_META_CONFIG_KEYS);
23
+ (0, util_1.each)(axes, function (axis, field) {
24
+ scales[field] = (0, utils_1.pick)(axis, constant_1.AXIS_META_CONFIG_KEYS);
25
25
  });
26
26
  }
27
- scales = utils_1.deepAssign({}, meta, scales);
27
+ scales = (0, utils_1.deepAssign)({}, meta, scales);
28
28
  viewOfG2.scale(scales);
29
29
  // 3. coordinate 配置 (默认由顶层决定)
30
30
  if (coordinate) {
@@ -35,13 +35,13 @@ function execViewAdaptor(viewOfG2, options) {
35
35
  viewOfG2.axis(false);
36
36
  }
37
37
  else {
38
- util_1.each(axes, function (axis, field) {
38
+ (0, util_1.each)(axes, function (axis, field) {
39
39
  viewOfG2.axis(field, axis);
40
40
  });
41
41
  }
42
- util_1.each(geometries, function (geometry) {
42
+ (0, util_1.each)(geometries, function (geometry) {
43
43
  // Geometry
44
- var ext = base_1.geometry({
44
+ var ext = (0, base_1.geometry)({
45
45
  chart: viewOfG2,
46
46
  options: geometry,
47
47
  }).ext;
@@ -52,7 +52,7 @@ function execViewAdaptor(viewOfG2, options) {
52
52
  }
53
53
  });
54
54
  // 5. interactions
55
- util_1.each(interactions, function (interaction) {
55
+ (0, util_1.each)(interactions, function (interaction) {
56
56
  if (interaction.enable === false) {
57
57
  viewOfG2.removeInteraction(interaction.type);
58
58
  }
@@ -61,11 +61,11 @@ function execViewAdaptor(viewOfG2, options) {
61
61
  }
62
62
  });
63
63
  // 6. annotations
64
- util_1.each(annotations, function (annotation) {
64
+ (0, util_1.each)(annotations, function (annotation) {
65
65
  viewOfG2.annotation()[annotation.type](tslib_1.__assign({}, annotation));
66
66
  });
67
67
  // 7. animation (先做动画)
68
- utils_1.addViewAnimation(viewOfG2, animation);
68
+ (0, utils_1.addViewAnimation)(viewOfG2, animation);
69
69
  if (tooltip) {
70
70
  // 8. tooltip
71
71
  viewOfG2.interaction('tooltip');
@@ -1 +1 @@
1
- {"version":3,"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geometryAdaptor } from '../../adaptor/geometries/base';\nimport { AXIS_META_CONFIG_KEYS } from '../../constant';\nimport { Axis, Interaction, Options } from '../../types';\nimport { addViewAnimation, deepAssign, pick } from '../../utils';\nimport { IView } from './types';\n\n/**\n *\n * @param params 分面图 参数\n * @returns facet eachView 的回调设置每个 view 的展示\n */\nexport function execViewAdaptor(viewOfG2: View, options: IView): void {\n const { data, coordinate, interactions, annotations, animation, tooltip, axes, meta, geometries } = options;\n\n // 1. data, optional\n if (data) {\n viewOfG2.data(data);\n }\n\n // 2. meta 配置\n let scales: Record<string, any> = {};\n if (axes) {\n each(axes, (axis: Axis, field: string) => {\n scales[field] = pick(axis, AXIS_META_CONFIG_KEYS);\n });\n }\n\n scales = deepAssign({}, meta, scales);\n viewOfG2.scale(scales);\n\n // 3. coordinate 配置 (默认由顶层决定)\n if (coordinate) {\n viewOfG2.coordinate(coordinate);\n }\n\n // 4. axis 轴配置 (默认由顶层决定,但可以通过 false 强制关闭)\n if (axes === false) {\n viewOfG2.axis(false);\n } else {\n each(axes, (axis: Axis, field: string) => {\n viewOfG2.axis(field, axis);\n });\n }\n\n each(geometries, (geometry) => {\n // Geometry\n const { ext } = geometryAdaptor({\n chart: viewOfG2,\n options: geometry,\n });\n\n // Geometry adjust\n const { adjust } = geometry;\n if (adjust) {\n ext.geometry.adjust(adjust);\n }\n });\n\n // 5. interactions\n each(interactions, (interaction: Interaction) => {\n if (interaction.enable === false) {\n viewOfG2.removeInteraction(interaction.type);\n } else {\n viewOfG2.interaction(interaction.type, interaction.cfg);\n }\n });\n // 6. annotations\n each(annotations, (annotation) => {\n viewOfG2.annotation()[annotation.type]({\n ...annotation,\n });\n });\n\n // 7. animation (先做动画)\n addViewAnimation(viewOfG2, animation as Options['animation']);\n\n if (tooltip) {\n // 8. tooltip\n viewOfG2.interaction('tooltip');\n viewOfG2.tooltip(tooltip);\n } else if (tooltip === false) {\n viewOfG2.removeInteraction('tooltip');\n }\n}\n"]}
1
+ {"version":3,"file":"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esContent":["import { View } from '@antv/g2';\nimport { each } from '@antv/util';\nimport { geometry as geometryAdaptor } from '../../adaptor/geometries/base';\nimport { AXIS_META_CONFIG_KEYS } from '../../constant';\nimport { Axis, Interaction, Options } from '../../types';\nimport { addViewAnimation, deepAssign, pick } from '../../utils';\nimport { IView } from './types';\n\n/**\n *\n * @param params 分面图 参数\n * @returns facet eachView 的回调设置每个 view 的展示\n */\nexport function execViewAdaptor(viewOfG2: View, options: IView): void {\n const { data, coordinate, interactions, annotations, animation, tooltip, axes, meta, geometries } = options;\n\n // 1. data, optional\n if (data) {\n viewOfG2.data(data);\n }\n\n // 2. meta 配置\n let scales: Record<string, any> = {};\n if (axes) {\n each(axes, (axis: Axis, field: string) => {\n scales[field] = pick(axis, AXIS_META_CONFIG_KEYS);\n });\n }\n\n scales = deepAssign({}, meta, scales);\n viewOfG2.scale(scales);\n\n // 3. coordinate 配置 (默认由顶层决定)\n if (coordinate) {\n viewOfG2.coordinate(coordinate);\n }\n\n // 4. axis 轴配置 (默认由顶层决定,但可以通过 false 强制关闭)\n if (axes === false) {\n viewOfG2.axis(false);\n } else {\n each(axes, (axis: Axis, field: string) => {\n viewOfG2.axis(field, axis);\n });\n }\n\n each(geometries, (geometry) => {\n // Geometry\n const { ext } = geometryAdaptor({\n chart: viewOfG2,\n options: geometry,\n });\n\n // Geometry adjust\n const { adjust } = geometry;\n if (adjust) {\n ext.geometry.adjust(adjust);\n }\n });\n\n // 5. interactions\n each(interactions, (interaction: Interaction) => {\n if (interaction.enable === false) {\n viewOfG2.removeInteraction(interaction.type);\n } else {\n viewOfG2.interaction(interaction.type, interaction.cfg);\n }\n });\n // 6. annotations\n each(annotations, (annotation) => {\n viewOfG2.annotation()[annotation.type]({\n ...annotation,\n });\n });\n\n // 7. animation (先做动画)\n addViewAnimation(viewOfG2, animation as Options['animation']);\n\n if (tooltip) {\n // 8. tooltip\n viewOfG2.interaction('tooltip');\n viewOfG2.tooltip(tooltip);\n } else if (tooltip === false) {\n viewOfG2.removeInteraction('tooltip');\n }\n}\n"]}