@@ -16,13 +16,17 @@ def test_initial_access_subplots(self):
16
16
self .assertEqual (self .layout .yaxis , go .layout .YAxis ())
17
17
self .assertEqual (self .layout ['geo' ], go .layout .Geo ())
18
18
self .assertEqual (self .layout .scene , go .layout .Scene ())
19
+ self .assertEqual (self .layout .mapbox , go .layout .Mapbox ())
20
+ self .assertEqual (self .layout .polar , go .layout .Polar ())
19
21
20
22
# Subplot ids of 1 should be mapped to the same object as the base
21
23
# subplot. Notice we're using assertIs not assertEqual here
22
24
self .assertIs (self .layout .xaxis , self .layout .xaxis1 )
23
25
self .assertIs (self .layout .yaxis , self .layout .yaxis1 )
24
26
self .assertIs (self .layout .geo , self .layout .geo1 )
25
27
self .assertIs (self .layout .scene , self .layout .scene1 )
28
+ self .assertIs (self .layout .mapbox , self .layout .mapbox1 )
29
+ self .assertIs (self .layout .polar , self .layout .polar1 )
26
30
27
31
@raises (AttributeError )
28
32
def test_initial_access_subplot2 (self ):
@@ -137,6 +141,12 @@ def test_subplot_objs_have_proper_type(self):
137
141
self .layout .scene6 = {}
138
142
self .assertIsInstance (self .layout .scene6 , go .layout .Scene )
139
143
144
+ self .layout .mapbox7 = {}
145
+ self .assertIsInstance (self .layout .mapbox7 , go .layout .Mapbox )
146
+
147
+ self .layout .polar8 = {}
148
+ self .assertIsInstance (self .layout .polar8 , go .layout .Polar )
149
+
140
150
def test_subplot_1_in_constructor (self ):
141
151
layout = go .Layout (xaxis1 = go .layout .XAxis (title = 'xaxis 1' ))
142
152
self .assertEqual (layout .xaxis1 .title , 'xaxis 1' )
@@ -146,10 +156,55 @@ def test_subplot_props_in_constructor(self):
146
156
yaxis3 = go .layout .YAxis (title = 'yaxis 3' ),
147
157
geo4 = go .layout .Geo (bgcolor = 'blue' ),
148
158
ternary5 = go .layout .Ternary (sum = 120 ),
149
- scene6 = go .layout .Scene (dragmode = 'zoom' ))
159
+ scene6 = go .layout .Scene (dragmode = 'zoom' ),
160
+ mapbox7 = go .layout .Mapbox (zoom = 2 ),
161
+ polar8 = go .layout .Polar (sector = [0 , 90 ]))
150
162
151
163
self .assertEqual (layout .xaxis2 .title , 'xaxis 2' )
152
164
self .assertEqual (layout .yaxis3 .title , 'yaxis 3' )
153
165
self .assertEqual (layout .geo4 .bgcolor , 'blue' )
154
166
self .assertEqual (layout .ternary5 .sum , 120 )
155
167
self .assertEqual (layout .scene6 .dragmode , 'zoom' )
168
+ self .assertEqual (layout .mapbox7 .zoom , 2 )
169
+ self .assertEqual (layout .polar8 .sector , (0 , 90 ))
170
+
171
+ def test_create_subplot_with_update (self ):
172
+
173
+ self .layout .update (
174
+ xaxis1 = go .layout .XAxis (title = 'xaxis 1' ),
175
+ xaxis2 = go .layout .XAxis (title = 'xaxis 2' ),
176
+ yaxis3 = go .layout .YAxis (title = 'yaxis 3' ),
177
+ geo4 = go .layout .Geo (bgcolor = 'blue' ),
178
+ ternary5 = go .layout .Ternary (sum = 120 ),
179
+ scene6 = go .layout .Scene (dragmode = 'zoom' ),
180
+ mapbox7 = go .layout .Mapbox (zoom = 2 ),
181
+ polar8 = go .layout .Polar (sector = [0 , 90 ]))
182
+
183
+ self .assertEqual (self .layout .xaxis1 .title , 'xaxis 1' )
184
+ self .assertEqual (self .layout .xaxis2 .title , 'xaxis 2' )
185
+ self .assertEqual (self .layout .yaxis3 .title , 'yaxis 3' )
186
+ self .assertEqual (self .layout .geo4 .bgcolor , 'blue' )
187
+ self .assertEqual (self .layout .ternary5 .sum , 120 )
188
+ self .assertEqual (self .layout .scene6 .dragmode , 'zoom' )
189
+ self .assertEqual (self .layout .mapbox7 .zoom , 2 )
190
+ self .assertEqual (self .layout .polar8 .sector , (0 , 90 ))
191
+
192
+ def test_create_subplot_with_update_dict (self ):
193
+
194
+ self .layout .update ({'xaxis1' : {'title' : 'xaxis 1' },
195
+ 'xaxis2' : {'title' : 'xaxis 2' },
196
+ 'yaxis3' : {'title' : 'yaxis 3' },
197
+ 'geo4' : {'bgcolor' : 'blue' },
198
+ 'ternary5' : {'sum' : 120 },
199
+ 'scene6' : {'dragmode' : 'zoom' },
200
+ 'mapbox7' : {'zoom' : 2 },
201
+ 'polar8' : {'sector' : [0 , 90 ]}})
202
+
203
+ self .assertEqual (self .layout .xaxis1 .title , 'xaxis 1' )
204
+ self .assertEqual (self .layout .xaxis2 .title , 'xaxis 2' )
205
+ self .assertEqual (self .layout .yaxis3 .title , 'yaxis 3' )
206
+ self .assertEqual (self .layout .geo4 .bgcolor , 'blue' )
207
+ self .assertEqual (self .layout .ternary5 .sum , 120 )
208
+ self .assertEqual (self .layout .scene6 .dragmode , 'zoom' )
209
+ self .assertEqual (self .layout .mapbox7 .zoom , 2 )
210
+ self .assertEqual (self .layout .polar8 .sector , (0 , 90 ))
0 commit comments