Update to d3-sankey-circular to allow self-linking nodes, as well as fixes to how nodes are compared to determine if they are horizontally aligned.
Also, includes minor tweaks to the layout functions to accommodate self linking links, and circular links that travel below the chart.
https://d3js.org/d3.v4.min.js
https://d3js.org/d3-scale-chromatic.v1.min.js