#Slate Methods
Programatically control the slate with the below methods.
#nodes.add
adds new node(s) to the slate
arguments
returns
null
#nodes.remove
remove node(s) from the slate
arguments
returns
null
#svg
download the slate as svg
arguments
None
returns
browser will download a slate_timestamp.svg svg file
#png
download the slate as png
arguments
None
returns
browser will download a slate_timestamp.png png file
#canvas.zoom
zoom the slate on the z plane
arguments
returns
null
#canvas.move
move the slate on the x, y plane
arguments
returns
null
#applyTheme
applyTheme
arguments
returns
null
#exportJSON
a JSON representation of the slate
arguments
None
returns an array of ...nodeObject(s) and a ...slateObject.
#loadJSON
load a slate with the JSON string exported from
exportJSONarguments
returns
null
#getOrientation
orientation details for the slate
arguments
returns
#scaleToFitAndCenter
This function combines the scaleToFitNodes and centerOnNodes methods into one simplified call.
scale and center the slate on all its nodes
arguments
returns
#scaleToFitNodes
scale the slate to show all nodes (or those selected) in the viewport
arguments
returns
#centerOnNodes
scale the slate to show all nodes (or those selected) in the viewport
arguments
returns
#slate.grid.show
show the background grid on the slate canvas
arguments
none
returns
#slate.grid.destroy
remove the background grid on the slate canvas
arguments
none
returns