Hello. When I click on the graph sigma.js need to add a point to the place of the click. Looked at the examples - they have some kind of graph similar to the world of goo. I did not understand anything from it (( The game itself )

Click I can track:

 s.bind('clickStage', function(e) { ... } 

But if I take the coordinates with the e.data.captor.x command, I get the wrong coordinates. The circle marks the main graph, and the rest of the points appear when clicked.

enter image description here

If someone fumbles, please help

    1 answer 1

    So after all, there is a ready-made example for adding a point to the project repository - https://github.com/jacomyal/sigma.js/blob/master/examples/add-node-on-click.html . Look from the 400th line:

      dom.addEventListener('click', function(e) { ... });