@visactor/vseed 0.1.6 → 0.1.8

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 (78) hide show
  1. package/dist/builder/builder/builder.d.ts +0 -2
  2. package/dist/dataReshape/constant.d.ts +2 -0
  3. package/dist/index.cjs +1053 -587
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.js +1050 -589
  6. package/dist/index.js.map +1 -1
  7. package/dist/pipeline/advanced/chart/pipes/encoding/bar.d.ts +1 -0
  8. package/dist/pipeline/advanced/chart/pipes/encoding/column.d.ts +1 -19
  9. package/dist/pipeline/advanced/chart/pipes/encoding/dualAxis.d.ts +1 -0
  10. package/dist/pipeline/advanced/chart/pipes/encoding/encodingAdapter.d.ts +2 -0
  11. package/dist/pipeline/advanced/chart/pipes/encoding/funnel.d.ts +1 -0
  12. package/dist/pipeline/advanced/chart/pipes/encoding/heatmap.d.ts +1 -0
  13. package/dist/pipeline/advanced/chart/pipes/encoding/index.d.ts +11 -9
  14. package/dist/pipeline/advanced/chart/pipes/encoding/line.d.ts +1 -17
  15. package/dist/pipeline/advanced/chart/pipes/encoding/pie.d.ts +1 -0
  16. package/dist/pipeline/advanced/chart/pipes/encoding/radar.d.ts +1 -0
  17. package/dist/pipeline/advanced/chart/pipes/encoding/rose.d.ts +1 -0
  18. package/dist/pipeline/advanced/chart/pipes/encoding/scatter.d.ts +1 -0
  19. package/dist/pipeline/advanced/chart/pipes/measures/utils.d.ts +7 -1
  20. package/dist/pipeline/advanced/table/pipes/{init/autoDimensions.d.ts → default/defaultDimensions.d.ts} +1 -1
  21. package/dist/pipeline/advanced/table/pipes/{init/autoMeasures.d.ts → default/defaultMeasureName.d.ts} +1 -1
  22. package/dist/pipeline/advanced/table/pipes/default/defaultMeasures.d.ts +5 -0
  23. package/dist/pipeline/advanced/table/pipes/default/index.d.ts +3 -0
  24. package/dist/pipeline/advanced/table/pipes/encoding/index.d.ts +1 -0
  25. package/dist/pipeline/advanced/table/pipes/{init/autoPivotMeasures.d.ts → encoding/pivotTable.d.ts} +1 -1
  26. package/dist/pipeline/advanced/table/pipes/index.d.ts +3 -0
  27. package/dist/pipeline/advanced/table/pipes/init/index.d.ts +0 -3
  28. package/dist/pipeline/spec/chart/pipes/tooltip/index.d.ts +2 -0
  29. package/dist/pipeline/spec/chart/pipes/tooltip/tooltip.d.ts +21 -1
  30. package/dist/pipeline/spec/chart/pipes/tooltip/tooltipHeatmap.d.ts +15 -0
  31. package/dist/pipeline/spec/chart/pipes/tooltip/tooltipScatter.d.ts +15 -0
  32. package/dist/types/advancedVSeed.d.ts +0 -5
  33. package/dist/types/chartType/area/area.d.ts +8 -29
  34. package/dist/types/chartType/area/zArea.d.ts +0 -5
  35. package/dist/types/chartType/areaPercent/areaPercent.d.ts +8 -30
  36. package/dist/types/chartType/areaPercent/zAreaPercent.d.ts +0 -5
  37. package/dist/types/chartType/bar/bar.d.ts +9 -14
  38. package/dist/types/chartType/bar/zBar.d.ts +0 -5
  39. package/dist/types/chartType/barParallel/barParallel.d.ts +9 -14
  40. package/dist/types/chartType/barParallel/zBarParallel.d.ts +0 -5
  41. package/dist/types/chartType/barPercent/barPercent.d.ts +9 -14
  42. package/dist/types/chartType/barPercent/zBarPercent.d.ts +0 -5
  43. package/dist/types/chartType/column/column.d.ts +9 -30
  44. package/dist/types/chartType/column/zColumn.d.ts +0 -5
  45. package/dist/types/chartType/columnParallel/columnParallel.d.ts +10 -32
  46. package/dist/types/chartType/columnParallel/zColumnParallel.d.ts +0 -5
  47. package/dist/types/chartType/columnPercent/columnPercent.d.ts +9 -30
  48. package/dist/types/chartType/columnPercent/zColumnPercent.d.ts +0 -5
  49. package/dist/types/chartType/donut/donut.d.ts +8 -13
  50. package/dist/types/chartType/donut/zDonut.d.ts +0 -5
  51. package/dist/types/chartType/dualAxis/dualAxis.d.ts +10 -14
  52. package/dist/types/chartType/dualAxis/zDualAxis.d.ts +0 -5
  53. package/dist/types/chartType/funnel/funnel.d.ts +8 -13
  54. package/dist/types/chartType/funnel/zFunnel.d.ts +0 -5
  55. package/dist/types/chartType/heatmap/heatmap.d.ts +9 -14
  56. package/dist/types/chartType/heatmap/zHeatmap.d.ts +0 -5
  57. package/dist/types/chartType/line/line.d.ts +9 -33
  58. package/dist/types/chartType/line/zLine.d.ts +0 -5
  59. package/dist/types/chartType/pie/pie.d.ts +8 -13
  60. package/dist/types/chartType/pie/zPie.d.ts +0 -5
  61. package/dist/types/chartType/pivotTable/pivotTable.d.ts +7 -3
  62. package/dist/types/chartType/pivotTable/zPivotTable.d.ts +0 -5
  63. package/dist/types/chartType/radar/radar.d.ts +8 -14
  64. package/dist/types/chartType/radar/zRadar.d.ts +0 -5
  65. package/dist/types/chartType/rose/rose.d.ts +9 -14
  66. package/dist/types/chartType/rose/zRose.d.ts +0 -5
  67. package/dist/types/chartType/roseParallel/roseParallel.d.ts +9 -14
  68. package/dist/types/chartType/roseParallel/zRoseParallel.d.ts +0 -5
  69. package/dist/types/chartType/scatter/scatter.d.ts +8 -14
  70. package/dist/types/chartType/scatter/zScatter.d.ts +0 -5
  71. package/dist/types/chartType/table/table.d.ts +2 -0
  72. package/dist/types/chartType/table/zTable.d.ts +0 -5
  73. package/dist/types/properties/dimensions/dimensions.d.ts +0 -4
  74. package/dist/types/properties/dimensions/zDimensions.d.ts +0 -15
  75. package/dist/types/zVseed.d.ts +0 -100
  76. package/dist/umd/index.js +1050 -588
  77. package/dist/umd/index.js.map +1 -1
  78. package/package.json +3 -3
@@ -1,2 +1,3 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const defaultEncodingForBar: AdvancedPipe;
2
3
  export declare const encodingForBar: AdvancedPipe;
@@ -1,21 +1,3 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
- /**
3
- * @description 堆叠柱状图、并列柱状图、百分比柱状图
4
- * 维度未包含任何encoding, 则使用默认映射规则:
5
- * 1. x: 第一个维度映射至X轴
6
- * 2. color: 非X轴所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
7
- * 3. detail: 其余所有维度映射至Detail通道
8
- * 指标未包含任何encoding, 则使用默认映射规则:
9
- * 1. y: 全部指标映射至Y轴
10
- * 2. tooltip: 全部指标映射至Tooltip
11
- *
12
- * 维度映射规则:
13
- * 1. 用户指定的xAxis维度映射至X轴, 支持多个维度; 若未指定, 则默认映射第一个维度
14
- * 2. 用户指定的color维度映射至颜色通道, 支持多个维度; 若未指定, 则默认映射指标名称
15
- * 3. 用户指定的detail维度映射至Detail通道, 支持多个维度; 若未指定, 则无detail
16
- * 指标映射规则:
17
- * 1. 指标未配置encoding, 则默认映射至Y轴;
18
- * 2. 用户指定的yAxis指标映射至Y轴, 支持多个指标;
19
- * 3. 所有指标均映射到Tooltip
20
- */
2
+ export declare const defaultEncodingForColumn: AdvancedPipe;
21
3
  export declare const encodingForColumn: AdvancedPipe;
@@ -1,2 +1,3 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const defaultEncodingForDualAxis: AdvancedPipe;
2
3
  export declare const encodingForDualAxis: AdvancedPipe;
@@ -0,0 +1,2 @@
1
+ import type { AdvancedPipe, AdvancedPipeline } from '../../../../../types';
2
+ export declare const encodingAdapter: (noEncodingPipeline: AdvancedPipeline, hasEncodingPipeline: AdvancedPipeline) => AdvancedPipe;
@@ -1,2 +1,3 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const defaultEncodingForFunnel: AdvancedPipe;
2
3
  export declare const encodingForFunnel: AdvancedPipe;
@@ -1,2 +1,3 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const defaultEncodingForHeatmap: AdvancedPipe;
2
3
  export declare const encodingForHeatmap: AdvancedPipe;
@@ -1,9 +1,11 @@
1
- export { encodingForColumn } from './column';
2
- export { encodingForBar } from './bar';
3
- export { encodingForPie } from './pie';
4
- export { encodingForDualAxis } from './dualAxis';
5
- export { encodingForFunnel } from './funnel';
6
- export { encodingForHeatmap } from './heatmap';
7
- export { encodingForRadar } from './radar';
8
- export { encodingForScatter } from './scatter';
9
- export { encodingForLine } from './line';
1
+ export { encodingForColumn, defaultEncodingForColumn } from './column';
2
+ export { encodingForBar, defaultEncodingForBar } from './bar';
3
+ export { encodingForPie, defaultEncodingForPie } from './pie';
4
+ export { encodingForDualAxis, defaultEncodingForDualAxis } from './dualAxis';
5
+ export { encodingForFunnel, defaultEncodingForFunnel } from './funnel';
6
+ export { encodingForHeatmap, defaultEncodingForHeatmap } from './heatmap';
7
+ export { encodingForRadar, defaultEncodingForRadar } from './radar';
8
+ export { encodingForScatter, defaultEncodingForScatter } from './scatter';
9
+ export { encodingForLine, defaultEncodingForLine } from './line';
10
+ export { encodingForRose, defaultEncodingForRose } from './rose';
11
+ export { encodingAdapter } from './encodingAdapter';
@@ -1,19 +1,3 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
- /**
3
- * @description 折线图、堆叠面积图、百分比面积图
4
- * 维度未包含任何encoding, 则使用默认映射规则:
5
- * 1. x: 第一个维度映射至X轴
6
- * 2. color: 其余所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
7
- * 指标未包含任何encoding, 则使用默认映射规则:
8
- * 1. y: 全部指标映射至Y轴
9
- * 2. tooltip: 全部指标映射至Tooltip
10
- *
11
- * 维度映射规则:
12
- * 1. 用户指定的xAxis维度映射至X轴, 支持多个维度; 若未指定, 则默认映射第一个维度
13
- * 2. 用户指定的color维度映射至颜色通道, 支持多个维度; 若未指定, 则默认映射指标名称
14
- * 指标映射规则:
15
- * 1. 指标未配置encoding, 则默认映射至Y轴;
16
- * 2. 用户指定的yAxis指标映射至Y轴, 支持多个指标;
17
- * 3. 所有指标均映射到Tooltip
18
- */
2
+ export declare const defaultEncodingForLine: AdvancedPipe;
19
3
  export declare const encodingForLine: AdvancedPipe;
@@ -1,2 +1,3 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const defaultEncodingForPie: AdvancedPipe;
2
3
  export declare const encodingForPie: AdvancedPipe;
@@ -1,2 +1,3 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const defaultEncodingForRadar: AdvancedPipe;
2
3
  export declare const encodingForRadar: AdvancedPipe;
@@ -1,2 +1,3 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const defaultEncodingForRose: AdvancedPipe;
2
3
  export declare const encodingForRose: AdvancedPipe;
@@ -1,2 +1,3 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
+ export declare const defaultEncodingForScatter: AdvancedPipe;
2
3
  export declare const encodingForScatter: AdvancedPipe;
@@ -1,4 +1,4 @@
1
- import type { AdvancedVSeed, VSeed } from '../../../../../types';
1
+ import type { AdvancedVSeed, MeasureGroup, MeasureTree, VSeed } from '../../../../../types';
2
2
  /**
3
3
  * @description 检查是否为指标树, 指标树深度大于1. 如果存在一个指标为组, 即有children配置, 则认为是指标树.
4
4
  * @param vseed vseed
@@ -11,3 +11,9 @@ export declare const isMeasureTreeWithChildren: (vseed: VSeed | AdvancedVSeed) =
11
11
  * @returns
12
12
  */
13
13
  export declare const isMeasureTreeWithParentId: (vseed: VSeed | AdvancedVSeed) => boolean;
14
+ /**
15
+ * @description 保证指标树中的每一组都有children, 没有children的指标, 会被放到一个默认的指标组中.
16
+ * @param measures 指标树
17
+ * @returns
18
+ */
19
+ export declare const normalizeMeasureTree: (measures: MeasureTree) => MeasureGroup[];
@@ -1,2 +1,2 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
- export declare const autoDimensions: AdvancedPipe;
2
+ export declare const defaultDimensions: AdvancedPipe;
@@ -1,2 +1,2 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
- export declare const autoMeasures: AdvancedPipe;
2
+ export declare const defaultMeasureName: AdvancedPipe;
@@ -0,0 +1,5 @@
1
+ import type { AdvancedPipe } from '../../../../../types';
2
+ /**
3
+ * @description 如果用户没有配置 measures, 则基于 dataset 构建默认的 measures
4
+ */
5
+ export declare const defaultMeasures: AdvancedPipe;
@@ -0,0 +1,3 @@
1
+ export { defaultMeasures } from './defaultMeasures';
2
+ export { defaultMeasureName } from './defaultMeasureName';
3
+ export { defaultDimensions } from './defaultDimensions';
@@ -0,0 +1 @@
1
+ export { encodingForPivotTable } from './pivotTable';
@@ -1,2 +1,2 @@
1
1
  import type { AdvancedPipe } from '../../../../../types';
2
- export declare const autoPivotMeasures: AdvancedPipe;
2
+ export declare const encodingForPivotTable: AdvancedPipe;
@@ -1,3 +1,6 @@
1
1
  export * from './init';
2
2
  export * from './records';
3
3
  export * from './config';
4
+ export * from './default';
5
+ export * from './reshape';
6
+ export * from './encoding';
@@ -1,5 +1,2 @@
1
- export * from './autoMeasures';
2
- export * from './autoDimensions';
3
1
  export * from './autoPivotDimensions';
4
- export * from './autoPivotMeasures';
5
2
  export * from './initAdvancedVSeed';
@@ -1,2 +1,4 @@
1
1
  export { tooltip } from './tooltip';
2
2
  export { tooltipPrimary, tooltipSecondary } from './tooltipDualAxis';
3
+ export { tooltipScatter } from './tooltipScatter';
4
+ export { tooltipHeatmap } from './tooltipHeatmap';
@@ -1,2 +1,22 @@
1
- import type { SpecPipe } from '../../../../../types';
1
+ import type { Dimensions, FoldInfo, Locale, Measures, SpecPipe, UnfoldInfo } from '../../../../../types';
2
2
  export declare const tooltip: SpecPipe;
3
+ export declare const createDimensionContent: (measures: Measures, foldInfo: FoldInfo, unfoldInfo: UnfoldInfo, locale: Locale) => {
4
+ visible: boolean;
5
+ shapeType: string;
6
+ hasShape: boolean;
7
+ key: (v: unknown) => string;
8
+ value: (v: unknown) => string;
9
+ }[];
10
+ export declare const createMarkContent: (tooltip: string[], dimensions: Dimensions, measures: Measures, locale: Locale, foldInfo: FoldInfo, unfoldInfo: UnfoldInfo) => ({
11
+ visible: boolean;
12
+ hasShape: boolean;
13
+ shapeType: string;
14
+ key: (v: unknown) => string;
15
+ value: (v: unknown) => string;
16
+ } | {
17
+ visible: boolean;
18
+ hasShape: boolean;
19
+ shapeType: string;
20
+ key: string;
21
+ value: (v: unknown) => string;
22
+ })[];
@@ -0,0 +1,15 @@
1
+ import type { Dimensions, FoldInfo, Locale, Measures, SpecPipe } from '../../../../../types';
2
+ export declare const tooltipHeatmap: SpecPipe;
3
+ export declare const createMarkContent: (tooltip: string[], dimensions: Dimensions, measures: Measures, locale: Locale, foldInfo: FoldInfo) => ({
4
+ visible: boolean;
5
+ hasShape: boolean;
6
+ shapeType: string;
7
+ key: (v: unknown) => string;
8
+ value: (v: unknown) => string;
9
+ } | {
10
+ visible: boolean;
11
+ hasShape: boolean;
12
+ shapeType: string;
13
+ key: string;
14
+ value: (v: unknown) => string;
15
+ })[];
@@ -0,0 +1,15 @@
1
+ import type { Dimensions, FoldInfo, Locale, Measures, SpecPipe } from '../../../../../types';
2
+ export declare const tooltipScatter: SpecPipe;
3
+ export declare const createMarkContent: (tooltip: string[], dimensions: Dimensions, measures: Measures, locale: Locale, foldInfoList: FoldInfo[]) => ({
4
+ visible: boolean;
5
+ hasShape: boolean;
6
+ shapeType: string;
7
+ key: (v: unknown) => string;
8
+ value: (v: unknown) => string;
9
+ } | {
10
+ visible: boolean;
11
+ hasShape: boolean;
12
+ shapeType: string;
13
+ key: string;
14
+ value: (v: unknown) => string;
15
+ })[];
@@ -56,11 +56,6 @@ export declare const zAdvancedVSeed: z.ZodObject<{
56
56
  dimensions: z.ZodArray<z.ZodUnion<[z.ZodType<import("./properties").DimensionGroup, unknown, z.core.$ZodTypeInternals<import("./properties").DimensionGroup, unknown>>, z.ZodObject<{
57
57
  id: z.ZodString;
58
58
  alias: z.ZodOptional<z.ZodString>;
59
- location: z.ZodDefault<z.ZodEnum<{
60
- dimension: "dimension";
61
- rowDimension: "rowDimension";
62
- columnDimension: "columnDimension";
63
- }>>;
64
59
  encoding: z.ZodOptional<z.ZodEnum<{
65
60
  column: "column";
66
61
  xAxis: "xAxis";
@@ -1,25 +1,16 @@
1
1
  import type { Locale } from '../../i18n';
2
- import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, AreaStyle, BackgroundColor, Color, Dataset, Dimensions, Label, Legend, LineStyle, PointStyle, Theme, Tooltip, XBandAxis, YLinearAxis, CrosshairLine, MeasureTree, Sort, SortLegend, Encoding } from '../../properties';
2
+ import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, AreaStyle, BackgroundColor, Color, Dataset, Dimensions, Label, Legend, LineStyle, PointStyle, Theme, Tooltip, XBandAxis, YLinearAxis, CrosshairLine, MeasureTree, Sort, SortLegend } from '../../properties';
3
3
  /**
4
4
  * @recommend
5
5
  * - 推荐字段配置: `1`个指标, `2`个维度
6
6
  * - 支持数据重塑: 至少`1`个指标, `0`个维度
7
- * @info
8
- * Encoding规则
9
- * 维度未包含任何encoding, 则使用默认映射规则:
10
- * 1. x: 第一个维度映射至X
11
- * 2. color: 其余所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
12
- * 指标未包含任何encoding, 则使用默认映射规则:
13
- * 1. y: 全部指标映射至Y轴
14
- * 2. tooltip: 全部指标映射至Tooltip
15
- *
16
- * 维度映射规则:
17
- * 1. 用户指定的xAxis维度映射至X轴, 支持多个维度; 若未指定, 则默认映射第一个维度
18
- * 2. 用户指定的color维度映射至颜色通道, 支持多个维度; 若未指定, 则默认映射指标名称
19
- * 指标映射规则:
20
- * 1. 指标未配置encoding, 则默认映射至Y轴;
21
- * 2. 用户指定的yAxis指标映射至Y轴, 支持多个指标;
22
- * 3. 所有指标均映射到Tooltip
7
+ * @encoding
8
+ * 面积图支持以下视觉通道:
9
+ * `xAxis` : x轴通道, 支持`多个维度`, 按维度值映射至x轴
10
+ * `yAxis` : y轴通道, 支持`多个指标`, 按指标值映射至y
11
+ * `color` : 颜色通道, 支持`多个维度`或 `一个指标`, 维度颜色用于区分不同的数据系列, 指标颜色用于线性映射指标值到图形颜色
12
+ * `tooltip`: 提示通道, 支持`多个维度`与 `多个指标`, 会在鼠标悬停在数据点上时展示
13
+ * `label` : 标签通道, 支持`多个维度`与 `多个指标`, 会在数据点上展示数据标签
23
14
  *
24
15
  * @description 面积图, 适用于展示数据随时间变化的趋势及累积关系, 通过填充区域增强数据对比. X轴为类目轴(分类数据), Y轴为数值轴(连续数据).
25
16
  * 适用场景:
@@ -56,18 +47,6 @@ export interface Area {
56
47
  * @example [{month:'1月', value:100}, {month:'2月', value:150}, {month:'3月', value:120}]
57
48
  */
58
49
  dataset: Dataset;
59
- /**
60
- * @description 编码配置, 堆叠面积图的视觉通道, 包括: x通道, color通道, detail通道, label通道, tooltip通道
61
- * - x: 映射到X轴的字段, 支持放入多个维度
62
- * - detail: 细分映射通道, 支持放入多个维度
63
- * - tooltip: 提示映射通道, 支持放入多个维度 和 多个指标
64
- * - color: 颜色映射通道, 支持放入多个维度 或 1个 指标
65
- * - label: 标签映射通道, 支持放入 多个维度 或 多个指标
66
- *
67
- * @tip 特殊的:
68
- * - y: measures会直接映射到Y轴通道
69
- */
70
- encoding?: Pick<Encoding, 'x' | 'color' | 'detail' | 'label' | 'tooltip'>;
71
50
  /**
72
51
  * 维度
73
52
  * @description 第一个维度被映射到X轴, 其余维度会与指标名称(存在多个指标时)合并, 作为图例项展示.
@@ -19,11 +19,6 @@ export declare const zArea: 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,28 +1,18 @@
1
1
  import type { Locale } from '../../i18n';
2
- import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, AreaStyle, BackgroundColor, Color, Dataset, Dimensions, Label, Legend, LineStyle, PointStyle, Theme, Tooltip, XBandAxis, YLinearAxis, CrosshairLine, MeasureTree, Sort, SortLegend, Encoding } from '../../properties';
2
+ import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, AreaStyle, BackgroundColor, Color, Dataset, Dimensions, Label, Legend, LineStyle, PointStyle, Theme, Tooltip, XBandAxis, YLinearAxis, CrosshairLine, MeasureTree, Sort, SortLegend } from '../../properties';
3
3
  /**
4
- * 百分比面积图类型定义
5
4
  * @description 百分比面积图,适用于展示多类别占比随时间变化的趋势,Y轴以百分比形式展示占比关系
6
5
  * 适用场景:
7
6
  * - 时间序列的构成变化分析
8
7
  * - 多类别占比趋势对比
9
8
  * - 累积占比与单一类别占比同时展示
10
- * @info
11
- * Encoding规则
12
- * 维度未包含任何encoding, 则使用默认映射规则:
13
- * 1. x: 第一个维度映射至X
14
- * 2. color: 其余所有维度与指标名称, 合并映射至颜色通道, 作为图例展示
15
- * 指标未包含任何encoding, 则使用默认映射规则:
16
- * 1. y: 全部指标映射至Y轴
17
- * 2. tooltip: 全部指标映射至Tooltip
18
- *
19
- * 维度映射规则:
20
- * 1. 用户指定的xAxis维度映射至X轴, 支持多个维度; 若未指定, 则默认映射第一个维度
21
- * 2. 用户指定的color维度映射至颜色通道, 支持多个维度; 若未指定, 则默认映射指标名称
22
- * 指标映射规则:
23
- * 1. 指标未配置encoding, 则默认映射至Y轴;
24
- * 2. 用户指定的yAxis指标映射至Y轴, 支持多个指标;
25
- * 3. 所有指标均映射到Tooltip
9
+ * @encoding
10
+ * 百分比面积图支持以下视觉通道:
11
+ * `xAxis` : x轴通道, 支持`多个维度`, 按维度值映射至x轴
12
+ * `yAxis` : y轴通道, 支持`多个指标`, 按指标值映射至y
13
+ * `color` : 颜色通道, 支持`多个维度`或 `一个指标`, 维度颜色用于区分不同的数据系列, 指标颜色用于线性映射指标值到图形颜色
14
+ * `tooltip`: 提示通道, 支持`多个维度`与 `多个指标`, 会在鼠标悬停在数据点上时展示
15
+ * `label` : 标签通道, 支持`多个维度`与 `多个指标`, 会在数据点上展示数据标签
26
16
  * @warning
27
17
  * 数据要求:
28
18
  * - 至少1个指标字段(度量)
@@ -49,18 +39,6 @@ export interface AreaPercent {
49
39
  * @example [{month:'1月', category:'A', value:30}, {month:'1月', category:'B', value:70}]
50
40
  */
51
41
  dataset: Dataset;
52
- /**
53
- * @description 编码配置, 百分比面积图的视觉通道, 包括: x通道, color通道, detail通道, label通道, tooltip通道
54
- * - x: 映射到X轴的字段, 支持放入多个维度
55
- * - detail: 细分映射通道, 支持放入多个维度
56
- * - tooltip: 提示映射通道, 支持放入多个维度 和 多个指标
57
- * - color: 颜色映射通道, 支持放入多个维度 或 1个 指标
58
- * - label: 标签映射通道, 支持放入 多个维度 或 多个指标
59
- *
60
- * @tip 特殊的:
61
- * - y: measures会直接映射到Y轴通道
62
- */
63
- encoding?: Pick<Encoding, 'x' | 'color' | 'detail' | 'label' | 'tooltip'>;
64
42
  /**
65
43
  * 维度
66
44
  * @description 第一个维度被映射到X轴, 其余维度会与指标名称(存在多个指标时)合并, 作为图例项展示.
@@ -19,11 +19,6 @@ export declare const zAreaPercent: 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,13 +1,20 @@
1
1
  import { type Locale } from '../../i18n';
2
- import type { Encoding, MeasureTree, Sort, SortLegend } from '../../properties';
2
+ import type { MeasureTree, Sort, SortLegend } from '../../properties';
3
3
  import { type AnnotationArea, type AnnotationHorizontalLine, type AnnotationPoint, type AnnotationVerticalLine, type BackgroundColor, type BarStyle, type Color, type CrosshairRect, type Dataset, type Dimensions, type Label, type Legend, type StackCornerRadius, type Theme, type Tooltip, type XLinearAxis, type YBandAxis } from '../../properties';
4
4
  /**
5
- * 条形图类型定义
6
5
  * @description 条形图,适用于横向数据对比场景,Y轴为类目轴(分类数据),X轴为数值轴(连续数据),柱子横向排列
7
6
  * 适用场景:
8
7
  * - 数据项名称较长时
9
8
  * - 需要展示数据排名对比
10
9
  * - 展示正负双向数据
10
+ * @encoding
11
+ * 条形图支持以下视觉通道:
12
+ * `yAxis` : y轴通道, 支持`多个维度`, 按维度值映射至y轴
13
+ * `xAxis` : x轴通道, 支持`多个指标`, 按指标值映射至x轴
14
+ * `detail` : 细分通道, 支持`多个维度`, 在同一个颜色系列下展示更细粒度的数据时使用
15
+ * `color` : 颜色通道, 支持`多个维度`或 `一个指标`, 维度颜色用于区分不同的数据系列, 指标颜色用于线性映射指标值到图形颜色
16
+ * `tooltip`: 提示通道, 支持`多个维度`与 `多个指标`, 会在鼠标悬停在数据点上时展示
17
+ * `label` : 标签通道, 支持`多个维度`与 `多个指标`, 会在数据点上展示数据标签
11
18
  * @warning
12
19
  * 数据要求:
13
20
  * - 至少1个指标(度量)
@@ -32,18 +39,6 @@ export interface Bar {
32
39
  * @example [{date:'2020-01-01', value:100}, {date:'2020-01-02', value:200}]
33
40
  */
34
41
  dataset: Dataset;
35
- /**
36
- * @description 编码配置, 条形图的视觉通道, 包括: y通道, color通道, detail通道, label通道, tooltip通道
37
- * - y: 映射到Y轴的字段, 支持放入多个维度
38
- * - detail: 细分映射通道, 支持放入多个维度
39
- * - tooltip: 提示映射通道, 支持放入多个维度 和 多个指标
40
- * - color: 颜色映射通道, 支持放入多个维度 或 1个 指标
41
- * - label: 标签映射通道, 支持放入 多个维度 或 多个指标
42
- *
43
- * @tip 特殊的:
44
- * - x: measures会直接映射到X轴通道
45
- */
46
- encoding?: Pick<Encoding, 'y' | 'color' | 'detail' | 'label' | 'tooltip'>;
47
42
  /**
48
43
  * @description 维度, 第一个维度被映射到Y轴, 其余维度会与指标名称(存在多个指标时)合并, 作为图例项展示.
49
44
  * @type {Dimensions}
@@ -19,11 +19,6 @@ export declare const zBar: 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,19 @@
1
1
  import type { Locale } from '../../i18n';
2
- import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, BackgroundColor, BarStyle, Color, CrosshairRect, Dataset, Dimensions, Label, Legend, StackCornerRadius, Theme, Tooltip, XLinearAxis, YBandAxis, MeasureTree, Sort, SortLegend, Encoding } from '../../properties';
2
+ import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, BackgroundColor, BarStyle, Color, CrosshairRect, Dataset, Dimensions, Label, Legend, StackCornerRadius, Theme, Tooltip, XLinearAxis, YBandAxis, MeasureTree, Sort, SortLegend } from '../../properties';
3
3
  /**
4
- * 并列条形图类型定义
5
4
  * @description 并列条形图,适用于多指标横向并行对比场景,多个条形平行排列展示不同指标值
6
5
  * 适用场景:
7
6
  * - 类别名称较长时的多指标对比
8
7
  * - 排名与数值同时展示的横向比较
9
8
  * - 多维度数据的并列分析
9
+ * @encoding
10
+ * 并列条形图支持以下视觉通道:
11
+ * `yAxis` : y轴通道, 支持`多个维度`, 按维度值映射至y轴
12
+ * `xAxis` : x轴通道, 支持`多个指标`, 按指标值映射至x轴
13
+ * `detail` : 细分通道, 支持`多个维度`, 在同一个颜色系列下展示更细粒度的数据时使用
14
+ * `color` : 颜色通道, 支持`多个维度`或 `一个指标`, 维度颜色用于区分不同的数据系列, 指标颜色用于线性映射指标值到图形颜色
15
+ * `tooltip`: 提示通道, 支持`多个维度`与 `多个指标`, 会在鼠标悬停在数据点上时展示
16
+ * `label` : 标签通道, 支持`多个维度`与 `多个指标`, 会在数据点上展示数据标签
10
17
  * @warning
11
18
  * 数据要求:
12
19
  * - 至少1个指标字段(度量)
@@ -31,18 +38,6 @@ export interface BarParallel {
31
38
  * @example [{category:'A', value1:100, value2:200}, {category:'B', value1:150, value2:250}]
32
39
  */
33
40
  dataset: Dataset;
34
- /**
35
- * @description 编码配置, 并列条形图的视觉通道, 包括: y通道, color通道, detail通道, label通道, tooltip通道
36
- * - y: 映射到Y轴的字段, 支持放入多个维度
37
- * - detail: 细分映射通道, 支持放入多个维度
38
- * - tooltip: 提示映射通道, 支持放入多个维度 和 多个指标
39
- * - color: 颜色映射通道, 支持放入多个维度 或 1个 指标
40
- * - label: 标签映射通道, 支持放入 多个维度 或 多个指标
41
- *
42
- * @tip 特殊的:
43
- * - x: measures会直接映射到X轴通道
44
- */
45
- encoding?: Pick<Encoding, 'y' | 'color' | 'detail' | 'label' | 'tooltip'>;
46
41
  /**
47
42
  * @description 维度, 第一个维度被映射到Y轴, 其余维度会与指标名称(存在多个指标时)合并, 作为图例项展示.
48
43
  * @type {Dimensions}
@@ -19,11 +19,6 @@ export declare const zBarParallel: 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,19 @@
1
1
  import type { Locale } from '../../i18n';
2
- import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, BackgroundColor, BarStyle, Color, CrosshairRect, Dataset, Dimensions, Label, Legend, StackCornerRadius, Theme, Tooltip, XLinearAxis, YBandAxis, MeasureTree, Sort, SortLegend, Encoding } from '../../properties';
2
+ import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, BackgroundColor, BarStyle, Color, CrosshairRect, Dataset, Dimensions, Label, Legend, StackCornerRadius, Theme, Tooltip, XLinearAxis, YBandAxis, MeasureTree, Sort, SortLegend } from '../../properties';
3
3
  /**
4
- * 百分比条形图类型定义
5
4
  * @description 百分比条形图,适用于横向展示各类别占比关系的场景,X轴以百分比形式展示数据占比
6
5
  * 适用场景:
7
6
  * - 类别名称较长时的占比对比
8
7
  * - 多维度数据的横向构成分析
9
8
  * - 排名与占比同时展示的场景
9
+ * @encoding
10
+ * 百分比条形图支持以下视觉通道:
11
+ * `yAxis` : y轴通道, 支持`多个维度`, 按维度值映射至y轴
12
+ * `xAxis` : x轴通道, 支持`多个指标`, 按指标值映射至x轴
13
+ * `detail` : 细分通道, 支持`多个维度`, 在同一个颜色系列下展示更细粒度的数据时使用
14
+ * `color` : 颜色通道, 支持`多个维度`或 `一个指标`, 维度颜色用于区分不同的数据系列, 指标颜色用于线性映射指标值到图形颜色
15
+ * `tooltip`: 提示通道, 支持`多个维度`与 `多个指标`, 会在鼠标悬停在数据点上时展示
16
+ * `label` : 标签通道, 支持`多个维度`与 `多个指标`, 会在数据点上展示数据标签
10
17
  * @warning
11
18
  * 数据要求:
12
19
  * - 至少1个维度字段和1个度量字段
@@ -31,18 +38,6 @@ export interface BarPercent {
31
38
  * @example [{category:'A', value:30}, {category:'B', value:70}]
32
39
  */
33
40
  dataset: Dataset;
34
- /**
35
- * @description 编码配置, 百分比条形图的视觉通道, 包括: y通道, color通道, detail通道, label通道, tooltip通道
36
- * - y: 映射到Y轴的字段, 支持放入多个维度
37
- * - detail: 细分映射通道, 支持放入多个维度
38
- * - tooltip: 提示映射通道, 支持放入多个维度 和 多个指标
39
- * - color: 颜色映射通道, 支持放入多个维度 或 1个 指标
40
- * - label: 标签映射通道, 支持放入 多个维度 或 多个指标
41
- *
42
- * @tip 特殊的:
43
- * - x: measures会直接映射到X轴通道
44
- */
45
- encoding?: Pick<Encoding, 'y' | 'color' | 'detail' | 'label' | 'tooltip'>;
46
41
  /**
47
42
  * @description 维度, 第一个维度会放至Y轴, 其余维度会与指标名称(存在多个指标时)合并, 作为图例项展示.
48
43
  * @type {Dimensions}
@@ -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";
@@ -1,28 +1,19 @@
1
1
  import type { Locale } from '../../i18n';
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';
2
+ import type { AnnotationArea, AnnotationHorizontalLine, AnnotationPoint, AnnotationVerticalLine, BackgroundColor, BarStyle, Color, CrosshairRect, Dataset, Dimensions, Label, Legend, StackCornerRadius, Theme, Tooltip, XBandAxis, YLinearAxis, MeasureTree, Sort, SortLegend } from '../../properties';
3
3
  /**
4
4
  * @description 柱状图,适用于纵向数据对比场景,X轴为类目轴(分类数据),Y轴为数值轴(连续数据),柱子纵向排列
5
5
  * 适用场景:
6
6
  * - 数据项名称较短时
7
7
  * - 需要直观比较不同类别的数值大小
8
8
  * - 展示时间序列数据变化趋势
9
- * @info
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
9
+ * @encoding
10
+ * 柱状图支持以下视觉通道:
11
+ * `xAxis` : x轴通道, 支持`多个维度`, 按维度值映射至x
12
+ * `yAxis` : y轴通道, 支持`多个指标`, 按指标值映射至y轴
13
+ * `detail` : 细分通道, 支持`多个维度`, 在同一个颜色系列下展示更细粒度的数据时使用
14
+ * `color` : 颜色通道, 支持`多个维度`或 `一个指标`, 维度颜色用于区分不同的数据系列, 指标颜色用于线性映射指标值到图形颜色
15
+ * `tooltip`: 提示通道, 支持`多个维度`与 `多个指标`, 会在鼠标悬停在数据点上时展示
16
+ * `label` : 标签通道, 支持`多个维度`与 `多个指标`, 会在数据点上展示数据标签
26
17
  * @warning
27
18
  * 数据要求:
28
19
  * - 至少1个数值字段(度量)
@@ -47,18 +38,6 @@ export interface Column {
47
38
  * @example [{category:'A', value:100}, {category:'B', value:200}]
48
39
  */
49
40
  dataset: Dataset;
50
- /**
51
- * @description 编码配置, 堆叠柱状图的视觉通道, 包括: x通道, color通道, detail通道, label通道, tooltip通道
52
- * - x: 映射到X轴的字段, 支持放入多个维度
53
- * - detail: 细分映射通道, 支持放入多个维度
54
- * - tooltip: 提示映射通道, 支持放入多个维度 和 多个指标
55
- * - color: 颜色映射通道, 支持放入多个维度 或 1个 指标
56
- * - label: 标签映射通道, 支持放入 多个维度 或 多个指标
57
- *
58
- * @tip 特殊的:
59
- * - y: measures会直接映射到Y轴通道
60
- */
61
- encoding?: Pick<Encoding, 'x' | 'color' | 'detail' | 'label' | 'tooltip'>;
62
41
  /**
63
42
  * @description 柱状图的第一个维度被映射到X轴, 其余维度会与指标名称(存在多个指标时)合并, 作为图例项展示
64
43
  * @type {Dimensions}
@@ -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";