@visactor/vseed 0.0.2 → 0.0.4

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 (116) hide show
  1. package/dist/.rsdoctor/chunkGraph/0 +1 -0
  2. package/dist/.rsdoctor/configs/0 +1 -0
  3. package/dist/.rsdoctor/envinfo/0 +1 -0
  4. package/dist/.rsdoctor/errors/0 +1 -0
  5. package/dist/.rsdoctor/loader/0 +1 -0
  6. package/dist/.rsdoctor/manifest.json +52 -0
  7. package/dist/.rsdoctor/moduleCodeMap/0 +1 -0
  8. package/dist/.rsdoctor/moduleGraph/0 +1 -0
  9. package/dist/.rsdoctor/otherReports/0 +1 -0
  10. package/dist/.rsdoctor/packageGraph/0 +1 -0
  11. package/dist/.rsdoctor/plugin/0 +1 -0
  12. package/dist/.rsdoctor/resolver/0 +1 -0
  13. package/dist/.rsdoctor/summary/0 +1 -0
  14. package/dist/builder/builder/builder.d.ts +186 -4
  15. package/dist/builder/register/all.d.ts +1 -0
  16. package/dist/builder/register/chartType.d.ts +10 -0
  17. package/dist/builder/register/index.d.ts +3 -1
  18. package/dist/builder/register/theme.d.ts +4 -0
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.html +1 -0
  21. package/dist/pipeline/advanced/pipeline/area.d.ts +2 -0
  22. package/dist/pipeline/advanced/pipeline/areaPercent.d.ts +2 -0
  23. package/dist/pipeline/advanced/pipeline/barParallel.d.ts +2 -0
  24. package/dist/pipeline/advanced/pipeline/barPercent.d.ts +2 -0
  25. package/dist/pipeline/advanced/pipeline/columnParallel.d.ts +2 -0
  26. package/dist/pipeline/advanced/pipeline/columnPercent.d.ts +2 -0
  27. package/dist/pipeline/advanced/pipeline/index.d.ts +7 -0
  28. package/dist/pipeline/advanced/pipeline/line.d.ts +2 -0
  29. package/dist/pipeline/advanced/pipes/baseConfig/baseConfig.d.ts +3 -0
  30. package/dist/pipeline/advanced/pipes/baseConfig/index.d.ts +1 -0
  31. package/dist/pipeline/advanced/pipes/encoding/encodingCartesian.d.ts +2 -1
  32. package/dist/pipeline/advanced/pipes/encoding/index.d.ts +1 -1
  33. package/dist/pipeline/advanced/pipes/index.d.ts +3 -0
  34. package/dist/pipeline/advanced/pipes/init/autoDimensions.d.ts +2 -0
  35. package/dist/pipeline/advanced/pipes/init/autoMeasures.d.ts +2 -0
  36. package/dist/pipeline/advanced/pipes/init/index.d.ts +3 -0
  37. package/dist/pipeline/advanced/pipes/init/initAdvancedVSeed.d.ts +2 -0
  38. package/dist/pipeline/advanced/pipes/init/utils.d.ts +1 -0
  39. package/dist/pipeline/advanced/pipes/theme/index.d.ts +1 -0
  40. package/dist/pipeline/advanced/pipes/theme/theme.d.ts +3 -0
  41. package/dist/pipeline/spec/pipeline/area.d.ts +2 -0
  42. package/dist/pipeline/spec/pipeline/areaPercent.d.ts +2 -0
  43. package/dist/pipeline/spec/pipeline/barParallel.d.ts +2 -0
  44. package/dist/pipeline/spec/pipeline/barPercent.d.ts +2 -0
  45. package/dist/pipeline/spec/pipeline/columnParallel.d.ts +2 -0
  46. package/dist/pipeline/spec/pipeline/columnPercent.d.ts +2 -0
  47. package/dist/pipeline/spec/pipeline/index.d.ts +7 -0
  48. package/dist/pipeline/spec/pipeline/line.d.ts +2 -0
  49. package/dist/pipeline/spec/pipes/backgroundColor/background.d.ts +2 -0
  50. package/dist/pipeline/spec/pipes/backgroundColor/index.d.ts +1 -0
  51. package/dist/pipeline/spec/pipes/color/color.d.ts +2 -0
  52. package/dist/pipeline/spec/pipes/color/index.d.ts +1 -0
  53. package/dist/pipeline/spec/pipes/index.d.ts +7 -0
  54. package/dist/pipeline/spec/pipes/init/area.d.ts +2 -0
  55. package/dist/pipeline/spec/pipes/init/barParallel.d.ts +2 -0
  56. package/dist/pipeline/spec/pipes/init/columnParallel.d.ts +2 -0
  57. package/dist/pipeline/spec/pipes/init/index.d.ts +4 -0
  58. package/dist/pipeline/spec/pipes/init/line.d.ts +2 -0
  59. package/dist/pipeline/spec/pipes/label/index.d.ts +1 -0
  60. package/dist/pipeline/spec/pipes/label/label.d.ts +2 -0
  61. package/dist/pipeline/spec/pipes/legend/index.d.ts +1 -0
  62. package/dist/pipeline/spec/pipes/legend/legend.d.ts +2 -0
  63. package/dist/pipeline/spec/pipes/percent/index.d.ts +1 -0
  64. package/dist/pipeline/spec/pipes/percent/percent.d.ts +2 -0
  65. package/dist/pipeline/spec/pipes/stack/index.d.ts +1 -0
  66. package/dist/pipeline/spec/pipes/stack/stack.d.ts +2 -0
  67. package/dist/pipeline/spec/pipes/tooltip/index.d.ts +1 -0
  68. package/dist/pipeline/spec/pipes/tooltip/tooltip.d.ts +2 -0
  69. package/dist/pipeline/utils/chatType.d.ts +3 -0
  70. package/dist/pipeline/utils/index.d.ts +1 -0
  71. package/dist/static/js/271.b02e15b2.js +16 -0
  72. package/dist/static/js/index.7ac2af0b.js +1 -0
  73. package/dist/theme/dark.d.ts +2 -0
  74. package/dist/theme/index.d.ts +2 -0
  75. package/dist/theme/light.d.ts +2 -0
  76. package/dist/types/{properties/advancedVSeed.d.ts → advancedVSeed.d.ts} +45 -0
  77. package/dist/types/builder/builder.d.ts +10 -3
  78. package/dist/types/chartType/area/area.d.ts +38 -3
  79. package/dist/types/chartType/areaPercent/areaPercent.d.ts +38 -3
  80. package/dist/types/chartType/bar/bar.d.ts +38 -3
  81. package/dist/types/chartType/barParallel/barParallel.d.ts +38 -3
  82. package/dist/types/chartType/barPercent/barPercent.d.ts +38 -3
  83. package/dist/types/chartType/column/column.d.ts +38 -3
  84. package/dist/types/chartType/columnParallel/columnParallel.d.ts +38 -3
  85. package/dist/types/chartType/columnPercent/columnPercent.d.ts +38 -3
  86. package/dist/types/chartType/donut/donut.d.ts +38 -3
  87. package/dist/types/chartType/dualAxis/dualAxis.d.ts +38 -3
  88. package/dist/types/chartType/index.d.ts +1 -1
  89. package/dist/types/chartType/line/line.d.ts +38 -3
  90. package/dist/types/chartType/pie/pie.d.ts +38 -3
  91. package/dist/types/chartType/pivotTable/pivotTable.d.ts +18 -3
  92. package/dist/types/chartType/rose/rose.d.ts +38 -3
  93. package/dist/types/chartType/table/table.d.ts +18 -3
  94. package/dist/types/index.d.ts +2 -0
  95. package/dist/types/pipeline/advancedVSeed/advancedVSeed.d.ts +4 -1
  96. package/dist/types/pipeline/spec/spec.d.ts +2 -1
  97. package/dist/types/properties/baseConfig/backgroundColor.d.ts +8 -0
  98. package/dist/types/properties/baseConfig/baseConfig.d.ts +44 -0
  99. package/dist/types/properties/baseConfig/color.d.ts +23 -0
  100. package/dist/types/properties/baseConfig/index.d.ts +12 -0
  101. package/dist/types/properties/baseConfig/label.d.ts +11 -0
  102. package/dist/types/properties/baseConfig/legend.d.ts +11 -0
  103. package/dist/types/properties/baseConfig/tooltip.d.ts +11 -0
  104. package/dist/types/properties/index.d.ts +2 -2
  105. package/dist/types/properties/theme/customTheme.d.ts +49 -0
  106. package/dist/types/properties/theme/index.d.ts +4 -0
  107. package/dist/types/properties/theme/theme.d.ts +15 -0
  108. package/dist/types/{properties/vseed.d.ts → vseed.d.ts} +17 -10
  109. package/package.json +2 -1
  110. package/dist/builder/register/register.d.ts +0 -3
  111. package/dist/index.cjs +0 -648
  112. package/dist/index.js +0 -533
  113. package/dist/pipeline/spec/pipes/axes/xBand copy.d.ts +0 -0
  114. package/dist/pipeline/spec/pipes/axes/xLinear copy.d.ts +0 -0
  115. package/dist/pipeline/spec/pipes/axes/yLinear copy.d.ts +0 -0
  116. package/dist/types/chartType/vseedDSL.d.ts +0 -16
@@ -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 百分比柱状图,适用于展示各类别占比关系的场景,Y轴以百分比形式展示数据占比
@@ -34,12 +34,47 @@ export interface ColumnPercent {
34
34
  * @type {Dimensions}
35
35
  * @example [{id: 'category', alias: '类别'}]
36
36
  */
37
- dimensions: Dimensions;
37
+ dimensions?: Dimensions;
38
38
  /**
39
39
  * 指标
40
40
  * @description 百分比柱状图指标会自动合并为一个指标, 映射到Y轴, 存在多个指标时, 指标名称会与其余维度合并, 作为图例项展示.
41
41
  * @type {Measures}
42
42
  * @example [{id: 'value', alias: '数值占比', format: 'percent'}]
43
43
  */
44
- measures: 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, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip } from '../..';
2
2
  /**
3
3
  * 环形图类型定义
4
4
  * @description 环形图,适用于展示单一维度数据的占比关系,中心留有空白区域可展示汇总信息
@@ -34,12 +34,47 @@ export interface Donut {
34
34
  * @type {Dimensions}
35
35
  * @example [{id: 'category', alias: '类别'}]
36
36
  */
37
- dimensions: 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: 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, Color, Dataset, Dimensions, Label, Legend, Measures, Theme, Tooltip } from '../..';
2
2
  /**
3
3
  * 双轴图类型定义
4
4
  * @description 双轴图,适用于展示两个不同量级或不同单位指标的对比关系,包含主坐标轴和次坐标轴
@@ -36,12 +36,47 @@ export interface DualAxis {
36
36
  * @type {Dimensions}
37
37
  * @example [{id: 'month', alias: '月份'}]
38
38
  */
39
- dimensions: Dimensions;
39
+ dimensions?: Dimensions;
40
40
  /**
41
41
  * 指标
42
42
  * @description 双轴图如果有2组指标组, 则每个组内的所有指标分别自动合并为一个指标, 分别映射到双轴图的左右轴, 如果指标不成组, 则会当作一组指标处理.
43
43
  * @type {Measures}
44
44
  * @example [{id: 'value', alias: '数值', axis: 'left'}, {id: 'growth', alias: '增长率', axis: 'right', format: 'percent'}]
45
45
  */
46
- measures: Measures;
46
+ measures?: Measures;
47
+ /**
48
+ * 图表的背景颜色
49
+ * @default transparent 默认为透明背景
50
+ * @description 背景颜色可以是颜色字符串, 例如'red', 'blue', 也可以是hex, rgb或rgba'#ff0000', 'rgba(255,0,0,0.5)'
51
+ */
52
+ backgroundColor?: BackgroundColor;
53
+ /**
54
+ * 颜色
55
+ * @description 颜色配置, 用于定义图表的颜色方案, 包括颜色列表, 颜色映射, 颜色渐变等.
56
+ */
57
+ color?: Color;
58
+ /**
59
+ * 标签
60
+ * @description 标签配置, 用于定义图表的数据标签, 包括数据标签的位置, 格式, 样式等.
61
+ */
62
+ label?: Label;
63
+ /**
64
+ * 图例
65
+ * @description 图例配置, 用于定义图表的图例, 包括图例的位置, 格式, 样式等.
66
+ */
67
+ legend?: Legend;
68
+ /**
69
+ * 提示信息
70
+ * @description 提示信息配置, 用于定义图表的提示信息, 包括提示信息的位置, 格式, 样式等.
71
+ */
72
+ tooltip?: Tooltip;
73
+ /**
74
+ * 图表的主题, 主题是优先级较低的功能配置, 包含所有图表类型共用的通用配置, 与单类图表类型共用的图表配置
75
+ * @default light 默认为亮色主题
76
+ * @description 内置light与dark两种主题, 用户可以通过Builder自定义主题
77
+ * @example 'dark'
78
+ * @example 'light'
79
+ * @example 'customThemeName'
80
+ */
81
+ theme?: Theme;
47
82
  }
@@ -13,4 +13,4 @@ export type * from './dualAxis';
13
13
  export type * from './rose';
14
14
  export type * from './pie';
15
15
  export type * from './donut';
16
- export type * from './vseedDSL';
16
+ export type * from '../vseed';
@@ -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 Line {
34
34
  * @type {Dimensions}
35
35
  * @example [{id: "month", alias: "月份"}]
36
36
  */
37
- dimensions: Dimensions;
37
+ dimensions?: Dimensions;
38
38
  /**
39
39
  * 指标
40
40
  * @description 折线图的所有指标会自动合并为一个指标, 映射到Y轴, 存在多个指标时, 指标名称会与其余维度合并, 作为图例项展示.
41
41
  * @type {Measures}
42
42
  * @example [{id: "value", alias: "数值"}]
43
43
  */
44
- measures: 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, 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: 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: 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: 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: 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: 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: 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: 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: 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
  }
@@ -2,3 +2,5 @@ export * from './properties';
2
2
  export type * from './pipeline';
3
3
  export type * from './chartType';
4
4
  export type * from './builder';
5
+ export type * from './vseed';
6
+ export type * from './advancedVSeed';
@@ -1,7 +1,10 @@
1
- import type { AdvancedVSeed, VSeed } from '../../properties';
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';
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const zLabel: z.ZodObject<{
3
+ enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4
+ }, z.core.$strip>;
5
+ export type Label = {
6
+ /**
7
+ * 标签功能是否开启
8
+ * @default true
9
+ */
10
+ enable: boolean;
11
+ };
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const zLegend: z.ZodObject<{
3
+ enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4
+ }, z.core.$strip>;
5
+ export type Legend = {
6
+ /**
7
+ * 图例功能是否开启
8
+ * @default true
9
+ */
10
+ enable: boolean;
11
+ };
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const zTooltip: z.ZodObject<{
3
+ enable: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
4
+ }, z.core.$strip>;
5
+ export type Tooltip = {
6
+ /**
7
+ * 提示信息功能是否开启
8
+ * @default true
9
+ */
10
+ enable: boolean;
11
+ };
@@ -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,4 @@
1
+ export type { CustomTheme, CustomThemeConfig } from './customTheme';
2
+ export { zCustomTheme, zCustomThemeConfig } from './customTheme';
3
+ export type { Theme } from './theme';
4
+ export { zTheme } from './theme';
@@ -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 {};