@easyv/config 1.0.49 → 1.0.54

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/pie.js CHANGED
@@ -1,4 +1,11 @@
1
- import { font, show as showConfig, showRule, translate as translateConfig, axisLine, sc } from './';
1
+ import {
2
+ font,
3
+ show as showConfig,
4
+ showRule,
5
+ translate as translateConfig,
6
+ axisLine,
7
+ sc,
8
+ } from './';
2
9
 
3
10
  const defaultBasePie = {
4
11
  chart: {
@@ -69,19 +76,19 @@ const basePie = ({
69
76
  });
70
77
 
71
78
  const defaultBaseRose = {
72
- chart:{
79
+ chart: {
73
80
  innerRadius: 0,
74
81
  outerRadius: 1,
75
- padAngle: 2
76
- }
77
- }
78
- const baseRose=({
82
+ padAngle: 2,
83
+ },
84
+ };
85
+ const baseRose = ({
79
86
  chart: {
80
87
  innerRadius = defaultBaseRose.chart.innerRadius,
81
88
  outerRadius = defaultBaseRose.chart.outerRadius,
82
89
  padAngle = defaultBaseRose.chart.padAngle,
83
90
  } = defaultBaseRose.chart,
84
- } = defaultBaseRose)=>({
91
+ } = defaultBaseRose) => ({
85
92
  name: 'chart',
86
93
  displayName: '饼图',
87
94
  value: [
@@ -123,18 +130,18 @@ const baseRose=({
123
130
  config: {
124
131
  defaultOpen: true,
125
132
  },
126
- })
133
+ });
127
134
 
128
- const defaultGridLine={
135
+ const defaultGridLine = {
129
136
  show: true,
130
137
  color: '#BAE7FF',
131
138
  lineWidth: 1,
132
139
  };
133
- const gridLine=({
140
+ const gridLine = ({
134
141
  show = defaultGridLine.show,
135
142
  color = defaultGridLine.color,
136
- lineWidth = defaultGridLine.lineWidth
137
- }=defaultGridLine)=>({
143
+ lineWidth = defaultGridLine.lineWidth,
144
+ } = defaultGridLine) => ({
138
145
  name: 'gridLine',
139
146
  displayName: '网格线',
140
147
  value: [
@@ -162,118 +169,120 @@ const gridLine=({
162
169
  },
163
170
  },
164
171
  ],
165
- })
172
+ });
166
173
 
167
174
  const defaultRoseAxis = {
168
- axis:{
169
- count:6,
170
- textStyle:font(),
171
- gap:10,
172
- axisline:{
175
+ axis: {
176
+ count: 6,
177
+ textStyle: font(),
178
+ gap: 10,
179
+ axisline: {
173
180
  show: true,
174
181
  color: '#BAE7FF',
175
182
  lineWidth: 1,
176
183
  },
177
- gridLine:{
178
- show:true,
184
+ gridLine: {
185
+ show: true,
179
186
  color: '#BAE7FF',
180
- lineWidth: 1
181
- }
182
- }
183
- }
187
+ lineWidth: 1,
188
+ },
189
+ },
190
+ };
184
191
 
185
192
  const roseCategoryAxis = ({
186
- axis:{
193
+ axis: {
187
194
  textStyle = defaultRoseAxis.axis.textStyle,
188
195
  gap = defaultRoseAxis.axis.gap,
189
196
  axisLine: axisLine_ = defaultRoseAxis.axis.axisline,
190
- gridLine: gridLine_ = defaultRoseAxis.axis.gridLine
191
- }=defaultRoseAxis.axis
192
- }=defaultRoseAxis)=>({
193
- name:"categoryAxis",
194
- displayName:"类目轴",
195
- value:[
196
- {
197
- name:"textStyle",
198
- displayName:"标签文本",
199
- value:font(textStyle),
200
- type:"textStyle"
201
- },
202
- {
203
- name:"gap",
204
- displayName:"边距",
205
- value:gap,
206
- type:"number",
207
- config:{
208
- suffix:"px"
209
- }
197
+ gridLine: gridLine_ = defaultRoseAxis.axis.gridLine,
198
+ } = defaultRoseAxis.axis,
199
+ } = defaultRoseAxis) => ({
200
+ name: 'categoryAxis',
201
+ displayName: '类目轴',
202
+ value: [
203
+ {
204
+ name: 'textStyle',
205
+ displayName: '标签文本',
206
+ value: font(textStyle),
207
+ type: 'textStyle',
208
+ markColorType: 'textColor'
209
+ },
210
+ {
211
+ name: 'gap',
212
+ displayName: '边距',
213
+ value: gap,
214
+ type: 'number',
215
+ config: {
216
+ suffix: 'px',
217
+ },
210
218
  },
211
219
  axisLine(axisLine_),
212
- gridLine(gridLine_)
220
+ gridLine(gridLine_),
213
221
  ],
214
222
  config: {
215
223
  defaultOpen: true,
216
- }
217
- })
224
+ },
225
+ });
218
226
 
219
227
  const roseValueAxis = ({
220
- axis:{
228
+ axis: {
221
229
  count = defaultRoseAxis.axis.count,
222
230
  textStyle = defaultRoseAxis.axis.textStyle,
223
231
  gap = defaultRoseAxis.axis.gap,
224
232
  axisLine: axisLine_ = defaultRoseAxis.axis.axisline,
225
- gridLine: gridLine_ = defaultRoseAxis.axis.gridLine
226
- }=defaultRoseAxis.axis
227
- } = defaultRoseAxis)=>({
228
- name:"valueAxis",
229
- displayName:"数值轴",
230
- value:[
233
+ gridLine: gridLine_ = defaultRoseAxis.axis.gridLine,
234
+ } = defaultRoseAxis.axis,
235
+ } = defaultRoseAxis) => ({
236
+ name: 'valueAxis',
237
+ displayName: '数值轴',
238
+ value: [
231
239
  {
232
- name:"count",
233
- displayName:"数量",
234
- value:count,
235
- type:"number"
240
+ name: 'count',
241
+ displayName: '数量',
242
+ value: count,
243
+ type: 'number',
236
244
  },
237
245
  {
238
- name:"textStyle",
239
- displayName:"标签文本",
240
- value:font(textStyle),
241
- type:"textStyle"
246
+ name: 'textStyle',
247
+ displayName: '标签文本',
248
+ value: font(textStyle),
249
+ type: 'textStyle',
250
+ markColorType: 'textColor'
242
251
  },
243
252
  {
244
- name:"gap",
245
- displayName:"边距",
246
- value:gap,
247
- type:"number",
248
- config:{
249
- suffix:"px"
250
- }
253
+ name: 'gap',
254
+ displayName: '边距',
255
+ value: gap,
256
+ type: 'number',
257
+ config: {
258
+ suffix: 'px',
259
+ },
251
260
  },
252
261
  axisLine(axisLine_),
253
- gridLine(gridLine_)
262
+ gridLine(gridLine_),
254
263
  ],
255
264
  config: {
256
265
  defaultOpen: true,
257
- }
258
- })
266
+ },
267
+ });
259
268
 
260
269
  const defaultCategoryText = {
261
270
  categoryText: {
262
- show:true,
263
- font:font(),
264
- gap:10
265
- }
266
- }
267
- const categoryText=({
271
+ show: true,
272
+ font: font(),
273
+ gap: 10,
274
+ },
275
+ };
276
+ const categoryText = ({
268
277
  categoryText: {
269
278
  show = defaultCategoryText.categoryText.show,
270
279
  font = defaultCategoryText.categoryText.font,
271
- gap = defaultCategoryText.categoryText.gap
280
+ gap = defaultCategoryText.categoryText.gap,
272
281
  } = defaultCategoryText,
273
- })=>({
282
+ }) => ({
274
283
  name: 'categoryText',
275
- displayName:'类目文本',
276
- value:[
284
+ displayName: '类目文本',
285
+ value: [
277
286
  {
278
287
  name: 'show',
279
288
  displayName: '显示',
@@ -285,7 +294,8 @@ const categoryText=({
285
294
  name: 'textStyle',
286
295
  displayName: '文本样式',
287
296
  value: font,
288
- type:"textStyle"
297
+ type: 'textStyle',
298
+ markColorType: 'textColor'
289
299
  },
290
300
  {
291
301
  ...showRule(),
@@ -293,12 +303,12 @@ const categoryText=({
293
303
  displayName: '间距',
294
304
  value: gap,
295
305
  type: 'number',
296
- config:{
297
- suffix:"px"
298
- }
299
- }
300
- ]
301
- })
306
+ config: {
307
+ suffix: 'px',
308
+ },
309
+ },
310
+ ],
311
+ });
302
312
 
303
313
  const defaultDecorate = {
304
314
  decorate: {
@@ -409,7 +419,7 @@ const defaultDecorate2 = {
409
419
  const decorate2 = ({
410
420
  show = defaultDecorate2.show,
411
421
  radiusWidth = defaultDecorate2.radiusWidth,
412
- opacity = defaultDecorate2.opacity
422
+ opacity = defaultDecorate2.opacity,
413
423
  }) => ({
414
424
  name: 'decorate2',
415
425
  displayName: '装饰物',
@@ -428,7 +438,7 @@ const decorate2 = ({
428
438
  type: 'range',
429
439
  config: {
430
440
  min: 0,
431
- max: 100
441
+ max: 100,
432
442
  },
433
443
  },
434
444
  {
@@ -440,10 +450,10 @@ const decorate2 = ({
440
450
  config: {
441
451
  min: 0,
442
452
  max: 100,
443
- suffix: "%",
453
+ suffix: '%',
444
454
  },
445
- }
446
- ]
455
+ },
456
+ ],
447
457
  });
448
458
 
449
459
  const defaultCurrent = {
@@ -477,8 +487,8 @@ export const current = ({
477
487
  name: {
478
488
  show: showName = defaultCurrent.current.name.show,
479
489
  font: nameFont = defaultCurrent.current.name.font,
480
- translate: nameTranslate ,
481
- textBreak
490
+ translate: nameTranslate,
491
+ textBreak,
482
492
  } = defaultCurrent.current.name,
483
493
  percent: {
484
494
  show: showPercent = defaultCurrent.current.percent.show,
@@ -528,16 +538,20 @@ export const current = ({
528
538
  displayName: '文本样式',
529
539
  value: nameFont,
530
540
  type: 'textStyle',
541
+ markColorType: 'textColor',
531
542
  },
532
- nameTranslate!=undefined && {
543
+ nameTranslate != undefined && {
533
544
  ...showRule(),
534
- ...translateConfig(nameTranslate.x,nameTranslate.y)
545
+ ...translateConfig(nameTranslate.x, nameTranslate.y),
535
546
  },
536
- textBreak!=undefined && {
547
+ textBreak != undefined && {
537
548
  ...showRule(),
538
- ...sc("textBreak","首行字数","number",textBreak,{min:0,suffix:"个"})
539
- }
540
- ].filter(item=>!!item),
549
+ ...sc('textBreak', '首行字数', 'number', textBreak, {
550
+ min: 0,
551
+ suffix: '个',
552
+ }),
553
+ },
554
+ ].filter((item) => !!item),
541
555
  },
542
556
  {
543
557
  rule: [['show', '$eq', true]],
@@ -561,6 +575,7 @@ export const current = ({
561
575
  displayName: '文本样式',
562
576
  value: percentFont,
563
577
  type: 'textStyle',
578
+ markColorType: 'textColor',
564
579
  },
565
580
  {
566
581
  rule: [['show', '$eq', true]],
@@ -580,6 +595,7 @@ export const current = ({
580
595
  displayName: '文本样式',
581
596
  value: valueFont,
582
597
  type: 'textStyle',
598
+ markColorType: 'textColor',
583
599
  },
584
600
  {
585
601
  rule: [['show', '$eq', true]],
@@ -632,14 +648,14 @@ const defaultBaseOuter = {
632
648
  innerRadius: 0,
633
649
  outerRadius: 1,
634
650
  padAngle: 2,
635
- }
636
- }
651
+ },
652
+ };
637
653
  const baseOuter = ({
638
654
  chart: {
639
655
  innerRadius = defaultBasePie.chart.innerRadius,
640
656
  outerRadius = defaultBasePie.chart.outerRadius,
641
- padAngle = defaultBasePie.chart.padAngle
642
- } = defaultBasePie.chart
657
+ padAngle = defaultBasePie.chart.padAngle,
658
+ } = defaultBasePie.chart,
643
659
  } = defaultBaseOuter) => ({
644
660
  name: 'chart',
645
661
  displayName: '图形',
@@ -681,35 +697,35 @@ const baseOuter = ({
681
697
  ],
682
698
  config: {
683
699
  defaultOpen: true,
684
- }
685
- })
700
+ },
701
+ });
686
702
 
687
703
  const defaultOuterDecorate = {
688
- outerDecorate:{
689
- color:"#CF00FF",
690
- width:10,
691
- tick:{
692
- show:true,
693
- count:12,
694
- color:"#CF00FF",
695
- width:3,
696
- length:8
697
- }
698
- }
699
- }
700
- const outerDecorate=({
701
- outerDecorate:{
704
+ outerDecorate: {
705
+ color: '#CF00FF',
706
+ width: 10,
707
+ tick: {
708
+ show: true,
709
+ count: 12,
710
+ color: '#CF00FF',
711
+ width: 3,
712
+ length: 8,
713
+ },
714
+ },
715
+ };
716
+ const outerDecorate = ({
717
+ outerDecorate: {
702
718
  color = defaultOuterDecorate.outerDecorate.color,
703
719
  width = defaultOuterDecorate.outerDecorate.width,
704
- tick:{
720
+ tick: {
705
721
  show = defaultOuterDecorate.outerDecorate.tick.show,
706
722
  count = defaultOuterDecorate.outerDecorate.tick.count,
707
723
  color: tickColor = defaultOuterDecorate.outerDecorate.tick.color,
708
724
  width: tickWidth = defaultOuterDecorate.outerDecorate.tick.width,
709
- length = defaultOuterDecorate.outerDecorate.tick.length
710
- } = defaultOuterDecorate.outerDecorate.tick
711
- }=defaultOuterDecorate.outerDecorate
712
- } = defaultOuterDecorate)=>({
725
+ length = defaultOuterDecorate.outerDecorate.tick.length,
726
+ } = defaultOuterDecorate.outerDecorate.tick,
727
+ } = defaultOuterDecorate.outerDecorate,
728
+ } = defaultOuterDecorate) => ({
713
729
  name: 'outerDecorate',
714
730
  displayName: '外环装饰',
715
731
  value: [
@@ -717,18 +733,18 @@ const outerDecorate=({
717
733
  name: 'color',
718
734
  displayName: '颜色',
719
735
  value: color,
720
- type: 'color'
736
+ type: 'color',
721
737
  },
722
738
  {
723
- name:"width",
724
- displayName:"粗细",
739
+ name: 'width',
740
+ displayName: '粗细',
725
741
  value: width,
726
- type: "number",
727
- config:{
728
- min:0,
729
- max:100,
730
- suffix:"px"
731
- }
742
+ type: 'number',
743
+ config: {
744
+ min: 0,
745
+ max: 100,
746
+ suffix: 'px',
747
+ },
732
748
  },
733
749
  {
734
750
  name: 'tick',
@@ -737,45 +753,45 @@ const outerDecorate=({
737
753
  showConfig(show),
738
754
  {
739
755
  ...showRule(),
740
- name:"count",
741
- displayName:"个数",
742
- value:count,
743
- type:"number",
744
- config:{
745
- min:0
746
- }
756
+ name: 'count',
757
+ displayName: '个数',
758
+ value: count,
759
+ type: 'number',
760
+ config: {
761
+ min: 0,
762
+ },
747
763
  },
748
764
  {
749
765
  ...showRule(),
750
- name:"color",
751
- displayName:"颜色",
752
- value:tickColor,
753
- type:"color"
766
+ name: 'color',
767
+ displayName: '颜色',
768
+ value: tickColor,
769
+ type: 'color',
754
770
  },
755
771
  {
756
772
  ...showRule(),
757
- name:"width",
758
- displayName:"粗细",
759
- value:tickWidth,
760
- type:"number",
761
- config:{
762
- suffix:"px"
763
- }
773
+ name: 'width',
774
+ displayName: '粗细',
775
+ value: tickWidth,
776
+ type: 'number',
777
+ config: {
778
+ suffix: 'px',
779
+ },
764
780
  },
765
781
  {
766
782
  ...showRule(),
767
- name:"length",
768
- displayName:"长度",
769
- value:length,
770
- type:"number",
771
- config:{
772
- suffix:"px"
773
- }
774
- }
783
+ name: 'length',
784
+ displayName: '长度',
785
+ value: length,
786
+ type: 'number',
787
+ config: {
788
+ suffix: 'px',
789
+ },
790
+ },
775
791
  ],
776
- }
777
- ]
778
- })
792
+ },
793
+ ],
794
+ });
779
795
 
780
796
  export const rosePie = (_basePie = defaultBasePie) => ({
781
797
  name: 'fan',
@@ -783,11 +799,14 @@ export const rosePie = (_basePie = defaultBasePie) => ({
783
799
  value: [basePie(_basePie)],
784
800
  });
785
801
 
786
- export const rosePieDecorate = (_baseOuter = defaultBaseOuter, _outerDecorate = defaultOuterDecorate)=>({
802
+ export const rosePieDecorate = (
803
+ _baseOuter = defaultBaseOuter,
804
+ _outerDecorate = defaultOuterDecorate
805
+ ) => ({
787
806
  name: 'fan',
788
807
  displayName: '环图属性',
789
- value:[baseOuter(_baseOuter),outerDecorate(_outerDecorate)]
790
- })
808
+ value: [baseOuter(_baseOuter), outerDecorate(_outerDecorate)],
809
+ });
791
810
 
792
811
  export const donut = (
793
812
  {
@@ -814,31 +833,42 @@ export const carouselDonut = (
814
833
  value: [basePie(_basePie), current(_current)],
815
834
  });
816
835
 
817
- export const nestRosePie = (_baseRose = defaultBaseRose, _categoryAxis = defaultRoseAxis, _valueAxis = defaultRoseAxis) =>({
836
+ export const nestRosePie = (
837
+ _baseRose = defaultBaseRose,
838
+ _categoryAxis = defaultRoseAxis,
839
+ _valueAxis = defaultRoseAxis
840
+ ) => ({
818
841
  name: 'fan',
819
842
  displayName: '环图属性',
820
- value:[baseRose(_baseRose), roseCategoryAxis(_categoryAxis), roseValueAxis(_valueAxis)]
843
+ value: [
844
+ baseRose(_baseRose),
845
+ roseCategoryAxis(_categoryAxis),
846
+ roseValueAxis(_valueAxis),
847
+ ],
821
848
  });
822
849
 
823
850
  export const carouselDonut2 = (
824
851
  {
825
- basePie: _basePie = defaultBasePie,
852
+ basePie: _basePie = defaultBasePie,
826
853
  categoryText: _categoryText = defaultCategoryText,
827
854
  decorate2: _decorate2 = defaultDecorate2,
828
- current: _current = defaultCurrent
829
- }={
855
+ current: _current = defaultCurrent,
856
+ } = {
830
857
  basePie: defaultBasePie,
831
858
  categoryText: defaultCategoryText,
832
859
  decorate2: defaultDecorate2,
833
860
  current: defaultCurrent,
834
861
  }
835
- )=>({
836
- name:'fan',
837
- displayName:'环图属性',
838
- value:[basePie(_basePie),categoryText(_categoryText), decorate2(_decorate2),current(_current)]
839
- })
840
-
841
-
862
+ ) => ({
863
+ name: 'fan',
864
+ displayName: '环图属性',
865
+ value: [
866
+ basePie(_basePie),
867
+ categoryText(_categoryText),
868
+ decorate2(_decorate2),
869
+ current(_current),
870
+ ],
871
+ });
842
872
 
843
873
  const defaultPie = {
844
874
  fan: {
@@ -976,4 +1006,4 @@ export default ({
976
1006
  },
977
1007
  },
978
1008
  ],
979
- });
1009
+ });