@@ -29,31 +29,31 @@ def setUp(self):
29
29
def test_raise_if_no_figure (self ):
30
30
scatt = go .Scatter ()
31
31
fn = MagicMock ()
32
- scatt .on_change (fn , False , 'x' )
32
+ scatt .on_change (fn , 'x' )
33
33
34
34
@raises (ValueError )
35
35
def test_raise_on_frame_hierarchy (self ):
36
36
fn = MagicMock ()
37
- self .figure .frames [0 ].layout .xaxis .on_change (fn , False , 'range' )
37
+ self .figure .frames [0 ].layout .xaxis .on_change (fn , 'range' )
38
38
39
39
@raises (ValueError )
40
40
def test_validate_property_path_nested (self ):
41
41
fn = MagicMock ()
42
- self .figure .layout .xaxis .on_change (fn , False , 'bogus' )
42
+ self .figure .layout .xaxis .on_change (fn , 'bogus' )
43
43
44
44
@raises (ValueError )
45
45
def test_validate_property_path_nested (self ):
46
46
fn = MagicMock ()
47
- self .figure .layout .on_change (fn , False , 'xaxis.titlefont.bogus' )
47
+ self .figure .layout .on_change (fn , 'xaxis.titlefont.bogus' )
48
48
49
49
# Python triggered changes
50
50
# ------------------------
51
51
def test_single_prop_callback_on_assignment (self ):
52
52
# Install callbacks on 'x', and 'y' property of first trace
53
53
fn_x = MagicMock ()
54
54
fn_y = MagicMock ()
55
- self .figure .data [0 ].on_change (fn_x , False , 'x' )
56
- self .figure .data [0 ].on_change (fn_y , False , 'y' )
55
+ self .figure .data [0 ].on_change (fn_x , 'x' )
56
+ self .figure .data [0 ].on_change (fn_y , 'y' )
57
57
58
58
# Setting x and y on second trace does not trigger callback
59
59
self .figure .data [1 ].x = [1 , 2 , 3 ]
@@ -74,7 +74,7 @@ def test_single_prop_callback_on_assignment(self):
74
74
def test_multi_prop_callback_on_assignment_trace (self ):
75
75
# Register callback if either 'x' or 'y' changes on first trace
76
76
fn = MagicMock ()
77
- self .figure .data [0 ].on_change (fn , False , 'x' , 'y' )
77
+ self .figure .data [0 ].on_change (fn , 'x' , 'y' )
78
78
79
79
# Perform assignment on one of the properties
80
80
self .figure .data [0 ].x = [11 , 22 , 33 ]
@@ -89,7 +89,7 @@ def test_multi_prop_callback_on_assignment_layout(self):
89
89
90
90
# Register callback if either axis range is changed. Both tuple and
91
91
# dot syntax are supported for nested properties
92
- self .figure .layout .on_change (fn_range , False ,
92
+ self .figure .layout .on_change (fn_range ,
93
93
('xaxis' , 'range' ),
94
94
'yaxis.range' )
95
95
@@ -102,18 +102,17 @@ def test_multi_prop_callback_on_assignment_layout_nested(self):
102
102
fn_layout = MagicMock ()
103
103
104
104
# Register callback on change to family property under titlefont
105
- self .figure .layout .xaxis .titlefont .on_change (fn_titlefont , False ,
105
+ self .figure .layout .xaxis .titlefont .on_change (fn_titlefont ,
106
106
'family' )
107
107
108
108
# Register callback on the range and titlefont.family properties
109
109
# under xaxis
110
110
self .figure .layout .xaxis .on_change (fn_xaxis ,
111
- False ,
112
111
'range' ,
113
112
'titlefont.family' )
114
113
115
114
# Register callback on xaxis object itself
116
- self .figure .layout .on_change (fn_layout , False , 'xaxis' )
115
+ self .figure .layout .on_change (fn_layout , 'xaxis' )
117
116
118
117
# Assign a new xaxis range and titlefont.family
119
118
self .figure .layout .xaxis .titlefont .family = 'courier'
@@ -145,10 +144,10 @@ def test_prop_callback_nested_arrays(self):
145
144
fn_layout = MagicMock ()
146
145
147
146
self .figure .layout .updatemenus [2 ].buttons [1 ].on_change (
148
- fn_button , False , 'method' )
147
+ fn_button , 'method' )
149
148
150
149
self .figure .layout .on_change (
151
- fn_layout , False , 'updatemenus[2].buttons[1].method' )
150
+ fn_layout , 'updatemenus[2].buttons[1].method' )
152
151
153
152
# Update button method
154
153
self .figure .layout .updatemenus [2 ].buttons [1 ].method = 'restyle'
@@ -162,7 +161,6 @@ def test_prop_callback_nested_arrays(self):
162
161
def test_callback_on_update (self ):
163
162
fn_range = MagicMock ()
164
163
self .figure .layout .on_change (fn_range ,
165
- False ,
166
164
'xaxis.range' ,
167
165
'yaxis.range' )
168
166
@@ -174,7 +172,6 @@ def test_callback_on_update(self):
174
172
def test_callback_on_update_single_call (self ):
175
173
fn_range = MagicMock ()
176
174
self .figure .layout .on_change (fn_range ,
177
- False ,
178
175
'xaxis.range' ,
179
176
'yaxis.range' ,
180
177
'width' )
@@ -193,7 +190,6 @@ def test_callback_on_update_single_call(self):
193
190
def test_callback_on_batch_update (self ):
194
191
fn_range = MagicMock ()
195
192
self .figure .layout .on_change (fn_range ,
196
- False ,
197
193
'xaxis.range' ,
198
194
'yaxis.range' ,
199
195
'width' )
@@ -212,7 +208,6 @@ def test_callback_on_batch_update(self):
212
208
def test_callback_on_batch_animate (self ):
213
209
fn_range = MagicMock ()
214
210
self .figure .layout .on_change (fn_range ,
215
- False ,
216
211
'xaxis.range' ,
217
212
'yaxis.range' ,
218
213
'width' )
@@ -231,7 +226,6 @@ def test_callback_on_batch_animate(self):
231
226
def test_callback_on_plotly_relayout (self ):
232
227
fn_range = MagicMock ()
233
228
self .figure .layout .on_change (fn_range ,
234
- False ,
235
229
'xaxis.range' ,
236
230
'yaxis.range' ,
237
231
'width' )
@@ -248,7 +242,7 @@ def test_callback_on_plotly_relayout(self):
248
242
def test_callback_on_plotly_restyle (self ):
249
243
# Register callback if either 'x' or 'y' changes on first trace
250
244
fn = MagicMock ()
251
- self .figure .data [0 ].on_change (fn , False , 'x' , 'y' )
245
+ self .figure .data [0 ].on_change (fn , 'x' , 'y' )
252
246
253
247
# Perform assignment on one of pthe properties
254
248
self .figure .plotly_restyle ({'x' : [[11 , 22 , 33 ],
@@ -263,7 +257,6 @@ def test_callback_on_plotly_restyle(self):
263
257
def test_callback_on_plotly_update (self ):
264
258
fn_range = MagicMock ()
265
259
self .figure .layout .on_change (fn_range ,
266
- False ,
267
260
'xaxis.range' ,
268
261
'yaxis.range' ,
269
262
'width' )
0 commit comments