Skip to content

Commit 569aecd

Browse files
Merge branch 'doc-prod'
2 parents 76ccbff + c44eb6b commit 569aecd

15 files changed

+275
-149
lines changed

doc/python/custom-buttons.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.1'
9-
jupytext_version: 1.1.7
8+
format_version: '1.2'
9+
jupytext_version: 1.3.2
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.2
23+
version: 3.7.3
2424
plotly:
2525
description: How to add custom buttons to update Plotly chart attributes in Python.
2626
display_as: controls
@@ -78,7 +78,7 @@ fig.update_scenes(
7878
# Add dropdown
7979
fig.update_layout(
8080
updatemenus=[
81-
go.layout.Updatemenu(
81+
dict(
8282
type = "buttons",
8383
direction = "left",
8484
buttons=list([
@@ -106,7 +106,7 @@ fig.update_layout(
106106
# Add annotation
107107
fig.update_layout(
108108
annotations=[
109-
go.layout.Annotation(text="Trace type:", showarrow=False,
109+
dict(text="Trace type:", showarrow=False,
110110
x=0, y=1.08, yref="paper", align="left")
111111
]
112112
)
@@ -153,7 +153,7 @@ button_layer_2_height = 1.065
153153

154154
fig.update_layout(
155155
updatemenus=[
156-
go.layout.Updatemenu(
156+
dict(
157157
buttons=list([
158158
dict(
159159
args=["colorscale", "Viridis"],
@@ -185,7 +185,7 @@ fig.update_layout(
185185
y=button_layer_1_height,
186186
yanchor="top"
187187
),
188-
go.layout.Updatemenu(
188+
dict(
189189
buttons=list([
190190
dict(
191191
args=["reversescale", False],
@@ -207,7 +207,7 @@ fig.update_layout(
207207
y=button_layer_2_height,
208208
yanchor="top"
209209
),
210-
go.layout.Updatemenu(
210+
dict(
211211
buttons=list([
212212
dict(
213213
args=[{"contours.showlines": False, "type": "contour"}],
@@ -234,11 +234,11 @@ fig.update_layout(
234234

235235
fig.update_layout(
236236
annotations=[
237-
go.layout.Annotation(text="colorscale", x=0, xref="paper", y=1.1, yref="paper",
237+
dict(text="colorscale", x=0, xref="paper", y=1.1, yref="paper",
238238
align="left", showarrow=False),
239-
go.layout.Annotation(text="Reverse<br>Colorscale", x=0, xref="paper", y=1.06,
239+
dict(text="Reverse<br>Colorscale", x=0, xref="paper", y=1.06,
240240
yref="paper", showarrow=False),
241-
go.layout.Annotation(text="Lines", x=0.47, xref="paper", y=1.045, yref="paper",
241+
dict(text="Lines", x=0.47, xref="paper", y=1.045, yref="paper",
242242
showarrow=False)
243243
])
244244

@@ -296,25 +296,25 @@ fig.add_trace(
296296
)
297297

298298
# Add buttons that add shapes
299-
cluster0 = [go.layout.Shape(type="circle",
299+
cluster0 = [dict(type="circle",
300300
xref="x", yref="y",
301301
x0=min(x0), y0=min(y0),
302302
x1=max(x0), y1=max(y0),
303303
line=dict(color="DarkOrange"))]
304-
cluster1 = [go.layout.Shape(type="circle",
304+
cluster1 = [dict(type="circle",
305305
xref="x", yref="y",
306306
x0=min(x1), y0=min(y1),
307307
x1=max(x1), y1=max(y1),
308308
line=dict(color="Crimson"))]
309-
cluster2 = [go.layout.Shape(type="circle",
309+
cluster2 = [dict(type="circle",
310310
xref="x", yref="y",
311311
x0=min(x2), y0=min(y2),
312312
x1=max(x2), y1=max(y2),
313313
line=dict(color="RebeccaPurple"))]
314314

315315
fig.update_layout(
316316
updatemenus=[
317-
go.layout.Updatemenu(
317+
dict(
318318
type="buttons",
319319
buttons=[
320320
dict(label="None",
@@ -415,7 +415,7 @@ low_annotations = [dict(x="2015-05-01",
415415

416416
fig.update_layout(
417417
updatemenus=[
418-
go.layout.Updatemenu(
418+
dict(
419419
type="buttons",
420420
direction="right",
421421
active=0,

doc/python/dropdowns.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ jupyter:
55
text_representation:
66
extension: .md
77
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
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.6.7
23+
version: 3.7.3
2424
plotly:
2525
description: How to add dropdowns to update Plotly chart attributes in Python.
2626
display_as: controls
@@ -80,7 +80,7 @@ fig.update_scenes(
8080
# Add dropdown
8181
fig.update_layout(
8282
updatemenus=[
83-
go.layout.Updatemenu(
83+
dict(
8484
buttons=list([
8585
dict(
8686
args=["type", "surface"],
@@ -107,8 +107,8 @@ fig.update_layout(
107107
# Add annotation
108108
fig.update_layout(
109109
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")
112112
]
113113
)
114114

@@ -151,7 +151,7 @@ fig.update_scenes(
151151
button_layer_1_height = 1.08
152152
fig.update_layout(
153153
updatemenus=[
154-
go.layout.Updatemenu(
154+
dict(
155155
buttons=list([
156156
dict(
157157
args=["colorscale", "Viridis"],
@@ -182,7 +182,7 @@ fig.update_layout(
182182
y=button_layer_1_height,
183183
yanchor="top"
184184
),
185-
go.layout.Updatemenu(
185+
dict(
186186
buttons=list([
187187
dict(
188188
args=["reversescale", False],
@@ -203,7 +203,7 @@ fig.update_layout(
203203
y=button_layer_1_height,
204204
yanchor="top"
205205
),
206-
go.layout.Updatemenu(
206+
dict(
207207
buttons=list([
208208
dict(
209209
args=[{"contours.showlines": False, "type": "contour"}],
@@ -229,11 +229,11 @@ fig.update_layout(
229229

230230
fig.update_layout(
231231
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",
233233
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,
235235
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",
237237
showarrow=False)
238238
])
239239

@@ -293,25 +293,25 @@ fig.add_trace(
293293
)
294294

295295
# Add buttons that add shapes
296-
cluster0 = [go.layout.Shape(type="circle",
296+
cluster0 = [dict(type="circle",
297297
xref="x", yref="y",
298298
x0=min(x0), y0=min(y0),
299299
x1=max(x0), y1=max(y0),
300300
line=dict(color="DarkOrange"))]
301-
cluster1 = [go.layout.Shape(type="circle",
301+
cluster1 = [dict(type="circle",
302302
xref="x", yref="y",
303303
x0=min(x1), y0=min(y1),
304304
x1=max(x1), y1=max(y1),
305305
line=dict(color="Crimson"))]
306-
cluster2 = [go.layout.Shape(type="circle",
306+
cluster2 = [dict(type="circle",
307307
xref="x", yref="y",
308308
x0=min(x2), y0=min(y2),
309309
x1=max(x2), y1=max(y2),
310310
line=dict(color="RebeccaPurple"))]
311311

312312
fig.update_layout(
313313
updatemenus=[
314-
go.layout.Updatemenu(buttons=list([
314+
dict(buttons=list([
315315
dict(label="None",
316316
method="relayout",
317317
args=["shapes", []]),
@@ -411,7 +411,7 @@ low_annotations = [dict(x="2015-05-01",
411411

412412
fig.update_layout(
413413
updatemenus=[
414-
go.layout.Updatemenu(
414+
dict(
415415
active=0,
416416
buttons=list([
417417
dict(label="None",

doc/python/images.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ jupyter:
55
text_representation:
66
extension: .md
77
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
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -55,7 +55,7 @@ fig.add_trace(
5555

5656
# Add images
5757
fig.add_layout_image(
58-
go.layout.Image(
58+
dict(
5959
source="https://images.plot.ly/language-icons/api-home/python-logo.png",
6060
xref="x",
6161
yref="y",
@@ -178,12 +178,12 @@ for (x, y), n in zip(simulated_absorptions, names):
178178

179179
# Add images
180180
fig.add_layout_image(
181-
go.layout.Image(
181+
dict(
182182
source="https://raw.githubusercontent.com/michaelbabyn/plot_data/master/benzene.png",
183183
x=0.75,
184184
y=0.65,
185185
))
186-
fig.add_layout_image(go.layout.Image(
186+
fig.add_layout_image(dict(
187187
source="https://raw.githubusercontent.com/michaelbabyn/plot_data/master/naphthalene.png",
188188
x=0.9,
189189
y=0.3,
@@ -201,7 +201,7 @@ fig.update_layout_images(dict(
201201
# Add annotations
202202
fig.update_layout(
203203
annotations=[
204-
go.layout.Annotation(
204+
dict(
205205
x=93.0 / 300,
206206
y=0.07 / 0.1,
207207
xref="paper",
@@ -212,7 +212,7 @@ fig.update_layout(
212212
ax=250,
213213
ay=-40,
214214
),
215-
go.layout.Annotation(
215+
dict(
216216
x=156.0 / 300,
217217
y=0.04 / 0.1,
218218
xref="paper",
@@ -280,7 +280,7 @@ fig.update_yaxes(
280280

281281
# Add image
282282
fig.add_layout_image(
283-
go.layout.Image(
283+
dict(
284284
x=0,
285285
sizex=img_width * scale_factor,
286286
y=img_height * scale_factor,

doc/python/line-charts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ fig.add_trace(go.Scatter(
384384
fillcolor='rgba(231,107,243,0.2)',
385385
line_color='rgba(255,255,255,0)',
386386
showlegend=False,
387-
name='Fair',
387+
name='Ideal',
388388
))
389389
fig.add_trace(go.Scatter(
390390
x=x, y=y1,

doc/python/lines-on-maps.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ for i in range(len(df_flight_paths)):
100100
fig.update_layout(
101101
title_text = 'Feb. 2011 American Airline flight paths<br>(Hover for airport names)',
102102
showlegend = False,
103-
geo = go.layout.Geo(
103+
geo = dict(
104104
scope = 'north america',
105105
projection_type = 'azimuthal equal area',
106106
showland = True,

0 commit comments

Comments
 (0)