@antv/g2plot 2.4.8 → 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 (258) hide show
  1. package/CHANGELOG.md +16 -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/types.d.ts +40 -11
  32. package/esm/plots/funnel/types.js.map +1 -1
  33. package/esm/plots/gauge/types.d.ts +83 -21
  34. package/esm/plots/gauge/types.js.map +1 -1
  35. package/esm/plots/heatmap/types.d.ts +47 -12
  36. package/esm/plots/heatmap/types.js.map +1 -1
  37. package/esm/plots/histogram/types.d.ts +17 -6
  38. package/esm/plots/histogram/types.js.map +1 -1
  39. package/esm/plots/line/types.d.ts +42 -12
  40. package/esm/plots/line/types.js.map +1 -1
  41. package/esm/plots/liquid/index.d.ts +1 -0
  42. package/esm/plots/liquid/index.js +1 -0
  43. package/esm/plots/liquid/index.js.map +1 -1
  44. package/esm/plots/liquid/shapes/liquid.d.ts +16 -1
  45. package/esm/plots/liquid/shapes/liquid.js +13 -8
  46. package/esm/plots/liquid/shapes/liquid.js.map +1 -1
  47. package/esm/plots/liquid/types.d.ts +56 -16
  48. package/esm/plots/liquid/types.js.map +1 -1
  49. package/esm/plots/mix/types.d.ts +31 -22
  50. package/esm/plots/mix/types.js.map +1 -1
  51. package/esm/plots/pie/types.d.ts +27 -10
  52. package/esm/plots/pie/types.js.map +1 -1
  53. package/esm/plots/progress/types.d.ts +13 -4
  54. package/esm/plots/progress/types.js.map +1 -1
  55. package/esm/plots/radar/types.d.ts +39 -12
  56. package/esm/plots/radar/types.js.map +1 -1
  57. package/esm/plots/radial-bar/types.d.ts +39 -12
  58. package/esm/plots/radial-bar/types.js.map +1 -1
  59. package/esm/plots/ring-progress/types.d.ts +18 -6
  60. package/esm/plots/ring-progress/types.js.map +1 -1
  61. package/esm/plots/rose/types.d.ts +32 -12
  62. package/esm/plots/rose/types.js.map +1 -1
  63. package/esm/plots/sankey/types.d.ts +51 -32
  64. package/esm/plots/sankey/types.js.map +1 -1
  65. package/esm/plots/scatter/types.d.ts +76 -22
  66. package/esm/plots/scatter/types.js.map +1 -1
  67. package/esm/plots/stock/types.d.ts +20 -7
  68. package/esm/plots/stock/types.js.map +1 -1
  69. package/esm/plots/sunburst/types.d.ts +40 -12
  70. package/esm/plots/sunburst/types.js.map +1 -1
  71. package/esm/plots/tiny-area/types.d.ts +16 -5
  72. package/esm/plots/tiny-area/types.js.map +1 -1
  73. package/esm/plots/tiny-column/types.d.ts +10 -3
  74. package/esm/plots/tiny-column/types.js.map +1 -1
  75. package/esm/plots/tiny-line/types.d.ts +17 -5
  76. package/esm/plots/tiny-line/types.js.map +1 -1
  77. package/esm/plots/treemap/types.d.ts +17 -6
  78. package/esm/plots/treemap/types.js.map +1 -1
  79. package/esm/plots/venn/types.d.ts +20 -6
  80. package/esm/plots/venn/types.js.map +1 -1
  81. package/esm/plots/violin/types.d.ts +52 -17
  82. package/esm/plots/violin/types.js.map +1 -1
  83. package/esm/plots/waterfall/types.d.ts +42 -10
  84. package/esm/plots/waterfall/types.js.map +1 -1
  85. package/esm/plots/word-cloud/types.d.ts +91 -44
  86. package/esm/plots/word-cloud/types.js.map +1 -1
  87. package/esm/types/button.d.ts +8 -4
  88. package/esm/types/button.js.map +1 -1
  89. package/esm/types/common.d.ts +145 -33
  90. package/esm/types/common.js.map +1 -1
  91. package/esm/types/drill-down.d.ts +28 -7
  92. package/esm/types/drill-down.js.map +1 -1
  93. package/esm/types/interaction.d.ts +26 -6
  94. package/esm/types/interaction.js.map +1 -1
  95. package/esm/types/label.d.ts +11 -3
  96. package/esm/types/label.js.map +1 -1
  97. package/esm/types/meta.d.ts +4 -7
  98. package/esm/types/meta.js.map +1 -1
  99. package/esm/types/pattern.d.ts +58 -18
  100. package/esm/types/pattern.js.map +1 -1
  101. package/esm/types/state.d.ts +11 -3
  102. package/esm/types/state.js.map +1 -1
  103. package/esm/types/statistic.d.ts +38 -6
  104. package/esm/types/statistic.js.map +1 -1
  105. package/esm/types/tooltip.d.ts +7 -2
  106. package/esm/types/tooltip.js.map +1 -1
  107. package/lib/core/plot.d.ts +2 -2
  108. package/lib/core/plot.js +4 -3
  109. package/lib/core/plot.js.map +1 -1
  110. package/lib/index.d.ts +2 -2
  111. package/lib/index.js +2 -1
  112. package/lib/index.js.map +1 -1
  113. package/lib/plots/area/types.d.ts +35 -10
  114. package/lib/plots/area/types.js.map +1 -1
  115. package/lib/plots/bar/types.d.ts +16 -3
  116. package/lib/plots/bar/types.js.map +1 -1
  117. package/lib/plots/bidirectional-bar/types.d.ts +21 -6
  118. package/lib/plots/bidirectional-bar/types.js.map +1 -1
  119. package/lib/plots/box/types.d.ts +20 -6
  120. package/lib/plots/box/types.js.map +1 -1
  121. package/lib/plots/bullet/types.d.ts +36 -9
  122. package/lib/plots/bullet/types.js.map +1 -1
  123. package/lib/plots/chord/types.d.ts +14 -10
  124. package/lib/plots/chord/types.js.map +1 -1
  125. package/lib/plots/circle-packing/types.d.ts +25 -8
  126. package/lib/plots/circle-packing/types.js.map +1 -1
  127. package/lib/plots/column/types.d.ts +57 -16
  128. package/lib/plots/column/types.js.map +1 -1
  129. package/lib/plots/dual-axes/types.d.ts +31 -6
  130. package/lib/plots/dual-axes/types.js.map +1 -1
  131. package/lib/plots/facet/types.d.ts +54 -34
  132. package/lib/plots/facet/types.js.map +1 -1
  133. package/lib/plots/funnel/types.d.ts +40 -11
  134. package/lib/plots/funnel/types.js.map +1 -1
  135. package/lib/plots/gauge/types.d.ts +83 -21
  136. package/lib/plots/gauge/types.js.map +1 -1
  137. package/lib/plots/heatmap/types.d.ts +47 -12
  138. package/lib/plots/heatmap/types.js.map +1 -1
  139. package/lib/plots/histogram/types.d.ts +17 -6
  140. package/lib/plots/histogram/types.js.map +1 -1
  141. package/lib/plots/line/types.d.ts +42 -12
  142. package/lib/plots/line/types.js.map +1 -1
  143. package/lib/plots/liquid/index.d.ts +1 -0
  144. package/lib/plots/liquid/index.js +2 -0
  145. package/lib/plots/liquid/index.js.map +1 -1
  146. package/lib/plots/liquid/shapes/liquid.d.ts +16 -1
  147. package/lib/plots/liquid/shapes/liquid.js +14 -7
  148. package/lib/plots/liquid/shapes/liquid.js.map +1 -1
  149. package/lib/plots/liquid/types.d.ts +56 -16
  150. package/lib/plots/liquid/types.js.map +1 -1
  151. package/lib/plots/mix/types.d.ts +31 -22
  152. package/lib/plots/mix/types.js.map +1 -1
  153. package/lib/plots/pie/types.d.ts +27 -10
  154. package/lib/plots/pie/types.js.map +1 -1
  155. package/lib/plots/progress/types.d.ts +13 -4
  156. package/lib/plots/progress/types.js.map +1 -1
  157. package/lib/plots/radar/types.d.ts +39 -12
  158. package/lib/plots/radar/types.js.map +1 -1
  159. package/lib/plots/radial-bar/types.d.ts +39 -12
  160. package/lib/plots/radial-bar/types.js.map +1 -1
  161. package/lib/plots/ring-progress/types.d.ts +18 -6
  162. package/lib/plots/ring-progress/types.js.map +1 -1
  163. package/lib/plots/rose/types.d.ts +32 -12
  164. package/lib/plots/rose/types.js.map +1 -1
  165. package/lib/plots/sankey/types.d.ts +51 -32
  166. package/lib/plots/sankey/types.js.map +1 -1
  167. package/lib/plots/scatter/types.d.ts +76 -22
  168. package/lib/plots/scatter/types.js.map +1 -1
  169. package/lib/plots/stock/types.d.ts +20 -7
  170. package/lib/plots/stock/types.js.map +1 -1
  171. package/lib/plots/sunburst/types.d.ts +40 -12
  172. package/lib/plots/sunburst/types.js.map +1 -1
  173. package/lib/plots/tiny-area/types.d.ts +16 -5
  174. package/lib/plots/tiny-area/types.js.map +1 -1
  175. package/lib/plots/tiny-column/types.d.ts +10 -3
  176. package/lib/plots/tiny-column/types.js.map +1 -1
  177. package/lib/plots/tiny-line/types.d.ts +17 -5
  178. package/lib/plots/tiny-line/types.js.map +1 -1
  179. package/lib/plots/treemap/types.d.ts +17 -6
  180. package/lib/plots/treemap/types.js.map +1 -1
  181. package/lib/plots/venn/types.d.ts +20 -6
  182. package/lib/plots/venn/types.js.map +1 -1
  183. package/lib/plots/violin/types.d.ts +52 -17
  184. package/lib/plots/violin/types.js.map +1 -1
  185. package/lib/plots/waterfall/types.d.ts +42 -10
  186. package/lib/plots/waterfall/types.js.map +1 -1
  187. package/lib/plots/word-cloud/types.d.ts +91 -44
  188. package/lib/plots/word-cloud/types.js.map +1 -1
  189. package/lib/types/button.d.ts +8 -4
  190. package/lib/types/button.js.map +1 -1
  191. package/lib/types/common.d.ts +145 -33
  192. package/lib/types/common.js.map +1 -1
  193. package/lib/types/drill-down.d.ts +28 -7
  194. package/lib/types/drill-down.js.map +1 -1
  195. package/lib/types/interaction.d.ts +26 -6
  196. package/lib/types/interaction.js.map +1 -1
  197. package/lib/types/label.d.ts +11 -3
  198. package/lib/types/label.js.map +1 -1
  199. package/lib/types/meta.d.ts +4 -7
  200. package/lib/types/meta.js.map +1 -1
  201. package/lib/types/pattern.d.ts +58 -18
  202. package/lib/types/pattern.js.map +1 -1
  203. package/lib/types/state.d.ts +11 -3
  204. package/lib/types/state.js.map +1 -1
  205. package/lib/types/statistic.d.ts +38 -6
  206. package/lib/types/statistic.js.map +1 -1
  207. package/lib/types/tooltip.d.ts +7 -2
  208. package/lib/types/tooltip.js.map +1 -1
  209. package/package.json +1 -1
  210. package/src/core/plot.ts +5 -4
  211. package/src/index.ts +2 -2
  212. package/src/plots/area/types.ts +35 -10
  213. package/src/plots/bar/types.ts +16 -3
  214. package/src/plots/bidirectional-bar/types.ts +21 -6
  215. package/src/plots/box/types.ts +20 -6
  216. package/src/plots/bullet/types.ts +36 -17
  217. package/src/plots/chord/types.ts +14 -11
  218. package/src/plots/circle-packing/types.ts +25 -14
  219. package/src/plots/column/types.ts +57 -20
  220. package/src/plots/dual-axes/types.ts +31 -16
  221. package/src/plots/facet/types.ts +54 -49
  222. package/src/plots/funnel/types.ts +40 -13
  223. package/src/plots/gauge/types.ts +86 -27
  224. package/src/plots/heatmap/types.ts +49 -14
  225. package/src/plots/histogram/types.ts +17 -9
  226. package/src/plots/line/types.ts +42 -14
  227. package/src/plots/liquid/index.ts +2 -0
  228. package/src/plots/liquid/shapes/liquid.ts +16 -8
  229. package/src/plots/liquid/types.ts +56 -16
  230. package/src/plots/mix/types.ts +31 -35
  231. package/src/plots/pie/types.ts +27 -10
  232. package/src/plots/progress/types.ts +13 -4
  233. package/src/plots/radar/types.ts +39 -12
  234. package/src/plots/radial-bar/types.ts +39 -12
  235. package/src/plots/ring-progress/types.ts +18 -6
  236. package/src/plots/rose/types.ts +32 -12
  237. package/src/plots/sankey/types.ts +52 -32
  238. package/src/plots/scatter/types.ts +77 -24
  239. package/src/plots/stock/types.ts +21 -8
  240. package/src/plots/sunburst/types.ts +42 -12
  241. package/src/plots/tiny-area/types.ts +16 -5
  242. package/src/plots/tiny-column/types.ts +10 -3
  243. package/src/plots/tiny-line/types.ts +17 -5
  244. package/src/plots/treemap/types.ts +17 -7
  245. package/src/plots/venn/types.ts +21 -6
  246. package/src/plots/violin/types.ts +52 -17
  247. package/src/plots/waterfall/types.ts +42 -10
  248. package/src/plots/word-cloud/types.ts +91 -44
  249. package/src/types/button.ts +8 -4
  250. package/src/types/common.ts +145 -37
  251. package/src/types/drill-down.ts +28 -7
  252. package/src/types/interaction.ts +26 -6
  253. package/src/types/label.ts +11 -3
  254. package/src/types/meta.ts +4 -7
  255. package/src/types/pattern.ts +58 -18
  256. package/src/types/state.ts +11 -3
  257. package/src/types/statistic.ts +38 -6
  258. package/src/types/tooltip.ts +7 -2
@@ -203,7 +203,7 @@ function getWaterWavePath(
203
203
  * @param radius 绘制图形的高度
204
204
  * @param waveLength 波的长度
205
205
  */
206
- function addWaterWave(
206
+ export function addWaterWave(
207
207
  x: number,
208
208
  y: number,
209
209
  level: number,
@@ -215,16 +215,21 @@ function addWaterWave(
215
215
  waveLength: number,
216
216
  animation: LiquidOptions['animation']
217
217
  ) {
218
+ // 盒子属性 颜色 宽高
218
219
  const { fill, opacity } = waveAttrs;
219
220
  const bbox = clip.getBBox();
220
221
  const width = bbox.maxX - bbox.minX;
221
222
  const height = bbox.maxY - bbox.minY;
222
223
 
224
+ // 循环 waveCount 个数
223
225
  for (let idx = 0; idx < waveCount; idx++) {
224
226
  const factor = waveCount <= 1 ? 0 : idx / (waveCount - 1);
227
+
228
+ // 画波
225
229
  const wave = group.addShape('path', {
226
230
  name: `waterwave-path`,
227
231
  attrs: {
232
+ // 波形路径配置
228
233
  path: getWaterWavePath(
229
234
  radius,
230
235
  bbox.minY + height * level,
@@ -240,6 +245,7 @@ function addWaterWave(
240
245
  });
241
246
 
242
247
  try {
248
+ // 默认 underfind 开启动画
243
249
  if (animation === false) return;
244
250
  const matrix = transform([['t', waveLength, 0]]);
245
251
 
@@ -369,6 +375,14 @@ function rect(x: number, y: number, width: number, height: number) {
369
375
  `;
370
376
  }
371
377
 
378
+ const builtInShapeByName = {
379
+ pin,
380
+ circle,
381
+ diamond,
382
+ triangle,
383
+ rect,
384
+ };
385
+
372
386
  registerShape('interval', 'liquid-fill-gauge', {
373
387
  draw(cfg: any, container: IGroup) {
374
388
  const cx = 0.5;
@@ -399,13 +413,7 @@ registerShape('interval', 'liquid-fill-gauge', {
399
413
  const waveAttrs = getFillAttrs(cfg);
400
414
  const outlineAttrs = getLineAttrs(mix({}, cfg, outline));
401
415
  const innerRadius = radius - border / 2;
402
- const builtInShapeByName = {
403
- pin,
404
- circle,
405
- diamond,
406
- triangle,
407
- rect,
408
- };
416
+
409
417
  const buildPath = typeof shape === 'function' ? shape : builtInShapeByName[shape] || builtInShapeByName['circle'];
410
418
  const shapePath = buildPath(center.x, center.y, innerRadius * 2, innerRadius * 2);
411
419
 
@@ -1,48 +1,88 @@
1
1
  import { PathCommand } from '@antv/g-base';
2
2
  import { Options, StyleAttr, ColorAttr, Statistic, ShapeStyle } from '../../types';
3
3
 
4
- /** 轮廓的配置 */
4
+ /**
5
+ * @title 轮廓
6
+ */
5
7
  type Outline = Partial<{
6
- /** 外环的宽度,默认为 2px */
8
+ /**
9
+ * @title 外环的宽度
10
+ * @default "2px"
11
+ */
7
12
  readonly border: number;
8
- /** 内外的边距,默认为 0px */
13
+ /**
14
+ * @title 内外的边距
15
+ * @default "0px"
16
+ */
9
17
  readonly distance: number;
10
- /** 外环的样式 */
18
+ /**
19
+ * @title 外环的样式
20
+ */
11
21
  readonly style?: Pick<ShapeStyle, 'stroke' | 'strokeOpacity'>;
12
22
  // /** 外边框的形状,可以有 circle,rect,默认为 circle */
13
23
  // readonly containerShape?: 'circle' | 'rect';
14
24
  }>;
15
25
 
16
26
  type Wave = Partial<{
17
- /** 波形的数量,默认为 3 */
27
+ /**
28
+ * @title 波形的数量
29
+ * @default 3
30
+ */
18
31
  readonly count: number;
19
- /** 波形的长度,默认是 192 */
32
+ /**
33
+ * @title 波形的长度
34
+ * @default 192
35
+ */
20
36
  readonly length: number;
21
37
  }>;
22
38
 
23
39
  type ShapeCallback = (x: number, y: number, width: number, height: number) => PathCommand[];
24
40
 
25
- /** 配置类型定义 */
41
+ /**
42
+ * @title 配置类型定义
43
+ */
26
44
  export interface LiquidOptions extends Omit<Options, 'data'> {
27
- /** 指标比例 */
45
+ /**
46
+ * @title 指标比例
47
+ */
28
48
  readonly percent: number;
29
- /** 配置水波图的颜色,使用默认色板的颜色 */
49
+ /**
50
+ * @title 配置水波图的颜色
51
+ * @description 使用默认色板的颜色
52
+ */
30
53
  readonly color?: ColorAttr;
31
- /** 水波的外半径, 0 ~ 1,默认为 0.9 */
54
+ /**
55
+ * @title 水波的外半径
56
+ * @description 范围0-1
57
+ * @default 0.9
58
+ */
32
59
  readonly radius?: number;
33
- /** 配置水波图的样式 */
60
+ /**
61
+ * @title 水波图的样式
62
+ */
34
63
  readonly liquidStyle?: StyleAttr;
35
- /** 指标文本组件 */
64
+ /**
65
+ * @title 指标文本组件
66
+ */
36
67
  readonly statistic?: Statistic;
37
- /** 外环轮廓的配置 */
68
+ /**
69
+ * @title 外环轮廓
70
+ */
38
71
  readonly outline?: Outline;
39
- /** 波的配置 */
72
+ /**
73
+ * @title 波的配置
74
+ */
40
75
  readonly wave?: Wave;
41
- /** 波的形状配置('circle' | 'rect' | 'triangle' | 'diamond')*/
76
+ /**
77
+ * @title 波的形状配置
78
+ * @description ('circle' | 'rect' | 'triangle' | 'diamond')
79
+ */
42
80
  readonly shape?: string | ShapeCallback;
43
81
  }
44
82
 
45
- /** 水波图自定义 的 customInfo */
83
+ /**
84
+ * @title 水波图自定义 的 customInfo
85
+ */
46
86
  export type CustomInfo = {
47
87
  radius?: LiquidOptions['radius'];
48
88
  outline?: LiquidOptions['outline'];
@@ -9,103 +9,99 @@ import { Interaction } from '../../types/interaction';
9
9
  import { IPlotTypes } from './utils';
10
10
 
11
11
  /**
12
- * geometry 映射信息
12
+ * @title geometry 映射信息
13
13
  */
14
14
  export type IGeometry = Geometry & {
15
15
  adjust?: Types.AdjustOption;
16
16
  };
17
-
18
17
  /**
19
- * 子 view 的配置。暂时不开嵌套 view 的情况
18
+ * @title 子 view 的配置
19
+ * @description 暂时不开嵌套 view 的情况
20
20
  */
21
21
  export type IView = {
22
22
  /**
23
- * view 的布局范围,默认是占满全部
23
+ * @title view 的布局范围
24
+ * @default "占满全部"
24
25
  */
25
26
  readonly region?: Region;
26
-
27
27
  /**
28
- * view 中的数据
28
+ * @title view 中的数据
29
29
  */
30
30
  readonly data: Data;
31
-
32
31
  /**
33
- * view 中对应的 meta 字段配置
32
+ * @title view 中对应的 meta 字段配置
34
33
  */
35
34
  readonly meta?: Record<string, Meta>;
36
-
37
35
  /**
38
- * 坐标系的配置,每一个 view 具有相同的坐标系
36
+ * @title 坐标系的配置
37
+ * @description 每一个 view 具有相同的坐标系
39
38
  */
40
39
  readonly coordinate?: Types.CoordinateOption;
41
-
42
40
  /**
43
- * 图形 geometry 及映射配置
41
+ * @title 图形 geometry 及映射配置
44
42
  */
45
43
  readonly geometries: IGeometry[];
46
-
47
44
  /**
48
- * x,y 轴配置
45
+ * @title x,y 轴
49
46
  */
50
47
  readonly axes?: false | Record<string, Axis>;
51
-
52
48
  /**
53
- * interactions 配置
49
+ * @title interactions
54
50
  */
55
51
  readonly interactions?: Interaction[];
56
-
57
52
  /**
58
- * annotation 配置
53
+ * @title annotation
59
54
  */
60
55
  readonly annotations?: Annotation[];
61
-
62
56
  /**
63
- * animation 配置
57
+ * @title annotation
64
58
  */
65
59
  readonly animation?: Animation;
66
-
67
60
  /**
68
- * tooltip 配置
61
+ * @title tooltip
69
62
  */
70
63
  readonly tooltip?: Tooltip;
71
64
  };
72
65
 
73
66
  /**
74
- * 子 plot 的配置
67
+ * @title 子 plot 的配置
75
68
  */
76
69
  export type IPlot = IPlotTypes & {
77
70
  /**
78
- * plot view 的布局范围,默认是占满全部
71
+ * @title plot view 的布局范围
72
+ * @default "占满全部"
79
73
  */
80
74
  readonly region?: Region;
81
75
  };
82
76
 
83
- /** 配置类型定义 */
77
+ /**
78
+ * @title 类型定义
79
+ */
84
80
  export interface MixOptions
85
81
  extends Omit<Options, 'data' | 'legend' | 'xAxis' | 'yAxis' | 'legend' | 'tooltip' | 'slider' | 'scrollbar'> {
86
82
  /**
87
- * 是否同步子 view 的配置
88
- * 目前仅仅支持 true / false,后续需要增加 function 的方式进行自定义 view 之前的布局同步
83
+ * @title 是否同步子 view 的配置
84
+ * @description 目前仅仅支持 true / false,后续需要增加 function 的方式进行自定义 view 之前的布局同步
89
85
  */
90
86
  readonly syncViewPadding?: boolean;
91
87
  /**
92
- * 每一个图层的配置。
93
- * 每个图层包括有自己的:数据、图形、图形映射。
88
+ * @title 每一个图层的配置
89
+ * @description 每个图层包括有自己的:数据、图形、图形映射
94
90
  */
95
91
  readonly views?: IView[];
96
-
97
92
  /**
98
- * 支持使用已有的 plot,限定与指定 plot 类型
93
+ * @title 限定与指定 plot 类型
94
+ * @description 支持使用已有的 plot,限定与指定 plot 类型
99
95
  */
100
96
  readonly plots?: IPlot[];
101
-
102
97
  /**
103
- * tooltip 配置在 chart 层配置
98
+ * @title tooltip 配置
99
+ * @description tooltip 配置在 chart 层配置
104
100
  */
105
101
  readonly tooltip?: Tooltip;
106
-
107
102
  /**
108
- * legend 配置,统一顶层配置
103
+ * @title legend 配置
104
+ * @description 统一顶层配置
109
105
  */
110
106
  readonly legend?: false | Record<string, Legend>;
111
107
  }
@@ -7,26 +7,43 @@ export type StatisticData = {
7
7
  };
8
8
 
9
9
  export interface PieOptions extends Options {
10
- /** 角度映射字段 */
10
+ /**
11
+ * @title 角度映射字段
12
+ */
11
13
  readonly angleField: string;
12
- /** 颜色映射字段 */
14
+ /**
15
+ * @title 颜色映射字段
16
+ */
13
17
  readonly colorField: string;
14
- /** 饼图半径 */
18
+ /**
19
+ * @title 饼图半径
20
+ */
15
21
  readonly radius?: number;
16
- /** 饼图内半径 */
22
+ /**
23
+ * @title 饼图内半径
24
+ */
17
25
  readonly innerRadius?: number;
18
- /** 饼图标签,type: 'inner' | 'outer' | 'spider' */
26
+ /**
27
+ * @title 饼图标签
28
+ * @description type: 'inner' | 'outer' | 'spider'
29
+ */
19
30
  readonly label?: Label;
20
- /** 饼图图形样式 */
31
+ /**
32
+ * @title 饼图图形样式
33
+ */
21
34
  readonly pieStyle?: StyleAttr;
22
35
  // 设置扇形图
23
- /** 圆环的开始角度 */
36
+ /**
37
+ * @title 圆环的开始角度
38
+ */
24
39
  readonly startAngle?: number;
25
- /** 圆环的结束角度 */
40
+ /**
41
+ * @title 圆环的结束角度
42
+ */
26
43
  readonly endAngle?: number;
27
44
  /**
28
- * 指标卡组件: 显示在环图中心,可以代替tooltip,显示环图数据的总计值和各项数据
29
- * 启用 statistic 组件的同时将自动关闭tooltip
45
+ * @title 指标卡组件
46
+ * @description 显示在环图中心,可以代替tooltip,显示环图数据的总计值和各项数据,启用 statistic 组件的同时将自动关闭tooltip
30
47
  */
31
48
  readonly statistic?: Statistic;
32
49
  }
@@ -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
  }
@@ -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
  }