svg-line-curved
Generate the path attribute for a curved SVG line between two points:
Usage
path = curve(x1, y1, x2, y2)
Returns a path attribute for the line between (x1, y1)
and (x2, y2)
.
For example:
var createSVG =var curved =var path =path
path = curve.vertical(x1, y1, x2, y2)
Equivalent to curve(x1, y1, x2, y2)
, but curving with a vertical bias instead
of a horizontal one.
Here's an example screenshot of horizontal and vertical curves respectively:
License
MIT. See LICENSE.md for details.