@easyv/config 1.2.6 → 1.2.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/src/index.js CHANGED
@@ -1,106 +1,106 @@
1
- import show, { showRule } from './show';
2
- import font from './font';
3
- import translate, { translate3d } from './translate';
4
- import gridLine from './gridLine';
5
- import tickLine from './tickLine';
6
- import axisLine from './axisLine';
7
- import extent from './extent';
8
- import unit from './unit';
9
- import margin from './margin';
10
- import multiColor from './multiColor';
11
- import animation, {
12
- dataAnimation,
13
- animationOfPie,
14
- animationOfCarousel,
15
- } from './animation';
16
- import dimension from './dimension';
17
- import label, {
18
- labelOfPie,
19
- labelOfRose,
20
- axisLabel,
21
- valueAsixLabel,
22
- } from './label';
23
- import legend, { legendOfPie, legendOfRose, legendOfDoublePie } from './legend';
24
- import tooltip from './tooltip';
25
- import axes, { valueAxis, categoryAxis } from './axes';
26
- import mapping from './mapping';
27
- import { imageGroup } from './imageGroup';
28
- import {
29
- bandSeries,
30
- lineSeries,
31
- areaSeries,
32
- pieSeries,
33
- purePieSeries,
34
- } from './series';
35
- import pie, {
36
- rosePie,
37
- rosePieDecorate,
38
- donut,
39
- carouselDonut,
40
- nestRosePie,
41
- carouselDonut2,
42
- current as pieCurrent,
43
- } from './pie';
44
- import brush from './brush';
45
- import interaction from './interaction';
46
- import sc from './sc';
47
- import shadow from './shadow';
48
- import textOverflow from './textOverflow';
49
- import baseLine from './baseLine';
50
- import { control } from './control';
51
- import pieTooltip from './pieTooltip';
52
- export {
53
- pieTooltip,
54
- control,
55
- show,
56
- showRule,
57
- font,
58
- tooltip,
59
- translate,
60
- translate3d,
61
- textOverflow,
62
- extent,
63
- unit,
64
- margin,
65
- multiColor,
66
- animation,
67
- dataAnimation,
68
- animationOfPie,
69
- animationOfCarousel,
70
- dimension,
71
- gridLine,
72
- tickLine,
73
- axisLine,
74
- valueAxis,
75
- categoryAxis,
76
- axes,
77
- imageGroup,
78
- mapping,
79
- bandSeries,
80
- lineSeries,
81
- areaSeries,
82
- pieSeries,
83
- purePieSeries,
84
- brush,
85
- interaction,
86
- legend,
87
- legendOfPie,
88
- legendOfRose,
89
- legendOfDoublePie,
90
- label,
91
- labelOfPie,
92
- labelOfRose,
93
- axisLabel,
94
- valueAsixLabel,
95
- pie,
96
- rosePie,
97
- nestRosePie,
98
- rosePieDecorate,
99
- donut,
100
- carouselDonut,
101
- carouselDonut2,
102
- pieCurrent,
103
- sc,
104
- shadow,
105
- baseLine
106
- };
1
+ import show, { showRule } from './show';
2
+ import font from './font';
3
+ import translate, { translate3d } from './translate';
4
+ import gridLine from './gridLine';
5
+ import tickLine from './tickLine';
6
+ import axisLine from './axisLine';
7
+ import extent from './extent';
8
+ import unit from './unit';
9
+ import margin from './margin';
10
+ import multiColor from './multiColor';
11
+ import animation, {
12
+ dataAnimation,
13
+ animationOfPie,
14
+ animationOfCarousel,
15
+ } from './animation';
16
+ import dimension from './dimension';
17
+ import label, {
18
+ labelOfPie,
19
+ labelOfRose,
20
+ axisLabel,
21
+ valueAsixLabel,
22
+ } from './label';
23
+ import legend, { legendOfPie, legendOfRose, legendOfDoublePie } from './legend';
24
+ import tooltip from './tooltip';
25
+ import axes, { valueAxis, categoryAxis } from './axes';
26
+ import mapping from './mapping';
27
+ import { imageGroup } from './imageGroup';
28
+ import {
29
+ bandSeries,
30
+ lineSeries,
31
+ areaSeries,
32
+ pieSeries,
33
+ purePieSeries,
34
+ } from './series';
35
+ import pie, {
36
+ rosePie,
37
+ rosePieDecorate,
38
+ donut,
39
+ carouselDonut,
40
+ nestRosePie,
41
+ carouselDonut2,
42
+ current as pieCurrent,
43
+ } from './pie';
44
+ import brush from './brush';
45
+ import interaction from './interaction';
46
+ import sc from './sc';
47
+ import shadow from './shadow';
48
+ import textOverflow from './textOverflow';
49
+ import baseLine from './baseLine';
50
+ import { control } from './control';
51
+ import pieTooltip from './pieTooltip';
52
+ export {
53
+ pieTooltip,
54
+ control,
55
+ show,
56
+ showRule,
57
+ font,
58
+ tooltip,
59
+ translate,
60
+ translate3d,
61
+ textOverflow,
62
+ extent,
63
+ unit,
64
+ margin,
65
+ multiColor,
66
+ animation,
67
+ dataAnimation,
68
+ animationOfPie,
69
+ animationOfCarousel,
70
+ dimension,
71
+ gridLine,
72
+ tickLine,
73
+ axisLine,
74
+ valueAxis,
75
+ categoryAxis,
76
+ axes,
77
+ imageGroup,
78
+ mapping,
79
+ bandSeries,
80
+ lineSeries,
81
+ areaSeries,
82
+ pieSeries,
83
+ purePieSeries,
84
+ brush,
85
+ interaction,
86
+ legend,
87
+ legendOfPie,
88
+ legendOfRose,
89
+ legendOfDoublePie,
90
+ label,
91
+ labelOfPie,
92
+ labelOfRose,
93
+ axisLabel,
94
+ valueAsixLabel,
95
+ pie,
96
+ rosePie,
97
+ nestRosePie,
98
+ rosePieDecorate,
99
+ donut,
100
+ carouselDonut,
101
+ carouselDonut2,
102
+ pieCurrent,
103
+ sc,
104
+ shadow,
105
+ baseLine
106
+ };
@@ -1,121 +1,121 @@
1
- /**
2
- * TODO:有个触发回调的类型
3
- */
4
- const defaultAction = 'click';
5
- const defaultCallback = {
6
- actions: [{ name: '鼠标点击', value: defaultAction }],
7
- extraInput: [],
8
- };
9
-
10
- export default ({ callback, remoteControl }) => ({
11
- name: 'interaction',
12
- displayName: '交互',
13
- value:
14
- callback || remoteControl
15
- ? [
16
- callback &&
17
- Array.isArray(callback.callback) && {
18
- name: 'callback',
19
- displayName: '回调参数',
20
- type: 'array',
21
- value: callback.callback.map(({ origin, target }, index) => ({
22
- name: 'callback_' + index,
23
- displayName: '回调',
24
- type: 'object',
25
- value: [
26
- {
27
- name: 'actions',
28
- displayName: '匹配动作',
29
- type: 'select',
30
- value: callback.value || defaultAction,
31
- config: {
32
- options: callback.actions
33
- ? callback.actions
34
- : defaultCallback.actions,
35
- },
36
- },
37
- {
38
- name: 'origin',
39
- displayName: '字段值',
40
- type: 'input',
41
- value: origin,
42
- },
43
- {
44
- name: 'target',
45
- displayName: '变量名',
46
- type: 'input',
47
- value: target,
48
- },
49
- ...(callback.extraInput
50
- ? callback.extraInput
51
- : defaultCallback.extraInput),
52
- ],
53
- })),
54
- config: {
55
- template: [
56
- {
57
- name: 'callback',
58
- displayName: '回调',
59
- type: 'object',
60
- value: [
61
- {
62
- name: 'actions',
63
- displayName: '匹配动作',
64
- type: 'select',
65
- value: callback.value || defaultAction,
66
- config: {
67
- options: callback.actions
68
- ? callback.actions
69
- : defaultCallback.actions,
70
- },
71
- },
72
- {
73
- name: 'origin',
74
- displayName: '字段值',
75
- type: 'input',
76
- value: '',
77
- },
78
- {
79
- name: 'target',
80
- displayName: '变量名',
81
- type: 'input',
82
- value: '',
83
- config:{
84
- callback:true
85
- }
86
- },
87
- ...(callback.extraInput
88
- ? callback.extraInput
89
- : defaultCallback.extraInput),
90
- ],
91
- },
92
- ],
93
- },
94
- },
95
- remoteControl &&
96
- Array.isArray(remoteControl) && {
97
- name: 'remoteControl',
98
- displayName: '远程控制',
99
- type: 'array',
100
- value: [],
101
- config: {
102
- template: [
103
- {
104
- name: 'controls',
105
- displayName: '控制',
106
- type: 'object',
107
- value: [
108
- {
109
- name: 'control',
110
- displayName: '控制',
111
- type: 'remoteOptions',
112
- value: '{}',
113
- },
114
- ],
115
- },
116
- ],
117
- },
118
- },
119
- ].filter((item) => !!item)
120
- : [],
121
- });
1
+ /**
2
+ * TODO:有个触发回调的类型
3
+ */
4
+ const defaultAction = 'click';
5
+ const defaultCallback = {
6
+ actions: [{ name: '鼠标点击', value: defaultAction }],
7
+ extraInput: [],
8
+ };
9
+
10
+ export default ({ callback, remoteControl }) => ({
11
+ name: 'interaction',
12
+ displayName: '交互',
13
+ value:
14
+ callback || remoteControl
15
+ ? [
16
+ callback &&
17
+ Array.isArray(callback.callback) && {
18
+ name: 'callback',
19
+ displayName: '回调参数',
20
+ type: 'array',
21
+ value: callback.callback.map(({ origin, target }, index) => ({
22
+ name: 'callback_' + index,
23
+ displayName: '回调',
24
+ type: 'object',
25
+ value: [
26
+ {
27
+ name: 'actions',
28
+ displayName: '匹配动作',
29
+ type: 'select',
30
+ value: callback.value || defaultAction,
31
+ config: {
32
+ options: callback.actions
33
+ ? callback.actions
34
+ : defaultCallback.actions,
35
+ },
36
+ },
37
+ {
38
+ name: 'origin',
39
+ displayName: '字段值',
40
+ type: 'input',
41
+ value: origin,
42
+ },
43
+ {
44
+ name: 'target',
45
+ displayName: '变量名',
46
+ type: 'input',
47
+ value: target,
48
+ },
49
+ ...(callback.extraInput
50
+ ? callback.extraInput
51
+ : defaultCallback.extraInput),
52
+ ],
53
+ })),
54
+ config: {
55
+ template: [
56
+ {
57
+ name: 'callback',
58
+ displayName: '回调',
59
+ type: 'object',
60
+ value: [
61
+ {
62
+ name: 'actions',
63
+ displayName: '匹配动作',
64
+ type: 'select',
65
+ value: callback.value || defaultAction,
66
+ config: {
67
+ options: callback.actions
68
+ ? callback.actions
69
+ : defaultCallback.actions,
70
+ },
71
+ },
72
+ {
73
+ name: 'origin',
74
+ displayName: '字段值',
75
+ type: 'input',
76
+ value: '',
77
+ },
78
+ {
79
+ name: 'target',
80
+ displayName: '变量名',
81
+ type: 'input',
82
+ value: '',
83
+ config:{
84
+ callback:true
85
+ }
86
+ },
87
+ ...(callback.extraInput
88
+ ? callback.extraInput
89
+ : defaultCallback.extraInput),
90
+ ],
91
+ },
92
+ ],
93
+ },
94
+ },
95
+ remoteControl &&
96
+ Array.isArray(remoteControl) && {
97
+ name: 'remoteControl',
98
+ displayName: '远程控制',
99
+ type: 'array',
100
+ value: [],
101
+ config: {
102
+ template: [
103
+ {
104
+ name: 'controls',
105
+ displayName: '控制',
106
+ type: 'object',
107
+ value: [
108
+ {
109
+ name: 'control',
110
+ displayName: '控制',
111
+ type: 'remoteOptions',
112
+ value: '{}',
113
+ },
114
+ ],
115
+ },
116
+ ],
117
+ },
118
+ },
119
+ ].filter((item) => !!item)
120
+ : [],
121
+ });
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("suffix","后缀","",[
77
- sc("content","内容","input",""),
78
- sc("font","字体样式","textStyle",font()),
79
- translate()
80
- ],{defaultOpen:true},showRule())
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("autoSort","自动排序","boolean",autoSort,{
654
- other:{
655
- tip:"数据按时间自动排序展示"
656
- }
657
- },showRule()),
658
- sc("textAlign","对齐","radio",textAlign,{
659
- mode:"icon",
660
- options:[
661
- {name:"左对齐",value:"left",icon:"align-left"},
662
- {name:"居中对齐",value:"center",icon:"align-center"},
663
- {name:"右对齐",value:"right",icon:"align-right"}
664
- ]
665
- },showRule("show","$eq",true)),
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: "percentage",
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",
package/src/pie.js CHANGED
@@ -174,6 +174,7 @@ const gridLine = ({
174
174
 
175
175
  const defaultRoseAxis = {
176
176
  axis: {
177
+ layout:"ring",
177
178
  count: 6,
178
179
  textStyle: font(),
179
180
  gap: 10,
@@ -192,6 +193,7 @@ const defaultRoseAxis = {
192
193
 
193
194
  const roseCategoryAxis = ({
194
195
  axis: {
196
+ layout = defaultRoseAxis.axis.layout,
195
197
  textStyle = defaultRoseAxis.axis.textStyle,
196
198
  gap = defaultRoseAxis.axis.gap,
197
199
  axisLine: axisLine_ = defaultRoseAxis.axis.axisline,
@@ -201,6 +203,12 @@ const roseCategoryAxis = ({
201
203
  name: 'categoryAxis',
202
204
  displayName: '类目轴',
203
205
  value: [
206
+ sc("layout","布局","radio",layout,{
207
+ options:[
208
+ {name:"环形",value:'ring'},
209
+ {name:"横排",value:"line"}
210
+ ]
211
+ }),
204
212
  {
205
213
  name: 'textStyle',
206
214
  displayName: '标签文本',