Skip to contents

A serializable description of a network graph. Build one with setup_NetworkConfig() rather than calling this constructor directly.

Usage

NetworkConfig(
  dat_path = NULL,
  title = NULL,
  origin = NULL,
  writer = NULL,
  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 = "#6CA3A0",
  positive_color = "#6CA3A0",
  negative_color = "#ff9e1f"
)

Arguments

dat_path

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

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.

origin

Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it.

writer

Optional Named character: Which interface wrote the config, as name and version. Absent on an authored config.

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.

Value

NetworkConfig object.

Details

The bound data is an adjacency matrix, optionally with a node table: draw(config, data = m) or draw(config, data = list(adjacency = m, nodes = df)).

Author

EDG

Examples

setup_NetworkConfig(layout = "force")@type
#> [1] "network"