I'm creating a sankey diagram using plotly and there is the built in method to use 'group' to combine nodes. However, when I use this the color of this node will be black and no label is showing. This is expected as the colors of the grouped nodes could vary. However, I don't see how I can set the color of the group. Same goes for the label. Is there a way to define this?
example code:
import plotly.graph_objs as go
from plotly.offline import plot
value = [3,5,2,4,6]
source = [0,0,1,0,3]
target = [1,4,2,3,4]
color = ["blue","yellow","orange","orange","purple"]
label = ["A","B","C1","C2","D"]
data = dict(
type='sankey',
arrangement = 'freeform',
node = dict(
pad = 15,
thickness = 20,
line = dict(
color = "black",
width = 0.1
),
groups = [[2,3]],
label = label,
color = color,
),
link = dict(
source = source,
target = target,
value = value,
)
)
layout = dict(
title = "Sankey test",
font = dict(
size = 10
)
)
f = go.FigureWidget(data=[data], layout=layout)
plot(f)