Namespace MochiKit.SVG
Provides functions for creating embedded SVG images.
Defined in: SVG.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
MochiKit.SVG.CIRCLE(cx, cy, r, attrs)
Creates an SVG circle node.
|
<static> |
MochiKit.SVG.DEFS(attrs)
Creates an SVG definitions node.
|
<static> |
MochiKit.SVG.G(attrs)
Creates an SVG group node.
|
<static> |
MochiKit.SVG.LINE(x1, y1, x2, y2, attrs)
Creates an SVG line node.
|
<static> |
MochiKit.SVG.moveToBottom(node)
Moves a node to the bottom of the SVG drawing order (i.e.
|
<static> |
MochiKit.SVG.moveToTop(node)
Moves a node to the top of the SVG drawing order (i.e.
|
<static> |
MochiKit.SVG.PATH(d, attrs)
Creates an SVG path node.
|
<static> |
MochiKit.SVG.RADIALGRADIENT(id, attrs)
Creates an SVG radial gradient node.
|
<static> |
MochiKit.SVG.RECT(x, y, width, height, attrs)
Creates an SVG rectangle node.
|
<static> |
MochiKit.SVG.rotate(node, angle, x, y)
Adds a rotation transform to a SVG DOM node.
|
<static> |
MochiKit.SVG.STOP(offset, color, attrs)
Creates an SVG gradient stop node.
|
<static> |
MochiKit.SVG.SVG(attrs)
Creates an SVG document node.
|
<static> |
MochiKit.SVG.TEXT(x, y, attrs)
Creates an SVG text node.
|
Method Detail
<static>
{Node}
MochiKit.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}
MochiKit.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}
MochiKit.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}
MochiKit.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>
MochiKit.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>
MochiKit.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>
{Node}
MochiKit.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}
MochiKit.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}
MochiKit.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>
MochiKit.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
<static>
{Node}
MochiKit.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>
{Node}
MochiKit.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}
MochiKit.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