var link = linkG.data(sankeyLinks)
.enter()
.append("path")
.attr("d", curveSankeyForceLink)
.style("stroke-width", function (d) { return Math.max(1, d.width); })
.style("stroke", function (d) {return colour(d.depth); })
.style("opacity", 0.7);
This code did not work. Changed red:black to colour(d.depth)