@easyv/config 1.3.3 → 1.3.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/src/axes.js CHANGED
@@ -1,29 +1,29 @@
1
- import { gridLine, tickLine, axisLine, unit, font, sc } from '.';
2
- import { axisLabel, valueAsixLabel,valueCilpAsixLabel } from './label';
1
+ import { gridLine, tickLine, axisLine, unit, font, sc } from ".";
2
+ import { axisLabel, valueAsixLabel, valueCilpAsixLabel } from "./label";
3
3
  const defaultFont = font();
4
4
  const defaultFontAxisY = font({
5
- color: 'rgba(230, 247, 255, 1)',
5
+ color: "rgba(230, 247, 255, 1)",
6
6
  });
7
7
  const defaultCategoryAxis = {
8
8
  on: true,
9
9
  label: {
10
10
  show: true,
11
- format: { type: 'date', showType: 'MM月' },
12
- appearance: { count: 3, angle: 0, wordBreak: 'keep-all' },
11
+ format: { type: "date", showType: "MM月" },
12
+ appearance: { count: 3, angle: 0, wordBreak: "keep-all" },
13
13
  translate: { x: 0, y: 0 },
14
14
  font: defaultFontAxisY,
15
15
  },
16
- axisLine: { show: true, color: '#BAE7FF', lineWidth: 1 },
16
+ axisLine: { show: true, color: "#BAE7FF", lineWidth: 1 },
17
17
  tickLine: {
18
18
  show: false,
19
- color: 'rgba(186,231,255,1)',
19
+ color: "rgba(186,231,255,1)",
20
20
  lineWidth: 1,
21
21
  tickSize: 6,
22
22
  },
23
23
  gridLine: {
24
24
  show: true,
25
- strokeDasharray: '3,3',
26
- color: 'rgba(230, 247, 255, 0.2)',
25
+ strokeDasharray: "3,3",
26
+ color: "rgba(230, 247, 255, 0.2)",
27
27
  lineWidth: 1,
28
28
  },
29
29
  };
@@ -36,25 +36,25 @@ export const categoryAxis = ({
36
36
  gridLine: gridLine_ = defaultCategoryAxis.gridLine,
37
37
  } = defaultCategoryAxis) => [
38
38
  {
39
- name: 'on',
40
- displayName: '启用',
39
+ name: "on",
40
+ displayName: "启用",
41
41
  value: on,
42
- type: 'boolean',
42
+ type: "boolean",
43
43
  },
44
44
  {
45
- rule: [['on', '$eq', true]],
45
+ rule: [["on", "$eq", true]],
46
46
  ...axisLabel(label),
47
47
  },
48
48
  {
49
- rule: [['on', '$eq', true]],
49
+ rule: [["on", "$eq", true]],
50
50
  ...axisLine(axisLine_),
51
51
  },
52
52
  {
53
- rule: [['on', '$eq', true]],
53
+ rule: [["on", "$eq", true]],
54
54
  ...tickLine(tickLine_),
55
55
  },
56
56
  {
57
- rule: [['on', '$eq', true]],
57
+ rule: [["on", "$eq", true]],
58
58
  ...gridLine(gridLine_),
59
59
  },
60
60
  ];
@@ -63,33 +63,33 @@ const defaultValueAxis = {
63
63
  on: true,
64
64
  label: {
65
65
  show: true,
66
- extent: { min: '0', max: '' },
67
- auto: false,
68
- mode: 'count',
66
+ extent: { min: "0", max: "" },
67
+ auto: true,
68
+ mode: "count",
69
69
  count: 3,
70
70
  step: 100,
71
71
  decimal: 0,
72
- suffix: '',
72
+ suffix: "",
73
73
  translate: { x: 6, y: 0 },
74
74
  font: defaultFont,
75
75
  },
76
76
  unit: {
77
77
  show: false,
78
- text: '单位',
78
+ text: "单位",
79
79
  font: defaultFont,
80
80
  translate: { x: 0, y: 0 },
81
81
  },
82
- axisLine: { show: true, color: '#BAE7FF', lineWidth: 1 },
82
+ axisLine: { show: true, color: "#BAE7FF", lineWidth: 1 },
83
83
  tickLine: {
84
84
  show: true,
85
- color: 'rgba(186,231,255,1)',
85
+ color: "rgba(186,231,255,1)",
86
86
  lineWidth: 1,
87
87
  tickSize: 6,
88
88
  },
89
89
  gridLine: {
90
90
  show: true,
91
- strokeDasharray: '3,3',
92
- color: 'rgba(230, 247, 255, 0.2)',
91
+ strokeDasharray: "3,3",
92
+ color: "rgba(230, 247, 255, 0.2)",
93
93
  lineWidth: 1,
94
94
  },
95
95
  };
@@ -97,7 +97,7 @@ const defaultValueAxis = {
97
97
  export const valueAxis = ({
98
98
  on = defaultValueAxis.on,
99
99
  reverse,
100
- openClipAxis = false,//断轴柱状图开启断轴 shuihan
100
+ openClipAxis = false, //断轴柱状图开启断轴 shuihan
101
101
  clipValueAxis,
102
102
  openClip,
103
103
  clipAxis,
@@ -106,62 +106,71 @@ export const valueAxis = ({
106
106
  axisLine: axisLine_ = defaultValueAxis.axisLine,
107
107
  tickLine: tickLine_ = defaultValueAxis.tickLine,
108
108
  gridLine: gridLine_ = defaultValueAxis.gridLine,
109
- } = defaultValueAxis) => [
110
- {
111
- name: 'on',
112
- displayName: '启用',
113
- value: on,
114
- type: 'boolean',
115
- },
116
- reverse!=undefined && sc("reverse","反转","boolean",reverse),
117
- openClip!=undefined && sc("openClip","开启断轴","boolean",false),
118
- clipAxis!=undefined && sc("clipAxis","轴段区间","array",[
119
- sc("range1","区间","object",[
120
- sc("value","区间值","number",50),
121
- sc("offset","高度占比","range",25)
122
- ]),
123
- sc("range2","区间","object",[
124
- sc("value","区间值","number",100),
125
- sc("offset","高度占比","range",50)
126
- ]),
127
- sc("range3","区间","object",[
128
- sc("value","区间值","number",1000),
129
- sc("offset","高度占比","range",75)
130
- ])
131
- ],{
132
- template:sc("range","区间","object",[
133
- sc("value","区间值","number",0),
134
- sc("offset","高度占比","range",0)
135
- ]),
136
- other:{
137
- tip:"不用设置高度占比为0或100的区间"
138
- }
139
- },{rule:[["openClip","$eq",true]]}),
140
- (openClipAxis === true) && {
141
- ...valueCilpAsixLabel(),
142
- rule: [['on', '$eq', true]],
143
- },
144
- (openClipAxis === false || !!!openClipAxis) && {
145
- rule: [['on', '$eq', true]],
146
- ...valueAsixLabel(label),
147
- },
148
- {
149
- rule: [['on', '$eq', true]],
150
- ...unit(unit_),
151
- },
152
- {
153
- rule: [['on', '$eq', true]],
154
- ...axisLine(axisLine_),
155
- },
156
- {
157
- rule: [['on', '$eq', true]],
158
- ...tickLine(tickLine_),
159
- },
160
- {
161
- rule: [['on', '$eq', true]],
162
- ...gridLine(gridLine_),
163
- },
164
- ].filter(item=>!!item);
109
+ } = defaultValueAxis) =>
110
+ [
111
+ {
112
+ name: "on",
113
+ displayName: "启用",
114
+ value: on,
115
+ type: "boolean",
116
+ },
117
+ reverse != undefined && sc("reverse", "反转", "boolean", reverse),
118
+ openClip != undefined && sc("openClip", "开启断轴", "boolean", false),
119
+ clipAxis != undefined &&
120
+ sc(
121
+ "clipAxis",
122
+ "轴段区间",
123
+ "array",
124
+ [
125
+ sc("range1", "区间", "object", [
126
+ sc("value", "区间值", "number", 50),
127
+ sc("offset", "高度占比", "range", 25),
128
+ ]),
129
+ sc("range2", "区间", "object", [
130
+ sc("value", "区间值", "number", 100),
131
+ sc("offset", "高度占比", "range", 50),
132
+ ]),
133
+ sc("range3", "区间", "object", [
134
+ sc("value", "区间值", "number", 1000),
135
+ sc("offset", "高度占比", "range", 75),
136
+ ]),
137
+ ],
138
+ {
139
+ template: sc("range", "区间", "object", [
140
+ sc("value", "区间值", "number", 0),
141
+ sc("offset", "高度占比", "range", 0),
142
+ ]),
143
+ other: {
144
+ tip: "不用设置高度占比为0或100的区间",
145
+ },
146
+ },
147
+ { rule: [["openClip", "$eq", true]] }
148
+ ),
149
+ openClipAxis === true && {
150
+ ...valueCilpAsixLabel(),
151
+ rule: [["on", "$eq", true]],
152
+ },
153
+ (openClipAxis === false || !!!openClipAxis) && {
154
+ rule: [["on", "$eq", true]],
155
+ ...valueAsixLabel(label),
156
+ },
157
+ {
158
+ rule: [["on", "$eq", true]],
159
+ ...unit(unit_),
160
+ },
161
+ {
162
+ rule: [["on", "$eq", true]],
163
+ ...axisLine(axisLine_),
164
+ },
165
+ {
166
+ rule: [["on", "$eq", true]],
167
+ ...tickLine(tickLine_),
168
+ },
169
+ {
170
+ rule: [["on", "$eq", true]],
171
+ ...gridLine(gridLine_),
172
+ },
173
+ ].filter((item) => !!item);
165
174
 
166
175
  export default (
167
176
  { xAxis = defaultCategoryAxis, yAxis = defaultValueAxis, zAxis } = {
@@ -169,27 +178,27 @@ export default (
169
178
  yAxis: defaultValueAxis,
170
179
  }
171
180
  ) => ({
172
- name: 'axes',
173
- displayName: '坐标轴',
181
+ name: "axes",
182
+ displayName: "坐标轴",
174
183
  value: [
175
184
  {
176
- name: 'xAxis',
177
- displayName: 'X轴',
185
+ name: "xAxis",
186
+ displayName: "X轴",
178
187
  value: categoryAxis(xAxis),
179
188
  },
180
189
  {
181
- name: 'yAxis',
182
- displayName: 'Y轴',
190
+ name: "yAxis",
191
+ displayName: "Y轴",
183
192
  value: valueAxis(yAxis),
184
193
  },
185
194
  zAxis && {
186
- name: 'zAxis',
187
- displayName: 'Z轴',
195
+ name: "zAxis",
196
+ displayName: "Z轴",
188
197
  value: valueAxis(zAxis),
189
198
  },
190
199
  ].filter((item) => !!item),
191
200
  config: {
192
- layout: 'horizontal',
201
+ layout: "horizontal",
193
202
  },
194
- type: 'menu',
203
+ type: "menu",
195
204
  });
package/src/font.js CHANGED
@@ -1,23 +1,23 @@
1
- const defaultFont = {
2
- fontFamily: 'SourceHanSansCN-Medium',
3
- fontSize: 12,
4
- color: 'rgba(230,247,255,0.7)',
5
- bold: false,
6
- italic: false,
7
- letterSpacing: 0,
8
- };
9
- export default ({
10
- fontFamily = defaultFont.fontFamily,
11
- fontSize = defaultFont.fontSize,
12
- color = defaultFont.color,
13
- bold = defaultFont.bold,
14
- italic = defaultFont.italic,
15
- letterSpacing = defaultFont.letterSpacing,
16
- } = defaultFont) => ({
17
- fontFamily,
18
- fontSize,
19
- color,
20
- bold,
21
- italic,
22
- letterSpacing,
23
- });
1
+ const defaultFont = {
2
+ fontFamily: 'SourceHanSansCN-Medium',
3
+ fontSize: 12,
4
+ color: 'rgba(230,247,255,0.7)',
5
+ bold: false,
6
+ italic: false,
7
+ letterSpacing: 0,
8
+ };
9
+ export default ({
10
+ fontFamily = defaultFont.fontFamily,
11
+ fontSize = defaultFont.fontSize,
12
+ color = defaultFont.color,
13
+ bold = defaultFont.bold,
14
+ italic = defaultFont.italic,
15
+ letterSpacing = defaultFont.letterSpacing,
16
+ } = defaultFont) => ({
17
+ fontFamily,
18
+ fontSize,
19
+ color,
20
+ bold,
21
+ italic,
22
+ letterSpacing,
23
+ });