@visactor/vseed 0.0.3 → 0.0.5
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.
- package/dist/builder/builder/buildAdvanced.d.ts +1 -1
- package/dist/builder/builder/buildSpec.d.ts +1 -1
- package/dist/builder/builder/builder.d.ts +387 -7
- package/dist/builder/register/all.d.ts +1 -0
- package/dist/builder/register/index.d.ts +3 -1
- package/dist/builder/register/theme.d.ts +4 -0
- package/dist/dataReshape/dataReshapeFor1D1M.d.ts +1 -1
- package/dist/dataReshape/dataReshapeFor2D1M.d.ts +1 -1
- package/dist/dataReshape/foldMeasures.d.ts +2 -2
- package/dist/dataReshape/unfoldDimensions.d.ts +2 -2
- package/dist/index.cjs +691 -265
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +446 -80
- package/dist/index.js.map +1 -0
- package/dist/pipeline/advanced/pipeline/area.d.ts +1 -1
- package/dist/pipeline/advanced/pipeline/areaPercent.d.ts +1 -1
- package/dist/pipeline/advanced/pipeline/bar.d.ts +1 -1
- package/dist/pipeline/advanced/pipeline/barParallel.d.ts +1 -1
- package/dist/pipeline/advanced/pipeline/barPercent.d.ts +1 -1
- package/dist/pipeline/advanced/pipeline/column.d.ts +1 -1
- package/dist/pipeline/advanced/pipeline/columnParallel.d.ts +1 -1
- package/dist/pipeline/advanced/pipeline/columnPercent.d.ts +1 -1
- package/dist/pipeline/advanced/pipeline/line.d.ts +1 -1
- package/dist/pipeline/advanced/pipes/baseConfig/baseConfig.d.ts +3 -0
- package/dist/pipeline/advanced/pipes/baseConfig/index.d.ts +1 -0
- package/dist/pipeline/advanced/pipes/encoding/encodingCartesian.d.ts +1 -1
- package/dist/pipeline/advanced/pipes/index.d.ts +2 -0
- package/dist/pipeline/advanced/pipes/init/autoDimensions.d.ts +2 -0
- package/dist/pipeline/advanced/pipes/init/autoMeasures.d.ts +2 -0
- package/dist/pipeline/advanced/pipes/init/index.d.ts +2 -0
- package/dist/pipeline/advanced/pipes/init/initAdvancedVSeed.d.ts +1 -1
- package/dist/pipeline/advanced/pipes/init/utils.d.ts +1 -0
- package/dist/pipeline/advanced/pipes/reshape/reshapeTo1D1M.d.ts +1 -1
- package/dist/pipeline/advanced/pipes/reshape/reshapeTo2D1M.d.ts +1 -1
- package/dist/pipeline/advanced/pipes/theme/index.d.ts +1 -0
- package/dist/pipeline/advanced/pipes/theme/theme.d.ts +3 -0
- package/dist/pipeline/spec/pipeline/area.d.ts +1 -1
- package/dist/pipeline/spec/pipeline/areaPercent.d.ts +1 -1
- package/dist/pipeline/spec/pipeline/bar.d.ts +1 -1
- package/dist/pipeline/spec/pipeline/barParallel.d.ts +1 -1
- package/dist/pipeline/spec/pipeline/barPercent.d.ts +1 -1
- package/dist/pipeline/spec/pipeline/column.d.ts +1 -1
- package/dist/pipeline/spec/pipeline/columnParallel.d.ts +1 -1
- package/dist/pipeline/spec/pipeline/columnPercent.d.ts +1 -1
- package/dist/pipeline/spec/pipeline/line.d.ts +1 -1
- package/dist/pipeline/spec/pipes/axes/xBand.d.ts +1 -1
- package/dist/pipeline/spec/pipes/axes/xLinear.d.ts +1 -1
- package/dist/pipeline/spec/pipes/axes/yBand.d.ts +1 -1
- package/dist/pipeline/spec/pipes/axes/yLinear.d.ts +1 -1
- package/dist/pipeline/spec/pipes/backgroundColor/background.d.ts +2 -0
- package/dist/pipeline/spec/pipes/backgroundColor/index.d.ts +1 -0
- package/dist/pipeline/spec/pipes/color/color.d.ts +2 -0
- package/dist/pipeline/spec/pipes/color/index.d.ts +1 -0
- package/dist/pipeline/spec/pipes/dataset/dataset.d.ts +1 -1
- package/dist/pipeline/spec/pipes/index.d.ts +5 -0
- package/dist/pipeline/spec/pipes/init/area.d.ts +1 -1
- package/dist/pipeline/spec/pipes/init/bar.d.ts +1 -1
- package/dist/pipeline/spec/pipes/init/barParallel.d.ts +1 -1
- package/dist/pipeline/spec/pipes/init/column.d.ts +1 -1
- package/dist/pipeline/spec/pipes/init/columnParallel.d.ts +1 -1
- package/dist/pipeline/spec/pipes/init/line.d.ts +1 -1
- package/dist/pipeline/spec/pipes/label/index.d.ts +1 -0
- package/dist/pipeline/spec/pipes/label/label.d.ts +2 -0
- package/dist/pipeline/spec/pipes/legend/index.d.ts +1 -0
- package/dist/pipeline/spec/pipes/legend/legend.d.ts +2 -0
- package/dist/pipeline/spec/pipes/percent/percent.d.ts +1 -1
- package/dist/pipeline/spec/pipes/stack/stack.d.ts +1 -1
- package/dist/pipeline/spec/pipes/tooltip/index.d.ts +1 -0
- package/dist/pipeline/spec/pipes/tooltip/tooltip.d.ts +2 -0
- package/dist/pipeline/utils/chatType.d.ts +3 -0
- package/dist/pipeline/utils/index.d.ts +1 -0
- package/dist/pipeline/utils/pipeline.d.ts +1 -1
- package/dist/theme/dark.d.ts +2 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/light.d.ts +2 -0
- package/dist/types/{properties/advancedVSeed.d.ts → advancedVSeed.d.ts} +53 -8
- package/dist/types/builder/builder.d.ts +10 -3
- package/dist/types/chartType/area/area.d.ts +38 -3
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +38 -3
- package/dist/types/chartType/bar/bar.d.ts +38 -3
- package/dist/types/chartType/barParallel/barParallel.d.ts +38 -3
- package/dist/types/chartType/barPercent/barPercent.d.ts +38 -3
- package/dist/types/chartType/column/column.d.ts +38 -3
- package/dist/types/chartType/columnParallel/columnParallel.d.ts +38 -3
- package/dist/types/chartType/columnPercent/columnPercent.d.ts +38 -3
- package/dist/types/chartType/donut/donut.d.ts +38 -3
- package/dist/types/chartType/dualAxis/dualAxis.d.ts +38 -3
- package/dist/types/chartType/index.d.ts +1 -1
- package/dist/types/chartType/line/line.d.ts +38 -3
- package/dist/types/chartType/pie/pie.d.ts +38 -3
- package/dist/types/chartType/pivotTable/pivotTable.d.ts +18 -3
- package/dist/types/chartType/rose/rose.d.ts +38 -3
- package/dist/types/chartType/table/table.d.ts +18 -3
- package/dist/types/index.d.ts +2 -0
- package/dist/types/pipeline/advancedVSeed/advancedVSeed.d.ts +4 -1
- package/dist/types/pipeline/spec/spec.d.ts +2 -1
- package/dist/types/properties/baseConfig/backgroundColor.d.ts +8 -0
- package/dist/types/properties/baseConfig/baseConfig.d.ts +44 -0
- package/dist/types/properties/baseConfig/color.d.ts +23 -0
- package/dist/types/properties/baseConfig/index.d.ts +12 -0
- package/dist/types/properties/baseConfig/label.d.ts +11 -0
- package/dist/types/properties/baseConfig/legend.d.ts +11 -0
- package/dist/types/properties/baseConfig/tooltip.d.ts +11 -0
- package/dist/types/properties/chartType/zChartType.d.ts +8 -8
- package/dist/types/properties/index.d.ts +2 -2
- package/dist/types/properties/theme/customTheme.d.ts +49 -0
- package/dist/types/properties/theme/index.d.ts +4 -0
- package/dist/types/properties/theme/theme.d.ts +15 -0
- package/dist/types/{properties/vseed.d.ts → vseed.d.ts} +25 -18
- package/package.json +2 -1
- package/dist/types/chartType/vseedDSL.d.ts +0 -16
- /package/dist/builder/register/{register.d.ts → chartType.d.ts} +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Dataset, Dimensions, Measures } from '
|
1
|
+
import type { BackgroundColor, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip } from '../..';
|
2
2
|
/**
|
3
3
|
* 饼图类型定义
|
4
4
|
* @description 饼图,适用于展示单一维度数据的占比关系,通过扇形面积大小表示各类别占比
|
@@ -34,12 +34,47 @@ export interface Pie {
|
|
34
34
|
* @type {Dimensions}
|
35
35
|
* @example [{id: 'category', alias: '类别'}]
|
36
36
|
*/
|
37
|
-
dimensions
|
37
|
+
dimensions?: Dimensions;
|
38
38
|
/**
|
39
39
|
* 指标
|
40
40
|
* @description 饼图的所有指标会自动合并为一个指标, 映射到半径轴, 存在多个指标时, 指标名称会与其余维度合并, 作为图例项展示.
|
41
41
|
* @type {Measures}
|
42
42
|
* @example [{id: 'value', alias: '数值占比', format: 'percent'}]
|
43
43
|
*/
|
44
|
-
measures
|
44
|
+
measures?: Measures;
|
45
|
+
/**
|
46
|
+
* 图表的背景颜色
|
47
|
+
* @default transparent 默认为透明背景
|
48
|
+
* @description 背景颜色可以是颜色字符串, 例如'red', 'blue', 也可以是hex, rgb或rgba'#ff0000', 'rgba(255,0,0,0.5)'
|
49
|
+
*/
|
50
|
+
backgroundColor?: BackgroundColor;
|
51
|
+
/**
|
52
|
+
* 颜色
|
53
|
+
* @description 颜色配置, 用于定义图表的颜色方案, 包括颜色列表, 颜色映射, 颜色渐变等.
|
54
|
+
*/
|
55
|
+
color?: Color;
|
56
|
+
/**
|
57
|
+
* 标签
|
58
|
+
* @description 标签配置, 用于定义图表的数据标签, 包括数据标签的位置, 格式, 样式等.
|
59
|
+
*/
|
60
|
+
label?: Label;
|
61
|
+
/**
|
62
|
+
* 图例
|
63
|
+
* @description 图例配置, 用于定义图表的图例, 包括图例的位置, 格式, 样式等.
|
64
|
+
*/
|
65
|
+
legend?: Legend;
|
66
|
+
/**
|
67
|
+
* 提示信息
|
68
|
+
* @description 提示信息配置, 用于定义图表的提示信息, 包括提示信息的位置, 格式, 样式等.
|
69
|
+
*/
|
70
|
+
tooltip?: Tooltip;
|
71
|
+
/**
|
72
|
+
* 图表的主题, 主题是优先级较低的功能配置, 包含所有图表类型共用的通用配置, 与单类图表类型共用的图表配置
|
73
|
+
* @default light 默认为亮色主题
|
74
|
+
* @description 内置light与dark两种主题, 用户可以通过Builder自定义主题
|
75
|
+
* @example 'dark'
|
76
|
+
* @example 'light'
|
77
|
+
* @example 'customThemeName'
|
78
|
+
*/
|
79
|
+
theme?: Theme;
|
45
80
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Dataset, Dimensions, Measures } from '
|
1
|
+
import type { BackgroundColor, Dataset, Dimensions, Measures, Theme } from '../..';
|
2
2
|
/**
|
3
3
|
* 透视表类型定义
|
4
4
|
* @description 透视表,适用于多维度数据交叉分析场景,可灵活配置行、列维度和指标计算方式
|
@@ -34,12 +34,27 @@ export interface PivotTable {
|
|
34
34
|
* @type {Dimensions}
|
35
35
|
* @example [{id: 'region', alias: '地区', isRow: true}, {id: 'product', alias: '产品', isColumn: true}]
|
36
36
|
*/
|
37
|
-
dimensions
|
37
|
+
dimensions?: Dimensions;
|
38
38
|
/**
|
39
39
|
* 指标
|
40
40
|
* @description 透视表支持多个维度指标
|
41
41
|
* @type {Measures}
|
42
42
|
* @example [{id: 'sales', alias: '销售额', aggregation: 'sum'}]
|
43
43
|
*/
|
44
|
-
measures
|
44
|
+
measures?: Measures;
|
45
|
+
/**
|
46
|
+
* 图表的背景颜色
|
47
|
+
* @default transparent 默认为透明背景
|
48
|
+
* @description 背景颜色可以是颜色字符串, 例如'red', 'blue', 也可以是hex, rgb或rgba'#ff0000', 'rgba(255,0,0,0.5)'
|
49
|
+
*/
|
50
|
+
backgroundColor?: BackgroundColor;
|
51
|
+
/**
|
52
|
+
* 图表的主题, 主题是优先级较低的功能配置, 包含所有图表类型共用的通用配置, 与单类图表类型共用的图表配置
|
53
|
+
* @default light 默认为亮色主题
|
54
|
+
* @description 内置light与dark两种主题, 用户可以通过Builder自定义主题
|
55
|
+
* @example 'dark'
|
56
|
+
* @example 'light'
|
57
|
+
* @example 'customThemeName'
|
58
|
+
*/
|
59
|
+
theme?: Theme;
|
45
60
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Dataset, Dimensions, Measures } from '
|
1
|
+
import type { BackgroundColor, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip } from '../..';
|
2
2
|
/**
|
3
3
|
* 玫瑰图类型定义
|
4
4
|
* @description 玫瑰图,适用于多维度数据对比场景,通过极坐标系下的扇形弧度和半径展示数据大小
|
@@ -34,12 +34,47 @@ export interface Rose {
|
|
34
34
|
* @type {Dimensions}
|
35
35
|
* @example [{id: 'category', alias: '类别'}]
|
36
36
|
*/
|
37
|
-
dimensions
|
37
|
+
dimensions?: Dimensions;
|
38
38
|
/**
|
39
39
|
* 指标
|
40
40
|
* @description 玫瑰图的指标会自动合并为一个指标, 映射到半径轴, 存在多个指标时, 指标名称会与其余维度合并, 作为图例项展示.
|
41
41
|
* @type {Measures}
|
42
42
|
* @example [{id: 'value', alias: '数值'}]
|
43
43
|
*/
|
44
|
-
measures
|
44
|
+
measures?: Measures;
|
45
|
+
/**
|
46
|
+
* 图表的背景颜色
|
47
|
+
* @default transparent 默认为透明背景
|
48
|
+
* @description 背景颜色可以是颜色字符串, 例如'red', 'blue', 也可以是hex, rgb或rgba'#ff0000', 'rgba(255,0,0,0.5)'
|
49
|
+
*/
|
50
|
+
backgroundColor?: BackgroundColor;
|
51
|
+
/**
|
52
|
+
* 颜色
|
53
|
+
* @description 颜色配置, 用于定义图表的颜色方案, 包括颜色列表, 颜色映射, 颜色渐变等.
|
54
|
+
*/
|
55
|
+
color?: Color;
|
56
|
+
/**
|
57
|
+
* 标签
|
58
|
+
* @description 标签配置, 用于定义图表的数据标签, 包括数据标签的位置, 格式, 样式等.
|
59
|
+
*/
|
60
|
+
label?: Label;
|
61
|
+
/**
|
62
|
+
* 图例
|
63
|
+
* @description 图例配置, 用于定义图表的图例, 包括图例的位置, 格式, 样式等.
|
64
|
+
*/
|
65
|
+
legend?: Legend;
|
66
|
+
/**
|
67
|
+
* 提示信息
|
68
|
+
* @description 提示信息配置, 用于定义图表的提示信息, 包括提示信息的位置, 格式, 样式等.
|
69
|
+
*/
|
70
|
+
tooltip?: Tooltip;
|
71
|
+
/**
|
72
|
+
* 图表的主题, 主题是优先级较低的功能配置, 包含所有图表类型共用的通用配置, 与单类图表类型共用的图表配置
|
73
|
+
* @default light 默认为亮色主题
|
74
|
+
* @description 内置light与dark两种主题, 用户可以通过Builder自定义主题
|
75
|
+
* @example 'dark'
|
76
|
+
* @example 'light'
|
77
|
+
* @example 'customThemeName'
|
78
|
+
*/
|
79
|
+
theme?: Theme;
|
45
80
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Dataset, Dimensions, Measures } from '
|
1
|
+
import type { BackgroundColor, Dataset, Dimensions, Measures, Theme } from '../..';
|
2
2
|
/**
|
3
3
|
* 表格类型定义
|
4
4
|
* @description 表格,适用于详细数据展示场景,行列分明,便于查看具体数值
|
@@ -34,12 +34,27 @@ export interface Table {
|
|
34
34
|
* @type {Dimensions}
|
35
35
|
* @example [{id: "name", alias: "名称"}]
|
36
36
|
*/
|
37
|
-
dimensions
|
37
|
+
dimensions?: Dimensions;
|
38
38
|
/**
|
39
39
|
* 指标
|
40
40
|
* @description 表格的每个指标会对应一行, 并且天生支持指标组合.
|
41
41
|
* @type {Measures}
|
42
42
|
* @example [{id: "value", alias: "数值"}]
|
43
43
|
*/
|
44
|
-
measures
|
44
|
+
measures?: Measures;
|
45
|
+
/**
|
46
|
+
* 图表的背景颜色
|
47
|
+
* @default transparent 默认为透明背景
|
48
|
+
* @description 背景颜色可以是颜色字符串, 例如'red', 'blue', 也可以是hex, rgb或rgba'#ff0000', 'rgba(255,0,0,0.5)'
|
49
|
+
*/
|
50
|
+
backgroundColor?: BackgroundColor;
|
51
|
+
/**
|
52
|
+
* 图表的主题, 主题是优先级较低的功能配置, 包含所有图表类型共用的通用配置, 与单类图表类型共用的图表配置
|
53
|
+
* @default light 默认为亮色主题
|
54
|
+
* @description 内置light与dark两种主题, 用户可以通过Builder自定义主题
|
55
|
+
* @example 'dark'
|
56
|
+
* @example 'light'
|
57
|
+
* @example 'customThemeName'
|
58
|
+
*/
|
59
|
+
theme?: Theme;
|
45
60
|
}
|
package/dist/types/index.d.ts
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
-
import type { AdvancedVSeed
|
1
|
+
import type { AdvancedVSeed } from '../../advancedVSeed';
|
2
|
+
import type { VSeed } from '../../chartType';
|
3
|
+
import type { CustomTheme } from '../../properties';
|
2
4
|
import type { Pipe } from '../pipeline';
|
3
5
|
export type AdvancedPipelineContext = {
|
4
6
|
vseed: VSeed;
|
7
|
+
customTheme?: CustomTheme;
|
5
8
|
};
|
6
9
|
export type AdvancedPipe = Pipe<AdvancedVSeed, AdvancedPipelineContext>;
|
7
10
|
export type AdvancedPipeline = Pipe<AdvancedVSeed, AdvancedPipelineContext>[];
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { ISpec } from '@visactor/vchart';
|
2
|
-
import type { AdvancedVSeed, VSeed } from '../../properties';
|
3
2
|
import type { Pipe } from '../pipeline';
|
3
|
+
import type { VSeed } from '../../chartType';
|
4
|
+
import type { AdvancedVSeed } from '../../advancedVSeed';
|
4
5
|
export type SpecPipelineContext = {
|
5
6
|
vseed: VSeed;
|
6
7
|
advancedVSeed: AdvancedVSeed;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const zBackgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
3
|
+
/**
|
4
|
+
* 图表的背景颜色
|
5
|
+
* @default transparent 默认为透明背景
|
6
|
+
* @description 背景颜色可以是颜色字符串, 例如'red', 'blue', 也可以是hex, rgb或rgba'#ff0000', 'rgba(255,0,0,0.5)'
|
7
|
+
*/
|
8
|
+
export type BackgroundColor = string | undefined;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
declare const zVChartBaseConfig: z.ZodObject<{
|
3
|
+
backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
4
|
+
label: z.ZodOptional<z.ZodObject<{
|
5
|
+
enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
6
|
+
}, z.core.$strip>>;
|
7
|
+
color: z.ZodOptional<z.ZodObject<{
|
8
|
+
colorScheme: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
9
|
+
colorMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
10
|
+
}, z.core.$strip>>;
|
11
|
+
tooltip: z.ZodOptional<z.ZodObject<{
|
12
|
+
enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
13
|
+
}, z.core.$strip>>;
|
14
|
+
legend: z.ZodOptional<z.ZodObject<{
|
15
|
+
enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
16
|
+
}, z.core.$strip>>;
|
17
|
+
}, z.core.$strip>;
|
18
|
+
declare const zVTableBaseConfig: z.ZodObject<{
|
19
|
+
backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
20
|
+
}, z.core.$strip>;
|
21
|
+
export declare const zBaseConfig: z.ZodObject<{
|
22
|
+
vchart: z.ZodOptional<z.ZodObject<{
|
23
|
+
backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
24
|
+
label: z.ZodOptional<z.ZodObject<{
|
25
|
+
enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
26
|
+
}, z.core.$strip>>;
|
27
|
+
color: z.ZodOptional<z.ZodObject<{
|
28
|
+
colorScheme: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
29
|
+
colorMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
30
|
+
}, z.core.$strip>>;
|
31
|
+
tooltip: z.ZodOptional<z.ZodObject<{
|
32
|
+
enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
33
|
+
}, z.core.$strip>>;
|
34
|
+
legend: z.ZodOptional<z.ZodObject<{
|
35
|
+
enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
36
|
+
}, z.core.$strip>>;
|
37
|
+
}, z.core.$strip>>;
|
38
|
+
vtable: z.ZodOptional<z.ZodObject<{
|
39
|
+
backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
40
|
+
}, z.core.$strip>>;
|
41
|
+
}, z.core.$strip>;
|
42
|
+
export type VTableBaseConfig = z.infer<typeof zVTableBaseConfig>;
|
43
|
+
export type VChartBaseConfig = z.infer<typeof zVChartBaseConfig>;
|
44
|
+
export {};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const zColor: z.ZodObject<{
|
3
|
+
colorScheme: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
4
|
+
colorMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
5
|
+
}, z.core.$strip>;
|
6
|
+
export type Color = {
|
7
|
+
/**
|
8
|
+
* 颜色配色方案
|
9
|
+
* @description 颜色配色方案用于定义图表中不同元素的颜色
|
10
|
+
* @example ['#FFCDD2,#F8BBD0,#E1BEE7,#D1C4E9,#C5CAE9,#BBDEFB,#B3E5FC,#B2EBF2,#B2DFDB,#C8E6C9,#DCEDC8,#F0F4C3,#FFF9C4,#FFECB3,#FFE0B2']
|
11
|
+
*/
|
12
|
+
colorScheme: string[];
|
13
|
+
/**
|
14
|
+
* 颜色映射
|
15
|
+
* @description 颜色映射用于将数据值映射到具体的颜色
|
16
|
+
* @example
|
17
|
+
* {
|
18
|
+
* 'profit': 'red',
|
19
|
+
* 'sales': 'blue',
|
20
|
+
* }
|
21
|
+
*/
|
22
|
+
colorMapping: Record<string, string>;
|
23
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export type { VTableBaseConfig, VChartBaseConfig } from './baseConfig';
|
2
|
+
export { zBackgroundColor } from './backgroundColor';
|
3
|
+
export type { BackgroundColor } from './backgroundColor';
|
4
|
+
export { zBaseConfig } from './baseConfig';
|
5
|
+
export type { Color } from './color';
|
6
|
+
export { zColor } from './color';
|
7
|
+
export type { Label } from './label';
|
8
|
+
export { zLabel } from './label';
|
9
|
+
export type { Legend } from './legend';
|
10
|
+
export { zLegend } from './legend';
|
11
|
+
export type { Tooltip } from './tooltip';
|
12
|
+
export { zTooltip } from './tooltip';
|
@@ -18,19 +18,19 @@ export declare enum ChartTypeEnum {
|
|
18
18
|
DualAxis = "dualAxis"
|
19
19
|
}
|
20
20
|
export declare const zChartType: z.ZodEnum<{
|
21
|
-
|
21
|
+
table: "table";
|
22
|
+
pivotTable: "pivotTable";
|
22
23
|
line: "line";
|
23
|
-
bar: "bar";
|
24
|
-
pie: "pie";
|
25
|
-
rose: "rose";
|
26
24
|
column: "column";
|
27
|
-
areaPercent: "areaPercent";
|
28
|
-
barPercent: "barPercent";
|
29
25
|
columnPercent: "columnPercent";
|
30
26
|
columnParallel: "columnParallel";
|
27
|
+
bar: "bar";
|
28
|
+
barPercent: "barPercent";
|
31
29
|
barParallel: "barParallel";
|
32
|
-
|
33
|
-
|
30
|
+
area: "area";
|
31
|
+
areaPercent: "areaPercent";
|
32
|
+
rose: "rose";
|
33
|
+
pie: "pie";
|
34
34
|
donut: "donut";
|
35
35
|
dualAxis: "dualAxis";
|
36
36
|
}>;
|
@@ -2,7 +2,7 @@ export * from './chartType';
|
|
2
2
|
export * from './dataset';
|
3
3
|
export * from './dimensions';
|
4
4
|
export * from './measures';
|
5
|
-
export * from './vseed';
|
6
|
-
export * from './advancedVSeed';
|
7
5
|
export * from './datasetReshapeInfo';
|
8
6
|
export * from './encoding';
|
7
|
+
export * from './baseConfig';
|
8
|
+
export * from './theme';
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const zCustomThemeConfig: z.ZodObject<{
|
3
|
+
baseConfig: z.ZodOptional<z.ZodObject<{
|
4
|
+
vchart: z.ZodOptional<z.ZodObject<{
|
5
|
+
backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
6
|
+
label: z.ZodOptional<z.ZodObject<{
|
7
|
+
enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
8
|
+
}, z.core.$strip>>;
|
9
|
+
color: z.ZodOptional<z.ZodObject<{
|
10
|
+
colorScheme: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
11
|
+
colorMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
12
|
+
}, z.core.$strip>>;
|
13
|
+
tooltip: z.ZodOptional<z.ZodObject<{
|
14
|
+
enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
15
|
+
}, z.core.$strip>>;
|
16
|
+
legend: z.ZodOptional<z.ZodObject<{
|
17
|
+
enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
18
|
+
}, z.core.$strip>>;
|
19
|
+
}, z.core.$strip>>;
|
20
|
+
vtable: z.ZodOptional<z.ZodObject<{
|
21
|
+
backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
22
|
+
}, z.core.$strip>>;
|
23
|
+
}, z.core.$strip>>;
|
24
|
+
}, z.core.$strip>;
|
25
|
+
export declare const zCustomTheme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
26
|
+
baseConfig: z.ZodOptional<z.ZodObject<{
|
27
|
+
vchart: z.ZodOptional<z.ZodObject<{
|
28
|
+
backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
29
|
+
label: z.ZodOptional<z.ZodObject<{
|
30
|
+
enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
31
|
+
}, z.core.$strip>>;
|
32
|
+
color: z.ZodOptional<z.ZodObject<{
|
33
|
+
colorScheme: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
34
|
+
colorMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
35
|
+
}, z.core.$strip>>;
|
36
|
+
tooltip: z.ZodOptional<z.ZodObject<{
|
37
|
+
enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
38
|
+
}, z.core.$strip>>;
|
39
|
+
legend: z.ZodOptional<z.ZodObject<{
|
40
|
+
enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
41
|
+
}, z.core.$strip>>;
|
42
|
+
}, z.core.$strip>>;
|
43
|
+
vtable: z.ZodOptional<z.ZodObject<{
|
44
|
+
backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
45
|
+
}, z.core.$strip>>;
|
46
|
+
}, z.core.$strip>>;
|
47
|
+
}, z.core.$strip>>>;
|
48
|
+
export type CustomTheme = z.infer<typeof zCustomTheme>;
|
49
|
+
export type CustomThemeConfig = z.infer<typeof zCustomThemeConfig>;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const zTheme: z.ZodString;
|
3
|
+
type Light = 'light' & {
|
4
|
+
readonly brand: unique symbol;
|
5
|
+
};
|
6
|
+
type Dark = 'dark' & {
|
7
|
+
readonly brand: unique symbol;
|
8
|
+
};
|
9
|
+
/**
|
10
|
+
* 主题
|
11
|
+
* @default light
|
12
|
+
* @description 内置 light、dark 两种主题, 新的主题可以通过registerTheme自定义主题.
|
13
|
+
*/
|
14
|
+
export type Theme = Light | Dark | string;
|
15
|
+
export {};
|
@@ -1,23 +1,35 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
import type {
|
5
|
-
import type {
|
2
|
+
import type { Bar } from './chartType/bar';
|
3
|
+
import type { BarParallel } from './chartType/barParallel';
|
4
|
+
import type { Column } from './chartType/column';
|
5
|
+
import type { ColumnParallel } from './chartType/columnParallel';
|
6
|
+
import type { ColumnPercent } from './chartType/columnPercent';
|
7
|
+
import type { Line } from './chartType/line';
|
8
|
+
import type { Table } from './chartType/table';
|
9
|
+
import type { Rose } from './chartType/rose';
|
10
|
+
import type { BarPercent } from './chartType/barPercent';
|
11
|
+
import type { PivotTable } from './chartType/pivotTable';
|
12
|
+
import type { Pie } from './chartType/pie';
|
13
|
+
import type { Donut } from './chartType/donut';
|
14
|
+
import type { DualAxis } from './chartType/dualAxis';
|
15
|
+
import type { Area } from './chartType/area';
|
16
|
+
import type { AreaPercent } from './chartType/areaPercent';
|
17
|
+
export type VSeed = Table | PivotTable | Line | Column | ColumnParallel | ColumnPercent | Bar | BarParallel | BarPercent | Area | AreaPercent | DualAxis | Rose | Pie | Donut;
|
6
18
|
export declare const zVSeed: z.ZodObject<{
|
7
19
|
chartType: z.ZodEnum<{
|
8
|
-
|
20
|
+
table: "table";
|
21
|
+
pivotTable: "pivotTable";
|
9
22
|
line: "line";
|
10
|
-
bar: "bar";
|
11
|
-
pie: "pie";
|
12
|
-
rose: "rose";
|
13
23
|
column: "column";
|
14
|
-
areaPercent: "areaPercent";
|
15
|
-
barPercent: "barPercent";
|
16
24
|
columnPercent: "columnPercent";
|
17
25
|
columnParallel: "columnParallel";
|
26
|
+
bar: "bar";
|
27
|
+
barPercent: "barPercent";
|
18
28
|
barParallel: "barParallel";
|
19
|
-
|
20
|
-
|
29
|
+
area: "area";
|
30
|
+
areaPercent: "areaPercent";
|
31
|
+
rose: "rose";
|
32
|
+
pie: "pie";
|
21
33
|
donut: "donut";
|
22
34
|
dualAxis: "dualAxis";
|
23
35
|
}>;
|
@@ -84,11 +96,6 @@ export declare const zVSeed: z.ZodObject<{
|
|
84
96
|
suffix: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
85
97
|
}, z.core.$strip>>;
|
86
98
|
}, z.core.$strip>]>>>;
|
99
|
+
backgroundColor: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
87
100
|
}, z.core.$strip>;
|
88
|
-
export type VSeed = {
|
89
|
-
chartType: ChartType;
|
90
|
-
dataset: Dataset;
|
91
|
-
dimensions?: Dimensions;
|
92
|
-
measures?: Measures;
|
93
|
-
};
|
94
101
|
export declare const VSeedJSONSchema: z.core.JSONSchema.JSONSchema;
|
package/package.json
CHANGED
@@ -1,16 +0,0 @@
|
|
1
|
-
import type { Bar } from './bar';
|
2
|
-
import type { BarParallel } from './barParallel';
|
3
|
-
import type { Column } from './column';
|
4
|
-
import type { ColumnParallel } from './columnParallel';
|
5
|
-
import type { ColumnPercent } from './columnPercent';
|
6
|
-
import type { Line } from './line';
|
7
|
-
import type { Table } from './table';
|
8
|
-
import type { Rose } from './rose';
|
9
|
-
import type { BarPercent } from './barPercent';
|
10
|
-
import type { PivotTable } from './pivotTable';
|
11
|
-
import type { Pie } from './pie';
|
12
|
-
import type { Donut } from './donut';
|
13
|
-
import type { DualAxis } from './dualAxis';
|
14
|
-
import type { Area } from './area';
|
15
|
-
import type { AreaPercent } from './areaPercent';
|
16
|
-
export type VSeedDSL = Table | PivotTable | Line | Column | ColumnParallel | ColumnPercent | Bar | BarParallel | BarPercent | Area | AreaPercent | DualAxis | Rose | Pie | Donut;
|
File without changes
|