Skip to content

Graph is rendering different layouts for the exact same nodes/links #381

@PedroVeloso95

Description

@PedroVeloso95

Describe the bug
Hello, im sorry if this is not a bug but could not find any information anywhere regarding this issue.
When using the ForceGraph and providing the exact same nodes and links, links having distances values which I then apply like this:

references.current.graphRef
.d3Force('link')
?.distance((link) => (link.distance > 1100 ? link.distance : 1000))
.iterations(graphData.nodes.length * 0.05);

it calculates a layout that stays that way but its not consistent across different environments, so for example, the exact same nodes and links will render a different layout on a QA environment versus localhost, sometimes even in the same environment it will render different layouts when I force a recalculation of the distances on my backend (the values come out exactly the same but the layout does not), if I don't recalculate the layouts stays fixed, I've double checked the distances many times to make sure there were no differences causing the layout changes.

Expected behavior
The graph should be equal to the same nodes/links

Is this expected behavior because of some internal randomness or it should be equal?

Thanks in advance

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