//Add an event handler to the node when creating it. function fOnCreateLabel(label, node) { label.id = node.id; label.innerHTML = node.name; label.onclick = function(){ st.onClick(node.id); } //set label styles var style = label.style; style.width = 70 + 'px'; style.height = 17 + 'px'; style.cursor = 'pointer'; style.color = '#333'; style.fontSize = '0.8em'; style.paddingTop = '2px'; style.paddingLeft = '2px'; } //This method is called right before plotting //a node. It's useful for changing an individual node //style properties before plotting it. //The data properties prefixed with a dollar //sign will override the global node style properties. function fOnBeforePlotNode(node) { //add some color to the nodes in the path between the //root node and the selected node. if (node.selected) { node.data.$color = "#ff7"; } else { delete node.data.$color; } } //This method is called right before plotting //an edge. It's useful for changing an individual edge //style properties before plotting it. //Edge data properties prefixed with a dollar sign will //override the Edge global style properties. function fOnBeforePlotLine(adj){ if (adj.nodeFrom.selected && adj.nodeTo.selected) { adj.data.$color = "#eed"; adj.data.$lineWidth = 3; } else { delete adj.data.$color; delete adj.data.$lineWidth; } }

menu