You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/python/datashader.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ jupyter:
36
36
37
37
[datashader](https://datashader.org/) creates rasterized representations of large datasets for easier visualization, with a pipeline approach consisting of several steps: projecting the data on a regular grid, creating a color representation of the grid, etc.
38
38
39
-
### Passing datashader rasters as a mabox image layer
39
+
### Passing datashader rasters as a mapbox image layer
40
40
41
41
We visualize here the spatial distribution of taxi rides in New York City. A higher density
42
42
is observed on major avenues. For more details about mapbox charts, see [the mapbox layers tutorial](/python/mapbox-layers). No mapbox token is needed here.
Copy file name to clipboardExpand all lines: doc/python/sliders.md
+28-5
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,8 @@ jupyter:
33
33
thumbnail: thumbnail/slider2017.gif
34
34
---
35
35
36
-
####Simple Slider Control
37
-
Sliders can now be used in Plotly to change the data displayed or style of a plot!
36
+
### Simple Slider Control
37
+
Sliders can be used in Plotly to change the data displayed or style of a plot.
38
38
39
39
```python
40
40
import plotly.graph_objects as go
@@ -60,10 +60,11 @@ fig.data[10].visible = True
60
60
steps = []
61
61
for i inrange(len(fig.data)):
62
62
step =dict(
63
-
method="restyle",
64
-
args=["visible", [False] *len(fig.data)],
63
+
method="update",
64
+
args=[{"visible": [False] *len(fig.data)},
65
+
{"title": "Slider switched to step: "+str(i)}], # layout attribute
65
66
)
66
-
step["args"][1][i] =True# Toggle i'th trace to "visible"
67
+
step["args"][0]["visible"][i] =True# Toggle i'th trace to "visible"
67
68
steps.append(step)
68
69
69
70
sliders = [dict(
@@ -80,5 +81,27 @@ fig.update_layout(
80
81
fig.show()
81
82
```
82
83
84
+
#### Methods
85
+
The method determines which [plotly.js function](https://plot.ly/javascript/plotlyjs-function-reference/) will be used to update the chart. Plotly can use several [updatemenu](https://plot.ly/python/reference/#layout-updatemenus-items-updatemenu-buttons-items-button-method) methods to add the slider:
86
+
-`"restyle"`: modify **data** attributes
87
+
-`"relayout"`: modify **layout** attributes
88
+
-`"update"`: modify **data and layout** attributes
89
+
-`"animate"`: start or pause an animation
90
+
91
+
### Sliders in Plotly Express
92
+
Plotly Express provide sliders, but with implicit animation. The animation can be ommited by removing `updatemenus` in the `layout`:
Copy file name to clipboardExpand all lines: doc/python/sunburst-charts.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -196,7 +196,7 @@ fig.show()
196
196
197
197
With branchvalues "total", the value of the parent represents the width of its wedge. In the example below, "Enoch" is 4 and "Awan" is 6 and so Enoch's width is 4/6ths of Awans. With branchvalues "remainder", the parent's width is determined by its own value plus those of its children. So, Enoch's width is 4/10ths of Awan's (4 / (6 + 4)).
198
198
199
-
Note that this means that the sum of the values of the children cannot exceed the value of their parent when branchvalues "total". When branchvalues "relative" (the default), children will not take up all of the space below their parent (unless the parent is the root and it has a value of 0).
199
+
Note that this means that the sum of the values of the children cannot exceed the value of their parent when branchvalues is set to "total". When branchvalues is set to "remainder" (the default), children will not take up all of the space below their parent (unless the parent is the root and it has a value of 0).
0 commit comments