@easyv/config 1.3.7 → 1.3.8
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/lib/animation.js +313 -0
- package/lib/axes.js +212 -0
- package/lib/axisLine.js +47 -0
- package/lib/baseLine.js +229 -0
- package/lib/brush.js +93 -0
- package/lib/control.js +128 -0
- package/lib/dimension.js +53 -0
- package/lib/extent.js +51 -0
- package/lib/font.js +38 -0
- package/lib/gridLine.js +57 -0
- package/lib/highlight.js +527 -0
- package/lib/imageGroup.js +54 -0
- package/lib/index.js +362 -0
- package/lib/interaction.js +117 -0
- package/lib/label.js +1094 -0
- package/lib/legend.js +1154 -0
- package/lib/mapping.js +40 -0
- package/lib/margin.js +66 -0
- package/lib/multiColor.js +49 -0
- package/lib/mutiColor.js +52 -0
- package/lib/pie.js +1051 -0
- package/lib/pieTooltip.js +323 -0
- package/lib/sc.js +29 -0
- package/lib/series.js +982 -0
- package/lib/shadow.js +30 -0
- package/lib/show.js +24 -0
- package/lib/textOverflow.js +45 -0
- package/lib/tickLine.js +59 -0
- package/lib/tooltip.js +500 -0
- package/lib/translate.js +74 -0
- package/lib/unit.js +88 -0
- package/package.json +1 -1
package/lib/baseLine.js
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _ = require(".");
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
+
var defaultBaseLine = {
|
|
13
|
+
line: {
|
|
14
|
+
yOrZ: 'y',
|
|
15
|
+
margin: {
|
|
16
|
+
marginLeft: 0,
|
|
17
|
+
marginRight: 100
|
|
18
|
+
},
|
|
19
|
+
lineType: 'dash',
|
|
20
|
+
color: '#FF781E',
|
|
21
|
+
lineWidth: 1,
|
|
22
|
+
strokeDasharray: '3,4'
|
|
23
|
+
},
|
|
24
|
+
dataStyle: {
|
|
25
|
+
label: {
|
|
26
|
+
show: true,
|
|
27
|
+
text: '平均值',
|
|
28
|
+
font: (0, _.font)({
|
|
29
|
+
color: 'rgba(255, 120, 30, 0.7)',
|
|
30
|
+
fontFamily: 'SourceHanSansCN-Medium',
|
|
31
|
+
fontSize: 12,
|
|
32
|
+
bold: false,
|
|
33
|
+
italic: false,
|
|
34
|
+
letterSpacing: 0
|
|
35
|
+
}),
|
|
36
|
+
translate: {
|
|
37
|
+
x: 4,
|
|
38
|
+
y: 1
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
data: {
|
|
42
|
+
show: false,
|
|
43
|
+
font: (0, _.font)(),
|
|
44
|
+
translate: {
|
|
45
|
+
x: 0,
|
|
46
|
+
y: 0
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var _default = function _default() {
|
|
52
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultBaseLine,
|
|
53
|
+
_ref$line = _ref.line;
|
|
54
|
+
_ref$line = _ref$line === void 0 ? defaultBaseLine.line : _ref$line;
|
|
55
|
+
var _ref$line$yOrZ = _ref$line.yOrZ,
|
|
56
|
+
yOrZ = _ref$line$yOrZ === void 0 ? defaultBaseLine.line.yOrZ : _ref$line$yOrZ,
|
|
57
|
+
_ref$line$margin = _ref$line.margin;
|
|
58
|
+
_ref$line$margin = _ref$line$margin === void 0 ? defaultBaseLine.line.margin : _ref$line$margin;
|
|
59
|
+
var _ref$line$margin$marg = _ref$line$margin.marginLeft,
|
|
60
|
+
marginLeft = _ref$line$margin$marg === void 0 ? defaultBaseLine.line.margin.marginLeft : _ref$line$margin$marg,
|
|
61
|
+
_ref$line$margin$marg2 = _ref$line$margin.marginRight,
|
|
62
|
+
marginRight = _ref$line$margin$marg2 === void 0 ? defaultBaseLine.line.margin.marginRight : _ref$line$margin$marg2,
|
|
63
|
+
_ref$line$lineType = _ref$line.lineType,
|
|
64
|
+
lineType = _ref$line$lineType === void 0 ? defaultBaseLine.line.lineType : _ref$line$lineType,
|
|
65
|
+
_ref$line$color = _ref$line.color,
|
|
66
|
+
color = _ref$line$color === void 0 ? defaultBaseLine.line.color : _ref$line$color,
|
|
67
|
+
_ref$line$lineWidth = _ref$line.lineWidth,
|
|
68
|
+
lineWidth = _ref$line$lineWidth === void 0 ? defaultBaseLine.line.lineWidth : _ref$line$lineWidth,
|
|
69
|
+
_ref$line$strokeDasha = _ref$line.strokeDasharray,
|
|
70
|
+
strokeDasharray = _ref$line$strokeDasha === void 0 ? defaultBaseLine.line.strokeDasharray : _ref$line$strokeDasha,
|
|
71
|
+
_ref$dataStyle = _ref.dataStyle;
|
|
72
|
+
_ref$dataStyle = _ref$dataStyle === void 0 ? defaultBaseLine.dataStyle : _ref$dataStyle;
|
|
73
|
+
var _ref$dataStyle$label = _ref$dataStyle.label,
|
|
74
|
+
_ref$dataStyle$label$ = _ref$dataStyle$label.showLabel,
|
|
75
|
+
showLabel = _ref$dataStyle$label$ === void 0 ? defaultBaseLine.dataStyle.label.show : _ref$dataStyle$label$,
|
|
76
|
+
_ref$dataStyle$label$2 = _ref$dataStyle$label.text,
|
|
77
|
+
text = _ref$dataStyle$label$2 === void 0 ? defaultBaseLine.dataStyle.label.text : _ref$dataStyle$label$2,
|
|
78
|
+
_ref$dataStyle$label$3 = _ref$dataStyle$label.textStyle,
|
|
79
|
+
textStyle = _ref$dataStyle$label$3 === void 0 ? defaultBaseLine.dataStyle.label.font : _ref$dataStyle$label$3,
|
|
80
|
+
_ref$dataStyle$label$4 = _ref$dataStyle$label.translate;
|
|
81
|
+
_ref$dataStyle$label$4 = _ref$dataStyle$label$4 === void 0 ? defaultBaseLine.dataStyle.label.translate : _ref$dataStyle$label$4;
|
|
82
|
+
var x = _ref$dataStyle$label$4.x,
|
|
83
|
+
y = _ref$dataStyle$label$4.y,
|
|
84
|
+
_ref$dataStyle$data = _ref$dataStyle.data;
|
|
85
|
+
_ref$dataStyle$data = _ref$dataStyle$data === void 0 ? defaultBaseLine.dataStyle.data : _ref$dataStyle$data;
|
|
86
|
+
var _ref$dataStyle$data$s = _ref$dataStyle$data.showData,
|
|
87
|
+
showData = _ref$dataStyle$data$s === void 0 ? defaultBaseLine.dataStyle.data.show : _ref$dataStyle$data$s,
|
|
88
|
+
_ref$dataStyle$data$d = _ref$dataStyle$data.dataStyle,
|
|
89
|
+
dataStyle = _ref$dataStyle$data$d === void 0 ? defaultBaseLine.dataStyle.data.dataStyle : _ref$dataStyle$data$d,
|
|
90
|
+
_ref$dataStyle$data$d2 = _ref$dataStyle$data.dataTranslate;
|
|
91
|
+
_ref$dataStyle$data$d2 = _ref$dataStyle$data$d2 === void 0 ? defaultBaseLine.dataStyle.data.translate : _ref$dataStyle$data$d2;
|
|
92
|
+
var _ref$dataStyle$data$d3 = _ref$dataStyle$data$d2.x,
|
|
93
|
+
dataTranslateX = _ref$dataStyle$data$d3 === void 0 ? defaultBaseLine.dataStyle.data.translate.x : _ref$dataStyle$data$d3,
|
|
94
|
+
_ref$dataStyle$data$d4 = _ref$dataStyle$data$d2.y,
|
|
95
|
+
dataTranslateY = _ref$dataStyle$data$d4 === void 0 ? defaultBaseLine.dataStyle.data.translate.y : _ref$dataStyle$data$d4;
|
|
96
|
+
return [{
|
|
97
|
+
name: 'line',
|
|
98
|
+
displayName: '线样式',
|
|
99
|
+
config: {
|
|
100
|
+
layout: 'horizontal'
|
|
101
|
+
},
|
|
102
|
+
value: [{
|
|
103
|
+
name: 'yOrZ',
|
|
104
|
+
displayName: '纵轴选择',
|
|
105
|
+
value: yOrZ,
|
|
106
|
+
type: 'select',
|
|
107
|
+
config: {
|
|
108
|
+
options: [{
|
|
109
|
+
name: "X轴",
|
|
110
|
+
value: 'x'
|
|
111
|
+
}, {
|
|
112
|
+
name: 'Y轴',
|
|
113
|
+
value: 'y'
|
|
114
|
+
}, {
|
|
115
|
+
name: 'Z轴',
|
|
116
|
+
value: 'z'
|
|
117
|
+
}]
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
name: 'margin',
|
|
121
|
+
displayName: '边距',
|
|
122
|
+
type: 'group',
|
|
123
|
+
value: [{
|
|
124
|
+
type: 'number',
|
|
125
|
+
name: 'marginLeft',
|
|
126
|
+
displayName: '左',
|
|
127
|
+
value: marginLeft,
|
|
128
|
+
config: {
|
|
129
|
+
span: 12,
|
|
130
|
+
showStep: false
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
type: 'number',
|
|
134
|
+
name: 'marginRight',
|
|
135
|
+
displayName: '右',
|
|
136
|
+
value: marginRight,
|
|
137
|
+
config: {
|
|
138
|
+
span: 12,
|
|
139
|
+
showStep: false
|
|
140
|
+
}
|
|
141
|
+
}]
|
|
142
|
+
}, {
|
|
143
|
+
name: 'lineType',
|
|
144
|
+
displayName: '线样式',
|
|
145
|
+
value: lineType,
|
|
146
|
+
type: 'select',
|
|
147
|
+
config: {
|
|
148
|
+
options: [{
|
|
149
|
+
name: '实线',
|
|
150
|
+
value: 'solid'
|
|
151
|
+
}, {
|
|
152
|
+
name: '虚线',
|
|
153
|
+
value: 'dash'
|
|
154
|
+
}]
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
name: 'color',
|
|
158
|
+
displayName: '颜色',
|
|
159
|
+
value: color,
|
|
160
|
+
type: 'color',
|
|
161
|
+
markColorType: 'assistColor'
|
|
162
|
+
}, {
|
|
163
|
+
name: 'lineWidth',
|
|
164
|
+
displayName: '粗细',
|
|
165
|
+
value: lineWidth,
|
|
166
|
+
type: 'number',
|
|
167
|
+
config: {
|
|
168
|
+
data: 'px'
|
|
169
|
+
}
|
|
170
|
+
}, {
|
|
171
|
+
rule: [['lineType', '$eq', 'dash']],
|
|
172
|
+
name: 'strokeDasharray',
|
|
173
|
+
displayName: '虚线样式',
|
|
174
|
+
value: strokeDasharray,
|
|
175
|
+
type: 'input',
|
|
176
|
+
tip: '格式使用半角字符,如3,3'
|
|
177
|
+
}]
|
|
178
|
+
}, {
|
|
179
|
+
name: 'dataStyle',
|
|
180
|
+
displayName: '数据样式',
|
|
181
|
+
value: [{
|
|
182
|
+
name: 'label',
|
|
183
|
+
displayName: '标签',
|
|
184
|
+
config: {
|
|
185
|
+
defaultOpen: true
|
|
186
|
+
},
|
|
187
|
+
value: [{
|
|
188
|
+
name: 'show',
|
|
189
|
+
displayName: '显示',
|
|
190
|
+
value: showLabel,
|
|
191
|
+
type: 'boolean'
|
|
192
|
+
}, {
|
|
193
|
+
rule: [['show', '$eq', true]],
|
|
194
|
+
name: "label",
|
|
195
|
+
displayName: "标签内容",
|
|
196
|
+
type: 'input',
|
|
197
|
+
value: text
|
|
198
|
+
}, {
|
|
199
|
+
rule: [['show', '$eq', true]],
|
|
200
|
+
name: 'textStyle',
|
|
201
|
+
displayName: '文本样式',
|
|
202
|
+
value: (0, _.font)(textStyle),
|
|
203
|
+
type: 'textStyle',
|
|
204
|
+
markColorType: 'textColor'
|
|
205
|
+
}, _objectSpread({
|
|
206
|
+
rule: [['show', '$eq', true]]
|
|
207
|
+
}, (0, _.translate)(x, y))]
|
|
208
|
+
}, {
|
|
209
|
+
name: 'data',
|
|
210
|
+
displayName: '数值',
|
|
211
|
+
value: [{
|
|
212
|
+
name: 'show',
|
|
213
|
+
displayName: '显示',
|
|
214
|
+
value: showData,
|
|
215
|
+
type: 'boolean'
|
|
216
|
+
}, {
|
|
217
|
+
rule: [['show', '$eq', true]],
|
|
218
|
+
name: 'dataStyle',
|
|
219
|
+
displayName: '文本样式',
|
|
220
|
+
value: (0, _.font)(dataStyle),
|
|
221
|
+
type: 'textStyle',
|
|
222
|
+
markColorType: 'textColor'
|
|
223
|
+
}, _objectSpread({
|
|
224
|
+
rule: [['show', '$eq', true]]
|
|
225
|
+
}, (0, _.translate)(dataTranslateX, dataTranslateY))]
|
|
226
|
+
}]
|
|
227
|
+
}];
|
|
228
|
+
};
|
|
229
|
+
exports["default"] = _default;
|
package/lib/brush.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var defaultBrush = {
|
|
8
|
+
height: 20,
|
|
9
|
+
background: 'rgba(20, 95, 255, 0.1)',
|
|
10
|
+
margin: {
|
|
11
|
+
marginLeft: 40,
|
|
12
|
+
marginRight: 40
|
|
13
|
+
},
|
|
14
|
+
detail: {
|
|
15
|
+
width: 30,
|
|
16
|
+
color: 'rgba(255, 255, 255, 0.3)'
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
var _default = function _default() {
|
|
20
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultBrush,
|
|
21
|
+
_ref$height = _ref.height,
|
|
22
|
+
height = _ref$height === void 0 ? defaultBrush.height : _ref$height,
|
|
23
|
+
_ref$background = _ref.background,
|
|
24
|
+
background = _ref$background === void 0 ? defaultBrush.background : _ref$background,
|
|
25
|
+
_ref$margin = _ref.margin;
|
|
26
|
+
_ref$margin = _ref$margin === void 0 ? defaultBrush.margin : _ref$margin;
|
|
27
|
+
var _ref$margin$marginLef = _ref$margin.marginLeft,
|
|
28
|
+
marginLeft = _ref$margin$marginLef === void 0 ? defaultBrush.margin.marginLeft : _ref$margin$marginLef,
|
|
29
|
+
_ref$margin$marginRig = _ref$margin.marginRight,
|
|
30
|
+
marginRight = _ref$margin$marginRig === void 0 ? defaultBrush.margin.marginRight : _ref$margin$marginRig,
|
|
31
|
+
_ref$detail = _ref.detail;
|
|
32
|
+
_ref$detail = _ref$detail === void 0 ? defaultBrush.detail : _ref$detail;
|
|
33
|
+
var _ref$detail$width = _ref$detail.width,
|
|
34
|
+
width = _ref$detail$width === void 0 ? defaultBrush.detail.width : _ref$detail$width,
|
|
35
|
+
_ref$detail$color = _ref$detail.color,
|
|
36
|
+
color = _ref$detail$color === void 0 ? defaultBrush.detail.color : _ref$detail$color;
|
|
37
|
+
return {
|
|
38
|
+
name: 'brush',
|
|
39
|
+
displayName: '控制条',
|
|
40
|
+
value: [{
|
|
41
|
+
name: 'height',
|
|
42
|
+
displayName: '高度',
|
|
43
|
+
value: height,
|
|
44
|
+
type: 'number'
|
|
45
|
+
}, {
|
|
46
|
+
name: 'background',
|
|
47
|
+
displayName: '背景',
|
|
48
|
+
value: background,
|
|
49
|
+
type: 'color'
|
|
50
|
+
}, {
|
|
51
|
+
name: 'margin',
|
|
52
|
+
displayName: '间距',
|
|
53
|
+
value: [{
|
|
54
|
+
name: 'marginLeft',
|
|
55
|
+
displayName: '左',
|
|
56
|
+
value: marginLeft,
|
|
57
|
+
type: 'number',
|
|
58
|
+
config: {
|
|
59
|
+
span: 12
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
name: 'marginRight',
|
|
63
|
+
displayName: '右',
|
|
64
|
+
value: marginRight,
|
|
65
|
+
type: 'number',
|
|
66
|
+
config: {
|
|
67
|
+
span: 12
|
|
68
|
+
}
|
|
69
|
+
}],
|
|
70
|
+
type: 'group'
|
|
71
|
+
}, {
|
|
72
|
+
name: 'detail',
|
|
73
|
+
displayName: '详情区域',
|
|
74
|
+
value: [{
|
|
75
|
+
name: 'width',
|
|
76
|
+
displayName: '宽度',
|
|
77
|
+
value: width,
|
|
78
|
+
type: 'number',
|
|
79
|
+
config: {
|
|
80
|
+
suffix: '%',
|
|
81
|
+
min: 0,
|
|
82
|
+
max: 100
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
name: 'color',
|
|
86
|
+
displayName: '颜色',
|
|
87
|
+
value: color,
|
|
88
|
+
type: 'color'
|
|
89
|
+
}]
|
|
90
|
+
}]
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
exports["default"] = _default;
|
package/lib/control.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.control = void 0;
|
|
7
|
+
var defaultControl = {
|
|
8
|
+
height: 20,
|
|
9
|
+
color: "rgba(20, 95, 255, 0.1)",
|
|
10
|
+
margin: {
|
|
11
|
+
left: 40,
|
|
12
|
+
right: 40
|
|
13
|
+
},
|
|
14
|
+
gap: 20,
|
|
15
|
+
drag: {
|
|
16
|
+
start: 0,
|
|
17
|
+
width: 30,
|
|
18
|
+
color: "RGBA(255, 255, 255, .3)"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var control = function control() {
|
|
22
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultControl,
|
|
23
|
+
_ref$height = _ref.height,
|
|
24
|
+
height = _ref$height === void 0 ? defaultControl.height : _ref$height,
|
|
25
|
+
_ref$color = _ref.color,
|
|
26
|
+
color = _ref$color === void 0 ? defaultControl.color : _ref$color,
|
|
27
|
+
_ref$margin = _ref.margin;
|
|
28
|
+
_ref$margin = _ref$margin === void 0 ? defaultControl.margin : _ref$margin;
|
|
29
|
+
var _ref$margin$left = _ref$margin.left,
|
|
30
|
+
left = _ref$margin$left === void 0 ? defaultControl.margin.left : _ref$margin$left,
|
|
31
|
+
_ref$margin$right = _ref$margin.right,
|
|
32
|
+
right = _ref$margin$right === void 0 ? defaultControl.margin.right : _ref$margin$right,
|
|
33
|
+
_ref$gap = _ref.gap,
|
|
34
|
+
gap = _ref$gap === void 0 ? defaultControl.gap : _ref$gap,
|
|
35
|
+
_ref$drag = _ref.drag;
|
|
36
|
+
_ref$drag = _ref$drag === void 0 ? defaultControl.drag : _ref$drag;
|
|
37
|
+
var _ref$drag$start = _ref$drag.start,
|
|
38
|
+
start = _ref$drag$start === void 0 ? defaultControl.drag.start : _ref$drag$start,
|
|
39
|
+
_ref$drag$width = _ref$drag.width,
|
|
40
|
+
width = _ref$drag$width === void 0 ? defaultControl.drag.width : _ref$drag$width,
|
|
41
|
+
_ref$drag$color = _ref$drag.color,
|
|
42
|
+
dragColor = _ref$drag$color === void 0 ? defaultControl.drag.color : _ref$drag$color;
|
|
43
|
+
return {
|
|
44
|
+
name: "control",
|
|
45
|
+
displayName: "控制条",
|
|
46
|
+
value: [{
|
|
47
|
+
name: "height",
|
|
48
|
+
displayName: "高度",
|
|
49
|
+
value: height,
|
|
50
|
+
type: "number"
|
|
51
|
+
}, {
|
|
52
|
+
name: "color",
|
|
53
|
+
displayName: "背景颜色",
|
|
54
|
+
value: color,
|
|
55
|
+
type: "color"
|
|
56
|
+
}, {
|
|
57
|
+
type: "group",
|
|
58
|
+
name: "margin",
|
|
59
|
+
displayName: "边距",
|
|
60
|
+
value: [{
|
|
61
|
+
name: "left",
|
|
62
|
+
displayName: "左边距",
|
|
63
|
+
value: left,
|
|
64
|
+
type: "number",
|
|
65
|
+
config: {
|
|
66
|
+
span: 12
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
name: "right",
|
|
70
|
+
displayName: "右边距",
|
|
71
|
+
value: right,
|
|
72
|
+
type: "number",
|
|
73
|
+
config: {
|
|
74
|
+
span: 12
|
|
75
|
+
}
|
|
76
|
+
}]
|
|
77
|
+
}, {
|
|
78
|
+
name: "gap",
|
|
79
|
+
displayName: "上间距",
|
|
80
|
+
type: "number",
|
|
81
|
+
value: gap,
|
|
82
|
+
config: {
|
|
83
|
+
suffix: "px"
|
|
84
|
+
},
|
|
85
|
+
tip: "与X轴的距离"
|
|
86
|
+
}, {
|
|
87
|
+
"name": "thumbnail",
|
|
88
|
+
"displayName": "开启缩略图",
|
|
89
|
+
"value": true,
|
|
90
|
+
"type": "boolean"
|
|
91
|
+
}, {
|
|
92
|
+
name: "drag",
|
|
93
|
+
displayName: "详情区域",
|
|
94
|
+
value: [{
|
|
95
|
+
"name": "enableStretch",
|
|
96
|
+
"displayName": "启动拉伸",
|
|
97
|
+
"value": false,
|
|
98
|
+
"type": "boolean"
|
|
99
|
+
}, {
|
|
100
|
+
name: "start",
|
|
101
|
+
displayName: "起始位置",
|
|
102
|
+
value: start,
|
|
103
|
+
type: "range",
|
|
104
|
+
config: {
|
|
105
|
+
suffix: "%",
|
|
106
|
+
min: 0,
|
|
107
|
+
max: 100
|
|
108
|
+
}
|
|
109
|
+
}, {
|
|
110
|
+
name: "width",
|
|
111
|
+
displayName: "宽度",
|
|
112
|
+
value: width,
|
|
113
|
+
type: "range",
|
|
114
|
+
config: {
|
|
115
|
+
suffix: "%",
|
|
116
|
+
min: 1,
|
|
117
|
+
max: 100
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
name: "color",
|
|
121
|
+
displayName: "颜色",
|
|
122
|
+
value: dragColor,
|
|
123
|
+
type: "color"
|
|
124
|
+
}]
|
|
125
|
+
}]
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
exports.control = control;
|
package/lib/dimension.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var defaultDimension = {
|
|
8
|
+
width: 450,
|
|
9
|
+
height: 250,
|
|
10
|
+
left: 100,
|
|
11
|
+
top: 100
|
|
12
|
+
};
|
|
13
|
+
var _default = function _default() {
|
|
14
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultDimension,
|
|
15
|
+
_ref$width = _ref.width,
|
|
16
|
+
width = _ref$width === void 0 ? defaultDimension.width : _ref$width,
|
|
17
|
+
_ref$height = _ref.height,
|
|
18
|
+
height = _ref$height === void 0 ? defaultDimension.height : _ref$height,
|
|
19
|
+
_ref$left = _ref.left,
|
|
20
|
+
left = _ref$left === void 0 ? defaultDimension.left : _ref$left,
|
|
21
|
+
_ref$top = _ref.top,
|
|
22
|
+
top = _ref$top === void 0 ? defaultDimension.top : _ref$top;
|
|
23
|
+
return {
|
|
24
|
+
name: 'dimension',
|
|
25
|
+
displayName: '位置尺寸',
|
|
26
|
+
value: [{
|
|
27
|
+
name: 'chartPosition',
|
|
28
|
+
displayName: '图表位置',
|
|
29
|
+
value: [{
|
|
30
|
+
name: 'left',
|
|
31
|
+
displayName: 'X轴坐标',
|
|
32
|
+
value: left
|
|
33
|
+
}, {
|
|
34
|
+
name: 'top',
|
|
35
|
+
displayName: 'Y轴坐标',
|
|
36
|
+
value: top
|
|
37
|
+
}]
|
|
38
|
+
}, {
|
|
39
|
+
name: 'chartDimension',
|
|
40
|
+
displayName: '图表尺寸',
|
|
41
|
+
value: [{
|
|
42
|
+
name: 'width',
|
|
43
|
+
displayName: '宽度',
|
|
44
|
+
value: width
|
|
45
|
+
}, {
|
|
46
|
+
name: 'height',
|
|
47
|
+
displayName: '高度',
|
|
48
|
+
value: height
|
|
49
|
+
}]
|
|
50
|
+
}]
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
exports["default"] = _default;
|
package/lib/extent.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var extent = {
|
|
8
|
+
min: "0",
|
|
9
|
+
max: "",
|
|
10
|
+
customDisplayName: "数值范围",
|
|
11
|
+
customName: "extent",
|
|
12
|
+
customSuffix: ""
|
|
13
|
+
};
|
|
14
|
+
var _default = function _default() {
|
|
15
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : extent,
|
|
16
|
+
_ref$min = _ref.min,
|
|
17
|
+
min = _ref$min === void 0 ? extent.min : _ref$min,
|
|
18
|
+
_ref$max = _ref.max,
|
|
19
|
+
max = _ref$max === void 0 ? extent.max : _ref$max,
|
|
20
|
+
_ref$customDisplayNam = _ref.customDisplayName,
|
|
21
|
+
customDisplayName = _ref$customDisplayNam === void 0 ? extent.customDisplayName : _ref$customDisplayNam,
|
|
22
|
+
_ref$customName = _ref.customName,
|
|
23
|
+
customName = _ref$customName === void 0 ? extent.customName : _ref$customName,
|
|
24
|
+
_ref$customSuffix = _ref.customSuffix,
|
|
25
|
+
customSuffix = _ref$customSuffix === void 0 ? extent.customSuffix : _ref$customSuffix;
|
|
26
|
+
return {
|
|
27
|
+
name: customName,
|
|
28
|
+
displayName: customDisplayName,
|
|
29
|
+
value: [{
|
|
30
|
+
name: "min",
|
|
31
|
+
displayName: "最小值",
|
|
32
|
+
value: min,
|
|
33
|
+
type: "input",
|
|
34
|
+
config: {
|
|
35
|
+
span: 12,
|
|
36
|
+
suffix: customSuffix
|
|
37
|
+
}
|
|
38
|
+
}, {
|
|
39
|
+
name: "max",
|
|
40
|
+
displayName: "最大值",
|
|
41
|
+
value: max,
|
|
42
|
+
type: "input",
|
|
43
|
+
config: {
|
|
44
|
+
span: 12,
|
|
45
|
+
suffix: customSuffix
|
|
46
|
+
}
|
|
47
|
+
}],
|
|
48
|
+
type: "group"
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
exports["default"] = _default;
|
package/lib/font.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var defaultFont = {
|
|
8
|
+
fontFamily: 'SourceHanSansCN-Medium',
|
|
9
|
+
fontSize: 12,
|
|
10
|
+
color: 'rgba(230,247,255,0.7)',
|
|
11
|
+
bold: false,
|
|
12
|
+
italic: false,
|
|
13
|
+
letterSpacing: 0
|
|
14
|
+
};
|
|
15
|
+
var _default = function _default() {
|
|
16
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultFont,
|
|
17
|
+
_ref$fontFamily = _ref.fontFamily,
|
|
18
|
+
fontFamily = _ref$fontFamily === void 0 ? defaultFont.fontFamily : _ref$fontFamily,
|
|
19
|
+
_ref$fontSize = _ref.fontSize,
|
|
20
|
+
fontSize = _ref$fontSize === void 0 ? defaultFont.fontSize : _ref$fontSize,
|
|
21
|
+
_ref$color = _ref.color,
|
|
22
|
+
color = _ref$color === void 0 ? defaultFont.color : _ref$color,
|
|
23
|
+
_ref$bold = _ref.bold,
|
|
24
|
+
bold = _ref$bold === void 0 ? defaultFont.bold : _ref$bold,
|
|
25
|
+
_ref$italic = _ref.italic,
|
|
26
|
+
italic = _ref$italic === void 0 ? defaultFont.italic : _ref$italic,
|
|
27
|
+
_ref$letterSpacing = _ref.letterSpacing,
|
|
28
|
+
letterSpacing = _ref$letterSpacing === void 0 ? defaultFont.letterSpacing : _ref$letterSpacing;
|
|
29
|
+
return {
|
|
30
|
+
fontFamily: fontFamily,
|
|
31
|
+
fontSize: fontSize,
|
|
32
|
+
color: color,
|
|
33
|
+
bold: bold,
|
|
34
|
+
italic: italic,
|
|
35
|
+
letterSpacing: letterSpacing
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
exports["default"] = _default;
|
package/lib/gridLine.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var gridLine = {
|
|
8
|
+
show: false,
|
|
9
|
+
strokeDasharray: '3,3',
|
|
10
|
+
color: 'rgba(230, 247, 255, 0.2)',
|
|
11
|
+
lineWidth: 1
|
|
12
|
+
};
|
|
13
|
+
var _default = function _default() {
|
|
14
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : gridLine,
|
|
15
|
+
_ref$show = _ref.show,
|
|
16
|
+
show = _ref$show === void 0 ? gridLine.show : _ref$show,
|
|
17
|
+
_ref$strokeDasharray = _ref.strokeDasharray,
|
|
18
|
+
strokeDasharray = _ref$strokeDasharray === void 0 ? gridLine.strokeDasharray : _ref$strokeDasharray,
|
|
19
|
+
_ref$color = _ref.color,
|
|
20
|
+
color = _ref$color === void 0 ? gridLine.color : _ref$color,
|
|
21
|
+
_ref$lineWidth = _ref.lineWidth,
|
|
22
|
+
lineWidth = _ref$lineWidth === void 0 ? gridLine.lineWidth : _ref$lineWidth;
|
|
23
|
+
return {
|
|
24
|
+
name: 'gridLine',
|
|
25
|
+
displayName: '网格线',
|
|
26
|
+
value: [{
|
|
27
|
+
name: 'show',
|
|
28
|
+
displayName: '显示',
|
|
29
|
+
value: show,
|
|
30
|
+
type: 'boolean'
|
|
31
|
+
}, {
|
|
32
|
+
rule: [['show', '$eq', true]],
|
|
33
|
+
name: 'strokeDasharray',
|
|
34
|
+
displayName: '虚线样式',
|
|
35
|
+
value: strokeDasharray,
|
|
36
|
+
type: 'input',
|
|
37
|
+
tip: '格式使用半角字符,如2,2'
|
|
38
|
+
}, {
|
|
39
|
+
rule: [['show', '$eq', true]],
|
|
40
|
+
name: 'color',
|
|
41
|
+
displayName: '颜色',
|
|
42
|
+
value: color,
|
|
43
|
+
type: 'color',
|
|
44
|
+
markColorType: 'gridColor'
|
|
45
|
+
}, {
|
|
46
|
+
rule: [['show', '$eq', true]],
|
|
47
|
+
name: 'lineWidth',
|
|
48
|
+
displayName: '粗细',
|
|
49
|
+
value: lineWidth,
|
|
50
|
+
type: 'number',
|
|
51
|
+
config: {
|
|
52
|
+
suffix: 'px'
|
|
53
|
+
}
|
|
54
|
+
}]
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
exports["default"] = _default;
|