@visactor/vseed 0.1.5 → 0.1.7

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 (84) hide show
  1. package/dist/builder/builder/builder.d.ts +2 -4
  2. package/dist/index.cjs +574 -498
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.js +574 -498
  5. package/dist/index.js.map +1 -1
  6. package/dist/pipeline/advanced/chart/pipes/{init/autoDimensions.d.ts → default/defaultDimensions.d.ts} +1 -1
  7. package/dist/pipeline/advanced/{table/pipes/init/autoMeasures.d.ts → chart/pipes/default/defaultMeasureName.d.ts} +1 -1
  8. package/dist/pipeline/advanced/chart/pipes/default/defaultMeasures.d.ts +5 -0
  9. package/dist/pipeline/advanced/chart/pipes/default/index.d.ts +3 -0
  10. package/dist/pipeline/advanced/chart/pipes/encoding/bar.d.ts +19 -0
  11. package/dist/pipeline/advanced/chart/pipes/encoding/column.d.ts +19 -0
  12. package/dist/pipeline/advanced/chart/pipes/encoding/dualAxis.d.ts +19 -0
  13. package/dist/pipeline/advanced/chart/pipes/encoding/funnel.d.ts +17 -0
  14. package/dist/pipeline/advanced/chart/pipes/encoding/heatmap.d.ts +19 -0
  15. package/dist/pipeline/advanced/chart/pipes/encoding/line.d.ts +18 -0
  16. package/dist/pipeline/advanced/chart/pipes/encoding/pie.d.ts +18 -0
  17. package/dist/pipeline/advanced/chart/pipes/encoding/radar.d.ts +19 -0
  18. package/dist/pipeline/advanced/chart/pipes/encoding/rose.d.ts +19 -0
  19. package/dist/pipeline/advanced/chart/pipes/encoding/scatter.d.ts +18 -0
  20. package/dist/pipeline/advanced/chart/pipes/index.d.ts +1 -0
  21. package/dist/pipeline/advanced/chart/pipes/init/index.d.ts +0 -2
  22. package/dist/pipeline/advanced/chart/pipes/measures/utils.d.ts +3 -18
  23. package/dist/pipeline/advanced/table/pipes/{init/autoPivotMeasures.d.ts → default/defaultDimensions.d.ts} +1 -1
  24. package/dist/pipeline/advanced/table/pipes/default/defaultMeasureName.d.ts +2 -0
  25. package/dist/pipeline/advanced/table/pipes/default/defaultMeasures.d.ts +5 -0
  26. package/dist/pipeline/advanced/table/pipes/default/index.d.ts +3 -0
  27. package/dist/pipeline/advanced/table/pipes/encoding/index.d.ts +1 -0
  28. package/dist/pipeline/advanced/table/pipes/encoding/pivotTable.d.ts +2 -0
  29. package/dist/pipeline/advanced/table/pipes/index.d.ts +3 -0
  30. package/dist/pipeline/advanced/table/pipes/init/index.d.ts +0 -3
  31. package/dist/pipeline/advanced/table/pipes/reshape/index.d.ts +1 -0
  32. package/dist/pipeline/advanced/table/pipes/{init/autoDimensions.d.ts → reshape/reshapePivotTable.d.ts} +1 -1
  33. package/dist/types/advancedVSeed.d.ts +2 -5
  34. package/dist/types/chartType/area/area.d.ts +19 -3
  35. package/dist/types/chartType/area/zArea.d.ts +2 -5
  36. package/dist/types/chartType/areaPercent/areaPercent.d.ts +15 -1
  37. package/dist/types/chartType/areaPercent/zAreaPercent.d.ts +2 -5
  38. package/dist/types/chartType/bar/bar.d.ts +17 -1
  39. package/dist/types/chartType/bar/zBar.d.ts +2 -5
  40. package/dist/types/chartType/barParallel/barParallel.d.ts +17 -1
  41. package/dist/types/chartType/barParallel/zBarParallel.d.ts +2 -5
  42. package/dist/types/chartType/barPercent/barPercent.d.ts +17 -1
  43. package/dist/types/chartType/barPercent/zBarPercent.d.ts +2 -5
  44. package/dist/types/chartType/column/column.d.ts +17 -1
  45. package/dist/types/chartType/column/zColumn.d.ts +2 -5
  46. package/dist/types/chartType/columnParallel/columnParallel.d.ts +17 -1
  47. package/dist/types/chartType/columnParallel/zColumnParallel.d.ts +2 -5
  48. package/dist/types/chartType/columnPercent/columnPercent.d.ts +17 -1
  49. package/dist/types/chartType/columnPercent/zColumnPercent.d.ts +2 -5
  50. package/dist/types/chartType/donut/donut.d.ts +16 -1
  51. package/dist/types/chartType/donut/zDonut.d.ts +2 -5
  52. package/dist/types/chartType/dualAxis/dualAxis.d.ts +17 -1
  53. package/dist/types/chartType/dualAxis/zDualAxis.d.ts +10 -5
  54. package/dist/types/chartType/funnel/funnel.d.ts +15 -1
  55. package/dist/types/chartType/funnel/zFunnel.d.ts +2 -5
  56. package/dist/types/chartType/heatmap/heatmap.d.ts +17 -1
  57. package/dist/types/chartType/heatmap/zHeatmap.d.ts +2 -5
  58. package/dist/types/chartType/line/line.d.ts +16 -4
  59. package/dist/types/chartType/line/zLine.d.ts +2 -5
  60. package/dist/types/chartType/pie/pie.d.ts +16 -1
  61. package/dist/types/chartType/pie/zPie.d.ts +2 -5
  62. package/dist/types/chartType/pivotTable/pivotTable.d.ts +10 -3
  63. package/dist/types/chartType/pivotTable/zPivotTable.d.ts +2 -5
  64. package/dist/types/chartType/radar/radar.d.ts +17 -1
  65. package/dist/types/chartType/radar/zRadar.d.ts +2 -5
  66. package/dist/types/chartType/rose/rose.d.ts +17 -1
  67. package/dist/types/chartType/rose/zRose.d.ts +2 -5
  68. package/dist/types/chartType/roseParallel/roseParallel.d.ts +17 -1
  69. package/dist/types/chartType/roseParallel/zRoseParallel.d.ts +2 -5
  70. package/dist/types/chartType/scatter/scatter.d.ts +16 -1
  71. package/dist/types/chartType/scatter/zScatter.d.ts +10 -5
  72. package/dist/types/chartType/table/table.d.ts +2 -0
  73. package/dist/types/chartType/table/zTable.d.ts +2 -5
  74. package/dist/types/properties/dimensions/dimensions.d.ts +0 -4
  75. package/dist/types/properties/dimensions/zDimensions.d.ts +0 -15
  76. package/dist/types/properties/measures/measures.d.ts +3 -1
  77. package/dist/types/properties/measures/zDualMeasures.d.ts +16 -0
  78. package/dist/types/properties/measures/zMeasures.d.ts +6 -0
  79. package/dist/types/properties/measures/zScatterMeasures.d.ts +16 -0
  80. package/dist/types/zVseed.d.ts +56 -100
  81. package/dist/umd/index.js +606 -530
  82. package/dist/umd/index.js.map +1 -1
  83. package/package.json +2 -2
  84. package/dist/pipeline/advanced/chart/pipes/init/utils.d.ts +0 -2
@@ -19,11 +19,6 @@ export declare const zBarPercent: z.ZodObject<{
19
19
  dimensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
20
20
  id: z.ZodString;
21
21
  alias: z.ZodOptional<z.ZodString>;
22
- location: z.ZodDefault<z.ZodEnum<{
23
- dimension: "dimension";
24
- rowDimension: "rowDimension";
25
- columnDimension: "columnDimension";
26
- }>>;
27
22
  encoding: z.ZodOptional<z.ZodEnum<{
28
23
  column: "column";
29
24
  xAxis: "xAxis";
@@ -71,10 +66,12 @@ export declare const zBarPercent: z.ZodObject<{
71
66
  }>>>;
72
67
  }, z.core.$strip>>>;
73
68
  encoding: z.ZodOptional<z.ZodEnum<{
69
+ column: "column";
74
70
  xAxis: "xAxis";
75
71
  yAxis: "yAxis";
76
72
  angle: "angle";
77
73
  color: "color";
74
+ detail: "detail";
78
75
  tooltip: "tooltip";
79
76
  label: "label";
80
77
  primaryYAxis: "primaryYAxis";
@@ -1,12 +1,28 @@
1
1
  import type { Locale } from '../../i18n';
2
2
  import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, BackgroundColor, BarStyle, Color, CrosshairRect, Dataset, Dimensions, Label, Legend, StackCornerRadius, Theme, Tooltip, XBandAxis, YLinearAxis, MeasureTree, Sort, SortLegend, Encoding } from '../../properties';
3
3
  /**
4
- * 柱状图类型定义
5
4
  * @description 柱状图,适用于纵向数据对比场景,X轴为类目轴(分类数据),Y轴为数值轴(连续数据),柱子纵向排列
6
5
  * 适用场景:
7
6
  * - 数据项名称较短时
8
7
  * - 需要直观比较不同类别的数值大小
9
8
  * - 展示时间序列数据变化趋势
9
+ * @encoding
10
+ * 维度未包含任何encoding, 则使用默认映射规则:
11
+ * 1. x: 第一个维度映射至X轴
12
+ * 2. color: 非X轴所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
13
+ * 3. detail: 其余所有维度映射至Detail通道
14
+ * 指标未包含任何encoding, 则使用默认映射规则:
15
+ * 1. y: 全部指标映射至Y轴
16
+ * 2. tooltip: 全部指标映射至Tooltip
17
+ *
18
+ * 维度映射规则:
19
+ * 1. 用户指定的xAxis维度映射至X轴, 支持多个维度; 若未指定, 则默认映射第一个维度
20
+ * 2. 用户指定的color维度映射至颜色通道, 支持多个维度; 若未指定, 则默认映射指标名称
21
+ * 3. 用户指定的detail维度映射至Detail通道, 支持多个维度; 若未指定, 则默认将指标名称映射至Detail通道
22
+ * 指标映射规则:
23
+ * 1. 指标未配置encoding, 则默认映射至Y轴;
24
+ * 2. 用户指定的yAxis指标映射至Y轴, 支持多个指标;
25
+ * 3. 所有指标均映射到Tooltip
10
26
  * @warning
11
27
  * 数据要求:
12
28
  * - 至少1个数值字段(度量)
@@ -19,11 +19,6 @@ export declare const zColumn: z.ZodObject<{
19
19
  dimensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
20
20
  id: z.ZodString;
21
21
  alias: z.ZodOptional<z.ZodString>;
22
- location: z.ZodDefault<z.ZodEnum<{
23
- dimension: "dimension";
24
- rowDimension: "rowDimension";
25
- columnDimension: "columnDimension";
26
- }>>;
27
22
  encoding: z.ZodOptional<z.ZodEnum<{
28
23
  column: "column";
29
24
  xAxis: "xAxis";
@@ -71,10 +66,12 @@ export declare const zColumn: z.ZodObject<{
71
66
  }>>>;
72
67
  }, z.core.$strip>>>;
73
68
  encoding: z.ZodOptional<z.ZodEnum<{
69
+ column: "column";
74
70
  xAxis: "xAxis";
75
71
  yAxis: "yAxis";
76
72
  angle: "angle";
77
73
  color: "color";
74
+ detail: "detail";
78
75
  tooltip: "tooltip";
79
76
  label: "label";
80
77
  primaryYAxis: "primaryYAxis";
@@ -1,12 +1,28 @@
1
1
  import type { Locale } from '../../i18n';
2
2
  import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, BackgroundColor, BarStyle, Color, CrosshairRect, Dataset, Dimensions, Label, Legend, StackCornerRadius, Theme, Tooltip, XBandAxis, YLinearAxis, MeasureTree, SortLegend, Sort, Encoding } from '../../properties';
3
3
  /**
4
- * 并列柱状图类型定义
5
4
  * @description 并列柱状图,适用于多指标并行对比场景,多个柱子并列排列展示不同指标值
6
5
  * 适用场景:
7
6
  * - 同一维度下多指标并行对比
8
7
  * - 多维度数据的横向比较
9
8
  * - 指标间关联性分析
9
+ * @encoding
10
+ * 维度未包含任何encoding, 则使用默认映射规则:
11
+ * 1. x: 第一个维度映射至X轴
12
+ * 2. color: 非X轴所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
13
+ * 3. detail: 其余所有维度映射至Detail通道
14
+ * 指标未包含任何encoding, 则使用默认映射规则:
15
+ * 1. y: 全部指标映射至Y轴
16
+ * 2. tooltip: 全部指标映射至Tooltip
17
+ *
18
+ * 维度映射规则:
19
+ * 1. 用户指定的xAxis维度映射至X轴, 支持多个维度; 若未指定, 则默认映射第一个维度
20
+ * 2. 用户指定的color维度映射至颜色通道, 支持多个维度; 若未指定, 则默认映射指标名称
21
+ * 3. 用户指定的detail维度映射至Detail通道, 支持多个维度; 若未指定, 则默认将指标名称映射至Detail通道
22
+ * 指标映射规则:
23
+ * 1. 指标未配置encoding, 则默认映射至Y轴;
24
+ * 2. 用户指定的yAxis指标映射至Y轴, 支持多个指标;
25
+ * 3. 所有指标均映射到Tooltip
10
26
  * @warning
11
27
  * 数据要求:
12
28
  * - 至少1个指标字段(度量)
@@ -19,11 +19,6 @@ export declare const zColumnParallel: z.ZodObject<{
19
19
  dimensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
20
20
  id: z.ZodString;
21
21
  alias: z.ZodOptional<z.ZodString>;
22
- location: z.ZodDefault<z.ZodEnum<{
23
- dimension: "dimension";
24
- rowDimension: "rowDimension";
25
- columnDimension: "columnDimension";
26
- }>>;
27
22
  encoding: z.ZodOptional<z.ZodEnum<{
28
23
  column: "column";
29
24
  xAxis: "xAxis";
@@ -71,10 +66,12 @@ export declare const zColumnParallel: z.ZodObject<{
71
66
  }>>>;
72
67
  }, z.core.$strip>>>;
73
68
  encoding: z.ZodOptional<z.ZodEnum<{
69
+ column: "column";
74
70
  xAxis: "xAxis";
75
71
  yAxis: "yAxis";
76
72
  angle: "angle";
77
73
  color: "color";
74
+ detail: "detail";
78
75
  tooltip: "tooltip";
79
76
  label: "label";
80
77
  primaryYAxis: "primaryYAxis";
@@ -1,12 +1,28 @@
1
1
  import type { Locale } from '../../i18n';
2
2
  import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, BackgroundColor, BarStyle, Color, CrosshairRect, Dataset, Dimensions, Label, Legend, StackCornerRadius, Theme, Tooltip, XBandAxis, YLinearAxis, MeasureTree, Sort, SortLegend, Encoding } from '../../properties';
3
3
  /**
4
- * 百分比柱状图类型定义
5
4
  * @description 百分比柱状图,适用于展示各类别占比关系的场景,Y轴以百分比形式展示数据占比
6
5
  * 适用场景:
7
6
  * - 不同类别数据的占比对比
8
7
  * - 多维度数据的构成分析
9
8
  * - 时间序列的占比变化趋势
9
+ * @encoding
10
+ * 维度未包含任何encoding, 则使用默认映射规则:
11
+ * 1. x: 第一个维度映射至X轴
12
+ * 2. color: 非X轴所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
13
+ * 3. detail: 其余所有维度映射至Detail通道
14
+ * 指标未包含任何encoding, 则使用默认映射规则:
15
+ * 1. y: 全部指标映射至Y轴
16
+ * 2. tooltip: 全部指标映射至Tooltip
17
+ *
18
+ * 维度映射规则:
19
+ * 1. 用户指定的xAxis维度映射至X轴, 支持多个维度; 若未指定, 则默认映射第一个维度
20
+ * 2. 用户指定的color维度映射至颜色通道, 支持多个维度; 若未指定, 则默认映射指标名称
21
+ * 3. 用户指定的detail维度映射至Detail通道, 支持多个维度; 若未指定, 则默认将指标名称映射至Detail通道
22
+ * 指标映射规则:
23
+ * 1. 指标未配置encoding, 则默认映射至Y轴;
24
+ * 2. 用户指定的yAxis指标映射至Y轴, 支持多个指标;
25
+ * 3. 所有指标均映射到Tooltip
10
26
  * @warning
11
27
  * 数据要求:
12
28
  * - 至少1个指标字段(度量)
@@ -19,11 +19,6 @@ export declare const zColumnPercent: z.ZodObject<{
19
19
  dimensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
20
20
  id: z.ZodString;
21
21
  alias: z.ZodOptional<z.ZodString>;
22
- location: z.ZodDefault<z.ZodEnum<{
23
- dimension: "dimension";
24
- rowDimension: "rowDimension";
25
- columnDimension: "columnDimension";
26
- }>>;
27
22
  encoding: z.ZodOptional<z.ZodEnum<{
28
23
  column: "column";
29
24
  xAxis: "xAxis";
@@ -71,10 +66,12 @@ export declare const zColumnPercent: z.ZodObject<{
71
66
  }>>>;
72
67
  }, z.core.$strip>>>;
73
68
  encoding: z.ZodOptional<z.ZodEnum<{
69
+ column: "column";
74
70
  xAxis: "xAxis";
75
71
  yAxis: "yAxis";
76
72
  angle: "angle";
77
73
  color: "color";
74
+ detail: "detail";
78
75
  tooltip: "tooltip";
79
76
  label: "label";
80
77
  primaryYAxis: "primaryYAxis";
@@ -1,12 +1,27 @@
1
1
  import { type Locale } from '../../i18n';
2
2
  import type { BackgroundColor, Color, Dataset, Dimensions, Encoding, Label, Legend, MeasureTree, Theme, Tooltip } from '../../properties';
3
3
  /**
4
- * 环形图类型定义
5
4
  * @description 环形图,适用于展示单一维度数据的占比关系,中心留有空白区域可展示汇总信息
6
5
  * 适用场景:
7
6
  * - 需要同时展示整体数据和各部分占比
8
7
  * - 强调数据的整体与部分关系
9
8
  * - 中心区域需要展示关键指标或标题
9
+ * @encoding
10
+ * 维度未包含任何`encoding`, 则使用默认映射规则:
11
+ * 1. color: 所有维度, 合并映射至颜色通道, 作为图例展示
12
+ * 2. detail: 所有维度, 映射至Detail通道
13
+ * 指标未包含任何`encoding`, 则使用默认映射规则:
14
+ * 1. angle: 全部指标映射至angle轴
15
+ * 2. tooltip: 全部指标映射至Tooltip
16
+ *
17
+ * 维度映射规则:
18
+ * 2. 用户指定的`color`维度映射至颜色通道, 支持多个维度; 若未指定, 则默认将指标名称映射至颜色通道, 作为图例展示
19
+ * 3. 用户指定的`detail`维度映射至Detail通道, 支持多个维度; 若未指定, 则默认将指标名称映射至Detail通道
20
+ * 指标映射规则:
21
+ * 1. 指标未配置`encoding`, 则默认映射至angle轴;
22
+ * 2. 用户指定的`angle`指标映射至angle轴, 支持多个指标;
23
+ * 3. 用户指定的`color`指标映射至color通道, 支持多个指标;
24
+ * 3. 所有指标均映射到Tooltip
10
25
  * @warning
11
26
  * 数据要求:
12
27
  * - 至少1个指标字段(度量)
@@ -19,11 +19,6 @@ export declare const zDonut: z.ZodObject<{
19
19
  dimensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
20
20
  id: z.ZodString;
21
21
  alias: z.ZodOptional<z.ZodString>;
22
- location: z.ZodDefault<z.ZodEnum<{
23
- dimension: "dimension";
24
- rowDimension: "rowDimension";
25
- columnDimension: "columnDimension";
26
- }>>;
27
22
  encoding: z.ZodOptional<z.ZodEnum<{
28
23
  column: "column";
29
24
  xAxis: "xAxis";
@@ -71,10 +66,12 @@ export declare const zDonut: z.ZodObject<{
71
66
  }>>>;
72
67
  }, z.core.$strip>>>;
73
68
  encoding: z.ZodOptional<z.ZodEnum<{
69
+ column: "column";
74
70
  xAxis: "xAxis";
75
71
  yAxis: "yAxis";
76
72
  angle: "angle";
77
73
  color: "color";
74
+ detail: "detail";
78
75
  tooltip: "tooltip";
79
76
  label: "label";
80
77
  primaryYAxis: "primaryYAxis";
@@ -1,13 +1,29 @@
1
1
  import type { Locale } from '../../i18n';
2
2
  import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, AreaStyle, BackgroundColor, BarStyle, Color, CrosshairRect, Dataset, Dimensions, DualChartType, DualMeasures, Encoding, Label, Legend, LineStyle, MeasureTree, PointStyle, Sort, SortLegend, Theme, Tooltip, YLinearAxis } from '../../properties';
3
3
  /**
4
- * 双轴图类型定义
5
4
  * @description 双轴图,适用于展示两个不同量级或不同单位指标的对比关系,包含主坐标轴和次坐标轴
6
5
  * 适用场景:
7
6
  * - 不同量级指标的对比分析
8
7
  * - 相关性指标的趋势比较
9
8
  * - 需要同时展示数值和增长率等复合指标
10
9
  * - 支持不同类型图表组合(如折线图+柱状图/ 折线图+面积图/ 面积图+柱状图)
10
+ * @encoding
11
+ * 维度未包含任何`encoding`, 则使用默认映射规则:
12
+ * 1. x: 第一个维度映射至X轴
13
+ * 2. color: 非`X`轴所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
14
+ * 3. detail: 非`X`轴所有维度与指标名称, 映射至Detail通道
15
+ * 指标未包含任何`encoding`, 则使用默认映射规则:
16
+ * 1. y: 第一个指标映射至主Y轴, 其余指标映射至次Y轴
17
+ * 2. tooltip: 全部指标映射至Tooltip
18
+ *
19
+ * 维度映射规则:
20
+ * 1. 用户指定的`xAxis`维度映射至X轴, 支持多个维度; 若未指定, 则默认将第一个维度映射至X轴
21
+ * 2. 用户指定的`color`维度映射至颜色通道, 支持多个维度; 若未指定, 则默认将指标名称映射至颜色通道, 作为图例展示
22
+ * 3. 用户指定的`detail`维度映射至Detail通道, 支持多个维度; 若未指定, 则默认将指标名称映射至Detail通道
23
+ * 指标映射规则:
24
+ * 1. 指标未配置encoding, 则第一个指标默认映射至Y轴, 其余指标默认映射至次Y轴
25
+ * 2. 用户指定的yAxis指标映射至主Y轴或次Y轴, 支持多个指标;
26
+ * 3. 所有指标均映射到Tooltip
11
27
  * @warning
12
28
  * 数据要求:
13
29
  * - 至少1个指标字段(度量)
@@ -5,11 +5,6 @@ export declare const zDualAxis: z.ZodObject<{
5
5
  dimensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
6
6
  id: z.ZodString;
7
7
  alias: z.ZodOptional<z.ZodString>;
8
- location: z.ZodDefault<z.ZodEnum<{
9
- dimension: "dimension";
10
- rowDimension: "rowDimension";
11
- columnDimension: "columnDimension";
12
- }>>;
13
8
  encoding: z.ZodOptional<z.ZodEnum<{
14
9
  column: "column";
15
10
  xAxis: "xAxis";
@@ -57,10 +52,12 @@ export declare const zDualAxis: z.ZodObject<{
57
52
  }>>>;
58
53
  }, z.core.$strip>>>;
59
54
  encoding: z.ZodOptional<z.ZodEnum<{
55
+ column: "column";
60
56
  xAxis: "xAxis";
61
57
  yAxis: "yAxis";
62
58
  angle: "angle";
63
59
  color: "color";
60
+ detail: "detail";
64
61
  tooltip: "tooltip";
65
62
  label: "label";
66
63
  primaryYAxis: "primaryYAxis";
@@ -107,10 +104,12 @@ export declare const zDualAxis: z.ZodObject<{
107
104
  }>>>;
108
105
  }, z.core.$strip>>>;
109
106
  encoding: z.ZodOptional<z.ZodEnum<{
107
+ column: "column";
110
108
  xAxis: "xAxis";
111
109
  yAxis: "yAxis";
112
110
  angle: "angle";
113
111
  color: "color";
112
+ detail: "detail";
114
113
  tooltip: "tooltip";
115
114
  label: "label";
116
115
  primaryYAxis: "primaryYAxis";
@@ -154,10 +153,12 @@ export declare const zDualAxis: z.ZodObject<{
154
153
  }>>>;
155
154
  }, z.core.$strip>>>;
156
155
  encoding: z.ZodOptional<z.ZodEnum<{
156
+ column: "column";
157
157
  xAxis: "xAxis";
158
158
  yAxis: "yAxis";
159
159
  angle: "angle";
160
160
  color: "color";
161
+ detail: "detail";
161
162
  tooltip: "tooltip";
162
163
  label: "label";
163
164
  primaryYAxis: "primaryYAxis";
@@ -202,10 +203,12 @@ export declare const zDualAxis: z.ZodObject<{
202
203
  }>>>;
203
204
  }, z.core.$strip>>>;
204
205
  encoding: z.ZodOptional<z.ZodEnum<{
206
+ column: "column";
205
207
  xAxis: "xAxis";
206
208
  yAxis: "yAxis";
207
209
  angle: "angle";
208
210
  color: "color";
211
+ detail: "detail";
209
212
  tooltip: "tooltip";
210
213
  label: "label";
211
214
  primaryYAxis: "primaryYAxis";
@@ -249,10 +252,12 @@ export declare const zDualAxis: z.ZodObject<{
249
252
  }>>>;
250
253
  }, z.core.$strip>>>;
251
254
  encoding: z.ZodOptional<z.ZodEnum<{
255
+ column: "column";
252
256
  xAxis: "xAxis";
253
257
  yAxis: "yAxis";
254
258
  angle: "angle";
255
259
  color: "color";
260
+ detail: "detail";
256
261
  tooltip: "tooltip";
257
262
  label: "label";
258
263
  primaryYAxis: "primaryYAxis";
@@ -1,11 +1,25 @@
1
1
  import type { Locale } from '../../i18n';
2
2
  import type { BackgroundColor, ColorLegend, Dataset, Dimensions, Encoding, Label, LinearColor, MeasureTree, Theme, Tooltip } from '../../properties';
3
3
  /**
4
- * 漏斗图
5
4
  * @description 漏斗图,用于展示单一维度数据的占比关系
6
5
  * 适用场景:
7
6
  * 漏斗图适用场景:
8
7
  * - 适合用来分析具有多个连续、规范化步骤的流程,并清晰地展示在每个环节的数据流失或转化情况
8
+ * @encoding
9
+ * 维度未包含任何`encoding`, 则使用默认映射规则:
10
+ * 1. color: 所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
11
+ * 2. detail: 所有维度与指标名称, 映射至Detail通道
12
+ * 指标未包含任何`encoding`, 则使用默认映射规则:
13
+ * 1. size: 全部指标映射至size通道
14
+ * 2. tooltip: 全部指标映射至Tooltip
15
+ *
16
+ * 维度映射规则:
17
+ * 1. 用户指定的`color`维度映射至颜色通道, 支持多个维度; 若未指定, 则默认将指标名称映射至颜色通道, 作为图例展示
18
+ * 2. 用户指定的`detail`维度映射至Detail通道, 支持多个维度; 若未指定, 则默认将指标名称映射至Detail通道
19
+ * 指标映射规则:
20
+ * 1. 指标未配置`encoding`, 则默认映射至size通道;
21
+ * 2. 用户指定的`size`指标映射至size通道, 支持多个指标;
22
+ * 3. 所有指标均映射到Tooltip
9
23
  * @warning
10
24
  * 数据要求:
11
25
  * - 至少1个数值字段(指标)
@@ -19,11 +19,6 @@ export declare const zFunnel: z.ZodObject<{
19
19
  dimensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
20
20
  id: z.ZodString;
21
21
  alias: z.ZodOptional<z.ZodString>;
22
- location: z.ZodDefault<z.ZodEnum<{
23
- dimension: "dimension";
24
- rowDimension: "rowDimension";
25
- columnDimension: "columnDimension";
26
- }>>;
27
22
  encoding: z.ZodOptional<z.ZodEnum<{
28
23
  column: "column";
29
24
  xAxis: "xAxis";
@@ -71,10 +66,12 @@ export declare const zFunnel: z.ZodObject<{
71
66
  }>>>;
72
67
  }, z.core.$strip>>>;
73
68
  encoding: z.ZodOptional<z.ZodEnum<{
69
+ column: "column";
74
70
  xAxis: "xAxis";
75
71
  yAxis: "yAxis";
76
72
  angle: "angle";
77
73
  color: "color";
74
+ detail: "detail";
78
75
  tooltip: "tooltip";
79
76
  label: "label";
80
77
  primaryYAxis: "primaryYAxis";
@@ -2,12 +2,28 @@ import { type Locale } from '../../i18n';
2
2
  import type { ColorLegend, Encoding, LinearColor, MeasureTree } from '../../properties';
3
3
  import { type BackgroundColor, type Dataset, type Dimensions, type Label, type Theme, type Tooltip } from '../../properties';
4
4
  /**
5
- * 热力图类型定义
6
5
  * @description 热力图,通过二维矩阵的颜色深浅展示数据的分布和强弱关系
7
6
  * 适用场景:
8
7
  * - 大规模二维数据的密度和强度展示
9
8
  * - 分类与数值的关联分析
10
9
  * - 时间序列与类别的交叉对比
10
+ * @encoding
11
+ * 维度未包含任何`encoding`, 则使用默认映射规则:
12
+ * 1. x: 第一个维度, 合并映射至x轴通道
13
+ * 2. y: 第二个(若没有第二个则复用第一个)及其之后的维度, 合并映射至y轴通道
14
+ * 3. color: 所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
15
+ * 4. detail: 所有维度与指标名称, 映射至Detail通道
16
+ * 指标未包含任何`encoding`, 则使用默认映射规则:
17
+ * 1. color: 第一个指标映射至Color通道
18
+ * 2. tooltip: 全部指标映射至Tooltip
19
+ *
20
+ * 维度映射规则:
21
+ * 1. 用户指定的`color`维度映射至颜色通道, 支持多个维度; 若未指定, 则默认将指标名称映射至颜色通道, 作为图例展示
22
+ * 2. 用户指定的`detail`维度映射至Detail通道, 支持多个维度; 若未指定, 则默认将指标名称映射至Detail通道
23
+ * 指标映射规则:
24
+ * 1. 指标未配置`encoding`, 则默认映射至color通道, 只有一个指标时才会映射至color通道
25
+ * 2. 用户指定的`detail`指标映射至Detail通道, 支持多个指标;
26
+ * 3. 所有指标均映射到Tooltip
11
27
  * @warning
12
28
  * 数据要求:
13
29
  * - 至少2个维度字段,用于确定热力图的行和列
@@ -5,11 +5,6 @@ export declare const zHeatmap: z.ZodObject<{
5
5
  dimensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
6
6
  id: z.ZodString;
7
7
  alias: z.ZodOptional<z.ZodString>;
8
- location: z.ZodDefault<z.ZodEnum<{
9
- dimension: "dimension";
10
- rowDimension: "rowDimension";
11
- columnDimension: "columnDimension";
12
- }>>;
13
8
  encoding: z.ZodOptional<z.ZodEnum<{
14
9
  column: "column";
15
10
  xAxis: "xAxis";
@@ -57,10 +52,12 @@ export declare const zHeatmap: z.ZodObject<{
57
52
  }>>>;
58
53
  }, z.core.$strip>>>;
59
54
  encoding: z.ZodOptional<z.ZodEnum<{
55
+ column: "column";
60
56
  xAxis: "xAxis";
61
57
  yAxis: "yAxis";
62
58
  angle: "angle";
63
59
  color: "color";
60
+ detail: "detail";
64
61
  tooltip: "tooltip";
65
62
  label: "label";
66
63
  primaryYAxis: "primaryYAxis";
@@ -1,14 +1,26 @@
1
1
  import type { Locale } from '../../i18n';
2
2
  import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, BackgroundColor, Color, Dataset, Dimensions, Label, Legend, LineStyle, PointStyle, Theme, Tooltip, CrosshairLine, XBandAxis, YLinearAxis, MeasureTree, Sort, SortLegend, Encoding } from '../../properties';
3
3
  /**
4
- * 折线图类型定义
5
- * @description
6
- * 折线图,适用于展示数据随时间或有序类别变化的趋势,通过线段连接数据点形成趋势线
7
- * @warning
4
+ * @description 折线图,适用于展示数据随时间或有序类别变化的趋势,通过线段连接数据点形成趋势线
8
5
  * 适用场景:
9
6
  * - 展示时间序列数据的变化趋势
10
7
  * - 比较多个数据系列的趋势对比
11
8
  * - 分析数据的增长或下降规律
9
+ * @encoding
10
+ * 维度未包含任何encoding, 则使用默认映射规则:
11
+ * 1. x: 第一个维度映射至X轴
12
+ * 2. color: 其余所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
13
+ * 指标未包含任何encoding, 则使用默认映射规则:
14
+ * 1. y: 全部指标映射至Y轴
15
+ * 2. tooltip: 全部指标映射至Tooltip
16
+ *
17
+ * 维度映射规则:
18
+ * 1. 用户指定的xAxis维度映射至X轴, 支持多个维度; 若未指定, 则默认将第一个维度映射至X轴
19
+ * 2. 用户指定的color维度映射至颜色通道, 支持多个维度; 若未指定, 则默认将指标名称映射至颜色通道, 作为图例展示
20
+ * 指标映射规则:
21
+ * 1. 指标未配置encoding, 则默认映射至Y轴;
22
+ * 2. 用户指定的yAxis指标映射至Y轴, 支持多个指标;
23
+ * 3. 所有指标均映射到Tooltip
12
24
  * @warning
13
25
  * 数据要求:
14
26
  * - 至少1个数值字段(度量)
@@ -19,11 +19,6 @@ export declare const zLine: z.ZodObject<{
19
19
  dimensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
20
20
  id: z.ZodString;
21
21
  alias: z.ZodOptional<z.ZodString>;
22
- location: z.ZodDefault<z.ZodEnum<{
23
- dimension: "dimension";
24
- rowDimension: "rowDimension";
25
- columnDimension: "columnDimension";
26
- }>>;
27
22
  encoding: z.ZodOptional<z.ZodEnum<{
28
23
  column: "column";
29
24
  xAxis: "xAxis";
@@ -71,10 +66,12 @@ export declare const zLine: z.ZodObject<{
71
66
  }>>>;
72
67
  }, z.core.$strip>>>;
73
68
  encoding: z.ZodOptional<z.ZodEnum<{
69
+ column: "column";
74
70
  xAxis: "xAxis";
75
71
  yAxis: "yAxis";
76
72
  angle: "angle";
77
73
  color: "color";
74
+ detail: "detail";
78
75
  tooltip: "tooltip";
79
76
  label: "label";
80
77
  primaryYAxis: "primaryYAxis";
@@ -1,12 +1,27 @@
1
1
  import type { Locale } from '../../i18n';
2
2
  import type { BackgroundColor, Color, Dataset, Dimensions, Encoding, Label, Legend, MeasureTree, Theme, Tooltip } from '../../properties';
3
3
  /**
4
- * 饼图类型定义
5
4
  * @description 饼图,适用于展示单一维度数据的占比关系,通过扇形面积大小表示各类别占比
6
5
  * 适用场景:
7
6
  * - 展示分类数据的占比分布
8
7
  * - 强调数据的整体与部分关系
9
8
  * - 类别数量较少(建议不超过6个)的占比分析
9
+ * @encoding
10
+ * 维度未包含任何`encoding`, 则使用默认映射规则:
11
+ * 1. color: 所有维度, 合并映射至颜色通道, 作为图例展示
12
+ * 2. detail: 所有维度, 映射至Detail通道
13
+ * 指标未包含任何`encoding`, 则使用默认映射规则:
14
+ * 1. angle: 全部指标映射至angle轴
15
+ * 2. tooltip: 全部指标映射至Tooltip
16
+ *
17
+ * 维度映射规则:
18
+ * 2. 用户指定的`color`维度映射至颜色通道, 支持多个维度; 若未指定, 则默认将指标名称映射至颜色通道, 作为图例展示
19
+ * 3. 用户指定的`detail`维度映射至Detail通道, 支持多个维度; 若未指定, 则默认将指标名称映射至Detail通道
20
+ * 指标映射规则:
21
+ * 1. 指标未配置`encoding`, 则默认映射至angle轴;
22
+ * 2. 用户指定的`angle`指标映射至angle轴, 支持多个指标;
23
+ * 3. 用户指定的`color`指标映射至color通道, 支持多个指标;
24
+ * 3. 所有指标均映射到Tooltip
10
25
  * @warning
11
26
  * 数据要求:
12
27
  * - 至少1个数值字段(度量)
@@ -19,11 +19,6 @@ export declare const zPie: z.ZodObject<{
19
19
  dimensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
20
20
  id: z.ZodString;
21
21
  alias: z.ZodOptional<z.ZodString>;
22
- location: z.ZodDefault<z.ZodEnum<{
23
- dimension: "dimension";
24
- rowDimension: "rowDimension";
25
- columnDimension: "columnDimension";
26
- }>>;
27
22
  encoding: z.ZodOptional<z.ZodEnum<{
28
23
  column: "column";
29
24
  xAxis: "xAxis";
@@ -71,10 +66,12 @@ export declare const zPie: z.ZodObject<{
71
66
  }>>>;
72
67
  }, z.core.$strip>>>;
73
68
  encoding: z.ZodOptional<z.ZodEnum<{
69
+ column: "column";
74
70
  xAxis: "xAxis";
75
71
  yAxis: "yAxis";
76
72
  angle: "angle";
77
73
  color: "color";
74
+ detail: "detail";
78
75
  tooltip: "tooltip";
79
76
  label: "label";
80
77
  primaryYAxis: "primaryYAxis";
@@ -2,12 +2,19 @@ import { type Locale } from '../../i18n';
2
2
  import type { Measures } from '../../properties';
3
3
  import { type BackgroundColor, type Dataset, type Dimensions, type Theme } from '../../properties';
4
4
  /**
5
- * 透视表类型定义
6
- * @description 透视表,适用于多维度数据交叉分析场景,可灵活配置行、列维度和指标计算方式
5
+ * @description 透视表格,适用于多维度数据交叉分析场景,可灵活配置行、列维度和指标计算方式
7
6
  * 适用场景:
8
7
  * - 复杂多维数据统计分析
9
8
  * - 数据钻取与聚合展示
10
9
  * - 业务报表生成与数据探索
10
+ * @encoding
11
+ * 则使用默认映射规则:
12
+ * - 维度与指标名称, 交替映射到列维度和行维度
13
+ * - 指标默认映射到detail通道
14
+ *
15
+ * 存在`encoding`配置:
16
+ * - 用户指定的`row`与`column`维度, 精准映射到行维度与列维度, 若未指定row和column, 则交替映射到列维度和行维度
17
+ * - 用户指定的`detail`指标, 精准映射到detail通道, 若未指定detail, 则依旧映射到detail通道
11
18
  * @warning
12
19
  * 数据要求:
13
20
  * - 至少1个行维度 或 1个列维度 或 1个指标
@@ -33,7 +40,7 @@ export interface PivotTable {
33
40
  */
34
41
  dataset: Dataset;
35
42
  /**
36
- * @description 透视表的行维度和列维度,会自动对数据进行处理为树形结构, 并映射到行和列轴, 可以通过 location : "rowDimension" | "columnDimension" 来控制一维度的映射位置
43
+ * @description 透视表的行维度和列维度,会自动对数据进行处理为树形结构, 并映射到行和列轴,
37
44
  * @type {Dimensions}
38
45
  * @example [{id: 'region', alias: '地区', isRow: true}, {id: 'product', alias: '产品', isColumn: true}]
39
46
  */
@@ -5,11 +5,6 @@ export declare const zPivotTable: z.ZodObject<{
5
5
  dimensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
6
6
  id: z.ZodString;
7
7
  alias: z.ZodOptional<z.ZodString>;
8
- location: z.ZodDefault<z.ZodEnum<{
9
- dimension: "dimension";
10
- rowDimension: "rowDimension";
11
- columnDimension: "columnDimension";
12
- }>>;
13
8
  encoding: z.ZodOptional<z.ZodEnum<{
14
9
  column: "column";
15
10
  xAxis: "xAxis";
@@ -57,10 +52,12 @@ export declare const zPivotTable: z.ZodObject<{
57
52
  }>>>;
58
53
  }, z.core.$strip>>>;
59
54
  encoding: z.ZodOptional<z.ZodEnum<{
55
+ column: "column";
60
56
  xAxis: "xAxis";
61
57
  yAxis: "yAxis";
62
58
  angle: "angle";
63
59
  color: "color";
60
+ detail: "detail";
64
61
  tooltip: "tooltip";
65
62
  label: "label";
66
63
  primaryYAxis: "primaryYAxis";