#
Node Methods
Programatically control a node with the below methods.
#
move
move a node by x, y coordinates
arguments
node.move({
x: 30,
y: 20,
dur: 500
});
returns
null
#
toFront
move a node to front on the z axis
arguments
node.toFront();
none
returns
null
#
toBack
move a node to back on the z axis
arguments
node.toBack();
none
returns
null
#
hide
hide the node
arguments
node.hide();
none
returns
null
#
show
show the node
arguments
node.show();
none
returns
null
#
toggleFilters
show or hide the node effect (dropshadow, etc)
arguments
node.toggleFilters(blnHide);
returns
null
#
spin
Apply a perpetual spin effect to a node
arguments
node.spin({
angle: 280,
duration: 500
});
returns
null
#
zoom
Zoom in on the node
arguments
node.zoom(zoomPercent, duration, cb);
returns
null
#
position
Position the node
arguments
node.position(location, cb, easing, dur);
returns
null
#
disable
Optionally set node.options.isLocked = true
prior to making this disable
call to enable lock icons that the user can programmatically click to re-enable the node.
Disables the node from any interaction
arguments
node.disable();
None
returns
null
#
enable
Enable the node for user interaction
arguments
node.enable();
None
returns
null
#
colorPicker.set
Set the background color and opacity for the node
arguments
node.colorPicker.set({
color: '#333',
opacity: 1.0
});
returns
null
#
customShapes.set
Set the node to a custom svg path
arguments
node.customShapes.set(path, width, height, sendCollab);
returns
null
#
editor.set
Set the node to a custom svg path
arguments
node.editor.set(text, fontSize, fontColor, fontOpacity, textXAlign, textYAlign);
returns
null
#
images.set
Set an image to the background of the node
arguments
node.images.set(img, width, height);
returns
null
#
links.set
Set a link on the node
arguments
node.links.set({
type: 'url|currentSlate',
data: 'https://slatebox.com|other_node_id'
}, blnSendCollab);
returns
null
#
links.unset
Remove a link from the node
arguments
node.links.unset(blnSendCollab);
returns
null
#
resize.set
Resize a node
arguments
node.resize.set(width, height);
returns
null
#
rotate.set
Rotate a node
arguments
node.rotate.set(rotationAngle);
returns
null