Let new path data API ride the trains
Categories
(Core :: SVG, enhancement)
Tracking
()
People
(Reporter: longsonr, Assigned: longsonr)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
| Assignee | ||
Comment 1•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 2•1 year ago
|
||
Comment 4•11 months ago
|
||
| bugherder | ||
Comment 5•11 months ago
|
||
Added to our 137 beta release notes with this wording:
Support for the SVG 2 path API is now available.
Adding the relnote flag and keeping it open until we ship to the release channel.
Comment 6•10 months ago
|
||
Hey! I’m documenting this API on MDN and have a few questions:
What user-facing methods/interfaces were implemented: getPathData, setPathData, and getPathSegmentAtLength?
Is there a way to construct an SVGPathSegment sequence to use it in the setPathData method? My attempts to use an array similar to what the polyfill uses:
const pathData = [
{ type: "M", values: [0, 0] },
{ type: "h", values: [64] },
{ type: "v", values: [64] },
{ type: "h", values: [-64] },
{ type: "Z", values: [] }
]
And then setting it to the path path.setPathData(pathData) end up with an error:
Uncaught TypeError: SVGPathElement.setPathData: Element of argument 1 does not implement interface SVGPathSegment.
I can only successfully setPathData that I just got via getPathData. But I’m trying to show an example of constructing it.
Thanks!
| Assignee | ||
Comment 7•10 months ago
|
||
What user-facing methods/interfaces were implemented: getPathData, setPathData, and getPathSegmentAtLength?
All of the above.
Is there a way to construct an SVGPathSegment sequence to use it in the setPathData method?
Not as far as I'm aware. See https://github.com/w3c/svgwg/issues/964
You'd need to get a SVGPathSegment from getPathData or getPathSegmentAtLength.
Updated•10 months ago
|
Updated•10 months ago
|
Description
•