Skip to contents

By default ("auto") code nodes are drawn only when an edge network is drawn, matching rENA, where nodes are part of ena.plot.network(): the <qe-nodes> element is emitted only then. Node positions always come from the model and set the plot extent, so the scale does not change.

Usage

qe_nodes(
  p,
  show = c("auto", "always", "never"),
  unconnected = c("dot", "hide"),
  positions = NULL,
  labels = NULL,
  sizes = NULL,
  fixed_size = FALSE
)

Arguments

p

A qe_plot object.

show

"auto" (default), "always", or "never". TRUE / FALSE are accepted as "always" / "never".

unconnected

What to draw for nodes with no drawn edges: "dot" (default, a tiny dot that still marks the code's position) or "hide" (omit the node and its label).

positions

Node positions for this plot, replacing the model's (as rENA's ena.plot.network(node.positions =)): a data frame / matrix / rotation$nodes-like table with a code column (the model's node id column, code, or row names) and two numeric columns (the model's x / y columns when present, else the first two numeric ones). A subset of codes moves only those nodes. Edges, node sizes, labels and the plot extent all follow the new positions.

labels

Display text per code: a named character vector (c(Technical.Constraints = "Tech. constraints")). The code stays the node's identity (events, edges); only the drawn label changes. "" draws no label for that code.

sizes

Node diameters in CSS pixels at zoom 1, per code: a named numeric vector (c(Data = 24)), in place of the size from the node's edge weights. Codes not listed keep the computed size; unconnected nodes stay a tiny dot (or hidden).

fixed_size

Logical. TRUE keeps node diameters at their zoom-1 on-screen size when the plot is zoomed. Default FALSE (nodes grow with the zoom).

Value

The modified qe_plot object.

Details

Each node's diameter equals the summed widths of its drawn edges (for directed / ONA models, only the edges directed at the node, plus its self-connection), so node size is proportional to its accumulated connection weight and comparable across plots of the same model.

Examples

if (FALSE) { # \dontrun{
# Means only, but keep the code nodes for orientation
qe_plot(set) |> qe_group() |> qe_nodes("always")
} # }