Skip to content

Commit 9df3b81

Browse files
recovering changes from v3 prod (#128)
1 parent 3095522 commit 9df3b81

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

python/sunburst-charts.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,26 @@ fig.update_layout(margin = dict(t=0, l=0, r=0, b=0))
8282
fig.show()
8383
```
8484

85+
### Branchvalues
86+
87+
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)).
88+
89+
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).
90+
91+
```python
92+
import plotly.graph_objects as go
93+
94+
fig =go.Figure(go.Sunburst(
95+
labels=[ "Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
96+
parents=["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ],
97+
values=[ 65, 14, 12, 10, 2, 6, 6, 4, 4],
98+
branchvalues="total",
99+
))
100+
fig.update_layout(margin = dict(t=0, l=0, r=0, b=0))
101+
102+
fig.show()
103+
```
104+
85105
### Large Number of Slices
86106

87107
This example uses a [plotly grid attribute](https://plot.ly/python/reference/#layout-grid) for the suplots. Reference the row and column destination using the [domain](https://plot.ly/python/reference/#sunburst-domain) attribute.

0 commit comments

Comments
 (0)