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•3 months ago
|
||
Updated•3 months ago
|
Updated•3 months ago
|
Assignee | ||
Comment 2•3 months ago
|
||
Comment 4•3 months ago
|
||
bugherder |
Comment 5•2 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•1 month 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•29 days 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•24 days ago
|
Updated•22 days ago
|
Description
•