-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drag node issue #423
Comments
Hello use |
Hi, sheymann: s = new sigma({
graph: g,
container: 'graph-container',
settings: {
autoRescale: ['nodeSize', 'edgeSize']
}
}); But what I got is the similar issue as mentioned in issue #373 |
@sheymann have you got a chance to look at my comment? I'm not sure where I did wrong here, but that autoRescale will make all the nodes collapsed on a single dot... |
Hello, you'll need to set the zoom ratio manually to use this setting. |
@sheymann I've searched the wiki and the only zoom ratio setting I found is 'zoomingRatio'. So if I understood you correctly, this is what I need to do (in examples/drag-nodes.html): s = new sigma({
graph: g,
container: 'graph-container',
settings: {
autoRescale: ['nodeSize', 'edgeSize'],
zoomingRatio: 5 /* Not exactly sure about this number yet, but it doesn't make much difference so far*/
}
}); But the code snippet above doesn't seem to work still. All the nodes are collapsed together. Please see the attached image If I didn't quite get what you meant, could you be kind enough to write some code snippet that could work for examples/drag-nodes.html? Many thanks to you! |
settings: zoomMin: 0.01, code: sigma.utils.zoomTo(s.camera, 0, 0, 0.02); |
Thank you @sheymann , so I did this: sigma.renderers.def = sigma.renderers.canvas
// Instantiate sigma:
s = new sigma({
graph: g,
container: 'graph-container',
settings: {
autoRescale: ['nodeSize', 'edgeSize'],
zoomMin: 0.01,
zoomMax: 2,
}
});
sigma.utils.zoomTo(s.camera, 0, 0, 0.02); And it seems that this will enlarge every single node but it won't solve the problem that all the nodes are collapsed together. Please see the image below. And I tried zoomTo with other numbers such as 0.01, 0.001, and what they did was just make nodes larger but didn't solve the core problem here. Is there anything else I need to set? |
My current work around for this issue is: #302, but I am also interested in dumping it for a native fix! |
Did you apply the layout algorithm? |
@sheymann no, I actually only need to play with predefined coordinates because I need to use the layout generated by back-end server (which gives better layout). However, @patrickmarabeas 's workaround seems working for me, so big thanks to both of you! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The library is light and nice but...Currently when you drag a node to the edge of the canvas, the whole graph is re-scaled (zoomed out). If you drag the node far enough, and you go back to the center of the graph, the node goes back too. Ideally, can it be simpler so that if I drag a node off canvas then the graph won't be scaled and the node will just be dragged to where I drop it?
The text was updated successfully, but these errors were encountered: