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

Improve force layout with fixed positions #628

Merged
merged 5 commits into from
Jul 3, 2024

Conversation

flo-dup
Copy link
Contributor

@flo-dup flo-dup commented Jul 2, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?
No

What kind of change does this PR introduce?
Feature

What is the current behavior?
When only a few positions are not fixed, force layout is

  • too slow
  • putting all non-fixed nodes in the middle of the diagram, leading to a messy spiderweb there

What is the new behavior (if this is a feature change)?
Force layout is now fast when only a few positions are not fixed, and the non-fixed nodes are better placed.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

Other information:
the non-fixed position suffered

  • repulsion forces from all the nodes, leading to a n^2 complexity
  • attraction force to the center, which was packing all the non-fixed nodes in the middle of the diagram

Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
@flo-dup flo-dup requested a review from So-Fras July 2, 2024 13:51
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
So-Fras and others added 2 commits July 3, 2024 15:47
Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
Copy link

sonarcloud bot commented Jul 3, 2024

@So-Fras So-Fras merged commit 2ce586a into main Jul 3, 2024
7 checks passed
@So-Fras So-Fras deleted the faster_force_layout_with_fixed branch July 3, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

2 participants