大网数据广告活动
Web 标准与前端开发

SVGPathElement

· 52CE 我爱测

The **`SVGPathElement`** interface corresponds to the path element.

SVG

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.pathLength
    • : This property reflects the pathLength attribute.

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 SVGAnimatedPathData.pathSegList utilizing the user agent's distance-along-a-path algorithm.
  • SVGPathElement.createSVGPathSegClosePath()
    • : Returns a stand-alone, parentless SVGPathSegClosePath object.
  • SVGPathElement.createSVGPathSegMovetoAbs()
    • : Returns a stand-alone, parentless SVGPathSegMovetoAbs object.
  • SVGPathElement.createSVGPathSegMovetoRel()
    • : Returns a stand-alone, parentless SVGPathSegMovetoRel object.
  • SVGPathElement.createSVGPathSegLinetoAbs()
    • : Returns a stand-alone, parentless SVGPathSegLinetoAbs object.
  • SVGPathElement.createSVGPathSegLinetoRel()
    • : Returns a stand-alone, parentless SVGPathSegLinetoRel object.
  • SVGPathElement.createSVGPathSegCurvetoCubicAbs()
    • : Returns a stand-alone, parentless SVGPathSegCurvetoCubicAbs object.
  • SVGPathElement.createSVGPathSegCurvetoCubicRel()
    • : Returns a stand-alone, parentless SVGPathSegCurvetoCubicRel object.
  • SVGPathElement.createSVGPathSegCurvetoQuadraticAbs()
    • : Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticAbs object.
  • SVGPathElement.createSVGPathSegCurvetoQuadraticRel()
    • : Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticRel object.
  • SVGPathElement.createSVGPathSegArcAbs()
    • : Returns a stand-alone, parentless SVGPathSegArcAbs object.
  • SVGPathElement.createSVGPathSegArcRel()
    • : Returns a stand-alone, parentless SVGPathSegArcRel object.
  • SVGPathElement.createSVGPathSegLinetoHorizontalAbs()
    • : Returns a stand-alone, parentless SVGPathSegLinetoHorizontalAbs object.
  • SVGPathElement.createSVGPathSegLinetoHorizontalRel()
    • : Returns a stand-alone, parentless SVGPathSegLinetoHorizontalRel object.
  • SVGPathElement.createSVGPathSegLinetoVerticalAbs()
    • : Returns a stand-alone, parentless SVGPathSegLinetoVerticalAbs object.
  • SVGPathElement.createSVGPathSegLinetoVerticalRel()
    • : Returns a stand-alone, parentless SVGPathSegLinetoVerticalRel object.
  • SVGPathElement.createSVGPathSegCurvetoCubicSmoothAbs()
    • : Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothAbs object.
  • SVGPathElement.createSVGPathSegCurvetoCubicSmoothRel()
    • : Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothRel object.
  • SVGPathElement.createSVGPathSegCurvetoQuadraticSmoothAbs()
    • : Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothAbs object.
  • SVGPathElement.createSVGPathSegCurvetoQuadraticSmoothRel()
    • : Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothRel object.

Specifications

Browser compatibility

See also

  • path SVG Element

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。