KâŘĕĕm Sayed
KâŘĕĕm Sayed

Reputation: 13

VisJs delete Node Dynamicaly

   function addEdgeMode(nodeId){
     network.addEdgeMode();
   }

/**need method like network.addEdgeMode(); to delete node example: network.deleteNodeMode()*/

Upvotes: 1

Views: 1600

Answers (1)

AndrewL64
AndrewL64

Reputation: 16341

Im not too familiar with vis but according to the offical vis.js docs, I think you can use the deleteSelected() method like this:

function deleteEdgeMode(nodeId){
    network.deleteSelected();
}

Also, according to the method description, do note that you do not need to go into editEdge mode or enable manipulation for the deleteSelected() method to work.

Upvotes: 2

Related Questions