add option to pin node positions #53
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 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.pin
argument 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 there2 => true/false
pin (or explicitly not pin) vertex 2. Initial condition needs to be specified ininitialpos
argument, otherwise will be random3 => (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.