@easyv/config 1.2.18 → 1.2.20

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.
@@ -0,0 +1,494 @@
1
+ import { multiColor, sc, showRule, font, show, translate } from ".";
2
+
3
+ const defaultConfig={
4
+ show:true,
5
+ defaultSelected:"",
6
+ showType:"bar",
7
+ // openStack:true,
8
+ barStyle:{
9
+ style:"square",
10
+ // paddingInner:1,
11
+ // seriesIntervalWidth:1,
12
+ fillType:"color",
13
+ fill:multiColor({
14
+ type:"pure",
15
+ pure:"#EDC20A"
16
+ }),
17
+ border:{
18
+ borderWidth:0,
19
+ borderColor:"#20ADFF"
20
+ },
21
+ url:"components/static-image/superChart/pattern.png",
22
+ size:{
23
+ width:10,
24
+ height:10
25
+ },
26
+ opacity:0.65
27
+ },
28
+ icon:{
29
+ show:true,
30
+ mode:"single",
31
+ image:"components/static-image/superChart/fang.png",
32
+ size:{
33
+ width:12,
34
+ height:12
35
+ },
36
+ inner:{
37
+ color:"#83C4FF",
38
+ radius:3
39
+ },
40
+ outer:{
41
+ color:"rgba(24,144,255,0.4)",
42
+ radius:6
43
+ },
44
+ color:"#00FFFF",
45
+ radius:4
46
+ },
47
+ headDecorate:{
48
+ show:true,
49
+ type:"image",
50
+ url:"",
51
+ video:"",
52
+ size:{
53
+ width:20,
54
+ height:20
55
+ },
56
+ translate:{x:0,y:0}
57
+ },
58
+ numlabel:{
59
+ show:true,
60
+ textStyle:font(),
61
+ position:"outerStart",
62
+ reverse:true,
63
+ translate:{x:0,y:0},
64
+ suffix:{
65
+ content:"",
66
+ font:font(),
67
+ translate:{x:0,y:0}
68
+ }
69
+ }
70
+ }
71
+ export default (isSuper=false,{
72
+ show:showConfig = defaultConfig.show,
73
+ defaultSelected = defaultConfig.defaultSelected,
74
+ showType = defaultConfig.showType,
75
+ // openStack = defaultConfig.openStack,
76
+ barStyle:{
77
+ style = defaultConfig.barStyle.type,
78
+ // paddingInner = defaultConfig.barStyle.paddingInner,
79
+ // seriesIntervalWidth = defaultConfig.barStyle.seriesIntervalWidth,
80
+ fillType = defaultConfig.barStyle.fillType,
81
+ fill = defaultConfig.barStyle.fill,
82
+ border:{
83
+ borderWidth = defaultConfig.barStyle.border.borderWidth,
84
+ borderColor = defaultConfig.barStyle.border.borderColor
85
+ } = defaultConfig.barStyle.border,
86
+ url = defaultConfig.barStyle.url,
87
+ size:{
88
+ width = defaultConfig.barStyle.size.width,
89
+ height = defaultConfig.barStyle.size.height
90
+ } = defaultConfig.barStyle.size,
91
+ opacity = defaultConfig.barStyle.opacity
92
+ } = defaultConfig.barStyle,
93
+ icon:{
94
+ show:showIcon = defaultConfig.icon.show,
95
+ mode = defaultConfig.icon.mode,
96
+ image = defaultConfig.icon.image,
97
+ size:{
98
+ width:iconWidth = defaultConfig.icon.size.width,
99
+ height:iconHeight = defaultConfig.icon.size.height
100
+ } = defaultConfig.icon.size,
101
+ inner:{
102
+ color:innerColor = defaultConfig.icon.inner.color,
103
+ radius:innerRadius = defaultConfig.icon.inner.radius
104
+ } = defaultConfig.icon.inner,
105
+ outer:{
106
+ color:outerColor = defaultConfig.icon.outer.color,
107
+ radius:outerRadius = defaultConfig.icon.outer.radius
108
+ } = defaultConfig.icon.outer,
109
+ color = defaultConfig.icon.color,
110
+ radius = defaultConfig.icon.radius
111
+ } = defaultConfig.icon,
112
+ headDecorate:{
113
+ show:showHead = defaultConfig.headDecorate.show,
114
+ type:headType = defaultConfig.headDecorate.type,
115
+ url:headUrl = defaultConfig.headDecorate.url,
116
+ video = defaultConfig.headDecorate.video,
117
+ size:{
118
+ width:headWidth = defaultConfig.headDecorate.size.width,
119
+ height:headHeight = defaultConfig.headDecorate.size.height
120
+ } = defaultConfig.headDecorate.size,
121
+ translate:{
122
+ x = defaultConfig.headDecorate.translate.x,
123
+ y = defaultConfig.headDecorate.translate.y
124
+ } = defaultConfig.headDecorate.translate
125
+ } = defaultConfig.headDecorate,
126
+ numlabel:{
127
+ show:showLabel = defaultConfig.numlabel.show,
128
+ textStyle = defaultConfig.numlabel.textStyle,
129
+ position = defaultConfig.numlabel.position,
130
+ reverse = defaultConfig.numlabel.reverse,
131
+ translate:{
132
+ x:labelX = defaultConfig.numlabel.translate.x,
133
+ y:labelY = defaultConfig.numlabel.translate.y
134
+ } = defaultConfig.numlabel.translate,
135
+ suffix:{
136
+ content = defaultConfig.numlabel.suffix.content,
137
+ font:suffixFont = defaultConfig.numlabel.suffix.font,
138
+ translate:{
139
+ x:suffixX = defaultConfig.numlabel.suffix.translate.x,
140
+ y:suffixY = defaultConfig.numlabel.suffix.translate.x
141
+ } = defaultConfig.numlabel.suffix.translate
142
+ } = defaultConfig.numlabel.suffix
143
+ } = defaultConfig.numlabel
144
+ } = defaultConfig)=>{
145
+ return sc("selectStyle","点击选中样式","",[
146
+ show(showConfig),
147
+ sc("defaultSelected","默认选中","input",defaultSelected,{other:{tip:"输入X轴的标签,则选中那一列"}},showRule()),
148
+ sc("showType","类型","radio",showType,{mode:"button",options:[
149
+ {name:"柱状",value:"bar"},
150
+ {name:"折线",value:"line"},
151
+ {name:"面积",value:"area"}
152
+ ]},isSuper?showRule():showRule("hidden","$eq",true)),
153
+ // sc("openStack","开启堆叠","boolean",openStack,{},{rule:[["show","$eq",true],["showType","$eq","bar"]]}),
154
+ sc("barStyle","柱状样式","",[
155
+ {
156
+ name: 'style',
157
+ displayName: '类型',
158
+ value: style,
159
+ type: 'select',
160
+ config: {
161
+ options: [
162
+ { name: '方形', value: 'square' },
163
+ { name: '子弹头', value: 'round' },
164
+ ],
165
+ },
166
+ },
167
+ // {
168
+ // name: 'paddingInner',
169
+ // displayName: '柱间间距',
170
+ // value: paddingInner,
171
+ // type: 'number',
172
+ // config: {
173
+ // step: 0.01,
174
+ // },
175
+ // },
176
+ // {
177
+ // name: 'seriesIntervalWidth',
178
+ // displayName: '系列间距',
179
+ // value: seriesIntervalWidth,
180
+ // type: 'number',
181
+ // config: {
182
+ // step: 0.01,
183
+ // },
184
+ // },
185
+ {
186
+ name: 'fillType',
187
+ displayName: '填充样式',
188
+ value: fillType,
189
+ type: 'radio',
190
+ config: {
191
+ options: [
192
+ { name: '颜色', value: 'color' },
193
+ { name: '纹理', value: 'pattern' },
194
+ ],
195
+ },
196
+ },
197
+ {
198
+ rule: [['fillType', '$eq', 'color']],
199
+ name: 'fill',
200
+ displayName: '柱子颜色',
201
+ type: 'multicolor',
202
+ value: fill,
203
+ markColorType: 'seriesGradient',
204
+ },
205
+ {
206
+ rule: [['fillType', '$eq', 'color']],
207
+ name: 'border',
208
+ displayName: '描边',
209
+ value:[
210
+ {
211
+ name:"borderWidth",
212
+ displayName:"线宽",
213
+ type:"number",
214
+ value:borderWidth,
215
+ config:{ min:0 }
216
+ },
217
+ {
218
+ name:"borderColor",
219
+ displayName:"描边颜色",
220
+ type:"color",
221
+ value:borderColor
222
+ }
223
+ ]
224
+ },
225
+ {
226
+ rule: [['fillType', '$eq', 'pattern']],
227
+ name: 'url',
228
+ displayName: '纹理图片',
229
+ type: 'uploadImage',
230
+ value: url,
231
+ },
232
+ {
233
+ rule: [['fillType', '$eq', 'pattern']],
234
+ name: 'size',
235
+ displayName: '尺寸',
236
+ value: [
237
+ {
238
+ name: 'width',
239
+ displayName: '宽度',
240
+ value: width,
241
+ config: { span: 12, suffix: 'W' },
242
+ },
243
+ {
244
+ name: 'height',
245
+ displayName: '高度',
246
+ value: height,
247
+ config: { span: 12, suffix: 'H' },
248
+ },
249
+ ],
250
+ type: 'group',
251
+ },
252
+ {
253
+ rule: [['fillType', '$eq', 'pattern']],
254
+ type: 'range',
255
+ name: 'opacity',
256
+ displayName: '透明度',
257
+ value: opacity,
258
+ config: { max: 1, min: 0, step: 0.01 },
259
+ },
260
+ ],{defaultOpen:true},{rule:[["show","$eq",true],["showType","$eq","bar"]]}),
261
+ sc("icon","数据标记","",[
262
+ {
263
+ name: 'show',
264
+ displayName: '显示',
265
+ value: showIcon,
266
+ type: 'boolean',
267
+ },
268
+ {
269
+ rule: [['show', '$eq', true]],
270
+ name: 'mode',
271
+ displayName: '模式',
272
+ value: mode,
273
+ type: 'select',
274
+ config: {
275
+ options: [
276
+ {
277
+ name: '单圆',
278
+ value: 'single',
279
+ },
280
+ {
281
+ name: '双圆',
282
+ value: 'double',
283
+ },
284
+ {
285
+ name: '自定义',
286
+ value: 'custom',
287
+ },
288
+ ],
289
+ },
290
+ },
291
+ {
292
+ rule: [
293
+ ['show', '$eq', true],
294
+ ['mode', '$eq', 'custom'],
295
+ ],
296
+ name: 'image',
297
+ displayName: '图片',
298
+ value: image,
299
+ type: 'uploadImage',
300
+ },
301
+ {
302
+ rule: [
303
+ ['show', '$eq', true],
304
+ ['mode', '$eq', 'custom'],
305
+ ],
306
+ name: 'size',
307
+ displayName: '尺寸',
308
+ value: [
309
+ {
310
+ name: 'width',
311
+ displayName: '宽度',
312
+ value: iconWidth,
313
+ config: {
314
+ span: 12,
315
+ suffix: 'W',
316
+ },
317
+ },
318
+ {
319
+ name: 'height',
320
+ displayName: '高度',
321
+ value: iconHeight,
322
+ config: {
323
+ span: 12,
324
+ suffix: 'H',
325
+ },
326
+ },
327
+ ],
328
+ type: 'group',
329
+ },
330
+ {
331
+ rule: [
332
+ ['show', '$eq', true],
333
+ ['mode', '$eq', 'double'],
334
+ ],
335
+ name: 'inner',
336
+ displayName: '内圆',
337
+ value: [
338
+ {
339
+ name: 'color',
340
+ displayName: '颜色',
341
+ value: innerColor,
342
+ type: 'color',
343
+ },
344
+ {
345
+ name: 'radius',
346
+ displayName: '半径',
347
+ value: innerRadius,
348
+ type: 'number',
349
+ config: {
350
+ min: 0,
351
+ suffix: 'px',
352
+ },
353
+ },
354
+ ],
355
+ },
356
+ {
357
+ rule: [
358
+ ['show', '$eq', true],
359
+ ['mode', '$eq', 'double'],
360
+ ],
361
+ name: 'outer',
362
+ displayName: '外圆',
363
+ value: [
364
+ {
365
+ name: 'color',
366
+ displayName: '颜色',
367
+ value: outerColor,
368
+ type: 'color',
369
+ },
370
+ {
371
+ name: 'radius',
372
+ displayName: '半径',
373
+ value: outerRadius,
374
+ type: 'number',
375
+ config: {
376
+ min: 0,
377
+ suffix: 'px',
378
+ },
379
+ },
380
+ ],
381
+ },
382
+ {
383
+ rule: [
384
+ ['show', '$eq', true],
385
+ ['mode', '$eq', 'single'],
386
+ ],
387
+ name: 'color',
388
+ displayName: '颜色',
389
+ value: color,
390
+ type: 'color',
391
+ markColorType: 'palette',
392
+ markColorType: 'palette',
393
+ },
394
+ {
395
+ rule: [
396
+ ['show', '$eq', true],
397
+ ['mode', '$eq', 'single'],
398
+ ],
399
+ name: 'radius',
400
+ displayName: '半径',
401
+ value: radius,
402
+ type: 'number',
403
+ config: {
404
+ min: 0,
405
+ suffix: 'px',
406
+ },
407
+ },
408
+ ],{defaultOpen:true},{rule:[["show","$eq",true],["showType","$neq","bar"]]}),
409
+ sc("headDecorate","头部装饰","",[
410
+ show(showHead),
411
+ sc("type","类型","radio",headType,{options:[
412
+ {name:"图片",value:"image"},
413
+ {name:"视频",value:"video"}
414
+ ]}),
415
+ sc("url","图片","image",headUrl,{},showRule("type","$eq","image")),
416
+ sc("video","视频","video",video,{},showRule("type","$eq","video")),
417
+ sc("size","尺寸","group",[
418
+ sc("width","宽","number",headWidth,{span:12,suffix:"px"}),
419
+ sc("height","高","number",headHeight,{span:12,suffix:"px"})
420
+ ]),
421
+ translate(x,y)
422
+ ],{},{rule:[["show","$eq",true],["showType","$eq","bar"]]}),
423
+ sc("numlabel","数值标签","",[
424
+ {
425
+ name: 'show',
426
+ displayName: '显示',
427
+ value: showLabel,
428
+ type: 'boolean',
429
+ },
430
+ {
431
+ rule: [['show', '$eq', true]],
432
+ name: 'font',
433
+ displayName: '文本样式',
434
+ type: 'textStyle',
435
+ value: textStyle,
436
+ },
437
+ {
438
+ name: "position",
439
+ displayName: "位置",
440
+ value: position,
441
+ type: "select",
442
+ config: {
443
+ options: [
444
+ { name: "起点", value: "start" },
445
+ { name: "居中", value: "middle" },
446
+ { name: "终点", value: "end" },
447
+ { name: "终点外", value: "outerStart" },
448
+ { name: "图表外", value: "chartStart" },
449
+ ],
450
+ },
451
+ },
452
+ {
453
+ rule:[["position","$neq","middle"],["position","$neq","chartStart"]],
454
+ name:"reverse",
455
+ displayName:"负值反向",
456
+ type:"boolean",
457
+ value:reverse,
458
+ tip:"开启后负值的标签会与正值对称显示"
459
+ },
460
+ {
461
+ name: 'translate',
462
+ displayName: '偏移',
463
+ type: 'group',
464
+ value: [
465
+ {
466
+ name: 'x',
467
+ displayName: 'X',
468
+ type: 'number',
469
+ value: labelX,
470
+ config: {
471
+ span: 12,
472
+ suffix: 'px',
473
+ },
474
+ },
475
+ {
476
+ name: 'y',
477
+ displayName: 'Y',
478
+ type: 'number',
479
+ value: labelY,
480
+ config: {
481
+ span: 12,
482
+ suffix: 'px',
483
+ },
484
+ },
485
+ ],
486
+ },
487
+ sc("suffix","后缀","",[
488
+ sc("content","内容","input",content),
489
+ sc("font","字体样式","textStyle",suffixFont),
490
+ translate(suffixX,suffixY)
491
+ ],{defaultOpen:true},showRule())
492
+ ],{},showRule())
493
+ ])
494
+ }
package/src/index.js CHANGED
@@ -49,6 +49,8 @@ import textOverflow from './textOverflow';
49
49
  import baseLine from './baseLine';
50
50
  import { control } from './control';
51
51
  import pieTooltip from './pieTooltip';
52
+ import highlight from './highlight';
53
+
52
54
  export {
53
55
  pieTooltip,
54
56
  control,
@@ -102,5 +104,6 @@ export {
102
104
  pieCurrent,
103
105
  sc,
104
106
  shadow,
105
- baseLine
107
+ baseLine,
108
+ highlight
106
109
  };
package/src/series.js CHANGED
@@ -1,4 +1,4 @@
1
- import { mapping, label, multiColor, imageGroup, show, shadow, sc, showRule } from '.';
1
+ import { mapping, label, multiColor, imageGroup, show, shadow, sc, showRule, translate } from '.';
2
2
 
3
3
  const _mapping = { fieldName: '', displayName: '' };
4
4