stocnet / manynet

Many Ways to Make, Manipulate, and Map Myriad Networks
https://stocnet.github.io/manynet/
Other
12 stars 0 forks source link

Rely on fill instead of color for `graphr/s/t` functions for flexibility and consistency #46

Open henriquesposito opened 11 months ago

henriquesposito commented 11 months ago

Currently we rely on the color aesthetics to color the inside of nodes. However, once node colors and shapes are declared, color becomes the outside color.

For example, autographr(ison_lawfirm, node_color = "school")and autographr(ison_lawfirm, node_color = "school", node_shape = "practice").

This happens because of inconsistencies in using both ggplot2 and ggraph packages in our functions. By refactoring and making code more consistent, will allow that we use color for the outside and fill for inside colors throughout. That is, we will have the "node_color" and "node_fill" arguments in the autographr/s/d functions.

henriquesposito commented 9 months ago

For the time being, shape is not mapped according to variable, it is just set as an aesthetic in autographr() with the '.infer_nshape()' helper function. For this reason, guides also do not work for shape at the moment (see #52).

henriquesposito commented 5 months ago

Because we rely on both ggplot2 and ggraph packages in our functions substituting color by fill returns unexpected results (e.g. aesthetics mapped correctly but colors are the same). However, we now consistently map node colors and sizes and this improves the function consistency.

henriquesposito commented 23 hours ago

@jhollway I am going through the open issues and I am wondering if we should close this issue since it was addressed (as much possible) in the recent changes related to how graphr() works? Thank you.

jhollway commented 22 hours ago

graphr(ison_lawfirm, node_color = "school", node_size = 6) still uses the color geom and not fill.

image

This issue is a bottleneck for themes like 'crisp' that would require e.g. nodes with a separate (white) fill and (black) outline.