Skip to content

Instantly share code, notes, and snippets.

@ashaw
Created March 9, 2012 22:22
Show Gist options
  • Save ashaw/2009032 to your computer and use it in GitHub Desktop.
Save ashaw/2009032 to your computer and use it in GitHub Desktop.
var sankeyIze = function(ox, oy, dx, dy) {
var curve = ((dx-ox) * 0.25)
var path = "";
path += "M "+ ox + "," + oy;
path += "Q " + (ox+curve) + "," + oy + " " + ((ox+dx)/2) +","+ ((oy+dy)/2);
path += "Q " + (dx-curve) + "," + dy + " " + dx + "," + dy;
return path;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment