Skip to contents

Configuration for a Sankey diagram series. Nodes and directed links are represented as two separate lists. Node names in data must match the source and target strings in links.

Usage

SankeySeries(
  name = NULL,
  data = NULL,
  links = NULL,
  levels = NULL,
  orient = NULL,
  node_width = NULL,
  node_gap = NULL,
  node_align = NULL,
  draggable = NULL,
  layout_iterations = NULL,
  sort = NULL,
  roam = NULL,
  label = NULL,
  edge_label = NULL,
  line_style = NULL,
  item_style = NULL,
  color = NULL,
  left = NULL,
  right = NULL,
  top = NULL,
  bottom = NULL,
  silent = NULL,
  z_level = NULL,
  z = NULL
)

Arguments

name

Optional Character: Series name for legend and tooltip.

data

Optional list: Nodes as a list of SankeyNodeItem objects or plain named lists, each with at least a name field.

Optional list: Edges as a list of SankeyEdgeItem objects or plain named lists with source, target, and value fields.

levels

Optional list: List of SankeyLevelOption for per-depth styling.

orient

Optional Character {"horizontal", "vertical"}: Flow direction.

node_width

Optional Numeric [0, Inf): Width of each node rectangle in pixels.

node_gap

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

node_align

Optional Character {"justify", "left", "right"}: Node alignment within columns.

draggable

Optional Logical: Whether nodes can be dragged interactively.

layout_iterations

Optional Numeric [0, Inf): Number of layout iterations.

sort

Optional Character {"desc"} or NULL: Column-internal node ordering. NULL preserves the original data order.

roam

Optional Logical or Character {"move", "scale"}: Whether to enable pan/zoom.

label

Optional LabelOption: Node label configuration.

edge_label

Optional LabelOption: Edge label configuration.

line_style

Optional LineStyle or list: Default link line styling. Accepts a LineStyle object or a plain list; a plain list also allows the Sankey-specific curveness field (e.g. list(curveness = 0.5)).

item_style

Optional ItemStyle: Default node styling.

color

Optional Character: Color palette for nodes as a character vector.

left

Optional Numeric or Character: Series left offset.

right

Optional Numeric or Character: Series right offset.

top

Optional Numeric or Character: Series top offset.

bottom

Optional Numeric or Character: Series bottom offset.

silent

Optional Logical: Whether to disable mouse/touch events.

z_level

Optional Numeric: Canvas layer index.

z

Optional Numeric: Front-back order within the same canvas layer.

Value

SankeySeries object.

Details

Corresponds to SankeySeriesOption in src/chart/sankey/SankeySeries.ts (line 100). ECharts docs: https://echarts.apache.org/en/option.html#series-sankey

Examples

SankeySeries(
  data = list(SankeyNodeItem(name = "A"), SankeyNodeItem(name = "B")),
  links = list(SankeyEdgeItem(source = "A", target = "B", value = 5))
)
#> <rtemis.draw::SankeySeries>
#>  @ name             : NULL
#>  @ data             :List of 2
#>  .. $ : <rtemis.draw::SankeyNodeItem>
#>  ..  ..@ name                : chr "A"
#>  ..  ..@ value               : NULL
#>  ..  ..@ depth               : NULL
#>  ..  ..@ draggable           : NULL
#>  ..  ..@ local_x             : NULL
#>  ..  ..@ local_y             : NULL
#>  ..  ..@ label               : NULL
#>  ..  ..@ item_style          : NULL
#>  ..  ..@ focus_node_adjacency: NULL
#>  .. $ : <rtemis.draw::SankeyNodeItem>
#>  ..  ..@ name                : chr "B"
#>  ..  ..@ value               : NULL
#>  ..  ..@ depth               : NULL
#>  ..  ..@ draggable           : NULL
#>  ..  ..@ local_x             : NULL
#>  ..  ..@ local_y             : NULL
#>  ..  ..@ label               : NULL
#>  ..  ..@ item_style          : NULL
#>  ..  ..@ focus_node_adjacency: NULL
#>  @ links            :List of 1
#>  .. $ : <rtemis.draw::SankeyEdgeItem>
#>  ..  ..@ source              : chr "A"
#>  ..  ..@ target              : chr "B"
#>  ..  ..@ value               : num 5
#>  ..  ..@ line_style          : NULL
#>  ..  ..@ edge_label          : NULL
#>  ..  ..@ focus_node_adjacency: NULL
#>  @ levels           : NULL
#>  @ orient           : NULL
#>  @ node_width       : NULL
#>  @ node_gap         : NULL
#>  @ node_align       : NULL
#>  @ draggable        : NULL
#>  @ layout_iterations: NULL
#>  @ sort             : NULL
#>  @ roam             : NULL
#>  @ label            : NULL
#>  @ edge_label       : NULL
#>  @ line_style       : NULL
#>  @ item_style       : NULL
#>  @ color            : NULL
#>  @ left             : NULL
#>  @ right            : NULL
#>  @ top              : NULL
#>  @ bottom           : NULL
#>  @ silent           : NULL
#>  @ z_level          : NULL
#>  @ z                : NULL