This is a demonstration of a Sankey diagram in D3 with conditional particle flow and circular nodes.

To change the position of the nodes on the screen use the mouse to drag any node. Clicking (double click if it's the first time you choose the node) on the nodes

will trigger the particle flow. Click again to kill the flow. Clicking on a node which is not in the flow will kill the old flow and trigger a new one based on the new condition set.

(Ctrl+Shift+i to see the source code)