pub struct PlotView<'a> { /* private fields */ }Expand description
Stateless view that renders a Plot into an egui Ui.
Implementations§
Source§impl<'a> PlotView<'a>
impl<'a> PlotView<'a>
Append custom entries to the plot’s built-in right-click context menu,
after the Zoom Back / Reset Zoom items. See Self::menu_ext for why
this hook (and not a second Response::context_menu) is the way to add
custom menu entries.
Sourcepub fn show(self, ui: &mut Ui, plot: &mut Plot) -> PlotResponse
pub fn show(self, ui: &mut Ui, plot: &mut Plot) -> PlotResponse
Render the plot with the default zoom interaction mode, filling the available space. Returns the egui response and the display transform used this frame.
Sourcepub fn zoom_back(&self, plot: &mut Plot) -> bool
pub fn zoom_back(&self, plot: &mut Plot) -> bool
Restore the previously stored view from the limits history, mirroring
silx ZoomBackAction (getLimitsHistory().pop()). Returns true if a
stored view was restored, false if the history was empty. The toolbar
zoom-back button (a later wave) calls through this.
Sourcepub fn show_with_interaction(
self,
ui: &mut Ui,
plot: &mut Plot,
interaction_mode: PlotInteractionMode,
) -> PlotResponse
pub fn show_with_interaction( self, ui: &mut Ui, plot: &mut Plot, interaction_mode: PlotInteractionMode, ) -> PlotResponse
Render the plot with an explicit primary-pointer interaction mode.
Sourcepub fn show_with_draw(
self,
ui: &mut Ui,
plot: &mut Plot,
draw: &mut DrawState,
style: SelectionStyle,
) -> DrawResponse
pub fn show_with_draw( self, ui: &mut Ui, plot: &mut Plot, draw: &mut DrawState, style: SelectionStyle, ) -> DrawResponse
Render the plot in a draw/select mode driven by draw, painting the
in-progress shape as a rubber-band overlay and returning any
DrawEvent produced this frame.
The plot is shown in PlotInteractionMode::Select so a primary drag
feeds the draw state machine instead of box-zooming (secondary drag still
pans, wheel still zooms). Press / move / release on the data area are fed
to draw (silx Select* onPress / onMove / onRelease); the
resulting preview/finished shape is drawn with style
(silx setSelectionArea, PlotInteraction.py:98-141).
Wiring a Finished event to ROI / mask creation is left to the caller
(silx high-level widgets / mask tools).
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PlotView<'a>
impl<'a> !Send for PlotView<'a>
impl<'a> !Sync for PlotView<'a>
impl<'a> !UnwindSafe for PlotView<'a>
impl<'a> Freeze for PlotView<'a>
impl<'a> Unpin for PlotView<'a>
impl<'a> UnsafeUnpin for PlotView<'a>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.