sigma.js: is there a way to drag-select multiple nodes?

1.7k views Asked by At

I try to do a drag-select but end up dragging the graph itself. I don't see any settings that can change the drag action.

Is there a way to drag-select multiple nodes at once?

2

There are 2 answers

1
user1918845 On

here you go, a plugin that i made for multiple selection of nodes by drag-selecting them

https://gist.github.com/deanshub/2ee8d3aee5f325c8c4aa

you should add the file provided to your html like so: (or use something like Webpack)

<script src="sigma.plugins.nodesSelection.js"></script>

To use the plugin you should activate it and give a callback

sigma.plugins.activateMouseEvents(s,function(err, selectedNodes){
    console.log(selectedNodes);
});
1
Seb On

Yes, see this example: https://github.com/Linkurious/linkurious.js/wiki/How-to-select-and-drag-multiple-nodes

with this plugin: https://github.com/Linkurious/linkurious.js/tree/linkurious-version/plugins/sigma.plugins.dragNodes

Linkurious.js provides high-level plugins to Sigma.js. It is free for open source projects.

Disclaimer: I work at Linkurious SAS.