@antv/g2plot 2.4.5 → 2.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +1 -1
  3. package/dist/g2plot.min.js +4 -4
  4. package/dist/g2plot.min.js.map +1 -1
  5. package/esm/core/plot.d.ts +2 -2
  6. package/esm/core/plot.js +4 -3
  7. package/esm/core/plot.js.map +1 -1
  8. package/esm/index.d.ts +2 -2
  9. package/esm/index.js +2 -2
  10. package/esm/index.js.map +1 -1
  11. package/esm/plots/area/constants.js +1 -0
  12. package/esm/plots/area/constants.js.map +1 -1
  13. package/esm/plots/area/types.d.ts +35 -10
  14. package/esm/plots/area/types.js.map +1 -1
  15. package/esm/plots/bar/constants.js +3 -0
  16. package/esm/plots/bar/constants.js.map +1 -1
  17. package/esm/plots/bar/types.d.ts +16 -3
  18. package/esm/plots/bar/types.js.map +1 -1
  19. package/esm/plots/bidirectional-bar/types.d.ts +21 -6
  20. package/esm/plots/bidirectional-bar/types.js.map +1 -1
  21. package/esm/plots/box/types.d.ts +20 -6
  22. package/esm/plots/box/types.js.map +1 -1
  23. package/esm/plots/bullet/types.d.ts +36 -9
  24. package/esm/plots/bullet/types.js.map +1 -1
  25. package/esm/plots/chord/types.d.ts +14 -10
  26. package/esm/plots/chord/types.js.map +1 -1
  27. package/esm/plots/circle-packing/types.d.ts +25 -8
  28. package/esm/plots/circle-packing/types.js.map +1 -1
  29. package/esm/plots/column/constants.js +3 -0
  30. package/esm/plots/column/constants.js.map +1 -1
  31. package/esm/plots/column/types.d.ts +57 -16
  32. package/esm/plots/column/types.js.map +1 -1
  33. package/esm/plots/dual-axes/types.d.ts +31 -6
  34. package/esm/plots/dual-axes/types.js.map +1 -1
  35. package/esm/plots/dual-axes/util/render-sider.js +1 -1
  36. package/esm/plots/dual-axes/util/render-sider.js.map +1 -1
  37. package/esm/plots/facet/types.d.ts +54 -34
  38. package/esm/plots/facet/types.js.map +1 -1
  39. package/esm/plots/funnel/types.d.ts +40 -11
  40. package/esm/plots/funnel/types.js.map +1 -1
  41. package/esm/plots/gauge/adaptor.js +1 -0
  42. package/esm/plots/gauge/adaptor.js.map +1 -1
  43. package/esm/plots/gauge/types.d.ts +83 -21
  44. package/esm/plots/gauge/types.js.map +1 -1
  45. package/esm/plots/heatmap/types.d.ts +47 -12
  46. package/esm/plots/heatmap/types.js.map +1 -1
  47. package/esm/plots/histogram/types.d.ts +17 -6
  48. package/esm/plots/histogram/types.js.map +1 -1
  49. package/esm/plots/line/adaptor.js +2 -2
  50. package/esm/plots/line/adaptor.js.map +1 -1
  51. package/esm/plots/line/constants.js +1 -0
  52. package/esm/plots/line/constants.js.map +1 -1
  53. package/esm/plots/line/types.d.ts +42 -12
  54. package/esm/plots/line/types.js.map +1 -1
  55. package/esm/plots/liquid/adaptor.js +2 -1
  56. package/esm/plots/liquid/adaptor.js.map +1 -1
  57. package/esm/plots/liquid/index.d.ts +1 -0
  58. package/esm/plots/liquid/index.js +1 -0
  59. package/esm/plots/liquid/index.js.map +1 -1
  60. package/esm/plots/liquid/shapes/liquid.d.ts +16 -1
  61. package/esm/plots/liquid/shapes/liquid.js +17 -10
  62. package/esm/plots/liquid/shapes/liquid.js.map +1 -1
  63. package/esm/plots/liquid/types.d.ts +57 -16
  64. package/esm/plots/liquid/types.js.map +1 -1
  65. package/esm/plots/mix/types.d.ts +31 -22
  66. package/esm/plots/mix/types.js.map +1 -1
  67. package/esm/plots/pie/adaptor.js +2 -0
  68. package/esm/plots/pie/adaptor.js.map +1 -1
  69. package/esm/plots/pie/contants.js +1 -0
  70. package/esm/plots/pie/contants.js.map +1 -1
  71. package/esm/plots/pie/types.d.ts +27 -10
  72. package/esm/plots/pie/types.js.map +1 -1
  73. package/esm/plots/progress/adaptor.js +1 -0
  74. package/esm/plots/progress/adaptor.js.map +1 -1
  75. package/esm/plots/progress/types.d.ts +13 -4
  76. package/esm/plots/progress/types.js.map +1 -1
  77. package/esm/plots/radar/types.d.ts +39 -12
  78. package/esm/plots/radar/types.js.map +1 -1
  79. package/esm/plots/radial-bar/types.d.ts +39 -12
  80. package/esm/plots/radial-bar/types.js.map +1 -1
  81. package/esm/plots/ring-progress/types.d.ts +18 -6
  82. package/esm/plots/ring-progress/types.js.map +1 -1
  83. package/esm/plots/rose/constant.js +1 -0
  84. package/esm/plots/rose/constant.js.map +1 -1
  85. package/esm/plots/rose/types.d.ts +32 -12
  86. package/esm/plots/rose/types.js.map +1 -1
  87. package/esm/plots/sankey/adaptor.js +31 -2
  88. package/esm/plots/sankey/adaptor.js.map +1 -1
  89. package/esm/plots/sankey/types.d.ts +57 -30
  90. package/esm/plots/sankey/types.js.map +1 -1
  91. package/esm/plots/scatter/adaptor.d.ts +1 -1
  92. package/esm/plots/scatter/adaptor.js +2 -2
  93. package/esm/plots/scatter/adaptor.js.map +1 -1
  94. package/esm/plots/scatter/types.d.ts +76 -22
  95. package/esm/plots/scatter/types.js.map +1 -1
  96. package/esm/plots/stock/types.d.ts +20 -7
  97. package/esm/plots/stock/types.js.map +1 -1
  98. package/esm/plots/sunburst/types.d.ts +40 -12
  99. package/esm/plots/sunburst/types.js.map +1 -1
  100. package/esm/plots/tiny-area/types.d.ts +16 -5
  101. package/esm/plots/tiny-area/types.js.map +1 -1
  102. package/esm/plots/tiny-column/types.d.ts +10 -3
  103. package/esm/plots/tiny-column/types.js.map +1 -1
  104. package/esm/plots/tiny-line/types.d.ts +17 -5
  105. package/esm/plots/tiny-line/types.js.map +1 -1
  106. package/esm/plots/treemap/types.d.ts +17 -6
  107. package/esm/plots/treemap/types.js.map +1 -1
  108. package/esm/plots/venn/types.d.ts +20 -6
  109. package/esm/plots/venn/types.js.map +1 -1
  110. package/esm/plots/violin/types.d.ts +52 -17
  111. package/esm/plots/violin/types.js.map +1 -1
  112. package/esm/plots/waterfall/types.d.ts +42 -10
  113. package/esm/plots/waterfall/types.js.map +1 -1
  114. package/esm/plots/word-cloud/types.d.ts +91 -44
  115. package/esm/plots/word-cloud/types.js.map +1 -1
  116. package/esm/types/button.d.ts +8 -4
  117. package/esm/types/button.js.map +1 -1
  118. package/esm/types/common.d.ts +145 -33
  119. package/esm/types/common.js.map +1 -1
  120. package/esm/types/drill-down.d.ts +28 -7
  121. package/esm/types/drill-down.js.map +1 -1
  122. package/esm/types/interaction.d.ts +26 -6
  123. package/esm/types/interaction.js.map +1 -1
  124. package/esm/types/label.d.ts +11 -3
  125. package/esm/types/label.js.map +1 -1
  126. package/esm/types/meta.d.ts +4 -7
  127. package/esm/types/meta.js.map +1 -1
  128. package/esm/types/pattern.d.ts +58 -18
  129. package/esm/types/pattern.js.map +1 -1
  130. package/esm/types/state.d.ts +11 -3
  131. package/esm/types/state.js.map +1 -1
  132. package/esm/types/statistic.d.ts +38 -6
  133. package/esm/types/statistic.js.map +1 -1
  134. package/esm/types/tooltip.d.ts +7 -2
  135. package/esm/types/tooltip.js.map +1 -1
  136. package/esm/utils/transform/percent.js +2 -2
  137. package/esm/utils/transform/percent.js.map +1 -1
  138. package/lib/core/plot.d.ts +2 -2
  139. package/lib/core/plot.js +4 -3
  140. package/lib/core/plot.js.map +1 -1
  141. package/lib/index.d.ts +2 -2
  142. package/lib/index.js +2 -1
  143. package/lib/index.js.map +1 -1
  144. package/lib/plots/area/constants.js +1 -0
  145. package/lib/plots/area/constants.js.map +1 -1
  146. package/lib/plots/area/types.d.ts +35 -10
  147. package/lib/plots/area/types.js.map +1 -1
  148. package/lib/plots/bar/constants.js +3 -0
  149. package/lib/plots/bar/constants.js.map +1 -1
  150. package/lib/plots/bar/types.d.ts +16 -3
  151. package/lib/plots/bar/types.js.map +1 -1
  152. package/lib/plots/bidirectional-bar/types.d.ts +21 -6
  153. package/lib/plots/bidirectional-bar/types.js.map +1 -1
  154. package/lib/plots/box/types.d.ts +20 -6
  155. package/lib/plots/box/types.js.map +1 -1
  156. package/lib/plots/bullet/types.d.ts +36 -9
  157. package/lib/plots/bullet/types.js.map +1 -1
  158. package/lib/plots/chord/types.d.ts +14 -10
  159. package/lib/plots/chord/types.js.map +1 -1
  160. package/lib/plots/circle-packing/types.d.ts +25 -8
  161. package/lib/plots/circle-packing/types.js.map +1 -1
  162. package/lib/plots/column/constants.js +3 -0
  163. package/lib/plots/column/constants.js.map +1 -1
  164. package/lib/plots/column/types.d.ts +57 -16
  165. package/lib/plots/column/types.js.map +1 -1
  166. package/lib/plots/dual-axes/types.d.ts +31 -6
  167. package/lib/plots/dual-axes/types.js.map +1 -1
  168. package/lib/plots/dual-axes/util/render-sider.js +1 -1
  169. package/lib/plots/dual-axes/util/render-sider.js.map +1 -1
  170. package/lib/plots/facet/types.d.ts +54 -34
  171. package/lib/plots/facet/types.js.map +1 -1
  172. package/lib/plots/funnel/types.d.ts +40 -11
  173. package/lib/plots/funnel/types.js.map +1 -1
  174. package/lib/plots/gauge/adaptor.js +1 -0
  175. package/lib/plots/gauge/adaptor.js.map +1 -1
  176. package/lib/plots/gauge/types.d.ts +83 -21
  177. package/lib/plots/gauge/types.js.map +1 -1
  178. package/lib/plots/heatmap/types.d.ts +47 -12
  179. package/lib/plots/heatmap/types.js.map +1 -1
  180. package/lib/plots/histogram/types.d.ts +17 -6
  181. package/lib/plots/histogram/types.js.map +1 -1
  182. package/lib/plots/line/adaptor.js +1 -1
  183. package/lib/plots/line/adaptor.js.map +1 -1
  184. package/lib/plots/line/constants.js +1 -0
  185. package/lib/plots/line/constants.js.map +1 -1
  186. package/lib/plots/line/types.d.ts +42 -12
  187. package/lib/plots/line/types.js.map +1 -1
  188. package/lib/plots/liquid/adaptor.js +2 -1
  189. package/lib/plots/liquid/adaptor.js.map +1 -1
  190. package/lib/plots/liquid/index.d.ts +1 -0
  191. package/lib/plots/liquid/index.js +2 -0
  192. package/lib/plots/liquid/index.js.map +1 -1
  193. package/lib/plots/liquid/shapes/liquid.d.ts +16 -1
  194. package/lib/plots/liquid/shapes/liquid.js +19 -10
  195. package/lib/plots/liquid/shapes/liquid.js.map +1 -1
  196. package/lib/plots/liquid/types.d.ts +57 -16
  197. package/lib/plots/liquid/types.js.map +1 -1
  198. package/lib/plots/mix/types.d.ts +31 -22
  199. package/lib/plots/mix/types.js.map +1 -1
  200. package/lib/plots/pie/adaptor.js +2 -0
  201. package/lib/plots/pie/adaptor.js.map +1 -1
  202. package/lib/plots/pie/contants.js +1 -0
  203. package/lib/plots/pie/contants.js.map +1 -1
  204. package/lib/plots/pie/types.d.ts +27 -10
  205. package/lib/plots/pie/types.js.map +1 -1
  206. package/lib/plots/progress/adaptor.js +1 -0
  207. package/lib/plots/progress/adaptor.js.map +1 -1
  208. package/lib/plots/progress/types.d.ts +13 -4
  209. package/lib/plots/progress/types.js.map +1 -1
  210. package/lib/plots/radar/types.d.ts +39 -12
  211. package/lib/plots/radar/types.js.map +1 -1
  212. package/lib/plots/radial-bar/types.d.ts +39 -12
  213. package/lib/plots/radial-bar/types.js.map +1 -1
  214. package/lib/plots/ring-progress/types.d.ts +18 -6
  215. package/lib/plots/ring-progress/types.js.map +1 -1
  216. package/lib/plots/rose/constant.js +1 -0
  217. package/lib/plots/rose/constant.js.map +1 -1
  218. package/lib/plots/rose/types.d.ts +32 -12
  219. package/lib/plots/rose/types.js.map +1 -1
  220. package/lib/plots/sankey/adaptor.js +30 -1
  221. package/lib/plots/sankey/adaptor.js.map +1 -1
  222. package/lib/plots/sankey/types.d.ts +57 -30
  223. package/lib/plots/sankey/types.js.map +1 -1
  224. package/lib/plots/scatter/adaptor.d.ts +1 -1
  225. package/lib/plots/scatter/adaptor.js +1 -1
  226. package/lib/plots/scatter/adaptor.js.map +1 -1
  227. package/lib/plots/scatter/types.d.ts +76 -22
  228. package/lib/plots/scatter/types.js.map +1 -1
  229. package/lib/plots/stock/types.d.ts +20 -7
  230. package/lib/plots/stock/types.js.map +1 -1
  231. package/lib/plots/sunburst/types.d.ts +40 -12
  232. package/lib/plots/sunburst/types.js.map +1 -1
  233. package/lib/plots/tiny-area/types.d.ts +16 -5
  234. package/lib/plots/tiny-area/types.js.map +1 -1
  235. package/lib/plots/tiny-column/types.d.ts +10 -3
  236. package/lib/plots/tiny-column/types.js.map +1 -1
  237. package/lib/plots/tiny-line/types.d.ts +17 -5
  238. package/lib/plots/tiny-line/types.js.map +1 -1
  239. package/lib/plots/treemap/types.d.ts +17 -6
  240. package/lib/plots/treemap/types.js.map +1 -1
  241. package/lib/plots/venn/types.d.ts +20 -6
  242. package/lib/plots/venn/types.js.map +1 -1
  243. package/lib/plots/violin/types.d.ts +52 -17
  244. package/lib/plots/violin/types.js.map +1 -1
  245. package/lib/plots/waterfall/types.d.ts +42 -10
  246. package/lib/plots/waterfall/types.js.map +1 -1
  247. package/lib/plots/word-cloud/types.d.ts +91 -44
  248. package/lib/plots/word-cloud/types.js.map +1 -1
  249. package/lib/types/button.d.ts +8 -4
  250. package/lib/types/button.js.map +1 -1
  251. package/lib/types/common.d.ts +145 -33
  252. package/lib/types/common.js.map +1 -1
  253. package/lib/types/drill-down.d.ts +28 -7
  254. package/lib/types/drill-down.js.map +1 -1
  255. package/lib/types/interaction.d.ts +26 -6
  256. package/lib/types/interaction.js.map +1 -1
  257. package/lib/types/label.d.ts +11 -3
  258. package/lib/types/label.js.map +1 -1
  259. package/lib/types/meta.d.ts +4 -7
  260. package/lib/types/meta.js.map +1 -1
  261. package/lib/types/pattern.d.ts +58 -18
  262. package/lib/types/pattern.js.map +1 -1
  263. package/lib/types/state.d.ts +11 -3
  264. package/lib/types/state.js.map +1 -1
  265. package/lib/types/statistic.d.ts +38 -6
  266. package/lib/types/statistic.js.map +1 -1
  267. package/lib/types/tooltip.d.ts +7 -2
  268. package/lib/types/tooltip.js.map +1 -1
  269. package/lib/utils/transform/percent.js +2 -2
  270. package/lib/utils/transform/percent.js.map +1 -1
  271. package/package.json +2 -2
  272. package/src/core/plot.ts +5 -4
  273. package/src/index.ts +2 -2
  274. package/src/plots/area/constants.ts +1 -0
  275. package/src/plots/area/types.ts +35 -10
  276. package/src/plots/bar/constants.ts +3 -0
  277. package/src/plots/bar/types.ts +16 -3
  278. package/src/plots/bidirectional-bar/types.ts +21 -6
  279. package/src/plots/box/types.ts +20 -6
  280. package/src/plots/bullet/types.ts +36 -17
  281. package/src/plots/chord/types.ts +14 -11
  282. package/src/plots/circle-packing/types.ts +25 -14
  283. package/src/plots/column/constants.ts +3 -0
  284. package/src/plots/column/types.ts +57 -20
  285. package/src/plots/dual-axes/types.ts +31 -16
  286. package/src/plots/dual-axes/util/render-sider.ts +1 -1
  287. package/src/plots/facet/types.ts +54 -49
  288. package/src/plots/funnel/types.ts +40 -13
  289. package/src/plots/gauge/adaptor.ts +1 -0
  290. package/src/plots/gauge/types.ts +86 -27
  291. package/src/plots/heatmap/types.ts +49 -14
  292. package/src/plots/histogram/types.ts +17 -9
  293. package/src/plots/line/adaptor.ts +12 -1
  294. package/src/plots/line/constants.ts +1 -0
  295. package/src/plots/line/types.ts +42 -14
  296. package/src/plots/liquid/adaptor.ts +2 -1
  297. package/src/plots/liquid/index.ts +2 -0
  298. package/src/plots/liquid/shapes/liquid.ts +22 -11
  299. package/src/plots/liquid/types.ts +57 -16
  300. package/src/plots/mix/types.ts +31 -35
  301. package/src/plots/pie/adaptor.ts +2 -0
  302. package/src/plots/pie/contants.ts +1 -0
  303. package/src/plots/pie/types.ts +27 -10
  304. package/src/plots/progress/adaptor.ts +1 -0
  305. package/src/plots/progress/types.ts +13 -4
  306. package/src/plots/radar/types.ts +39 -12
  307. package/src/plots/radial-bar/types.ts +39 -12
  308. package/src/plots/ring-progress/types.ts +18 -6
  309. package/src/plots/rose/constant.ts +1 -0
  310. package/src/plots/rose/types.ts +32 -12
  311. package/src/plots/sankey/adaptor.ts +35 -2
  312. package/src/plots/sankey/types.ts +58 -30
  313. package/src/plots/scatter/adaptor.ts +3 -1
  314. package/src/plots/scatter/types.ts +77 -24
  315. package/src/plots/stock/types.ts +21 -8
  316. package/src/plots/sunburst/types.ts +42 -12
  317. package/src/plots/tiny-area/types.ts +16 -5
  318. package/src/plots/tiny-column/types.ts +10 -3
  319. package/src/plots/tiny-line/types.ts +17 -5
  320. package/src/plots/treemap/types.ts +17 -7
  321. package/src/plots/venn/types.ts +21 -6
  322. package/src/plots/violin/types.ts +52 -17
  323. package/src/plots/waterfall/types.ts +42 -10
  324. package/src/plots/word-cloud/types.ts +91 -44
  325. package/src/types/button.ts +8 -4
  326. package/src/types/common.ts +145 -37
  327. package/src/types/drill-down.ts +28 -7
  328. package/src/types/interaction.ts +26 -6
  329. package/src/types/label.ts +11 -3
  330. package/src/types/meta.ts +4 -7
  331. package/src/types/pattern.ts +58 -18
  332. package/src/types/state.ts +11 -3
  333. package/src/types/statistic.ts +38 -6
  334. package/src/types/tooltip.ts +7 -2
  335. package/src/utils/transform/percent.ts +2 -2
@@ -11,40 +11,77 @@ export interface ColumnOptions
11
11
  OptionWithConversionTag,
12
12
  OptionWithConnectedArea,
13
13
  PartialIntervalGeometryOptions {
14
- /** x 轴字段 */
14
+ /**
15
+ * @title x轴字段
16
+ */
15
17
  readonly xField: string;
16
- /** y 轴字段 */
18
+ /**
19
+ * @title y轴字段
20
+ */
17
21
  readonly yField: string;
18
- /** 拆分字段 */
22
+ /**
23
+ * @title 拆分字段
24
+ */
19
25
  readonly seriesField?: string;
20
- /** 是否分组柱形图 */
26
+ /**
27
+ * @title 是否分组柱形图
28
+ * @default false
29
+ */
21
30
  readonly isGroup?: boolean;
22
- /** 是否是区间柱状图 */
31
+ /**
32
+ * @title 是否是区间柱状图
33
+ * @default false
34
+ */
23
35
  readonly isRange?: boolean;
24
- /** 是否是百分比柱状图 */
36
+ /**
37
+ * @title 是否是百分比柱状图
38
+ * @default false
39
+ */
25
40
  readonly isPercent?: boolean;
26
- /** 是否堆积柱状图 */
41
+ /**
42
+ * @title 是否堆积柱状图
43
+ * @default false
44
+ */
27
45
  readonly isStack?: boolean;
28
- /** 柱状图宽度占比 [0-1] */
46
+ /**
47
+ * @title 柱状图宽度占比
48
+ * @description 范围[0-1]
49
+ */
29
50
  readonly columnWidthRatio?: number;
30
- /** 分组中柱子之间的间距 [0-1],仅对分组柱状图适用 */
51
+ /**
52
+ * @title 分组中柱子之间的间距
53
+ * @description 范围[0-1],仅对分组柱状图适用
54
+ */
31
55
  readonly marginRatio?: number;
32
- /** 柱状图最小宽度(像素) */
56
+ /**
57
+ * @title 柱状图最小宽度(像素)
58
+ */
33
59
  readonly minColumnWidth?: number;
34
- /** 柱状图最大宽度(像素) */
60
+ /**
61
+ * @title 柱状图最大宽度(像素)
62
+ */
35
63
  readonly maxColumnWidth?: number;
36
- /** 柱状图柱子的背景 */
64
+ /**
65
+ * @title 柱状图柱子的背景
66
+ */
37
67
  readonly columnBackground?: { style?: ShapeAttrs };
38
- /** 柱子样式配置,可选 */
68
+ /**
69
+ * @title 柱子样式
70
+ */
39
71
  readonly columnStyle?: StyleAttr;
40
- /** 分组字段,优先级高于 seriesField , isGroup: true 时会根据 groupField 进行分组。*/
72
+ /**
73
+ * @title 分组字段
74
+ * @description 优先级高于 seriesField , isGroup: true 时会根据 groupField 进行分组
75
+ */
41
76
  readonly groupField?: string;
42
-
43
- // 自定义相关
44
- /** 自定义柱状图 interval 图形元素展示形状 */
77
+ /**
78
+ * @title 自定义柱状图
79
+ * @description interval 图形元素展示形状
80
+ */
45
81
  readonly shape?: string;
46
-
47
- // 图表交互
48
- /** 开启下钻交互,以及进行下钻交互的配置 */
82
+ /**
83
+ * @title 图表交互
84
+ * @description 开启下钻交互,以及进行下钻交互的配置
85
+ */
49
86
  readonly brush?: BrushCfg;
50
87
  }
@@ -19,17 +19,31 @@ export interface PointConfig {
19
19
  }
20
20
 
21
21
  type CommonGeometryOption = {
22
- // 图形类型
22
+ /**
23
+ * @title 图形类型
24
+ */
23
25
  readonly geometry?: string;
24
- // label
26
+ /**
27
+ * @title 数据标签的配置
28
+ */
25
29
  readonly label?: Options['label'];
26
- // legend
30
+ /**
31
+ * @title 图例legend的配置项
32
+ */
27
33
  readonly legend?: Options['legend'];
28
- // 色板
34
+ /**
35
+ * @title 颜色色板
36
+ */
29
37
  readonly color?: Options['color'];
30
- // 是否分组
38
+ /**
39
+ * @title 是否分组
40
+ * @default false
41
+ */
31
42
  readonly isGroup?: boolean;
32
- // 分组字段,优先级高于 seriesField
43
+ /**
44
+ * @title 分组字段
45
+ * @description 优先级高于 seriesField
46
+ */
33
47
  readonly groupField?: string;
34
48
  };
35
49
 
@@ -59,31 +73,32 @@ export type GeometryOption = GeometryColumnOption | GeometryLineOption;
59
73
 
60
74
  export type DualAxesOptions = Omit<Options, 'data' | 'yAxis' | 'color' | 'annotations'> & {
61
75
  /**
62
- * 具体的数据,左右两边的数据
76
+ * @title 数据
77
+ * @description 具体的数据,左右两边的数据
63
78
  */
64
79
  readonly data: Array<Record<string, any>[]>;
65
-
66
80
  /**
67
- * 双轴图的 x 字段,x 字段名称需要保持一致
81
+ * @title 双轴图的 x 字段
82
+ * @description x 字段名称需要保持一致
68
83
  */
69
84
  readonly xField: string;
70
85
  /**
71
- * 双轴图左右 y 字段,需要不一致
86
+ * @title 双轴图左右 y 字段
87
+ * @description 需要不一致
72
88
  */
73
89
  readonly yField: string[];
74
-
75
90
  /**
76
- * 左右两边的 yAxis 配置,使用 object 的方式,key 为 y 字段名,或者数组分别表示左右
91
+ * @title 左右两边的 yAxis 配置
92
+ * @description 使用 object 的方式,key 为 y 字段名,或者数组分别表示左右
77
93
  */
78
94
  readonly yAxis?: Options['yAxis'][] | Record<string, Options['yAxis']>;
79
-
80
95
  /**
81
- * 左右两边的图形配置
96
+ * @title 左右两边的图形配置
82
97
  */
83
98
  readonly geometryOptions?: GeometryOption[];
84
-
85
99
  /**
86
- * 左右两边的 annotation 配置, 同时支持数组和object 两种形式,以防出现 field 相同无法设置的情况
100
+ * @title 左右两边的 annotation 配置
101
+ * @description 同时支持数组和object 两种形式,以防出现 field 相同无法设置的情况
87
102
  */
88
103
  readonly annotations?: Options['annotations'][] | Record<string, Options['annotations']>;
89
104
  };
@@ -29,5 +29,5 @@ export const doSliderFilter = (view: View, sliderValue: [number, number]) => {
29
29
  const idx: number = xValues.indexOf(value);
30
30
  return idx > -1 ? isBetween(idx, minIndex, maxIndex) : true;
31
31
  });
32
- view.render(true);
32
+ view.getRootView().render(true);
33
33
  };
@@ -9,140 +9,145 @@ import { Interaction } from '../../types/interaction';
9
9
  import { IPlotTypes } from '../mix/utils';
10
10
 
11
11
  /**
12
- * geometry 映射信息
12
+ * @title geometry 映射信息
13
13
  */
14
14
  export type IGeometry = Geometry & {
15
15
  adjust?: Types.AdjustOption;
16
16
  };
17
17
 
18
18
  /**
19
- * 子 view 的配置。
20
- * 1. 暂时不开嵌套 view 的情况
21
- * 2. 暂不开放 分面子 view 的 meta 独立设置
19
+ * @title 子 view 的配置
20
+ * @description 1. 暂时不开嵌套 view 的情况 2. 暂不开放 分面子 view 的 meta 独立设置
22
21
  */
23
22
  export type IView = {
24
23
  /**
25
- * 图形 geometry 及映射配置
24
+ * @title 图形
25
+ * @description geometry 及映射配置
26
26
  */
27
27
  readonly geometries: IGeometry[];
28
-
29
28
  /**
30
- * 1. optional,view 中的数据,默认由分面数据来根据拆分维度值进行分配
29
+ * @title 数据
30
+ * @description optional,view 中的数据
31
31
  */
32
32
  readonly data?: Data;
33
-
34
33
  /**
35
- * 2. meta
34
+ * @title meta
36
35
  */
37
36
  readonly meta?: Record<string, Axis>;
38
-
39
37
  /**
40
- * 3. 坐标系的配置,每一个 view 具有相同的坐标系
38
+ * @title 坐标系的配置
39
+ * @description 每一个 view 具有相同的坐标系
41
40
  */
42
41
  readonly coordinate?: Types.CoordinateOption;
43
-
44
42
  /**
45
- * 4. 坐标轴配置
43
+ * @title 坐标轴配置
46
44
  */
47
45
  readonly axes?: false | Record<string, Axis>;
48
-
49
46
  /**
50
- * 5. interactions 配置
47
+ * @title interactions 配置
51
48
  */
52
49
  readonly interactions?: Interaction[];
53
-
54
50
  /**
55
- * 6. annotation 配置
51
+ * @title annotation 配置
56
52
  */
57
53
  readonly annotations?: Annotation[];
58
-
59
54
  /**
60
- * 7. animation 配置
55
+ * @title animation 配置
61
56
  */
62
57
  readonly animation?: Animation;
63
-
64
58
  /**
65
- * 8. tooltip 配置
59
+ * @title tooltip 配置
66
60
  */
67
61
  readonly tooltip?: Tooltip;
68
62
  };
69
63
 
70
64
  /**
71
- * 子 plot 的配置
65
+ * @title 子 plot 的配置
72
66
  */
73
67
  export type IPlot = IPlotTypes;
74
68
  /**
75
- * facetData map
69
+ * @title facetData map
76
70
  */
77
71
  type FacetDataMap = {
78
- /** rect 类型分面配置 */
72
+ /**
73
+ * @title rect 类型分面配置
74
+ */
79
75
  readonly rect: Types.RectData;
80
- /** mirror 类型分面配置 */
76
+ /**
77
+ * @title mirror 类型分面配置
78
+ */
81
79
  readonly mirror: Types.MirrorData;
82
- /** list 类型分面配置 */
80
+ /**
81
+ * @title list 类型分面配置
82
+ */
83
83
  readonly list: Types.ListData;
84
- /** matrix 类型分面配置 */
84
+ /**
85
+ * @title matrix 类型分面配置
86
+ */
85
87
  readonly matrix: Types.MatrixData;
86
- /** circle 类型分面配置 */
88
+ /**
89
+ * @title circle 类型分面配置
90
+ */
87
91
  readonly circle: Types.CircleData;
88
- /** tree 类型分面配置 */
92
+ /**
93
+ * @title tree 类型分面配置
94
+ */
89
95
  readonly tree: Types.TreeData;
90
96
  };
91
97
 
92
98
  type FacetCfg = Types.MirrorCfg & Types.RectCfg & Types.TreeCfg & Types.ListCfg & Types.CircleCfg & Types.MatrixCfg;
93
99
 
94
- /** 分面图的配置类型定义 */
100
+ /**
101
+ * @title 分面图的配置类型定义
102
+ */
95
103
  export interface FacetOptions<T extends keyof Types.FacetCfgMap = keyof Types.FacetCfgMap> extends Options, FacetCfg {
96
104
  /**
97
- * 分面类型,G2 内置了六种分面: rect、list、circle、tree、mirror 和 matrix
105
+ * @title 分面类型
106
+ * @description G2 内置了六种分面: rect、list、circle、tree、mirror 和 matrix
98
107
  */
99
108
  readonly type: T;
100
109
  /**
101
- * 数据划分维度。
110
+ * @title 数据划分维度
102
111
  */
103
112
  readonly fields: string[];
104
113
  /**
105
- * 分面数据
114
+ * @title 分面数据
106
115
  */
107
116
  readonly data: Data;
108
-
109
117
  /**
110
- * 每个分面 view 中的具体绘图表现
111
- * 回调的方式
118
+ * @title 绘图
119
+ * @description 每个分面 view 中的具体绘图表现 回调的方式
112
120
  */
113
121
  readonly eachView: (innerView: View, facet?: FacetDataMap[T]) => IView | IPlot;
114
122
  /**
115
- * 是否展示分面标题
123
+ * @title 是否展示分面标题
124
+ * @default false
116
125
  */
117
126
  readonly showTitle?: boolean;
118
-
119
127
  /**
120
- * 3. facet 中对应的 meta 字段配置
128
+ * @title meta 字段
129
+ * @description facet 中对应的 meta 字段配置
121
130
  */
122
131
  readonly meta?: Record<string, Meta>;
123
-
124
132
  /**
125
- * 4. 坐标系的配置,每一个 view 具有相同的坐标系
133
+ * @title 坐标系的配置
134
+ * @description 每一个 view 具有相同的坐标系
126
135
  */
127
136
  readonly coordinate?: Types.CoordinateOption;
128
-
129
137
  /**
130
- * 5. 轴配置
138
+ * @title 轴配置
131
139
  */
132
140
  readonly axes?: false | Record<string, Axis>;
133
-
134
141
  /**
135
- * 6. tooltip 配置
142
+ * @title tooltip 配置
136
143
  */
137
144
  readonly tooltip?: Tooltip;
138
-
139
145
  /**
140
- * 7. 图例配置
146
+ * @title 图例配置
141
147
  */
142
148
  readonly legend?: Legend;
143
-
144
149
  /**
145
- * 8. 图例配置
150
+ * @title 图例配置
146
151
  */
147
152
  readonly interactions?: Interaction[];
148
153
  }
@@ -7,31 +7,58 @@ export type ConversionPosition = {
7
7
  };
8
8
 
9
9
  export interface FunnelOptions extends Options {
10
- /** x 轴字段 */
10
+ /**
11
+ * @title x轴字段
12
+ */
11
13
  readonly xField?: string;
12
- /** y 轴字段 */
14
+ /**
15
+ * @title y轴字段
16
+ */
13
17
  readonly yField?: string;
14
- /** 分组字段: 漏斗图将根据此字段转置为分面漏斗图 */
18
+ /**
19
+ * @title 分组字段
20
+ * @description 漏斗图将根据此字段转置为分面漏斗图
21
+ */
15
22
  readonly seriesField?: string;
16
- /** 对比字段:漏斗图将根据此字段转置为对比漏斗图 */
23
+ /**
24
+ * @title 对比字段
25
+ * @description 漏斗图将根据此字段转置为对比漏斗图
26
+ */
17
27
  readonly compareField?: string;
18
- /** 是否转置 */
28
+ /**
29
+ * @title 是否转置
30
+ * @default false
31
+ */
19
32
  readonly isTransposed?: boolean;
20
- /** 是否是动态高度 */
33
+ /**
34
+ * @title 是否是动态高度
35
+ * @default false
36
+ */
21
37
  readonly dynamicHeight?: boolean;
22
- /** maxSize: 最大宽度,0-1 之间 */
38
+ /**
39
+ * @title 最大宽度
40
+ * @description 范围0-1
41
+ */
23
42
  readonly maxSize?: number;
24
- /** minSize: 最大宽度,0-1 之间 */
43
+ /**
44
+ * @title 最小宽度
45
+ * @description 范围0-1
46
+ */
25
47
  readonly minSize?: number;
26
-
27
- // 样式
28
- /** shape 形状: pyramid 金字塔, 只在基础漏斗图中适用. 在对比漏斗图以及设置 dynamicHeight: 'true' 时不适用 */
48
+ /**
49
+ * @title shape 形状
50
+ * @description pyramid 金字塔, 只在基础漏斗图中适用. 在对比漏斗图以及设置 dynamicHeight: 'true' 时不适用
51
+ */
29
52
  readonly shape?: string;
30
- /** 漏斗图样式 */
53
+ /**
54
+ * @title 漏斗图样式
55
+ */
31
56
  readonly funnelStyle?: StyleAttr;
32
57
 
33
58
  // 组件
34
- /** 转化率信息 */
59
+ /**
60
+ * @title 转化率信息
61
+ */
35
62
  readonly conversionTag?:
36
63
  | false
37
64
  | {
@@ -70,6 +70,7 @@ function geometry(params: Params<GaugeOptions>): Params<GaugeOptions> {
70
70
  },
71
71
  args: {
72
72
  zIndexReversed: true,
73
+ sortZIndex: true,
73
74
  },
74
75
  minColumnWidth: rangeWidth,
75
76
  maxColumnWidth: rangeWidth,
@@ -4,29 +4,45 @@ import { PERCENT, RANGE_TYPE, RANGE_VALUE } from './constants';
4
4
 
5
5
  /** 指标指标的配置 */
6
6
  export type Indicator = {
7
- // 指针
7
+ /**
8
+ * @title 指针
9
+ * @description 只允许静态的 object
10
+ */
8
11
  readonly pointer?: {
9
- readonly style?: ShapeStyle; // 只允许静态的 object
12
+ readonly style?: ShapeStyle;
10
13
  };
11
- // 圆环
14
+ /**
15
+ * @title 圆环
16
+ * @description 只允许静态的 object
17
+ */
12
18
  readonly pin?: {
13
- readonly style?: ShapeStyle; // 只允许静态的 object
19
+ readonly style?: ShapeStyle;
14
20
  };
15
- // 自定义指针 shape. 默认: 'gauge-indicator'
21
+ /**
22
+ * @title 自定义指针 shape
23
+ * @default 'gauge-indicator'
24
+ */
16
25
  readonly shape?: string;
17
26
  };
18
27
 
19
28
  export type Range = {
20
- /** 辅助的刻度值 0 ~ 1 的数字 */
29
+ /**
30
+ * @title 辅助的刻度值
31
+ * @description 0 ~ 1 的数字
32
+ */
21
33
  readonly ticks?: number[];
22
- /** 辅助刻度的颜色配置 */
34
+ /**
35
+ * @title 辅助刻度的颜色配置
36
+ */
23
37
  readonly color?: string | string[];
24
- /** 仪表盘辅助背景的宽度 */
38
+ /**
39
+ * @title 仪表盘辅助背景的宽度
40
+ */
25
41
  readonly width?: number;
26
42
  };
27
43
 
28
44
  /**
29
- * 仪表盘辅助生成的 rangeData
45
+ * @title 仪表盘辅助生成的 rangeData
30
46
  */
31
47
  export type GaugeRangeData = {
32
48
  readonly [RANGE_VALUE]?: number;
@@ -34,46 +50,89 @@ export type GaugeRangeData = {
34
50
  readonly [PERCENT]: number;
35
51
  }[];
36
52
 
37
- /** 仪表盘配置类型定义 */
53
+ /**
54
+ * @title 仪表盘配置类型定义
55
+ */
38
56
  export interface GaugeOptions
39
57
  extends Omit<Options, 'data' | 'tooltip' | 'legend' | 'xAxis' | 'yAxis' | 'xField' | 'yField' | 'color'> {
40
- /** 指标的比例 0 ~ 1 */
58
+ /**
59
+ * @title 指标的比例
60
+ * @description 范围0 ~ 1
61
+ */
41
62
  readonly percent: number;
42
- /** 外弧度 0 ~ 1 */
63
+ /**
64
+ * @title 外弧度
65
+ * @description 范围0 ~ 1
66
+ */
43
67
  readonly radius?: number;
44
- /** 内弧度 0 ~ 1 */
68
+ /**
69
+ * @title 内弧度
70
+ * @description 范围0 ~ 1
71
+ */
45
72
  readonly innerRadius?: number;
46
- /** 弧度起始 */
73
+ /**
74
+ * @title 弧度起始
75
+ */
47
76
  readonly startAngle?: number;
48
- /** 弧度结束 */
77
+ /**
78
+ * @title 弧度结束
79
+ */
49
80
  readonly endAngle?: number;
50
- /** 辅助的 range 组件 */
81
+ /**
82
+ * @title 辅助的 range 组件
83
+ */
51
84
  readonly range?: Range;
52
- /** 坐标轴配置 */
85
+ /**
86
+ * @title 坐标轴配置
87
+ */
53
88
  readonly axis?: Axis;
54
- /** 指针的配置 */
89
+ /**
90
+ * @title 指针的配置
91
+ */
55
92
  readonly indicator?: false | Indicator;
56
- /** 统计文本 */
93
+ /**
94
+ * @title 统计文本
95
+ */
57
96
  readonly statistic?: Statistic;
58
- /** 仪表盘样式 */
97
+ /**
98
+ * @title 仪表盘样式
99
+ */
59
100
  readonly gaugeStyle?: StyleAttr;
60
101
 
61
- // meter gauge 相关配置
62
- /** 仪表盘类型, 可选项: 'meter', default 为空 */
102
+ /**
103
+ * @title meter gauge 相关配置
104
+ */
105
+
106
+ /**
107
+ * @title 仪表盘类型
108
+ * @description 可选项: 'meter', default 为空
109
+ */
63
110
  readonly type?: string;
64
- /** 当仪表盘类型 = 'meter' 生效 */
111
+ /**
112
+ * @title 仪表盘配置
113
+ * @description 当仪表盘类型 = 'meter' 生效
114
+ */
65
115
  readonly meter?: {
66
- /** 仪表盘总步数, default: 50 */
116
+ /**
117
+ * @title 仪表盘总步数
118
+ * @default "50"
119
+ */
67
120
  readonly steps?: number;
68
- /** step 与 gap 的宽度占比, default: 0.5 */
121
+ /**
122
+ * @title step 与 gap 的宽度占比
123
+ * @default "0.5"
124
+ */
69
125
  readonly stepRatio?: number;
70
126
  };
71
127
  }
72
128
 
73
129
  /**
74
- * 仪表盘 自定义 shape 使用的 customInfo
130
+ * @title 仪表盘
131
+ * @description 自定义 shape 使用的 customInfo
75
132
  */
76
133
  export type GaugeCustomInfo = {
77
- /** 仪表盘 meter 类型的相关配置 */
134
+ /**
135
+ * @title 仪表盘 meter 类型的相关配置
136
+ */
78
137
  readonly meter?: GaugeOptions['meter'];
79
138
  };