Skip to contents

The seam between convenient input and a complete, validated object. Every argument is optional, which is what lets the published schema require nothing.

Usage

setup_NetworkConfig(
  directed = FALSE,
  threshold = NULL,
  self_loops = FALSE,
  layout = "force",
  cluster_resolution = 1,
  scale_by_degree = TRUE,
  color_by_group = FALSE,
  blend_edges = FALSE,
  show_labels = TRUE,
  node_size = 10,
  edge_scale = 3,
  node_opacity = 0.95,
  edge_opacity = 0.4,
  palette = NULL,
  node_color = rtemis_colors[["teal"]],
  positive_color = rtemis_colors[["teal"]],
  negative_color = "#ff9e1f",
  title = NULL,
  dat_path = NULL,
  origin = NULL,
  writer = NULL
)

Arguments

directed

Logical: Treat the matrix as directed.

threshold

Optional Numeric: Drop edges weaker than this.

self_loops

Logical: Keep self-edges.

layout

Character: Layout algorithm.

cluster_resolution

Numeric [0, Inf): Community-detection resolution. Higher values find more, smaller communities.

scale_by_degree

Logical: Size nodes by their degree.

color_by_group

Logical: Color nodes by detected community.

blend_edges

Logical: Blend overlapping edges.

show_labels

Logical: Draw node labels.

node_size

Numeric [0, Inf): Base node size.

edge_scale

Numeric [0, Inf): Edge width multiplier.

node_opacity, edge_opacity

Numeric [0, 1]: Opacity of each.

palette

Optional Character: Community colors, overriding the theme palette. NULL uses the theme's.

node_color

Character: Node color when not colored by group.

positive_color, negative_color

Character: Edge colors by sign.

title

Optional Character: Chart title. Declared here because it is the one property every chart type has; palette is not (four take a colormap instead), and axis labels and margins are cartesian-only.

dat_path

Optional Character: Path to the data, read at draw time. The serializable alternative to passing data to draw().

origin

Optional Named character: Where each value came from. Normally computed from which arguments were supplied; pass it only when restoring a config that already carries provenance.

writer

Optional Named character: Which interface wrote the config.

Value

NetworkConfig object.

Author

EDG

Examples

m <- matrix(
  c(0, 1, 1, 1, 0, 1, 1, 1, 0),
  nrow = 3,
  dimnames = list(letters[1:3], letters[1:3])
)
draw(setup_NetworkConfig(), data = m)