SVG implementation of the Graphic class.
SVGGraphic is not intended to be used directly. Instead, use the Graphic class.
If the browser has SVG capabilities, the Graphic
class will point to the SVGGraphic class.
_appendShapeshape
Adds a shape instance to the graphic instance.
shape
Shape
The shape instance to be added to the graphic.
_createGraphicNodetype
pe
Creates a graphic node
_createGraphicsCreates a contentNode element
_getDocFragReturns a document fragment to for attaching shapes.
_getShapeClassval
Returns a shape class. Used by addShape.
_getUpdatedContentBoundsRecalculates and returns the contentBounds for the Graphic instance.
_redrawRedraws all shapes.
addShapecfg
Generates a shape instance by type.
cfg
Object
attributes for the shape
addToRedrawQueueshape
Adds a shape to the redraw queue and calculates the contentBounds. Used internally
by Shape instances.
shape
SVGShape
batchmethod
Allows for creating multiple shapes in order to batch appending and redraw operations.
method
Function
Method to execute.
clearClears the graphics object.
destroyRemoves all nodes.
getGradientNodekey
type
Returns a reference to a gradient definition based on an id and type.
getShapeByIdid
Returns a shape based on the id of its dom node.
id
String
Dom id of the shape's node attribute.
getXYGets the current position of the graphic instance in page coordinates.
initializerInitializes the class.
removeAllShapesRemoves all shape instances from the dom.
removeShapeshape
Removes a shape instance from from the graphic instance.
renderparentNode
Adds the graphics node to the dom.
parentNode
HTMLElement
node in which to render the graphics node into.
_shapeClassLook up for shape classes. Used by addShape to retrieve a class for instantiation.
autoDrawIndicates whether or not the instance will automatically redraw after a change is made to a shape. This property will get set to false when batching operations.
Default: true
autoSizeDetermines how the size of instance is calculated. If true, the width and height are determined by the size of the contents. If false, the width and height values are either explicitly set or determined by the size of the parent node's dimensions.
Default: false
contentBoundsObject containing size and coordinate data for the content of a Graphic in relation to the coordSpace node.
renderWhether or not to render the Graphic automatically after to a specified parent node after init. This can be a Node instance or a CSS selector string.
resizeDownThe contentBounds will resize to greater values but not to smaller values. (for performance) When resizing the contentBounds down is desirable, set the resizeDown value to true.