@visactor/vseed 0.1.6 → 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 (70) hide show
  1. package/dist/builder/builder/builder.d.ts +0 -2
  2. package/dist/index.cjs +327 -313
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.js +327 -313
  5. package/dist/index.js.map +1 -1
  6. package/dist/pipeline/advanced/chart/pipes/encoding/bar.d.ts +19 -0
  7. package/dist/pipeline/advanced/chart/pipes/encoding/column.d.ts +9 -9
  8. package/dist/pipeline/advanced/chart/pipes/encoding/dualAxis.d.ts +19 -0
  9. package/dist/pipeline/advanced/chart/pipes/encoding/funnel.d.ts +17 -0
  10. package/dist/pipeline/advanced/chart/pipes/encoding/heatmap.d.ts +19 -0
  11. package/dist/pipeline/advanced/chart/pipes/encoding/line.d.ts +3 -2
  12. package/dist/pipeline/advanced/chart/pipes/encoding/pie.d.ts +18 -0
  13. package/dist/pipeline/advanced/chart/pipes/encoding/radar.d.ts +19 -0
  14. package/dist/pipeline/advanced/chart/pipes/encoding/rose.d.ts +19 -0
  15. package/dist/pipeline/advanced/chart/pipes/encoding/scatter.d.ts +18 -0
  16. package/dist/pipeline/advanced/table/pipes/{init/autoDimensions.d.ts → default/defaultDimensions.d.ts} +1 -1
  17. package/dist/pipeline/advanced/table/pipes/{init/autoMeasures.d.ts → default/defaultMeasureName.d.ts} +1 -1
  18. package/dist/pipeline/advanced/table/pipes/default/defaultMeasures.d.ts +5 -0
  19. package/dist/pipeline/advanced/table/pipes/default/index.d.ts +3 -0
  20. package/dist/pipeline/advanced/table/pipes/encoding/index.d.ts +1 -0
  21. package/dist/pipeline/advanced/table/pipes/{init/autoPivotMeasures.d.ts → encoding/pivotTable.d.ts} +1 -1
  22. package/dist/pipeline/advanced/table/pipes/index.d.ts +3 -0
  23. package/dist/pipeline/advanced/table/pipes/init/index.d.ts +0 -3
  24. package/dist/types/advancedVSeed.d.ts +0 -5
  25. package/dist/types/chartType/area/area.d.ts +1 -2
  26. package/dist/types/chartType/area/zArea.d.ts +0 -5
  27. package/dist/types/chartType/areaPercent/areaPercent.d.ts +1 -3
  28. package/dist/types/chartType/areaPercent/zAreaPercent.d.ts +0 -5
  29. package/dist/types/chartType/bar/bar.d.ts +17 -1
  30. package/dist/types/chartType/bar/zBar.d.ts +0 -5
  31. package/dist/types/chartType/barParallel/barParallel.d.ts +17 -1
  32. package/dist/types/chartType/barParallel/zBarParallel.d.ts +0 -5
  33. package/dist/types/chartType/barPercent/barPercent.d.ts +17 -1
  34. package/dist/types/chartType/barPercent/zBarPercent.d.ts +0 -5
  35. package/dist/types/chartType/column/column.d.ts +2 -2
  36. package/dist/types/chartType/column/zColumn.d.ts +0 -5
  37. package/dist/types/chartType/columnParallel/columnParallel.d.ts +2 -3
  38. package/dist/types/chartType/columnParallel/zColumnParallel.d.ts +0 -5
  39. package/dist/types/chartType/columnPercent/columnPercent.d.ts +2 -2
  40. package/dist/types/chartType/columnPercent/zColumnPercent.d.ts +0 -5
  41. package/dist/types/chartType/donut/donut.d.ts +16 -1
  42. package/dist/types/chartType/donut/zDonut.d.ts +0 -5
  43. package/dist/types/chartType/dualAxis/dualAxis.d.ts +17 -1
  44. package/dist/types/chartType/dualAxis/zDualAxis.d.ts +0 -5
  45. package/dist/types/chartType/funnel/funnel.d.ts +15 -1
  46. package/dist/types/chartType/funnel/zFunnel.d.ts +0 -5
  47. package/dist/types/chartType/heatmap/heatmap.d.ts +17 -1
  48. package/dist/types/chartType/heatmap/zHeatmap.d.ts +0 -5
  49. package/dist/types/chartType/line/line.d.ts +8 -12
  50. package/dist/types/chartType/line/zLine.d.ts +0 -5
  51. package/dist/types/chartType/pie/pie.d.ts +16 -1
  52. package/dist/types/chartType/pie/zPie.d.ts +0 -5
  53. package/dist/types/chartType/pivotTable/pivotTable.d.ts +10 -3
  54. package/dist/types/chartType/pivotTable/zPivotTable.d.ts +0 -5
  55. package/dist/types/chartType/radar/radar.d.ts +17 -1
  56. package/dist/types/chartType/radar/zRadar.d.ts +0 -5
  57. package/dist/types/chartType/rose/rose.d.ts +17 -1
  58. package/dist/types/chartType/rose/zRose.d.ts +0 -5
  59. package/dist/types/chartType/roseParallel/roseParallel.d.ts +17 -1
  60. package/dist/types/chartType/roseParallel/zRoseParallel.d.ts +0 -5
  61. package/dist/types/chartType/scatter/scatter.d.ts +16 -1
  62. package/dist/types/chartType/scatter/zScatter.d.ts +0 -5
  63. package/dist/types/chartType/table/table.d.ts +2 -0
  64. package/dist/types/chartType/table/zTable.d.ts +0 -5
  65. package/dist/types/properties/dimensions/dimensions.d.ts +0 -4
  66. package/dist/types/properties/dimensions/zDimensions.d.ts +0 -15
  67. package/dist/types/zVseed.d.ts +0 -100
  68. package/dist/umd/index.js +327 -313
  69. package/dist/umd/index.js.map +1 -1
  70. package/package.json +2 -2
@@ -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";
@@ -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";
@@ -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";
@@ -1,11 +1,12 @@
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
- * @info
8
- * Encoding规则
4
+ * @description 折线图,适用于展示数据随时间或有序类别变化的趋势,通过线段连接数据点形成趋势线
5
+ * 适用场景:
6
+ * - 展示时间序列数据的变化趋势
7
+ * - 比较多个数据系列的趋势对比
8
+ * - 分析数据的增长或下降规律
9
+ * @encoding
9
10
  * 维度未包含任何encoding, 则使用默认映射规则:
10
11
  * 1. x: 第一个维度映射至X轴
11
12
  * 2. color: 其余所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
@@ -14,18 +15,13 @@ import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, Annotat
14
15
  * 2. tooltip: 全部指标映射至Tooltip
15
16
  *
16
17
  * 维度映射规则:
17
- * 1. 用户指定的xAxis维度映射至X轴, 支持多个维度; 若未指定, 则默认映射第一个维度
18
- * 2. 用户指定的color维度映射至颜色通道, 支持多个维度; 若未指定, 则默认映射指标名称
18
+ * 1. 用户指定的xAxis维度映射至X轴, 支持多个维度; 若未指定, 则默认将第一个维度映射至X轴
19
+ * 2. 用户指定的color维度映射至颜色通道, 支持多个维度; 若未指定, 则默认将指标名称映射至颜色通道, 作为图例展示
19
20
  * 指标映射规则:
20
21
  * 1. 指标未配置encoding, 则默认映射至Y轴;
21
22
  * 2. 用户指定的yAxis指标映射至Y轴, 支持多个指标;
22
23
  * 3. 所有指标均映射到Tooltip
23
24
  * @warning
24
- * 适用场景:
25
- * - 展示时间序列数据的变化趋势
26
- * - 比较多个数据系列的趋势对比
27
- * - 分析数据的增长或下降规律
28
- * @warning
29
25
  * 数据要求:
30
26
  * - 至少1个数值字段(度量)
31
27
  * - 第一个维度会放至X轴, 其余维度会与指标名称(存在多个指标时)合并, 作为图例项展示
@@ -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";
@@ -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";
@@ -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";
@@ -2,12 +2,28 @@ import { type Locale } from '../../i18n';
2
2
  import type { AreaStyle, Encoding, LineStyle, MeasureTree, PointStyle } from '../../properties';
3
3
  import { type BackgroundColor, type Color, type Dataset, type Dimensions, type Label, type Legend, 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. angle: 第一个维度映射至angle轴
13
+ * 2. color: 非`Angle`轴所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
14
+ * 3. detail: 非`Angle`轴所有维度与指标名称, 映射至Detail通道
15
+ * 指标未包含任何`encoding`, 则使用默认映射规则:
16
+ * 1. radius: 全部指标映射至radius轴
17
+ * 2. tooltip: 全部指标映射至Tooltip
18
+ *
19
+ * 维度映射规则:
20
+ * 1. 用户指定的`angle`维度映射至angle轴, 支持多个维度; 若未指定, 则默认将第一个维度映射至angle轴
21
+ * 2. 用户指定的`color`维度映射至颜色通道, 支持多个维度; 若未指定, 则默认将指标名称映射至颜色通道, 作为图例展示
22
+ * 3. 用户指定的`detail`维度映射至Detail通道, 支持多个维度; 若未指定, 则默认将指标名称映射至Detail通道
23
+ * 指标映射规则:
24
+ * 1. 指标未配置`encoding`, 则默认映射至radius轴;
25
+ * 2. 用户指定的`radius`指标映射至radius轴, 支持多个指标;
26
+ * 3. 所有指标均映射到Tooltip
11
27
  * @warning
12
28
  * 数据要求:
13
29
  * - 至少1个数值字段(度量)
@@ -19,11 +19,6 @@ export declare const zRadar: 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";
@@ -2,12 +2,28 @@ import { type Locale } from '../../i18n';
2
2
  import type { Encoding, MeasureTree } from '../../properties';
3
3
  import { type BackgroundColor, type Color, type Dataset, type Dimensions, type Label, type Legend, 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. angle: 第一个维度映射至angle轴
13
+ * 2. color: 非`angle`轴所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
14
+ * 3. detail: 非`angle`轴所有维度与指标名称, 映射至Detail通道
15
+ * 指标未包含任何`encoding`, 则使用默认映射规则:
16
+ * 1. radius: 全部指标映射至radius轴
17
+ * 2. tooltip: 全部指标映射至Tooltip
18
+ *
19
+ * 维度映射规则:
20
+ * 1. 用户指定的`angle`维度映射至angle轴, 支持多个维度; 若未指定, 则默认将第一个维度映射至angle轴
21
+ * 2. 用户指定的`color`维度映射至颜色通道, 支持多个维度; 若未指定, 则默认将指标名称映射至颜色通道, 作为图例展示
22
+ * 3. 用户指定的`detail`维度映射至Detail通道, 支持多个维度; 若未指定, 则默认将指标名称映射至Detail通道
23
+ * 指标映射规则:
24
+ * 1. 指标未配置`encoding`, 则默认映射至Y轴;
25
+ * 2. 用户指定的`radius`指标映射至radius轴, 支持多个指标;
26
+ * 3. 所有指标均映射到Tooltip
11
27
  * @warning
12
28
  * 数据要求:
13
29
  * - 至少1个数值字段(度量)
@@ -19,11 +19,6 @@ export declare const zRose: 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";
@@ -2,12 +2,28 @@ import { type Locale } from '../../i18n';
2
2
  import type { Encoding, MeasureTree } from '../../properties';
3
3
  import { type BackgroundColor, type Color, type Dataset, type Dimensions, type Label, type Legend, 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. angle: 第一个维度映射至angle轴
13
+ * 2. color: 非`angle`轴所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
14
+ * 3. detail: 非`angle`轴所有维度与指标名称, 映射至Detail通道
15
+ * 指标未包含任何`encoding`, 则使用默认映射规则:
16
+ * 1. radius: 全部指标映射至radius轴
17
+ * 2. tooltip: 全部指标映射至Tooltip
18
+ *
19
+ * 维度映射规则:
20
+ * 1. 用户指定的`angle`维度映射至angle轴, 支持多个维度; 若未指定, 则默认将第一个维度映射至angle轴
21
+ * 2. 用户指定的`color`维度映射至颜色通道, 支持多个维度; 若未指定, 则默认将指标名称映射至颜色通道, 作为图例展示
22
+ * 3. 用户指定的`detail`维度映射至Detail通道, 支持多个维度; 若未指定, 则默认将指标名称映射至Detail通道
23
+ * 指标映射规则:
24
+ * 1. 指标未配置`encoding`, 则默认映射至Y轴;
25
+ * 2. 用户指定的`radius`指标映射至radius轴, 支持多个指标;
26
+ * 3. 所有指标均映射到Tooltip
11
27
  * @warning
12
28
  * 数据要求:
13
29
  * - 至少1个数值字段(度量)
@@ -19,11 +19,6 @@ export declare const zRoseParallel: 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";
@@ -1,10 +1,25 @@
1
1
  import type { Locale } from '../../i18n';
2
2
  import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, BackgroundColor, Color, Dataset, Dimensions, Label, Legend, PointStyle, Theme, Tooltip, CrosshairLine, YLinearAxis, XLinearAxis, MeasureTree, Encoding, ScatterMeasures } from '../../properties';
3
3
  /**
4
- * 散点图类型定义
5
4
  * @description 散点图,适用于展示数据的分布情况,通过点的位置表示数据的数值
6
5
  * 适用场景:
7
6
  * - 分析数据的分布特征, 如数据的中心趋势, 分布范围, 异常值等
7
+ * @encoding
8
+ * 维度未包含任何`encoding`, 则使用默认映射规则:
9
+ * 1. color: 所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
10
+ * 2. detail: 所有维度与指标名称, 映射至Detail通道
11
+ * 指标未包含任何`encoding`, 则使用默认映射规则:
12
+ * 1. x: 第一个指标映射至X轴
13
+ * 2. y: 第二个及其之后的指标映射至Y轴
14
+ * 3. tooltip: 全部指标映射至Tooltip
15
+ *
16
+ * 维度映射规则:
17
+ * 2. 用户指定的`color`维度映射至颜色通道, 支持多个维度; 若未指定, 则默认将指标名称映射至颜色通道, 作为图例展示
18
+ * 3. 用户指定的`detail`维度映射至Detail通道, 支持多个维度; 若未指定, 则默认将指标名称映射至Detail通道
19
+ * 指标映射规则:
20
+ * 1. 指标未配置encoding, 则第一个指标默认映射至X轴, 第二个指标默认映射至Y轴
21
+ * 2. 用户指定的yAxis指标映射至Y轴X轴, 支持多个指标;
22
+ * 3. 所有指标均映射到Tooltip
8
23
  * @warning
9
24
  * 数据要求:
10
25
  * - 至少2个数值字段(度量)
@@ -19,11 +19,6 @@ export declare const zScatter: 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";
@@ -7,6 +7,8 @@ import { type BackgroundColor, type Dataset, type Theme } from '../../properties
7
7
  * - 需要展示详细数据明细
8
8
  * - 数据项需要精确比对
9
9
  * - 展示多维度数据属性
10
+ * @encoding
11
+ * 仅支持配置维度树与指标树, 默认encoding到column
10
12
  * @warning
11
13
  * 数据要求:
12
14
  * - 至少1个维度字段
@@ -5,11 +5,6 @@ export declare const zTable: 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";
@@ -4,10 +4,6 @@
4
4
  export type Dimension = {
5
5
  id: string;
6
6
  alias?: string;
7
- /**
8
- * @deprecated 请使用 encoding 代替
9
- */
10
- location?: 'dimension' | 'rowDimension' | 'columnDimension';
11
7
  /**
12
8
  * @description 维度映射的通道
13
9
  * - x: 支持将多个维度映射到x轴, 支持柱状图、折线图、面积图等
@@ -3,11 +3,6 @@ import type { DimensionGroup } from './dimensions';
3
3
  export declare const zDimension: z.ZodObject<{
4
4
  id: z.ZodString;
5
5
  alias: z.ZodOptional<z.ZodString>;
6
- location: z.ZodDefault<z.ZodEnum<{
7
- dimension: "dimension";
8
- rowDimension: "rowDimension";
9
- columnDimension: "columnDimension";
10
- }>>;
11
6
  encoding: z.ZodOptional<z.ZodEnum<{
12
7
  column: "column";
13
8
  xAxis: "xAxis";
@@ -24,11 +19,6 @@ export declare const zDimensionGroup: z.ZodType<DimensionGroup>;
24
19
  export declare const zDimensions: z.ZodArray<z.ZodObject<{
25
20
  id: z.ZodString;
26
21
  alias: z.ZodOptional<z.ZodString>;
27
- location: z.ZodDefault<z.ZodEnum<{
28
- dimension: "dimension";
29
- rowDimension: "rowDimension";
30
- columnDimension: "columnDimension";
31
- }>>;
32
22
  encoding: z.ZodOptional<z.ZodEnum<{
33
23
  column: "column";
34
24
  xAxis: "xAxis";
@@ -44,11 +34,6 @@ export declare const zDimensions: z.ZodArray<z.ZodObject<{
44
34
  export declare const zDimensionTree: z.ZodArray<z.ZodUnion<[z.ZodType<DimensionGroup, unknown, z.core.$ZodTypeInternals<DimensionGroup, unknown>>, z.ZodObject<{
45
35
  id: z.ZodString;
46
36
  alias: z.ZodOptional<z.ZodString>;
47
- location: z.ZodDefault<z.ZodEnum<{
48
- dimension: "dimension";
49
- rowDimension: "rowDimension";
50
- columnDimension: "columnDimension";
51
- }>>;
52
37
  encoding: z.ZodOptional<z.ZodEnum<{
53
38
  column: "column";
54
39
  xAxis: "xAxis";