pub struct PlotHover { /* private fields */ }Expand description
The datum a plot has in focus this frame, handed to Plot::hover.
Carries the TooltipState the cursor resolved to and how far the hover has
faded in. After the cursor leaves, the state lingers here while the focus
eases back to zero, so a hover-driven presentation can fade out over the
last datum instead of vanishing.
Implementations§
Source§impl PlotHover
impl PlotHover
Sourcepub fn state(&self) -> &TooltipState
pub fn state(&self) -> &TooltipState
The datum in focus: the one under the cursor, or the last one while the hover fades out.
Sourcepub fn focus(&self) -> f32
pub fn focus(&self) -> f32
How far the hover has faded in, from 0 to 1.
Rises over the styled layer’s fast duration when the cursor lands on a
datum and falls back after it leaves, during which Self::is_hovered
is false.
Sourcepub fn is_hovered(&self) -> bool
pub fn is_hovered(&self) -> bool
Whether the cursor is on the datum, as opposed to the state lingering while its hover fades out.
Sourcepub fn is_entering(&self) -> bool
pub fn is_entering(&self) -> bool
Whether this is the first frame the cursor is on a datum: the hover has not started fading in yet. A position that follows the hovered datum adopts it here instead of travelling from where the last hover ended.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlotHover
impl RefUnwindSafe for PlotHover
impl Send for PlotHover
impl Sync for PlotHover
impl Unpin for PlotHover
impl UnsafeUnpin for PlotHover
impl UnwindSafe for PlotHover
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more