6
6
extension : .md
7
7
format_name : markdown
8
8
format_version : ' 1.2'
9
- jupytext_version : 1.3.0
9
+ jupytext_version : 1.3.1
10
10
kernel_info :
11
11
name : python2
12
12
kernelspec :
@@ -22,7 +22,7 @@ jupyter:
22
22
name : python
23
23
nbconvert_exporter : python
24
24
pygments_lexer : ipython3
25
- version : 3.7.3
25
+ version : 3.6.8
26
26
plotly :
27
27
description : How to make Sankey Diagrams in Python with Plotly.
28
28
display_as : basic
@@ -158,13 +158,17 @@ fig = go.Figure(data=[go.Sankey(
158
158
label = [" A1" , " A2" , " B1" , " B2" , " C1" , " C2" ],
159
159
customdata = [" Long name A1" , " Long name A2" , " Long name B1" , " Long name B2" ,
160
160
" Long name C1" , " Long name C2" ],
161
- hovertemplate = ' %{customdata} <br> %{value} <extra></extra>' ,
161
+ hovertemplate = ' Node %{customdata} has total value %{value} <extra></extra>' ,
162
162
color = " blue"
163
163
),
164
164
link = dict (
165
165
source = [0 , 1 , 0 , 2 , 3 , 3 ], # indices correspond to labels, eg A1, A2, A2, B1, ...
166
166
target = [2 , 3 , 3 , 4 , 4 , 5 ],
167
- value = [8 , 4 , 2 , 8 , 4 , 2 ]
167
+ value = [8 , 4 , 2 , 8 , 4 , 2 ],
168
+ customdata = [" q" ," r" ," s" ," t" ," u" ," v" ],
169
+ hovertemplate = ' Link from node %{source.customdata} <br />' +
170
+ ' to node%{target.customdata} <br />has value %{value} ' +
171
+ ' <br />and data %{customdata} <extra></extra>' ,
168
172
))])
169
173
170
174
fig.update_layout(title_text = " Basic Sankey Diagram" , font_size = 10 )
0 commit comments