Struct Link

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

The links of the Sankey plot.

Implementations§

Source§

impl<'a> Link<'a>

Source

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

The shown name of the link.

default: []

Source

pub fn color(&mut self, color: &'a str) -> &mut Self

Sets the link color. It can be a single value, or an array for specifying color for each link. If link.color is omitted, then by default, a translucent grey link will be used.

Source

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

Source

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

An integer number [0..nodes.length - 1] that represents the source node.

default: []

Source

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

An integer number [0..nodes.length - 1] that represents the target node.

default: []

Source

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

A numeric value representing the flow volume value.

default: []

Source

pub fn hoverinfo(&mut self, hoverinfo: Hoverinfo) -> &mut Self

Determines which trace information appear when hovering links. 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 Link<'a>

Source§

fn default() -> Link<'a>

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

impl<'a> Serialize for Link<'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 Link<'a>

§

impl<'a> RefUnwindSafe for Link<'a>

§

impl<'a> Send for Link<'a>

§

impl<'a> Sync for Link<'a>

§

impl<'a> Unpin for Link<'a>

§

impl<'a> UnwindSafe for Link<'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.