@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
@@ -2,12 +2,21 @@ import { Options, StyleAttr, ColorAttr } from '../../types';
2
2
 
3
3
  /** mini 图类型定义需要 omit 很多的 G2 Options 配置 */
4
4
  export interface ProgressOptions extends Omit<Options, 'data' | 'color'> {
5
- /** 进度百分比 */
5
+ /**
6
+ * @title 进度百分比
7
+ */
6
8
  readonly percent: number;
7
- /** 条图宽度占比 [0-1] */
9
+ /**
10
+ * @title 条图宽度占比
11
+ * @description 范围[0-1]
12
+ */
8
13
  readonly barWidthRatio?: number;
9
- /** 进度条颜色 */
14
+ /**
15
+ * @title 进度条颜色
16
+ */
10
17
  readonly color?: ColorAttr;
11
- /** 进度条样式 */
18
+ /**
19
+ * @title 进度条样式
20
+ */
12
21
  readonly progressStyle?: StyleAttr;
13
22
  }
@@ -2,28 +2,55 @@ import { PointGeometryOptions, AreaGeometryOptions } from '../../adaptor/geometr
2
2
  import { Options, ShapeStyle } from '../../types';
3
3
 
4
4
  export interface RadarOptions extends Options {
5
- /** x 字段 */
5
+ /**
6
+ * @title x轴字段
7
+ */
6
8
  readonly xField: string;
7
- /** y 字段,映射雷达图的射线长度 */
9
+ /**
10
+ * @title y轴字段
11
+ * @description 映射雷达图的射线长度
12
+ */
8
13
  readonly yField: string;
9
- /** 分组字段 */
14
+ /**
15
+ * @title 分组字段
16
+ */
10
17
  readonly seriesField?: string;
11
- /** 是否平滑 */
18
+ /**
19
+ * @title 是否平滑
20
+ * @default false
21
+ */
12
22
  readonly smooth?: boolean;
13
- /** 折线图形样式 */
23
+ /**
24
+ * @title 折线图形样式
25
+ */
14
26
  readonly lineStyle?: ShapeStyle | ((x: any, y: any, series?: any) => ShapeStyle);
15
- /** 数据点图形样式 */
27
+ /**
28
+ * @title 数据点图形样式
29
+ */
16
30
  readonly point?: PointGeometryOptions['point'] & Pick<PointGeometryOptions, 'state'>;
17
- /** area 图形样式, 均提供回调的方式, 不开放 field 映射配置 */
31
+ /**
32
+ * @title area 图形样式
33
+ * @description 均提供回调的方式, 不开放 field 映射配置
34
+ */
18
35
  readonly area?: AreaGeometryOptions['area'];
19
- /** 角度轴配置 */
36
+ /**
37
+ * @title 角度轴配置
38
+ */
20
39
  readonly xAxis?: any;
21
- /** 径向轴配置 */
40
+ /**
41
+ * @title 径向轴配置
42
+ */
22
43
  readonly yAxis?: any;
23
- /** 雷达图半径 */
44
+ /**
45
+ * @title 雷达图半径
46
+ */
24
47
  readonly radius?: number;
25
- /** 雷达图开始角度 */
48
+ /**
49
+ * @title 雷达图开始角度
50
+ */
26
51
  readonly startAngle?: number;
27
- /** 雷达图结束角度 */
52
+ /**
53
+ * @title 雷达图结束角度
54
+ */
28
55
  readonly endAngle?: number;
29
56
  }
@@ -4,28 +4,55 @@ import { BarOptions } from '../bar';
4
4
 
5
5
  /** 配置类型定义 */
6
6
  export interface RadialBarOptions extends Options, Pick<BarOptions, 'barBackground' | 'minBarWidth' | 'maxBarWidth'> {
7
- /** x 轴字段 */
7
+ /**
8
+ * @title x轴字段
9
+ */
8
10
  readonly xField?: string;
9
- /** y 轴字段 */
11
+ /**
12
+ * @title y轴字段
13
+ */
10
14
  readonly yField?: string;
11
- /** 样式 */
15
+ /**
16
+ * @title 样式
17
+ */
12
18
  readonly barStyle?: ShapeAttrs;
13
- /** 最大旋转角度 0~360 */
19
+ /**
20
+ * @title 最大旋转角度
21
+ * @description 范围0-360
22
+ */
14
23
  readonly maxAngle?: number;
15
- /** 圆半径 */
24
+ /**
25
+ * @title 圆半径
26
+ */
16
27
  readonly radius?: number;
17
- /** 圆内半径 */
28
+ /**
29
+ * @title 圆内半径
30
+ */
18
31
  readonly innerRadius?: number;
19
- /** 圆环的开始角度 */
32
+ /**
33
+ * @title 圆环的开始角度
34
+ */
20
35
  readonly startAngle?: number;
21
- /** 圆环的结束角度 */
36
+ /**
37
+ * @title 圆环的结束角度
38
+ */
22
39
  readonly endAngle?: number;
23
- /** 颜色字段 */
40
+ /**
41
+ * @title 颜色字段
42
+ */
24
43
  readonly colorField?: string;
25
- /** 类型 */
44
+ /**
45
+ * @title 类型
46
+ */
26
47
  readonly type?: string;
27
- /** 叠加 */
48
+ /**
49
+ * @title 是否叠加
50
+ * @default false
51
+ */
28
52
  readonly isStack?: boolean;
29
- /** 分组 */
53
+ /**
54
+ * @title 是否分组
55
+ * @default false
56
+ */
30
57
  readonly isGroup?: boolean;
31
58
  }
@@ -2,16 +2,28 @@ import { Options, StyleAttr, ColorAttr, Statistic } from '../../types';
2
2
 
3
3
  /** mini 图类型定义需要 omit 很多的 G2 Options 配置 */
4
4
  export interface RingProgressOptions extends Omit<Options, 'data' | 'tooltip' | 'legend' | 'label' | 'color'> {
5
- /** 进度百分比 */
5
+ /**
6
+ * @title 进度百分比
7
+ */
6
8
  readonly percent: number;
7
- /** 外环的半径 */
9
+ /**
10
+ * @title 外环的半径
11
+ */
8
12
  readonly radius?: number;
9
- /** 内环的半径 */
13
+ /**
14
+ * @title 内环的半径
15
+ */
10
16
  readonly innerRadius?: number;
11
- /** 进度条颜色 */
17
+ /**
18
+ * @title 进度条颜色
19
+ */
12
20
  readonly color?: ColorAttr;
13
- /** 进度条样式 */
21
+ /**
22
+ * @title 进度条样式
23
+ */
14
24
  readonly progressStyle?: StyleAttr;
15
- /** 统计内容组件 */
25
+ /**
26
+ * @title 统计内容组件
27
+ */
16
28
  readonly statistic?: Statistic;
17
29
  }
@@ -9,6 +9,7 @@ export const DEFAULT_OPTIONS = deepAssign({}, Plot.getDefaultOptions(), {
9
9
  yAxis: false,
10
10
  legend: {
11
11
  position: 'right',
12
+ radio: {},
12
13
  },
13
14
  sectorStyle: {
14
15
  stroke: '#fff',
@@ -1,30 +1,50 @@
1
1
  import { Options, StyleAttr } from '../../types';
2
2
 
3
3
  export interface RoseOptions extends Options {
4
- /** 扇形切片分类所对应的数据字段名(每个扇形的弧度相等) */
4
+ /**
5
+ * @title 扇形切片分类所对应的数据字段名
6
+ * @description 每个扇形的弧度相等
7
+ */
5
8
  readonly xField: string;
6
- /** 扇形切片半径长度所对应的数据字段名 */
9
+ /**
10
+ * @title 扇形切片半径长度所对应的数据字段名
11
+ */
7
12
  readonly yField: string;
8
- /** 拆分字段 */
13
+ /**
14
+ * @title 拆分字段
15
+ */
9
16
  readonly seriesField?: string;
10
- /** 是否分组玫瑰图 */
17
+ /**
18
+ * @title 是否分组玫瑰图
19
+ * @default false
20
+ */
11
21
  readonly isGroup?: boolean;
12
- /** 是否堆积玫瑰图 */
22
+ /**
23
+ * @title 是否堆积玫瑰图
24
+ * @default false
25
+ */
13
26
  readonly isStack?: boolean;
14
27
  /**
15
- * 玫瑰图的半径,原点为画布中心。配置值域为 (0,1]
16
- * 1 代表玫瑰图大小为 1,即撑满绘图区域
28
+ * @title 玫瑰图的半径
29
+ * @description 原点为画布中心。配置值域为 (0,1] 1 代表玫瑰图大小为 1,即撑满绘图区域
17
30
  */
18
31
  readonly radius?: number;
19
- /** 内部空心圆的半径,规则与 radius 一致 */
32
+ /**
33
+ * @title 内部空心圆的半径
34
+ * @description 规则与 radius 一致
35
+ */
20
36
  readonly innerRadius?: number;
21
- /** 玫瑰图开始角度 */
37
+ /**
38
+ * @title 玫瑰图开始角度
39
+ */
22
40
  readonly startAngle?: number;
23
- /** 玫瑰图结束角度 */
41
+ /**
42
+ * @title 玫瑰图结束角度
43
+ */
24
44
  readonly endAngle?: number;
25
45
  /**
26
- * 设置扇形样式。sectorStyle 中的fill会覆盖 color 的配置
27
- * sectorStyle 可以直接指定,也可以通过 callback 的方式,根据数据为每个扇形切片指定单独的样式
46
+ * @title 设置扇形样式
47
+ * @description sectorStyle 中的fill会覆盖 color 的配置,sectorStyle 可以直接指定,也可以通过 callback 的方式,根据数据为每个扇形切片指定单独的样式
28
48
  */
29
49
  readonly sectorStyle?: StyleAttr;
30
50
  }
@@ -1,7 +1,7 @@
1
1
  import { uniq } from '@antv/util';
2
- import { interaction, theme } from '../../adaptor/common';
2
+ import { theme } from '../../adaptor/common';
3
3
  import { Params } from '../../core/adaptor';
4
- import { deepAssign, flow } from '../../utils';
4
+ import { deepAssign, findViewById, flow } from '../../utils';
5
5
  import { polygon, edge } from '../../adaptor/geometries';
6
6
  import { transformToViewsData } from './helper';
7
7
  import { SankeyOptions } from './types';
@@ -146,6 +146,39 @@ export function nodeDraggable(params: Params<SankeyOptions>): Params<SankeyOptio
146
146
  return params;
147
147
  }
148
148
 
149
+ /**
150
+ * Interaction 配置
151
+ * @param params
152
+ */
153
+ function interaction(params: Params<SankeyOptions>): Params<SankeyOptions> {
154
+ const { chart, options } = params;
155
+ const { interactions = [] } = options;
156
+
157
+ const nodeInteractions = [].concat(interactions, options.nodeInteractions || []);
158
+ const edgeInteractions = [].concat(interactions, options.edgeInteractions || []);
159
+
160
+ const nodeView = findViewById(chart, NODES_VIEW_ID);
161
+ const edgeView = findViewById(chart, EDGES_VIEW_ID);
162
+
163
+ nodeInteractions.forEach((i) => {
164
+ if (i?.enable === false) {
165
+ nodeView.removeInteraction(i.type);
166
+ } else {
167
+ nodeView.interaction(i.type, i.cfg || {});
168
+ }
169
+ });
170
+
171
+ edgeInteractions.forEach((i) => {
172
+ if (i?.enable === false) {
173
+ edgeView.removeInteraction(i.type);
174
+ } else {
175
+ edgeView.interaction(i.type, i.cfg || {});
176
+ }
177
+ });
178
+
179
+ return params;
180
+ }
181
+
149
182
  /**
150
183
  * 图适配器
151
184
  * @param chart
@@ -2,117 +2,145 @@ import { Data, Options, State, StyleAttr } from '../../types';
2
2
  import { NodeDepth, NodeSort } from './layout';
3
3
 
4
4
  /**
5
- * node-link 数据类型的结构
5
+ * @title node-link 数据类型的结构
6
6
  */
7
7
  export type NodeLinkData = {
8
8
  /**
9
- * 节点数据
9
+ * @title 节点数据
10
10
  */
11
11
  readonly nodes: {
12
12
  /**
13
- * id 唯一即可,一般可以直接等于 name
13
+ * @title id
14
+ * @description 唯一即可,一般可以直接等于 name
14
15
  */
15
16
  readonly id: string;
16
17
  /**
17
- * 节点的名称,用于 UI 上的现实
18
+ * @title 节点的名称
19
+ * @description 用于 UI 上的现实
18
20
  */
19
21
  readonly name: string;
20
22
  /**
21
- * 节点的值,不传则节点大小有来源求和决定
23
+ * @title 节点的值
24
+ * @description 不传则节点大小有来源求和决定
22
25
  */
23
26
  readonly fixedValue?: number;
24
27
  }[];
25
- /**
26
- *
27
- */
28
+
28
29
  readonly links: {
29
30
  /**
30
- * 来源节点在 nodes 中的 index
31
+ * @title 来源节点
32
+ * @description 在 nodes 中的 index
31
33
  */
32
34
  readonly source: number;
33
35
  /**
34
- * 目标节点在 nodes 中的 index
36
+ * @title 目标节点
37
+ * @description 在 nodes 中的 index
35
38
  */
36
39
  readonly target: number;
37
40
  /**
38
- * 边的值
41
+ * @title 边的值
39
42
  */
40
43
  readonly value: number;
41
44
  }[];
42
45
  };
43
46
 
44
- /** 配置类型定义 */
47
+ /**
48
+ * @title 配置类型定义
49
+ */
45
50
  export interface SankeyOptions extends Omit<Options, 'data' | 'xField' | 'yField' | 'xAxis' | 'yAxis'> {
46
51
  /**
47
- * 数据集的类型,默认为 detail
52
+ * @title 数据集的类型
53
+ * @description 数据集的类型 'node-link' | 'detail'
54
+ * @default "detail"
48
55
  */
49
56
  readonly dataType?: 'node-link' | 'detail';
50
57
  /**
51
- * 来源字段,dataType = 'node-link' 的时候,不用传
58
+ * @title 来源字段
59
+ * @description dataType = 'node-link' 的时候,不用传
52
60
  */
53
61
  readonly sourceField?: string;
54
62
  /**
55
- * 去向字段,dataType = 'node-link' 的时候,不用传
63
+ * @title 去向字段
64
+ * @description dataType = 'node-link' 的时候,不用传
56
65
  */
57
66
  readonly targetField?: string;
58
67
  /**
59
- * 权重字段,dataType = 'node-link' 的时候,不用传
68
+ * @title 权重字段
69
+ * @description dataType = 'node-link' 的时候,不用传
60
70
  */
61
71
  readonly weightField?: string;
62
72
  /**
63
- * 附加的 元字段
73
+ * @title 附加的元字段
64
74
  */
65
75
  readonly rawFields?: string[];
66
76
  /**
67
- * 数据
77
+ * @title 数据
68
78
  */
69
79
  readonly data: Data | NodeLinkData;
70
80
  /**
71
- * 节点宽度的比如,参考画布的宽度,默认值为 0.008
81
+ * @title 节点宽度
82
+ * @description 参考画布的宽度
83
+ * @default 0.008
72
84
  */
73
85
  readonly nodeWidthRatio?: number;
74
86
  /**
75
- * 节点宽度的像素设置,优先级高于 nodeWidthRatio
87
+ * @title 节点宽度的像素设置
88
+ * @description 优先级高于 nodeWidthRatio
76
89
  */
77
90
  readonly nodeWidth?: number;
78
91
  /**
79
- * 节点之间的间距比例,参考画布高度,默认值为 0.03
92
+ * @title 节点之间的间距比例
93
+ * @description 参考画布高度
94
+ * @default 0.03
80
95
  */
81
96
  readonly nodePaddingRatio?: number;
82
97
  /**
83
- * 节点间距的像素设置,优先级高于 nodePaddingRatio
98
+ * @title 节点间距的像素设置
99
+ * @description 优先级高于 nodePaddingRatio
84
100
  */
85
101
  readonly nodePadding?: number;
86
102
  /**
87
- * 节点对齐的方式,默认为 justify
103
+ * @title 节点对齐的方式
104
+ * @description 节点对齐的方式 'left' | 'right' | 'center' | 'justify'
105
+ * @default "justify"
88
106
  */
89
107
  readonly nodeAlign?: 'left' | 'right' | 'center' | 'justify';
90
108
  /**
91
- * 节点排序方式,默认为空
109
+ * @title 节点排序方式
92
110
  */
93
111
  readonly nodeSort?: NodeSort;
94
112
  /**
95
- * 节点排放分层的顺序,从 0 开始,并且返回值需要保证所有的层级都有节点
113
+ * @title 节点排放分层的顺序
114
+ * @description 从 0 开始,并且返回值需要保证所有的层级都有节点
96
115
  */
97
116
  readonly nodeDepth?: NodeDepth;
98
117
  /**
99
- * 节点样式
118
+ * @title 节点样式
100
119
  */
101
120
  readonly nodeStyle?: StyleAttr;
102
121
  /**
103
- * 节点状态样式
122
+ * @title 节点状态样式
104
123
  */
105
124
  readonly nodeState?: State;
106
125
  /**
107
- * 边样式
126
+ * @title 边样式
108
127
  */
109
128
  readonly edgeStyle?: StyleAttr;
110
129
  /**
111
- * 边状态样式
130
+ * @title 边状态样式
112
131
  */
113
132
  readonly edgeState?: State;
114
133
  /**
115
- * 节点位置是否可以拖拽,默认为 false
134
+ * @title 节点位置是否可以拖拽
135
+ * @default false
116
136
  */
117
137
  readonly nodeDraggable?: boolean;
138
+ /**
139
+ * @title 边交互
140
+ */
141
+ readonly edgeInteractions?: Options['interactions'];
142
+ /**
143
+ * @title 节点交互
144
+ */
145
+ readonly nodeInteractions?: Options['interactions'];
118
146
  }
@@ -3,7 +3,7 @@ import { Params } from '../../core/adaptor';
3
3
  import { flow, deepAssign, pick } from '../../utils';
4
4
  import { point } from '../../adaptor/geometries';
5
5
  import { brushInteraction } from '../../adaptor/brush';
6
- import { interaction, animation, theme, scale, annotation } from '../../adaptor/common';
6
+ import { interaction, animation, theme, scale, annotation, slider, scrollbar } from '../../adaptor/common';
7
7
  import { findGeometry, transformLabel } from '../../utils';
8
8
  import { getQuadrantDefaultConfig, getPath, getMeta } from './util';
9
9
  import { ScatterOptions } from './types';
@@ -327,6 +327,8 @@ export function adaptor(params: Params<ScatterOptions>) {
327
327
  label,
328
328
  // 需要在 interaction 前面
329
329
  brushInteraction,
330
+ slider,
331
+ scrollbar,
330
332
  interaction,
331
333
  scatterAnnotation,
332
334
  animation,
@@ -15,59 +15,112 @@ interface Labels extends Omit<TextOption, 'position'> {
15
15
  }
16
16
 
17
17
  interface QuadrantOptions {
18
- /** x 方向上的象限分割基准线,默认为 0 */
18
+ /**
19
+ * @title x 基准线
20
+ * @description x 方向上的象限分割基准线
21
+ * @default 0
22
+ */
19
23
  readonly xBaseline?: number;
20
- /** y 方向上的象限分割基准线,默认为 0 */
24
+ /**
25
+ * @title y 基准线
26
+ * @description y 方向上的象限分割基准线
27
+ * @default 0
28
+ */
21
29
  readonly yBaseline?: number;
22
- /** 配置象限分割线的样式 */
30
+ /**
31
+ * @title 配置象限分割线的样式
32
+ */
23
33
  readonly lineStyle?: RegionPositionBaseOption;
24
- /** 象限样式 */
34
+ /**
35
+ * @title 象限样式
36
+ */
25
37
  readonly regionStyle?: RegionPositionBaseOption[];
26
- /** 象限文本配置 */
38
+ /**
39
+ * @title 象限文本
40
+ */
27
41
  readonly labels?: Labels[];
28
42
  }
29
43
 
30
44
  export interface RegressionLineOptions {
31
- /** 是否顶层显示,默认 false */
45
+ /**
46
+ * @title 是否顶层显示
47
+ * @default false
48
+ */
32
49
  readonly top?: boolean;
33
- /** 回归线类型 */
50
+ /**
51
+ * @title 回归线类型
52
+ */
34
53
  readonly type?: string;
35
- /** 配置回归线样式 */
54
+ /**
55
+ * @title 配置回归线样式
56
+ */
36
57
  readonly style?: ShapeStyle;
37
- /** 自定义算法 [[0,0],[100,100]] */
58
+ /**
59
+ * @title 自定义算法
60
+ * @description [[0,0],[100,100]]
61
+ */
38
62
  readonly algorithm?: Array<[number, number]> | ((data: any) => Array<[number, number]>);
39
63
  }
40
64
 
41
65
  export interface ScatterOptions extends Options {
42
- /** x 轴字段 */
66
+ /**
67
+ * @title x 轴字段
68
+ */
43
69
  readonly xField: string;
44
- /** y 轴字段 */
70
+ /**
71
+ * @title y 轴字段
72
+ */
45
73
  readonly yField: string;
46
- /** 数据调整类型 */
74
+ /**
75
+ * @title 数据调整类型
76
+ * @description 数据调整类型 'jitter' | 'stack' | 'symmetric' | 'dodge'
77
+ */
47
78
  readonly type?: 'jitter' | 'stack' | 'symmetric' | 'dodge';
48
- /** 点大小映射对应的数据字段名 */
79
+ /**
80
+ * @title 点大小映射对应的数据字段名
81
+ */
49
82
  readonly sizeField?: string;
50
- /** size 对应的图例 */
83
+ /**
84
+ * @title size 对应的图例
85
+ */
51
86
  readonly sizeLegend?: Options['legend'];
52
- /** 散点图大小 */
87
+ /**
88
+ * @title 散点图大小
89
+ */
53
90
  readonly size?: SizeAttr;
54
- /** 点形状映射对应的数据字段名 */
91
+ /**
92
+ * @title 点形状映射对应的数据字段名
93
+ */
55
94
  readonly shapeField?: string;
56
- /** shape 对应的图例 */
95
+ /**
96
+ * @title shape 对应的图例
97
+ */
57
98
  readonly shapeLegend?: Options['legend'];
58
- /** 散点图形状 */
99
+ /**
100
+ * @title 散点图形状
101
+ */
59
102
  readonly shape?: ShapeAttr;
60
- /** 散点图样式 */
103
+ /**
104
+ * @title 散点图样式
105
+ */
61
106
  readonly pointStyle?: StyleAttr;
62
- /** 点颜色映射对应的数据字段名 */
107
+ /**
108
+ * @title 点颜色映射对应的数据字段名
109
+ */
63
110
  readonly colorField?: string;
64
111
 
65
112
  // 图表标注组件
66
- /** 四象限组件 */
113
+
114
+ /**
115
+ * @title 四象限组件
116
+ */
67
117
  readonly quadrant?: QuadrantOptions;
68
- /** 归曲线 */
118
+ /**
119
+ * @title 归曲线
120
+ */
69
121
  readonly regressionLine?: RegressionLineOptions;
70
-
71
- // 图表交互
122
+ /**
123
+ * @title 图表交互
124
+ */
72
125
  readonly brush?: BrushCfg;
73
126
  }