SVGPathElement

Baseline 廣泛可用 *

此特性已相當成熟,可在許多裝置和瀏覽器版本上使用。自 ⁨2015 年 7 月⁩以來,各瀏覽器均已提供此特性。

* 此特性的某些部分可能存在不同級別的支援。

SVGPathElement 介面對應於 <path> 元素。

EventTarget Node Element SVGElement SVGGraphicsElement SVGGeometryElement SVGPathElement

注意: 在 SVG 2 中,getPathSegAtLength()createSVGPathSeg* 方法被移除,pathLength 屬性以及 getTotalLength()getPointAtLength() 方法被移至 SVGGeometryElement

例項屬性

此介面繼承了其父級 SVGGeometryElement 的屬性。

SVGPathElement.pathLength 只讀

此屬性反映了 pathLength 屬性。

例項方法

此介面還繼承了其父級 SVGGeometryElement 的方法。

SVGPathElement.getPathData() 實驗性

返回對應於路徑資料的路徑段序列,可選擇標準化值和段型別。

SVGPathElement.getPointAtLength()

返回沿路徑給定距離處的點。

SVGPathElement.getTotalLength()

返回使用者代理計算出的路徑總長度(使用者單位)。

SVGPathElement.setPathData() 實驗性

將路徑段序列設定為新的路徑資料。

SVGPathElement.getPathSegmentAtLength() 實驗性

返回沿路徑給定距離處的段。

已廢棄的方法

SVGPathElement.getPathSegAtLength() 已廢棄

返回一個無符號長整數,表示 pathSegList 中利用使用者代理的沿路徑距離演算法的索引。

SVGPathElement.createSVGPathSegClosePath() 已廢棄

返回一個獨立的、無父級的 SVGPathSegClosePath 物件。

SVGPathElement.createSVGPathSegMovetoAbs() 已廢棄

返回一個獨立的、無父級的 SVGPathSegMovetoAbs 物件。

SVGPathElement.createSVGPathSegMovetoRel() 已廢棄

返回一個獨立的、無父級的 SVGPathSegMovetoRel 物件。

SVGPathElement.createSVGPathSegLinetoAbs() 已廢棄

返回一個獨立的、無父級的 SVGPathSegLinetoAbs 物件。

SVGPathElement.createSVGPathSegLinetoRel() 已廢棄

返回一個獨立的、無父級的 SVGPathSegLinetoRel 物件。

SVGPathElement.createSVGPathSegCurvetoCubicAbs() 已廢棄

返回一個獨立的、無父級的 SVGPathSegCurvetoCubicAbs 物件。

SVGPathElement.createSVGPathSegCurvetoCubicRel() 已廢棄

返回一個獨立的、無父級的 SVGPathSegCurvetoCubicRel 物件。

SVGPathElement.createSVGPathSegCurvetoQuadraticAbs() 已廢棄

返回一個獨立的、無父級的 SVGPathSegCurvetoQuadraticAbs 物件。

SVGPathElement.createSVGPathSegCurvetoQuadraticRel() 已廢棄

返回一個獨立的、無父級的 SVGPathSegCurvetoQuadraticRel 物件。

SVGPathElement.createSVGPathSegArcAbs() 已廢棄

返回一個獨立的、無父級的 SVGPathSegArcAbs 物件。

SVGPathElement.createSVGPathSegArcRel() 已廢棄

返回一個獨立的、無父級的 SVGPathSegArcRel 物件。

SVGPathElement.createSVGPathSegLinetoHorizontalAbs() 已廢棄

返回一個獨立的、無父級的 SVGPathSegLinetoHorizontalAbs 物件。

SVGPathElement.createSVGPathSegLinetoHorizontalRel() 已廢棄

返回一個獨立的、無父級的 SVGPathSegLinetoHorizontalRel 物件。

SVGPathElement.createSVGPathSegLinetoVerticalAbs() 已廢棄

返回一個獨立的、無父級的 SVGPathSegLinetoVerticalAbs 物件。

SVGPathElement.createSVGPathSegLinetoVerticalRel() 已廢棄

返回一個獨立的、無父級的 SVGPathSegLinetoVerticalRel 物件。

SVGPathElement.createSVGPathSegCurvetoCubicSmoothAbs() 已廢棄

返回一個獨立的、無父級的 SVGPathSegCurvetoCubicSmoothAbs 物件。

SVGPathElement.createSVGPathSegCurvetoCubicSmoothRel() 已廢棄

返回一個獨立的、無父級的 SVGPathSegCurvetoCubicSmoothRel 物件。

SVGPathElement.createSVGPathSegCurvetoQuadraticSmoothAbs() 已廢棄

返回一個獨立的、無父級的 SVGPathSegCurvetoQuadraticSmoothAbs 物件。

SVGPathElement.createSVGPathSegCurvetoQuadraticSmoothRel() 已廢棄

返回一個獨立的、無父級的 SVGPathSegCurvetoQuadraticSmoothRel 物件。

規範

規範
Scalable Vector Graphics (SVG) 2
# 介面SVGPathElement

瀏覽器相容性

另見