@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
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/circle-packing/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ColorAttr, Options, StyleAttr } from '../../types';\nimport { DrillDownCfg } from '../../types/drill-down';\nimport { HierarchyOption } from '../../utils/hierarchy/types';\n\nexport interface CirclePackingOptions extends Omit<Options, 'data'> {\n /** 数据字段 */\n readonly data?: Record<string, any>;\n /** 层级布局配置 */\n readonly hierarchyConfig?: Omit<HierarchyOption, 'as' | 'type' | 'field'>;\n\n /** 颜色字段 */\n readonly colorField?: string;\n\n /** 颜色配置 */\n readonly color?: ColorAttr;\n\n /** 大小字段 */\n readonly sizeField?: string;\n\n /** 源字段 */\n readonly rawFields?: string[];\n\n // 暂不提供自定义 size,内部计算\n // readonly size?: SizeAttr;\n\n // 暂不提供 shape 配置,默认:circle.\n // readonly shape?: string;\n\n /** 图形样式 */\n readonly pointStyle?: StyleAttr;\n\n // 交互\n /** 下钻交互 */\n readonly drilldown?: DrillDownCfg;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/circle-packing/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ColorAttr, Options, StyleAttr } from '../../types';\nimport { DrillDownCfg } from '../../types/drill-down';\nimport { HierarchyOption } from '../../utils/hierarchy/types';\n\nexport interface CirclePackingOptions extends Omit<Options, 'data'> {\n /**\n * @title 数据字段\n */\n readonly data?: Record<string, any>;\n /**\n * @title 层级布局配置\n */\n readonly hierarchyConfig?: Omit<HierarchyOption, 'as' | 'type' | 'field'>;\n /**\n * @title 颜色字段\n */\n readonly colorField?: string;\n /**\n * @title 颜色\n */\n readonly color?: ColorAttr;\n /**\n * @title 大小字段\n */\n readonly sizeField?: string;\n /**\n * @title 源字段\n */\n readonly rawFields?: string[];\n\n // 暂不提供自定义 size,内部计算\n // readonly size?: SizeAttr;\n\n // 暂不提供 shape 配置,默认:circle.\n // readonly shape?: string;\n\n /**\n * @title 图形样式\n */\n readonly pointStyle?: StyleAttr;\n /**\n * @title 交互\n * @description 下钻交互\n */\n readonly drilldown?: DrillDownCfg;\n}\n"]}
@@ -5,39 +5,80 @@ import { OptionWithConnectedArea } from '../../adaptor/connected-area';
5
5
  import { IntervalGeometryOptions } from '../../adaptor/geometries/interval';
6
6
  declare type PartialIntervalGeometryOptions = Pick<IntervalGeometryOptions, 'dodgePadding' | 'intervalPadding'>;
7
7
  export interface ColumnOptions extends Options, OptionWithConversionTag, OptionWithConnectedArea, PartialIntervalGeometryOptions {
8
- /** x 轴字段 */
8
+ /**
9
+ * @title x轴字段
10
+ */
9
11
  readonly xField: string;
10
- /** y 轴字段 */
12
+ /**
13
+ * @title y轴字段
14
+ */
11
15
  readonly yField: string;
12
- /** 拆分字段 */
16
+ /**
17
+ * @title 拆分字段
18
+ */
13
19
  readonly seriesField?: string;
14
- /** 是否分组柱形图 */
20
+ /**
21
+ * @title 是否分组柱形图
22
+ * @default false
23
+ */
15
24
  readonly isGroup?: boolean;
16
- /** 是否是区间柱状图 */
25
+ /**
26
+ * @title 是否是区间柱状图
27
+ * @default false
28
+ */
17
29
  readonly isRange?: boolean;
18
- /** 是否是百分比柱状图 */
30
+ /**
31
+ * @title 是否是百分比柱状图
32
+ * @default false
33
+ */
19
34
  readonly isPercent?: boolean;
20
- /** 是否堆积柱状图 */
35
+ /**
36
+ * @title 是否堆积柱状图
37
+ * @default false
38
+ */
21
39
  readonly isStack?: boolean;
22
- /** 柱状图宽度占比 [0-1] */
40
+ /**
41
+ * @title 柱状图宽度占比
42
+ * @description 范围[0-1]
43
+ */
23
44
  readonly columnWidthRatio?: number;
24
- /** 分组中柱子之间的间距 [0-1],仅对分组柱状图适用 */
45
+ /**
46
+ * @title 分组中柱子之间的间距
47
+ * @description 范围[0-1],仅对分组柱状图适用
48
+ */
25
49
  readonly marginRatio?: number;
26
- /** 柱状图最小宽度(像素) */
50
+ /**
51
+ * @title 柱状图最小宽度(像素)
52
+ */
27
53
  readonly minColumnWidth?: number;
28
- /** 柱状图最大宽度(像素) */
54
+ /**
55
+ * @title 柱状图最大宽度(像素)
56
+ */
29
57
  readonly maxColumnWidth?: number;
30
- /** 柱状图柱子的背景 */
58
+ /**
59
+ * @title 柱状图柱子的背景
60
+ */
31
61
  readonly columnBackground?: {
32
62
  style?: ShapeAttrs;
33
63
  };
34
- /** 柱子样式配置,可选 */
64
+ /**
65
+ * @title 柱子样式
66
+ */
35
67
  readonly columnStyle?: StyleAttr;
36
- /** 分组字段,优先级高于 seriesField , isGroup: true 时会根据 groupField 进行分组。*/
68
+ /**
69
+ * @title 分组字段
70
+ * @description 优先级高于 seriesField , isGroup: true 时会根据 groupField 进行分组
71
+ */
37
72
  readonly groupField?: string;
38
- /** 自定义柱状图 interval 图形元素展示形状 */
73
+ /**
74
+ * @title 自定义柱状图
75
+ * @description interval 图形元素展示形状
76
+ */
39
77
  readonly shape?: string;
40
- /** 开启下钻交互,以及进行下钻交互的配置 */
78
+ /**
79
+ * @title 图表交互
80
+ * @description 开启下钻交互,以及进行下钻交互的配置
81
+ */
41
82
  readonly brush?: BrushCfg;
42
83
  }
43
84
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/column/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeAttrs } from '@antv/g2';\nimport { BrushCfg, Options, StyleAttr } from '../../types';\nimport { OptionWithConversionTag } from '../../adaptor/conversion-tag';\nimport { OptionWithConnectedArea } from '../../adaptor/connected-area';\nimport { IntervalGeometryOptions } from '../../adaptor/geometries/interval';\n\ntype PartialIntervalGeometryOptions = Pick<IntervalGeometryOptions, 'dodgePadding' | 'intervalPadding'>;\n\nexport interface ColumnOptions\n extends Options,\n OptionWithConversionTag,\n OptionWithConnectedArea,\n PartialIntervalGeometryOptions {\n /** x 轴字段 */\n readonly xField: string;\n /** y 轴字段 */\n readonly yField: string;\n /** 拆分字段 */\n readonly seriesField?: string;\n /** 是否分组柱形图 */\n readonly isGroup?: boolean;\n /** 是否是区间柱状图 */\n readonly isRange?: boolean;\n /** 是否是百分比柱状图 */\n readonly isPercent?: boolean;\n /** 是否堆积柱状图 */\n readonly isStack?: boolean;\n /** 柱状图宽度占比 [0-1] */\n readonly columnWidthRatio?: number;\n /** 分组中柱子之间的间距 [0-1],仅对分组柱状图适用 */\n readonly marginRatio?: number;\n /** 柱状图最小宽度(像素) */\n readonly minColumnWidth?: number;\n /** 柱状图最大宽度(像素) */\n readonly maxColumnWidth?: number;\n /** 柱状图柱子的背景 */\n readonly columnBackground?: { style?: ShapeAttrs };\n /** 柱子样式配置,可选 */\n readonly columnStyle?: StyleAttr;\n /** 分组字段,优先级高于 seriesField , isGroup: true 时会根据 groupField 进行分组。*/\n readonly groupField?: string;\n\n // 自定义相关\n /** 自定义柱状图 interval 图形元素展示形状 */\n readonly shape?: string;\n\n // 图表交互\n /** 开启下钻交互,以及进行下钻交互的配置 */\n readonly brush?: BrushCfg;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/column/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeAttrs } from '@antv/g2';\nimport { BrushCfg, Options, StyleAttr } from '../../types';\nimport { OptionWithConversionTag } from '../../adaptor/conversion-tag';\nimport { OptionWithConnectedArea } from '../../adaptor/connected-area';\nimport { IntervalGeometryOptions } from '../../adaptor/geometries/interval';\n\ntype PartialIntervalGeometryOptions = Pick<IntervalGeometryOptions, 'dodgePadding' | 'intervalPadding'>;\n\nexport interface ColumnOptions\n extends Options,\n OptionWithConversionTag,\n OptionWithConnectedArea,\n PartialIntervalGeometryOptions {\n /**\n * @title x轴字段\n */\n readonly xField: string;\n /**\n * @title y轴字段\n */\n readonly yField: string;\n /**\n * @title 拆分字段\n */\n readonly seriesField?: string;\n /**\n * @title 是否分组柱形图\n * @default false\n */\n readonly isGroup?: boolean;\n /**\n * @title 是否是区间柱状图\n * @default false\n */\n readonly isRange?: boolean;\n /**\n * @title 是否是百分比柱状图\n * @default false\n */\n readonly isPercent?: boolean;\n /**\n * @title 是否堆积柱状图\n * @default false\n */\n readonly isStack?: boolean;\n /**\n * @title 柱状图宽度占比\n * @description 范围[0-1]\n */\n readonly columnWidthRatio?: number;\n /**\n * @title 分组中柱子之间的间距\n * @description 范围[0-1],仅对分组柱状图适用\n */\n readonly marginRatio?: number;\n /**\n * @title 柱状图最小宽度(像素)\n */\n readonly minColumnWidth?: number;\n /**\n * @title 柱状图最大宽度(像素)\n */\n readonly maxColumnWidth?: number;\n /**\n * @title 柱状图柱子的背景\n */\n readonly columnBackground?: { style?: ShapeAttrs };\n /**\n * @title 柱子样式\n */\n readonly columnStyle?: StyleAttr;\n /**\n * @title 分组字段\n * @description 优先级高于 seriesField , isGroup: true 时会根据 groupField 进行分组\n */\n readonly groupField?: string;\n /**\n * @title 自定义柱状图\n * @description interval 图形元素展示形状\n */\n readonly shape?: string;\n /**\n * @title 图表交互\n * @description 开启下钻交互,以及进行下钻交互的配置\n */\n readonly brush?: BrushCfg;\n}\n"]}
@@ -15,11 +15,31 @@ export interface PointConfig {
15
15
  readonly style?: StyleAttr;
16
16
  }
17
17
  declare type CommonGeometryOption = {
18
+ /**
19
+ * @title 图形类型
20
+ */
18
21
  readonly geometry?: string;
22
+ /**
23
+ * @title 数据标签的配置
24
+ */
19
25
  readonly label?: Options['label'];
26
+ /**
27
+ * @title 图例legend的配置项
28
+ */
20
29
  readonly legend?: Options['legend'];
30
+ /**
31
+ * @title 颜色色板
32
+ */
21
33
  readonly color?: Options['color'];
34
+ /**
35
+ * @title 是否分组
36
+ * @default false
37
+ */
22
38
  readonly isGroup?: boolean;
39
+ /**
40
+ * @title 分组字段
41
+ * @description 优先级高于 seriesField
42
+ */
23
43
  readonly groupField?: string;
24
44
  };
25
45
  export declare type GeometryLineOption = Pick<LineOptions, 'seriesField' | 'smooth' | 'connectNulls' | 'lineStyle' | 'point' | 'isStack' | 'stepType'> & CommonGeometryOption;
@@ -27,27 +47,32 @@ export declare type GeometryColumnOption = Pick<ColumnOptions, 'seriesField' | '
27
47
  export declare type GeometryOption = GeometryColumnOption | GeometryLineOption;
28
48
  export declare type DualAxesOptions = Omit<Options, 'data' | 'yAxis' | 'color' | 'annotations'> & {
29
49
  /**
30
- * 具体的数据,左右两边的数据
50
+ * @title 数据
51
+ * @description 具体的数据,左右两边的数据
31
52
  */
32
53
  readonly data: Array<Record<string, any>[]>;
33
54
  /**
34
- * 双轴图的 x 字段,x 字段名称需要保持一致
55
+ * @title 双轴图的 x 字段
56
+ * @description x 字段名称需要保持一致
35
57
  */
36
58
  readonly xField: string;
37
59
  /**
38
- * 双轴图左右 y 字段,需要不一致
60
+ * @title 双轴图左右 y 字段
61
+ * @description 需要不一致
39
62
  */
40
63
  readonly yField: string[];
41
64
  /**
42
- * 左右两边的 yAxis 配置,使用 object 的方式,key 为 y 字段名,或者数组分别表示左右
65
+ * @title 左右两边的 yAxis 配置
66
+ * @description 使用 object 的方式,key 为 y 字段名,或者数组分别表示左右
43
67
  */
44
68
  readonly yAxis?: Options['yAxis'][] | Record<string, Options['yAxis']>;
45
69
  /**
46
- * 左右两边的图形配置
70
+ * @title 左右两边的图形配置
47
71
  */
48
72
  readonly geometryOptions?: GeometryOption[];
49
73
  /**
50
- * 左右两边的 annotation 配置, 同时支持数组和object 两种形式,以防出现 field 相同无法设置的情况
74
+ * @title 左右两边的 annotation 配置
75
+ * @description 同时支持数组和object 两种形式,以防出现 field 相同无法设置的情况
51
76
  */
52
77
  readonly annotations?: Options['annotations'][] | Record<string, Options['annotations']>;
53
78
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/dual-axes/types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,2BAAe,CAAA;AACjB,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,qCAAiB,CAAA;AACnB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B","sourcesContent":["import { Options, ShapeAttr, SizeAttr, StyleAttr } from '../../types';\nimport { LineOptions } from '../line/types';\nimport { ColumnOptions } from '../column/types';\n\nexport enum AxisType {\n Left = 'Left',\n Right = 'Right',\n}\n\nexport enum DualAxesGeometry {\n Line = 'line',\n Column = 'column',\n}\n\nexport interface PointConfig {\n readonly shape?: ShapeAttr;\n readonly size?: SizeAttr;\n readonly style?: StyleAttr;\n}\n\ntype CommonGeometryOption = {\n // 图形类型\n readonly geometry?: string;\n // label\n readonly label?: Options['label'];\n // legend\n readonly legend?: Options['legend'];\n // 色板\n readonly color?: Options['color'];\n // 是否分组\n readonly isGroup?: boolean;\n // 分组字段,优先级高于 seriesField\n readonly groupField?: string;\n};\n\n// 折线设置接口, 直接用 LineOption 吧\nexport type GeometryLineOption = Pick<\n LineOptions,\n 'seriesField' | 'smooth' | 'connectNulls' | 'lineStyle' | 'point' | 'isStack' | 'stepType'\n> &\n CommonGeometryOption;\n\n// 柱设置接口\nexport type GeometryColumnOption = Pick<\n ColumnOptions,\n | 'seriesField'\n | 'isGroup'\n | 'isStack'\n | 'isRange'\n | 'isPercent'\n | 'columnWidthRatio'\n | 'marginRatio'\n | 'columnStyle'\n | 'pattern'\n> &\n CommonGeometryOption;\n\nexport type GeometryOption = GeometryColumnOption | GeometryLineOption;\n\nexport type DualAxesOptions = Omit<Options, 'data' | 'yAxis' | 'color' | 'annotations'> & {\n /**\n * 具体的数据,左右两边的数据\n */\n readonly data: Array<Record<string, any>[]>;\n\n /**\n * 双轴图的 x 字段,x 字段名称需要保持一致\n */\n readonly xField: string;\n /**\n * 双轴图左右 y 字段,需要不一致\n */\n readonly yField: string[];\n\n /**\n * 左右两边的 yAxis 配置,使用 object 的方式,key 为 y 字段名,或者数组分别表示左右\n */\n readonly yAxis?: Options['yAxis'][] | Record<string, Options['yAxis']>;\n\n /**\n * 左右两边的图形配置\n */\n readonly geometryOptions?: GeometryOption[];\n\n /**\n * 左右两边的 annotation 配置, 同时支持数组和object 两种形式,以防出现 field 相同无法设置的情况\n */\n readonly annotations?: Options['annotations'][] | Record<string, Options['annotations']>;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/dual-axes/types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,2BAAe,CAAA;AACjB,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,qCAAiB,CAAA;AACnB,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B","sourcesContent":["import { Options, ShapeAttr, SizeAttr, StyleAttr } from '../../types';\nimport { LineOptions } from '../line/types';\nimport { ColumnOptions } from '../column/types';\n\nexport enum AxisType {\n Left = 'Left',\n Right = 'Right',\n}\n\nexport enum DualAxesGeometry {\n Line = 'line',\n Column = 'column',\n}\n\nexport interface PointConfig {\n readonly shape?: ShapeAttr;\n readonly size?: SizeAttr;\n readonly style?: StyleAttr;\n}\n\ntype CommonGeometryOption = {\n /**\n * @title 图形类型\n */\n readonly geometry?: string;\n /**\n * @title 数据标签的配置\n */\n readonly label?: Options['label'];\n /**\n * @title 图例legend的配置项\n */\n readonly legend?: Options['legend'];\n /**\n * @title 颜色色板\n */\n readonly color?: Options['color'];\n /**\n * @title 是否分组\n * @default false\n */\n readonly isGroup?: boolean;\n /**\n * @title 分组字段\n * @description 优先级高于 seriesField\n */\n readonly groupField?: string;\n};\n\n// 折线设置接口, 直接用 LineOption 吧\nexport type GeometryLineOption = Pick<\n LineOptions,\n 'seriesField' | 'smooth' | 'connectNulls' | 'lineStyle' | 'point' | 'isStack' | 'stepType'\n> &\n CommonGeometryOption;\n\n// 柱设置接口\nexport type GeometryColumnOption = Pick<\n ColumnOptions,\n | 'seriesField'\n | 'isGroup'\n | 'isStack'\n | 'isRange'\n | 'isPercent'\n | 'columnWidthRatio'\n | 'marginRatio'\n | 'columnStyle'\n | 'pattern'\n> &\n CommonGeometryOption;\n\nexport type GeometryOption = GeometryColumnOption | GeometryLineOption;\n\nexport type DualAxesOptions = Omit<Options, 'data' | 'yAxis' | 'color' | 'annotations'> & {\n /**\n * @title 数据\n * @description 具体的数据,左右两边的数据\n */\n readonly data: Array<Record<string, any>[]>;\n /**\n * @title 双轴图的 x 字段\n * @description x 字段名称需要保持一致\n */\n readonly xField: string;\n /**\n * @title 双轴图左右 y 字段\n * @description 需要不一致\n */\n readonly yField: string[];\n /**\n * @title 左右两边的 yAxis 配置\n * @description 使用 object 的方式,key 为 y 字段名,或者数组分别表示左右\n */\n readonly yAxis?: Options['yAxis'][] | Record<string, Options['yAxis']>;\n /**\n * @title 左右两边的图形配置\n */\n readonly geometryOptions?: GeometryOption[];\n /**\n * @title 左右两边的 annotation 配置\n * @description 同时支持数组和object 两种形式,以防出现 field 相同无法设置的情况\n */\n readonly annotations?: Options['annotations'][] | Record<string, Options['annotations']>;\n};\n"]}
@@ -8,121 +8,141 @@ import { Annotation } from '../../types/annotation';
8
8
  import { Interaction } from '../../types/interaction';
9
9
  import { IPlotTypes } from '../mix/utils';
10
10
  /**
11
- * geometry 映射信息
11
+ * @title geometry 映射信息
12
12
  */
13
13
  export declare type IGeometry = Geometry & {
14
14
  adjust?: Types.AdjustOption;
15
15
  };
16
16
  /**
17
- * 子 view 的配置。
18
- * 1. 暂时不开嵌套 view 的情况
19
- * 2. 暂不开放 分面子 view 的 meta 独立设置
17
+ * @title 子 view 的配置
18
+ * @description 1. 暂时不开嵌套 view 的情况 2. 暂不开放 分面子 view 的 meta 独立设置
20
19
  */
21
20
  export declare type IView = {
22
21
  /**
23
- * 图形 geometry 及映射配置
22
+ * @title 图形
23
+ * @description geometry 及映射配置
24
24
  */
25
25
  readonly geometries: IGeometry[];
26
26
  /**
27
- * 1. optional,view 中的数据,默认由分面数据来根据拆分维度值进行分配
27
+ * @title 数据
28
+ * @description optional,view 中的数据
28
29
  */
29
30
  readonly data?: Data;
30
31
  /**
31
- * 2. meta
32
+ * @title meta
32
33
  */
33
34
  readonly meta?: Record<string, Axis>;
34
35
  /**
35
- * 3. 坐标系的配置,每一个 view 具有相同的坐标系
36
+ * @title 坐标系的配置
37
+ * @description 每一个 view 具有相同的坐标系
36
38
  */
37
39
  readonly coordinate?: Types.CoordinateOption;
38
40
  /**
39
- * 4. 坐标轴配置
41
+ * @title 坐标轴配置
40
42
  */
41
43
  readonly axes?: false | Record<string, Axis>;
42
44
  /**
43
- * 5. interactions 配置
45
+ * @title interactions 配置
44
46
  */
45
47
  readonly interactions?: Interaction[];
46
48
  /**
47
- * 6. annotation 配置
49
+ * @title annotation 配置
48
50
  */
49
51
  readonly annotations?: Annotation[];
50
52
  /**
51
- * 7. animation 配置
53
+ * @title animation 配置
52
54
  */
53
55
  readonly animation?: Animation;
54
56
  /**
55
- * 8. tooltip 配置
57
+ * @title tooltip 配置
56
58
  */
57
59
  readonly tooltip?: Tooltip;
58
60
  };
59
61
  /**
60
- * 子 plot 的配置
62
+ * @title 子 plot 的配置
61
63
  */
62
64
  export declare type IPlot = IPlotTypes;
63
65
  /**
64
- * facetData map
66
+ * @title facetData map
65
67
  */
66
68
  declare type FacetDataMap = {
67
- /** rect 类型分面配置 */
69
+ /**
70
+ * @title rect 类型分面配置
71
+ */
68
72
  readonly rect: Types.RectData;
69
- /** mirror 类型分面配置 */
73
+ /**
74
+ * @title mirror 类型分面配置
75
+ */
70
76
  readonly mirror: Types.MirrorData;
71
- /** list 类型分面配置 */
77
+ /**
78
+ * @title list 类型分面配置
79
+ */
72
80
  readonly list: Types.ListData;
73
- /** matrix 类型分面配置 */
81
+ /**
82
+ * @title matrix 类型分面配置
83
+ */
74
84
  readonly matrix: Types.MatrixData;
75
- /** circle 类型分面配置 */
85
+ /**
86
+ * @title circle 类型分面配置
87
+ */
76
88
  readonly circle: Types.CircleData;
77
- /** tree 类型分面配置 */
89
+ /**
90
+ * @title tree 类型分面配置
91
+ */
78
92
  readonly tree: Types.TreeData;
79
93
  };
80
94
  declare type FacetCfg = Types.MirrorCfg & Types.RectCfg & Types.TreeCfg & Types.ListCfg & Types.CircleCfg & Types.MatrixCfg;
81
- /** 分面图的配置类型定义 */
95
+ /**
96
+ * @title 分面图的配置类型定义
97
+ */
82
98
  export interface FacetOptions<T extends keyof Types.FacetCfgMap = keyof Types.FacetCfgMap> extends Options, FacetCfg {
83
99
  /**
84
- * 分面类型,G2 内置了六种分面: rect、list、circle、tree、mirror 和 matrix
100
+ * @title 分面类型
101
+ * @description G2 内置了六种分面: rect、list、circle、tree、mirror 和 matrix
85
102
  */
86
103
  readonly type: T;
87
104
  /**
88
- * 数据划分维度。
105
+ * @title 数据划分维度
89
106
  */
90
107
  readonly fields: string[];
91
108
  /**
92
- * 分面数据
109
+ * @title 分面数据
93
110
  */
94
111
  readonly data: Data;
95
112
  /**
96
- * 每个分面 view 中的具体绘图表现
97
- * 回调的方式
113
+ * @title 绘图
114
+ * @description 每个分面 view 中的具体绘图表现 回调的方式
98
115
  */
99
116
  readonly eachView: (innerView: View, facet?: FacetDataMap[T]) => IView | IPlot;
100
117
  /**
101
- * 是否展示分面标题
118
+ * @title 是否展示分面标题
119
+ * @default false
102
120
  */
103
121
  readonly showTitle?: boolean;
104
122
  /**
105
- * 3. facet 中对应的 meta 字段配置
123
+ * @title meta 字段
124
+ * @description facet 中对应的 meta 字段配置
106
125
  */
107
126
  readonly meta?: Record<string, Meta>;
108
127
  /**
109
- * 4. 坐标系的配置,每一个 view 具有相同的坐标系
128
+ * @title 坐标系的配置
129
+ * @description 每一个 view 具有相同的坐标系
110
130
  */
111
131
  readonly coordinate?: Types.CoordinateOption;
112
132
  /**
113
- * 5. 轴配置
133
+ * @title 轴配置
114
134
  */
115
135
  readonly axes?: false | Record<string, Axis>;
116
136
  /**
117
- * 6. tooltip 配置
137
+ * @title tooltip 配置
118
138
  */
119
139
  readonly tooltip?: Tooltip;
120
140
  /**
121
- * 7. 图例配置
141
+ * @title 图例配置
122
142
  */
123
143
  readonly legend?: Legend;
124
144
  /**
125
- * 8. 图例配置
145
+ * @title 图例配置
126
146
  */
127
147
  readonly interactions?: Interaction[];
128
148
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/facet/types.ts"],"names":[],"mappings":"","sourcesContent":["import { View, Types } from '@antv/g2';\nimport { Data, Meta, Options, Tooltip } from '../../types';\nimport { Axis } from '../../types/axis';\nimport { Legend } from '../../types/legend';\nimport { Geometry } from '../../adaptor/geometries/base';\nimport { Animation } from '../../types/animation';\nimport { Annotation } from '../../types/annotation';\nimport { Interaction } from '../../types/interaction';\nimport { IPlotTypes } from '../mix/utils';\n\n/**\n * geometry 映射信息\n */\nexport type IGeometry = Geometry & {\n adjust?: Types.AdjustOption;\n};\n\n/**\n * 子 view 的配置。\n * 1. 暂时不开嵌套 view 的情况\n * 2. 暂不开放 分面子 view 的 meta 独立设置\n */\nexport type IView = {\n /**\n * 图形 geometry 及映射配置\n */\n readonly geometries: IGeometry[];\n\n /**\n * 1. optional,view 中的数据,默认由分面数据来根据拆分维度值进行分配\n */\n readonly data?: Data;\n\n /**\n * 2. meta\n */\n readonly meta?: Record<string, Axis>;\n\n /**\n * 3. 坐标系的配置,每一个 view 具有相同的坐标系\n */\n readonly coordinate?: Types.CoordinateOption;\n\n /**\n * 4. 坐标轴配置\n */\n readonly axes?: false | Record<string, Axis>;\n\n /**\n * 5. interactions 配置\n */\n readonly interactions?: Interaction[];\n\n /**\n * 6. annotation 配置\n */\n readonly annotations?: Annotation[];\n\n /**\n * 7. animation 配置\n */\n readonly animation?: Animation;\n\n /**\n * 8. tooltip 配置\n */\n readonly tooltip?: Tooltip;\n};\n\n/**\n * 子 plot 的配置\n */\nexport type IPlot = IPlotTypes;\n/**\n * facetData map\n */\ntype FacetDataMap = {\n /** rect 类型分面配置 */\n readonly rect: Types.RectData;\n /** mirror 类型分面配置 */\n readonly mirror: Types.MirrorData;\n /** list 类型分面配置 */\n readonly list: Types.ListData;\n /** matrix 类型分面配置 */\n readonly matrix: Types.MatrixData;\n /** circle 类型分面配置 */\n readonly circle: Types.CircleData;\n /** tree 类型分面配置 */\n readonly tree: Types.TreeData;\n};\n\ntype FacetCfg = Types.MirrorCfg & Types.RectCfg & Types.TreeCfg & Types.ListCfg & Types.CircleCfg & Types.MatrixCfg;\n\n/** 分面图的配置类型定义 */\nexport interface FacetOptions<T extends keyof Types.FacetCfgMap = keyof Types.FacetCfgMap> extends Options, FacetCfg {\n /**\n * 分面类型,G2 内置了六种分面: rect、list、circle、tree、mirror 和 matrix\n */\n readonly type: T;\n /**\n * 数据划分维度。\n */\n readonly fields: string[];\n /**\n * 分面数据\n */\n readonly data: Data;\n\n /**\n * 每个分面 view 中的具体绘图表现\n * 回调的方式\n */\n readonly eachView: (innerView: View, facet?: FacetDataMap[T]) => IView | IPlot;\n /**\n * 是否展示分面标题\n */\n readonly showTitle?: boolean;\n\n /**\n * 3. facet 中对应的 meta 字段配置\n */\n readonly meta?: Record<string, Meta>;\n\n /**\n * 4. 坐标系的配置,每一个 view 具有相同的坐标系\n */\n readonly coordinate?: Types.CoordinateOption;\n\n /**\n * 5. 轴配置\n */\n readonly axes?: false | Record<string, Axis>;\n\n /**\n * 6. tooltip 配置\n */\n readonly tooltip?: Tooltip;\n\n /**\n * 7. 图例配置\n */\n readonly legend?: Legend;\n\n /**\n * 8. 图例配置\n */\n readonly interactions?: Interaction[];\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/facet/types.ts"],"names":[],"mappings":"","sourcesContent":["import { View, Types } from '@antv/g2';\nimport { Data, Meta, Options, Tooltip } from '../../types';\nimport { Axis } from '../../types/axis';\nimport { Legend } from '../../types/legend';\nimport { Geometry } from '../../adaptor/geometries/base';\nimport { Animation } from '../../types/animation';\nimport { Annotation } from '../../types/annotation';\nimport { Interaction } from '../../types/interaction';\nimport { IPlotTypes } from '../mix/utils';\n\n/**\n * @title geometry 映射信息\n */\nexport type IGeometry = Geometry & {\n adjust?: Types.AdjustOption;\n};\n\n/**\n * @title 子 view 的配置\n * @description 1. 暂时不开嵌套 view 的情况 2. 暂不开放 分面子 view 的 meta 独立设置\n */\nexport type IView = {\n /**\n * @title 图形\n * @description geometry 及映射配置\n */\n readonly geometries: IGeometry[];\n /**\n * @title 数据\n * @description optional,view 中的数据\n */\n readonly data?: Data;\n /**\n * @title meta\n */\n readonly meta?: Record<string, Axis>;\n /**\n * @title 坐标系的配置\n * @description 每一个 view 具有相同的坐标系\n */\n readonly coordinate?: Types.CoordinateOption;\n /**\n * @title 坐标轴配置\n */\n readonly axes?: false | Record<string, Axis>;\n /**\n * @title interactions 配置\n */\n readonly interactions?: Interaction[];\n /**\n * @title annotation 配置\n */\n readonly annotations?: Annotation[];\n /**\n * @title animation 配置\n */\n readonly animation?: Animation;\n /**\n * @title tooltip 配置\n */\n readonly tooltip?: Tooltip;\n};\n\n/**\n * @title 子 plot 的配置\n */\nexport type IPlot = IPlotTypes;\n/**\n * @title facetData map\n */\ntype FacetDataMap = {\n /**\n * @title rect 类型分面配置\n */\n readonly rect: Types.RectData;\n /**\n * @title mirror 类型分面配置\n */\n readonly mirror: Types.MirrorData;\n /**\n * @title list 类型分面配置\n */\n readonly list: Types.ListData;\n /**\n * @title matrix 类型分面配置\n */\n readonly matrix: Types.MatrixData;\n /**\n * @title circle 类型分面配置\n */\n readonly circle: Types.CircleData;\n /**\n * @title tree 类型分面配置\n */\n readonly tree: Types.TreeData;\n};\n\ntype FacetCfg = Types.MirrorCfg & Types.RectCfg & Types.TreeCfg & Types.ListCfg & Types.CircleCfg & Types.MatrixCfg;\n\n/**\n * @title 分面图的配置类型定义\n */\nexport interface FacetOptions<T extends keyof Types.FacetCfgMap = keyof Types.FacetCfgMap> extends Options, FacetCfg {\n /**\n * @title 分面类型\n * @description G2 内置了六种分面: rect、list、circle、tree、mirror 和 matrix\n */\n readonly type: T;\n /**\n * @title 数据划分维度\n */\n readonly fields: string[];\n /**\n * @title 分面数据\n */\n readonly data: Data;\n /**\n * @title 绘图\n * @description 每个分面 view 中的具体绘图表现 回调的方式\n */\n readonly eachView: (innerView: View, facet?: FacetDataMap[T]) => IView | IPlot;\n /**\n * @title 是否展示分面标题\n * @default false\n */\n readonly showTitle?: boolean;\n /**\n * @title meta 字段\n * @description facet 中对应的 meta 字段配置\n */\n readonly meta?: Record<string, Meta>;\n /**\n * @title 坐标系的配置\n * @description 每一个 view 具有相同的坐标系\n */\n readonly coordinate?: Types.CoordinateOption;\n /**\n * @title 轴配置\n */\n readonly axes?: false | Record<string, Axis>;\n /**\n * @title tooltip 配置\n */\n readonly tooltip?: Tooltip;\n /**\n * @title 图例配置\n */\n readonly legend?: Legend;\n /**\n * @title 图例配置\n */\n readonly interactions?: Interaction[];\n}\n"]}
@@ -5,27 +5,56 @@ export declare type ConversionPosition = {
5
5
  end: AnnotationPosition;
6
6
  };
7
7
  export interface FunnelOptions extends Options {
8
- /** x 轴字段 */
8
+ /**
9
+ * @title x轴字段
10
+ */
9
11
  readonly xField?: string;
10
- /** y 轴字段 */
12
+ /**
13
+ * @title y轴字段
14
+ */
11
15
  readonly yField?: string;
12
- /** 分组字段: 漏斗图将根据此字段转置为分面漏斗图 */
16
+ /**
17
+ * @title 分组字段
18
+ * @description 漏斗图将根据此字段转置为分面漏斗图
19
+ */
13
20
  readonly seriesField?: string;
14
- /** 对比字段:漏斗图将根据此字段转置为对比漏斗图 */
21
+ /**
22
+ * @title 对比字段
23
+ * @description 漏斗图将根据此字段转置为对比漏斗图
24
+ */
15
25
  readonly compareField?: string;
16
- /** 是否转置 */
26
+ /**
27
+ * @title 是否转置
28
+ * @default false
29
+ */
17
30
  readonly isTransposed?: boolean;
18
- /** 是否是动态高度 */
31
+ /**
32
+ * @title 是否是动态高度
33
+ * @default false
34
+ */
19
35
  readonly dynamicHeight?: boolean;
20
- /** maxSize: 最大宽度,0-1 之间 */
36
+ /**
37
+ * @title 最大宽度
38
+ * @description 范围0-1
39
+ */
21
40
  readonly maxSize?: number;
22
- /** minSize: 最大宽度,0-1 之间 */
41
+ /**
42
+ * @title 最小宽度
43
+ * @description 范围0-1
44
+ */
23
45
  readonly minSize?: number;
24
- /** shape 形状: pyramid 金字塔, 只在基础漏斗图中适用. 在对比漏斗图以及设置 dynamicHeight: 'true' 时不适用 */
46
+ /**
47
+ * @title shape 形状
48
+ * @description pyramid 金字塔, 只在基础漏斗图中适用. 在对比漏斗图以及设置 dynamicHeight: 'true' 时不适用
49
+ */
25
50
  readonly shape?: string;
26
- /** 漏斗图样式 */
51
+ /**
52
+ * @title 漏斗图样式
53
+ */
27
54
  readonly funnelStyle?: StyleAttr;
28
- /** 转化率信息 */
55
+ /**
56
+ * @title 转化率信息
57
+ */
29
58
  readonly conversionTag?: false | {
30
59
  readonly offsetX?: number;
31
60
  readonly offsetY?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/funnel/types.ts"],"names":[],"mappings":"","sourcesContent":["import { StyleAttr } from '../../types/attr';\nimport { TextStyle, Datum, Data, AnnotationPosition, Options } from '../../types/common';\n\nexport type ConversionPosition = {\n start: AnnotationPosition;\n end: AnnotationPosition;\n};\n\nexport interface FunnelOptions extends Options {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段: 漏斗图将根据此字段转置为分面漏斗图 */\n readonly seriesField?: string;\n /** 对比字段:漏斗图将根据此字段转置为对比漏斗图 */\n readonly compareField?: string;\n /** 是否转置 */\n readonly isTransposed?: boolean;\n /** 是否是动态高度 */\n readonly dynamicHeight?: boolean;\n /** maxSize: 最大宽度,0-1 之间 */\n readonly maxSize?: number;\n /** minSize: 最大宽度,0-1 之间 */\n readonly minSize?: number;\n\n // 样式\n /** shape 形状: pyramid 金字塔, 只在基础漏斗图中适用. 在对比漏斗图以及设置 dynamicHeight: 'true' 时不适用 */\n readonly shape?: string;\n /** 漏斗图样式 */\n readonly funnelStyle?: StyleAttr;\n\n // 组件\n /** 转化率信息 */\n readonly conversionTag?:\n | false\n | {\n readonly offsetX?: number;\n readonly offsetY?: number;\n readonly style?: TextStyle;\n readonly formatter?: string | ((datum?: Datum, data?: Data) => string);\n };\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/funnel/types.ts"],"names":[],"mappings":"","sourcesContent":["import { StyleAttr } from '../../types/attr';\nimport { TextStyle, Datum, Data, AnnotationPosition, Options } from '../../types/common';\n\nexport type ConversionPosition = {\n start: AnnotationPosition;\n end: AnnotationPosition;\n};\n\nexport interface FunnelOptions extends Options {\n /**\n * @title x轴字段\n */\n readonly xField?: string;\n /**\n * @title y轴字段\n */\n readonly yField?: string;\n /**\n * @title 分组字段\n * @description 漏斗图将根据此字段转置为分面漏斗图\n */\n readonly seriesField?: string;\n /**\n * @title 对比字段\n * @description 漏斗图将根据此字段转置为对比漏斗图\n */\n readonly compareField?: string;\n /**\n * @title 是否转置\n * @default false\n */\n readonly isTransposed?: boolean;\n /**\n * @title 是否是动态高度\n * @default false\n */\n readonly dynamicHeight?: boolean;\n /**\n * @title 最大宽度\n * @description 范围0-1\n */\n readonly maxSize?: number;\n /**\n * @title 最小宽度\n * @description 范围0-1\n */\n readonly minSize?: number;\n /**\n * @title shape 形状\n * @description pyramid 金字塔, 只在基础漏斗图中适用. 在对比漏斗图以及设置 dynamicHeight: 'true' 时不适用\n */\n readonly shape?: string;\n /**\n * @title 漏斗图样式\n */\n readonly funnelStyle?: StyleAttr;\n\n // 组件\n /**\n * @title 转化率信息\n */\n readonly conversionTag?:\n | false\n | {\n readonly offsetX?: number;\n readonly offsetY?: number;\n readonly style?: TextStyle;\n readonly formatter?: string | ((datum?: Datum, data?: Data) => string);\n };\n}\n"]}
@@ -3,66 +3,128 @@ import { Axis } from '../../types/axis';
3
3
  import { PERCENT, RANGE_TYPE, RANGE_VALUE } from './constants';
4
4
  /** 指标指标的配置 */
5
5
  export declare type Indicator = {
6
+ /**
7
+ * @title 指针
8
+ * @description 只允许静态的 object
9
+ */
6
10
  readonly pointer?: {
7
11
  readonly style?: ShapeStyle;
8
12
  };
13
+ /**
14
+ * @title 圆环
15
+ * @description 只允许静态的 object
16
+ */
9
17
  readonly pin?: {
10
18
  readonly style?: ShapeStyle;
11
19
  };
20
+ /**
21
+ * @title 自定义指针 shape
22
+ * @default 'gauge-indicator'
23
+ */
12
24
  readonly shape?: string;
13
25
  };
14
26
  export declare type Range = {
15
- /** 辅助的刻度值 0 ~ 1 的数字 */
27
+ /**
28
+ * @title 辅助的刻度值
29
+ * @description 0 ~ 1 的数字
30
+ */
16
31
  readonly ticks?: number[];
17
- /** 辅助刻度的颜色配置 */
32
+ /**
33
+ * @title 辅助刻度的颜色配置
34
+ */
18
35
  readonly color?: string | string[];
19
- /** 仪表盘辅助背景的宽度 */
36
+ /**
37
+ * @title 仪表盘辅助背景的宽度
38
+ */
20
39
  readonly width?: number;
21
40
  };
22
41
  /**
23
- * 仪表盘辅助生成的 rangeData
42
+ * @title 仪表盘辅助生成的 rangeData
24
43
  */
25
44
  export declare type GaugeRangeData = {
26
45
  readonly [RANGE_VALUE]?: number;
27
46
  readonly [RANGE_TYPE]: string;
28
47
  readonly [PERCENT]: number;
29
48
  }[];
30
- /** 仪表盘配置类型定义 */
49
+ /**
50
+ * @title 仪表盘配置类型定义
51
+ */
31
52
  export interface GaugeOptions extends Omit<Options, 'data' | 'tooltip' | 'legend' | 'xAxis' | 'yAxis' | 'xField' | 'yField' | 'color'> {
32
- /** 指标的比例 0 ~ 1 */
53
+ /**
54
+ * @title 指标的比例
55
+ * @description 范围0 ~ 1
56
+ */
33
57
  readonly percent: number;
34
- /** 外弧度 0 ~ 1 */
58
+ /**
59
+ * @title 外弧度
60
+ * @description 范围0 ~ 1
61
+ */
35
62
  readonly radius?: number;
36
- /** 内弧度 0 ~ 1 */
63
+ /**
64
+ * @title 内弧度
65
+ * @description 范围0 ~ 1
66
+ */
37
67
  readonly innerRadius?: number;
38
- /** 弧度起始 */
68
+ /**
69
+ * @title 弧度起始
70
+ */
39
71
  readonly startAngle?: number;
40
- /** 弧度结束 */
72
+ /**
73
+ * @title 弧度结束
74
+ */
41
75
  readonly endAngle?: number;
42
- /** 辅助的 range 组件 */
76
+ /**
77
+ * @title 辅助的 range 组件
78
+ */
43
79
  readonly range?: Range;
44
- /** 坐标轴配置 */
80
+ /**
81
+ * @title 坐标轴配置
82
+ */
45
83
  readonly axis?: Axis;
46
- /** 指针的配置 */
84
+ /**
85
+ * @title 指针的配置
86
+ */
47
87
  readonly indicator?: false | Indicator;
48
- /** 统计文本 */
88
+ /**
89
+ * @title 统计文本
90
+ */
49
91
  readonly statistic?: Statistic;
50
- /** 仪表盘样式 */
92
+ /**
93
+ * @title 仪表盘样式
94
+ */
51
95
  readonly gaugeStyle?: StyleAttr;
52
- /** 仪表盘类型, 可选项: 'meter', default 为空 */
96
+ /**
97
+ * @title meter gauge 相关配置
98
+ */
99
+ /**
100
+ * @title 仪表盘类型
101
+ * @description 可选项: 'meter', default 为空
102
+ */
53
103
  readonly type?: string;
54
- /** 当仪表盘类型 = 'meter' 生效 */
104
+ /**
105
+ * @title 仪表盘配置
106
+ * @description 当仪表盘类型 = 'meter' 生效
107
+ */
55
108
  readonly meter?: {
56
- /** 仪表盘总步数, default: 50 */
109
+ /**
110
+ * @title 仪表盘总步数
111
+ * @default "50"
112
+ */
57
113
  readonly steps?: number;
58
- /** step 与 gap 的宽度占比, default: 0.5 */
114
+ /**
115
+ * @title step 与 gap 的宽度占比
116
+ * @default "0.5"
117
+ */
59
118
  readonly stepRatio?: number;
60
119
  };
61
120
  }
62
121
  /**
63
- * 仪表盘 自定义 shape 使用的 customInfo
122
+ * @title 仪表盘
123
+ * @description 自定义 shape 使用的 customInfo
64
124
  */
65
125
  export declare type GaugeCustomInfo = {
66
- /** 仪表盘 meter 类型的相关配置 */
126
+ /**
127
+ * @title 仪表盘 meter 类型的相关配置
128
+ */
67
129
  readonly meter?: GaugeOptions['meter'];
68
130
  };