add option to pin node positions
This is a rework of #52. I changed the interface in the folloing way:
-
initialposoptionally allows for dictionarys now. So you can use something likeDict(3 => (1,2,3))to set the inittial positon for the third vertex. Works with everypairs(..)comaptible container so the oldstyle arrays should also work. -
pinargument is new and also accepts containers which supportpairs(...)(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/falsepin (or explicitly not pin) vertex 2. Initial condition needs to be specified ininitialposargument, 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 usinginitialpos
-
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 Report
Merging #53 (b6edb03) into master (8eca84d) will increase coverage by
0.88%. The diff coverage is98.82%.
:exclamation: 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%) |
:arrow_up: |
| src/sfdp.jl | 100.00% <100.00%> (+1.69%) |
:arrow_up: |
| src/spring.jl | 100.00% <100.00%> (+2.22%) |
:arrow_up: |
| src/stress.jl | 100.00% <100.00%> (+2.24%) |
:arrow_up: |
... 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.
added docs on that: https://juliagraphs.org/NetworkLayout.jl/previews/PR53/#pin-Positions-in-Interative-Layouts
@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.