pub struct Node<'a> { /* private fields */ }
Expand description
The nodes of the Sankey plot.
Implementations§
Source§impl<'a> Node<'a>
impl<'a> Node<'a>
Sourcepub fn groups(&mut self, groups: &'a InfoArray) -> &mut Self
pub fn groups(&mut self, groups: &'a InfoArray) -> &mut Self
Groups of nodes. Each group is defined by an array with the indices of the nodes it contains. Multiple groups can be specified.
default: []
Sourcepub fn x(&mut self, x: &'a [f64]) -> &mut Self
pub fn x(&mut self, x: &'a [f64]) -> &mut Self
The normalized horizontal position of the node.
default: []
Sourcepub fn y(&mut self, y: &'a [f64]) -> &mut Self
pub fn y(&mut self, y: &'a [f64]) -> &mut Self
The normalized vertical position of the node.
default: []
Sourcepub fn color(&mut self, color: &'a str) -> &mut Self
pub fn color(&mut self, color: &'a str) -> &mut Self
Sets the node
color. It can be a single value, or an array for specifying color for each node
. If node.color
is omitted, then the default Plotly
color palette will be cycled through to have a variety of colors. These defaults are not fully opaque, to allow some visibility of what is beneath the node.
pub fn line(&mut self) -> &mut Line<'a>
Sourcepub fn pad(&mut self, pad: f64) -> &mut Self
pub fn pad(&mut self, pad: f64) -> &mut Self
Sets the padding (in px) between the nodes
.
default: 20
Sourcepub fn thickness(&mut self, thickness: f64) -> &mut Self
pub fn thickness(&mut self, thickness: f64) -> &mut Self
Sets the thickness (in px) of the nodes
.
default: 20
Sourcepub fn hoverinfo(&mut self, hoverinfo: Hoverinfo) -> &mut Self
pub fn hoverinfo(&mut self, hoverinfo: Hoverinfo) -> &mut Self
Determines which trace information appear when hovering nodes. If none
or skip
are set, no information is displayed upon hovering. But, if none
is set, click and hover events are still fired.
default: all
pub fn hoverlabel(&mut self) -> &mut Hoverlabel<'a>
Sourcepub fn hovertemplate(&mut self, hovertemplate: &'a str) -> &mut Self
pub fn hovertemplate(&mut self, hovertemplate: &'a str) -> &mut Self
Template string used for rendering the information that appear on hover box. Note that this will override hoverinfo
. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time-format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format for details on the date formatting syntax. The variables available in hovertemplate
are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are arrayOk: true
) are available. variables value
and label
. Anything contained in tag <extra>
is displayed in the secondary box, for example “<extra></extra>
.
default: ``