Render a step-package Sankey diagram
Usage
make_sankey(
nodes,
links,
colours,
font_size = 14,
link_alpha = 0.35,
value_scaled_alpha = FALSE,
alpha_range = c(0.2, 0.8),
node_width = 30,
split_newlines = TRUE,
center_labels = TRUE,
place_labels_above = FALSE,
label_y_offset = -6
)
Arguments
- nodes
Data frame describing Sankey nodes as produced by
make_nodes()
.- links
Data frame describing connections between nodes, typically the output of
make_links()
.- colours
JavaScript colour scale generated by
make_colours()
.- font_size
Node label font size in pixels.
- link_alpha
Default opacity applied to all links when
value_scaled_alpha
isFALSE
.- value_scaled_alpha
Should link opacity be scaled according to its value?
- alpha_range
Numeric range to use when scaling link opacity by value.
- node_width
Width of each node rectangle in pixels. Use
NULL
to keep the networkD3 default.- split_newlines
Should newline characters in labels be converted into stacked
<tspan>
elements for readability?- center_labels
Should text labels be horizontally centred on each node?
- place_labels_above
When
TRUE
, nudges labels above the node rectangle.- label_y_offset
Vertical offset (in pixels) used when moving labels above the node.
Value
An htmlwidgets object produced by
networkD3::sankeyNetwork()
.