Struct Node

Source
pub struct Node<'a> { /* private fields */ }
Expand description

The nodes of the Sankey plot.

Implementations§

Source§

impl<'a> Node<'a>

Source

pub fn label(&mut self, label: &'a [f64]) -> &mut Self

The shown name of the node.

default: []

Source

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: []

Source

pub fn x(&mut self, x: &'a [f64]) -> &mut Self

The normalized horizontal position of the node.

default: []

Source

pub fn y(&mut self, y: &'a [f64]) -> &mut Self

The normalized vertical position of the node.

default: []

Source

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.

Source

pub fn line(&mut self) -> &mut Line<'a>

Source

pub fn pad(&mut self, pad: f64) -> &mut Self

Sets the padding (in px) between the nodes.

default: 20

Source

pub fn thickness(&mut self, thickness: f64) -> &mut Self

Sets the thickness (in px) of the nodes.

default: 20

Source

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

Source

pub fn hoverlabel(&mut self) -> &mut Hoverlabel<'a>

Source

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 “{fullData.name}”. To hide the secondary box completely, use an empty tag <extra></extra>.

default: ``

Trait Implementations§

Source§

impl<'a> Default for Node<'a>

Source§

fn default() -> Node<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> Serialize for Node<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Node<'a>

§

impl<'a> RefUnwindSafe for Node<'a>

§

impl<'a> Send for Node<'a>

§

impl<'a> Sync for Node<'a>

§

impl<'a> Unpin for Node<'a>

§

impl<'a> UnwindSafe for Node<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.