@visactor/vseed 0.0.9 → 0.0.10

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 (28) hide show
  1. package/dist/builder/builder/builder.d.ts +222 -21
  2. package/dist/index.cjs +198 -51
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.js +191 -50
  5. package/dist/index.js.map +1 -1
  6. package/dist/pipeline/advanced/pipes/annotation/annotation.d.ts +2 -0
  7. package/dist/pipeline/advanced/pipes/annotation/index.d.ts +1 -0
  8. package/dist/pipeline/advanced/pipes/index.d.ts +1 -0
  9. package/dist/pipeline/spec/pipes/annotation/annotationPoint.d.ts +2 -0
  10. package/dist/pipeline/spec/pipes/annotation/index.d.ts +1 -0
  11. package/dist/pipeline/spec/pipes/index.d.ts +1 -0
  12. package/dist/types/advancedVSeed.d.ts +91 -8
  13. package/dist/types/chartType/area/area.d.ts +6 -1
  14. package/dist/types/chartType/areaPercent/areaPercent.d.ts +6 -1
  15. package/dist/types/chartType/bar/bar.d.ts +6 -1
  16. package/dist/types/chartType/barParallel/barParallel.d.ts +6 -1
  17. package/dist/types/chartType/barPercent/barPercent.d.ts +6 -1
  18. package/dist/types/chartType/column/column.d.ts +6 -1
  19. package/dist/types/chartType/columnParallel/columnParallel.d.ts +6 -1
  20. package/dist/types/chartType/columnPercent/columnPercent.d.ts +6 -1
  21. package/dist/types/chartType/line/line.d.ts +6 -1
  22. package/dist/types/properties/annotation/annotation.d.ts +85 -0
  23. package/dist/types/properties/annotation/annotationPoint.d.ts +147 -0
  24. package/dist/types/properties/annotation/index.d.ts +2 -0
  25. package/dist/types/properties/index.d.ts +1 -0
  26. package/dist/types/properties/markStyle/barStyle.d.ts +9 -9
  27. package/dist/types/properties/markStyle/markStyle.d.ts +8 -8
  28. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ import type { AdvancedPipe } from '../../../../types';
2
+ export declare const annotation: AdvancedPipe;
@@ -0,0 +1 @@
1
+ export { annotation } from './annotation';
@@ -6,3 +6,4 @@ export * from './config';
6
6
  export * from './theme';
7
7
  export * from './pivot';
8
8
  export * from './markStyle';
9
+ export * from './annotation';
@@ -0,0 +1,2 @@
1
+ import type { SpecPipe } from '../../../../types';
2
+ export declare const annotationPoint: SpecPipe;
@@ -0,0 +1 @@
1
+ export { annotationPoint } from './annotationPoint';
@@ -10,3 +10,4 @@ export * from './legend';
10
10
  export * from './color';
11
11
  export * from './pivotChart';
12
12
  export * from './markStyle';
13
+ export * from './annotation';
@@ -896,7 +896,7 @@ export declare const zAdvancedVSeed: z.ZodObject<{
896
896
  theme: z.ZodString;
897
897
  markStyle: z.ZodObject<{
898
898
  barStyle: z.ZodOptional<z.ZodObject<{
899
- selector: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
899
+ selector: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
900
900
  field: z.ZodString;
901
901
  operator: z.ZodString;
902
902
  value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
@@ -912,13 +912,13 @@ export declare const zAdvancedVSeed: z.ZodObject<{
912
912
  field: z.ZodString;
913
913
  operator: z.ZodString;
914
914
  value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
915
- }, z.core.$strip>]>>]>;
916
- barColor: z.ZodString;
917
- barColorOpacity: z.ZodNumber;
918
- barBorderColor: z.ZodString;
919
- barBorderWidth: z.ZodNumber;
920
- barBorderStyle: z.ZodUnion<readonly [z.ZodLiteral<"solid">, z.ZodLiteral<"dashed">, z.ZodLiteral<"dotted">]>;
921
- barRadius: z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>;
915
+ }, z.core.$strip>]>>]>>;
916
+ barColor: z.ZodOptional<z.ZodString>;
917
+ barColorOpacity: z.ZodOptional<z.ZodNumber>;
918
+ barBorderColor: z.ZodOptional<z.ZodString>;
919
+ barBorderWidth: z.ZodOptional<z.ZodNumber>;
920
+ barBorderStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"solid">, z.ZodLiteral<"dashed">, z.ZodLiteral<"dotted">]>>;
921
+ barRadius: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>;
922
922
  }, z.core.$strip>>;
923
923
  }, z.core.$strip>;
924
924
  customTheme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -1714,5 +1714,88 @@ export declare const zAdvancedVSeed: z.ZodObject<{
1714
1714
  pivotTable: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
1715
1715
  }, z.core.$strip>>;
1716
1716
  }, z.core.$strip>>>;
1717
+ annotation: z.ZodObject<{
1718
+ annotationPoint: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
1719
+ selector: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
1720
+ field: z.ZodString;
1721
+ operator: z.ZodString;
1722
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
1723
+ }, z.core.$strip>, z.ZodObject<{
1724
+ field: z.ZodString;
1725
+ operator: z.ZodString;
1726
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
1727
+ }, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
1728
+ field: z.ZodString;
1729
+ operator: z.ZodString;
1730
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
1731
+ }, z.core.$strip>, z.ZodObject<{
1732
+ field: z.ZodString;
1733
+ operator: z.ZodString;
1734
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
1735
+ }, z.core.$strip>]>>]>;
1736
+ text: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>;
1737
+ textColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
1738
+ textFontSize: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1739
+ textFontWeight: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1740
+ textAlign: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1741
+ left: "left";
1742
+ right: "right";
1743
+ center: "center";
1744
+ }>>>;
1745
+ textBaseline: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1746
+ top: "top";
1747
+ bottom: "bottom";
1748
+ middle: "middle";
1749
+ }>>>;
1750
+ backgroundVisible: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1751
+ backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
1752
+ backgroundBorderColor: z.ZodOptional<z.ZodString>;
1753
+ backgroundBorderWidth: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1754
+ backgroundBorderRadius: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1755
+ backgroundPadding: z.ZodOptional<z.ZodNumber>;
1756
+ offsetY: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1757
+ offsetX: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1758
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
1759
+ selector: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
1760
+ field: z.ZodString;
1761
+ operator: z.ZodString;
1762
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
1763
+ }, z.core.$strip>, z.ZodObject<{
1764
+ field: z.ZodString;
1765
+ operator: z.ZodString;
1766
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
1767
+ }, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
1768
+ field: z.ZodString;
1769
+ operator: z.ZodString;
1770
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
1771
+ }, z.core.$strip>, z.ZodObject<{
1772
+ field: z.ZodString;
1773
+ operator: z.ZodString;
1774
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
1775
+ }, z.core.$strip>]>>]>;
1776
+ text: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>;
1777
+ textColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
1778
+ textFontSize: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1779
+ textFontWeight: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1780
+ textAlign: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1781
+ left: "left";
1782
+ right: "right";
1783
+ center: "center";
1784
+ }>>>;
1785
+ textBaseline: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
1786
+ top: "top";
1787
+ bottom: "bottom";
1788
+ middle: "middle";
1789
+ }>>>;
1790
+ backgroundVisible: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1791
+ backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
1792
+ backgroundBorderColor: z.ZodOptional<z.ZodString>;
1793
+ backgroundBorderWidth: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1794
+ backgroundBorderRadius: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1795
+ backgroundPadding: z.ZodOptional<z.ZodNumber>;
1796
+ offsetY: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1797
+ offsetX: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
1798
+ }, z.core.$strip>>]>>;
1799
+ }, z.core.$strip>;
1717
1800
  }, z.core.$strip>;
1718
1801
  export type AdvancedVSeed = z.infer<typeof zAdvancedVSeed>;
@@ -1,4 +1,4 @@
1
- import type { BackgroundColor, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XBandAxis, YLinearAxis } from '../../properties';
1
+ import type { AnnotationPoint, BackgroundColor, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XBandAxis, YLinearAxis } from '../../properties';
2
2
  /**
3
3
  * 面积图类型定义
4
4
  * @description 面积图, 适用于展示数据随时间变化的趋势及累积关系, 通过填充区域增强数据对比. X轴为类目轴(分类数据), Y轴为数值轴(连续数据).
@@ -88,4 +88,9 @@ export interface Area {
88
88
  * @example 'customThemeName'
89
89
  */
90
90
  theme?: Theme;
91
+ /**
92
+ * 标注点
93
+ * @description 标注点配置, 根据选择的数据, 定义图表的标注点, 包括标注点的位置, 格式, 样式等.
94
+ */
95
+ annotationPoint?: AnnotationPoint | AnnotationPoint[];
91
96
  }
@@ -1,4 +1,4 @@
1
- import type { BackgroundColor, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XBandAxis, YLinearAxis } from '../../properties';
1
+ import type { AnnotationPoint, BackgroundColor, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XBandAxis, YLinearAxis } from '../../properties';
2
2
  /**
3
3
  * 百分比面积图类型定义
4
4
  * @description 百分比面积图,适用于展示多类别占比随时间变化的趋势,Y轴以百分比形式展示占比关系
@@ -87,4 +87,9 @@ export interface AreaPercent {
87
87
  * @example 'customThemeName'
88
88
  */
89
89
  theme?: Theme;
90
+ /**
91
+ * 标注点
92
+ * @description 标注点配置, 根据选择的数据, 定义图表的标注点, 包括标注点的位置, 格式, 样式等.
93
+ */
94
+ annotationPoint?: AnnotationPoint | AnnotationPoint[];
90
95
  }
@@ -1,4 +1,4 @@
1
- import type { BackgroundColor, BarStyle, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XLinearAxis, YBandAxis } from '../../properties';
1
+ import type { AnnotationPoint, BackgroundColor, BarStyle, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XLinearAxis, YBandAxis } from '../../properties';
2
2
  /**
3
3
  * 条形图类型定义
4
4
  * @description 条形图,适用于横向数据对比场景,Y轴为类目轴(分类数据),X轴为数值轴(连续数据),柱子横向排列
@@ -96,4 +96,9 @@ export interface Bar {
96
96
  * 若未配置selector, 则样式全局生效.
97
97
  */
98
98
  barStyle?: BarStyle;
99
+ /**
100
+ * 标注点
101
+ * @description 标注点配置, 根据选择的数据, 定义图表的标注点, 包括标注点的位置, 格式, 样式等.
102
+ */
103
+ annotationPoint?: AnnotationPoint | AnnotationPoint[];
99
104
  }
@@ -1,4 +1,4 @@
1
- import type { BackgroundColor, BarStyle, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XLinearAxis, YBandAxis } from '../../properties';
1
+ import type { AnnotationPoint, BackgroundColor, BarStyle, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XLinearAxis, YBandAxis } from '../../properties';
2
2
  /**
3
3
  * 并列条形图类型定义
4
4
  * @description 并列条形图,适用于多指标横向并行对比场景,多个条形平行排列展示不同指标值
@@ -96,4 +96,9 @@ export interface BarParallel {
96
96
  * 若未配置selector, 则样式全局生效.
97
97
  */
98
98
  barStyle?: BarStyle;
99
+ /**
100
+ * 标注点
101
+ * @description 标注点配置, 根据选择的数据, 定义图表的标注点, 包括标注点的位置, 格式, 样式等.
102
+ */
103
+ annotationPoint?: AnnotationPoint | AnnotationPoint[];
99
104
  }
@@ -1,4 +1,4 @@
1
- import type { BackgroundColor, BarStyle, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XLinearAxis, YBandAxis } from '../../properties';
1
+ import type { AnnotationPoint, BackgroundColor, BarStyle, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XLinearAxis, YBandAxis } from '../../properties';
2
2
  /**
3
3
  * 百分比条形图类型定义
4
4
  * @description 百分比条形图,适用于横向展示各类别占比关系的场景,X轴以百分比形式展示数据占比
@@ -96,4 +96,9 @@ export interface BarPercent {
96
96
  * 若未配置selector, 则样式全局生效.
97
97
  */
98
98
  barStyle?: BarStyle;
99
+ /**
100
+ * 标注点
101
+ * @description 标注点配置, 根据选择的数据, 定义图表的标注点, 包括标注点的位置, 格式, 样式等.
102
+ */
103
+ annotationPoint?: AnnotationPoint | AnnotationPoint[];
99
104
  }
@@ -1,4 +1,4 @@
1
- import type { BackgroundColor, BarStyle, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XBandAxis, YLinearAxis } from '../../properties';
1
+ import type { AnnotationPoint, BackgroundColor, BarStyle, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XBandAxis, YLinearAxis } from '../../properties';
2
2
  /**
3
3
  * 柱状图类型定义
4
4
  * @description 柱状图,适用于纵向数据对比场景,X轴为类目轴(分类数据),Y轴为数值轴(连续数据),柱子纵向排列
@@ -96,4 +96,9 @@ export interface Column {
96
96
  * 若未配置selector, 则样式全局生效.
97
97
  */
98
98
  barStyle?: BarStyle;
99
+ /**
100
+ * 标注点
101
+ * @description 标注点配置, 根据选择的数据, 定义图表的标注点, 包括标注点的位置, 格式, 样式等.
102
+ */
103
+ annotationPoint?: AnnotationPoint | AnnotationPoint[];
99
104
  }
@@ -1,4 +1,4 @@
1
- import type { BackgroundColor, BarStyle, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XBandAxis, YLinearAxis } from '../../properties';
1
+ import type { AnnotationPoint, BackgroundColor, BarStyle, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XBandAxis, YLinearAxis } from '../../properties';
2
2
  /**
3
3
  * 并列柱状图类型定义
4
4
  * @description 并列柱状图,适用于多指标并行对比场景,多个柱子并列排列展示不同指标值
@@ -96,4 +96,9 @@ export interface ColumnParallel {
96
96
  * 若未配置selector, 则样式全局生效.
97
97
  */
98
98
  barStyle?: BarStyle;
99
+ /**
100
+ * 标注点
101
+ * @description 标注点配置, 根据选择的数据, 定义图表的标注点, 包括标注点的位置, 格式, 样式等.
102
+ */
103
+ annotationPoint?: AnnotationPoint | AnnotationPoint[];
99
104
  }
@@ -1,4 +1,4 @@
1
- import type { BackgroundColor, BarStyle, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XBandAxis, YLinearAxis } from '../../properties';
1
+ import type { AnnotationPoint, BackgroundColor, BarStyle, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XBandAxis, YLinearAxis } from '../../properties';
2
2
  /**
3
3
  * 百分比柱状图类型定义
4
4
  * @description 百分比柱状图,适用于展示各类别占比关系的场景,Y轴以百分比形式展示数据占比
@@ -96,4 +96,9 @@ export interface ColumnPercent {
96
96
  * 若未配置selector, 则样式全局生效.
97
97
  */
98
98
  barStyle?: BarStyle;
99
+ /**
100
+ * 标注点
101
+ * @description 标注点配置, 根据选择的数据, 定义图表的标注点, 包括标注点的位置, 格式, 样式等.
102
+ */
103
+ annotationPoint?: AnnotationPoint | AnnotationPoint[];
99
104
  }
@@ -1,4 +1,4 @@
1
- import type { BackgroundColor, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XBandAxis, YLinearAxis } from '../../properties';
1
+ import type { AnnotationPoint, BackgroundColor, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip, XBandAxis, YLinearAxis } from '../../properties';
2
2
  /**
3
3
  * 折线图类型定义
4
4
  * @description 折线图,适用于展示数据随时间或有序类别变化的趋势,通过线段连接数据点形成趋势线
@@ -87,4 +87,9 @@ export interface Line {
87
87
  * @example 'customThemeName'
88
88
  */
89
89
  theme?: Theme;
90
+ /**
91
+ * 标注点
92
+ * @description 标注点配置, 根据选择的数据, 定义图表的标注点, 包括标注点的位置, 格式, 样式等.
93
+ */
94
+ annotationPoint?: AnnotationPoint | AnnotationPoint[];
90
95
  }
@@ -0,0 +1,85 @@
1
+ import { z } from 'zod';
2
+ export declare const zAnnotation: z.ZodObject<{
3
+ annotationPoint: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
4
+ selector: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
5
+ field: z.ZodString;
6
+ operator: z.ZodString;
7
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
8
+ }, z.core.$strip>, z.ZodObject<{
9
+ field: z.ZodString;
10
+ operator: z.ZodString;
11
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
12
+ }, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
13
+ field: z.ZodString;
14
+ operator: z.ZodString;
15
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
16
+ }, z.core.$strip>, z.ZodObject<{
17
+ field: z.ZodString;
18
+ operator: z.ZodString;
19
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
20
+ }, z.core.$strip>]>>]>;
21
+ text: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>;
22
+ textColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
23
+ textFontSize: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
24
+ textFontWeight: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
25
+ textAlign: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
26
+ left: "left";
27
+ right: "right";
28
+ center: "center";
29
+ }>>>;
30
+ textBaseline: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
31
+ top: "top";
32
+ bottom: "bottom";
33
+ middle: "middle";
34
+ }>>>;
35
+ backgroundVisible: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
36
+ backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
37
+ backgroundBorderColor: z.ZodOptional<z.ZodString>;
38
+ backgroundBorderWidth: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
39
+ backgroundBorderRadius: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
40
+ backgroundPadding: z.ZodOptional<z.ZodNumber>;
41
+ offsetY: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
42
+ offsetX: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
43
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
44
+ selector: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
45
+ field: z.ZodString;
46
+ operator: z.ZodString;
47
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ field: z.ZodString;
50
+ operator: z.ZodString;
51
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
52
+ }, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
53
+ field: z.ZodString;
54
+ operator: z.ZodString;
55
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
56
+ }, z.core.$strip>, z.ZodObject<{
57
+ field: z.ZodString;
58
+ operator: z.ZodString;
59
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
60
+ }, z.core.$strip>]>>]>;
61
+ text: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>;
62
+ textColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
63
+ textFontSize: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
64
+ textFontWeight: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
65
+ textAlign: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
66
+ left: "left";
67
+ right: "right";
68
+ center: "center";
69
+ }>>>;
70
+ textBaseline: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
71
+ top: "top";
72
+ bottom: "bottom";
73
+ middle: "middle";
74
+ }>>>;
75
+ backgroundVisible: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
76
+ backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
77
+ backgroundBorderColor: z.ZodOptional<z.ZodString>;
78
+ backgroundBorderWidth: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
79
+ backgroundBorderRadius: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
80
+ backgroundPadding: z.ZodOptional<z.ZodNumber>;
81
+ offsetY: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
82
+ offsetX: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
83
+ }, z.core.$strip>>]>>;
84
+ }, z.core.$strip>;
85
+ export type Annotation = z.infer<typeof zAnnotation>;
@@ -0,0 +1,147 @@
1
+ import { type Selector, type Selectors } from '../../dataSelector';
2
+ import { z } from 'zod';
3
+ export type AnnotationPoint = {
4
+ /**
5
+ * 依赖选择的数据, 进行数据标记.
6
+ */
7
+ selector: Selector | Selectors;
8
+ /**
9
+ * 标注的文本
10
+ * @description 标注的文本
11
+ * @default ''
12
+ * @example '标注文本'
13
+ */
14
+ text?: string | string[];
15
+ /**
16
+ * 文本颜色
17
+ * @description 文本颜色
18
+ * @default '#ffffff'
19
+ * @example 'red'
20
+ */
21
+ textColor?: string;
22
+ /**
23
+ * 文本字体大小
24
+ * @description 文本字体大小
25
+ * @default 12
26
+ * @example 12
27
+ */
28
+ textFontSize?: number;
29
+ /**
30
+ * 文本字体重量
31
+ * @description 文本字体重量
32
+ * @default 400
33
+ * @example 400
34
+ */
35
+ textFontWeight?: number;
36
+ /**
37
+ * 文本对齐方式
38
+ * @description 文本对齐方式
39
+ * @default 'left'
40
+ * @example 'left'
41
+ */
42
+ textAlign?: 'left' | 'right' | 'center';
43
+ /**
44
+ * 文本垂直对齐方式
45
+ * @description 文本垂直对齐方式
46
+ * @default 'middle'
47
+ * @example 'middle'
48
+ */
49
+ textBaseline?: 'top' | 'middle' | 'bottom';
50
+ /**
51
+ * 文本Y方向的, 偏移量
52
+ * @description 文本Y方向的, 偏移量, 支持正负
53
+ * @default 0
54
+ * @example offsetY: 10
55
+ */
56
+ offsetY?: number;
57
+ /**
58
+ * 文本X方向的, 偏移量
59
+ * @description 文本X方向的, 偏移量, 支持正负
60
+ * @default 0
61
+ * @example offsetX: -10
62
+ */
63
+ offsetX?: number;
64
+ /**
65
+ * 背景可见
66
+ * @description 背景可见
67
+ * @default true
68
+ * @example true
69
+ */
70
+ backgroundVisible?: boolean;
71
+ /**
72
+ * 背景颜色
73
+ * @description 背景颜色
74
+ * @default '#212121'
75
+ * @example 'red'
76
+ */
77
+ backgroundColor?: string;
78
+ /**
79
+ * 背景边框颜色
80
+ * @description 背景边框颜色
81
+ * @default 'red'
82
+ * @example 'red'
83
+ */
84
+ backgroundBorderColor?: string;
85
+ /**
86
+ * 背景边框宽度
87
+ * @description 背景边框宽度
88
+ * @default 1
89
+ * @example 2
90
+ */
91
+ backgroundBorderWidth?: number;
92
+ /**
93
+ * 背景边框圆角
94
+ * @description 背景边框圆角
95
+ * @default 4
96
+ * @example 4
97
+ */
98
+ backgroundBorderRadius?: number;
99
+ /**
100
+ * 背景内边距
101
+ * @description 背景内边距
102
+ * @default 4
103
+ * @example 4
104
+ */
105
+ backgroundPadding?: number;
106
+ };
107
+ export declare const zAnnotationPoint: z.ZodObject<{
108
+ selector: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
109
+ field: z.ZodString;
110
+ operator: z.ZodString;
111
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
112
+ }, z.core.$strip>, z.ZodObject<{
113
+ field: z.ZodString;
114
+ operator: z.ZodString;
115
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
116
+ }, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
117
+ field: z.ZodString;
118
+ operator: z.ZodString;
119
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
120
+ }, z.core.$strip>, z.ZodObject<{
121
+ field: z.ZodString;
122
+ operator: z.ZodString;
123
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
124
+ }, z.core.$strip>]>>]>;
125
+ text: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>;
126
+ textColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
127
+ textFontSize: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
128
+ textFontWeight: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
129
+ textAlign: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
130
+ left: "left";
131
+ right: "right";
132
+ center: "center";
133
+ }>>>;
134
+ textBaseline: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
135
+ top: "top";
136
+ bottom: "bottom";
137
+ middle: "middle";
138
+ }>>>;
139
+ backgroundVisible: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
140
+ backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
141
+ backgroundBorderColor: z.ZodOptional<z.ZodString>;
142
+ backgroundBorderWidth: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
143
+ backgroundBorderRadius: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
144
+ backgroundPadding: z.ZodOptional<z.ZodNumber>;
145
+ offsetY: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
146
+ offsetX: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
147
+ }, z.core.$strip>;
@@ -0,0 +1,2 @@
1
+ export * from './annotationPoint';
2
+ export * from './annotation';
@@ -8,3 +8,4 @@ export * from './baseConfig';
8
8
  export * from './config';
9
9
  export * from './theme';
10
10
  export * from './markStyle';
11
+ export * from './annotation';
@@ -1,5 +1,5 @@
1
- import { type Selector, type Selectors } from '../../dataSelector';
2
1
  import { z } from 'zod';
2
+ import { type Selector, type Selectors } from '../../dataSelector';
3
3
  export type BarStyle = {
4
4
  /**
5
5
  * 数据选择器
@@ -88,7 +88,7 @@ export type BarStyle = {
88
88
  barRadius?: number | number[];
89
89
  };
90
90
  export declare const zBarStyle: z.ZodObject<{
91
- selector: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
91
+ selector: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
92
92
  field: z.ZodString;
93
93
  operator: z.ZodString;
94
94
  value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
@@ -104,11 +104,11 @@ export declare const zBarStyle: z.ZodObject<{
104
104
  field: z.ZodString;
105
105
  operator: z.ZodString;
106
106
  value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
107
- }, z.core.$strip>]>>]>;
108
- barColor: z.ZodString;
109
- barColorOpacity: z.ZodNumber;
110
- barBorderColor: z.ZodString;
111
- barBorderWidth: z.ZodNumber;
112
- barBorderStyle: z.ZodUnion<readonly [z.ZodLiteral<"solid">, z.ZodLiteral<"dashed">, z.ZodLiteral<"dotted">]>;
113
- barRadius: z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>;
107
+ }, z.core.$strip>]>>]>>;
108
+ barColor: z.ZodOptional<z.ZodString>;
109
+ barColorOpacity: z.ZodOptional<z.ZodNumber>;
110
+ barBorderColor: z.ZodOptional<z.ZodString>;
111
+ barBorderWidth: z.ZodOptional<z.ZodNumber>;
112
+ barBorderStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"solid">, z.ZodLiteral<"dashed">, z.ZodLiteral<"dotted">]>>;
113
+ barRadius: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>;
114
114
  }, z.core.$strip>;
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export declare const zMarkStyle: z.ZodObject<{
3
3
  barStyle: z.ZodOptional<z.ZodObject<{
4
- selector: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
4
+ selector: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodObject<{
5
5
  field: z.ZodString;
6
6
  operator: z.ZodString;
7
7
  value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
@@ -17,13 +17,13 @@ export declare const zMarkStyle: z.ZodObject<{
17
17
  field: z.ZodString;
18
18
  operator: z.ZodString;
19
19
  value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>;
20
- }, z.core.$strip>]>>]>;
21
- barColor: z.ZodString;
22
- barColorOpacity: z.ZodNumber;
23
- barBorderColor: z.ZodString;
24
- barBorderWidth: z.ZodNumber;
25
- barBorderStyle: z.ZodUnion<readonly [z.ZodLiteral<"solid">, z.ZodLiteral<"dashed">, z.ZodLiteral<"dotted">]>;
26
- barRadius: z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>;
20
+ }, z.core.$strip>]>>]>>;
21
+ barColor: z.ZodOptional<z.ZodString>;
22
+ barColorOpacity: z.ZodOptional<z.ZodNumber>;
23
+ barBorderColor: z.ZodOptional<z.ZodString>;
24
+ barBorderWidth: z.ZodOptional<z.ZodNumber>;
25
+ barBorderStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"solid">, z.ZodLiteral<"dashed">, z.ZodLiteral<"dotted">]>>;
26
+ barRadius: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>;
27
27
  }, z.core.$strip>>;
28
28
  }, z.core.$strip>;
29
29
  export type MarkStyle = z.infer<typeof zMarkStyle>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vseed",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {