@easyv/config 1.2.7 → 1.2.9
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/extent.js +9 -4
- package/lib/label.js +39 -3
- package/package.json +1 -1
- package/src/extent.js +29 -23
- package/src/label.js +73 -21
package/lib/extent.js
CHANGED
|
@@ -8,7 +8,8 @@ var extent = {
|
|
|
8
8
|
min: "0",
|
|
9
9
|
max: "",
|
|
10
10
|
customDisplayName: "数值范围",
|
|
11
|
-
customName: "extent"
|
|
11
|
+
customName: "extent",
|
|
12
|
+
customSuffix: ""
|
|
12
13
|
};
|
|
13
14
|
var _default = function _default() {
|
|
14
15
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : extent,
|
|
@@ -19,7 +20,9 @@ var _default = function _default() {
|
|
|
19
20
|
_ref$customDisplayNam = _ref.customDisplayName,
|
|
20
21
|
customDisplayName = _ref$customDisplayNam === void 0 ? extent.customDisplayName : _ref$customDisplayNam,
|
|
21
22
|
_ref$customName = _ref.customName,
|
|
22
|
-
customName = _ref$customName === void 0 ? extent.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;
|
|
23
26
|
return {
|
|
24
27
|
name: customName,
|
|
25
28
|
displayName: customDisplayName,
|
|
@@ -29,7 +32,8 @@ var _default = function _default() {
|
|
|
29
32
|
value: min,
|
|
30
33
|
type: "input",
|
|
31
34
|
config: {
|
|
32
|
-
span: 12
|
|
35
|
+
span: 12,
|
|
36
|
+
suffix: customSuffix
|
|
33
37
|
}
|
|
34
38
|
}, {
|
|
35
39
|
name: "max",
|
|
@@ -37,7 +41,8 @@ var _default = function _default() {
|
|
|
37
41
|
value: max,
|
|
38
42
|
type: "input",
|
|
39
43
|
config: {
|
|
40
|
-
span: 12
|
|
44
|
+
span: 12,
|
|
45
|
+
suffix: customSuffix
|
|
41
46
|
}
|
|
42
47
|
}],
|
|
43
48
|
type: "group"
|
package/lib/label.js
CHANGED
|
@@ -684,8 +684,13 @@ var defaultValueAxisLabel = {
|
|
|
684
684
|
min: "0",
|
|
685
685
|
max: ""
|
|
686
686
|
},
|
|
687
|
+
percentageExtent: {
|
|
688
|
+
min: 80,
|
|
689
|
+
max: 120
|
|
690
|
+
},
|
|
687
691
|
auto: false,
|
|
688
692
|
mode: "count",
|
|
693
|
+
numericalRangeModel: "value",
|
|
689
694
|
count: 3,
|
|
690
695
|
step: 100,
|
|
691
696
|
decimal: 0,
|
|
@@ -773,7 +778,7 @@ var valueCilpAsixLabel = function valueCilpAsixLabel() {
|
|
|
773
778
|
displayName: "断轴模式",
|
|
774
779
|
value: "manual",
|
|
775
780
|
type: "radio",
|
|
776
|
-
tip:
|
|
781
|
+
tip: "手动模式需要指定断轴值,如果断轴值在数据范围内,就会执行断轴,自动模式设置断轴阈值,当数据离散程度超过阈值的时候执行断轴",
|
|
777
782
|
config: {
|
|
778
783
|
options: [{
|
|
779
784
|
name: "手动模式",
|
|
@@ -792,7 +797,7 @@ var valueCilpAsixLabel = function valueCilpAsixLabel() {
|
|
|
792
797
|
}, {
|
|
793
798
|
name: "clipDifferenceValue",
|
|
794
799
|
displayName: "断轴差值",
|
|
795
|
-
tip:
|
|
800
|
+
tip: "差值越高,代表需要更大的数据离散程度才能触发断轴,反之同理",
|
|
796
801
|
type: "number",
|
|
797
802
|
value: 100,
|
|
798
803
|
config: {
|
|
@@ -880,10 +885,18 @@ var valueAsixLabel = function valueAsixLabel() {
|
|
|
880
885
|
min = _ref6$extent$min === void 0 ? defaultValueAxisLabel.extent.min : _ref6$extent$min,
|
|
881
886
|
_ref6$extent$max = _ref6$extent.max,
|
|
882
887
|
max = _ref6$extent$max === void 0 ? defaultValueAxisLabel.extent.max : _ref6$extent$max,
|
|
888
|
+
_ref6$percentageExten = _ref6.percentageExtent;
|
|
889
|
+
_ref6$percentageExten = _ref6$percentageExten === void 0 ? defaultValueAxisLabel.percentageExtent : _ref6$percentageExten;
|
|
890
|
+
var _ref6$percentageExten2 = _ref6$percentageExten.min,
|
|
891
|
+
percentMin = _ref6$percentageExten2 === void 0 ? defaultValueAxisLabel.percentageExtent.min : _ref6$percentageExten2,
|
|
892
|
+
_ref6$percentageExten3 = _ref6$percentageExten.max,
|
|
893
|
+
percentMax = _ref6$percentageExten3 === void 0 ? defaultValueAxisLabel.percentageExtent.max : _ref6$percentageExten3,
|
|
883
894
|
_ref6$auto = _ref6.auto,
|
|
884
895
|
auto = _ref6$auto === void 0 ? defaultValueAxisLabel.auto : _ref6$auto,
|
|
885
896
|
_ref6$mode = _ref6.mode,
|
|
886
897
|
mode = _ref6$mode === void 0 ? defaultValueAxisLabel.mode : _ref6$mode,
|
|
898
|
+
_ref6$numericalRangeM = _ref6.numericalRangeModel,
|
|
899
|
+
numericalRangeModel = _ref6$numericalRangeM === void 0 ? defaultValueAxisLabel.numericalRangeModel : _ref6$numericalRangeM,
|
|
887
900
|
_ref6$count = _ref6.count,
|
|
888
901
|
count = _ref6$count === void 0 ? defaultValueAxisLabel.count : _ref6$count,
|
|
889
902
|
_ref6$step = _ref6.step,
|
|
@@ -908,11 +921,34 @@ var valueAsixLabel = function valueAsixLabel() {
|
|
|
908
921
|
displayName: "显示",
|
|
909
922
|
value: showLabel,
|
|
910
923
|
type: "boolean"
|
|
924
|
+
}, {
|
|
925
|
+
rule: [["show", "$eq", true]],
|
|
926
|
+
name: "numericalRangeModel",
|
|
927
|
+
displayName: "范围模式",
|
|
928
|
+
value: numericalRangeModel,
|
|
929
|
+
type: "radio",
|
|
930
|
+
tip: "真实值模式会取填入的值来作为轴的最大最小值,而百分比模式会取数据中最小值乘上数值范围中的最小值百分比作为作为轴的最小值,最大值同理",
|
|
931
|
+
config: {
|
|
932
|
+
options: [{
|
|
933
|
+
name: "真实值",
|
|
934
|
+
value: "value"
|
|
935
|
+
}, {
|
|
936
|
+
name: "百分比",
|
|
937
|
+
value: "percentage"
|
|
938
|
+
}]
|
|
939
|
+
}
|
|
911
940
|
}, _objectSpread({
|
|
912
|
-
rule: [["show", "$eq", true]]
|
|
941
|
+
rule: [["show", "$eq", true], ["numericalRangeModel", "$eq", "value"]]
|
|
913
942
|
}, (0, _.extent)({
|
|
914
943
|
min: min,
|
|
915
944
|
max: max
|
|
945
|
+
})), _objectSpread({
|
|
946
|
+
rule: [["show", "$eq", true], ["numericalRangeModel", "$eq", "percentage"]]
|
|
947
|
+
}, (0, _.extent)({
|
|
948
|
+
min: percentMin,
|
|
949
|
+
max: percentMax,
|
|
950
|
+
customSuffix: '%',
|
|
951
|
+
customName: 'percentageExtent'
|
|
916
952
|
})), {
|
|
917
953
|
rule: [["show", "$eq", true]],
|
|
918
954
|
name: "auto",
|
package/package.json
CHANGED
package/src/extent.js
CHANGED
|
@@ -3,34 +3,40 @@ const extent = {
|
|
|
3
3
|
max: "",
|
|
4
4
|
customDisplayName: "数值范围",
|
|
5
5
|
customName: "extent",
|
|
6
|
+
customSuffix: "",
|
|
6
7
|
};
|
|
7
8
|
export default ({
|
|
8
9
|
min = extent.min,
|
|
9
10
|
max = extent.max,
|
|
10
11
|
customDisplayName = extent.customDisplayName,
|
|
11
12
|
customName = extent.customName,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
customSuffix = extent.customSuffix,
|
|
14
|
+
} = extent) => {
|
|
15
|
+
return {
|
|
16
|
+
name: customName,
|
|
17
|
+
displayName: customDisplayName,
|
|
18
|
+
value: [
|
|
19
|
+
{
|
|
20
|
+
name: "min",
|
|
21
|
+
displayName: "最小值",
|
|
22
|
+
value: min,
|
|
23
|
+
type: "input",
|
|
24
|
+
config: {
|
|
25
|
+
span: 12,
|
|
26
|
+
suffix: customSuffix,
|
|
27
|
+
},
|
|
23
28
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
{
|
|
30
|
+
name: "max",
|
|
31
|
+
displayName: "最大值",
|
|
32
|
+
value: max,
|
|
33
|
+
type: "input",
|
|
34
|
+
config: {
|
|
35
|
+
span: 12,
|
|
36
|
+
suffix: customSuffix,
|
|
37
|
+
},
|
|
32
38
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
39
|
+
],
|
|
40
|
+
type: "group",
|
|
41
|
+
};
|
|
42
|
+
};
|
package/src/label.js
CHANGED
|
@@ -73,11 +73,18 @@ export default ({
|
|
|
73
73
|
_rule: [["show", "$eq", true]],
|
|
74
74
|
...translate(x, y),
|
|
75
75
|
},
|
|
76
|
-
sc(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
sc(
|
|
77
|
+
"suffix",
|
|
78
|
+
"后缀",
|
|
79
|
+
"",
|
|
80
|
+
[
|
|
81
|
+
sc("content", "内容", "input", ""),
|
|
82
|
+
sc("font", "字体样式", "textStyle", font()),
|
|
83
|
+
translate(),
|
|
84
|
+
],
|
|
85
|
+
{ defaultOpen: true },
|
|
86
|
+
showRule()
|
|
87
|
+
),
|
|
81
88
|
].filter((item) => !!item),
|
|
82
89
|
});
|
|
83
90
|
|
|
@@ -650,19 +657,33 @@ export const axisLabel = ({
|
|
|
650
657
|
type: "boolean",
|
|
651
658
|
tip: "显示返回最新数据的轴标签",
|
|
652
659
|
},
|
|
653
|
-
sc(
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
660
|
+
sc(
|
|
661
|
+
"autoSort",
|
|
662
|
+
"自动排序",
|
|
663
|
+
"boolean",
|
|
664
|
+
autoSort,
|
|
665
|
+
{
|
|
666
|
+
other: {
|
|
667
|
+
tip: "数据按时间自动排序展示",
|
|
668
|
+
},
|
|
669
|
+
},
|
|
670
|
+
showRule()
|
|
671
|
+
),
|
|
672
|
+
sc(
|
|
673
|
+
"textAlign",
|
|
674
|
+
"对齐",
|
|
675
|
+
"radio",
|
|
676
|
+
textAlign,
|
|
677
|
+
{
|
|
678
|
+
mode: "icon",
|
|
679
|
+
options: [
|
|
680
|
+
{ name: "左对齐", value: "left", icon: "align-left" },
|
|
681
|
+
{ name: "居中对齐", value: "center", icon: "align-center" },
|
|
682
|
+
{ name: "右对齐", value: "right", icon: "align-right" },
|
|
683
|
+
],
|
|
684
|
+
},
|
|
685
|
+
showRule("show", "$eq", true)
|
|
686
|
+
),
|
|
666
687
|
{
|
|
667
688
|
rule: [["show", "$eq", true]],
|
|
668
689
|
...translate(labelTranslateX, labelTranslateY),
|
|
@@ -681,8 +702,10 @@ export const axisLabel = ({
|
|
|
681
702
|
const defaultValueAxisLabel = {
|
|
682
703
|
show: true,
|
|
683
704
|
extent: { min: "0", max: "" },
|
|
705
|
+
percentageExtent: { min: 80, max: 120 },
|
|
684
706
|
auto: false,
|
|
685
707
|
mode: "count",
|
|
708
|
+
numericalRangeModel: "value",
|
|
686
709
|
count: 3,
|
|
687
710
|
step: 100,
|
|
688
711
|
decimal: 0,
|
|
@@ -731,6 +754,7 @@ export const valueCilpAsixLabel = ({
|
|
|
731
754
|
value: showLabel,
|
|
732
755
|
type: "boolean",
|
|
733
756
|
},
|
|
757
|
+
|
|
734
758
|
{
|
|
735
759
|
rule: [["show", "$eq", true]],
|
|
736
760
|
...extent({ min, max }),
|
|
@@ -752,13 +776,12 @@ export const valueCilpAsixLabel = ({
|
|
|
752
776
|
displayName: "断轴模式",
|
|
753
777
|
value: "manual",
|
|
754
778
|
type: "radio",
|
|
755
|
-
tip:
|
|
779
|
+
tip: "手动模式需要指定断轴值,如果断轴值在数据范围内,就会执行断轴,自动模式设置断轴阈值,当数据离散程度超过阈值的时候执行断轴",
|
|
756
780
|
config: {
|
|
757
781
|
options: [
|
|
758
782
|
{ name: "手动模式", value: "manual" },
|
|
759
783
|
{ name: "自动模式", value: "auto" },
|
|
760
784
|
],
|
|
761
|
-
|
|
762
785
|
},
|
|
763
786
|
},
|
|
764
787
|
{
|
|
@@ -774,7 +797,7 @@ export const valueCilpAsixLabel = ({
|
|
|
774
797
|
{
|
|
775
798
|
name: "clipDifferenceValue",
|
|
776
799
|
displayName: "断轴差值",
|
|
777
|
-
tip:
|
|
800
|
+
tip: "差值越高,代表需要更大的数据离散程度才能触发断轴,反之同理",
|
|
778
801
|
type: "number",
|
|
779
802
|
value: 100,
|
|
780
803
|
config: {
|
|
@@ -888,8 +911,13 @@ export const valueAsixLabel = ({
|
|
|
888
911
|
min = defaultValueAxisLabel.extent.min,
|
|
889
912
|
max = defaultValueAxisLabel.extent.max,
|
|
890
913
|
} = defaultValueAxisLabel.extent,
|
|
914
|
+
percentageExtent: {
|
|
915
|
+
min: percentMin = defaultValueAxisLabel.percentageExtent.min,
|
|
916
|
+
max: percentMax = defaultValueAxisLabel.percentageExtent.max,
|
|
917
|
+
} = defaultValueAxisLabel.percentageExtent,
|
|
891
918
|
auto = defaultValueAxisLabel.auto,
|
|
892
919
|
mode = defaultValueAxisLabel.mode,
|
|
920
|
+
numericalRangeModel = defaultValueAxisLabel.numericalRangeModel,
|
|
893
921
|
count = defaultValueAxisLabel.count,
|
|
894
922
|
step = defaultValueAxisLabel.step,
|
|
895
923
|
decimal = defaultValueAxisLabel.decimal,
|
|
@@ -911,8 +939,32 @@ export const valueAsixLabel = ({
|
|
|
911
939
|
},
|
|
912
940
|
{
|
|
913
941
|
rule: [["show", "$eq", true]],
|
|
942
|
+
name: "numericalRangeModel",
|
|
943
|
+
displayName: "范围模式",
|
|
944
|
+
value: numericalRangeModel,
|
|
945
|
+
type: "radio",
|
|
946
|
+
tip: "真实值模式会取填入的值来作为轴的最大最小值,而百分比模式会取数据中最小值乘上数值范围中的最小值百分比作为作为轴的最小值,最大值同理",
|
|
947
|
+
config: {
|
|
948
|
+
options: [
|
|
949
|
+
{ name: "真实值", value: "value" },
|
|
950
|
+
{ name: "百分比", value: "percentage" },
|
|
951
|
+
],
|
|
952
|
+
},
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
rule: [
|
|
956
|
+
["show", "$eq", true],
|
|
957
|
+
["numericalRangeModel", "$eq", "value"],
|
|
958
|
+
],
|
|
914
959
|
...extent({ min, max }),
|
|
915
960
|
},
|
|
961
|
+
{
|
|
962
|
+
rule: [
|
|
963
|
+
["show", "$eq", true],
|
|
964
|
+
["numericalRangeModel", "$eq", "percentage"],
|
|
965
|
+
],
|
|
966
|
+
...extent({ min: percentMin, max: percentMax , customSuffix:'%',customName:'percentageExtent' }),
|
|
967
|
+
},
|
|
916
968
|
{
|
|
917
969
|
rule: [["show", "$eq", true]],
|
|
918
970
|
name: "auto",
|