New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial implementation of variable width line #448

wants to merge 2 commits into
base: master


3 participants
Copy link

larskotthoff commented Jan 19, 2012

Simulates variable width lines by drawing and connecting two boundary lines. Can be used in much the same way as d3.svg.line, except that the "fill" attribute does what the "stroke" attribute does for normal lines.

I suppose wrappers could be added to make it behave exactly like d3.svg.line (i.e. intercept .attr calls), but I think explaining how it's done in the documentation would be a better option that would offer people more flexibility.

Example at

if(i > 0) {
var dx = thisx - spinePoints[i-1][0],
dy = thisy - spinePoints[i-1][1];
aleft = Math.PI - Math.atan(dy/dx);

This comment has been minimized.


mbostock Jan 23, 2012


This should probably be Math.atan2(dy, dx) (and below).


This comment has been minimized.

Copy link

arestov commented Jul 31, 2013

Will this be merged?

@mbostock mbostock closed this Oct 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment