-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Relative vertex.size + fix in tests + spelling in plot.common.Rd #172
base: main
Are you sure you want to change the base?
Conversation
Following CONTRIBUTING.md, ping @gaborcsardi @ntamas |
In general, this possibility looks quite useful @gvegayon, thanks for contributing! It has taken slightly longer than a week to get back to you on this 😉 I will have to look at this in a bit more detail, but I had a more general question. The ability to specify relative vertex sizes is definitely useful, however, it is a pity that the ordinary
That way, users continuing to use |
No worries wrt to the timing, @vtraag! I see myself reflected on this 😛. Sure, that makes sense. I will take a look at this and try to implement one of your suggested solutions. |
If a breaking change is made, this would be an opportunity to think carefully about what the best way is to set vertex sizes. I'll admit I haven't yet looked into how this is done in the R interface yet, but for lack of time, I'll just throw a few Mathematica-inspired ideas here:
|
Current Aviator status
This pull request is currently open (not queued). How to mergeTo merge this PR, comment
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
This now has conflicts, my apologies. Are you still interested in the change? |
Just solved the conflicts. I haven't tested the code, but it should still work. Will try it out tomorrow. |
The vignettes now fail: https://github.com/igraph/rigraph/actions/runs/8446422057/job/23140221959?pr=172#step:7:34 . Can you please take a look? |
What about the comments in #172 (comment)? Do we want to make this a breaking change? |
library("igraph")
#>
#> Attaching package: 'igraph'
#> The following objects are masked from 'package:stats':
#>
#> decompose, spectrum
#> The following object is masked from 'package:base':
#>
#> union
g <- make_graph("Zachary")
plot(g)
#> Error in symbols(x = coords[, 1], y = coords[, 2], bg = vertex.color, : invalid symbol parameter Created on 2024-05-07 with reprex v2.1.0 For some reason in this reprex vertex.size becomes a vector of NA, that is passed to |
Want to sync main after #1413 and see what remains. |
Following issue #161, this PR makes a significan change in the way
vertex.size
is processed. In particular, instead of using the scaling(1/200)
as seen throughout the code,plot.igraph
now uses the functioni.rescale.vertex
which rescales the vertex size such that the smallest vertex is of sizevertex.relative.size[1]
and the largest one of sizevertex.relative.size[2]
(vertex.relative.size
is a new parameter that has been added asrelative.size
in the listi.vertex.default
and has a default values ofc(.01,.025)
[1%,2.5% of the plotting region]).This new feature has been included to be compatible with
rglplot
andtkplot
so all three plotting functions have somewhat same vertex sizes.A neat example of this new feature is:
which has been included at the end of the file
plot.common.Rd
. Furthermore, the changes do not affect significantly examples in theplot.common.Rd
file since by default all vertices occupy 2.5% of the screen.One important drawback of this PR is that "simple" changes in vertex.size won't be reflected, e.g.
Finally, this PR fixes a couple of 'failures' that
testthat
showed due to a relatively recent update in which usingprint
started to be a requirement within 'expectations'.I understand that this may be a big change but the benefits are greater (in my opinion) since picking vertex sizes will now be more intuitive than before.