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

fix stress layout #40

Merged
merged 3 commits into from
Sep 15, 2021
Merged

fix stress layout #40

merged 3 commits into from
Sep 15, 2021

Conversation

hexaeder
Copy link
Collaborator

This PR fixes the stress layout according to the cited paper (see #39). It mainly introduces the pairwise_distances function which calculates the minimum distance between ALL nodes (not only the connected) and uses those as the "optimal distance" for drawing. It is slower now (calculating all distances is O(n^3) 😢 )... but at least it produces nice layouts now^^

Technicially this is breaking but if @SimonDanisch agrees I'd still publish this as a patch release... i doubt someone is using the layout as is.

@mroavi can you check if this works as expected with your example?

stress_animation.mp4

@codecov
Copy link

codecov bot commented Sep 15, 2021

Codecov Report

Merging #40 (0c5ba55) into master (fef0acb) will decrease coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #40      +/-   ##
==========================================
- Coverage   98.14%   98.01%   -0.14%     
==========================================
  Files           8        8              
  Lines         432      454      +22     
==========================================
+ Hits          424      445      +21     
- Misses          8        9       +1     
Impacted Files Coverage Δ
src/NetworkLayout.jl 94.11% <100.00%> (+2.81%) ⬆️
src/stress.jl 97.75% <100.00%> (-0.97%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fef0acb...0c5ba55. Read the comment docs.

@mroavi
Copy link

mroavi commented Sep 15, 2021

Works great!

GraphMakie-stress-fix-Screenshot_2021-09-15_10-25-09

@hexaeder hexaeder merged commit 6c2039c into master Sep 15, 2021
@hexaeder hexaeder deleted the hw/fix_stress branch September 15, 2021 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat request: integrate by_axis_local_stress_graph network layout from GraphRecipes
3 participants