#[non_exhaustive]pub struct Tooltip<X: Tick, Y: Tick> {
pub placement: RwSignal<TooltipPlacement>,
pub sort_by: RwSignal<TooltipSortBy>,
pub cursor_distance: RwSignal<f64>,
pub skip_missing: RwSignal<bool>,
pub show_x_ticks: RwSignal<bool>,
pub x_ticks: TickLabels<X>,
pub y_ticks: TickLabels<Y>,
}Expand description
Builds a mouse tooltip that shows X and Y values for the nearest data. Drawn in HTML as an overlay.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.placement: RwSignal<TooltipPlacement>Where the tooltip is placed when shown.
sort_by: RwSignal<TooltipSortBy>How the tooltip Y value table is sorted.
cursor_distance: RwSignal<f64>Gap distance from cursor to tooltip when shown.
skip_missing: RwSignal<bool>If true, skips Y values that are f64::NAN.
show_x_ticks: RwSignal<bool>Whether to show X ticks. Default is true.
x_ticks: TickLabels<X>X axis formatter.
y_ticks: TickLabels<Y>Y axis formatter.
Implementations§
Source§impl<X: Tick, Y: Tick> Tooltip<X, Y>
impl<X: Tick, Y: Tick> Tooltip<X, Y>
Sourcepub fn new(
placement: impl Into<TooltipPlacement>,
x_ticks: impl Into<TickLabels<X>>,
y_ticks: impl Into<TickLabels<Y>>,
) -> Self
pub fn new( placement: impl Into<TooltipPlacement>, x_ticks: impl Into<TickLabels<X>>, y_ticks: impl Into<TickLabels<Y>>, ) -> Self
Creates a new tooltip with the given placement, X ticks, and Y ticks.
Sourcepub fn from_placement(placement: impl Into<TooltipPlacement>) -> Self
pub fn from_placement(placement: impl Into<TooltipPlacement>) -> Self
Creates a new tooltip with the given placement. Uses default X and Y ticks.
Sourcepub fn left_cursor() -> Self
pub fn left_cursor() -> Self
Creates a new tooltip left of the cursor. Uses default X and Y ticks.
Sourcepub fn with_sort_by(self, sort_by: impl Into<TooltipSortBy>) -> Self
pub fn with_sort_by(self, sort_by: impl Into<TooltipSortBy>) -> Self
Sets the sort order of the Y value table.
Sourcepub fn with_cursor_distance(self, distance: impl Into<f64>) -> Self
pub fn with_cursor_distance(self, distance: impl Into<f64>) -> Self
Sets the gap distance from cursor to tooltip when shown.
Sourcepub fn skip_missing(self, skip_missing: impl Into<bool>) -> Self
pub fn skip_missing(self, skip_missing: impl Into<bool>) -> Self
Sets whether the tooltip should skip Y values that are f64::NAN.
Sourcepub fn show_x_ticks(self, show_x_ticks: impl Into<bool>) -> Self
pub fn show_x_ticks(self, show_x_ticks: impl Into<bool>) -> Self
Sets whether to show X ticks.
Trait Implementations§
impl<X: Tick, Y: Tick> StructuralPartialEq for Tooltip<X, Y>
Auto Trait Implementations§
impl<X, Y> Freeze for Tooltip<X, Y>
impl<X, Y> RefUnwindSafe for Tooltip<X, Y>
impl<X, Y> Send for Tooltip<X, Y>
impl<X, Y> Sync for Tooltip<X, Y>
impl<X, Y> Unpin for Tooltip<X, Y>
impl<X, Y> UnwindSafe for Tooltip<X, Y>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
Marker: ?Sized,
impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
Marker: ?Sized,
fn into_element_maybe_signal(self) -> ElementMaybeSignal<T>
Source§impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
fn into_element_maybe_signal_type(self) -> ElementMaybeSignalType<T>
Source§impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
Marker: ?Sized,
impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
Marker: ?Sized,
fn into_elements_maybe_signal(self) -> ElementsMaybeSignal<T>
Source§impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
fn into_elements_maybe_signal_type(self) -> ElementsMaybeSignalType<T>
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.