Trait PlotItem

Source
pub trait PlotItem {
Show 14 methods // Required methods fn shapes( &self, ui: &Ui, transform: &PlotTransform, shapes: &mut Vec<Shape>, ); fn initialize(&mut self, x_range: RangeInclusive<f64>); fn color(&self) -> Color32; fn geometry(&self) -> PlotGeometry<'_>; fn bounds(&self) -> PlotBounds; fn base(&self) -> &PlotItemBase; fn base_mut(&mut self) -> &mut PlotItemBase; // Provided methods fn name(&self) -> &str { ... } fn highlight(&mut self) { ... } fn highlighted(&self) -> bool { ... } fn allow_hover(&self) -> bool { ... } fn id(&self) -> Id { ... } fn find_closest( &self, point: Pos2, transform: &PlotTransform, ) -> Option<ClosestElem> { ... } fn on_hover( &self, elem: ClosestElem, shapes: &mut Vec<Shape>, cursors: &mut Vec<Cursor>, plot: &PlotConfig<'_>, label_formatter: &LabelFormatter<'_>, ) { ... }
}
Expand description

Trait shared by things that can be drawn in the plot.

Required Methods§

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 color(&self) -> Color32

Source

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

Source

fn bounds(&self) -> PlotBounds

Source

fn base(&self) -> &PlotItemBase

Source

fn base_mut(&mut self) -> &mut PlotItemBase

Provided Methods§

Source

fn name(&self) -> &str

Source

fn highlight(&mut self)

Source

fn highlighted(&self) -> bool

Source

fn allow_hover(&self) -> bool

Can the user hover this item?

Source

fn id(&self) -> 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<'_>, )

Implementors§