@@ -4,11 +4,12 @@ import { delay } from '../../../utils/delay';
4
4
import { SUNBRUST_DATA } from '../../../data/sunburst' ;
5
5
6
6
describe ( 'sunburst' , ( ) => {
7
- it ( 'init: change data ' , async ( ) => {
7
+ it ( '旧版本 ' , async ( ) => {
8
8
const sunburstPlot = new Sunburst ( createDiv ( ) , {
9
9
width : 400 ,
10
10
height : 400 ,
11
11
data : [ ] ,
12
+ // @ts -ignore
12
13
seriesField : 'sum' ,
13
14
colorField : 'value' ,
14
15
color : [ '#BAE7FF' , '#1890FF' , '#0050B3' ] ,
@@ -30,7 +31,8 @@ describe('sunburst', () => {
30
31
labelOption : { fields, cfg } ,
31
32
coordinate,
32
33
} = geometry ;
33
- expect ( fields ) . toEqual ( [ 'sum' ] ) ;
34
+ // 默认展示 name(不进行兼容))
35
+ expect ( fields ) . toEqual ( [ 'name' ] ) ;
34
36
expect ( cfg . position ) . toBe ( 'middle' ) ;
35
37
const positionFields = geometry . getAttribute ( 'position' ) . getFields ( ) ;
36
38
expect ( geometry . elements . length ) . toBe ( geometry . data . length ) ;
@@ -42,11 +44,12 @@ describe('sunburst', () => {
42
44
sunburstPlot . destroy ( ) ;
43
45
} ) ;
44
46
45
- it ( 'init : update' , async ( ) => {
47
+ it ( '旧版本 : update' , async ( ) => {
46
48
const sunburstPlot = new Sunburst ( createDiv ( ) , {
47
49
width : 400 ,
48
50
height : 400 ,
49
51
data : SUNBRUST_DATA ,
52
+ // @ts -ignore
50
53
seriesField : 'sum' ,
51
54
innerRadius : 0.3 ,
52
55
radius : 1 ,
@@ -63,7 +66,8 @@ describe('sunburst', () => {
63
66
labelOption : { fields } ,
64
67
coordinate,
65
68
} = geometry ;
66
- expect ( fields ) . toEqual ( [ 'sum' ] ) ;
69
+ // 默认展示 name(不进行兼容))
70
+ expect ( fields ) . toEqual ( [ 'name' ] ) ;
67
71
expect ( coordinate . innerRadius ) . toBe ( 0.3 ) ;
68
72
// @ts -ignore
69
73
sunburstPlot . update ( {
0 commit comments