Namespace RapidContext.SVG

Provides functions for creating embedded SVG images.

Source code: RapidContext_SVG.js

Namespace Summary
 
Method Summary
<static>  
RapidContext.SVG.CIRCLE(cx, cy, r, attrs)
Creates an SVG circle node.
<static>  
RapidContext.SVG.DEFS(attrs)
Creates an SVG definitions node.
<static>  
RapidContext.SVG.G(attrs)
Creates an SVG group node.
<static>  
RapidContext.SVG.LINE(x1, y1, x2, y2, attrs)
Creates an SVG line node.
<static>  
RapidContext.SVG.PATH(d, attrs)
Creates an SVG path node.
<static>  
RapidContext.SVG.RADIALGRADIENT(id, attrs)
Creates an SVG radial gradient node.
<static>  
RapidContext.SVG.RECT(x, y, width, height, attrs)
Creates an SVG rectangle node.
<static>  
RapidContext.SVG.STOP(offset, color, attrs)
Creates an SVG gradient stop node.
<static>  
RapidContext.SVG.SVG(attrs)
Creates an SVG document node.
<static>  
RapidContext.SVG.TEXT(x, y, attrs)
Creates an SVG text node.
<static>  
RapidContext.SVG.moveToBottom(node)
Moves a node to the bottom of the SVG drawing order (i.e.
<static>  
RapidContext.SVG.moveToTop(node)
Moves a node to the top of the SVG drawing order (i.e.
<static>  
RapidContext.SVG.rotate(node, angle, x, y)
Adds a rotation transform to a SVG DOM node.
Namespace Detail
RapidContext.SVG
Method Detail
<static> {Node} RapidContext.SVG.SVG(attrs)
Creates an SVG document node.
Parameters:
{Object} attrs Optional
the optional node attributes
{Object} ... Optional
the nodes or text to add as children
Returns:
{Node} the SVG DOM document node created

<static> {Node} RapidContext.SVG.DEFS(attrs)
Creates an SVG definitions node.
Parameters:
{Object} attrs Optional
the optional node attributes
{Object} ... Optional
the nodes or text to add as children
Returns:
{Node} the SVG DOM document node created

<static> {Node} RapidContext.SVG.G(attrs)
Creates an SVG group node.
Parameters:
{Object} attrs Optional
the optional node attributes
{Object} ... Optional
the nodes or text to add as children
Returns:
{Node} the SVG DOM document node created

<static> {Node} RapidContext.SVG.LINE(x1, y1, x2, y2, attrs)
Creates an SVG line node.
Parameters:
{String} x1
the x1 coordinate value
{String} y1
the y1 coordinate value
{String} x2
the x2 coordinate value
{String} y2
the y2 coordinate value
{Object} attrs Optional
the optional node attributes
Returns:
{Node} the SVG DOM document node created

<static> {Node} RapidContext.SVG.RECT(x, y, width, height, attrs)
Creates an SVG rectangle node.
Parameters:
{String} x
the x coordinate value
{String} y
the y coordinate value
{String} width
the width value
{String} height
the height value
{Object} attrs Optional
the optional node attributes
Returns:
{Node} the SVG DOM document node created

<static> {Node} RapidContext.SVG.CIRCLE(cx, cy, r, attrs)
Creates an SVG circle node.
Parameters:
{String} cx
the center x coordinate value
{String} cy
the center y coordinate value
{String} r
the radius value
{Object} attrs Optional
the optional node attributes
Returns:
{Node} the SVG DOM document node created

<static> {Node} RapidContext.SVG.PATH(d, attrs)
Creates an SVG path node.
Parameters:
{String} d
the path data value
{Object} attrs Optional
the optional node attributes
Returns:
{Node} the SVG DOM document node created

<static> {Node} RapidContext.SVG.TEXT(x, y, attrs)
Creates an SVG text node.
Parameters:
{String} x
the x coordinate value
{String} y
the y coordinate value
{Object} attrs Optional
the optional node attributes
{Object} ... Optional
the text to add as children
Returns:
{Node} the SVG DOM document node created

<static> {Node} RapidContext.SVG.RADIALGRADIENT(id, attrs)
Creates an SVG radial gradient node.
Parameters:
{String} id
the id of the node
{Object} attrs Optional
the optional node attributes
{Object} ... Optional
the stop nodes to add as children
Returns:
{Node} the SVG DOM document node created

<static> {Node} RapidContext.SVG.STOP(offset, color, attrs)
Creates an SVG gradient stop node.
Parameters:
{String} offset
the stop offset
{String} color
the stop color
{Object} attrs Optional
the optional node attributes
Returns:
{Node} the SVG DOM document node created

<static> RapidContext.SVG.moveToTop(node)
Moves a node to the top of the SVG drawing order (i.e. z-index). Note that this will only have effect on other SVG DOM nodes with the same parent node. Otherwise, the node must be moved down in the SVG DOM tree by changing parent node.
Parameters:
{Node/String} node
the SVG DOM node or unique id

<static> RapidContext.SVG.moveToBottom(node)
Moves a node to the bottom of the SVG drawing order (i.e. z-index). Note that this will only have effect on other SVG DOM nodes with the same parent node. Otherwise, the node must be moved up in the SVG DOM tree by changing parent node.
Parameters:
{Node/String} node
the SVG DOM node or unique id

<static> RapidContext.SVG.rotate(node, angle, x, y)
Adds a rotation transform to a SVG DOM node. Any previous rotation transform will be kept intact.
Parameters:
{Node/String} node
the SVG DOM node or unique id
{String/Number} angle
the numeric angle
{String/Number} x Optional
the x coordinate value
{String/Number} y Optional
the y coordinate value