netplot 0.4-0
Attribute formulas for
vertex.nsides,vertex.size, andedge.widthnow evaluate the right-hand side against the graph’s attributes, so expressions such asedge.width = ~ log1p(weight)orvertex.size = ~ degree ^ 2work in addition to bare attribute names. Previously any non-trivial right-hand side failed with a crypticthe condition has length > 1error. Missing attributes now produce a clear, informative message.vertex.color = ~ attrnow draws a legend appropriate to the attribute type: a categorical key for discrete attributes (factor, logical, low-cardinality integer) and a continuous color bar for continuous ones.Documentation overhaul:
nplot()now documents the formula interface for mapping vertex/edge aesthetics from graph attributes, the README highlights what sets netplot apart, a package-level help page was added, and the pkgdown reference is organized by feature.New vignette
"formulas"demonstrating how to color, shape, and size vertices (and scale edge widths) from graph attributes using formulas.nplot.network()now uses the"weight"edge attribute foredge.widthby default (likenplot.igraph()already did), so edge widths reflect edge weights instead of being drawn uniformly.edge.widthvalues are also explicitly re-applied to each edge grob after color post-processing to keep the drawn line widths robust. Closes #17.edge.width.range,vertex.size.range, andvertex.label.rangenow acceptNULLto suppress scaling and use the supplied values as-is.Fixed
vertex.rot, which was truncated to an integer and so ignored fractional (radian) rotations; the named"square"shape orientation was corrected as well.edge.line.ltyis now validated to be length 1 or one value per plotted edge, and is subset correctly whensample.edgesdrops edges.
netplot 0.2-0
CRAN release: 2023-09-19
The arguments
skip.vertex,skip.edges, andskip.arrowsnow work as documented.New function
nplot_legend()helps to add legends to the figure.New
nplot()method for matrices.New feature: Gradients.
The argument
sample.edgesnow work as expected.vertex.color,vertex.size, andvertex.nsidesnow accepts formulas.edge.widthnow accepts formulas.New function:
locate_vertex().