Function Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
A
 addCommandToHistory, SvgCanvas
 addSubCommand, SvgCanvas.BatchCommand
 addSvgElementFromJson, SelectorManager
 addToSelection, SelectorManager
 apply
 assignAttributes, SelectorManager
B
 BatchCommand, SvgCanvas
 beginUndoableChange, SvgCanvas
 bind, SelectorManager
C
 ChangeElementCommand, SvgCanvas
 cleanupElement, SelectorManager
 clear, pathActions
 clearSelection, SelectorManager
 convertToNum, SvgCanvas
 convertToPath, pathActions
 createLayer, pathActions
D
 deleteCurrentLayer, pathActions
E
 elements
 embedImage, pathActions
F
 finishUndoableChange, SvgCanvas
 fromXml, SvgCanvas
G
 getContentElem, pathActions
 getCurrentLayer, pathActions
 getDocumentTitle, pathActions
 getId, SelectorManager
 getLayer, pathActions
 getLayerOpacity, pathActions
 getLayerVisibility, pathActions
 getMatrix, SelectorManager
 getMouseTarget, SelectorManager
 getNextId, SelectorManager
 getNextRedoCommandText, SvgCanvas.undoMgr
 getNextUndoCommandText, SvgCanvas.undoMgr
 getNumLayers, pathActions
 getRedoStackSize, SvgCanvas.undoMgr
 getResolution, pathActions
 getRootElem, pathActions
 getRubberBandBox, SelectorManager.SelectorManager
 getSelectedElems, pathActions
 getSvgString, pathActions
 getUndoStackSize, SvgCanvas.undoMgr
 getUrlFromAttr, SelectorManager
 getVersion, pathActions
H
 hasMatrixTransform, SelectorManager
I
 identifyLayers, pathActions
 importSvgString, pathActions
 initGroup, SelectorManager.SelectorManager
 InsertElementCommand, SvgCanvas
 isEmpty, SvgCanvas.BatchCommand
 isIdentity, SelectorManager
 isValidUnit, SvgCanvas
L
 linkControlPoints, pathActions
M
 matrixMultiply, SelectorManager
 MoveElementCommand, SvgCanvas
 moveSelectedToLayer, pathActions
R
 rasterExport, pathActions
 recalculateAllSelectedDimensions, SelectorManager
 recalculateDimensions, SelectorManager
 redo, SvgCanvas.undoMgr
 releaseSelector, SelectorManager.SelectorManager
 remapElement, SelectorManager
 RemoveElementCommand, SvgCanvas
 removeFromSelection, SelectorManager
 removeUnusedDefElems, pathActions
 renameCurrentLayer, pathActions
 requestSelector, SelectorManager.SelectorManager
 reset, Selector.Selector
 resetUndoStack, SvgCanvas
 resize, Selector.Selector
addCommandToHistory = c.undoCmd.add = function(cmd)
Adds a command object to the undo history stack
Adds a given command to the history stack
var addSvgElementFromJson = this.addSvgElementFromJson = function(data)
Create a new SVG element based on the given object keys/values and add it to the current layer The element will be ran through cleanupElement before being returned
this.addToSelection = function(elemsToAdd,
showGrips)
Adds a list of elements to the selection.
Runs “apply” on all subcommands
Performs the stored change action
Re-Inserts the new element
Re-removes the new element
var assignAttributes = this.assignAttributes = function(node,
attrs,
suspendLength,
unitCheck)
Assigns multiple attributes to an element.
var BatchCommand = this.undoCmd.batch = function(text)
History command that can contain/execute multiple other commands
c.beginUndoableChange = function(attrName,
elems)
This function tells the canvas to remember the old values of the attrName attribute for each element sent in.
c.bind = function(event,
f)
Attaches a callback function to an event
var ChangeElementCommand = this.undoCmd.changeElement = function(elem,
attrs,
text)
History command to make a change to an element.
var cleanupElement = this.cleanupElement = function(element)
Remove unneeded (default) attributes, makes resulting SVG smaller
this.clear = function()
Clears the current document.
this.clearSelection = function(noCall)
Clears the selection.
convertToNum = function(attr,
val)
Converts given values to numbers.
this.convertToPath = function(elem,
getBBox)
Convert selected element to a path, or get the BBox of an element-as-path
this.createLayer = function(name)
Creates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.
this.deleteCurrentLayer = function()
Deletes the current layer from the drawing and then clears the selection.
Iterate through all our subcommands and returns all the elements we are changing
Returns array with element associated with this command
Returns array with element associated with this command
Returns array with element associated with this command
Returns array with element associated with this command
this.embedImage = function(val,
callback)
Converts a given image file to a data URL when possible, then runs a given callback
c.finishUndoableChange = function()
This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
fromXml = function(str)
Converts XML entities in a string to single characters.
this.getContentElem = function()
Returns the content DOM element
this.getCurrentLayer = function()
Returns the name of the currently selected layer.
this.getDocumentTitle = function()
Returns the current document title or an empty string if not found
getId = c.getId = function()
Returns the last created DOM element ID string
this.getLayer = function(i)
Returns the name of the ith layer.
this.getLayerOpacity = function(layername)
Returns the opacity of the given layer.
this.getLayerVisibility = function(layername)
Returns whether the layer is visible.
var getMatrix = function(elem)
Get the matrix object for a given element
var getMouseTarget = this.getMouseTarget = function(evt)
Gets the desired element from a mouse event
getNextId = c.getNextId = function()
Creates and returns a unique ID string for a DOM element
String associated with the next redo command
String associated with the next undo command
this.getNumLayers = function()
Returns the number of layers in the current drawing.
Integer with the current size of the redo history stack
this.getResolution = function()
Returns the current dimensions and zoom level in an object
this.getRootElem = function()
Returns the root DOM element
Returns the rubberBandBox DOM element.
this.getSelectedElems = function()
Returns the array with selected DOM elements
this.getSvgString = function()
Returns the current drawing as raw SVG XML text.
Integer with the current size of the undo history stack
var getUrlFromAttr = this.getUrlFromAttr = function(attrVal)
Extracts the URL from the url(...)
this.getVersion = function()
Returns a string which describes the revision number of SvgCanvas.
var hasMatrixTransform = this.hasMatrixTransform = function(tlist)
See if the given transformlist includes a non-indentity matrix transform
var identifyLayers = function()
Updates layer system
this.importSvgString = function(xmlString)
This function imports the input SVG XML into the current layer in the drawing
Resets the parent selector group element
var InsertElementCommand = this.undoCmd.insertElement = function(elem,
text)
History command for an element that was added to the DOM
Returns a boolean indicating whether or not the batch command is empty
var isIdentity = function(m)
Helper function to check if the matrix performs no actual transform (i.e.
canvas.isValidUnit = function(attr,
val)
Check if an attribute’s value is in a valid format
Alias function
var matrixMultiply = this.matrixMultiply = function()
This function tries to return a SVGMatrix that is the multiplication m1*m2.
var MoveElementCommand = this.undoCmd.moveElement = function(elem,
oldNextSibling,
oldParent,
text)
History command for an element that had its DOM position changed
this.moveSelectedToLayer = function(layername)
Moves the selected elements to layername.
this.rasterExport = function()
Generates a PNG Data URL based on the current image, then calls “exported” with an object including the string and any issues found
var recalculateAllSelectedDimensions = this.recalculateAllSelectedDimensions = function()
Runs recalculateDimensions on the selected elements, adding the changes to a single batch command
var recalculateDimensions = this.recalculateDimensions = function(selected)
Decides the course of action based on the element’s transform list
Performs a redo step
Removes the selector of the given element (hides selection box)
var remapElement = this.remapElement = function(selected,
changes,
m)
Applies coordinate changes to an element based on the given matrix
var RemoveElementCommand = this.undoCmd.removeElement = function(elem,
parent,
text)
History command for an element removed from the DOM
this.removeFromSelection = function(elemsToRemove)
Removes elements from the selection.
var removeUnusedDefElems = this.removeUnusedDefElems = function()
Looks at DOM elements inside the defs to see if they are referred to, removes them from the DOM if they are not.
this.renameCurrentLayer = function(newname)
Renames the current layer.
Returns the selector based on the given element
Used to reset the id and element that the selector is attached to
resetUndoStack = function()
Resets the undo stack, effectively clearing the undo/redo history
Updates the selector to match the element’s size
Close