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.
TheSVGPathElement interface corresponds to the<path> element.
Note:In SVG 2 thegetPathSegAtLength() andcreateSVGPathSeg* methods were removed and thepathLength property and thegetTotalLength() andgetPointAtLength() methods were moved toSVGGeometryElement.
In this article
Instance properties
This interface inherits properties from its parent,SVGGeometryElement.
SVGPathElement.pathLengthRead onlyThis property reflects the
pathLengthattribute.
Instance methods
This interface also inherits methods from its parent,SVGGeometryElement.
SVGPathElement.getPathData()ExperimentalReturns 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()ExperimentalSets the sequence of path segments as the new path data.
SVGPathElement.getPathSegmentAtLength()ExperimentalReturns the segment at a given distance along the path.
Deprecated methods
SVGPathElement.getPathSegAtLength()DeprecatedReturns an unsigned long representing the index within the
pathSegListutilizing the user agent's distance-along-a-path algorithm.SVGPathElement.createSVGPathSegClosePath()DeprecatedReturns a stand-alone, parentless
SVGPathSegClosePathobject.SVGPathElement.createSVGPathSegMovetoAbs()DeprecatedReturns a stand-alone, parentless
SVGPathSegMovetoAbsobject.SVGPathElement.createSVGPathSegMovetoRel()DeprecatedReturns a stand-alone, parentless
SVGPathSegMovetoRelobject.SVGPathElement.createSVGPathSegLinetoAbs()DeprecatedReturns a stand-alone, parentless
SVGPathSegLinetoAbsobject.SVGPathElement.createSVGPathSegLinetoRel()DeprecatedReturns a stand-alone, parentless
SVGPathSegLinetoRelobject.SVGPathElement.createSVGPathSegCurvetoCubicAbs()DeprecatedReturns a stand-alone, parentless
SVGPathSegCurvetoCubicAbsobject.SVGPathElement.createSVGPathSegCurvetoCubicRel()DeprecatedReturns a stand-alone, parentless
SVGPathSegCurvetoCubicRelobject.SVGPathElement.createSVGPathSegCurvetoQuadraticAbs()DeprecatedReturns a stand-alone, parentless
SVGPathSegCurvetoQuadraticAbsobject.SVGPathElement.createSVGPathSegCurvetoQuadraticRel()DeprecatedReturns a stand-alone, parentless
SVGPathSegCurvetoQuadraticRelobject.SVGPathElement.createSVGPathSegArcAbs()DeprecatedReturns a stand-alone, parentless
SVGPathSegArcAbsobject.SVGPathElement.createSVGPathSegArcRel()DeprecatedReturns a stand-alone, parentless
SVGPathSegArcRelobject.SVGPathElement.createSVGPathSegLinetoHorizontalAbs()DeprecatedReturns a stand-alone, parentless
SVGPathSegLinetoHorizontalAbsobject.SVGPathElement.createSVGPathSegLinetoHorizontalRel()DeprecatedReturns a stand-alone, parentless
SVGPathSegLinetoHorizontalRelobject.SVGPathElement.createSVGPathSegLinetoVerticalAbs()DeprecatedReturns a stand-alone, parentless
SVGPathSegLinetoVerticalAbsobject.SVGPathElement.createSVGPathSegLinetoVerticalRel()DeprecatedReturns a stand-alone, parentless
SVGPathSegLinetoVerticalRelobject.SVGPathElement.createSVGPathSegCurvetoCubicSmoothAbs()DeprecatedReturns a stand-alone, parentless
SVGPathSegCurvetoCubicSmoothAbsobject.SVGPathElement.createSVGPathSegCurvetoCubicSmoothRel()DeprecatedReturns a stand-alone, parentless
SVGPathSegCurvetoCubicSmoothRelobject.SVGPathElement.createSVGPathSegCurvetoQuadraticSmoothAbs()DeprecatedReturns a stand-alone, parentless
SVGPathSegCurvetoQuadraticSmoothAbsobject.SVGPathElement.createSVGPathSegCurvetoQuadraticSmoothRel()DeprecatedReturns a stand-alone, parentless
SVGPathSegCurvetoQuadraticSmoothRelobject.
Specifications
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2> # InterfaceSVGPathElement> |
Browser compatibility
See also
<path>SVG Element