Skip to content

Instantly share code, notes, and snippets.

@jrgleason
Created May 27, 2015 13:18
Show Gist options
  • Save jrgleason/1c9e608bc0ee9ef2e778 to your computer and use it in GitHub Desktop.
Save jrgleason/1c9e608bc0ee9ef2e778 to your computer and use it in GitHub Desktop.
Keylines add link
chart.createLink(nodeId, newLinkId, {style: newLinkStyle}, function(linkedId){
if(linkedId){
var fromNode = chart.getItem(nodeId);
var toNode = chart.getItem(linkedId);
if(fromNode && toNode){
//great we have them both so now we are ready to save.
console.log("Linking from "+JSON.stringify(fromNode)+" to "+JSON.stringify(toNode));
}
else{
console.log("One side of the link is missing");
}
}
else{
chart.removeItem(newLinkId);
}
removePlusIcon();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment