Hi all. I would like to apply a colorscale for the links in a Sankey diagram so that the first link is yellow, the very last link is blue, and all links in-between are defined by the colorscale 'YlGnBl'
. Here is my code:
import plotly.graph_objects as go
fig = go.Figure(go.Sankey(
arrangement = "snap",
node = {
"label": names,
'pad':10,
'color':'lightgray'
},
link = {
"source": sources,
"target": targets,
"value": values,
'colorscales' : [{'colorscale':'YlGnBu'}]
}))
fig.show()
The Sankey diagram itself shows as intended (and no errors are raised), but all links are displayed in the standard light gray color. What is it that goes wrong? I am using Plotly 4.5.3 with Python 3.7.4.
Thanks for helping.