@easyv/config 1.0.42 → 1.0.46

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/src/axes.js CHANGED
@@ -1,162 +1,162 @@
1
- import { gridLine, tickLine, axisLine, unit, font } from '.';
2
- import { axisLabel, valueAsixLabel } from './label';
3
- const defaultFont = font();
4
- const defaultFontAxisY = font({
5
- color: 'rgba(230, 247, 255, 1)',
6
- });
7
- const defaultCategoryAxis = {
8
- on: true,
9
- label: {
10
- show: true,
11
- format: { type: 'date', showType: 'MM月' },
12
- appearance: { count: 3, angle: 0, wordBreak: 'keep-all' },
13
- translate: { x: 0, y: 0 },
14
- font: defaultFontAxisY,
15
- },
16
- axisLine: { show: true, color: '#BAE7FF', lineWidth: 1 },
17
- tickLine: {
18
- show: false,
19
- color: 'rgba(186,231,255,1)',
20
- lineWidth: 1,
21
- tickSize: 6,
22
- },
23
- gridLine: {
24
- show: true,
25
- strokeDasharray: '3,3',
26
- color: 'rgba(230, 247, 255, 0.2)',
27
- lineWidth: 1,
28
- },
29
- };
30
-
31
- export const categoryAxis = ({
32
- on = defaultCategoryAxis.on,
33
- label = defaultCategoryAxis.label,
34
- axisLine: axisLine_ = defaultCategoryAxis.axisLine,
35
- tickLine: tickLine_ = defaultCategoryAxis.tickLine,
36
- gridLine: gridLine_ = defaultCategoryAxis.gridLine,
37
- } = defaultCategoryAxis) => [
38
- {
39
- name: 'on',
40
- displayName: '启用',
41
- value: on,
42
- type: 'boolean',
43
- },
44
- {
45
- rule: [['on', '$eq', true]],
46
- ...axisLabel(label),
47
- },
48
- {
49
- rule: [['on', '$eq', true]],
50
- ...axisLine(axisLine_),
51
- },
52
- {
53
- rule: [['on', '$eq', true]],
54
- ...tickLine(tickLine_),
55
- },
56
- {
57
- rule: [['on', '$eq', true]],
58
- ...gridLine(gridLine_),
59
- },
60
- ];
61
-
62
- const defaultValueAxis = {
63
- on: true,
64
- label: {
65
- show: true,
66
- extent: { min: '0', max: '' },
67
- auto: false,
68
- mode: 'count',
69
- count: 3,
70
- step: 100,
71
- decimal: 0,
72
- suffix: '',
73
- translate: { x: 6, y: 0 },
74
- font: defaultFont,
75
- },
76
- unit: {
77
- show: false,
78
- text: '单位',
79
- font: defaultFont,
80
- translate: { x: 0, y: 0 },
81
- },
82
- axisLine: { show: true, color: '#BAE7FF', lineWidth: 1 },
83
- tickLine: {
84
- show: true,
85
- color: 'rgba(186,231,255,1)',
86
- lineWidth: 1,
87
- tickSize: 6,
88
- },
89
- gridLine: {
90
- show: true,
91
- strokeDasharray: '3,3',
92
- color: 'rgba(230, 247, 255, 0.2)',
93
- lineWidth: 1,
94
- },
95
- };
96
-
97
- export const valueAxis = ({
98
- on = defaultValueAxis.on,
99
- label = defaultValueAxis.label,
100
- unit: unit_ = defaultValueAxis.unit,
101
- axisLine: axisLine_ = defaultValueAxis.axisLine,
102
- tickLine: tickLine_ = defaultValueAxis.tickLine,
103
- gridLine: gridLine_ = defaultValueAxis.gridLine,
104
- } = defaultValueAxis) => [
105
- {
106
- name: 'on',
107
- displayName: '启用',
108
- value: on,
109
- type: 'boolean',
110
- },
111
- {
112
- rule: [['on', '$eq', true]],
113
- ...valueAsixLabel(label),
114
- },
115
- {
116
- rule: [['on', '$eq', true]],
117
- ...unit(unit_),
118
- },
119
- {
120
- rule: [['on', '$eq', true]],
121
- ...axisLine(axisLine_),
122
- },
123
- {
124
- rule: [['on', '$eq', true]],
125
- ...tickLine(tickLine_),
126
- },
127
- {
128
- rule: [['on', '$eq', true]],
129
- ...gridLine(gridLine_),
130
- },
131
- ];
132
-
133
- export default (
134
- { xAxis = defaultCategoryAxis, yAxis = defaultValueAxis, zAxis } = {
135
- xAxis: defaultCategoryAxis,
136
- yAxis: defaultValueAxis,
137
- }
138
- ) => ({
139
- name: 'axes',
140
- displayName: '坐标轴',
141
- value: [
142
- {
143
- name: 'xAxis',
144
- displayName: 'X轴',
145
- value: categoryAxis(xAxis),
146
- },
147
- {
148
- name: 'yAxis',
149
- displayName: 'Y轴',
150
- value: valueAxis(yAxis),
151
- },
152
- zAxis && {
153
- name: 'zAxis',
154
- displayName: 'Z轴',
155
- value: valueAxis(zAxis),
156
- },
157
- ].filter((item) => !!item),
158
- config: {
159
- layout: 'horizontal',
160
- },
161
- type: 'menu',
162
- });
1
+ import { gridLine, tickLine, axisLine, unit, font } from '.';
2
+ import { axisLabel, valueAsixLabel } from './label';
3
+ const defaultFont = font();
4
+ const defaultFontAxisY = font({
5
+ color: 'rgba(230, 247, 255, 1)',
6
+ });
7
+ const defaultCategoryAxis = {
8
+ on: true,
9
+ label: {
10
+ show: true,
11
+ format: { type: 'date', showType: 'MM月' },
12
+ appearance: { count: 3, angle: 0, wordBreak: 'keep-all' },
13
+ translate: { x: 0, y: 0 },
14
+ font: defaultFontAxisY,
15
+ },
16
+ axisLine: { show: true, color: '#BAE7FF', lineWidth: 1 },
17
+ tickLine: {
18
+ show: false,
19
+ color: 'rgba(186,231,255,1)',
20
+ lineWidth: 1,
21
+ tickSize: 6,
22
+ },
23
+ gridLine: {
24
+ show: true,
25
+ strokeDasharray: '3,3',
26
+ color: 'rgba(230, 247, 255, 0.2)',
27
+ lineWidth: 1,
28
+ },
29
+ };
30
+
31
+ export const categoryAxis = ({
32
+ on = defaultCategoryAxis.on,
33
+ label = defaultCategoryAxis.label,
34
+ axisLine: axisLine_ = defaultCategoryAxis.axisLine,
35
+ tickLine: tickLine_ = defaultCategoryAxis.tickLine,
36
+ gridLine: gridLine_ = defaultCategoryAxis.gridLine,
37
+ } = defaultCategoryAxis) => [
38
+ {
39
+ name: 'on',
40
+ displayName: '启用',
41
+ value: on,
42
+ type: 'boolean',
43
+ },
44
+ {
45
+ rule: [['on', '$eq', true]],
46
+ ...axisLabel(label),
47
+ },
48
+ {
49
+ rule: [['on', '$eq', true]],
50
+ ...axisLine(axisLine_),
51
+ },
52
+ {
53
+ rule: [['on', '$eq', true]],
54
+ ...tickLine(tickLine_),
55
+ },
56
+ {
57
+ rule: [['on', '$eq', true]],
58
+ ...gridLine(gridLine_),
59
+ },
60
+ ];
61
+
62
+ const defaultValueAxis = {
63
+ on: true,
64
+ label: {
65
+ show: true,
66
+ extent: { min: '0', max: '' },
67
+ auto: false,
68
+ mode: 'count',
69
+ count: 3,
70
+ step: 100,
71
+ decimal: 0,
72
+ suffix: '',
73
+ translate: { x: 6, y: 0 },
74
+ font: defaultFont,
75
+ },
76
+ unit: {
77
+ show: false,
78
+ text: '单位',
79
+ font: defaultFont,
80
+ translate: { x: 0, y: 0 },
81
+ },
82
+ axisLine: { show: true, color: '#BAE7FF', lineWidth: 1 },
83
+ tickLine: {
84
+ show: true,
85
+ color: 'rgba(186,231,255,1)',
86
+ lineWidth: 1,
87
+ tickSize: 6,
88
+ },
89
+ gridLine: {
90
+ show: true,
91
+ strokeDasharray: '3,3',
92
+ color: 'rgba(230, 247, 255, 0.2)',
93
+ lineWidth: 1,
94
+ },
95
+ };
96
+
97
+ export const valueAxis = ({
98
+ on = defaultValueAxis.on,
99
+ label = defaultValueAxis.label,
100
+ unit: unit_ = defaultValueAxis.unit,
101
+ axisLine: axisLine_ = defaultValueAxis.axisLine,
102
+ tickLine: tickLine_ = defaultValueAxis.tickLine,
103
+ gridLine: gridLine_ = defaultValueAxis.gridLine,
104
+ } = defaultValueAxis) => [
105
+ {
106
+ name: 'on',
107
+ displayName: '启用',
108
+ value: on,
109
+ type: 'boolean',
110
+ },
111
+ {
112
+ rule: [['on', '$eq', true]],
113
+ ...valueAsixLabel(label),
114
+ },
115
+ {
116
+ rule: [['on', '$eq', true]],
117
+ ...unit(unit_),
118
+ },
119
+ {
120
+ rule: [['on', '$eq', true]],
121
+ ...axisLine(axisLine_),
122
+ },
123
+ {
124
+ rule: [['on', '$eq', true]],
125
+ ...tickLine(tickLine_),
126
+ },
127
+ {
128
+ rule: [['on', '$eq', true]],
129
+ ...gridLine(gridLine_),
130
+ },
131
+ ];
132
+
133
+ export default (
134
+ { xAxis = defaultCategoryAxis, yAxis = defaultValueAxis, zAxis } = {
135
+ xAxis: defaultCategoryAxis,
136
+ yAxis: defaultValueAxis,
137
+ }
138
+ ) => ({
139
+ name: 'axes',
140
+ displayName: '坐标轴',
141
+ value: [
142
+ {
143
+ name: 'xAxis',
144
+ displayName: 'X轴',
145
+ value: categoryAxis(xAxis),
146
+ },
147
+ {
148
+ name: 'yAxis',
149
+ displayName: 'Y轴',
150
+ value: valueAxis(yAxis),
151
+ },
152
+ zAxis && {
153
+ name: 'zAxis',
154
+ displayName: 'Z轴',
155
+ value: valueAxis(zAxis),
156
+ },
157
+ ].filter((item) => !!item),
158
+ config: {
159
+ layout: 'horizontal',
160
+ },
161
+ type: 'menu',
162
+ });
package/src/axisLine.js CHANGED
@@ -1,38 +1,38 @@
1
- const axisLine = {
2
- show: true,
3
- color: '#BAE7FF',
4
- lineWidth: 1,
5
- };
6
- export default ({
7
- show = axisLine.show,
8
- color = axisLine.color,
9
- lineWidth = axisLine.lineWidth,
10
- } = axisLine) => ({
11
- name: 'axisLine',
12
- displayName: '轴线',
13
- value: [
14
- {
15
- name: 'show',
16
- displayName: '显示',
17
- value: show,
18
- type: 'boolean',
19
- },
20
- {
21
- rule: [['show', '$eq', true]],
22
- name: 'color',
23
- displayName: '颜色',
24
- value: color,
25
- type: 'color',
26
- },
27
- {
28
- rule: [['show', '$eq', true]],
29
- name: 'lineWidth',
30
- displayName: '粗细',
31
- value: lineWidth,
32
- type: 'number',
33
- config: {
34
- suffix: 'px',
35
- },
36
- },
37
- ],
38
- });
1
+ const axisLine = {
2
+ show: true,
3
+ color: '#BAE7FF',
4
+ lineWidth: 1,
5
+ };
6
+ export default ({
7
+ show = axisLine.show,
8
+ color = axisLine.color,
9
+ lineWidth = axisLine.lineWidth,
10
+ } = axisLine) => ({
11
+ name: 'axisLine',
12
+ displayName: '轴线',
13
+ value: [
14
+ {
15
+ name: 'show',
16
+ displayName: '显示',
17
+ value: show,
18
+ type: 'boolean',
19
+ },
20
+ {
21
+ rule: [['show', '$eq', true]],
22
+ name: 'color',
23
+ displayName: '颜色',
24
+ value: color,
25
+ type: 'color',
26
+ },
27
+ {
28
+ rule: [['show', '$eq', true]],
29
+ name: 'lineWidth',
30
+ displayName: '粗细',
31
+ value: lineWidth,
32
+ type: 'number',
33
+ config: {
34
+ suffix: 'px',
35
+ },
36
+ },
37
+ ],
38
+ });
package/src/brush.js CHANGED
@@ -1,90 +1,90 @@
1
- const defaultBrush = {
2
- height: 20,
3
- background: 'rgba(20, 95, 255, 0.1)',
4
- margin: {
5
- marginLeft: 40,
6
- marginRight: 40,
7
- },
8
- detail: {
9
- width: 30,
10
- color: 'rgba(255, 255, 255, 0.3)',
11
- },
12
- };
13
-
14
- export default ({
15
- height = defaultBrush.height,
16
- background = defaultBrush.background,
17
- margin: {
18
- marginLeft = defaultBrush.margin.marginLeft,
19
- marginRight = defaultBrush.margin.marginRight,
20
- } = defaultBrush.margin,
21
- detail: {
22
- width = defaultBrush.detail.width,
23
- color = defaultBrush.detail.color,
24
- } = defaultBrush.detail,
25
- } = defaultBrush) => ({
26
- name: 'brush',
27
- displayName: '控制条',
28
- value: [
29
- {
30
- name: 'height',
31
- displayName: '高度',
32
- value: height,
33
- type: 'number',
34
- },
35
- {
36
- name: 'background',
37
- displayName: '背景',
38
- value: background,
39
- type: 'color',
40
- },
41
- {
42
- name: 'margin',
43
- displayName: '间距',
44
- value: [
45
- {
46
- name: 'marginLeft',
47
- displayName: '左',
48
- value: marginLeft,
49
- type: 'number',
50
- config: {
51
- span: 12,
52
- },
53
- },
54
- {
55
- name: 'marginRight',
56
- displayName: '右',
57
- value: marginRight,
58
- type: 'number',
59
- config: {
60
- span: 12,
61
- },
62
- },
63
- ],
64
- type: 'group',
65
- },
66
- {
67
- name: 'detail',
68
- displayName: '详情区域',
69
- value: [
70
- {
71
- name: 'width',
72
- displayName: '宽度',
73
- value: width,
74
- type: 'number',
75
- config: {
76
- suffix: '%',
77
- min: 0,
78
- max: 100,
79
- },
80
- },
81
- {
82
- name: 'color',
83
- displayName: '颜色',
84
- value: color,
85
- type: 'color',
86
- },
87
- ],
88
- },
89
- ],
90
- });
1
+ const defaultBrush = {
2
+ height: 20,
3
+ background: 'rgba(20, 95, 255, 0.1)',
4
+ margin: {
5
+ marginLeft: 40,
6
+ marginRight: 40,
7
+ },
8
+ detail: {
9
+ width: 30,
10
+ color: 'rgba(255, 255, 255, 0.3)',
11
+ },
12
+ };
13
+
14
+ export default ({
15
+ height = defaultBrush.height,
16
+ background = defaultBrush.background,
17
+ margin: {
18
+ marginLeft = defaultBrush.margin.marginLeft,
19
+ marginRight = defaultBrush.margin.marginRight,
20
+ } = defaultBrush.margin,
21
+ detail: {
22
+ width = defaultBrush.detail.width,
23
+ color = defaultBrush.detail.color,
24
+ } = defaultBrush.detail,
25
+ } = defaultBrush) => ({
26
+ name: 'brush',
27
+ displayName: '控制条',
28
+ value: [
29
+ {
30
+ name: 'height',
31
+ displayName: '高度',
32
+ value: height,
33
+ type: 'number',
34
+ },
35
+ {
36
+ name: 'background',
37
+ displayName: '背景',
38
+ value: background,
39
+ type: 'color',
40
+ },
41
+ {
42
+ name: 'margin',
43
+ displayName: '间距',
44
+ value: [
45
+ {
46
+ name: 'marginLeft',
47
+ displayName: '左',
48
+ value: marginLeft,
49
+ type: 'number',
50
+ config: {
51
+ span: 12,
52
+ },
53
+ },
54
+ {
55
+ name: 'marginRight',
56
+ displayName: '右',
57
+ value: marginRight,
58
+ type: 'number',
59
+ config: {
60
+ span: 12,
61
+ },
62
+ },
63
+ ],
64
+ type: 'group',
65
+ },
66
+ {
67
+ name: 'detail',
68
+ displayName: '详情区域',
69
+ value: [
70
+ {
71
+ name: 'width',
72
+ displayName: '宽度',
73
+ value: width,
74
+ type: 'number',
75
+ config: {
76
+ suffix: '%',
77
+ min: 0,
78
+ max: 100,
79
+ },
80
+ },
81
+ {
82
+ name: 'color',
83
+ displayName: '颜色',
84
+ value: color,
85
+ type: 'color',
86
+ },
87
+ ],
88
+ },
89
+ ],
90
+ });
package/src/dimension.js CHANGED
@@ -1,49 +1,49 @@
1
- const defaultDimension = {
2
- width: 450,
3
- height: 250,
4
- left: 100,
5
- top: 100,
6
- };
7
- export default ({
8
- width = defaultDimension.width,
9
- height = defaultDimension.height,
10
- left = defaultDimension.left,
11
- top = defaultDimension.top,
12
- } = defaultDimension) => ({
13
- name: 'dimension',
14
- displayName: '位置尺寸',
15
- value: [
16
- {
17
- name: 'chartPosition',
18
- displayName: '图表位置',
19
- value: [
20
- {
21
- name: 'left',
22
- displayName: 'X轴坐标',
23
- value: left,
24
- },
25
- {
26
- name: 'top',
27
- displayName: 'Y轴坐标',
28
- value: top,
29
- },
30
- ],
31
- },
32
- {
33
- name: 'chartDimension',
34
- displayName: '图表尺寸',
35
- value: [
36
- {
37
- name: 'width',
38
- displayName: '宽度',
39
- value: width,
40
- },
41
- {
42
- name: 'height',
43
- displayName: '高度',
44
- value: height,
45
- },
46
- ],
47
- },
48
- ],
49
- });
1
+ const defaultDimension = {
2
+ width: 450,
3
+ height: 250,
4
+ left: 100,
5
+ top: 100,
6
+ };
7
+ export default ({
8
+ width = defaultDimension.width,
9
+ height = defaultDimension.height,
10
+ left = defaultDimension.left,
11
+ top = defaultDimension.top,
12
+ } = defaultDimension) => ({
13
+ name: 'dimension',
14
+ displayName: '位置尺寸',
15
+ value: [
16
+ {
17
+ name: 'chartPosition',
18
+ displayName: '图表位置',
19
+ value: [
20
+ {
21
+ name: 'left',
22
+ displayName: 'X轴坐标',
23
+ value: left,
24
+ },
25
+ {
26
+ name: 'top',
27
+ displayName: 'Y轴坐标',
28
+ value: top,
29
+ },
30
+ ],
31
+ },
32
+ {
33
+ name: 'chartDimension',
34
+ displayName: '图表尺寸',
35
+ value: [
36
+ {
37
+ name: 'width',
38
+ displayName: '宽度',
39
+ value: width,
40
+ },
41
+ {
42
+ name: 'height',
43
+ displayName: '高度',
44
+ value: height,
45
+ },
46
+ ],
47
+ },
48
+ ],
49
+ });