cosmograph-org / cosmos

GPU-accelerated force graph layout and rendering
Other
823 stars 53 forks source link

Rescale Initial Node Positions #92

Closed Stukova closed 9 months ago

Stukova commented 9 months ago

Previously, when nodes had initial positions with negative X or Y values, the Many Body force pushed these nodes towards the left or right boundaries. This issue occurred because the boundaries were simulated in a space from 0 to spaceSize value.

We decided to rescale the initial coordinates of the nodes to fit the simulation space while preserving the proportion. This ensures that nodes with negative initial positions are correctly handled and prevents them from being pushed to the boundaries.