SVG Method Reference

This section contains the Scalable Vector Graphics (SVG) method reference documentation.

In this section

TopicDescription

addEventListener

Registers an event listener

animationsPaused

Gets a value that indicates whether this SVG document fragment is in a paused state.

appendItem

Inserts a new item at the end of the list.

checkEnclosure

Determines if the rendered content of the specified element is entirely contained within the specified rectangle.

checkIntersection

Determines if the rendered content of the specified element intersects the specified rectangle.

clear

Clears all existing items from the list, which creates an empty list.

consolidate

Consolidates a transform list into a single transform.

convertToSpecifiedUnits

Changes the stored unit identifier to the specified type.

createEvent

Creates an event object to be used in conjunction with the dispatchEvent method.

createSVGAngle

Creates a new SVGAngle object that does not have units, that is set to 0 degrees, and that is not attached to any document.

createSVGLength

Creates a new SVGLength object that has a length of 0 user units.

createSVGMatrix

Creates a new SVGMatrix object that is set to the identity matrix and that is not attached to any document.

createSVGNumber

Creates a new SVGNumber object that has a value of zero and that is not attached to any document.

createSVGPathSegArcAbs

Returns a stand-alone, parentless SVGPathSegArcAbs object.

createSVGPathSegArcRel

Returns a stand-alone, parentless SVGPathSegArcRel object.

createSVGPathSegClosePath

Returns a stand-alone, parentless SVGPathSegClosePath object.

createSVGPathSegCurvetoCubicAbs

Returns a stand-alone, parentless SVGPathSegCurvetoCubicAbs object.

createSVGPathSegCurvetoCubicRel

Returns a stand-alone, parentless SVGPathSegCurvetoCubicRel object.

createSVGPathSegCurvetoCubicSmoothAbs

Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothAbs object.

createSVGPathSegCurvetoCubicSmoothRel

Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothRel object.

createSVGPathSegCurvetoQuadraticAbs

Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticAbs object.

createSVGPathSegCurvetoQuadraticRel

Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticRel object.

createSVGPathSegCurvetoQuadraticSmoothAbs

Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothAbs object.

createSVGPathSegCurvetoQuadraticSmoothRel

Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothRel object.

createSVGPathSegLinetoAbs

Returns a stand-alone, parentless SVGPathSegLinetoAbs object.

createSVGPathSegLinetoHorizontalAbs

Returns a stand-alone, parentless SVGPathSegLinetoHorizontalAbs object.

createSVGPathSegLinetoHorizontalRel

Returns a stand-alone, parentless SVGPathSegLinetoHorizontalRel object.

createSVGPathSegLinetoRel

Returns a stand-alone, parentless SVGPathSegLinetoRel object.

createSVGPathSegLinetoVerticalAbs

Returns a stand-alone, parentless SVGPathSegLinetoVerticalAbs object.

createSVGPathSegLinetoVerticalRel

Returns a stand-alone, parentless SVGPathSegLinetoVerticalRel object.

createSVGPathSegMovetoAbs

Returns a standalone parentless SVGPathSegMovetoAbs object.

createSVGPathSegMovetoRel

Returns a stand-alone, parentless SVGPathSegMovetoRel object.

createSVGPoint

Creates a new SVGPoint object that is initialized to the point (0,0) in the user coordinate system and that is not attached to any document.

createSVGRect

Creates a new SVGRect object that has all values set to 0 user units and that is not attached to any document.

createSVGTransform

Creates a new SVGTransform object that is set to the identity matrix and that is not attached to any document.

createSVGTransformFromMatrix

Creates a matrix transform object whose values are given by the specified matrix.

deselectAll

Cancels the selection of any selected objects, including any selections of text strings and text boxes.

dispatchEvent

Dispatches an event to an object.

flipX

Returns a matrix equivalent to a flip about the x-axis.

flipY

Returns a matrix equivalent to a flip about the y-axis.

forceRedraw

Redraws all regions of the viewport that require updating.

getBBox

Gets the bounding box, in current user space, of the geometry of all contained graphics elements.

getCTM

Gets the transformation matrix that transforms from the current user units to the viewport coordinate system for the nearestViewportElement object.

getCharNumAtPosition

Gets the index of the character that the glyph cell bounding box contains at the specified point.

getComputedStyle

Returns the current computed value of the combined CSS properties for an element.

getComputedTextLength

Returns the total sum of all advance values from rendering all characters within the given text element.

getCurrentTime

Gets the current time, in seconds, relative to the start time for the current SVG document fragment.

getElementById

Gets the element that matches the specified ID from the SVG document or document fragment.

getEnclosureList

Gets the list of graphics elements whose rendered content is entirely contained within the specified rectangle.

getEndPositionOfChar

Gets the current text position of the specified character after the character is rendered in the user coordinate system where the glyphs that correspond to the specified character are rendered.

getExtentOfChar

Gets a rectangle that defines the minimum and maximum x-coordinate and y-coordinate values in the user coordinate system where the glyphs that correspond to the specified character are rendered.

getIntersectionList

Gets the list of graphics elements whose rendered content intersects the specified rectangle.

getItem

Returns the specified item from a list.

getNumberOfChars

Gets the total number of characters that are available for rendering within the current element.

getPathSegAtLength

Gets the index of pathSegList by using the specified distance along the path.

getPointAtLength

Gets the (x,y) coordinate in user space that is the specified distance along the path.

getRotationOfChar

Gets the rotation value of the specified character, relative to the current user coordinate system where the glyphs that corresponding to the specified character are rendered.

getSVGDocument

Gets Document object for the referenced document, or null if there is no document.

getScreenCTM

Gets the transformation matrix from the current user units to the screen coordinate system.

getStartPositionOfChar

Gets the current text position of the specified character before the character is rendered in the user coordinate system where the glyphs that correspond to the specified character are rendered.

getSubStringLength

Calculates the total sum of all advance values from rendering the specified substring of the characters.

getTotalLength

Gets the total length of the path, as a distance in the current user coordinate system.

getTransformToElement

Gets the transformation matrix that transforms from the user coordinate system on the current element to the user coordinate system on the specified target element.

hasExtension

Determines if the specified extension is supported.

initialize

Clears current items from the list and re-initializes the list to contain the specified item.

insertItemBefore

Inserts a new item into a list at a specified position.

inverse

Returns the inverse of this matrix.

item

Gets the specified SVGElementInstance object from the collection.

matrixTransform

Applies the given 2×3 matrix transformation on this SVGPoint object and returns a new, transformed SVGPoint object.

multiply

Post-multiplies the matrix by the specified second matrix and returns the resulting matrix.

newValueSpecifiedUnits

Resets the specified value as a number with the specified unit type, replacing the values for all of the attributes on the object.

pauseAnimations

Pauses all currently running animations that are defined within the SVG document fragment that corresponds to this svg element.

removeEventListener

Removes an event listener.

removeItem

Removes an existing item from the list.

replaceItem

Replaces a specified existing item in the list with a specified new item.

rotate

Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix.

rotateFromVector

Post-multiplies the matrix by a specified rotation transformation and returns the resulting matrix.

scale

Post-multiplies the matrix by a uniform scale transformation and returns the resulting matrix.

scaleNonUniform

Post-multiplies the matrix by a non-uniform scale transformation and returns the resulting matrix.

selectSubString

Selects the specified substring, just as if a user selected the substring interactively.

setCurrentTime

Sets the new current time for this SVG document fragment.

setFilterRes

Sets the X and Y values of the filterRes attribute.

setMatrix

Sets the transform type to SVG_TRANSFORM_MATRIX by using the specified new transformation.

setOrientToAngle

Sets the value of the orientAngle attribute to the specified angle.

setOrientToAuto

Sets the value of the svgMarkerOrient attribute to auto.

setRotate

Sets the transform type to SVG_TRANSFORM_ROTATE by using the specified rotation angle and center of rotation.

setScale

Sets the transform type to SVG_TRANSFORM_SCALE by using the specified scale amounts.

setSkewX

Sets the transform type to SVG_TRANSFORM_SKEWX, with the given angle defining the amount of skew.

setSkewY

Sets the transform type to SVG_TRANSFORM_SKEWY, with the given angle defining the amount of skew.

setStdDeviation

Sets the standard deviation values used in calculating a Gaussian blur.

setTranslate

Sets the transform type to SVG_TRANSFORM_TRANSLATE by using the specified components.

skewX

Post-multiplies the matrix by a skew transformation along the x-axis and returns the resulting matrix.

skewY

Post-multiplies the matrix by a skew transformation along the y-axis and returns the resulting matrix.

suspendRedraw

Suspends redrawing a device for a specified duration.

toString

Returns a string that represents the current object.

translate

Post-multiplies the matrix by a translation transformation and returns the resulting matrix.

unpauseAnimations

Resumes currently running animations that are defined within the SVG document fragment.

unsuspendRedraw

Cancels the specified suspension of redrawing operations.

unsuspendRedrawAll

Cancels all currently active suspensions of redrawing operations.

 

 

 

Show:
© 2014 Microsoft