SVGSVGElement
interface provides access to the properties of <svg>
elements, as well as methods to manipulate them. This interface contains also various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices.contentScriptType
on the given <svg>
element.contentStyleType
on the given <svg>
element.<svg>
element, this attribute indicates the current scale factor relative to the initial view to take into account user magnification and panning operations. DOM attributes currentScale
and currentTranslate
are equivalent to the 2x3 matrix a b c d e f
= currentScale 0 0 currentScale currentTranslate.x currentTranslate.y
. If "magnification" is enabled (i.e., zoomAndPan="magnify"
), then the effect is as if an extra transformation were placed at the outermost level on the SVG document fragment (i.e., outside the outermost <svg>
element).<svg>
element, the corresponding translation factor that takes into account user "magnification".viewBox
,
preserveAspectRatio
and
zoomAndPan
within
currentView
will match the values for the corresponding DOM attributes that are on SVGSVGElement
directlytransform
and
viewTarget
within
currentView
will be null<view>
element, then: viewBox
,
preserveAspectRatio
and
zoomAndPan
within
currentView
will correspond to the corresponding attributes for the given <view>
elementtransform
and
viewTarget
within
currentView
will be null<view>
), then: viewBox
,
preserveAspectRatio
and
zoomAndPan
within
currentView
will match the values for the corresponding DOM attributes that are on SVGSVGElement
directly for the closest ancestor <svg>
elementtransform
within
currentView
will be nullviewTarget
within
currentView
will represent the target of the linkviewBox
,
preserveAspectRatio
,
zoomAndPan
,
transform
and
viewTarget
within
currentView
will correspond to the values from the SVG view specification fragment identifierheight
on the given <svg>
element.<svg>
element such as
viewBox
) or to a "custom" view (i.e., a hyperlink into a particular <view>
or other element). If the initial view is the "standard" view, then this attribute is false. If the initial view is a "custom" view, then this attribute is true.<svg>
element. When the browser is actually rendering the content, then the position and size values represent the actual values when rendering. The position and size values are unitless values in the coordinate system of the parent element. If no parent element exists (i.e., <svg>
element represents the root of the document tree), if this SVG document is embedded as part of another document (e.g., via the HTML <object>
element), then the position and size are unitless values in the coordinate system of the parent document. (If the parent uses CSS or XSL layout, then unitless values represent pixel units for the current CSS or XSL viewport.)width
on the given <svg>
element.