I’ve created a Sankey diagram, which presents alright, but it would be much more useful if it displayed percentages alongside (or instead) the raw values for each flow (e.g. if my base node sums to 100, and each flow’s value is 20, to also present 20% on each flow’s hover).
Is there a way to do that?
Below is my plotting code:
data = dict(
type='sankey',
node = dict(
pad = 20,
thickness = 20,
line = dict(
color = "black",
width = 0.25
),
label = label_list
),
link = dict(
source = df['sourceID'],
target = df['targetID'],
value = df['count']
)
)
layout = dict(
title = title,
font = dict(
size = 15
)
)
fig = dict(data=[data], layout=layout)
pio.show(fig)