Trait PlotMarks
pub trait PlotMarks: 'static {
type Hover: Clone + PartialEq;
type Activated: Clone;
const NAME: &'static str;
const LABEL: &'static str;
Show 21 methods
// Required methods
fn frame(&self) -> &PlotFrame<Self::Hover>;
fn frame_mut(&mut self) -> &mut PlotFrame<Self::Hover>;
fn hit(&self, point: Point) -> Option<Self::Hover>;
fn keyboard_items(&self) -> Vec<Self::Hover>;
fn anchor(&self, item: &Self::Hover) -> Option<Point>;
fn activation(&self, item: &Self::Hover) -> Option<Self::Activated>;
fn items(&self) -> Vec<PlotItem<Self::Activated>>;
fn paint(
&mut self,
scene: &mut Scene,
transform: Affine,
tr: &mut TextRenderer,
theme: &Theme,
);
// Provided methods
fn label(&self) -> &'static str { ... }
fn series(&self) -> Vec<(&str, &str)> { ... }
fn legend_interactive(&self) -> bool { ... }
fn toggles(&self) -> Option<&SeriesToggles> { ... }
fn toggles_mut(&mut self) -> Option<&mut SeriesToggles> { ... }
fn series_of(&self, _item: &Self::Hover) -> Option<&str> { ... }
fn is_animating(&self) -> bool { ... }
fn layout_height(&self) -> Option<f32> { ... }
fn natural_height(
&self,
_tr: &mut TextRenderer,
_theme: &Theme,
_width: f64,
) -> f64 { ... }
fn event(&mut self, _event: &WindowEvent, _ctx: &mut EventCtx<'_>) -> bool { ... }
fn wants_pointer_capture(&self) -> bool { ... }
fn visible_changed(&mut self) { ... }
fn follow_keyboard_anchor(&mut self) { ... }
}Expand description
What a chart kind supplies to Plot.
Required Associated Constants§
Required Associated Types§
type Activated: Clone
type Activated: Clone
What activating a mark reports through Plot::take_activated.
Required Methods§
fn frame(&self) -> &PlotFrame<Self::Hover>
fn frame_mut(&mut self) -> &mut PlotFrame<Self::Hover>
fn keyboard_items(&self) -> Vec<Self::Hover>
fn keyboard_items(&self) -> Vec<Self::Hover>
The marks the keyboard steps through, in order.
fn anchor(&self, item: &Self::Hover) -> Option<Point>
fn anchor(&self, item: &Self::Hover) -> Option<Point>
Where inspecting item puts the pointer; None leaves it.
fn activation(&self, item: &Self::Hover) -> Option<Self::Activated>
fn activation(&self, item: &Self::Hover) -> Option<Self::Activated>
What activating item reports; None when it is not activatable.
fn paint(
&mut self,
scene: &mut Scene,
transform: Affine,
tr: &mut TextRenderer,
theme: &Theme,
)
fn paint( &mut self, scene: &mut Scene, transform: Affine, tr: &mut TextRenderer, theme: &Theme, )
Paints the marks. Call Self::follow_keyboard_anchor once the
geometry is current and before painting the inspector.
Provided Methods§
fn legend_interactive(&self) -> bool
fn legend_interactive(&self) -> bool
Whether clicking a legend entry shows or hides its series.
fn toggles(&self) -> Option<&SeriesToggles>
fn toggles_mut(&mut self) -> Option<&mut SeriesToggles>
fn is_animating(&self) -> bool
fn layout_height(&self) -> Option<f32>
fn layout_height(&self) -> Option<f32>
The height the chart lays out at; None fills the parent.
fn natural_height(
&self,
_tr: &mut TextRenderer,
_theme: &Theme,
_width: f64,
) -> f64
fn natural_height( &self, _tr: &mut TextRenderer, _theme: &Theme, _width: f64, ) -> f64
The height a filling chart wants at width when the parent leaves
it open.
fn event(&mut self, _event: &WindowEvent, _ctx: &mut EventCtx<'_>) -> bool
fn event(&mut self, _event: &WindowEvent, _ctx: &mut EventCtx<'_>) -> bool
Takes the events the shell’s own inspection cannot drive — zoom, pan, brush, focus loss — before the shell inspects. Whether the event was consumed.
fn wants_pointer_capture(&self) -> bool
fn wants_pointer_capture(&self) -> bool
Whether a gesture is in flight and must keep receiving the pointer.
fn visible_changed(&mut self)
fn visible_changed(&mut self)
A series was shown or hidden: marks that cache their domain or their geometry drop it.
fn follow_keyboard_anchor(&mut self)
fn follow_keyboard_anchor(&mut self)
Keeps the pointer on a mark the keyboard chose while the geometry changes under it, so its inspector shows there.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.