SVGPathElement
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
The SVGPathElement interface corresponds to the <path> element.
Note:
In SVG 2 the getPathSegAtLength() and createSVGPathSeg* methods were removed and the pathLength property and the getTotalLength() and getPointAtLength() methods were moved to SVGGeometryElement.
Instance properties
This interface inherits properties from its parent, SVGGeometryElement.
SVGPathElement.pathLengthRead only-
This property reflects the
pathLengthattribute.
Instance methods
This interface also inherits methods from its parent, SVGGeometryElement.
SVGPathElement.getPathData()-
Returns the sequence of path segments that corresponds to the path data, optionally normalizing the values and segment types.
SVGPathElement.getPointAtLength()-
Returns the point at a given distance along the path.
SVGPathElement.getTotalLength()-
Returns the user agent's computed value for the total length of the path in user units.
SVGPathElement.setPathData()-
Sets the sequence of path segments as the new path data.
SVGPathElement.getPathSegmentAtLength()-
Returns the segment at a given distance along the path.
Deprecated methods
SVGPathElement.getPathSegAtLength()-
Returns an unsigned long representing the index within the
pathSegListutilizing the user agent's distance-along-a-path algorithm. SVGPathElement.createSVGPathSegClosePath()-
Returns a stand-alone, parentless
SVGPathSegClosePathobject. SVGPathElement.createSVGPathSegMovetoAbs()-
Returns a stand-alone, parentless
SVGPathSegMovetoAbsobject. SVGPathElement.createSVGPathSegMovetoRel()-
Returns a stand-alone, parentless
SVGPathSegMovetoRelobject. SVGPathElement.createSVGPathSegLinetoAbs()-
Returns a stand-alone, parentless
SVGPathSegLinetoAbsobject. SVGPathElement.createSVGPathSegLinetoRel()-
Returns a stand-alone, parentless
SVGPathSegLinetoRelobject. SVGPathElement.createSVGPathSegCurvetoCubicAbs()-
Returns a stand-alone, parentless
SVGPathSegCurvetoCubicAbsobject. SVGPathElement.createSVGPathSegCurvetoCubicRel()-
Returns a stand-alone, parentless
SVGPathSegCurvetoCubicRelobject. SVGPathElement.createSVGPathSegCurvetoQuadraticAbs()-
Returns a stand-alone, parentless
SVGPathSegCurvetoQuadraticAbsobject. SVGPathElement.createSVGPathSegCurvetoQuadraticRel()-
Returns a stand-alone, parentless
SVGPathSegCurvetoQuadraticRelobject. SVGPathElement.createSVGPathSegArcAbs()-
Returns a stand-alone, parentless
SVGPathSegArcAbsobject. SVGPathElement.createSVGPathSegArcRel()-
Returns a stand-alone, parentless
SVGPathSegArcRelobject. SVGPathElement.createSVGPathSegLinetoHorizontalAbs()-
Returns a stand-alone, parentless
SVGPathSegLinetoHorizontalAbsobject. SVGPathElement.createSVGPathSegLinetoHorizontalRel()-
Returns a stand-alone, parentless
SVGPathSegLinetoHorizontalRelobject. SVGPathElement.createSVGPathSegLinetoVerticalAbs()-
Returns a stand-alone, parentless
SVGPathSegLinetoVerticalAbsobject. SVGPathElement.createSVGPathSegLinetoVerticalRel()-
Returns a stand-alone, parentless
SVGPathSegLinetoVerticalRelobject. SVGPathElement.createSVGPathSegCurvetoCubicSmoothAbs()-
Returns a stand-alone, parentless
SVGPathSegCurvetoCubicSmoothAbsobject. SVGPathElement.createSVGPathSegCurvetoCubicSmoothRel()-
Returns a stand-alone, parentless
SVGPathSegCurvetoCubicSmoothRelobject. SVGPathElement.createSVGPathSegCurvetoQuadraticSmoothAbs()-
Returns a stand-alone, parentless
SVGPathSegCurvetoQuadraticSmoothAbsobject. SVGPathElement.createSVGPathSegCurvetoQuadraticSmoothRel()-
Returns a stand-alone, parentless
SVGPathSegCurvetoQuadraticSmoothRelobject.
Specifications
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2> # InterfaceSVGPathElement> |
Browser compatibility
See also
<path>SVG Element