d3 / d3-path

Serialize Canvas path commands to SVG.
https://d3js.org/d3-path
ISC License
196 stars 37 forks source link

Arc and arcTo draw only circular arcs. #18

Closed rybaczewa closed 5 years ago

rybaczewa commented 5 years ago

Currently, neiher path.arc nor path.arcTo allow to draw elliptical arcs - only circular. Single radius is passed and used for both rx and ry parameters.

https://github.com/d3/d3-path/blob/fb809cd12e1122ed2fd6df72d2017592f1dc4451/src/path.js#L118-L120

It's possible to draw first, but not the second arc: https://jsfiddle.net/qd1ph9y0/5/

mbostock commented 5 years ago

Correct. Please see the CanvasPathMethods specification:

https://www.w3.org/TR/2dcontext/#building-paths

carpiediem commented 4 years ago

Would it make sense to add an additional method that captures the capabilities of the SVG elliptical arc command?

mbostock commented 4 years ago

No. This interface is specified by the CanvasPathMethods API.