SVG API
SVG 提供了圆形、矩形以及简单和复杂曲线的元素。这些元素的属性值指定了它们的绘制方式。**SVG API** 是 **DOM** 的一个子集,它通过在内存中表示这些 SVG 元素及其属性值,将它们与脚本或编程语言连接起来。因此,SVG API 提供了允许以编程方式访问 SVG 元素及其属性值的方法。
SVG API 是一组被划分为以下几大类别的接口
- 元素接口 提供对 SVG 元素属性的访问以及操作它们的方法。
- 静态数据类型 接口提供对元素属性值的访问以及操作它们的方法。
- 对于可动画化的属性,动画数据类型接口 提供对属性当前动画值的只读访问。
- 同步多媒体集成语言 (SMIL) 接口
- 其他
接口
SVG 元素接口
SVGAElementSVGAnimationElementSVGAnimateElementSVGAnimateMotionElementSVGAnimateTransformElementSVGCircleElementSVGClipPathElementSVGComponentTransferFunctionElementSVGDefsElementSVGDescElementSVGDiscardElementSVGElementSVGEllipseElementSVGFEBlendElementSVGFEColorMatrixElementSVGFEComponentTransferElementSVGFECompositeElementSVGFEConvolveMatrixElementSVGFEDiffuseLightingElementSVGFEDisplacementMapElementSVGFEDistantLightElementSVGFEDropShadowElementSVGFEFloodElementSVGFEFuncAElementSVGFEFuncBElementSVGFEFuncGElementSVGFEFuncRElementSVGFEGaussianBlurElementSVGFEImageElementSVGFEMergeElementSVGFEMergeNodeElementSVGFEMorphologyElementSVGFEOffsetElementSVGFEPointLightElementSVGFESpecularLightingElementSVGFESpotLightElementSVGFETileElementSVGFETurbulenceElementSVGFilterElementSVGForeignObjectElementSVGGElementSVGGeometryElementSVGGradientElementSVGGraphicsElementSVGImageElementSVGLinearGradientElementSVGLineElementSVGMarkerElement实验性的SVGMaskElementSVGMetadataElementSVGMPathElementSVGPathElementSVGPatternElementSVGPolylineElementSVGPolygonElementSVGRadialGradientElementSVGRectElementSVGScriptElementSVGSetElementSVGStopElementSVGStyleElementSVGSVGElementSVGSwitchElementSVGSymbolElementSVGTextContentElementSVGTextElementSVGTextPathElementSVGTextPositioningElementSVGTitleElementSVGTSpanElementSVGUseElementSVGViewElement
SVG 数据类型接口
以下是用于 SVG 属性和特性定义中的数据类型的 DOM API。
静态类型
SVGAngleSVGLengthSVGLengthListSVGNumberSVGNumberListSVGPreserveAspectRatioSVGStringListSVGTransformSVGTransformList
动画类型
与 SMIL 相关的接口
其他 SVG 接口
规范
| 规范 |
|---|
| Scalable Vector Graphics (SVG) 2 |