We want to use d3 to draw a network route graph that has fixed start and end node but different paths in between that might share some nodes, for example:
See my demo here。
http://jsfiddle.net/doraeimo/JEcdS/
The main idea is to make a connectivity based on a tree.
//1)temporarily convert a connectivity to a tree
var tree = conv2tree(data);
//2)calculate for nodes' coords with cluster.nodes(tree);
var nodes = buildNodes(tree);
//3)append all the edges(links) of the connectivity
var links = buildLinks(data);