Events - marcelklehr/buzzmap GitHub Wiki

$('#container').buzzmap({
  onchange: function (node, data) {},
  ondrag: function (node) {},
  onshow: function (node) {},
  onhide: function (node) {},
  onremove: function (node) {},
  fps: function (fps) {},
});

Event callbacks can be defined with the initial options or attached to the Buzzmap object (see Objects) using .bind('event', callback) and .unbind('event', callback).

onchange

function (node, data)
Gets called after a node was added, altered or removed. Argument node will contain the changed node, data will contain the new node structure as a json-encoded string (see Data structure).

onremove

function (node)
Gets called before a node is being removed. Argument node will contain the concerned node.

ondrag

function (node)
Gets called while a node is being dragged around. Argument node will contain the node being dragged.

onshow

function (node)
Gets called when a node is being displayed. Argument node will contain the particular node.

onhide

function (node) Gets called when a node is being hidden. Argument node will contain the particular node.

fps

function (fps)
Gets called every 500 ms with the current frames per second value.