UPDATE: I think @timelyportfolio's Sankey plot uses the following to get round the index issue:
//FROM: http://bl.ocks.org/timelyportfolio/79350d7475a5709b051e
//it appears d3 with force layout wants a numeric source and target
//so loop through each link replacing the text with its index from node
links.forEach(function (d, i) {
links[i].source = nodes.indexOf(links[i].source);
links[i].target = nodes.indexOf(links[i].target);
});
Does the edge data require that the nodes are identified as consecutive integers, starting from 0?
eg this works:
but if I try:
or
or
the chart doesn't render?
UPDATE: I think @timelyportfolio's Sankey plot uses the following to get round the index issue: