Skip to content

add option to pin node positions #53

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

Merged
merged 8 commits into from
Mar 20, 2023
Merged

add option to pin node positions #53

merged 8 commits into from
Mar 20, 2023

Conversation

hexaeder
Copy link
Collaborator

This is a rework of #52. I changed the interface in the folloing way:

  • initialpos optionally allows for dictionarys now. So you can use something like Dict(3 => (1,2,3)) to set the inittial positon for the third vertex. Works with every pairs(..) comaptible container so the oldstyle arrays should also work.
  • pin argument is new and also accepts containers which support pairs(...) (mainly Vectors and Dicts). There are three options to use it:
    • 1 => (0.0, 1.0) overwrite the initial position for vertex 1 with (0.0, 1.0) and than pin it there
    • 2 => true/false pin (or explicitly not pin) vertex 2. Initial condition needs to be specified in initialpos argument, otherwise will be random
    • 3 => (true, false) only pin x coordinate of that point. y is free. The position at which to pin needs to be set using initialpos

I'd would be great if @claytonpbarrows and @thchr could give feedback on this. Would theis interface satisfy your invisoned workflows? Do you have the chance to try that PR? The tests in that package are not that great so i'd like to hear wether it works in real world code.

@codecov
Copy link

codecov bot commented Oct 27, 2022

Codecov Report

Merging #53 (b6edb03) into master (8eca84d) will increase coverage by 0.88%.
The diff coverage is 98.82%.

❗ Current head b6edb03 differs from pull request most recent head 199dd56. Consider uploading reports for the commit 199dd56 to get more accurate results

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
+ Coverage   97.44%   98.32%   +0.88%     
==========================================
  Files           8        8              
  Lines         470      538      +68     
==========================================
+ Hits          458      529      +71     
+ Misses         12        9       -3     
Impacted Files Coverage Δ
src/NetworkLayout.jl 95.58% <96.66%> (+1.14%) ⬆️
src/sfdp.jl 100.00% <100.00%> (+1.69%) ⬆️
src/spring.jl 100.00% <100.00%> (+2.22%) ⬆️
src/stress.jl 100.00% <100.00%> (+2.24%) ⬆️

... and 4 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@hexaeder
Copy link
Collaborator Author

@claytonpbarrows
Copy link

@hexaeder apologies for the slow response to this. It looks great. I believe that all the workflows that I've envisioned would work well with this implementation.

@hexaeder hexaeder merged commit 1b702d3 into master Mar 20, 2023
@hexaeder hexaeder deleted the hw/fixed branch March 20, 2023 16:09
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.

2 participants