@visactor/vseed 0.1.2 → 0.1.4

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 (58) hide show
  1. package/dist/builder/builder/builder.d.ts +6 -28
  2. package/dist/dataReshape/dataReshapeByEncoding.d.ts +1 -0
  3. package/dist/dataReshape/foldMeasures.d.ts +6 -5
  4. package/dist/index.cjs +844 -609
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.js +857 -619
  7. package/dist/index.js.map +1 -1
  8. package/dist/pipeline/advanced/chart/pipes/index.d.ts +1 -0
  9. package/dist/pipeline/advanced/chart/pipes/init/index.d.ts +1 -3
  10. package/dist/pipeline/advanced/chart/pipes/init/utils.d.ts +2 -0
  11. package/dist/pipeline/advanced/chart/pipes/{init/autoMeasures.d.ts → measures/buildMeasures.d.ts} +1 -1
  12. package/dist/pipeline/advanced/chart/pipes/measures/buildMeasuresForDualAxis.d.ts +2 -0
  13. package/dist/pipeline/advanced/chart/pipes/measures/buildMeasuresForScatter.d.ts +2 -0
  14. package/dist/pipeline/advanced/chart/pipes/measures/index.d.ts +4 -0
  15. package/dist/pipeline/advanced/chart/pipes/measures/utils.d.ts +28 -0
  16. package/dist/pipeline/spec/chart/pipes/color/colorAdapter.d.ts +2 -1
  17. package/dist/pipeline/spec/chart/pipes/color/index.d.ts +2 -1
  18. package/dist/pipeline/spec/chart/pipes/color/linearColorForDualAxis.d.ts +2 -0
  19. package/dist/pipeline/utils/chatType.d.ts +1 -1
  20. package/dist/types/advancedVSeed.d.ts +24 -14
  21. package/dist/types/chartType/area/zArea.d.ts +24 -0
  22. package/dist/types/chartType/areaPercent/zAreaPercent.d.ts +24 -0
  23. package/dist/types/chartType/bar/zBar.d.ts +24 -0
  24. package/dist/types/chartType/barParallel/zBarParallel.d.ts +24 -0
  25. package/dist/types/chartType/barPercent/zBarPercent.d.ts +24 -0
  26. package/dist/types/chartType/column/zColumn.d.ts +24 -0
  27. package/dist/types/chartType/columnParallel/zColumnParallel.d.ts +24 -0
  28. package/dist/types/chartType/columnPercent/zColumnPercent.d.ts +24 -0
  29. package/dist/types/chartType/donut/zDonut.d.ts +24 -0
  30. package/dist/types/chartType/dualAxis/zDualAxis.d.ts +76 -0
  31. package/dist/types/chartType/funnel/zFunnel.d.ts +24 -0
  32. package/dist/types/chartType/heatmap/zHeatmap.d.ts +24 -0
  33. package/dist/types/chartType/line/line.d.ts +0 -1
  34. package/dist/types/chartType/line/zLine.d.ts +24 -0
  35. package/dist/types/chartType/pie/zPie.d.ts +24 -0
  36. package/dist/types/chartType/pivotTable/zPivotTable.d.ts +24 -0
  37. package/dist/types/chartType/radar/zRadar.d.ts +24 -0
  38. package/dist/types/chartType/rose/zRose.d.ts +24 -0
  39. package/dist/types/chartType/roseParallel/zRoseParallel.d.ts +24 -0
  40. package/dist/types/chartType/scatter/zScatter.d.ts +76 -0
  41. package/dist/types/chartType/table/zTable.d.ts +24 -0
  42. package/dist/types/properties/dimensions/dimensions.d.ts +16 -0
  43. package/dist/types/properties/dimensions/zDimensions.d.ts +33 -0
  44. package/dist/types/properties/encoding/encoding.d.ts +0 -1
  45. package/dist/types/properties/encoding/index.d.ts +2 -2
  46. package/dist/types/properties/encoding/zEncoding.d.ts +0 -14
  47. package/dist/types/properties/measures/dualMeasures.d.ts +1 -0
  48. package/dist/types/properties/measures/measures.d.ts +19 -0
  49. package/dist/types/properties/measures/scatterMeasures.d.ts +1 -0
  50. package/dist/types/properties/measures/zDualMeasures.d.ts +104 -0
  51. package/dist/types/properties/measures/zMeasures.d.ts +39 -0
  52. package/dist/types/properties/measures/zScatterMeasures.d.ts +104 -0
  53. package/dist/types/zVseed.d.ts +584 -0
  54. package/dist/umd/index.js +858 -607
  55. package/dist/umd/index.js.map +1 -1
  56. package/package.json +1 -1
  57. package/dist/pipeline/advanced/chart/pipes/init/autoDualMeasures.d.ts +0 -2
  58. package/dist/pipeline/advanced/chart/pipes/init/autoScatterMeasures.d.ts +0 -2
@@ -10,6 +10,17 @@ export declare const zHeatmap: z.ZodObject<{
10
10
  rowDimension: "rowDimension";
11
11
  columnDimension: "columnDimension";
12
12
  }>>;
13
+ encoding: z.ZodOptional<z.ZodEnum<{
14
+ column: "column";
15
+ xAxis: "xAxis";
16
+ yAxis: "yAxis";
17
+ angle: "angle";
18
+ color: "color";
19
+ detail: "detail";
20
+ tooltip: "tooltip";
21
+ label: "label";
22
+ row: "row";
23
+ }>>;
13
24
  }, z.core.$strip>>>>;
14
25
  measures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnion<[z.ZodType<import("../..").MeasureGroup, unknown, z.core.$ZodTypeInternals<import("../..").MeasureGroup, unknown>>, z.ZodObject<{
15
26
  id: z.ZodString;
@@ -45,6 +56,19 @@ export declare const zHeatmap: z.ZodObject<{
45
56
  halfEven: "halfEven";
46
57
  }>>>;
47
58
  }, z.core.$strip>>>;
59
+ encoding: z.ZodOptional<z.ZodEnum<{
60
+ xAxis: "xAxis";
61
+ yAxis: "yAxis";
62
+ angle: "angle";
63
+ color: "color";
64
+ tooltip: "tooltip";
65
+ label: "label";
66
+ primaryYAxis: "primaryYAxis";
67
+ secondaryYAxis: "secondaryYAxis";
68
+ radius: "radius";
69
+ size: "size";
70
+ }>>;
71
+ parentId: z.ZodOptional<z.ZodString>;
48
72
  }, z.core.$strip>]>>>>;
49
73
  backgroundColor: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>>;
50
74
  color: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -53,7 +53,6 @@ export interface Line {
53
53
  dimensions?: Dimensions;
54
54
  /**
55
55
  * @description 指标, 折线图的所有指标会自动合并为一个指标, 映射到Y轴, 存在多个指标时, 指标名称会与其余维度合并, 作为图例项展示.
56
- * @type {DimensionTree}
57
56
  * @example [{id: "value", alias: "数值"}]
58
57
  */
59
58
  measures?: MeasureTree;
@@ -24,6 +24,17 @@ export declare const zLine: z.ZodObject<{
24
24
  rowDimension: "rowDimension";
25
25
  columnDimension: "columnDimension";
26
26
  }>>;
27
+ encoding: z.ZodOptional<z.ZodEnum<{
28
+ column: "column";
29
+ xAxis: "xAxis";
30
+ yAxis: "yAxis";
31
+ angle: "angle";
32
+ color: "color";
33
+ detail: "detail";
34
+ tooltip: "tooltip";
35
+ label: "label";
36
+ row: "row";
37
+ }>>;
27
38
  }, z.core.$strip>>>>;
28
39
  measures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnion<[z.ZodType<import("../..").MeasureGroup, unknown, z.core.$ZodTypeInternals<import("../..").MeasureGroup, unknown>>, z.ZodObject<{
29
40
  id: z.ZodString;
@@ -59,6 +70,19 @@ export declare const zLine: z.ZodObject<{
59
70
  halfEven: "halfEven";
60
71
  }>>>;
61
72
  }, z.core.$strip>>>;
73
+ encoding: z.ZodOptional<z.ZodEnum<{
74
+ xAxis: "xAxis";
75
+ yAxis: "yAxis";
76
+ angle: "angle";
77
+ color: "color";
78
+ tooltip: "tooltip";
79
+ label: "label";
80
+ primaryYAxis: "primaryYAxis";
81
+ secondaryYAxis: "secondaryYAxis";
82
+ radius: "radius";
83
+ size: "size";
84
+ }>>;
85
+ parentId: z.ZodOptional<z.ZodString>;
62
86
  }, z.core.$strip>]>>>>;
63
87
  backgroundColor: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>>;
64
88
  color: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -24,6 +24,17 @@ export declare const zPie: z.ZodObject<{
24
24
  rowDimension: "rowDimension";
25
25
  columnDimension: "columnDimension";
26
26
  }>>;
27
+ encoding: z.ZodOptional<z.ZodEnum<{
28
+ column: "column";
29
+ xAxis: "xAxis";
30
+ yAxis: "yAxis";
31
+ angle: "angle";
32
+ color: "color";
33
+ detail: "detail";
34
+ tooltip: "tooltip";
35
+ label: "label";
36
+ row: "row";
37
+ }>>;
27
38
  }, z.core.$strip>>>>;
28
39
  measures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnion<[z.ZodType<import("../..").MeasureGroup, unknown, z.core.$ZodTypeInternals<import("../..").MeasureGroup, unknown>>, z.ZodObject<{
29
40
  id: z.ZodString;
@@ -59,6 +70,19 @@ export declare const zPie: z.ZodObject<{
59
70
  halfEven: "halfEven";
60
71
  }>>>;
61
72
  }, z.core.$strip>>>;
73
+ encoding: z.ZodOptional<z.ZodEnum<{
74
+ xAxis: "xAxis";
75
+ yAxis: "yAxis";
76
+ angle: "angle";
77
+ color: "color";
78
+ tooltip: "tooltip";
79
+ label: "label";
80
+ primaryYAxis: "primaryYAxis";
81
+ secondaryYAxis: "secondaryYAxis";
82
+ radius: "radius";
83
+ size: "size";
84
+ }>>;
85
+ parentId: z.ZodOptional<z.ZodString>;
62
86
  }, z.core.$strip>]>>>>;
63
87
  backgroundColor: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>>;
64
88
  color: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -10,6 +10,17 @@ export declare const zPivotTable: z.ZodObject<{
10
10
  rowDimension: "rowDimension";
11
11
  columnDimension: "columnDimension";
12
12
  }>>;
13
+ encoding: z.ZodOptional<z.ZodEnum<{
14
+ column: "column";
15
+ xAxis: "xAxis";
16
+ yAxis: "yAxis";
17
+ angle: "angle";
18
+ color: "color";
19
+ detail: "detail";
20
+ tooltip: "tooltip";
21
+ label: "label";
22
+ row: "row";
23
+ }>>;
13
24
  }, z.core.$strip>>>>;
14
25
  measures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
15
26
  id: z.ZodString;
@@ -45,6 +56,19 @@ export declare const zPivotTable: z.ZodObject<{
45
56
  halfEven: "halfEven";
46
57
  }>>>;
47
58
  }, z.core.$strip>>>;
59
+ encoding: z.ZodOptional<z.ZodEnum<{
60
+ xAxis: "xAxis";
61
+ yAxis: "yAxis";
62
+ angle: "angle";
63
+ color: "color";
64
+ tooltip: "tooltip";
65
+ label: "label";
66
+ primaryYAxis: "primaryYAxis";
67
+ secondaryYAxis: "secondaryYAxis";
68
+ radius: "radius";
69
+ size: "size";
70
+ }>>;
71
+ parentId: z.ZodOptional<z.ZodString>;
48
72
  }, z.core.$strip>>>>;
49
73
  backgroundColor: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>>;
50
74
  borderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -24,6 +24,17 @@ export declare const zRadar: z.ZodObject<{
24
24
  rowDimension: "rowDimension";
25
25
  columnDimension: "columnDimension";
26
26
  }>>;
27
+ encoding: z.ZodOptional<z.ZodEnum<{
28
+ column: "column";
29
+ xAxis: "xAxis";
30
+ yAxis: "yAxis";
31
+ angle: "angle";
32
+ color: "color";
33
+ detail: "detail";
34
+ tooltip: "tooltip";
35
+ label: "label";
36
+ row: "row";
37
+ }>>;
27
38
  }, z.core.$strip>>>>;
28
39
  measures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnion<[z.ZodType<import("../..").MeasureGroup, unknown, z.core.$ZodTypeInternals<import("../..").MeasureGroup, unknown>>, z.ZodObject<{
29
40
  id: z.ZodString;
@@ -59,6 +70,19 @@ export declare const zRadar: z.ZodObject<{
59
70
  halfEven: "halfEven";
60
71
  }>>>;
61
72
  }, z.core.$strip>>>;
73
+ encoding: z.ZodOptional<z.ZodEnum<{
74
+ xAxis: "xAxis";
75
+ yAxis: "yAxis";
76
+ angle: "angle";
77
+ color: "color";
78
+ tooltip: "tooltip";
79
+ label: "label";
80
+ primaryYAxis: "primaryYAxis";
81
+ secondaryYAxis: "secondaryYAxis";
82
+ radius: "radius";
83
+ size: "size";
84
+ }>>;
85
+ parentId: z.ZodOptional<z.ZodString>;
62
86
  }, z.core.$strip>]>>>>;
63
87
  backgroundColor: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>>;
64
88
  color: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -24,6 +24,17 @@ export declare const zRose: z.ZodObject<{
24
24
  rowDimension: "rowDimension";
25
25
  columnDimension: "columnDimension";
26
26
  }>>;
27
+ encoding: z.ZodOptional<z.ZodEnum<{
28
+ column: "column";
29
+ xAxis: "xAxis";
30
+ yAxis: "yAxis";
31
+ angle: "angle";
32
+ color: "color";
33
+ detail: "detail";
34
+ tooltip: "tooltip";
35
+ label: "label";
36
+ row: "row";
37
+ }>>;
27
38
  }, z.core.$strip>>>>;
28
39
  measures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnion<[z.ZodType<import("../..").MeasureGroup, unknown, z.core.$ZodTypeInternals<import("../..").MeasureGroup, unknown>>, z.ZodObject<{
29
40
  id: z.ZodString;
@@ -59,6 +70,19 @@ export declare const zRose: z.ZodObject<{
59
70
  halfEven: "halfEven";
60
71
  }>>>;
61
72
  }, z.core.$strip>>>;
73
+ encoding: z.ZodOptional<z.ZodEnum<{
74
+ xAxis: "xAxis";
75
+ yAxis: "yAxis";
76
+ angle: "angle";
77
+ color: "color";
78
+ tooltip: "tooltip";
79
+ label: "label";
80
+ primaryYAxis: "primaryYAxis";
81
+ secondaryYAxis: "secondaryYAxis";
82
+ radius: "radius";
83
+ size: "size";
84
+ }>>;
85
+ parentId: z.ZodOptional<z.ZodString>;
62
86
  }, z.core.$strip>]>>>>;
63
87
  backgroundColor: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>>;
64
88
  color: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -24,6 +24,17 @@ export declare const zRoseParallel: z.ZodObject<{
24
24
  rowDimension: "rowDimension";
25
25
  columnDimension: "columnDimension";
26
26
  }>>;
27
+ encoding: z.ZodOptional<z.ZodEnum<{
28
+ column: "column";
29
+ xAxis: "xAxis";
30
+ yAxis: "yAxis";
31
+ angle: "angle";
32
+ color: "color";
33
+ detail: "detail";
34
+ tooltip: "tooltip";
35
+ label: "label";
36
+ row: "row";
37
+ }>>;
27
38
  }, z.core.$strip>>>>;
28
39
  measures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnion<[z.ZodType<import("../..").MeasureGroup, unknown, z.core.$ZodTypeInternals<import("../..").MeasureGroup, unknown>>, z.ZodObject<{
29
40
  id: z.ZodString;
@@ -59,6 +70,19 @@ export declare const zRoseParallel: z.ZodObject<{
59
70
  halfEven: "halfEven";
60
71
  }>>>;
61
72
  }, z.core.$strip>>>;
73
+ encoding: z.ZodOptional<z.ZodEnum<{
74
+ xAxis: "xAxis";
75
+ yAxis: "yAxis";
76
+ angle: "angle";
77
+ color: "color";
78
+ tooltip: "tooltip";
79
+ label: "label";
80
+ primaryYAxis: "primaryYAxis";
81
+ secondaryYAxis: "secondaryYAxis";
82
+ radius: "radius";
83
+ size: "size";
84
+ }>>;
85
+ parentId: z.ZodOptional<z.ZodString>;
62
86
  }, z.core.$strip>]>>>>;
63
87
  backgroundColor: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>>;
64
88
  color: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -24,6 +24,17 @@ export declare const zScatter: z.ZodObject<{
24
24
  rowDimension: "rowDimension";
25
25
  columnDimension: "columnDimension";
26
26
  }>>;
27
+ encoding: z.ZodOptional<z.ZodEnum<{
28
+ column: "column";
29
+ xAxis: "xAxis";
30
+ yAxis: "yAxis";
31
+ angle: "angle";
32
+ color: "color";
33
+ detail: "detail";
34
+ tooltip: "tooltip";
35
+ label: "label";
36
+ row: "row";
37
+ }>>;
27
38
  }, z.core.$strip>>>>;
28
39
  measures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnion<[z.ZodType<import("../..").MeasureGroup, unknown, z.core.$ZodTypeInternals<import("../..").MeasureGroup, unknown>>, z.ZodObject<{
29
40
  id: z.ZodString;
@@ -59,6 +70,19 @@ export declare const zScatter: z.ZodObject<{
59
70
  halfEven: "halfEven";
60
71
  }>>>;
61
72
  }, z.core.$strip>>>;
73
+ encoding: z.ZodOptional<z.ZodEnum<{
74
+ xAxis: "xAxis";
75
+ yAxis: "yAxis";
76
+ angle: "angle";
77
+ color: "color";
78
+ tooltip: "tooltip";
79
+ label: "label";
80
+ primaryYAxis: "primaryYAxis";
81
+ secondaryYAxis: "secondaryYAxis";
82
+ radius: "radius";
83
+ size: "size";
84
+ }>>;
85
+ parentId: z.ZodOptional<z.ZodString>;
62
86
  }, z.core.$strip>]>>>>;
63
87
  scatterMeasures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
64
88
  id: z.ZodString;
@@ -96,6 +120,19 @@ export declare const zScatter: z.ZodObject<{
96
120
  halfEven: "halfEven";
97
121
  }>>>;
98
122
  }, z.core.$strip>>>;
123
+ encoding: z.ZodOptional<z.ZodEnum<{
124
+ xAxis: "xAxis";
125
+ yAxis: "yAxis";
126
+ angle: "angle";
127
+ color: "color";
128
+ tooltip: "tooltip";
129
+ label: "label";
130
+ primaryYAxis: "primaryYAxis";
131
+ secondaryYAxis: "secondaryYAxis";
132
+ radius: "radius";
133
+ size: "size";
134
+ }>>;
135
+ parentId: z.ZodOptional<z.ZodString>;
99
136
  }, z.core.$strip>>, z.ZodObject<{
100
137
  id: z.ZodString;
101
138
  alias: z.ZodOptional<z.ZodString>;
@@ -130,6 +167,19 @@ export declare const zScatter: z.ZodObject<{
130
167
  halfEven: "halfEven";
131
168
  }>>>;
132
169
  }, z.core.$strip>>>;
170
+ encoding: z.ZodOptional<z.ZodEnum<{
171
+ xAxis: "xAxis";
172
+ yAxis: "yAxis";
173
+ angle: "angle";
174
+ color: "color";
175
+ tooltip: "tooltip";
176
+ label: "label";
177
+ primaryYAxis: "primaryYAxis";
178
+ secondaryYAxis: "secondaryYAxis";
179
+ radius: "radius";
180
+ size: "size";
181
+ }>>;
182
+ parentId: z.ZodOptional<z.ZodString>;
133
183
  }, z.core.$strip>]>>;
134
184
  yMeasures: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodObject<{
135
185
  id: z.ZodString;
@@ -165,6 +215,19 @@ export declare const zScatter: z.ZodObject<{
165
215
  halfEven: "halfEven";
166
216
  }>>>;
167
217
  }, z.core.$strip>>>;
218
+ encoding: z.ZodOptional<z.ZodEnum<{
219
+ xAxis: "xAxis";
220
+ yAxis: "yAxis";
221
+ angle: "angle";
222
+ color: "color";
223
+ tooltip: "tooltip";
224
+ label: "label";
225
+ primaryYAxis: "primaryYAxis";
226
+ secondaryYAxis: "secondaryYAxis";
227
+ radius: "radius";
228
+ size: "size";
229
+ }>>;
230
+ parentId: z.ZodOptional<z.ZodString>;
168
231
  }, z.core.$strip>>, z.ZodObject<{
169
232
  id: z.ZodString;
170
233
  alias: z.ZodOptional<z.ZodString>;
@@ -199,6 +262,19 @@ export declare const zScatter: z.ZodObject<{
199
262
  halfEven: "halfEven";
200
263
  }>>>;
201
264
  }, z.core.$strip>>>;
265
+ encoding: z.ZodOptional<z.ZodEnum<{
266
+ xAxis: "xAxis";
267
+ yAxis: "yAxis";
268
+ angle: "angle";
269
+ color: "color";
270
+ tooltip: "tooltip";
271
+ label: "label";
272
+ primaryYAxis: "primaryYAxis";
273
+ secondaryYAxis: "secondaryYAxis";
274
+ radius: "radius";
275
+ size: "size";
276
+ }>>;
277
+ parentId: z.ZodOptional<z.ZodString>;
202
278
  }, z.core.$strip>]>>;
203
279
  }, z.core.$strip>>>>;
204
280
  backgroundColor: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>>;
@@ -10,6 +10,17 @@ export declare const zTable: z.ZodObject<{
10
10
  rowDimension: "rowDimension";
11
11
  columnDimension: "columnDimension";
12
12
  }>>;
13
+ encoding: z.ZodOptional<z.ZodEnum<{
14
+ column: "column";
15
+ xAxis: "xAxis";
16
+ yAxis: "yAxis";
17
+ angle: "angle";
18
+ color: "color";
19
+ detail: "detail";
20
+ tooltip: "tooltip";
21
+ label: "label";
22
+ row: "row";
23
+ }>>;
13
24
  }, z.core.$strip>>>>;
14
25
  measures: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnion<[z.ZodType<import("../..").MeasureGroup, unknown, z.core.$ZodTypeInternals<import("../..").MeasureGroup, unknown>>, z.ZodObject<{
15
26
  id: z.ZodString;
@@ -45,6 +56,19 @@ export declare const zTable: z.ZodObject<{
45
56
  halfEven: "halfEven";
46
57
  }>>>;
47
58
  }, z.core.$strip>>>;
59
+ encoding: z.ZodOptional<z.ZodEnum<{
60
+ xAxis: "xAxis";
61
+ yAxis: "yAxis";
62
+ angle: "angle";
63
+ color: "color";
64
+ tooltip: "tooltip";
65
+ label: "label";
66
+ primaryYAxis: "primaryYAxis";
67
+ secondaryYAxis: "secondaryYAxis";
68
+ radius: "radius";
69
+ size: "size";
70
+ }>>;
71
+ parentId: z.ZodOptional<z.ZodString>;
48
72
  }, z.core.$strip>]>>>>;
49
73
  backgroundColor: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodString>>>>>;
50
74
  borderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -4,7 +4,23 @@
4
4
  export type Dimension = {
5
5
  id: string;
6
6
  alias?: string;
7
+ /**
8
+ * @deprecated 请使用 encoding 代替
9
+ */
7
10
  location?: 'dimension' | 'rowDimension' | 'columnDimension';
11
+ /**
12
+ * @description 维度映射的通道
13
+ * - x: 支持将多个维度映射到x轴, 支持柱状图、折线图、面积图等
14
+ * - y: 支持将多个维度映射到y轴, 支持柱状图、折线图、面积图等
15
+ * - angle: 支持将多个维度映射到角度通道, 支持玫瑰图、雷达图等
16
+ * - color: 支持将多个维度映射到颜色通道, 支持所有图表类型
17
+ * - detail: 支持将多个维度映射到详情通道, 支持所有图表类型
18
+ * - tooltip: 支持将多个维度映射到提示通道, 支持所有图表类型
19
+ * - label: 支持将多个维度映射到标签通道, 支持所有图表类型
20
+ * - row: 支持将多个维度映射到行通道, 支持所有图表类型
21
+ * - column: 支持将多个维度映射到列通道, 支持所有图表类型
22
+ */
23
+ encoding?: 'xAxis' | 'yAxis' | 'angle' | 'color' | 'detail' | 'tooltip' | 'label' | 'row' | 'column';
8
24
  };
9
25
  /**
10
26
  * @description 维度组
@@ -8,6 +8,17 @@ export declare const zDimension: z.ZodObject<{
8
8
  rowDimension: "rowDimension";
9
9
  columnDimension: "columnDimension";
10
10
  }>>;
11
+ encoding: z.ZodOptional<z.ZodEnum<{
12
+ column: "column";
13
+ xAxis: "xAxis";
14
+ yAxis: "yAxis";
15
+ angle: "angle";
16
+ color: "color";
17
+ detail: "detail";
18
+ tooltip: "tooltip";
19
+ label: "label";
20
+ row: "row";
21
+ }>>;
11
22
  }, z.core.$strip>;
12
23
  export declare const zDimensionGroup: z.ZodType<DimensionGroup>;
13
24
  export declare const zDimensions: z.ZodArray<z.ZodObject<{
@@ -18,6 +29,17 @@ export declare const zDimensions: z.ZodArray<z.ZodObject<{
18
29
  rowDimension: "rowDimension";
19
30
  columnDimension: "columnDimension";
20
31
  }>>;
32
+ encoding: z.ZodOptional<z.ZodEnum<{
33
+ column: "column";
34
+ xAxis: "xAxis";
35
+ yAxis: "yAxis";
36
+ angle: "angle";
37
+ color: "color";
38
+ detail: "detail";
39
+ tooltip: "tooltip";
40
+ label: "label";
41
+ row: "row";
42
+ }>>;
21
43
  }, z.core.$strip>>;
22
44
  export declare const zDimensionTree: z.ZodArray<z.ZodUnion<[z.ZodType<DimensionGroup, unknown, z.core.$ZodTypeInternals<DimensionGroup, unknown>>, z.ZodObject<{
23
45
  id: z.ZodString;
@@ -27,4 +49,15 @@ export declare const zDimensionTree: z.ZodArray<z.ZodUnion<[z.ZodType<DimensionG
27
49
  rowDimension: "rowDimension";
28
50
  columnDimension: "columnDimension";
29
51
  }>>;
52
+ encoding: z.ZodOptional<z.ZodEnum<{
53
+ column: "column";
54
+ xAxis: "xAxis";
55
+ yAxis: "yAxis";
56
+ angle: "angle";
57
+ color: "color";
58
+ detail: "detail";
59
+ tooltip: "tooltip";
60
+ label: "label";
61
+ row: "row";
62
+ }>>;
30
63
  }, z.core.$strip>]>>;
@@ -1,4 +1,3 @@
1
- export type Encodings = Array<Encoding>;
2
1
  export type Encoding = {
3
2
  /**
4
3
  * @description X轴映射通道, 支持放入多个维度字段, 不支持放入指标字段, 在笛卡尔坐标系中用于显示离散的X轴, 例如柱状图、折线图、面积图、双轴图
@@ -1,2 +1,2 @@
1
- export type { Encodings, Encoding } from './encoding';
2
- export { zEncoding, zEncodings } from './zEncoding';
1
+ export type { Encoding } from './encoding';
2
+ export { zEncoding } from './zEncoding';
@@ -13,17 +13,3 @@ export declare const zEncoding: z.ZodObject<{
13
13
  column: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
14
14
  group: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
15
15
  }, z.core.$strip>;
16
- export declare const zEncodings: z.ZodArray<z.ZodObject<{
17
- x: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
18
- y: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
19
- angle: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
20
- radius: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
21
- detail: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
22
- color: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
23
- size: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
24
- tooltip: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
25
- label: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
26
- row: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
27
- column: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
28
- group: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
29
- }, z.core.$strip>>;
@@ -1,5 +1,6 @@
1
1
  import type { Measure } from './measures';
2
2
  export type DualMeasure = {
3
+ id: string;
3
4
  primaryMeasures?: Measure | Measure[];
4
5
  secondaryMeasures?: Measure | Measure[];
5
6
  };
@@ -26,6 +26,25 @@ export type Measure = {
26
26
  * @description 指标的数值格式化, 会自动应用于label、tooltip
27
27
  */
28
28
  format?: NumFormat;
29
+ /**
30
+ * @description 指标映射的通道
31
+ * - primaryYAxis: 指标映射的主y轴, 仅用于双轴图
32
+ * - secondaryYAxis: 指标映射的次y轴, 仅用于双轴图
33
+ * - xAxis: 指标映射的x轴, 适用于条形图、散点图
34
+ * - yAxis: 指标映射的y轴, 适用于柱状图、折线图、面积图、散点图
35
+ * - angle: 指标映射的角度, 适用于饼图、环形图、雷达图
36
+ * - radius: 指标映射的半径, 适用于玫瑰图
37
+ * - size: 指标映射的大小, 适用于漏斗图、散点图
38
+ * - color: 指标映射的颜色, 适用于所有图表
39
+ * - label: 指标映射的标签, 适用于所有图表
40
+ * - tooltip: 指标映射的提示, 适用于所有图表
41
+ */
42
+ encoding?: 'primaryYAxis' | 'secondaryYAxis' | 'xAxis' | 'yAxis' | 'angle' | 'radius' | 'size' | 'color' | 'label' | 'tooltip';
43
+ /**
44
+ * @description 以扁平的指标配置形式, 构建树形指标组, parentId指向父级指标组的id, 用于构建指标树
45
+ * @tip 指标树的配置存在两种形式, 方式一是直接配置带children的指标树, 方式二是配置parentId的扁平指标列表, 两种方式不能同时配置
46
+ */
47
+ parentId?: string;
29
48
  };
30
49
  export type MeasureGroup = {
31
50
  /**
@@ -1,5 +1,6 @@
1
1
  import type { Measure } from './measures';
2
2
  export type ScatterMeasure = {
3
+ id: string;
3
4
  xMeasures?: Measure | Measure[];
4
5
  yMeasures?: Measure | Measure[];
5
6
  };