SVGPathElement
interface corresponds to the
<path>
元素。
<div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="../API/EventTarget.html" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="../API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25 236,20 236,30 226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="../API/Element" target="_top"><rect x="266" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Element</text></a><polyline points="341,25 351,20 351,30 341,25" stroke="#D4DDE4" fill="none"/><line x1="351" y1="25" x2="381" y2="25" stroke="#D4DDE4"/><a xlink:href="../API/SVGElement" target="_top"><rect x="381" y="1" width="100" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="431" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGElement</text></a><polyline points="481,25 491,20 491,30 481,25" stroke="#D4DDE4" fill="none"/><line x1="491" y1="25" x2="499" y2="25" stroke="#D4DDE4"/><line x1="499" y1="25" x2="499" y2="90" stroke="#D4DDE4"/><line x1="499" y1="90" x2="482" y2="90" stroke="#D4DDE4"/><a xlink:href="../API/SVGGraphicsElement" target="_top"><rect x="301" y="65" width="180" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="391" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGGraphicsElement</text></a><polyline points="301,89 291,84 291,94 301,89" stroke="#D4DDE4" fill="none"/><line x1="291" y1="89" x2="261" y2="89" stroke="#D4DDE4"/><a xlink:href="../API/SVGGeometryElement" target="_top"><rect x="81" y="65" width="180" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="171" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGGeometryElement</text></a><polyline points="81,89 71,84 71,94 81,89" stroke="#D4DDE4" fill="none"/><line x1="71" y1="89" x2="41" y2="89" stroke="#D4DDE4"/><a xlink:href="../API/SVGPathElement" target="_top"><rect x="-99" y="65" width="140" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="-29" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGPathElement</text></a></svg></div>
a:hover text { fill: #0095DD; pointer-events: all;}
注意:
In SVG 2 the
getPathSegAtLength()
and
createSVGPathSeg*
methods were removed and the
pathLength
特性和
getTotalLength()
and
getPointAtLength()
methods were moved to
SVGGeometryElement
.
This interface also inherits properties from its parent,
SVGGeometryElement
.
SVGPathElement.pathLength
SVGAnimatedNumber
corresponding to the
pathLength
attribute of the given
<path>
元素。
SVGGeometryElement
interface, from which this interface inherits it.
This interface also inherits methods from its parent,
SVGGeometryElement
.
SVGPathElement.getTotalLength()
Returns a float representing the computed value for the total length of the path using the browser's distance-along-a-path algorithm, as a distance in the current user coordinate system.
注意: In SVG 2 this method was moved to the
SVGGeometryElement
interface, from which this interface inherits it.
SVGPathElement.getPointAtLength()
返回
SVGPoint
representing the x and y coordinates in user space utilizing the browser's distance-along-a-path algorithm.
SVGGeometryElement
interface, from which this interface inherits it.
SVGPathElement.getPathSegAtLength()
pathSegList
utilizing the user agent's distance-along-a-path algorithm.
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
The definition of 'SVGPathElement' in that specification. |
候选推荐 |
移除
getPathSegAtLength()
and
createSVGPathSeg*
methods and moved the
pathLength
特性和
getTotalLength()
and
getPointAtLength()
方法到
SVGGeometryElement
.
|
|
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
The definition of 'SVGPathElement' in that specification. |
推荐 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
SVGPathElement
|
Chrome Yes | Edge 12 | Firefox Yes | IE Yes | Opera Yes | Safari Yes | WebView Android Yes | Chrome Android Yes | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
createSVGPathSegArcAbs
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegArcRel
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegClosePath
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegCurvetoCubicAbs
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegCurvetoCubicRel
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegCurvetoCubicSmoothAbs
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegCurvetoCubicSmoothRel
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegCurvetoQuadraticAbs
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegCurvetoQuadraticRel
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegCurvetoQuadraticSmoothAbs
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegCurvetoQuadraticSmoothRel
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegLinetoAbs
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegLinetoHorizontalAbs
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegLinetoHorizontalRel
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegLinetoRel
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegLinetoVerticalAbs
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegLinetoVerticalRel
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegMovetoAbs
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
createSVGPathSegMovetoRel
弃用
|
Chrome ? — 48 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 35 | Safari ? | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android ? | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
getPathSegAtLength
弃用
|
Chrome ? — 62 | Edge 12 — 79 | Firefox ? | IE ? | Opera ? — 49 | Safari ? | WebView Android ? — 62 | Chrome Android ? — 62 | Firefox Android ? | Opera Android ? — 46 | Safari iOS ? | Samsung Internet Android ? — 8.0 |
getPointAtLength
弃用
|
Chrome Yes | Edge 12 |
Firefox
Yes
|
IE Yes | Opera Yes | Safari Yes | WebView Android Yes | Chrome Android Yes |
Firefox Android
Yes
|
Opera Android ? | Safari iOS ? | Samsung Internet Android Yes |
getTotalLength
弃用
|
Chrome Yes | Edge 12 |
Firefox
Yes
|
IE ? | Opera Yes | Safari No | WebView Android Yes | Chrome Android Yes |
Firefox Android
Yes
|
Opera Android Yes | Safari iOS ? | Samsung Internet Android Yes |
pathLength
弃用
|
Chrome ? — 48 | Edge No | Firefox Yes | IE No | Opera ? — 35 | Safari Yes | WebView Android ? — 48 | Chrome Android ? — 48 | Firefox Android Yes | Opera Android ? — 35 | Safari iOS ? | Samsung Internet Android ? — 5.0 |
完整支持
不支持
兼容性未知
弃用。不要用于新网站。
见实现注意事项。
<path>
SVG Element
SVGPathElement
SVGAElement
SVGAltGlyphElement
SVGAngle
SVGAnimateColorElement
SVGAnimateElement
SVGAnimateMotionElement
SVGAnimateTransformElement
SVGAnimatedAngle
SVGAnimatedBoolean
SVGAnimatedEnumeration
SVGAnimatedInteger
SVGAnimatedLength
SVGAnimatedLengthList
SVGAnimatedNumber
SVGAnimatedNumberList
SVGAnimatedPathData
SVGAnimatedPoints
SVGAnimatedPreserveAspectRatio
SVGAnimatedRect
SVGAnimatedString
SVGAnimatedTransformList
SVGAnimationElement
SVGCircleElement
SVGClipPathElement
SVGComponentTransferFunctionElement
SVGCursorElement
SVGDefsElement
SVGDescElement
SVGDocument
SVGElement
SVGEllipseElement
SVGFEBlendElement
SVGFEColorMatrixElement
SVGFEComponentTransferElement
SVGFECompositeElement
SVGFEConvolveMatrixElement
SVGFEDiffuseLightingElement
SVGFEDisplacementMapElement
SVGFEDistantLightElement
SVGFEDropShadowElement
SVGFEFloodElement
SVGFEFuncAElement
SVGFEFuncBElement
SVGFEFuncGElement
SVGFEFuncRElement
SVGFEGaussianBlurElement
SVGFEImageElement
SVGFEMergeElement
SVGFEMergeNodeElement
SVGFEMorphologyElement
SVGFEOffsetElement
SVGFEPointLightElement
SVGFESpecularLightingElement
SVGFESpotLightElement
SVGFETileElement
SVGFETurbulenceElement
SVGFilterElement
SVGFilterPrimitiveStandardAttributes
SVGFitToViewBox
SVGFontElement
SVGFontFaceElement
SVGFontFaceFormatElement
SVGFontFaceNameElement
SVGFontFaceSrcElement
SVGFontFaceUriElement
SVGForeignObjectElement
SVGGElement
SVGGlyphElement
SVGGradientElement
SVGGraphicsElement
SVGHKernElement
SVGImageElement
SVGLength
SVGLengthList
SVGLineElement
SVGLinearGradientElement
SVGMPathElement
SVGMarkerElement
SVGMaskElement
SVGMatrix
SVGMetadataElement
SVGMissingGlyphElement
SVGNumber
SVGNumberList
SVGPathSeg
SVGPathSegArcAbs
SVGPathSegArcRel
SVGPathSegClosePath
SVGPathSegCurvetoCubicAbs
SVGPathSegCurvetoCubicRel
SVGPathSegCurvetoCubicSmoothAbs
SVGPathSegCurvetoCubicSmoothRel
SVGPathSegCurvetoQuadraticAbs
SVGPathSegCurvetoQuadraticRel
SVGPathSegCurvetoQuadraticSmoothAbs
SVGPathSegCurvetoQuadraticSmoothRel
SVGPathSegLinetoAbs
SVGPathSegLinetoHorizontalAbs
SVGPathSegLinetoHorizontalRel
SVGPathSegLinetoRel
SVGPathSegLinetoVerticalAbs
SVGPathSegLinetoVerticalRel
SVGPathSegList
SVGPathSegMovetoAbs
SVGPathSegMovetoRel
SVGPatternElement
SVGPoint
SVGPointList
SVGPolygonElement
SVGPolylineElement
SVGPreserveAspectRatio
SVGRadialGradientElement
SVGRect
SVGRectElement
SVGSVGElement
SVGScriptElement
SVGSetElement
SVGStopElement
SVGStringList
SVGStylable
SVGStyleElement
SVGSwitchElement
SVGSymbolElement
SVGTRefElement
SVGTSpanElement
SVGTests
SVGTextContentElement
SVGTextElement
SVGTextPathElement
SVGTextPositioningElement
SVGTitleElement
SVGTransform
SVGTransformList
SVGTransformable
SVGURIReference
SVGUnitTypes
SVGUseElement
SVGVKernElement
SVGViewElement
SVGZoomAndPan
SVGZoomEvent
TimeEvent