Struct Arrows

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

A set of arrows.

Implementations§

Source§

impl<'a> Arrows<'a>

Source

pub fn new( origins: impl Into<PlotPoints<'a>>, tips: impl Into<PlotPoints<'a>>, ) -> Self

Source

pub fn highlight(self, highlight: bool) -> Self

Highlight these arrows in the plot.

Source

pub fn allow_hover(self, hovering: bool) -> Self

Allowed hovering this item in the plot. Default: true.

Source

pub fn tip_length(self, tip_length: f32) -> Self

Set the length of the arrow tips

Source

pub fn color(self, color: impl Into<Color32>) -> Self

Set the arrows’ color.

Source

pub fn name(self, name: impl ToString) -> Self

Name of this set of arrows.

This name will show up in the plot legend, if legends are turned on.

Multiple plot items may share the same name, in which case they will also share an entry in the legend.

Source

pub fn id(self, id: Id) -> Self

Set the arrows’ id which is used to identify them in the plot’s response.

Trait Implementations§

Source§

impl<'a> PlotItem for Arrows<'a>

Source§

fn shapes(&self, _ui: &Ui, transform: &PlotTransform, shapes: &mut Vec<Shape>)

Source§

fn initialize(&mut self, _x_range: RangeInclusive<f64>)

For plot-items which are generated based on x values (plotting functions).
Source§

fn name(&self) -> &str

Source§

fn color(&self) -> Color32

Source§

fn highlight(&mut self)

Source§

fn highlighted(&self) -> bool

Source§

fn allow_hover(&self) -> bool

Can the user hover this item?
Source§

fn geometry(&self) -> PlotGeometry<'_>

Source§

fn bounds(&self) -> PlotBounds

Source§

fn id(&self) -> Option<Id>

Source§

fn find_closest( &self, point: Pos2, transform: &PlotTransform, ) -> Option<ClosestElem>

Source§

fn on_hover( &self, elem: ClosestElem, shapes: &mut Vec<Shape>, cursors: &mut Vec<Cursor>, plot: &PlotConfig<'_>, label_formatter: &LabelFormatter<'_>, )

Auto Trait Implementations§

§

impl<'a> Freeze for Arrows<'a>

§

impl<'a> !RefUnwindSafe for Arrows<'a>

§

impl<'a> !Send for Arrows<'a>

§

impl<'a> !Sync for Arrows<'a>

§

impl<'a> Unpin for Arrows<'a>

§

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