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 get raised), but all links are in the standard light gray color. What is it that goes wrong? Thanks for helping.