@@ -10,7 +10,7 @@ jupyter:
10
10
kernel_info :
11
11
name : python2
12
12
kernelspec :
13
- display_name : Python 3
13
+ display_name : Python 3 (ipykernel)
14
14
language : python
15
15
name : python3
16
16
language_info :
@@ -214,6 +214,34 @@ fig = go.Figure(go.Sankey(
214
214
fig.show()
215
215
```
216
216
217
+ ### Sankey Diagram with Arrow Links
218
+
219
+ * New in 5.10*
220
+
221
+ Create a Sankey diagram with arrow links by setting the ` arrowlen ` attribute of ` link ` :
222
+
223
+ ``` python
224
+ import plotly.graph_objects as go
225
+
226
+ fig = go.Figure(go.Sankey(
227
+ arrangement = ' snap' ,
228
+ node = dict (
229
+ label = [' A' , ' B' , ' C' , ' D' , ' E' , ' F' ],
230
+ x = [0.2 , 0.1 , 0.5 , 0.7 , 0.3 , 0.5 ],
231
+ y = [0.7 , 0.5 , 0.2 , 0.4 , 0.2 , 0.3 ],
232
+ pad = 10
233
+ ),
234
+ link = dict (
235
+ arrowlen = 15 ,
236
+ source = [0 , 0 , 1 , 2 , 5 , 4 , 3 , 5 ],
237
+ target = [5 , 3 , 4 , 3 , 0 , 2 , 2 , 3 ],
238
+ value = [1 , 2 , 1 , 1 , 1 , 1 , 1 , 2 ]
239
+ )
240
+ ))
241
+
242
+ fig.show()
243
+ ```
244
+
217
245
### Reference
218
246
219
247
See [ https://plotly.com/python/reference/sankey ] ( https://plotly.com/python/reference/sankey/ ) for more information and options!
0 commit comments