5
5
text_representation :
6
6
extension : .md
7
7
format_name : markdown
8
- format_version : ' 1.1 '
9
- jupytext_version : 1.1.1
8
+ format_version : ' 1.2 '
9
+ jupytext_version : 1.3.2
10
10
kernelspec :
11
11
display_name : Python 3
12
12
language : python
@@ -20,7 +20,7 @@ jupyter:
20
20
name : python
21
21
nbconvert_exporter : python
22
22
pygments_lexer : ipython3
23
- version : 3.6.7
23
+ version : 3.7.3
24
24
plotly :
25
25
description : How to add dropdowns to update Plotly chart attributes in Python.
26
26
display_as : controls
@@ -80,7 +80,7 @@ fig.update_scenes(
80
80
# Add dropdown
81
81
fig.update_layout(
82
82
updatemenus = [
83
- go.layout.Updatemenu (
83
+ dict (
84
84
buttons = list ([
85
85
dict (
86
86
args = [" type" , " surface" ],
@@ -107,8 +107,8 @@ fig.update_layout(
107
107
# Add annotation
108
108
fig.update_layout(
109
109
annotations = [
110
- go.layout.Annotation (text = " Trace type:" , showarrow = False ,
111
- x = 0 , y = 1.085 , yref = " paper" , align = " left" )
110
+ dict (text = " Trace type:" , showarrow = False ,
111
+ x = 0 , y = 1.085 , yref = " paper" , align = " left" )
112
112
]
113
113
)
114
114
@@ -151,7 +151,7 @@ fig.update_scenes(
151
151
button_layer_1_height = 1.08
152
152
fig.update_layout(
153
153
updatemenus = [
154
- go.layout.Updatemenu (
154
+ dict (
155
155
buttons = list ([
156
156
dict (
157
157
args = [" colorscale" , " Viridis" ],
@@ -182,7 +182,7 @@ fig.update_layout(
182
182
y = button_layer_1_height,
183
183
yanchor = " top"
184
184
),
185
- go.layout.Updatemenu (
185
+ dict (
186
186
buttons = list ([
187
187
dict (
188
188
args = [" reversescale" , False ],
@@ -203,7 +203,7 @@ fig.update_layout(
203
203
y = button_layer_1_height,
204
204
yanchor = " top"
205
205
),
206
- go.layout.Updatemenu (
206
+ dict (
207
207
buttons = list ([
208
208
dict (
209
209
args = [{" contours.showlines" : False , " type" : " contour" }],
@@ -229,11 +229,11 @@ fig.update_layout(
229
229
230
230
fig.update_layout(
231
231
annotations = [
232
- go.layout.Annotation (text = " colorscale" , x = 0 , xref = " paper" , y = 1.06 , yref = " paper" ,
232
+ dict (text = " colorscale" , x = 0 , xref = " paper" , y = 1.06 , yref = " paper" ,
233
233
align = " left" , showarrow = False ),
234
- go.layout.Annotation (text = " Reverse<br>Colorscale" , x = 0.25 , xref = " paper" , y = 1.07 ,
234
+ dict (text = " Reverse<br>Colorscale" , x = 0.25 , xref = " paper" , y = 1.07 ,
235
235
yref = " paper" , showarrow = False ),
236
- go.layout.Annotation (text = " Lines" , x = 0.54 , xref = " paper" , y = 1.06 , yref = " paper" ,
236
+ dict (text = " Lines" , x = 0.54 , xref = " paper" , y = 1.06 , yref = " paper" ,
237
237
showarrow = False )
238
238
])
239
239
@@ -293,25 +293,25 @@ fig.add_trace(
293
293
)
294
294
295
295
# Add buttons that add shapes
296
- cluster0 = [go.layout.Shape (type = " circle" ,
296
+ cluster0 = [dict (type = " circle" ,
297
297
xref = " x" , yref = " y" ,
298
298
x0 = min (x0), y0 = min (y0),
299
299
x1 = max (x0), y1 = max (y0),
300
300
line = dict (color = " DarkOrange" ))]
301
- cluster1 = [go.layout.Shape (type = " circle" ,
301
+ cluster1 = [dict (type = " circle" ,
302
302
xref = " x" , yref = " y" ,
303
303
x0 = min (x1), y0 = min (y1),
304
304
x1 = max (x1), y1 = max (y1),
305
305
line = dict (color = " Crimson" ))]
306
- cluster2 = [go.layout.Shape (type = " circle" ,
306
+ cluster2 = [dict (type = " circle" ,
307
307
xref = " x" , yref = " y" ,
308
308
x0 = min (x2), y0 = min (y2),
309
309
x1 = max (x2), y1 = max (y2),
310
310
line = dict (color = " RebeccaPurple" ))]
311
311
312
312
fig.update_layout(
313
313
updatemenus = [
314
- go.layout.Updatemenu (buttons = list ([
314
+ dict (buttons = list ([
315
315
dict (label = " None" ,
316
316
method = " relayout" ,
317
317
args = [" shapes" , []]),
@@ -411,7 +411,7 @@ low_annotations = [dict(x="2015-05-01",
411
411
412
412
fig.update_layout(
413
413
updatemenus = [
414
- go.layout.Updatemenu (
414
+ dict (
415
415
active = 0 ,
416
416
buttons = list ([
417
417
dict (label = " None" ,
0 commit comments