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§
fn shapes(&self, ui: &Ui, transform: &PlotTransform, shapes: &mut Vec<Shape>)
Sourcefn initialize(&mut self, x_range: RangeInclusive<f64>)
fn initialize(&mut self, x_range: RangeInclusive<f64>)
For plot-items which are generated based on x values (plotting functions).
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
Sourcefn allow_hover(&self) -> bool
fn allow_hover(&self) -> bool
Can the user hover this item?