Removing Link data from the graph

I’m trying to remove link data from my graph but it isn’t working. I have tried both removeLinkData as well as removeLinkDataCollection within the transaction but to no result.

What are you trying?

You do need to find the exact Object that is the link data (i.e. the value of if you are using a GraphLinksModel). I suppose you could call Diagram.findLinksByExample. Or you could find a Node by calling Diagram.findNodeForKey or Diagram.findNodeForData and then call Node methods to find connected Links.

I did what you asked of me but even that doesn’t works for me.Below is the code:

node = myDiagram.findNodeForKey(nodeData.key);
links = node.findLinksConnected();
while (
var edge = links.value;
data =;
myDiagram.startTransaction(“Edge Delete”);
myDiagram.commitTransaction(“Edge Delete”);

First, as with any transactional system, you should not be performing transactions inside loops like that.

Second, why don’t you remove the Links from the Diagram instead of removing the link data from the Model?

  var node = . . .
  myDiagram.startTransaction("Deleted Links");
  myDiagram.commitTransaction("Deleted Links");

Or, if you don’t mind changing the current selection:

  var node = ...

(Commands and tools execute their own transactions.)

thanks, it worked great.