@antv/g2plot 2.4.8 → 2.4.11

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 (273) hide show
  1. package/CHANGELOG.md +32 -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/types.d.ts +35 -10
  12. package/esm/plots/area/types.js.map +1 -1
  13. package/esm/plots/bar/types.d.ts +16 -3
  14. package/esm/plots/bar/types.js.map +1 -1
  15. package/esm/plots/bidirectional-bar/types.d.ts +21 -6
  16. package/esm/plots/bidirectional-bar/types.js.map +1 -1
  17. package/esm/plots/box/types.d.ts +20 -6
  18. package/esm/plots/box/types.js.map +1 -1
  19. package/esm/plots/bullet/types.d.ts +36 -9
  20. package/esm/plots/bullet/types.js.map +1 -1
  21. package/esm/plots/chord/types.d.ts +14 -10
  22. package/esm/plots/chord/types.js.map +1 -1
  23. package/esm/plots/circle-packing/types.d.ts +25 -8
  24. package/esm/plots/circle-packing/types.js.map +1 -1
  25. package/esm/plots/column/types.d.ts +57 -16
  26. package/esm/plots/column/types.js.map +1 -1
  27. package/esm/plots/dual-axes/types.d.ts +31 -6
  28. package/esm/plots/dual-axes/types.js.map +1 -1
  29. package/esm/plots/facet/types.d.ts +54 -34
  30. package/esm/plots/facet/types.js.map +1 -1
  31. package/esm/plots/funnel/geometries/compare.js +2 -1
  32. package/esm/plots/funnel/geometries/compare.js.map +1 -1
  33. package/esm/plots/funnel/geometries/facet.js +2 -1
  34. package/esm/plots/funnel/geometries/facet.js.map +1 -1
  35. package/esm/plots/funnel/types.d.ts +45 -11
  36. package/esm/plots/funnel/types.js.map +1 -1
  37. package/esm/plots/gauge/adaptor.js +31 -3
  38. package/esm/plots/gauge/adaptor.js.map +1 -1
  39. package/esm/plots/gauge/types.d.ts +84 -22
  40. package/esm/plots/gauge/types.js.map +1 -1
  41. package/esm/plots/heatmap/types.d.ts +47 -12
  42. package/esm/plots/heatmap/types.js.map +1 -1
  43. package/esm/plots/histogram/types.d.ts +17 -6
  44. package/esm/plots/histogram/types.js.map +1 -1
  45. package/esm/plots/line/types.d.ts +42 -12
  46. package/esm/plots/line/types.js.map +1 -1
  47. package/esm/plots/liquid/index.d.ts +1 -0
  48. package/esm/plots/liquid/index.js +1 -0
  49. package/esm/plots/liquid/index.js.map +1 -1
  50. package/esm/plots/liquid/shapes/liquid.d.ts +16 -1
  51. package/esm/plots/liquid/shapes/liquid.js +13 -8
  52. package/esm/plots/liquid/shapes/liquid.js.map +1 -1
  53. package/esm/plots/liquid/types.d.ts +56 -16
  54. package/esm/plots/liquid/types.js.map +1 -1
  55. package/esm/plots/mix/types.d.ts +31 -22
  56. package/esm/plots/mix/types.js.map +1 -1
  57. package/esm/plots/pie/types.d.ts +27 -10
  58. package/esm/plots/pie/types.js.map +1 -1
  59. package/esm/plots/progress/types.d.ts +13 -4
  60. package/esm/plots/progress/types.js.map +1 -1
  61. package/esm/plots/radar/types.d.ts +39 -12
  62. package/esm/plots/radar/types.js.map +1 -1
  63. package/esm/plots/radial-bar/types.d.ts +39 -12
  64. package/esm/plots/radial-bar/types.js.map +1 -1
  65. package/esm/plots/ring-progress/types.d.ts +18 -6
  66. package/esm/plots/ring-progress/types.js.map +1 -1
  67. package/esm/plots/rose/types.d.ts +32 -12
  68. package/esm/plots/rose/types.js.map +1 -1
  69. package/esm/plots/sankey/types.d.ts +51 -32
  70. package/esm/plots/sankey/types.js.map +1 -1
  71. package/esm/plots/scatter/types.d.ts +76 -22
  72. package/esm/plots/scatter/types.js.map +1 -1
  73. package/esm/plots/stock/types.d.ts +20 -7
  74. package/esm/plots/stock/types.js.map +1 -1
  75. package/esm/plots/sunburst/types.d.ts +40 -12
  76. package/esm/plots/sunburst/types.js.map +1 -1
  77. package/esm/plots/tiny-area/types.d.ts +16 -5
  78. package/esm/plots/tiny-area/types.js.map +1 -1
  79. package/esm/plots/tiny-column/types.d.ts +10 -3
  80. package/esm/plots/tiny-column/types.js.map +1 -1
  81. package/esm/plots/tiny-line/types.d.ts +17 -5
  82. package/esm/plots/tiny-line/types.js.map +1 -1
  83. package/esm/plots/treemap/types.d.ts +17 -6
  84. package/esm/plots/treemap/types.js.map +1 -1
  85. package/esm/plots/venn/types.d.ts +20 -6
  86. package/esm/plots/venn/types.js.map +1 -1
  87. package/esm/plots/violin/types.d.ts +52 -17
  88. package/esm/plots/violin/types.js.map +1 -1
  89. package/esm/plots/waterfall/types.d.ts +42 -10
  90. package/esm/plots/waterfall/types.js.map +1 -1
  91. package/esm/plots/word-cloud/types.d.ts +91 -44
  92. package/esm/plots/word-cloud/types.js.map +1 -1
  93. package/esm/types/button.d.ts +8 -4
  94. package/esm/types/button.js.map +1 -1
  95. package/esm/types/common.d.ts +145 -33
  96. package/esm/types/common.js.map +1 -1
  97. package/esm/types/drill-down.d.ts +28 -7
  98. package/esm/types/drill-down.js.map +1 -1
  99. package/esm/types/interaction.d.ts +26 -6
  100. package/esm/types/interaction.js.map +1 -1
  101. package/esm/types/label.d.ts +11 -3
  102. package/esm/types/label.js.map +1 -1
  103. package/esm/types/meta.d.ts +4 -7
  104. package/esm/types/meta.js.map +1 -1
  105. package/esm/types/pattern.d.ts +58 -18
  106. package/esm/types/pattern.js.map +1 -1
  107. package/esm/types/state.d.ts +11 -3
  108. package/esm/types/state.js.map +1 -1
  109. package/esm/types/statistic.d.ts +38 -6
  110. package/esm/types/statistic.js.map +1 -1
  111. package/esm/types/tooltip.d.ts +7 -2
  112. package/esm/types/tooltip.js.map +1 -1
  113. package/lib/core/plot.d.ts +2 -2
  114. package/lib/core/plot.js +4 -3
  115. package/lib/core/plot.js.map +1 -1
  116. package/lib/index.d.ts +2 -2
  117. package/lib/index.js +2 -1
  118. package/lib/index.js.map +1 -1
  119. package/lib/plots/area/types.d.ts +35 -10
  120. package/lib/plots/area/types.js.map +1 -1
  121. package/lib/plots/bar/types.d.ts +16 -3
  122. package/lib/plots/bar/types.js.map +1 -1
  123. package/lib/plots/bidirectional-bar/types.d.ts +21 -6
  124. package/lib/plots/bidirectional-bar/types.js.map +1 -1
  125. package/lib/plots/box/types.d.ts +20 -6
  126. package/lib/plots/box/types.js.map +1 -1
  127. package/lib/plots/bullet/types.d.ts +36 -9
  128. package/lib/plots/bullet/types.js.map +1 -1
  129. package/lib/plots/chord/types.d.ts +14 -10
  130. package/lib/plots/chord/types.js.map +1 -1
  131. package/lib/plots/circle-packing/types.d.ts +25 -8
  132. package/lib/plots/circle-packing/types.js.map +1 -1
  133. package/lib/plots/column/types.d.ts +57 -16
  134. package/lib/plots/column/types.js.map +1 -1
  135. package/lib/plots/dual-axes/types.d.ts +31 -6
  136. package/lib/plots/dual-axes/types.js.map +1 -1
  137. package/lib/plots/facet/types.d.ts +54 -34
  138. package/lib/plots/facet/types.js.map +1 -1
  139. package/lib/plots/funnel/geometries/compare.js +2 -1
  140. package/lib/plots/funnel/geometries/compare.js.map +1 -1
  141. package/lib/plots/funnel/geometries/facet.js +2 -1
  142. package/lib/plots/funnel/geometries/facet.js.map +1 -1
  143. package/lib/plots/funnel/types.d.ts +45 -11
  144. package/lib/plots/funnel/types.js.map +1 -1
  145. package/lib/plots/gauge/adaptor.js +30 -2
  146. package/lib/plots/gauge/adaptor.js.map +1 -1
  147. package/lib/plots/gauge/types.d.ts +84 -22
  148. package/lib/plots/gauge/types.js.map +1 -1
  149. package/lib/plots/heatmap/types.d.ts +47 -12
  150. package/lib/plots/heatmap/types.js.map +1 -1
  151. package/lib/plots/histogram/types.d.ts +17 -6
  152. package/lib/plots/histogram/types.js.map +1 -1
  153. package/lib/plots/line/types.d.ts +42 -12
  154. package/lib/plots/line/types.js.map +1 -1
  155. package/lib/plots/liquid/index.d.ts +1 -0
  156. package/lib/plots/liquid/index.js +2 -0
  157. package/lib/plots/liquid/index.js.map +1 -1
  158. package/lib/plots/liquid/shapes/liquid.d.ts +16 -1
  159. package/lib/plots/liquid/shapes/liquid.js +14 -7
  160. package/lib/plots/liquid/shapes/liquid.js.map +1 -1
  161. package/lib/plots/liquid/types.d.ts +56 -16
  162. package/lib/plots/liquid/types.js.map +1 -1
  163. package/lib/plots/mix/types.d.ts +31 -22
  164. package/lib/plots/mix/types.js.map +1 -1
  165. package/lib/plots/pie/types.d.ts +27 -10
  166. package/lib/plots/pie/types.js.map +1 -1
  167. package/lib/plots/progress/types.d.ts +13 -4
  168. package/lib/plots/progress/types.js.map +1 -1
  169. package/lib/plots/radar/types.d.ts +39 -12
  170. package/lib/plots/radar/types.js.map +1 -1
  171. package/lib/plots/radial-bar/types.d.ts +39 -12
  172. package/lib/plots/radial-bar/types.js.map +1 -1
  173. package/lib/plots/ring-progress/types.d.ts +18 -6
  174. package/lib/plots/ring-progress/types.js.map +1 -1
  175. package/lib/plots/rose/types.d.ts +32 -12
  176. package/lib/plots/rose/types.js.map +1 -1
  177. package/lib/plots/sankey/types.d.ts +51 -32
  178. package/lib/plots/sankey/types.js.map +1 -1
  179. package/lib/plots/scatter/types.d.ts +76 -22
  180. package/lib/plots/scatter/types.js.map +1 -1
  181. package/lib/plots/stock/types.d.ts +20 -7
  182. package/lib/plots/stock/types.js.map +1 -1
  183. package/lib/plots/sunburst/types.d.ts +40 -12
  184. package/lib/plots/sunburst/types.js.map +1 -1
  185. package/lib/plots/tiny-area/types.d.ts +16 -5
  186. package/lib/plots/tiny-area/types.js.map +1 -1
  187. package/lib/plots/tiny-column/types.d.ts +10 -3
  188. package/lib/plots/tiny-column/types.js.map +1 -1
  189. package/lib/plots/tiny-line/types.d.ts +17 -5
  190. package/lib/plots/tiny-line/types.js.map +1 -1
  191. package/lib/plots/treemap/types.d.ts +17 -6
  192. package/lib/plots/treemap/types.js.map +1 -1
  193. package/lib/plots/venn/types.d.ts +20 -6
  194. package/lib/plots/venn/types.js.map +1 -1
  195. package/lib/plots/violin/types.d.ts +52 -17
  196. package/lib/plots/violin/types.js.map +1 -1
  197. package/lib/plots/waterfall/types.d.ts +42 -10
  198. package/lib/plots/waterfall/types.js.map +1 -1
  199. package/lib/plots/word-cloud/types.d.ts +91 -44
  200. package/lib/plots/word-cloud/types.js.map +1 -1
  201. package/lib/types/button.d.ts +8 -4
  202. package/lib/types/button.js.map +1 -1
  203. package/lib/types/common.d.ts +145 -33
  204. package/lib/types/common.js.map +1 -1
  205. package/lib/types/drill-down.d.ts +28 -7
  206. package/lib/types/drill-down.js.map +1 -1
  207. package/lib/types/interaction.d.ts +26 -6
  208. package/lib/types/interaction.js.map +1 -1
  209. package/lib/types/label.d.ts +11 -3
  210. package/lib/types/label.js.map +1 -1
  211. package/lib/types/meta.d.ts +4 -7
  212. package/lib/types/meta.js.map +1 -1
  213. package/lib/types/pattern.d.ts +58 -18
  214. package/lib/types/pattern.js.map +1 -1
  215. package/lib/types/state.d.ts +11 -3
  216. package/lib/types/state.js.map +1 -1
  217. package/lib/types/statistic.d.ts +38 -6
  218. package/lib/types/statistic.js.map +1 -1
  219. package/lib/types/tooltip.d.ts +7 -2
  220. package/lib/types/tooltip.js.map +1 -1
  221. package/package.json +1 -1
  222. package/src/core/plot.ts +5 -4
  223. package/src/index.ts +2 -2
  224. package/src/plots/area/types.ts +35 -10
  225. package/src/plots/bar/types.ts +16 -3
  226. package/src/plots/bidirectional-bar/types.ts +21 -6
  227. package/src/plots/box/types.ts +20 -6
  228. package/src/plots/bullet/types.ts +36 -17
  229. package/src/plots/chord/types.ts +14 -11
  230. package/src/plots/circle-packing/types.ts +25 -14
  231. package/src/plots/column/types.ts +57 -20
  232. package/src/plots/dual-axes/types.ts +31 -16
  233. package/src/plots/facet/types.ts +54 -49
  234. package/src/plots/funnel/geometries/compare.ts +2 -0
  235. package/src/plots/funnel/geometries/facet.ts +2 -1
  236. package/src/plots/funnel/types.ts +45 -14
  237. package/src/plots/gauge/adaptor.ts +38 -2
  238. package/src/plots/gauge/types.ts +87 -28
  239. package/src/plots/heatmap/types.ts +49 -14
  240. package/src/plots/histogram/types.ts +17 -9
  241. package/src/plots/line/types.ts +42 -14
  242. package/src/plots/liquid/index.ts +2 -0
  243. package/src/plots/liquid/shapes/liquid.ts +16 -8
  244. package/src/plots/liquid/types.ts +56 -16
  245. package/src/plots/mix/types.ts +31 -35
  246. package/src/plots/pie/types.ts +27 -10
  247. package/src/plots/progress/types.ts +13 -4
  248. package/src/plots/radar/types.ts +39 -12
  249. package/src/plots/radial-bar/types.ts +39 -12
  250. package/src/plots/ring-progress/types.ts +18 -6
  251. package/src/plots/rose/types.ts +32 -12
  252. package/src/plots/sankey/types.ts +52 -32
  253. package/src/plots/scatter/types.ts +77 -24
  254. package/src/plots/stock/types.ts +21 -8
  255. package/src/plots/sunburst/types.ts +42 -12
  256. package/src/plots/tiny-area/types.ts +16 -5
  257. package/src/plots/tiny-column/types.ts +10 -3
  258. package/src/plots/tiny-line/types.ts +17 -5
  259. package/src/plots/treemap/types.ts +17 -7
  260. package/src/plots/venn/types.ts +21 -6
  261. package/src/plots/violin/types.ts +52 -17
  262. package/src/plots/waterfall/types.ts +42 -10
  263. package/src/plots/word-cloud/types.ts +91 -44
  264. package/src/types/button.ts +8 -4
  265. package/src/types/common.ts +145 -37
  266. package/src/types/drill-down.ts +28 -7
  267. package/src/types/interaction.ts +26 -6
  268. package/src/types/label.ts +11 -3
  269. package/src/types/meta.ts +4 -7
  270. package/src/types/pattern.ts +58 -18
  271. package/src/types/state.ts +11 -3
  272. package/src/types/statistic.ts +38 -6
  273. package/src/types/tooltip.ts +7 -2
@@ -1,40 +1,75 @@
1
1
  import { Options, State, StyleAttr } from '../../types';
2
2
 
3
3
  export interface ViolinOptions extends Options {
4
- /** X 轴映射 */
4
+ /**
5
+ * @title X 轴映射
6
+ */
5
7
  readonly xField: string;
6
- /** Y 轴映射 */
8
+ /**
9
+ * @title Y 轴映射
10
+ */
7
11
  readonly yField: string;
8
- /** 拆分字段映射,默认是分组情况,颜色作为视觉通道 */
12
+ /**
13
+ * @title 拆分字段映射
14
+ * @default "分组情况,颜色作为视觉通道 "
15
+ */
9
16
  readonly seriesField?: string;
10
- /** 内部箱线图配置,false 为不显示。 */
17
+ /**
18
+ * @title 内部箱线图配置
19
+ * @description false 为不显示
20
+ */
11
21
  readonly box?:
12
22
  | boolean
13
23
  | {
14
- /** 箱线图 状态样式设置 */
24
+ /**
25
+ * @title 箱线图
26
+ * @description 状态样式设置
27
+ */
15
28
  state: State;
16
29
  };
17
30
  /**
18
- * 小提琴的形状。
19
- * 默认: 非平滑、实心
20
- * smooth: 平滑
21
- * hollow: 空心
22
- * hollow-smooth: 平滑、空心
31
+ * @title 小提琴的形状
32
+ * @description smooth: 平滑,hollow: 空心,hollow-smooth: 平滑、空心.
33
+ * @default "非平滑、实心"
23
34
  */
24
35
  readonly shape?: 'smooth' | 'hollow' | 'hollow-smooth';
25
- /** 小提琴样式配置,可选 */
36
+ /**
37
+ * @title 小提琴样式配置
38
+ */
26
39
  readonly violinStyle?: StyleAttr;
27
- /** 核函数配置,当前只支持三角核 */
40
+ /**
41
+ * @title 核函数配置
42
+ * @description 核函数配置,当前只支持三角核
43
+ */
28
44
  readonly kde?: {
29
- /** 三角波类型 */
45
+ /**
46
+ * @title 三角波类型
47
+ * @description 三角波类型'triangular'
48
+ */
30
49
  type: 'triangular';
31
- /** 最小值,默认为数据中的最小值减去一个固定的阈值。 */
50
+ /**
51
+ * @title 最小值
52
+ * @description 默认为数据中的最小值减去一个固定的阈值
53
+ * @default "数据中的最小值减去一个固定的阈值"
54
+ */
32
55
  min?: number;
33
- /** 最大值,默认为数据中的最大值加上一个固定的阈值。 */
56
+ /**
57
+ * @title 最大值
58
+ * @description 默认为数据中的最大值减去一个固定的阈值
59
+ * @default "数据中的最大值减去一个固定的阈值"
60
+ */
34
61
  max?: number;
35
- /** 采样数量,越大轮廓线越接近真实概率分布函数,默认32。 */
62
+ /**
63
+ * @title 采样数量
64
+ * @description 越大轮廓线越接近真实概率分布函数
65
+ * @default "32"
66
+ */
36
67
  sampleSize?: number;
37
- /** 核函数的带宽。带宽越大产生的曲线越平滑(越模糊),带宽越小产生的曲线越陡峭。默认3。 */
68
+ /**
69
+ * @title 核函数的带宽
70
+ * @description 带宽越大产生的曲线越平滑(越模糊),带宽越小产生的曲线越陡峭
71
+ * @default "3"
72
+ */
38
73
  width?: number;
39
74
  } /* | { type: 'gaussian', } ⬅️ 像这样添加新的核函数支持 */;
40
75
  }
@@ -2,33 +2,65 @@ import { Options, ShapeStyle, StyleAttr } from '../../types';
2
2
 
3
3
  /** totalCfg of waterfall */
4
4
  type TotalCfg = {
5
- /** 总计的标签 */
5
+ /**
6
+ * @title 总计的标签
7
+ */
6
8
  label?: string;
9
+ /**
10
+ * @title 样式
11
+ */
7
12
  style?: ShapeStyle;
8
13
  };
9
14
 
10
15
  /** leaderLineCfg of waterfall */
11
16
  type LeaderLineCfg = {
17
+ /**
18
+ * @title 样式
19
+ */
12
20
  style?: ShapeStyle;
13
21
  };
14
22
 
15
23
  export interface WaterfallOptions extends Options {
16
- /** x 轴字段 */
24
+ /**
25
+ * @title x 轴字段
26
+ */
17
27
  readonly xField: string;
18
- /** y 轴字段 */
28
+ /**
29
+ * @title y 轴字段
30
+ */
19
31
  readonly yField: string;
20
- /** label 数据模式, default: difference */
32
+ /**
33
+ * @title label 数据模式
34
+ * @description absolute' | 'difference'
35
+ * @default "difference"
36
+ */
21
37
  readonly labelMode?: 'absolute' | 'difference';
22
- /** 是否展示 总计 */
38
+ /**
39
+ * @title 是否展示 总计
40
+ * @description false | TotalCfg
41
+ */
23
42
  readonly total?: false | TotalCfg;
24
- /** 是否展示 柱子间牵引线 */
43
+ /**
44
+ * @title 是否展示 柱子间牵引线
45
+ * @description false | LeaderLineCfg
46
+ */
25
47
  readonly leaderLine?: false | LeaderLineCfg;
26
- /** 上涨色 */
48
+ /**
49
+ * @title 上涨色
50
+ */
27
51
  readonly risingFill?: string;
28
- /** 下跌色 */
52
+ /**
53
+ * @title 下跌色
54
+ */
29
55
  readonly fallingFill?: string;
30
- /** 柱子样式配置; 注意: fill 不再生效,直接使用 risingFill, fallingFill 或 color */
56
+ /**
57
+ * @title 柱子样式配置
58
+ * @description 注意: fill 不再生效,直接使用 risingFill, fallingFill 或 color
59
+ */
31
60
  readonly waterfallStyle?: StyleAttr;
32
- /** 柱状图宽度占比 [0-1] */
61
+ /**
62
+ * @title 柱状图宽度占比
63
+ * @description 范围0-1
64
+ */
33
65
  readonly columnWidthRatio?: number;
34
66
  }
@@ -4,99 +4,146 @@ type FontWeight = ShapeStyle['fontWeight'];
4
4
 
5
5
  /** 一个文本信息,wordCloud 内部 */
6
6
  export interface Word {
7
- /** 文本内容 */
7
+ /**
8
+ * @title 文本内容
9
+ */
8
10
  text: string;
9
- /** 该文本所占权重 */
11
+ /**
12
+ * @title 该文本所占权重
13
+ */
10
14
  value: number;
11
- /** 用于指定颜色字段 */
15
+ /**
16
+ * @title 用于指定颜色字段
17
+ */
12
18
  color: string | number;
13
- /** 原始数据 */
19
+ /**
20
+ * @title 原始数据
21
+ */
14
22
  datum: Datum;
15
23
  }
16
24
 
17
25
  export type Tag = Word & {
18
- /** 字体 */
26
+ /**
27
+ * @title 字体
28
+ */
19
29
  font?: string;
20
- /** 字体样式 */
30
+ /**
31
+ * @title 字体样式
32
+ */
21
33
  style?: ShapeStyle['fontStyle'];
22
- /** 文本粗细 */
34
+ /**
35
+ * @title 文本粗细
36
+ */
23
37
  weight?: FontWeight;
24
- /** 旋转角度 */
38
+ /**
39
+ * @title 旋转角度
40
+ */
25
41
  rotate?: number;
26
- /** 字体大小 */
42
+ /**
43
+ * @title 字体大小
44
+ */
27
45
  size?: number;
28
- /** 一个单词所占的盒子的内边距,值越大单词之间的间隔越大 */
46
+ /**
47
+ * @title 一个单词所占的盒子的内边距
48
+ * @description 值越大单词之间的间隔越大
49
+ */
29
50
  padding?: number;
30
- /** 是否包含文本 */
51
+ /**
52
+ * @title 是否包含文本
53
+ * @default false
54
+ */
31
55
  hasText?: boolean;
32
- /** 单词所占盒子的宽度 */
56
+ /**
57
+ * @title 单词所占盒子的宽度
58
+ */
33
59
  width?: number;
34
- /** 单词所占盒子的高度 */
60
+ /**
61
+ * @title 单词所占盒子的高度
62
+ */
35
63
  height?: number;
36
- /** x 轴坐标 */
64
+ /**
65
+ * @title x 轴坐标
66
+ */
37
67
  x?: number;
38
- /** y 轴坐标 */
68
+ /**
69
+ * @title y 轴坐标
70
+ */
39
71
  y?: number;
40
72
  };
41
73
 
42
74
  /** 词云字体样式 */
43
75
  export interface WordStyle {
44
- /** 词云的字体, 当为函数时,其参数是一个经过处理之后的数据元素的值 */
76
+ /**
77
+ * @title 词云的字体
78
+ * @description 当为函数时,其参数是一个经过处理之后的数据元素的值
79
+ */
45
80
  readonly fontFamily?: string | ((word: Word, index?: number, words?: Word[]) => string);
46
- /** 设置字体的粗细, 当为函数时,其参数是一个经过处理之后的数据元素的值 */
81
+ /**
82
+ * @title 设置字体的粗细
83
+ * @description 当为函数时,其参数是一个经过处理之后的数据元素的值
84
+ */
47
85
  readonly fontWeight?: FontWeight | ((word: Word, index?: number, words?: Word[]) => FontWeight);
48
86
  /**
49
- * 每个单词所占的盒子的内边距,默认为 1。 越大单词之间的间隔越大。
50
- * 当为函数时,其参数是一个经过处理之后的数据元素的值
87
+ * @title 每个单词所占的盒子的内边距
88
+ * @description 当为函数时,其参数是一个经过处理之后的数据元素的值 越大单词之间的间隔越大
89
+ * @default 1
51
90
  */
52
91
  readonly padding?: number | ((word: Word, index?: number, words?: Word[]) => number);
53
- /** 字体的大小范围,当为函数时,其参数是一个经过处理之后的数据元素的值 */
92
+ /**
93
+ * @title 字体的大小范围
94
+ * @description 当为函数时,其参数是一个经过处理之后的数据元素的值
95
+ */
54
96
  readonly fontSize?: [number, number] | number | ((word: Word, index?: number, words?: Word[]) => number);
55
97
  /**
56
- * 旋转的最小角度和最大角度 默认 [0, 90]。
57
- *
58
- * 注意:如果值是 number 或者 function ,则
59
- * `rotationSteps` 选项将失效。
98
+ * @title 旋转的最小角度和最大角度
99
+ * @description 如果值是 number 或者 function ,则 `rotationSteps` 选项将失效
100
+ * @default "[0, 90]"
60
101
  */
61
102
  readonly rotation?: [number, number] | number | ((word: Word, index?: number, words?: Word[]) => number);
62
103
  /**
63
- * 旋转实际的步数,越大可能旋转角度越小, 默认是 2。
64
- *
65
- * 例如:如果 `rotation` 的值是 [0, 90],`rotationSteps` 的值是 3,
66
- * 则最终可能旋转的角度有三种,分别是 0 度、45度和 90 度。
104
+ * @title 旋转实际的步数
105
+ * @description 越大可能旋转角度越小,* 例如:如果 `rotation` 的值是 [0, 90],`rotationSteps` 的值是 3,则最终可能旋转的角度有三种,分别是 0 度、45度和 90 度。
106
+ * @default 2
67
107
  */
68
108
  readonly rotationSteps?: number;
69
109
  }
70
110
 
71
111
  export interface WordCloudOptions extends Options {
72
- /** 词条内容字段 */
112
+ /**
113
+ * @title 词条内容字段
114
+ */
73
115
  readonly wordField: string;
74
- /** 词条权重字段 */
116
+ /**
117
+ * @title 词条权重字段
118
+ */
75
119
  readonly weightField: string;
76
- /** 根据该字段进行颜色映射 */
120
+ /**
121
+ * @title 根据该字段进行颜色映射
122
+ */
77
123
  readonly colorField?: string;
78
- /** 遮罩图片实例,可以是图片 URL 或者 base64 */
124
+ /**
125
+ * @title 遮罩图片实例
126
+ * @description 可以是图片 URL 或者 base64
127
+ */
79
128
  readonly imageMask?: HTMLImageElement | string;
80
- /** 最大执行时间 */
129
+ /**
130
+ * @title 最大执行时间
131
+ */
81
132
  readonly timeInterval?: number;
82
133
  /**
83
- * 自定义所使用的随机函数,其值可以是一个 [0, 1) 区间中的值,
84
- * 也可以是一个返回该值的函数,当该值是一个固定的值时,每次渲染
85
- * 相同数据的词云图时,其对应的每个单词的布局坐标一致。
86
- *
87
- * 默认使用的是浏览器内置的 Math.random,也就是每次渲染,单词的位置都不一样。
134
+ * @title 自定义所使用的随机函数
135
+ * @description 其值可以是一个 [0, 1) 区间中的值;也可以是一个返回该值的函数,当该值是一个固定的值时,每次渲染;相同数据的词云图时,其对应的每个单词的布局坐标一致。
88
136
  */
89
137
  readonly random?: number | (() => number);
90
138
  /**
91
- * 1,当设置为 `archimedean` 时,整个词云图接近于`椭圆`的形状。
92
- * 2,当设置为 `rectangular` 时,整个词云图接近于`矩形`的形状。
93
- * 默认是 `archimedean`。
139
+ * @title 词云图形状
140
+ * @description 1,当设置为 `archimedean` 时,整个词云图接近于`椭圆`的形状。 2,当设置为 `rectangular` 时,整个词云图接近于`矩形`的形状。
141
+ * @default "archimedean"
94
142
  */
95
143
  readonly spiral?: 'archimedean' | 'rectangular';
96
144
  /**
97
- * 自定义每个词语的坐标。
98
- * 返回值必须包含 x 和 y 属性,其余的可选。也可以在 `wordStyle` 中的
99
- * 选项中设置。
145
+ * @title 自定义每个词语的坐标。
146
+ * @description 返回值必须包含 x 和 y 属性,其余的可选。也可以在 `wordStyle` 中的选项中设置。
100
147
  */
101
148
  readonly placementStrategy?: (word: Word, index?: number, words?: Word[]) => Partial<Tag> & { x: number; y: number };
102
149
  readonly wordStyle?: WordStyle;
@@ -7,21 +7,25 @@ import { ShapeAttrs } from '@antv/g2';
7
7
  */
8
8
  export type ButtonCfg = {
9
9
  /**
10
- * 文本与按钮边缘的间距
10
+ * @title 间距
11
+ * @description 文本与按钮边缘的间距
11
12
  */
12
13
  padding?: number | number[];
13
14
  /**
14
- * 按钮文本
15
+ * @title 文本
16
+ * @description 按钮文本
15
17
  */
16
18
  text?: string;
17
19
  /**
18
- * 自定义文本样式
20
+ * @title 文本样式
21
+ * @title 自定义文本样式
19
22
  */
20
23
  textStyle?: {
21
24
  default?: ShapeAttrs;
22
25
  };
23
26
  /**
24
- * 自定义按钮样式
27
+ * @title 按钮样式
28
+ * @description 自定义按钮样式
25
29
  */
26
30
  buttonStyle?: {
27
31
  default?: ShapeAttrs;
@@ -34,9 +34,15 @@ export type Position = [number, number];
34
34
 
35
35
  /** 一个区域描述 */
36
36
  export type Region = {
37
- /** the top-left corner of layer-range, range from 0 to 1, relative to parent layer's range */
37
+ /**
38
+ * @title 开始位置
39
+ * @description the top-left corner of layer-range, range from 0 to 1, relative to parent layer's range
40
+ */
38
41
  readonly start: Point;
39
- /** the bottom-right corner of layer-range, range from 0 to 1, relative to parent layer's range */
42
+ /**
43
+ * @title 结束位置
44
+ * @description the bottom-right corner of layer-range, range from 0 to 1, relative to parent layer's range
45
+ */
40
46
  readonly end: Point;
41
47
  };
42
48
 
@@ -50,17 +56,29 @@ export type BBox = {
50
56
 
51
57
  /** 文字 */
52
58
  export type TextStyle = {
53
- /** 文本大小 */
59
+ /**
60
+ * @title 文本大小
61
+ */
54
62
  readonly fontSize?: number;
55
- /** 字体系列 */
63
+ /**
64
+ * @title 字体系列
65
+ */
56
66
  readonly fontFamily?: string;
57
- /** 文本粗细 */
67
+ /**
68
+ * @title 文本粗细
69
+ */
58
70
  readonly fontWeight?: number;
59
- /** 文本行高 */
71
+ /**
72
+ * @title 文本行高
73
+ */
60
74
  readonly lineHeight?: number;
61
- /** 文本对齐方式 */
75
+ /**
76
+ * @title 文本对齐方式
77
+ */
62
78
  readonly textAlign?: 'center' | 'left' | 'right';
63
- /** 文本基线 */
79
+ /**
80
+ * @title 文本基线
81
+ */
64
82
  readonly textBaseline?: 'middle' | 'top' | 'bottom';
65
83
  };
66
84
 
@@ -71,67 +89,157 @@ export type Size = {
71
89
 
72
90
  /** 基础的 Options 配置 */
73
91
  export type Options = {
74
- // 画布基本配置
75
- /** 画布宽度 */
92
+ /**
93
+ * @title 画布宽度
94
+ */
76
95
  readonly width?: number;
77
- /** 画布高度 */
96
+ /**
97
+ * @title 画布高度
98
+ */
78
99
  readonly height?: number;
79
- /** 画布是否自动适配容器大小,默认为 true */
100
+ /**
101
+ * @title 自适应
102
+ * @description 画布是否自动适配容器大小,默认为 true
103
+ */
80
104
  readonly autoFit?: boolean;
81
- /** 画布的 padding 值,或者开启 'auto' */
105
+ /**
106
+ * @title 内填充
107
+ * @description 画布的 padding 值,或者开启 'auto'
108
+ */
82
109
  readonly padding?: number[] | number | 'auto';
83
- /** 额外怎加的 padding 值 */
110
+ /**
111
+ * @title 画布宽度
112
+ * @description 额外怎加的 padding 值
113
+ */
84
114
  readonly appendPadding?: number[] | number;
85
- /** 是否同步子 view 的 padding */
115
+ /**
116
+ * @title 额外填充
117
+ * @description 是否同步子 view 的 padding
118
+ */
86
119
  readonly syncViewPadding?: boolean | Types.SyncViewPaddingFn;
87
120
 
88
- /** 国际化 */
121
+ /**
122
+ * @title 国际化
123
+ * @description 语言配置
124
+ */
89
125
  readonly locale?: string;
90
126
 
91
- // G 相关
92
- /** 渲染引擎 */
127
+ /**
128
+ * @title 渲染引擎
129
+ * @description 设置渲染引擎,'svg' | 'canvas'
130
+ * @default "canvas"
131
+ */
93
132
  readonly renderer?: 'svg' | 'canvas';
94
- /** 屏幕像素比,默认为 window.devicePixelRatio */
133
+ /**
134
+ * @title 屏幕像素比
135
+ * @description 默认为 window.devicePixelRatio
136
+ */
95
137
  readonly pixelRatio?: number;
96
- /** 是否开启局部渲染,默认为 true */
138
+ /**
139
+ * @title 是否启局部渲染
140
+ * @description 是否开启局部渲染,默认为 true
141
+ * @default true
142
+ */
97
143
  readonly localRefresh?: boolean;
98
- /** 支持 CSS transform,开启后图表的交互以及事件将在页面设置了 css transform 属性时生效,默认关闭。 */
144
+ /**
145
+ * @title 是否支持 CSS transform
146
+ * @description 开启后图表的交互以及事件将在页面设置了 css transform 属性时生效,默认关闭。
147
+ * @default false
148
+ */
99
149
  readonly supportCSSTransform?: boolean;
100
150
 
101
- // 通用数据配置
102
- /** 具体的数据 */
151
+ /**
152
+ * @title 数据
153
+ * @description 设置画布具体的数据
154
+ */
103
155
  readonly data: Record<string, any>[];
104
- /** 数据字段元信息 */
156
+ /**
157
+ * @title 数据字段元信息
158
+ * @description 设置数据字段元信息
159
+ */
105
160
  readonly meta?: Record<string, Meta>;
106
161
 
107
162
  // G2 相关
108
- /** 主题,G2 主题,字符串或者 theme object */
163
+ /**
164
+ * @title 主题
165
+ * @description G2 主题,字符串或者 theme object
166
+ * @default "light"
167
+ */
109
168
  readonly theme?: string | object;
110
- /** 颜色色板 */
169
+ /**
170
+ * @title 颜色色板
171
+ * @description 设置颜色色板
172
+ */
111
173
  readonly color?: ColorAttr;
112
- /** pattern 配置 */
174
+ /**
175
+ * @title pattern 配置
176
+ * @description 设置图表 pattern
177
+ */
113
178
  readonly pattern?: PatternAttr;
114
- /** xAxis 的配置项 */
179
+ /**
180
+ * @title 横坐标
181
+ * @description 设置画布横坐标的配置项
182
+ */
115
183
  readonly xAxis?: Axis;
116
- /** yAxis 的配置项 */
184
+ /**
185
+ * @title 纵坐标
186
+ * @description 设置画布纵坐标的配置项
187
+ */
117
188
  readonly yAxis?: Axis;
118
- /** 数据标签的配置 */
189
+ /**
190
+ * @title 数据标签
191
+ * @description 设置数据标签
192
+ */
119
193
  readonly label?: Label;
120
- /** tooltip 的配置项 */
194
+ /**
195
+ * @title tooltip 提示
196
+ * @description 设置画布 tooltip 的配置项
197
+ */
121
198
  readonly tooltip?: Tooltip;
122
- /** 图例 legend 的配置项 */
199
+ /**
200
+ * @title 图例
201
+ * @description 设置画布图例 legend 的配置项
202
+ */
123
203
  readonly legend?: Legend;
124
- /** 缩略轴 slider 的配置项 */
204
+ /**
205
+ * @title 缩略轴
206
+ * @description 设置缩略轴 slider 的配置项
207
+ */
125
208
  readonly slider?: Slider;
126
- /** 缩略轴 scrollbar 的配置项 */
209
+ /**
210
+ * @title 滚动条
211
+ * @description 设置画布缩略轴 scrollbar 的配置项
212
+ */
127
213
  readonly scrollbar?: Scrollbar;
214
+ /**
215
+ * @title 动画
216
+ * @description 设置图表动画
217
+ */
128
218
  readonly animation?: Animation;
219
+ /**
220
+ * @title 交互
221
+ * @description 设置画布交互行为
222
+ */
129
223
  readonly interactions?: Interaction[];
224
+ /**
225
+ * @title 注解
226
+ * @description 设置画布注解
227
+ */
130
228
  readonly annotations?: Annotation[];
131
- // 配置 active,inactive,selected 三种状态的样式,也可在 Theme 主题中配置
229
+ /**
230
+ * @title 图表状态
231
+ * @description 设置画布配置 active,inactive,selected 三种状态的样式,也可在 Theme 主题中配置
232
+ */
132
233
  readonly state?: State;
133
- /** 是否对超出坐标系范围的 Geometry 进行剪切 */
234
+ /**
235
+ * @title 是否裁剪
236
+ * @description 是否对超出坐标系范围的 Geometry 进行剪切
237
+ */
134
238
  readonly limitInPlot?: boolean;
135
- /** 内置注册的交互 */
239
+ /**
240
+ * @title 内置交互
241
+ * @description 内置注册的交互
242
+ * @deprecated false
243
+ */
136
244
  readonly defaultInteractions?: string[];
137
245
  };
@@ -1,19 +1,40 @@
1
1
  import { ShapeAttrs } from '@antv/g2';
2
2
 
3
3
  export type DrillDownCfg = {
4
- /** Enable or disable the drillDown interaction */
4
+ /**
5
+ * @title 是否启用
6
+ * @description 是否启用 drillDown interaction
7
+ */
5
8
  enabled?: boolean;
6
- /** 面包屑相关配置 */
9
+ /**
10
+ * @title 面包屑
11
+ * @description 设置面包屑相关配置
12
+ */
7
13
  breadCrumb?: {
8
- /** 位置 */
14
+ /**
15
+ * @title 位置
16
+ * @description 设置面包屑显示位置
17
+ */
9
18
  position: 'top-left' | 'bottom-left';
10
- /** 根文本 */
19
+ /**
20
+ * @title 根文本
21
+ * @description 设置面包屑根文本
22
+ */
11
23
  rootText?: string;
12
- /** 分割线文本 */
24
+ /**
25
+ * @title 分割线文本
26
+ * @description 设置面包屑分割线文本
27
+ */
13
28
  dividerText?: string;
14
- /** 字体样式 */
29
+ /**
30
+ * @title 字体样式
31
+ * @description 设置面包屑字体样式
32
+ */
15
33
  textStyle?: ShapeAttrs;
16
- /** 激活的字体样式 */
34
+ /**
35
+ * @title 激活的字体样式
36
+ * @description 设置面包屑字激活的字体样式
37
+ */
17
38
  activeTextStyle?: ShapeAttrs;
18
39
  };
19
40
  };