stocnet / manynet

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

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

Open henriquesposito opened 6 months ago

henriquesposito commented 6 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 5 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 1 month 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.