Class SVGSVGElement
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The 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.
[Value("SVGSVGElement")]
public class SVGSVGElement : SVGGraphicsElement, ElementCSSInlineStyle, GlobalEventHandlers, SVGElementInstance, HTMLOrSVGElement, SVGTests
- Inheritance
-
SVGSVGElement
- Implements
- Inherited Members
Remarks
Constructors
SVGSVGElement()
public SVGSVGElement()
Properties
CurrentScale
The currentScale property of the SVGSVGElement interface reflects the current scale factor relative to the initial view to take into account user magnification and panning operations on the outermost {{SVGElement("svg")}} element.
[Value("currentScale")]
public Number CurrentScale { get; set; }
Property Value
- Number
A float.
Remarks
DOM attributes currentScale and currentTranslate are equivalent to the 2×3 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).
If the svg element is not at the outermost level, then currentScale is always 1 and setting it has no effect.
CurrentTranslate
The currentTranslate read-only property of the SVGSVGElement interface reflects the translation factor that takes into account user "magnification" corresponding to an outermost {{SVGElement("svg")}} element.
[Value("currentTranslate")]
public DOMPointReadOnly CurrentTranslate { get; }
Property Value
Remarks
If the svg element is not at the outermost level, then currentTranslate is always { x: 0, y: 0 } and is read-only. Otherwise, it is writable.
Height
The height read-only property of the SVGSVGElement interface describes the vertical size of element as an SVGAnimatedLength. It reflects the {{SVGElement("svg")}} element's {{SVGAttr("height")}} attribute, which may not be the SVG's rendered height.
[Value("height")]
public SVGAnimatedLength Height { get; }
Property Value
Remarks
The CSS height property takes precedence over the <svg> element's height attribute, so the value may not reflect the element's appearance. If both the viewBox and height attributes are omitted, the height property reflects that actual height.
Width
The width read-only property of the SVGSVGElement interface describes the horizontal size of element as an SVGAnimatedLength. It reflects the {{SVGElement("svg")}} element's {{SVGAttr("width")}} attribute, which may not be the SVG's rendered width.
[Value("width")]
public SVGAnimatedLength Width { get; }
Property Value
Remarks
The CSS width property takes precedence over the <svg> element's width attribute, so the value may not reflect the element's appearance. If both the viewBox and width attributes are omitted, the width property reflects that actual width.
-SVGSVGElement.ViewBox
-BaseVal
X
The x read-only property of the SVGSVGElement interface describes the horizontal coordinate of the position of that SVG as an SVGAnimatedLength. When an {{SVGElement("svg")}} is nested within another <svg>, the horizontal coordinate is a length in the user coordinate system that is the given distance from the origin of the user coordinate system along the x-axis. Its syntax is the same as that for <length>.
[Value("x")]
public SVGAnimatedLength X { get; }
Property Value
Remarks
It reflects the svg element's {{SVGAttr("x")}} geometric attribute. The default value is 0. The x attribute has no effect on outermost <svg> elements; only one nested ones. The CSS x property takes precedence over the <svg> element's x attribute, so the value may not reflect the element's appearance.
Y
The y read-only property of the SVGSVGElement interface describes the vertical coordinate of the position of that SVG as an SVGAnimatedLength. When an {{SVGElement("svg")}} is nested within another <svg>, the vertical coordinate is a length in the user coordinate system that is the given distance from the origin of the user coordinate system along the y-axis. Its syntax is the same as that for <length>.
[Value("y")]
public SVGAnimatedLength Y { get; }
Property Value
Remarks
It reflects the svg element's {{SVGAttr("y")}} geometric attribute. The default value is 0. The y attribute has no effect on outermost <svg> elements; only on nested ones. The CSS y property takes precedence over the <svg> element's y attribute, so the value may not reflect the element's appearance.
Methods
AnimationsPaused()
The animationsPaused() method of the SVGSVGElement interface checks whether the animations in the SVG document fragment are currently paused.
[Value("animationsPaused")]
public bool AnimationsPaused()
Returns
- bool
A boolean.
trueif this SVG document fragment is in a paused state.
Remarks
CheckEnclosure(SVGElement, DOMRectReadOnly)
The checkEnclosure() method of the SVGSVGElement interface checks if the rendered content of the given element is entirely contained within the supplied rectangle.
[Value("checkEnclosure")]
public bool CheckEnclosure(SVGElement element, DOMRectReadOnly rect)
Parameters
elementSVGElementrectDOMRectReadOnly
Returns
- bool
A boolean.
Remarks
Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in pointer-events processing.
CheckIntersection(SVGElement, DOMRectReadOnly)
The checkIntersection() method of the SVGSVGElement interface checks if the rendered content of the given element intersects the supplied rectangle.
[Value("checkIntersection")]
public bool CheckIntersection(SVGElement element, DOMRectReadOnly rect)
Parameters
elementSVGElementrectDOMRectReadOnly
Returns
- bool
A boolean.
Remarks
Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in pointer-events processing.
CreateSVGAngle()
The createSVGAngle() method of the SVGSVGElement interface creates an SVGAngle object outside of any document trees.
[Value("createSVGAngle")]
public SVGAngle CreateSVGAngle()
Returns
Remarks
CreateSVGLength()
The createSVGLength() method of the SVGSVGElement interface creates an SVGLength object outside of any document trees.
[Value("createSVGLength")]
public SVGLength CreateSVGLength()
Returns
Remarks
CreateSVGMatrix()
The createSVGMatrix() method of the SVGSVGElement interface creates a DOMMatrix object outside of any document trees.
[Value("createSVGMatrix")]
public DOMMatrix CreateSVGMatrix()
Returns
Remarks
CreateSVGNumber()
The createSVGNumber() method of the SVGSVGElement interface creates an SVGNumber object outside of any document trees.
[Value("createSVGNumber")]
public SVGNumber CreateSVGNumber()
Returns
Remarks
CreateSVGPoint()
The createSVGPoint() method of the SVGSVGElement interface creates a DOMPoint object outside of any document trees.
[Value("createSVGPoint")]
public DOMPoint CreateSVGPoint()
Returns
Remarks
CreateSVGRect()
The createSVGRect() method of the SVGSVGElement interface creates an DOMRect object outside of any document trees.
[Value("createSVGRect")]
public DOMRect CreateSVGRect()
Returns
Remarks
CreateSVGTransform()
The createSVGTransform() method of the SVGSVGElement interface creates an SVGTransform object outside of any document trees.
[Value("createSVGTransform")]
public SVGTransform CreateSVGTransform()
Returns
- SVGTransform
An SVGTransform object, initialized to the identity matrix transform (
matrix(1, 0, 0, 1, 0, 0)).
Remarks
CreateSVGTransformFromMatrix(DOMMatrix2DInit)
The createSVGTransformFromMatrix() method of the SVGSVGElement interface creates an SVGTransform object outside of any document trees, based on the given DOMMatrix object.
[Value("createSVGTransformFromMatrix")]
public SVGTransform CreateSVGTransformFromMatrix(DOMMatrix2DInit matrix = null)
Parameters
matrixDOMMatrix2DInit
Returns
- SVGTransform
An SVGTransform object, initialized to the given matrix transform. It is a
matrix()transform if thematrixis 2D, and amatrix3d()transform otherwise.
Remarks
DeselectAll()
The deselectAll() method of the SVGSVGElement interface unselects any selected objects, including any selections of text strings and type-in bars.
[Value("deselectAll")]
public GlobalObject.Undefined DeselectAll()
Returns
- GlobalObject.Undefined
None.
Remarks
ForceRedraw()
[Value("forceRedraw")]
public GlobalObject.Undefined ForceRedraw()
Returns
GetCurrentTime()
The getCurrentTime() method of the SVGSVGElement interface returns the current time in seconds relative to the start time for the current SVG document fragment.
[Value("getCurrentTime")]
public Number GetCurrentTime()
Returns
- Number
A float.
Remarks
If getCurrentTime() is called before the document timeline has begun (for example, by script running in a script element before the document's SVGLoad event is dispatched), then 0 is returned.
GetElementById(string)
The getElementById() method of the SVGSVGElement interface searches the SVG document fragment (i.e., the search is restricted to a subset of the document tree) for an Element whose id property matches the specified string.
[Value("getElementById")]
public Element GetElementById(string elementId)
Parameters
elementIdstring
Returns
- Element
An Element object describing the DOM element object matching the specified ID, or
nullif no matching element was found in the SVG document fragment.
Remarks
GetEnclosureList(DOMRectReadOnly, SVGElement?)
[Value("getEnclosureList")]
public NodeList GetEnclosureList(DOMRectReadOnly rect, SVGElement? referenceElement)
Parameters
rectDOMRectReadOnlyreferenceElementSVGElement
Returns
GetIntersectionList(DOMRectReadOnly, SVGElement?)
[Value("getIntersectionList")]
public NodeList GetIntersectionList(DOMRectReadOnly rect, SVGElement? referenceElement)
Parameters
rectDOMRectReadOnlyreferenceElementSVGElement
Returns
PauseAnimations()
The pauseAnimations() method of the SVGSVGElement interface suspends (i.e., pauses) all currently running animations that are defined within the SVG document fragment corresponding to this {{SVGElement("svg")}} element, causing the animation clock corresponding to this document fragment to stand still until it is unpaused.
[Value("pauseAnimations")]
public GlobalObject.Undefined PauseAnimations()
Returns
Remarks
SetCurrentTime(Number)
The setCurrentTime() method of the SVGSVGElement interface adjusts the clock for this SVG document fragment, establishing a new current time.
[Value("setCurrentTime")]
public GlobalObject.Undefined SetCurrentTime(Number seconds)
Parameters
secondsNumber
Returns
- GlobalObject.Undefined
None.
Remarks
If setCurrentTime() is called before the document timeline has begun (for example, by script running in a script element before the document's SVGLoad event is dispatched), then the value of seconds in the last invocation of the method gives the time that the document will seek to once the document timeline has begun.
SuspendRedraw(ulong)
[Value("suspendRedraw")]
public ulong SuspendRedraw(ulong maxWaitMilliseconds)
Parameters
maxWaitMillisecondsulong
Returns
UnpauseAnimations()
The unpauseAnimations() method of the SVGSVGElement interface resumes (i.e., unpauses) currently running animations that are defined within the SVG document fragment, causing the animation clock to continue from the time at which it was suspended.
[Value("unpauseAnimations")]
public GlobalObject.Undefined UnpauseAnimations()
Returns
Remarks
UnsuspendRedraw(ulong)
[Value("unsuspendRedraw")]
public GlobalObject.Undefined UnsuspendRedraw(ulong suspendHandleID)
Parameters
suspendHandleIDulong
Returns
UnsuspendRedrawAll()
[Value("unsuspendRedrawAll")]
public GlobalObject.Undefined UnsuspendRedrawAll()