color your d3 sankey using rCharts
This example shows how to add color to a d3.js Sankey diagram built with rCharts, using data from a Google Spreadsheet describing visualization gallery entries. The code uses the `d3.sankey` plugin to create the diagram, then applies a custom `afterScript` template that selects all `path.link` elements and sets their stroke color to match the source node’s color. The data is processed with `plyr` to aggregate edges into source-target-value triples. The result is a color-coded Sankey diagram rendered in SVG, demonstrating a technique applicable beyond rCharts.
AI-generated descriptionHow To Color Your d3.js Sankey Diagram
in this case with rCharts but relevant even without
In response to this Stack Overflow question Adding Color to Sankey Diagram in rCharts, I put this quick example together to demonstrate one way of handling.
forked from <a href='http://bl.ocks.org/timelyportfolio/'>timelyportfolio</a>'s block: <a href='http://bl.ocks.org/timelyportfolio/79350d7475a5709b051e'>color your d3 sankey using rCharts</a>