Skip to contents

This function organizes and formats static and variable-dependent aesthetic parameters for nodes, text labels, and edges to be used in ggplot2 visualizations. It adjusts parameters based on the existence and non-null status of the corresponding entries in plot_args.

Usage

gg_params(plot_args)

Arguments

plot_args

A list containing user-defined specifications for various graphical parameters such as color, size, alpha, and others for different components of the plot.

Value

A list containing organized graphical parameters for nodes, text, labels, and edges. Each component has sub-lists for static parameters and variable parameters.

Details

The function splits the graphical parameters into static and dynamic (variable-dependent) categories. Static parameters are directly applied when the corresponding variable-dependent parameter is not set. If a variable-dependent parameter is set, the static parameter is excluded to allow dynamic mapping in ggplot.

Dynamic or variable-dependent parameters are set based on a mapping from data columns specified in plot_args. The function checks for non-null entries in plot_args and assigns these to the appropriate aesthetic if the entry exists. For example, if plot_args$point_color_var is not null, it will create a dynamic color mapping for nodes and remove any static color setting.

Author

Cassy Dorff, Shahryar Minhas