1
- var Plotly = require ( '@src/plotly ' ) ;
1
+ var Geo = require ( '@src/plots/geo ' ) ;
2
2
3
- describe ( 'Test geolayout ' , function ( ) {
3
+ describe ( 'Test Geo layout defaults ' , function ( ) {
4
4
'use strict' ;
5
5
6
- var GeoLayout = Plotly . GeoLayout ;
6
+ var layoutAttributes = Geo . layoutAttributes ;
7
+ var supplyLayoutDefaults = Geo . supplyLayoutDefaults ;
7
8
8
9
describe ( 'supplyLayoutDefaults' , function ( ) {
9
10
var layoutIn , layoutOut ;
@@ -30,12 +31,12 @@ describe('Test geolayout', function () {
30
31
}
31
32
} ;
32
33
33
- GeoLayout . supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
34
+ supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
34
35
expect ( layoutOut . geo . projection . rotation ) . toBeUndefined ( ) ;
35
36
36
37
delete layoutIn . geo . projection . type ;
37
38
layoutOut = { } ;
38
- GeoLayout . supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
39
+ supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
39
40
expect ( layoutOut . geo . projection . rotation ) . toBeDefined ( ) ;
40
41
} ) ;
41
42
@@ -55,21 +56,21 @@ describe('Test geolayout', function () {
55
56
}
56
57
} ;
57
58
58
- GeoLayout . supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
59
+ supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
59
60
fields . forEach ( function ( field ) {
60
61
expect ( layoutOut . geo [ field ] ) . toBeUndefined ( ) ;
61
62
} ) ;
62
63
63
64
delete layoutIn . geo . projection . type ;
64
65
layoutOut = { } ;
65
- GeoLayout . supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
66
+ supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
66
67
fields . forEach ( function ( field ) {
67
68
expect ( layoutOut . geo [ field ] ) . toBeDefined ( ) ;
68
69
} ) ;
69
70
} ) ;
70
71
71
72
it ( 'should not coerce projection.parallels if type is conic' , function ( ) {
72
- var projTypes = GeoLayout . layoutAttributes . projection . type . values ;
73
+ var projTypes = layoutAttributes . projection . type . values ;
73
74
74
75
function testOne ( projType ) {
75
76
layoutIn = {
@@ -81,7 +82,7 @@ describe('Test geolayout', function () {
81
82
}
82
83
} ;
83
84
layoutOut = { } ;
84
- GeoLayout . supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
85
+ supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
85
86
}
86
87
87
88
projTypes . forEach ( function ( projType ) {
@@ -103,14 +104,14 @@ describe('Test geolayout', function () {
103
104
geo : { scope : 'usa' }
104
105
} ;
105
106
layoutOut = { } ;
106
- GeoLayout . supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
107
+ supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
107
108
fields . forEach ( function ( field ) {
108
109
expect ( layoutOut . geo [ field ] ) . toBeDefined ( ) ;
109
110
} ) ;
110
111
111
112
delete layoutIn . geo . scope ;
112
113
layoutOut = { } ;
113
- GeoLayout . supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
114
+ supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
114
115
fields . forEach ( function ( field ) {
115
116
expect ( layoutOut . geo [ field ] ) . toBeUndefined ( ) ;
116
117
} ) ;
@@ -122,7 +123,7 @@ describe('Test geolayout', function () {
122
123
}
123
124
} ;
124
125
layoutOut = { } ;
125
- GeoLayout . supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
126
+ supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
126
127
fields . forEach ( function ( field ) {
127
128
expect ( layoutOut . geo [ field ] ) . toBeDefined ( ) ;
128
129
} ) ;
@@ -134,14 +135,14 @@ describe('Test geolayout', function () {
134
135
}
135
136
} ;
136
137
layoutOut = { } ;
137
- GeoLayout . supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
138
+ supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
138
139
fields . forEach ( function ( field ) {
139
140
expect ( layoutOut . geo [ field ] ) . toBeDefined ( ) ;
140
141
} ) ;
141
142
142
143
delete layoutIn . geo . resolution ;
143
144
layoutOut = { } ;
144
- GeoLayout . supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
145
+ supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
145
146
fields . forEach ( function ( field ) {
146
147
expect ( layoutOut . geo [ field ] ) . toBeUndefined ( ) ;
147
148
} ) ;
@@ -151,14 +152,14 @@ describe('Test geolayout', function () {
151
152
var fields = [
152
153
'showframe' , 'framecolor' , 'framewidth'
153
154
] ,
154
- scopes = GeoLayout . layoutAttributes . scope . values ;
155
+ scopes = layoutAttributes . scope . values ;
155
156
156
157
function testOne ( scope ) {
157
158
layoutIn = {
158
159
geo : { scope : scope }
159
160
} ;
160
161
layoutOut = { } ;
161
- GeoLayout . supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
162
+ supplyLayoutDefaults ( layoutIn , layoutOut , fullData ) ;
162
163
}
163
164
164
165
scopes . forEach ( function ( scope ) {
0 commit comments