Open morozovkirill opened 4 years ago
You need to update links structure, i.e.:
const links = [
{ source: 0, target: 4, value: 10, color: 'rgba(20,20,30,.3)' },
{ source: 1, target: 4, value: 20, color: 'rgba(90,90,90,.3)' },
{ source: 2, target: 4, value: 20, color: 'rgba(200,45,40,.3)' },
{ source: 3, target: 5, value: 4, color: 'rgb(45,70,40)' },
];
Documentation still suggests that you can use links
in the style object, but this does not seem to be supported. That would seem a very basic feature to have.
In the most common case it doesn't seem te make sense to add styling on each datum of your data.
To keep data and style separate:
<Sankey nodes={data.nodes} links={data.links.map((d, i) => ({ ...d, color:'#df8305', opacity: 0.1 }))} />
I'm trying to change default blue links at Sankey chart with style option. But nothing happens. Could anybody help me?