diff --git a/docs/files/svgcanvas-js.html b/docs/files/svgcanvas-js.html index b8d56a85..ece9b90e 100644 --- a/docs/files/svgcanvas-js.html +++ b/docs/files/svgcanvas-js.html @@ -11,12 +11,20 @@ if (browserType) {document.write("
The main SvgCanvas class that manages all SVG-related functions
container | The container HTML element that should hold the SVG root element |
config | An object that contains configuration data |
SvgCanvas | The main SvgCanvas class that manages all SVG-related functions |
toXml | Converts characters in a string to XML-friendly entities. |
fromXml | Converts XML entities in a string to single characters. |
Undo/ | |
ChangeElementCommand | History command to make a change to an element. |
ChangeElementCommand. | Performs the stored change action |
ChangeElementCommand. | Reverses the stored change action |
ChangeElementCommand. | Returns array with element associated with this command |
InsertElementCommand | History command for an element that was added to the DOM |
InsertElementCommand. | Re-Inserts the new element |
InsertElementCommand. | Removes the element |
InsertElementCommand. | Returns array with element associated with this command |
RemoveElementCommand | History command for an element removed from the DOM |
RemoveElementCommand. | Re-removes the new element |
RemoveElementCommand. | Re-adds the new element |
RemoveElementCommand. | Returns array with element associated with this command |
MoveElementCommand | History command for an element that had its DOM position changed |
MoveElementCommand. | Re-positions the element |
MoveElementCommand. | Positions the element back to its original location |
MoveElementCommand. | Returns array with element associated with this command |
BatchCommand | History command that can contain/execute multiple other commands |
BatchCommand. | Runs “apply” on all subcommands |
BatchCommand. | Runs “unapply” on all subcommands |
BatchCommand. | Iterate through all our subcommands and returns all the elements we are changing |
BatchCommand. | Adds a given command to the history stack |
BatchCommand. | Returns a boolean indicating whether or not the batch command is empty |
resetUndoStack | Resets the undo stack, effectively clearing the undo/redo history |
undoMgr. | Integer with the current size of the undo history stack |
undoMgr. | Integer with the current size of the redo history stack |
undoMgr. | String associated with the next undo command |
undoMgr. | String associated with the next redo command |
undoMgr.undo | Performs an undo step |
undoMgr.redo | Performs a redo step |
addCommandToHistory | Adds a command object to the undo history stack |
beginUndoableChange | This function tells the canvas to remember the old values of the attrName attribute for each element sent in. |
finishUndoableChange | This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called. |
Selector | Private class for DOM element selection boxes |
Functions | |
Selector. | Used to reset the id and element that the selector is attached to |
Selector. | Show the resize grips of this selector |
Selector. | Updates cursors for corner grips on rotation so arrows point the right way |
Selector. | Updates the selector to match the element’s size |
SelectorManager | public class to manage all selector objects (selection boxes) |
SelectorManager. | Resets the parent selector group element |
SelectorManager. | Returns the selector based on the given element |
SelectorManager. | Removes the selector of the given element (hides selection box) |
SelectorManager. | Returns the rubberBandBox DOM element. |
Selection | |
clearSelection | Clears the selection. |
addToSelection | Adds a list of elements to the selection. |
removeFromSelection | Removes elements from the selection. |
Serialization | |
save | Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler. |
getSvgString | Returns the current drawing as raw SVG XML text. |
setSvgString | This function sets the current drawing as the input SVG XML. |
importSvgString | This function imports the input SVG XML into the current layer in the drawing |
Layers | |
createLayer | 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. |
deleteCurrentLayer | Deletes the current layer from the drawing and then clears the selection. |
getNumLayers | Returns the number of layers in the current drawing. |
getLayer | Returns the name of the ith layer. |
getCurrentLayer | Returns the name of the currently selected layer. |
setCurrentLayer | Sets the current layer. |
renameCurrentLayer | Renames the current layer. |
setCurrentLayerPosition | Changes the position of the current layer to the new value. |
getLayerVisibility | Returns whether the layer is visible. |
setLayerVisibility | Sets the visibility of the layer. |
moveSelectedToLayer | Moves the selected elements to layername. |
getLayerOpacity | Returns the opacity of the given layer. |
setLayerOpacity | Sets the opacity of the given layer. |
selectAllInCurrentLayer | Clears the selection, then adds all elements in the current layer to the selection. |
clear | Clears the current document. |
Fill and Stroke | |
getVersion | Returns a string which describes the revision number of SvgCanvas. |
The main SvgCanvas class that manages all SVG-related functions
container | The container HTML element that should hold the SVG root element |
config | An object that contains configuration data |
SvgCanvas | The main SvgCanvas class that manages all SVG-related functions |
toXml | Converts characters in a string to XML-friendly entities. |
fromXml | Converts XML entities in a string to single characters. |
Unit conversion functions | |
convertToNum | Converts given values to numbers. |
setUnitAttr | Sets an element’s attribute based on the unit in its current value. |
isValidUnit | Check if an attribute’s value is in a valid format |
Undo/ | |
ChangeElementCommand | History command to make a change to an element. |
ChangeElementCommand. | Performs the stored change action |
ChangeElementCommand. | Reverses the stored change action |
ChangeElementCommand. | Returns array with element associated with this command |
InsertElementCommand | History command for an element that was added to the DOM |
InsertElementCommand. | Re-Inserts the new element |
InsertElementCommand. | Removes the element |
InsertElementCommand. | Returns array with element associated with this command |
RemoveElementCommand | History command for an element removed from the DOM |
RemoveElementCommand. | Re-removes the new element |
RemoveElementCommand. | Re-adds the new element |
RemoveElementCommand. | Returns array with element associated with this command |
MoveElementCommand | History command for an element that had its DOM position changed |
MoveElementCommand. | Re-positions the element |
MoveElementCommand. | Positions the element back to its original location |
MoveElementCommand. | Returns array with element associated with this command |
BatchCommand | History command that can contain/execute multiple other commands |
BatchCommand. | Runs “apply” on all subcommands |
BatchCommand. | Runs “unapply” on all subcommands |
BatchCommand. | Iterate through all our subcommands and returns all the elements we are changing |
BatchCommand. | Adds a given command to the history stack |
BatchCommand. | Returns a boolean indicating whether or not the batch command is empty |
resetUndoStack | Resets the undo stack, effectively clearing the undo/redo history |
undoMgr. | Integer with the current size of the undo history stack |
undoMgr. | Integer with the current size of the redo history stack |
undoMgr. | String associated with the next undo command |
undoMgr. | String associated with the next redo command |
undoMgr.undo | Performs an undo step |
undoMgr.redo | Performs a redo step |
addCommandToHistory | Adds a command object to the undo history stack |
beginUndoableChange | This function tells the canvas to remember the old values of the attrName attribute for each element sent in. |
finishUndoableChange | This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called. |
Selector | Private class for DOM element selection boxes |
Functions | |
Selector. | Used to reset the id and element that the selector is attached to |
Selector. | Show the resize grips of this selector |
Selector. | Updates cursors for corner grips on rotation so arrows point the right way |
Selector. | Updates the selector to match the element’s size |
SelectorManager | Public class to manage all selector objects (selection boxes) |
SelectorManager. | Resets the parent selector group element |
SelectorManager. | Returns the selector based on the given element |
SelectorManager. | Removes the selector of the given element (hides selection box) |
SelectorManager. | Returns the rubberBandBox DOM element. |
Helper functions | |
assignAttributes | Assigns multiple attributes to an element. |
cleanupElement | Remove unneeded (default) attributes, makes resulting SVG smaller |
addSvgElementFromJson | 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 |
getId | Returns the last created DOM element ID string |
getNextId | Creates and returns a unique ID string for a DOM element |
bind | Attaches a callback function to an event |
setIdPrefix | Changes the ID prefix to the given value |
sanitizeSvg | Sanitizes the input node and its children It only keeps what is allowed from our whitelist defined above |
getUrlFromAttr | i.e. |
Selection | |
clearSelection | Clears the selection. |
addToSelection | Adds a list of elements to the selection. |
removeFromSelection | Removes elements from the selection. |
Serialization | |
removeUnusedDefElems | Looks at DOM elements inside the <defs> to see if they are referred to, removes them from the DOM if they are not. |
svgCanvasToString | Main function to set up the SVG content for output |
svgToString | Sub function ran on each SVG element to convert it to a string as desired |
embedImage | Converts a given image file to a data URL when possible, then runs a given callback |
save | Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler. |
getSvgString | Returns the current drawing as raw SVG XML text. |
setSvgString | This function sets the current drawing as the input SVG XML. |
importSvgString | This function imports the input SVG XML into the current layer in the drawing |
Layers | |
createLayer | 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. |
deleteCurrentLayer | Deletes the current layer from the drawing and then clears the selection. |
getNumLayers | Returns the number of layers in the current drawing. |
getLayer | Returns the name of the ith layer. |
getCurrentLayer | Returns the name of the currently selected layer. |
setCurrentLayer | Sets the current layer. |
renameCurrentLayer | Renames the current layer. |
setCurrentLayerPosition | Changes the position of the current layer to the new value. |
getLayerVisibility | Returns whether the layer is visible. |
setLayerVisibility | Sets the visibility of the layer. |
moveSelectedToLayer | Moves the selected elements to layername. |
getLayerOpacity | Returns the opacity of the given layer. |
setLayerOpacity | Sets the opacity of the given layer. |
selectAllInCurrentLayer | Clears the selection, then adds all elements in the current layer to the selection. |
clear | Clears the current document. |
Fill and Stroke | |
getVersion | Returns a string which describes the revision number of SvgCanvas. |
var ChangeElementCommand = this.undoCmd.changeElement = function( elem, attrs, text )
History command to make a change to an element. Usually an attribute change, but can also be textcontent.
elem | The DOM element that was changed |
attrs | An object with the attributes to be changed and the values they had before the change |
text | An optional string visible to user related to this change |
Private class for DOM element selection boxes
id | integer to internally indentify the selector |
elem | DOM element associated with this selector |
Functions | |
Selector. | Used to reset the id and element that the selector is attached to |
Selector. | Show the resize grips of this selector |
Selector. | Updates cursors for corner grips on rotation so arrows point the right way |
Selector. | Updates the selector to match the element’s size |
Private class for DOM element selection boxes
id | integer to internally indentify the selector |
elem | DOM element associated with this selector |
Functions | |
Selector. | Used to reset the id and element that the selector is attached to |
Selector. | Show the resize grips of this selector |
Selector. | Updates cursors for corner grips on rotation so arrows point the right way |
Selector. | Updates the selector to match the element’s size |
public class to manage all selector objects (selection boxes)
SelectorManager. | Resets the parent selector group element |
SelectorManager. | Returns the selector based on the given element |
SelectorManager. | Removes the selector of the given element (hides selection box) |
SelectorManager. | Returns the rubberBandBox DOM element. |
Selection | |
clearSelection | Clears the selection. |
addToSelection | Adds a list of elements to the selection. |
removeFromSelection | Removes elements from the selection. |
Serialization | |
save | Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler. |
getSvgString | Returns the current drawing as raw SVG XML text. |
setSvgString | This function sets the current drawing as the input SVG XML. |
importSvgString | This function imports the input SVG XML into the current layer in the drawing |
Layers | |
createLayer | 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. |
deleteCurrentLayer | Deletes the current layer from the drawing and then clears the selection. |
getNumLayers | Returns the number of layers in the current drawing. |
getLayer | Returns the name of the ith layer. |
getCurrentLayer | Returns the name of the currently selected layer. |
setCurrentLayer | Sets the current layer. |
renameCurrentLayer | Renames the current layer. |
setCurrentLayerPosition | Changes the position of the current layer to the new value. |
getLayerVisibility | Returns whether the layer is visible. |
setLayerVisibility | Sets the visibility of the layer. |
moveSelectedToLayer | Moves the selected elements to layername. |
getLayerOpacity | Returns the opacity of the given layer. |
setLayerOpacity | Sets the opacity of the given layer. |
selectAllInCurrentLayer | Clears the selection, then adds all elements in the current layer to the selection. |
clear | Clears the current document. |
Fill and Stroke | |
getVersion | Returns a string which describes the revision number of SvgCanvas. |
Public class to manage all selector objects (selection boxes)
SelectorManager. | Resets the parent selector group element |
SelectorManager. | Returns the selector based on the given element |
SelectorManager. | Removes the selector of the given element (hides selection box) |
SelectorManager. | Returns the rubberBandBox DOM element. |
Helper functions | |
assignAttributes | Assigns multiple attributes to an element. |
cleanupElement | Remove unneeded (default) attributes, makes resulting SVG smaller |
addSvgElementFromJson | 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 |
getId | Returns the last created DOM element ID string |
getNextId | Creates and returns a unique ID string for a DOM element |
bind | Attaches a callback function to an event |
setIdPrefix | Changes the ID prefix to the given value |
sanitizeSvg | Sanitizes the input node and its children It only keeps what is allowed from our whitelist defined above |
getUrlFromAttr | i.e. |
Selection | |
clearSelection | Clears the selection. |
addToSelection | Adds a list of elements to the selection. |
removeFromSelection | Removes elements from the selection. |
Serialization | |
removeUnusedDefElems | Looks at DOM elements inside the <defs> to see if they are referred to, removes them from the DOM if they are not. |
svgCanvasToString | Main function to set up the SVG content for output |
svgToString | Sub function ran on each SVG element to convert it to a string as desired |
embedImage | Converts a given image file to a data URL when possible, then runs a given callback |
save | Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler. |
getSvgString | Returns the current drawing as raw SVG XML text. |
setSvgString | This function sets the current drawing as the input SVG XML. |
importSvgString | This function imports the input SVG XML into the current layer in the drawing |
Layers | |
createLayer | 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. |
deleteCurrentLayer | Deletes the current layer from the drawing and then clears the selection. |
getNumLayers | Returns the number of layers in the current drawing. |
getLayer | Returns the name of the ith layer. |
getCurrentLayer | Returns the name of the currently selected layer. |
setCurrentLayer | Sets the current layer. |
renameCurrentLayer | Renames the current layer. |
setCurrentLayerPosition | Changes the position of the current layer to the new value. |
getLayerVisibility | Returns whether the layer is visible. |
setLayerVisibility | Sets the visibility of the layer. |
moveSelectedToLayer | Moves the selected elements to layername. |
getLayerOpacity | Returns the opacity of the given layer. |
setLayerOpacity | Sets the opacity of the given layer. |
selectAllInCurrentLayer | Clears the selection, then adds all elements in the current layer to the selection. |
clear | Clears the current document. |
Fill and Stroke | |
getVersion | Returns a string which describes the revision number of SvgCanvas. |
var assignAttributes = this.assignAttributes = function( node, attrs, suspendLength, unitCheck )
Assigns multiple attributes to an element.
node | DOM element to apply new attribute values to |
attrs | Object with attribute keys/values |
suspendLength | Optional integer of milliseconds to suspend redraw |
unitCheck | Boolean to indicate the need to use setUnitAttr |
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
data | Object with the following keys/values: |
Returns: The new element
var getUrlFromAttr = this.getUrlFromAttr = function( attrVal )
i.e. <circle fill=”url(someFile.svg#foo)” /> or <circle fill=”url(‘someFile.svg#foo’)” /> or <circle fill=’url(“someFile.svg#foo”)’ />
attrVal | The attribute value as a string |
String with just the URL
this.embedImage = function( val, callback )
Converts a given image file to a data URL when possible, then runs a given callback
val | String with the path/URL of the image |
callback | Optional function to run when image data is found, supplies the result (data URL or false) as first parameter. |
Converts characters in a string to XML-friendly entities.
toXml = function( str )
Converts XML entities in a string to single characters.
fromXml = function( str )
History command to make a change to an element.
var ChangeElementCommand = this.undoCmd.changeElement = function( elem, attrs, text )
History command for an element that was added to the DOM
var InsertElementCommand = this.undoCmd.insertElement = function( elem, text )
History command for an element removed from the DOM
var RemoveElementCommand = this.undoCmd.removeElement = function( elem, parent, text )
History command for an element that had its DOM position changed
var MoveElementCommand = this.undoCmd.moveElement = function( elem, oldNextSibling, oldParent, text )
History command that can contain/execute multiple other commands
var BatchCommand = this.undoCmd.batch = function( text )
Resets the undo stack, effectively clearing the undo/redo history
resetUndoStack = function()
Adds a command object to the undo history stack
addCommandToHistory = c.undoCmd.add = function( cmd )
This function tells the canvas to remember the old values of the attrName attribute for each element sent in.
c.beginUndoableChange = function( attrName, elems )
This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
c.finishUndoableChange = function()
Clears the selection.
this.clearSelection = function( noCall )
Adds a list of elements to the selection.
this.addToSelection = function( elemsToAdd, showGrips )
Removes elements from the selection.
this.removeFromSelection = function( elemsToRemove )
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.save = function( opts )
Returns the current drawing as raw SVG XML text.
this.getSvgString = function()
This function sets the current drawing as the input SVG XML.
this.setSvgString = function( xmlString )
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.createLayer = function( name )
Deletes the current layer from the drawing and then clears the selection.
this.deleteCurrentLayer = function()
Returns the number of layers in the current drawing.
this.getNumLayers = function()
Returns the name of the ith layer.
this.getLayer = function( i )
Returns the name of the currently selected layer.
this.getCurrentLayer = function()
Sets the current layer.
this.setCurrentLayer = function( name )
Renames the current layer.
this.renameCurrentLayer = function( newname )
Changes the position of the current layer to the new value.
this.setCurrentLayerPosition = function( newpos )
Returns whether the layer is visible.
this.getLayerVisibility = function( layername )
Sets the visibility of the layer.
this.setLayerVisibility = function( layername, bVisible )
Moves the selected elements to layername.
this.moveSelectedToLayer = function( layername )
Returns the opacity of the given layer.
this.getLayerOpacity = function( layername )
Sets the opacity of the given layer.
this.setLayerOpacity = function( layername, opacity )
Clears the selection, then adds all elements in the current layer to the selection.
this.selectAllInCurrentLayer = function()
Clears the current document.
this.clear = function()
Returns a string which describes the revision number of SvgCanvas.
this.getVersion = function()
Converts characters in a string to XML-friendly entities.
toXml = function( str )
Converts XML entities in a string to single characters.
fromXml = function( str )
Converts given values to numbers.
convertToNum = function( attr, val )
Sets an element’s attribute based on the unit in its current value.
setUnitAttr = function( elem, attr, val )
Check if an attribute’s value is in a valid format
canvas.isValidUnit = function( attr, val )
History command to make a change to an element.
var ChangeElementCommand = this.undoCmd.changeElement = function( elem, attrs, text )
History command for an element that was added to the DOM
var InsertElementCommand = this.undoCmd.insertElement = function( elem, text )
History command for an element removed from the DOM
var RemoveElementCommand = this.undoCmd.removeElement = function( elem, parent, text )
History command for an element that had its DOM position changed
var MoveElementCommand = this.undoCmd.moveElement = function( elem, oldNextSibling, oldParent, text )
History command that can contain/execute multiple other commands
var BatchCommand = this.undoCmd.batch = function( text )
Resets the undo stack, effectively clearing the undo/redo history
resetUndoStack = function()
Adds a command object to the undo history stack
addCommandToHistory = c.undoCmd.add = function( cmd )
This function tells the canvas to remember the old values of the attrName attribute for each element sent in.
c.beginUndoableChange = function( attrName, elems )
This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
c.finishUndoableChange = function()
Assigns multiple attributes to an element.
var assignAttributes = this.assignAttributes = function( node, attrs, suspendLength, unitCheck )
Remove unneeded (default) attributes, makes resulting SVG smaller
var cleanupElement = this.cleanupElement = function( element )
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
var addSvgElementFromJson = this.addSvgElementFromJson = function( data )
Returns the last created DOM element ID string
getId = c.getId = function()
Creates and returns a unique ID string for a DOM element
getNextId = c.getNextId = function()
Attaches a callback function to an event
c.bind = function( event, f )
Changes the ID prefix to the given value
c.setIdPrefix = function( p )
Sanitizes the input node and its children It only keeps what is allowed from our whitelist defined above
var sanitizeSvg = this.sanitizeSvg = function( node )
i.e.
var getUrlFromAttr = this.getUrlFromAttr = function( attrVal )
Clears the selection.
this.clearSelection = function( noCall )
Adds a list of elements to the selection.
this.addToSelection = function( elemsToAdd, showGrips )
Removes elements from the selection.
this.removeFromSelection = function( elemsToRemove )
Looks at DOM elements inside the defs to see if they are referred to, removes them from the DOM if they are not.
var removeUnusedDefElems = this.removeUnusedDefElems = function()
Main function to set up the SVG content for output
var svgCanvasToString = this.svgCanvasToString = function()
Sub function ran on each SVG element to convert it to a string as desired
var svgToString = this.svgToString = function( elem, indent )
Converts a given image file to a data URL when possible, then runs a given callback
this.embedImage = function( val, callback )
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.save = function( opts )
Returns the current drawing as raw SVG XML text.
this.getSvgString = function()
This function sets the current drawing as the input SVG XML.
this.setSvgString = function( xmlString )
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.createLayer = function( name )
Deletes the current layer from the drawing and then clears the selection.
this.deleteCurrentLayer = function()
Returns the number of layers in the current drawing.
this.getNumLayers = function()
Returns the name of the ith layer.
this.getLayer = function( i )
Returns the name of the currently selected layer.
this.getCurrentLayer = function()
Sets the current layer.
this.setCurrentLayer = function( name )
Renames the current layer.
this.renameCurrentLayer = function( newname )
Changes the position of the current layer to the new value.
this.setCurrentLayerPosition = function( newpos )
Returns whether the layer is visible.
this.getLayerVisibility = function( layername )
Sets the visibility of the layer.
this.setLayerVisibility = function( layername, bVisible )
Moves the selected elements to layername.
this.moveSelectedToLayer = function( layername )
Returns the opacity of the given layer.
this.getLayerOpacity = function( layername )
Sets the opacity of the given layer.
this.setLayerOpacity = function( layername, opacity )
Clears the selection, then adds all elements in the current layer to the selection.
this.selectAllInCurrentLayer = function()
Clears the current document.
this.clear = function()
Returns a string which describes the revision number of SvgCanvas.
this.getVersion = function()
A | |
addCommandToHistory, SvgCanvas | |
addSubCommand, SvgCanvas. | |
addToSelection, SelectorManager | |
apply | |
B | |
BatchCommand, SvgCanvas | |
beginUndoableChange, SvgCanvas | |
C | |
ChangeElementCommand, SvgCanvas | |
clear, SelectorManager | |
clearSelection, SelectorManager | |
createLayer, SelectorManager | |
D | |
deleteCurrentLayer, SelectorManager | |
E | |
elements | |
F | |
finishUndoableChange, SvgCanvas | |
fromXml, SvgCanvas | |
G | |
getCurrentLayer, SelectorManager | |
getLayer, SelectorManager | |
getLayerOpacity, SelectorManager | |
getLayerVisibility, SelectorManager | |
getNextRedoCommandText, SvgCanvas. | |
getNextUndoCommandText, SvgCanvas. | |
getNumLayers, SelectorManager | |
getRedoStackSize, SvgCanvas. | |
getRubberBandBox, SelectorManager. | |
getSvgString, SelectorManager | |
getUndoStackSize, SvgCanvas. | |
getVersion, SelectorManager | |
I | |
importSvgString, SelectorManager | |
initGroup, SelectorManager. | |
InsertElementCommand, SvgCanvas | |
isEmpty, SvgCanvas. | |
M | |
MoveElementCommand, SvgCanvas | |
moveSelectedToLayer, SelectorManager | |
R | |
redo, SvgCanvas. | |
releaseSelector, SelectorManager. | |
RemoveElementCommand, SvgCanvas | |
removeFromSelection, SelectorManager | |
renameCurrentLayer, SelectorManager | |
requestSelector, SelectorManager. | |
reset, Selector. | |
resetUndoStack, SvgCanvas | |
resize, Selector. | |
S | |
save, SelectorManager | |
selectAllInCurrentLayer, SelectorManager | |
setCurrentLayer, SelectorManager | |
setCurrentLayerPosition, SelectorManager | |
setForeignString(xmlString,elt) | |
setLayerOpacity, SelectorManager | |
setLayerVisibility, SelectorManager | |
setSvgString, SelectorManager | |
showGrips, Selector. | |
T | |
toXml, SvgCanvas | |
U | |
unapply | |
undo, SvgCanvas. | |
updateGripCursors, Selector. |
A | |
addCommandToHistory, SvgCanvas | |
addSubCommand, SvgCanvas. | |
addSvgElementFromJson, SelectorManager | |
addToSelection, SelectorManager | |
apply | |
assignAttributes, SelectorManager | |
B | |
BatchCommand, SvgCanvas | |
beginUndoableChange, SvgCanvas | |
bind, SelectorManager | |
C | |
ChangeElementCommand, SvgCanvas | |
cleanupElement, SelectorManager | |
clear, SelectorManager | |
clearSelection, SelectorManager | |
convertToNum, SvgCanvas | |
createLayer, SelectorManager | |
D | |
deleteCurrentLayer, SelectorManager | |
E | |
elements | |
embedImage, SelectorManager | |
F | |
finishUndoableChange, SvgCanvas | |
fromXml, SvgCanvas | |
G | |
getCurrentLayer, SelectorManager | |
getId, SelectorManager | |
getLayer, SelectorManager | |
getLayerOpacity, SelectorManager | |
getLayerVisibility, SelectorManager | |
getNextId, SelectorManager | |
getNextRedoCommandText, SvgCanvas. | |
getNextUndoCommandText, SvgCanvas. | |
getNumLayers, SelectorManager | |
getRedoStackSize, SvgCanvas. | |
getRubberBandBox, SelectorManager. | |
getSvgString, SelectorManager | |
getUndoStackSize, SvgCanvas. | |
getUrlFromAttr, SelectorManager | |
getVersion, SelectorManager | |
I | |
importSvgString, SelectorManager | |
initGroup, SelectorManager. | |
InsertElementCommand, SvgCanvas | |
isEmpty, SvgCanvas. | |
isValidUnit, SvgCanvas | |
M | |
MoveElementCommand, SvgCanvas | |
moveSelectedToLayer, SelectorManager | |
R | |
redo, SvgCanvas. | |
releaseSelector, SelectorManager. | |
RemoveElementCommand, SvgCanvas | |
removeFromSelection, SelectorManager | |
removeUnusedDefElems, SelectorManager | |
renameCurrentLayer, SelectorManager | |
requestSelector, SelectorManager. | |
reset, Selector. | |
resetUndoStack, SvgCanvas | |
resize, Selector. | |
S | |
sanitizeSvg, SelectorManager | |
save, SelectorManager | |
selectAllInCurrentLayer, SelectorManager | |
setCurrentLayer, SelectorManager | |
setCurrentLayerPosition, SelectorManager | |
setForeignString(xmlString,elt) | |
setIdPrefix, SelectorManager | |
setLayerOpacity, SelectorManager | |
setLayerVisibility, SelectorManager | |
setSvgString, SelectorManager | |
setUnitAttr, SvgCanvas | |
showGrips, Selector. | |
svgCanvasToString, SelectorManager | |
svgToString, SelectorManager | |
T | |
toXml, SvgCanvas | |
U | |
unapply | |
undo, SvgCanvas. | |
updateGripCursors, Selector. |
Adds a command object to the undo history stack
addCommandToHistory = c.undoCmd.add = function( cmd )
Adds a list of elements to the selection.
this.addToSelection = function( elemsToAdd, showGrips )
Adds a command object to the undo history stack
addCommandToHistory = c.undoCmd.add = function( cmd )
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
var addSvgElementFromJson = this.addSvgElementFromJson = function( data )
Adds a list of elements to the selection.
this.addToSelection = function( elemsToAdd, showGrips )
Assigns multiple attributes to an element.
var assignAttributes = this.assignAttributes = function( node, attrs, suspendLength, unitCheck )
History command that can contain/execute multiple other commands
var BatchCommand = this.undoCmd.batch = function( text )
This function tells the canvas to remember the old values of the attrName attribute for each element sent in.
c.beginUndoableChange = function( attrName, elems )
History command that can contain/execute multiple other commands
var BatchCommand = this.undoCmd.batch = function( text )
This function tells the canvas to remember the old values of the attrName attribute for each element sent in.
c.beginUndoableChange = function( attrName, elems )
Attaches a callback function to an event
c.bind = function( event, f )
History command to make a change to an element.
var ChangeElementCommand = this.undoCmd.changeElement = function( elem, attrs, text )
Clears the current document.
this.clear = function()
Clears the selection.
this.clearSelection = function( noCall )
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.createLayer = function( name )
History command to make a change to an element.
var ChangeElementCommand = this.undoCmd.changeElement = function( elem, attrs, text )
Remove unneeded (default) attributes, makes resulting SVG smaller
var cleanupElement = this.cleanupElement = function( element )
Clears the current document.
this.clear = function()
Clears the selection.
this.clearSelection = function( noCall )
Converts given values to numbers.
convertToNum = function( attr, val )
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.createLayer = function( name )
Deletes the current layer from the drawing and then clears the selection.
this.deleteCurrentLayer = function()
Deletes the current layer from the drawing and then clears the selection.
this.deleteCurrentLayer = function()
Converts a given image file to a data URL when possible, then runs a given callback
this.embedImage = function( val, callback )
This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
c.finishUndoableChange = function()
Converts XML entities in a string to single characters.
fromXml = function( str )
This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
c.finishUndoableChange = function()
Converts XML entities in a string to single characters.
fromXml = function( str )
Returns the name of the currently selected layer.
this.getCurrentLayer = function()
Returns the name of the ith layer.
this.getLayer = function( i )
Returns the opacity of the given layer.
this.getLayerOpacity = function( layername )
Returns whether the layer is visible.
this.getLayerVisibility = function( layername )
Returns the number of layers in the current drawing.
this.getNumLayers = function()
Returns the current drawing as raw SVG XML text.
this.getSvgString = function()
Returns a string which describes the revision number of SvgCanvas.
this.getVersion = function()
Returns the name of the currently selected layer.
this.getCurrentLayer = function()
Returns the last created DOM element ID string
getId = c.getId = function()
Returns the name of the ith layer.
this.getLayer = function( i )
Returns the opacity of the given layer.
this.getLayerOpacity = function( layername )
Returns whether the layer is visible.
this.getLayerVisibility = function( layername )
Creates and returns a unique ID string for a DOM element
getNextId = c.getNextId = function()
Returns the number of layers in the current drawing.
this.getNumLayers = function()
Returns the current drawing as raw SVG XML text.
this.getSvgString = function()
i.e.
var getUrlFromAttr = this.getUrlFromAttr = function( attrVal )
Returns a string which describes the revision number of SvgCanvas.
this.getVersion = function()
History command for an element that was added to the DOM
var InsertElementCommand = this.undoCmd.insertElement = function( elem, text )
History command for an element that was added to the DOM
var InsertElementCommand = this.undoCmd.insertElement = function( elem, text )
Check if an attribute’s value is in a valid format
canvas.isValidUnit = function( attr, val )
History command for an element that had its DOM position changed
var MoveElementCommand = this.undoCmd.moveElement = function( elem, oldNextSibling, oldParent, text )
Moves the selected elements to layername.
this.moveSelectedToLayer = function( layername )
History command for an element that had its DOM position changed
var MoveElementCommand = this.undoCmd.moveElement = function( elem, oldNextSibling, oldParent, text )
Moves the selected elements to layername.
this.moveSelectedToLayer = function( layername )
History command for an element removed from the DOM
var RemoveElementCommand = this.undoCmd.removeElement = function( elem, parent, text )
Removes elements from the selection.
this.removeFromSelection = function( elemsToRemove )
Renames the current layer.
this.renameCurrentLayer = function( newname )
Resets the undo stack, effectively clearing the undo/redo history
resetUndoStack = function()
History command for an element removed from the DOM
var RemoveElementCommand = this.undoCmd.removeElement = function( elem, parent, text )
Removes elements from the selection.
this.removeFromSelection = function( elemsToRemove )
Looks at DOM elements inside the defs to see if they are referred to, removes them from the DOM if they are not.
var removeUnusedDefElems = this.removeUnusedDefElems = function()
Renames the current layer.
this.renameCurrentLayer = function( newname )
Resets the undo stack, effectively clearing the undo/redo history
resetUndoStack = function()
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.save = function( opts )
Clears the selection, then adds all elements in the current layer to the selection.
this.selectAllInCurrentLayer = function()
Sets the current layer.
this.setCurrentLayer = function( name )
Changes the position of the current layer to the new value.
this.setCurrentLayerPosition = function( newpos )
This function sets the content of element elt to the input XML.
function setForeignString( xmlString )
Sets the opacity of the given layer.
this.setLayerOpacity = function( layername, opacity )
Sets the visibility of the layer.
this.setLayerVisibility = function( layername, bVisible )
This function sets the current drawing as the input SVG XML.
this.setSvgString = function( xmlString )
Sanitizes the input node and its children It only keeps what is allowed from our whitelist defined above
var sanitizeSvg = this.sanitizeSvg = function( node )
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.save = function( opts )
Clears the selection, then adds all elements in the current layer to the selection.
this.selectAllInCurrentLayer = function()
Sets the current layer.
this.setCurrentLayer = function( name )
Changes the position of the current layer to the new value.
this.setCurrentLayerPosition = function( newpos )
This function sets the content of element elt to the input XML.
function setForeignString( xmlString )
Changes the ID prefix to the given value
c.setIdPrefix = function( p )
Sets the opacity of the given layer.
this.setLayerOpacity = function( layername, opacity )
Sets the visibility of the layer.
this.setLayerVisibility = function( layername, bVisible )
This function sets the current drawing as the input SVG XML.
this.setSvgString = function( xmlString )
Sets an element’s attribute based on the unit in its current value.
setUnitAttr = function( elem, attr, val )
Main function to set up the SVG content for output
var svgCanvasToString = this.svgCanvasToString = function()
Sub function ran on each SVG element to convert it to a string as desired
var svgToString = this.svgToString = function( elem, indent )
Converts characters in a string to XML-friendly entities.
toXml = function( str )
Converts characters in a string to XML-friendly entities.
toXml = function( str )
A | |
addCommandToHistory, SvgCanvas | |
addSubCommand, SvgCanvas. | |
addToSelection, SelectorManager | |
apply | |
B | |
BatchCommand, SvgCanvas | |
beginUndoableChange, SvgCanvas | |
C | |
ChangeElementCommand, SvgCanvas | |
clear, SelectorManager | |
clearSelection, SelectorManager | |
createLayer, SelectorManager | |
D | |
deleteCurrentLayer, SelectorManager | |
E | |
elements | |
F | |
Fill and Stroke, SelectorManager | |
finishUndoableChange, SvgCanvas | |
fromXml, SvgCanvas | |
Functions, Selector | |
G | |
getCurrentLayer, SelectorManager | |
getLayer, SelectorManager | |
getLayerOpacity, SelectorManager | |
getLayerVisibility, SelectorManager | |
getNextRedoCommandText, SvgCanvas. | |
getNextUndoCommandText, SvgCanvas. | |
getNumLayers, SelectorManager | |
getRedoStackSize, SvgCanvas. | |
getRubberBandBox, SelectorManager. | |
getSvgString, SelectorManager | |
getUndoStackSize, SvgCanvas. | |
getVersion, SelectorManager | |
I | |
importSvgString, SelectorManager | |
initGroup, SelectorManager. | |
InsertElementCommand, SvgCanvas | |
isEmpty, SvgCanvas. | |
L | |
Layers, SelectorManager | |
M | |
MoveElementCommand, SvgCanvas | |
moveSelectedToLayer, SelectorManager | |
R | |
redo, SvgCanvas. | |
releaseSelector, SelectorManager. | |
RemoveElementCommand, SvgCanvas | |
removeFromSelection, SelectorManager | |
renameCurrentLayer, SelectorManager | |
requestSelector, SelectorManager. | |
reset, Selector. | |
resetUndoStack, SvgCanvas | |
resize, Selector. | |
S | |
save, SelectorManager | |
selectAllInCurrentLayer, SelectorManager | |
Selection, SelectorManager | |
Selector | |
SelectorManager | |
Serialization, SelectorManager | |
setCurrentLayer, SelectorManager | |
setCurrentLayerPosition, SelectorManager | |
setForeignString(xmlString,elt) | |
setLayerOpacity, SelectorManager | |
setLayerVisibility, SelectorManager | |
setSvgString, SelectorManager | |
showGrips, Selector. | |
SvgCanvas | |
T | |
toXml, SvgCanvas | |
U | |
unapply | |
undo, SvgCanvas. | |
Undo/ | |
updateGripCursors, Selector. |
A | |
addCommandToHistory, SvgCanvas | |
addSubCommand, SvgCanvas. | |
addSvgElementFromJson, SelectorManager | |
addToSelection, SelectorManager | |
apply | |
assignAttributes, SelectorManager | |
B | |
BatchCommand, SvgCanvas | |
beginUndoableChange, SvgCanvas | |
bind, SelectorManager | |
C | |
ChangeElementCommand, SvgCanvas | |
cleanupElement, SelectorManager | |
clear, SelectorManager | |
clearSelection, SelectorManager | |
convertToNum, SvgCanvas | |
createLayer, SelectorManager | |
D | |
deleteCurrentLayer, SelectorManager | |
E | |
elements | |
embedImage, SelectorManager | |
F | |
Fill and Stroke, SelectorManager | |
finishUndoableChange, SvgCanvas | |
fromXml, SvgCanvas | |
Functions, Selector | |
G | |
getCurrentLayer, SelectorManager | |
getId, SelectorManager | |
getLayer, SelectorManager | |
getLayerOpacity, SelectorManager | |
getLayerVisibility, SelectorManager | |
getNextId, SelectorManager | |
getNextRedoCommandText, SvgCanvas. | |
getNextUndoCommandText, SvgCanvas. | |
getNumLayers, SelectorManager | |
getRedoStackSize, SvgCanvas. | |
getRubberBandBox, SelectorManager. | |
getSvgString, SelectorManager | |
getUndoStackSize, SvgCanvas. | |
getUrlFromAttr, SelectorManager | |
getVersion, SelectorManager | |
H | |
Helper functions, SelectorManager | |
I | |
importSvgString, SelectorManager | |
initGroup, SelectorManager. | |
InsertElementCommand, SvgCanvas | |
isEmpty, SvgCanvas. | |
isValidUnit, SvgCanvas | |
L | |
Layers, SelectorManager | |
M | |
MoveElementCommand, SvgCanvas | |
moveSelectedToLayer, SelectorManager | |
R | |
redo, SvgCanvas. | |
releaseSelector, SelectorManager. | |
RemoveElementCommand, SvgCanvas | |
removeFromSelection, SelectorManager | |
removeUnusedDefElems, SelectorManager | |
renameCurrentLayer, SelectorManager | |
requestSelector, SelectorManager. | |
reset, Selector. | |
resetUndoStack, SvgCanvas | |
resize, Selector. | |
S | |
sanitizeSvg, SelectorManager | |
save, SelectorManager | |
selectAllInCurrentLayer, SelectorManager | |
Selection, SelectorManager | |
Selector | |
SelectorManager | |
Serialization, SelectorManager | |
setCurrentLayer, SelectorManager | |
setCurrentLayerPosition, SelectorManager | |
setForeignString(xmlString,elt) | |
setIdPrefix, SelectorManager | |
setLayerOpacity, SelectorManager | |
setLayerVisibility, SelectorManager | |
setSvgString, SelectorManager | |
setUnitAttr, SvgCanvas | |
showGrips, Selector. | |
SvgCanvas | |
svgCanvasToString, SelectorManager | |
svgToString, SelectorManager | |
T | |
toXml, SvgCanvas |
Adds a command object to the undo history stack
addCommandToHistory = c.undoCmd.add = function( cmd )
Adds a list of elements to the selection.
this.addToSelection = function( elemsToAdd, showGrips )
Adds a command object to the undo history stack
addCommandToHistory = c.undoCmd.add = function( cmd )
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
var addSvgElementFromJson = this.addSvgElementFromJson = function( data )
Adds a list of elements to the selection.
this.addToSelection = function( elemsToAdd, showGrips )
Assigns multiple attributes to an element.
var assignAttributes = this.assignAttributes = function( node, attrs, suspendLength, unitCheck )
History command that can contain/execute multiple other commands
var BatchCommand = this.undoCmd.batch = function( text )
This function tells the canvas to remember the old values of the attrName attribute for each element sent in.
c.beginUndoableChange = function( attrName, elems )
History command that can contain/execute multiple other commands
var BatchCommand = this.undoCmd.batch = function( text )
This function tells the canvas to remember the old values of the attrName attribute for each element sent in.
c.beginUndoableChange = function( attrName, elems )
Attaches a callback function to an event
c.bind = function( event, f )
History command to make a change to an element.
var ChangeElementCommand = this.undoCmd.changeElement = function( elem, attrs, text )
Clears the current document.
this.clear = function()
Clears the selection.
this.clearSelection = function( noCall )
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.createLayer = function( name )
History command to make a change to an element.
var ChangeElementCommand = this.undoCmd.changeElement = function( elem, attrs, text )
Remove unneeded (default) attributes, makes resulting SVG smaller
var cleanupElement = this.cleanupElement = function( element )
Clears the current document.
this.clear = function()
Clears the selection.
this.clearSelection = function( noCall )
Converts given values to numbers.
convertToNum = function( attr, val )
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.createLayer = function( name )
Deletes the current layer from the drawing and then clears the selection.
this.deleteCurrentLayer = function()
Deletes the current layer from the drawing and then clears the selection.
this.deleteCurrentLayer = function()
Converts a given image file to a data URL when possible, then runs a given callback
this.embedImage = function( val, callback )
This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
c.finishUndoableChange = function()
Converts XML entities in a string to single characters.
fromXml = function( str )
This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
c.finishUndoableChange = function()
Converts XML entities in a string to single characters.
fromXml = function( str )
Returns the name of the currently selected layer.
this.getCurrentLayer = function()
Returns the name of the ith layer.
this.getLayer = function( i )
Returns the opacity of the given layer.
this.getLayerOpacity = function( layername )
Returns whether the layer is visible.
this.getLayerVisibility = function( layername )
Returns the number of layers in the current drawing.
this.getNumLayers = function()
Returns the current drawing as raw SVG XML text.
this.getSvgString = function()
Returns a string which describes the revision number of SvgCanvas.
this.getVersion = function()
History command for an element that was added to the DOM
var InsertElementCommand = this.undoCmd.insertElement = function( elem, text )
Returns the name of the currently selected layer.
this.getCurrentLayer = function()
Returns the last created DOM element ID string
getId = c.getId = function()
Returns the name of the ith layer.
this.getLayer = function( i )
Returns the opacity of the given layer.
this.getLayerOpacity = function( layername )
Returns whether the layer is visible.
this.getLayerVisibility = function( layername )
Creates and returns a unique ID string for a DOM element
getNextId = c.getNextId = function()
Returns the number of layers in the current drawing.
this.getNumLayers = function()
Returns the current drawing as raw SVG XML text.
this.getSvgString = function()
i.e.
var getUrlFromAttr = this.getUrlFromAttr = function( attrVal )
Returns a string which describes the revision number of SvgCanvas.
this.getVersion = function()
History command for an element that had its DOM position changed
var MoveElementCommand = this.undoCmd.moveElement = function( elem, oldNextSibling, oldParent, text )
Moves the selected elements to layername.
this.moveSelectedToLayer = function( layername )
History command for an element that was added to the DOM
var InsertElementCommand = this.undoCmd.insertElement = function( elem, text )
Check if an attribute’s value is in a valid format
canvas.isValidUnit = function( attr, val )
History command for an element removed from the DOM
var RemoveElementCommand = this.undoCmd.removeElement = function( elem, parent, text )
Removes elements from the selection.
this.removeFromSelection = function( elemsToRemove )
Renames the current layer.
this.renameCurrentLayer = function( newname )
Resets the undo stack, effectively clearing the undo/redo history
resetUndoStack = function()
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.save = function( opts )
Clears the selection, then adds all elements in the current layer to the selection.
this.selectAllInCurrentLayer = function()
Sets the current layer.
this.setCurrentLayer = function( name )
Changes the position of the current layer to the new value.
this.setCurrentLayerPosition = function( newpos )
This function sets the content of element elt to the input XML.
function setForeignString( xmlString )
Sets the opacity of the given layer.
this.setLayerOpacity = function( layername, opacity )
Sets the visibility of the layer.
this.setLayerVisibility = function( layername, bVisible )
This function sets the current drawing as the input SVG XML.
this.setSvgString = function( xmlString )
History command for an element that had its DOM position changed
var MoveElementCommand = this.undoCmd.moveElement = function( elem, oldNextSibling, oldParent, text )
Moves the selected elements to layername.
this.moveSelectedToLayer = function( layername )
Converts characters in a string to XML-friendly entities.
toXml = function( str )
History command for an element removed from the DOM
var RemoveElementCommand = this.undoCmd.removeElement = function( elem, parent, text )
Removes elements from the selection.
this.removeFromSelection = function( elemsToRemove )
Looks at DOM elements inside the defs to see if they are referred to, removes them from the DOM if they are not.
var removeUnusedDefElems = this.removeUnusedDefElems = function()
Renames the current layer.
this.renameCurrentLayer = function( newname )
Resets the undo stack, effectively clearing the undo/redo history
resetUndoStack = function()
Sanitizes the input node and its children It only keeps what is allowed from our whitelist defined above
var sanitizeSvg = this.sanitizeSvg = function( node )
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.save = function( opts )
Clears the selection, then adds all elements in the current layer to the selection.
this.selectAllInCurrentLayer = function()
Sets the current layer.
this.setCurrentLayer = function( name )
Changes the position of the current layer to the new value.
this.setCurrentLayerPosition = function( newpos )
This function sets the content of element elt to the input XML.
function setForeignString( xmlString )
Changes the ID prefix to the given value
c.setIdPrefix = function( p )
Sets the opacity of the given layer.
this.setLayerOpacity = function( layername, opacity )
Sets the visibility of the layer.
this.setLayerVisibility = function( layername, bVisible )
This function sets the current drawing as the input SVG XML.
this.setSvgString = function( xmlString )
Sets an element’s attribute based on the unit in its current value.
setUnitAttr = function( elem, attr, val )
Main function to set up the SVG content for output
var svgCanvasToString = this.svgCanvasToString = function()
Sub function ran on each SVG element to convert it to a string as desired
var svgToString = this.svgToString = function( elem, indent )
Converts characters in a string to XML-friendly entities.
toXml = function( str )