pub struct PlotHover { /* private fields */ }Expand description
The datum a plot has under the pointer 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
progress 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 hovered datum: the one under the cursor, or the last one while the hover fades out.
Sourcepub fn progress(&self) -> f32
pub fn progress(&self) -> f32
How far the hover has faded in, from 0 to 1.
Rises over the active PlotMotion’s enter when the
cursor lands on a datum and falls back over its exit after it leaves,
during which Self::is_hovered is false.
pub fn focus(&self) -> f32
use progress
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.
Sourcepub fn glide(
&self,
id: impl Into<TransitionId>,
target: Pixels,
window: &mut Window,
cx: &mut App,
) -> Pixels
pub fn glide( &self, id: impl Into<TransitionId>, target: Pixels, window: &mut Window, cx: &mut App, ) -> Pixels
Follow target on the pointer spring, adopting the
target on the entering frame instead of travelling from where the last
hover ended.
For a position a plot paints with, such as the center of a highlighted band or the crosshair a styled tooltip draws.
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