Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Improve force layout #39

Merged
merged 8 commits into from
Jan 14, 2022
Merged

Improve force layout #39

merged 8 commits into from
Jan 14, 2022

Conversation

flo-dup
Copy link
Contributor

@flo-dup flo-dup commented Jan 14, 2022

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?
Bug fix and layout improvements

What is the current behavior?
Unwanted behavior of force-layout algorithm:

  • counting twice some edges as direction does matter in equals
  • repulsion is added twice on each (node,node) pair
  • when two nodes are very close at one step they slow down the algorithm as they are sent very far apart
  • the damping term helps the convergence but does not make sense physically
  • the default parameters of the algorithm do not fit the usual use cases of network-area-diagram

What is the new behavior (if this is a feature change)?

  • edges not counted twice even if adding an equivalent edge reversed
  • repulsion only added once on each (node,node) pair
  • when two nodes are very close at one step they are not sent too far apart
  • the damping term has been replaced with a friction
  • the default parameters fit better the usual use cases of network-area-diagram; nonetheless the stiffness needs to be adapted for very large networks (set to 100)

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

  • The Breaking Change or Deprecated label has been added
  • The migration guide has been updated in the github wiki (What changes might users need to make in their application due to this PR?)

Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
@flo-dup flo-dup added the Breaking change API is broken label Jan 14, 2022
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

72.2% 72.2% Coverage
0.0% 0.0% Duplication

@flo-dup flo-dup merged commit 9ba8b36 into main Jan 14, 2022
@flo-dup flo-dup deleted the fix_force_layout branch January 14, 2022 16:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Breaking change API is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant