@easyv/config 1.0.48 → 1.0.53
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/CHANGELOG.md +9 -0
- package/lib/animation.js +2 -1
- package/lib/axisLine.js +2 -1
- package/lib/gridLine.js +2 -1
- package/lib/label.js +19 -13
- package/lib/legend.js +18 -10
- package/lib/pie.js +55 -49
- package/lib/series.js +34 -28
- package/lib/tickLine.js +2 -1
- package/lib/tooltip.js +8 -4
- package/lib/unit.js +2 -1
- package/package.json +7 -3
- package/src/animation.js +2 -1
- package/src/axisLine.js +1 -0
- package/src/gridLine.js +1 -0
- package/src/label.js +18 -12
- package/src/legend.js +27 -13
- package/src/pie.js +212 -182
- package/src/series.js +105 -100
- package/src/tickLine.js +1 -0
- package/src/tooltip.js +4 -0
- package/src/unit.js +1 -0
package/src/series.js
CHANGED
|
@@ -5,7 +5,6 @@ const _mapping = { fieldName: '', displayName: '' };
|
|
|
5
5
|
const defaultBandSeries = {
|
|
6
6
|
mapping: _mapping,
|
|
7
7
|
yOrZ: 'y',
|
|
8
|
-
stack: '',
|
|
9
8
|
fillImage: 'components/static-image/superChart/pattern.png',
|
|
10
9
|
fill: {
|
|
11
10
|
type: 'linear',
|
|
@@ -39,9 +38,9 @@ const defaultBandSeries = {
|
|
|
39
38
|
},
|
|
40
39
|
size: {
|
|
41
40
|
width: 10,
|
|
42
|
-
height: 10
|
|
41
|
+
height: 10,
|
|
43
42
|
},
|
|
44
|
-
opacity: 0.65
|
|
43
|
+
opacity: 0.65,
|
|
45
44
|
};
|
|
46
45
|
|
|
47
46
|
export const bandSeries = (
|
|
@@ -62,7 +61,7 @@ export const bandSeries = (
|
|
|
62
61
|
fill = defaultBandSeries.fill,
|
|
63
62
|
size: {
|
|
64
63
|
width: urlWidth = defaultBandSeries.size.width,
|
|
65
|
-
height: urlHeight = defaultBandSeries.size.height
|
|
64
|
+
height: urlHeight = defaultBandSeries.size.height,
|
|
66
65
|
} = defaultBandSeries.size,
|
|
67
66
|
opacity = defaultBandSeries.opacity,
|
|
68
67
|
highlight: {
|
|
@@ -107,21 +106,23 @@ export const bandSeries = (
|
|
|
107
106
|
],
|
|
108
107
|
},
|
|
109
108
|
},
|
|
110
|
-
fillType !== undefined &&{
|
|
109
|
+
fillType !== undefined && {
|
|
111
110
|
rule: [['fillType', '$eq', 'color']],
|
|
112
111
|
name: 'fill',
|
|
113
112
|
displayName: '颜色',
|
|
114
113
|
type: 'multicolor',
|
|
115
114
|
value: fill,
|
|
115
|
+
markColorType: 'seriesGradient',
|
|
116
|
+
|
|
116
117
|
},
|
|
117
|
-
fillType !== undefined &&{
|
|
118
|
+
fillType !== undefined && {
|
|
118
119
|
rule: [['fillType', '$eq', 'pattern']],
|
|
119
120
|
name: 'url',
|
|
120
121
|
displayName: '纹理图片',
|
|
121
122
|
type: 'uploadImage',
|
|
122
123
|
value: fillImage,
|
|
123
124
|
},
|
|
124
|
-
fillType !== undefined &&{
|
|
125
|
+
fillType !== undefined && {
|
|
125
126
|
rule: [['fillType', '$eq', 'pattern']],
|
|
126
127
|
name: 'size',
|
|
127
128
|
displayName: '尺寸',
|
|
@@ -141,19 +142,20 @@ export const bandSeries = (
|
|
|
141
142
|
],
|
|
142
143
|
type: 'group',
|
|
143
144
|
},
|
|
144
|
-
fillType !== undefined &&{
|
|
145
|
+
fillType !== undefined && {
|
|
145
146
|
rule: [['fillType', '$eq', 'pattern']],
|
|
146
|
-
type:
|
|
147
|
-
name:
|
|
148
|
-
displayName:
|
|
147
|
+
type: 'range',
|
|
148
|
+
name: 'opacity',
|
|
149
|
+
displayName: '透明度',
|
|
149
150
|
value: opacity,
|
|
150
|
-
config: { max: 1, min: 0, step: 0.01 }
|
|
151
|
+
config: { max: 1, min: 0, step: 0.01 },
|
|
151
152
|
},
|
|
152
|
-
patternType !== undefined && {
|
|
153
|
+
(patternType !== undefined || fillType === undefined) && {
|
|
153
154
|
name: 'fill',
|
|
154
155
|
displayName: '颜色',
|
|
155
156
|
type: 'multicolor',
|
|
156
157
|
value: fill,
|
|
158
|
+
markColorType: 'seriesGradient',
|
|
157
159
|
},
|
|
158
160
|
patternType !== undefined && {
|
|
159
161
|
name: 'patternType',
|
|
@@ -262,7 +264,7 @@ const defaultLineSeries = {
|
|
|
262
264
|
areaType: 'color',
|
|
263
265
|
size: {
|
|
264
266
|
width: 10,
|
|
265
|
-
height: 10
|
|
267
|
+
height: 10,
|
|
266
268
|
},
|
|
267
269
|
url: 'components/static-image/superChart/pattern.png',
|
|
268
270
|
opacity: 0.65,
|
|
@@ -290,8 +292,8 @@ const defaultIcon = {
|
|
|
290
292
|
image: 'components/static-image/superChart/fang.png',
|
|
291
293
|
size: {
|
|
292
294
|
width: 10,
|
|
293
|
-
height: 10
|
|
294
|
-
}
|
|
295
|
+
height: 10,
|
|
296
|
+
},
|
|
295
297
|
};
|
|
296
298
|
|
|
297
299
|
const commonLine = (
|
|
@@ -304,64 +306,65 @@ const commonLine = (
|
|
|
304
306
|
connectNulls = defaultLineSeries.line.connectNulls,
|
|
305
307
|
} = defaultLineSeries.line
|
|
306
308
|
) => [
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
},
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
name: 'color',
|
|
327
|
-
displayName: '颜色',
|
|
328
|
-
value: color,
|
|
329
|
-
type: 'color',
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
name: 'lineWidth',
|
|
333
|
-
displayName: '粗细',
|
|
334
|
-
value: lineWidth,
|
|
335
|
-
type: 'input',
|
|
336
|
-
config: {
|
|
337
|
-
suffix: 'px',
|
|
338
|
-
},
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
name: 'curve',
|
|
342
|
-
displayName: '曲线',
|
|
343
|
-
value: curve,
|
|
344
|
-
type: 'boolean',
|
|
309
|
+
{
|
|
310
|
+
name: 'type',
|
|
311
|
+
displayName: '类型',
|
|
312
|
+
value: type,
|
|
313
|
+
type: 'select',
|
|
314
|
+
config: {
|
|
315
|
+
options: [
|
|
316
|
+
{
|
|
317
|
+
name: '实线',
|
|
318
|
+
value: 'solid',
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: '虚线',
|
|
322
|
+
value: 'dash',
|
|
323
|
+
},
|
|
324
|
+
],
|
|
345
325
|
},
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
name: 'color',
|
|
329
|
+
displayName: '颜色',
|
|
330
|
+
value: color,
|
|
331
|
+
type: 'color',
|
|
332
|
+
markColorType: 'palette',
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
name: 'lineWidth',
|
|
336
|
+
displayName: '粗细',
|
|
337
|
+
value: lineWidth,
|
|
338
|
+
type: 'input',
|
|
339
|
+
config: {
|
|
340
|
+
suffix: 'px',
|
|
357
341
|
},
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: 'curve',
|
|
345
|
+
displayName: '曲线',
|
|
346
|
+
value: curve,
|
|
347
|
+
type: 'boolean',
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
rule: [['curve', '$eq', true]],
|
|
351
|
+
name: 'tension',
|
|
352
|
+
displayName: '曲线张力',
|
|
353
|
+
value: tension,
|
|
354
|
+
type: 'range',
|
|
355
|
+
config: {
|
|
356
|
+
min: 0,
|
|
357
|
+
max: 1,
|
|
358
|
+
step: 0.1,
|
|
363
359
|
},
|
|
364
|
-
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
name: 'connectNulls',
|
|
363
|
+
displayName: 'null值连接',
|
|
364
|
+
value: connectNulls,
|
|
365
|
+
type: 'boolean',
|
|
366
|
+
},
|
|
367
|
+
];
|
|
365
368
|
|
|
366
369
|
const lighter = (
|
|
367
370
|
{
|
|
@@ -387,6 +390,7 @@ const lighter = (
|
|
|
387
390
|
displayName: '颜色',
|
|
388
391
|
type: 'multicolor',
|
|
389
392
|
value: fill,
|
|
393
|
+
markColorType: 'seriesGradient',
|
|
390
394
|
},
|
|
391
395
|
{
|
|
392
396
|
rule: [['show', '$eq', true]],
|
|
@@ -428,8 +432,8 @@ const icon = ({
|
|
|
428
432
|
image = defaultIcon.image,
|
|
429
433
|
size: {
|
|
430
434
|
width: imageWidth = defaultIcon.size.width,
|
|
431
|
-
height: imageHeight = defaultIcon.size.height
|
|
432
|
-
} = defaultIcon.size
|
|
435
|
+
height: imageHeight = defaultIcon.size.height,
|
|
436
|
+
} = defaultIcon.size,
|
|
433
437
|
} = defaultIcon) => ({
|
|
434
438
|
name: 'icon',
|
|
435
439
|
displayName: '数据标记',
|
|
@@ -643,9 +647,9 @@ export const areaSeries = (
|
|
|
643
647
|
url = defaultLineSeries.url,
|
|
644
648
|
size: {
|
|
645
649
|
width: urlWidth = defaultLineSeries.size.width,
|
|
646
|
-
height: urlHeight = defaultLineSeries.size.height
|
|
650
|
+
height: urlHeight = defaultLineSeries.size.height,
|
|
647
651
|
} = defaultLineSeries.size,
|
|
648
|
-
opacity = defaultLineSeries.opacity
|
|
652
|
+
opacity = defaultLineSeries.opacity,
|
|
649
653
|
} = defaultLineSeries
|
|
650
654
|
) => ({
|
|
651
655
|
name,
|
|
@@ -665,16 +669,16 @@ export const areaSeries = (
|
|
|
665
669
|
},
|
|
666
670
|
},
|
|
667
671
|
{
|
|
668
|
-
name:
|
|
669
|
-
displayName:
|
|
672
|
+
name: 'areaType',
|
|
673
|
+
displayName: '区域样式',
|
|
670
674
|
value: areaType,
|
|
671
675
|
type: 'radio',
|
|
672
676
|
config: {
|
|
673
677
|
options: [
|
|
674
|
-
{ name:
|
|
675
|
-
{ name:
|
|
676
|
-
]
|
|
677
|
-
}
|
|
678
|
+
{ name: '颜色', value: 'color' },
|
|
679
|
+
{ name: '纹理', value: 'pattern' },
|
|
680
|
+
],
|
|
681
|
+
},
|
|
678
682
|
},
|
|
679
683
|
{
|
|
680
684
|
rule: [['areaType', '$eq', 'color']],
|
|
@@ -682,15 +686,14 @@ export const areaSeries = (
|
|
|
682
686
|
displayName: '区域颜色',
|
|
683
687
|
type: 'multicolor',
|
|
684
688
|
value: areaColor,
|
|
689
|
+
markColorType: 'seriesGradient',
|
|
685
690
|
},
|
|
686
691
|
{
|
|
687
|
-
rule: [
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
name: "url",
|
|
691
|
-
displayName: "纹理图片",
|
|
692
|
+
rule: [['areaType', '$eq', 'pattern']],
|
|
693
|
+
name: 'url',
|
|
694
|
+
displayName: '纹理图片',
|
|
692
695
|
value: url,
|
|
693
|
-
type:
|
|
696
|
+
type: 'uploadImage',
|
|
694
697
|
},
|
|
695
698
|
{
|
|
696
699
|
rule: [['areaType', '$eq', 'pattern']],
|
|
@@ -714,11 +717,11 @@ export const areaSeries = (
|
|
|
714
717
|
},
|
|
715
718
|
{
|
|
716
719
|
rule: [['areaType', '$eq', 'pattern']],
|
|
717
|
-
type:
|
|
718
|
-
name:
|
|
719
|
-
displayName:
|
|
720
|
+
type: 'range',
|
|
721
|
+
name: 'opacity',
|
|
722
|
+
displayName: '透明度',
|
|
720
723
|
value: opacity,
|
|
721
|
-
config: { max: 1, min: 0, step: 0.01 }
|
|
724
|
+
config: { max: 1, min: 0, step: 0.01 },
|
|
722
725
|
},
|
|
723
726
|
{
|
|
724
727
|
name: 'line',
|
|
@@ -732,7 +735,7 @@ export const areaSeries = (
|
|
|
732
735
|
tension,
|
|
733
736
|
connectNulls,
|
|
734
737
|
}),
|
|
735
|
-
|
|
738
|
+
lineLighter && lighter(lineLighter),
|
|
736
739
|
].filter((item) => !!item),
|
|
737
740
|
},
|
|
738
741
|
label(areaLabel),
|
|
@@ -764,7 +767,7 @@ export const pieSeries = (
|
|
|
764
767
|
displayName = defaultPieSeries.mapping.displayName,
|
|
765
768
|
} = defaultPieSeries.mapping,
|
|
766
769
|
color = defaultPieSeries.color,
|
|
767
|
-
currentColor
|
|
770
|
+
currentColor,
|
|
768
771
|
} = defaultPieSeries
|
|
769
772
|
) => ({
|
|
770
773
|
name: name,
|
|
@@ -776,20 +779,21 @@ export const pieSeries = (
|
|
|
776
779
|
displayName: currentColor != undefined ? '默认颜色' : '颜色',
|
|
777
780
|
type: 'multicolor',
|
|
778
781
|
value: multiColor(color),
|
|
782
|
+
markColorType: 'seriesGradient',
|
|
779
783
|
},
|
|
780
784
|
currentColor != undefined && {
|
|
781
785
|
name: 'currentColor',
|
|
782
786
|
displayName: '当前颜色',
|
|
783
|
-
type:
|
|
784
|
-
value: multiColor(currentColor)
|
|
785
|
-
}
|
|
787
|
+
type: 'multicolor',
|
|
788
|
+
value: multiColor(currentColor),
|
|
789
|
+
},
|
|
786
790
|
].filter((item) => !!item),
|
|
787
791
|
type: 'object',
|
|
788
792
|
});
|
|
789
793
|
|
|
790
794
|
const defaultPurePieSeries = {
|
|
791
795
|
mapping: _mapping,
|
|
792
|
-
color:
|
|
796
|
+
color: '#fff',
|
|
793
797
|
};
|
|
794
798
|
export const purePieSeries = (
|
|
795
799
|
name = Math.random() + '',
|
|
@@ -798,7 +802,7 @@ export const purePieSeries = (
|
|
|
798
802
|
fieldName = defaultPurePieSeries.mapping.fieldName,
|
|
799
803
|
displayName = defaultPurePieSeries.mapping.displayName,
|
|
800
804
|
} = defaultPurePieSeries.mapping,
|
|
801
|
-
color = defaultPurePieSeries.color
|
|
805
|
+
color = defaultPurePieSeries.color,
|
|
802
806
|
} = defaultPurePieSeries
|
|
803
807
|
) => ({
|
|
804
808
|
name: name,
|
|
@@ -810,7 +814,8 @@ export const purePieSeries = (
|
|
|
810
814
|
displayName: '填充',
|
|
811
815
|
type: 'color',
|
|
812
816
|
value: color,
|
|
813
|
-
|
|
817
|
+
markColorType: 'palette',
|
|
818
|
+
},
|
|
814
819
|
],
|
|
815
820
|
type: 'object',
|
|
816
|
-
});
|
|
821
|
+
});
|
package/src/tickLine.js
CHANGED
package/src/tooltip.js
CHANGED
|
@@ -221,6 +221,7 @@ export default ({
|
|
|
221
221
|
letterSpacing: xAxisLetterSpacing,
|
|
222
222
|
},
|
|
223
223
|
type: 'textStyle',
|
|
224
|
+
markColorType: 'textColor',
|
|
224
225
|
},
|
|
225
226
|
{
|
|
226
227
|
name: 'align',
|
|
@@ -275,6 +276,7 @@ export default ({
|
|
|
275
276
|
letterSpacing: nameLetterSpacing,
|
|
276
277
|
},
|
|
277
278
|
type: 'textStyle',
|
|
279
|
+
markColorType: 'textColor',
|
|
278
280
|
},
|
|
279
281
|
{
|
|
280
282
|
name: 'value',
|
|
@@ -288,6 +290,7 @@ export default ({
|
|
|
288
290
|
letterSpacing: valueFontLetterSpacing,
|
|
289
291
|
},
|
|
290
292
|
type: 'textStyle',
|
|
293
|
+
markColorType: 'textColor',
|
|
291
294
|
},
|
|
292
295
|
{
|
|
293
296
|
name: 'suffix',
|
|
@@ -386,6 +389,7 @@ export default ({
|
|
|
386
389
|
letterSpacing: suffixLetterSpacing,
|
|
387
390
|
},
|
|
388
391
|
type: 'textStyle',
|
|
392
|
+
markColorType: 'textColor',
|
|
389
393
|
},
|
|
390
394
|
translate(x, y),
|
|
391
395
|
],
|