Skip to content
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

Reload sigma graph with new layout? #133

Open
michaelbdavid opened this issue Oct 31, 2022 · 1 comment
Open

Reload sigma graph with new layout? #133

michaelbdavid opened this issue Oct 31, 2022 · 1 comment

Comments

@michaelbdavid
Copy link

michaelbdavid commented Oct 31, 2022

Can someone point me to a way to force sigma to refresh with a new layout? It seems that after first layout can not get sigma to recalculate node positions and relayout.

I tried doing something like:

const forcePositions = forceAtlas2(graph, { iterations: 50 });
graph.forEachNode((node, attributes) => {
    graph.updateNodeAttribute(node, 'x', () => forcePositions[node].x);
                 graph.updateNodeAttribute(node, 'y', () => forcePositions[node].y);
        });

sigma.refresh();

node x and y are updated but sigma remains the same, even with sigma.refresh();

@michaelbdavid
Copy link
Author

any thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant