@antv/g2plot 2.4.7 → 2.4.10

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 (283) hide show
  1. package/CHANGELOG.md +52 -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/dual-axes/util/render-sider.js +1 -1
  30. package/esm/plots/dual-axes/util/render-sider.js.map +1 -1
  31. package/esm/plots/facet/types.d.ts +54 -34
  32. package/esm/plots/facet/types.js.map +1 -1
  33. package/esm/plots/funnel/geometries/compare.js +2 -1
  34. package/esm/plots/funnel/geometries/compare.js.map +1 -1
  35. package/esm/plots/funnel/geometries/facet.js +2 -1
  36. package/esm/plots/funnel/geometries/facet.js.map +1 -1
  37. package/esm/plots/funnel/types.d.ts +45 -11
  38. package/esm/plots/funnel/types.js.map +1 -1
  39. package/esm/plots/gauge/types.d.ts +83 -21
  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/adaptor.js +31 -2
  70. package/esm/plots/sankey/adaptor.js.map +1 -1
  71. package/esm/plots/sankey/types.d.ts +57 -30
  72. package/esm/plots/sankey/types.js.map +1 -1
  73. package/esm/plots/scatter/types.d.ts +76 -22
  74. package/esm/plots/scatter/types.js.map +1 -1
  75. package/esm/plots/stock/types.d.ts +20 -7
  76. package/esm/plots/stock/types.js.map +1 -1
  77. package/esm/plots/sunburst/types.d.ts +40 -12
  78. package/esm/plots/sunburst/types.js.map +1 -1
  79. package/esm/plots/tiny-area/types.d.ts +16 -5
  80. package/esm/plots/tiny-area/types.js.map +1 -1
  81. package/esm/plots/tiny-column/types.d.ts +10 -3
  82. package/esm/plots/tiny-column/types.js.map +1 -1
  83. package/esm/plots/tiny-line/types.d.ts +17 -5
  84. package/esm/plots/tiny-line/types.js.map +1 -1
  85. package/esm/plots/treemap/types.d.ts +17 -6
  86. package/esm/plots/treemap/types.js.map +1 -1
  87. package/esm/plots/venn/types.d.ts +20 -6
  88. package/esm/plots/venn/types.js.map +1 -1
  89. package/esm/plots/violin/types.d.ts +52 -17
  90. package/esm/plots/violin/types.js.map +1 -1
  91. package/esm/plots/waterfall/types.d.ts +42 -10
  92. package/esm/plots/waterfall/types.js.map +1 -1
  93. package/esm/plots/word-cloud/types.d.ts +91 -44
  94. package/esm/plots/word-cloud/types.js.map +1 -1
  95. package/esm/types/button.d.ts +8 -4
  96. package/esm/types/button.js.map +1 -1
  97. package/esm/types/common.d.ts +145 -33
  98. package/esm/types/common.js.map +1 -1
  99. package/esm/types/drill-down.d.ts +28 -7
  100. package/esm/types/drill-down.js.map +1 -1
  101. package/esm/types/interaction.d.ts +26 -6
  102. package/esm/types/interaction.js.map +1 -1
  103. package/esm/types/label.d.ts +11 -3
  104. package/esm/types/label.js.map +1 -1
  105. package/esm/types/meta.d.ts +4 -7
  106. package/esm/types/meta.js.map +1 -1
  107. package/esm/types/pattern.d.ts +58 -18
  108. package/esm/types/pattern.js.map +1 -1
  109. package/esm/types/state.d.ts +11 -3
  110. package/esm/types/state.js.map +1 -1
  111. package/esm/types/statistic.d.ts +38 -6
  112. package/esm/types/statistic.js.map +1 -1
  113. package/esm/types/tooltip.d.ts +7 -2
  114. package/esm/types/tooltip.js.map +1 -1
  115. package/esm/utils/transform/percent.js +2 -2
  116. package/esm/utils/transform/percent.js.map +1 -1
  117. package/lib/core/plot.d.ts +2 -2
  118. package/lib/core/plot.js +4 -3
  119. package/lib/core/plot.js.map +1 -1
  120. package/lib/index.d.ts +2 -2
  121. package/lib/index.js +2 -1
  122. package/lib/index.js.map +1 -1
  123. package/lib/plots/area/types.d.ts +35 -10
  124. package/lib/plots/area/types.js.map +1 -1
  125. package/lib/plots/bar/types.d.ts +16 -3
  126. package/lib/plots/bar/types.js.map +1 -1
  127. package/lib/plots/bidirectional-bar/types.d.ts +21 -6
  128. package/lib/plots/bidirectional-bar/types.js.map +1 -1
  129. package/lib/plots/box/types.d.ts +20 -6
  130. package/lib/plots/box/types.js.map +1 -1
  131. package/lib/plots/bullet/types.d.ts +36 -9
  132. package/lib/plots/bullet/types.js.map +1 -1
  133. package/lib/plots/chord/types.d.ts +14 -10
  134. package/lib/plots/chord/types.js.map +1 -1
  135. package/lib/plots/circle-packing/types.d.ts +25 -8
  136. package/lib/plots/circle-packing/types.js.map +1 -1
  137. package/lib/plots/column/types.d.ts +57 -16
  138. package/lib/plots/column/types.js.map +1 -1
  139. package/lib/plots/dual-axes/types.d.ts +31 -6
  140. package/lib/plots/dual-axes/types.js.map +1 -1
  141. package/lib/plots/dual-axes/util/render-sider.js +1 -1
  142. package/lib/plots/dual-axes/util/render-sider.js.map +1 -1
  143. package/lib/plots/facet/types.d.ts +54 -34
  144. package/lib/plots/facet/types.js.map +1 -1
  145. package/lib/plots/funnel/geometries/compare.js +2 -1
  146. package/lib/plots/funnel/geometries/compare.js.map +1 -1
  147. package/lib/plots/funnel/geometries/facet.js +2 -1
  148. package/lib/plots/funnel/geometries/facet.js.map +1 -1
  149. package/lib/plots/funnel/types.d.ts +45 -11
  150. package/lib/plots/funnel/types.js.map +1 -1
  151. package/lib/plots/gauge/types.d.ts +83 -21
  152. package/lib/plots/gauge/types.js.map +1 -1
  153. package/lib/plots/heatmap/types.d.ts +47 -12
  154. package/lib/plots/heatmap/types.js.map +1 -1
  155. package/lib/plots/histogram/types.d.ts +17 -6
  156. package/lib/plots/histogram/types.js.map +1 -1
  157. package/lib/plots/line/types.d.ts +42 -12
  158. package/lib/plots/line/types.js.map +1 -1
  159. package/lib/plots/liquid/index.d.ts +1 -0
  160. package/lib/plots/liquid/index.js +2 -0
  161. package/lib/plots/liquid/index.js.map +1 -1
  162. package/lib/plots/liquid/shapes/liquid.d.ts +16 -1
  163. package/lib/plots/liquid/shapes/liquid.js +14 -7
  164. package/lib/plots/liquid/shapes/liquid.js.map +1 -1
  165. package/lib/plots/liquid/types.d.ts +56 -16
  166. package/lib/plots/liquid/types.js.map +1 -1
  167. package/lib/plots/mix/types.d.ts +31 -22
  168. package/lib/plots/mix/types.js.map +1 -1
  169. package/lib/plots/pie/types.d.ts +27 -10
  170. package/lib/plots/pie/types.js.map +1 -1
  171. package/lib/plots/progress/types.d.ts +13 -4
  172. package/lib/plots/progress/types.js.map +1 -1
  173. package/lib/plots/radar/types.d.ts +39 -12
  174. package/lib/plots/radar/types.js.map +1 -1
  175. package/lib/plots/radial-bar/types.d.ts +39 -12
  176. package/lib/plots/radial-bar/types.js.map +1 -1
  177. package/lib/plots/ring-progress/types.d.ts +18 -6
  178. package/lib/plots/ring-progress/types.js.map +1 -1
  179. package/lib/plots/rose/types.d.ts +32 -12
  180. package/lib/plots/rose/types.js.map +1 -1
  181. package/lib/plots/sankey/adaptor.js +30 -1
  182. package/lib/plots/sankey/adaptor.js.map +1 -1
  183. package/lib/plots/sankey/types.d.ts +57 -30
  184. package/lib/plots/sankey/types.js.map +1 -1
  185. package/lib/plots/scatter/types.d.ts +76 -22
  186. package/lib/plots/scatter/types.js.map +1 -1
  187. package/lib/plots/stock/types.d.ts +20 -7
  188. package/lib/plots/stock/types.js.map +1 -1
  189. package/lib/plots/sunburst/types.d.ts +40 -12
  190. package/lib/plots/sunburst/types.js.map +1 -1
  191. package/lib/plots/tiny-area/types.d.ts +16 -5
  192. package/lib/plots/tiny-area/types.js.map +1 -1
  193. package/lib/plots/tiny-column/types.d.ts +10 -3
  194. package/lib/plots/tiny-column/types.js.map +1 -1
  195. package/lib/plots/tiny-line/types.d.ts +17 -5
  196. package/lib/plots/tiny-line/types.js.map +1 -1
  197. package/lib/plots/treemap/types.d.ts +17 -6
  198. package/lib/plots/treemap/types.js.map +1 -1
  199. package/lib/plots/venn/types.d.ts +20 -6
  200. package/lib/plots/venn/types.js.map +1 -1
  201. package/lib/plots/violin/types.d.ts +52 -17
  202. package/lib/plots/violin/types.js.map +1 -1
  203. package/lib/plots/waterfall/types.d.ts +42 -10
  204. package/lib/plots/waterfall/types.js.map +1 -1
  205. package/lib/plots/word-cloud/types.d.ts +91 -44
  206. package/lib/plots/word-cloud/types.js.map +1 -1
  207. package/lib/types/button.d.ts +8 -4
  208. package/lib/types/button.js.map +1 -1
  209. package/lib/types/common.d.ts +145 -33
  210. package/lib/types/common.js.map +1 -1
  211. package/lib/types/drill-down.d.ts +28 -7
  212. package/lib/types/drill-down.js.map +1 -1
  213. package/lib/types/interaction.d.ts +26 -6
  214. package/lib/types/interaction.js.map +1 -1
  215. package/lib/types/label.d.ts +11 -3
  216. package/lib/types/label.js.map +1 -1
  217. package/lib/types/meta.d.ts +4 -7
  218. package/lib/types/meta.js.map +1 -1
  219. package/lib/types/pattern.d.ts +58 -18
  220. package/lib/types/pattern.js.map +1 -1
  221. package/lib/types/state.d.ts +11 -3
  222. package/lib/types/state.js.map +1 -1
  223. package/lib/types/statistic.d.ts +38 -6
  224. package/lib/types/statistic.js.map +1 -1
  225. package/lib/types/tooltip.d.ts +7 -2
  226. package/lib/types/tooltip.js.map +1 -1
  227. package/lib/utils/transform/percent.js +2 -2
  228. package/lib/utils/transform/percent.js.map +1 -1
  229. package/package.json +1 -1
  230. package/src/core/plot.ts +5 -4
  231. package/src/index.ts +2 -2
  232. package/src/plots/area/types.ts +35 -10
  233. package/src/plots/bar/types.ts +16 -3
  234. package/src/plots/bidirectional-bar/types.ts +21 -6
  235. package/src/plots/box/types.ts +20 -6
  236. package/src/plots/bullet/types.ts +36 -17
  237. package/src/plots/chord/types.ts +14 -11
  238. package/src/plots/circle-packing/types.ts +25 -14
  239. package/src/plots/column/types.ts +57 -20
  240. package/src/plots/dual-axes/types.ts +31 -16
  241. package/src/plots/dual-axes/util/render-sider.ts +1 -1
  242. package/src/plots/facet/types.ts +54 -49
  243. package/src/plots/funnel/geometries/compare.ts +2 -0
  244. package/src/plots/funnel/geometries/facet.ts +2 -1
  245. package/src/plots/funnel/types.ts +45 -14
  246. package/src/plots/gauge/types.ts +86 -27
  247. package/src/plots/heatmap/types.ts +49 -14
  248. package/src/plots/histogram/types.ts +17 -9
  249. package/src/plots/line/types.ts +42 -14
  250. package/src/plots/liquid/index.ts +2 -0
  251. package/src/plots/liquid/shapes/liquid.ts +16 -8
  252. package/src/plots/liquid/types.ts +56 -16
  253. package/src/plots/mix/types.ts +31 -35
  254. package/src/plots/pie/types.ts +27 -10
  255. package/src/plots/progress/types.ts +13 -4
  256. package/src/plots/radar/types.ts +39 -12
  257. package/src/plots/radial-bar/types.ts +39 -12
  258. package/src/plots/ring-progress/types.ts +18 -6
  259. package/src/plots/rose/types.ts +32 -12
  260. package/src/plots/sankey/adaptor.ts +35 -2
  261. package/src/plots/sankey/types.ts +58 -30
  262. package/src/plots/scatter/types.ts +77 -24
  263. package/src/plots/stock/types.ts +21 -8
  264. package/src/plots/sunburst/types.ts +42 -12
  265. package/src/plots/tiny-area/types.ts +16 -5
  266. package/src/plots/tiny-column/types.ts +10 -3
  267. package/src/plots/tiny-line/types.ts +17 -5
  268. package/src/plots/treemap/types.ts +17 -7
  269. package/src/plots/venn/types.ts +21 -6
  270. package/src/plots/violin/types.ts +52 -17
  271. package/src/plots/waterfall/types.ts +42 -10
  272. package/src/plots/word-cloud/types.ts +91 -44
  273. package/src/types/button.ts +8 -4
  274. package/src/types/common.ts +145 -37
  275. package/src/types/drill-down.ts +28 -7
  276. package/src/types/interaction.ts +26 -6
  277. package/src/types/label.ts +11 -3
  278. package/src/types/meta.ts +4 -7
  279. package/src/types/pattern.ts +58 -18
  280. package/src/types/state.ts +11 -3
  281. package/src/types/statistic.ts +38 -6
  282. package/src/types/tooltip.ts +7 -2
  283. package/src/utils/transform/percent.ts +2 -2
@@ -1,18 +1,31 @@
1
1
  import { Options, StyleAttr } from '../../types';
2
2
 
3
3
  export interface StockOptions extends Options {
4
- /** x 轴字段 日期*/
4
+ /**
5
+ * @title x 轴字段 日期
6
+ */
5
7
  readonly xField: string;
6
- /** y 轴映射 range 【开盘价/收盘价/最高价/最低价】
7
- * 设置一个指定 [open, close, high, low]【开盘价/收盘价/最高价/最低价】字段的数组 */
8
+ /**
9
+ * @title y 轴映射
10
+ * @description range 【开盘价/收盘价/最高价/最低价】,设置一个指定 [open, close, high, low]【开盘价/收盘价/最高价/最低价】字段的数组
11
+ */
8
12
  readonly yField: [string, string, string, string];
9
13
 
10
- /** 颜色配置, 不支持 color 配置 */
11
- /** 上涨色 */
14
+ /**
15
+ * @title 颜色配置
16
+ * @description 不支持 color 配置
17
+ */
18
+
19
+ /**
20
+ * @title 上涨色
21
+ */
12
22
  readonly risingFill?: string;
13
- /** 下跌色 */
23
+ /**
24
+ * @title 下跌色
25
+ */
14
26
  readonly fallingFill?: string;
15
-
16
- /** 样式配置 */
27
+ /**
28
+ * @title 样式配置
29
+ */
17
30
  readonly stockStyle?: StyleAttr;
18
31
  }
@@ -3,36 +3,66 @@ import { DrillDownCfg } from '../../types/drill-down';
3
3
  import { HierarchyOption } from '../../utils/hierarchy/types';
4
4
 
5
5
  export interface SunburstOptions extends Omit<Options, 'data' | 'slider' | 'scrollbar' | 'xAxis' | 'yAxis'> {
6
- /** 旭日图数据 */
6
+ /**
7
+ * @title 旭日图数据
8
+ */
7
9
  readonly data: any;
8
- /** 径向类型 */
10
+ /**
11
+ * @title 径向类型
12
+ * @description 径向类型'x' | 'y'
13
+ */
9
14
  readonly reflect?: 'x' | 'y';
10
15
 
11
16
  // 样式
12
- /** 内径 */
17
+
18
+ /**
19
+ * @title 内径
20
+ */
13
21
  readonly innerRadius?: number;
14
- /** 半经 */
22
+ /**
23
+ * @title 半经
24
+ */
15
25
  readonly radius?: number;
16
- /** 颜色映射 */
26
+ /**
27
+ * @title 颜色映射
28
+ */
17
29
  readonly colorField?: string;
18
- /** 颜色*/
30
+ /**
31
+ * @title 颜色
32
+ */
19
33
  readonly color?: ColorAttr;
20
- /** 旭日图形样式 */
34
+ /**
35
+ * @title 旭日图形样式
36
+ */
21
37
  readonly sunburstStyle?: StyleAttr;
22
38
 
23
- /** 层级布局配置 */
39
+ /**
40
+ * @title 层级布局
41
+ */
24
42
  readonly hierarchyConfig?: Omit<HierarchyOption, 'as' | 'type'> & {
25
43
  /** default: 'value', required data to be like: { name: 'xx', [field]: 12, children: [] } */
26
44
  readonly field?: string;
27
- /** 是否忽略父节点的权重, 默认: false, 其父节点的权重不由子节点权重总和决定 */
45
+ /**
46
+ * @title 是否忽略父节点的权重
47
+ * @description 其父节点的权重不由子节点权重总和决定
48
+ * @default false
49
+ */
28
50
  readonly ignoreParentValue?: boolean;
29
- /** 默认展示的层级深度. 默认空, 代表全部展示. 取值 > 0 */
51
+ /**
52
+ * @title 展示的层级深度
53
+ * @description 取值 > 0 默认空, 代表全部展示
54
+ */
30
55
  readonly activeDepth?: number;
31
56
  };
32
57
 
33
58
  // 其他
34
- /** 额外的原始字段 */
59
+
60
+ /**
61
+ * @title 额外的原始字段
62
+ */
35
63
  readonly rawFields?: string[];
36
- /** 下钻交互 */
64
+ /**
65
+ * @title 下钻交互
66
+ */
37
67
  readonly drilldown?: DrillDownCfg;
38
68
  }
@@ -4,14 +4,25 @@ import { PointGeometryOptions } from '../../adaptor/geometries/point';
4
4
 
5
5
  /** mini 图类型定义需要 omit 很多的 G2 Options 配置 */
6
6
  export interface TinyAreaOptions extends Omit<Options, 'data' | 'legend' | 'label'> {
7
- /** 具体的数据 */
7
+ /**
8
+ * @title 具体的数据
9
+ */
8
10
  readonly data: number[];
9
- /** 是否平滑 */
11
+ /**
12
+ * @title 是否平滑
13
+ * @default false
14
+ */
10
15
  readonly smooth?: boolean;
11
- /** 面积折线图形样式 */
16
+ /**
17
+ * @title 面积折线图形样式
18
+ */
12
19
  readonly areaStyle?: StyleAttr;
13
- /** 面积折线图形样式 */
20
+ /**
21
+ * @title 面积折线图形样式
22
+ */
14
23
  readonly line?: MappingOptions;
15
- /** 面积点图形样式 */
24
+ /**
25
+ * @title 面积点图形样式
26
+ */
16
27
  readonly point?: MappingOptions & Pick<PointGeometryOptions, 'state'>;
17
28
  }
@@ -2,10 +2,17 @@ import { Options, StyleAttr } from '../../types';
2
2
 
3
3
  /** mini 图类型定义需要 omit 很多的 G2 Options 配置 */
4
4
  export interface TinyColumnOptions extends Omit<Options, 'data' | 'legend' | 'label'> {
5
- /** 具体的数据 */
5
+ /**
6
+ * @title 具体的数据
7
+ */
6
8
  readonly data: number[];
7
- /** 柱状图宽度占比 [0-1] */
9
+ /**
10
+ * @title 柱状图宽度占比
11
+ * @description 范围[0-1]
12
+ */
8
13
  readonly columnWidthRatio?: number;
9
- /** 迷你柱形图形样式 */
14
+ /**
15
+ * @title 迷你柱形图形样式
16
+ */
10
17
  readonly columnStyle?: StyleAttr;
11
18
  }
@@ -4,14 +4,26 @@ import { PointGeometryOptions } from '../../adaptor/geometries/point';
4
4
 
5
5
  /** mini 图类型定义需要 omit 很多的 G2 Options 配置 */
6
6
  export interface TinyLineOptions extends Omit<Options, 'data' | 'legend' | 'label'> {
7
- /** 具体的数据 */
7
+ /**
8
+ * @title 具体的数据
9
+ */
8
10
  readonly data: number[];
9
- /** 是否平滑 */
11
+ /**
12
+ * @title 是否平滑
13
+ * @default false
14
+ */
10
15
  readonly smooth?: boolean;
11
- /** 是否连接空数据 */
16
+ /**
17
+ * @title 是否连接空数据
18
+ * @default false
19
+ */
12
20
  readonly connectNulls?: boolean;
13
- /** 折线图形样式 */
21
+ /**
22
+ * @title 折线图形样式
23
+ */
14
24
  readonly lineStyle?: StyleAttr;
15
- /** 折线点图形样式 */
25
+ /**
26
+ * @title 折线点图形样式
27
+ */
16
28
  readonly point?: MappingOptions & Pick<PointGeometryOptions, 'state'>;
17
29
  }
@@ -3,19 +3,29 @@ import { DrillDownCfg } from '../../types/drill-down';
3
3
  import { HierarchyOption } from '../../utils/hierarchy/types';
4
4
 
5
5
  export interface TreemapOptions extends Omit<Options, 'data'> {
6
- /** 颜色字段 */
6
+ /**
7
+ * @title 颜色字段
8
+ */
7
9
  readonly colorField?: string;
8
- /** 数据字段 */
10
+ /**
11
+ * @title 数据字段
12
+ */
9
13
  readonly data?: Record<string, any>;
10
- /** 图形样式 */
14
+ /**
15
+ * @title 图形样式
16
+ */
11
17
  readonly rectStyle?: StyleAttr;
12
- /** 层级布局配置 */
18
+ /**
19
+ * @title 层级布局
20
+ */
13
21
  readonly hierarchyConfig?: Omit<HierarchyOption, 'as' | 'type' | 'field'>;
14
22
  /**
15
- * 附加的 源字段
23
+ * @title 附加的源字段
16
24
  */
17
25
  readonly rawFields?: string[];
18
- // 矩阵树图 内置一些交互
19
- /** 下钻交互相关配置 */
26
+ /**
27
+ * @title 矩阵树图
28
+ * @description 内置一些交互 下钻交互相关配置
29
+ */
20
30
  readonly drilldown?: DrillDownCfg;
21
31
  }
@@ -6,19 +6,34 @@ export type VennData = (Types.Datum & { sets: string[]; [PATH_FIELD]: string; [I
6
6
 
7
7
  /** 配置类型定义 */
8
8
  export interface VennOptions extends Options {
9
- /** 韦恩图 数据 */
9
+ /**
10
+ * @title 韦恩图数据
11
+ */
10
12
  readonly data: Types.Datum[];
11
- /** 集合字段 */
13
+ /**
14
+ * @title 集合字段
15
+ */
12
16
  readonly setsField: string;
13
- /** 大小字段 */
17
+ /**
18
+ * @title 大小字段
19
+ */
14
20
  readonly sizeField: string;
15
21
 
16
22
  // 韦恩图 样式
17
- /** color */
23
+
24
+ /**
25
+ * @title 颜色
26
+ */
18
27
  readonly color?: string | string[] | ((datum: Datum, defaultColor?: string) => string);
19
- /** 并集合的颜色混合方式, 可选项: 参考 https://gka.github.io/chroma.js/#chroma-blend, 默认: multiply */
28
+ /**
29
+ * @title 并集合的颜色混合方式
30
+ * @description 可选项: 参考 https://gka.github.io/chroma.js/#chroma-blend
31
+ * @default "multiply"
32
+ */
20
33
  readonly blendMode?: string;
21
- /** point 样式 */
34
+ /**
35
+ * @title point 样式
36
+ */
22
37
  readonly pointStyle?: StyleAttr;
23
38
  }
24
39
 
@@ -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;