Skip to content

Reload sigma graph with new layout? #133

@michaelbdavid

Description

@michaelbdavid

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions