jacomyal / sigma.js

A JavaScript library aimed at visualizing graphs of thousands of nodes and edges
https://www.sigmajs.org/
MIT License
11.28k stars 1.59k forks source link

I want to prevent nodes from disappearing from the screen. #1338

Open rainingdaewoo opened 1 year ago

rainingdaewoo commented 1 year ago

When i move the nodes while dragging the mouse, they disappear from the screen. I want to prevent nodes from disappearing from the screen.

joaopfg commented 1 year ago

@rainingdaewoo I also have this problem sometimes when drawing the graph using ForceAtlas algorithm. Did you find a way to prevent it ?

BatPandaPancake commented 1 year ago

@joaopfg ForceAtlas2 bugs out for me in that manner when you pan the camera before there's anything in the graph. Once you add nodes it goes crazy and disappears. I think it has to do with some viewport bs and their fake scaling. I "fixed" it by adding an overlay that blocks mouse input to the graph when its node count is 0. This might be fixable by only adding nodes within viewport coordinates, but I haven't explored that yet.