You can config:

sankeyNetwork(Links = Flow_data, Nodes = Nodes_data,
                      Source = "Source_ID", Target = "Target",
                      Value = "value", NodeID = "Nodes_name",
                      width = 1000, height=600, fontsize = 16, nodeWidth = 50,
                      colourScale = "d3.scale.category20c()")  <==== Categorical color


Newer version:

d3.scale.ordinal().range(["#7d3945","#e0677b", "#244457"])
now works if changed to:
d3.scaleOrdinal().range(["#7d3945","#e0677b", "#244457"]) 

Thanks @Peter Ellis


Is there any way to set transparency when using custom colours?

"#AARRGGBB" doesn't seem to work

You can make a selectAll("your_class").style("opacity",0.5), Take a look to this:… for style attribute options. And CSS3 has a fully standardized solution: "fill="rgba(124,240,10,0.5)"

For color references, look here:

and here:

Related Query