Skip to contents

A serializable description of a Sankey diagram. Build one with setup_SankeyConfig() rather than calling this constructor directly.

Usage

SankeyConfig(
  dat_path = NULL,
  title = NULL,
  origin = NULL,
  writer = NULL,
  source = "source",
  target = "target",
  value = "value",
  orient = "horizontal",
  node_align = NULL,
  node_width = NULL,
  node_gap = NULL,
  palette = NULL
)

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.

source

Character: Column naming each link's source node.

target

Character: Column naming each link's target node.

value

Character: Column holding each link's magnitude.

orient

Character {"horizontal", "vertical"}: Layout direction.

node_align

Optional Character {"left", "right", "justify"}: How nodes are aligned along the flow.

node_width

Optional Numeric [0, Inf): Node thickness in pixels.

node_gap

Optional Numeric [0, Inf): Gap between nodes in pixels.

palette

Optional Character: Node colors, overriding the theme palette for this chart. NULL uses the theme's.

Value

SankeyConfig object.

Details

The bound data is a table of links, one row per flow. source, target and value name its columns.

Author

EDG

Examples

#> [1] "sankey"