Closed Jean-Baptiste-Camps closed 6 years ago
Also, it seems that igraph
as an easy way of setting edge length, and that would be useful for setting this length as a function of the number of disagreements in the stemmata, which I have been wanting to do since a long time now…
Ooops, apparently, I missed #27 ! You were suggesting other packages already.
Only issue with igraph
is that we won't be able to set arbitrary edge lengths in stemmata (for instance, an edge length proportional to the number of disagreements). The way to do that would be to use a phylogenetic tree package…
Actually, there might be a workaround with igraph
, but it includes coding a small layout modifying function to adjust coordinates.
EDIT: implemented a basic function to do that.
Switched to igraph done for all graph plotting.
I wonder whether to switch from
sna
(+network
) toigraph
for network plottingSome reading:
Problems and solutions
For the moment, the problem with
sna::gplot
is that it does not scale graphics properly in R studio, and graphs have readability issues.A side benefit seems to be that igraph has built-in tree objects and methods (such as layout=layout_as_tree, etc.).
NB: the default placement algorithm (modifiable) for sna is 'fruchtermanreigold', and for igraph, `` layout_nicely: a smart function that chooses a layouter based on the graph.''
Also, maybe
graphViz
could be an interesting solution. It seems quite used in the stemmatology community and has R implementations.Performance
In terms of performance, I have run profiling on the following lines:
Result:
sna::gplot
takes 25.9 MB of memory and 210 msigraph::plot
takes 0.8 MB of memory and 40 msGraphics
In terms of graphics (in Rstudio, without reconfiguring the graphics interface)
SNA
igraph
What do you think, @floriancafiero ? I am tempted to switch to
igraph
, which means some important changes in code and visualisation (as compared to what we've been doing until now).