pub struct Plot<'a> { /* private fields */ }Expand description
A plot widget.
Implementations§
Source§impl<'a> Plot<'a>
impl<'a> Plot<'a>
Sourcepub fn new(id: impl Into<String>, series: &'a [Series]) -> Self
pub fn new(id: impl Into<String>, series: &'a [Series]) -> Self
A plot named id (in the collector and egui’s memory) showing
series.
Sourcepub fn decimation(self, threshold: Option<usize>) -> Self
pub fn decimation(self, threshold: Option<usize>) -> Self
Decimates the lines, stepped lines and bands with more than
threshold points in view: each pixel column draws at most four
of its points (the first, the lowest, the highest and the last),
which cover the same pixels as all of them. None draws every
point. Default: DECIMATION_THRESHOLD.
A series sorted by x (a time series) is read in the x range in
view only, found by binary search: a pass costs the points in
view, whatever the series’ length. A series that is not sorted is
drawn whole, as egui_plot draws it. The point under the pointer
(PlotOutput::hovered) and the values at the pointer are read
in the full series, never in the points drawn.
Sourcepub fn height(self, height: f32) -> Self
pub fn height(self, height: f32) -> Self
Its height (default: what is available, or egui_plot’s aspect).
Sourcepub fn time_cursor(self, time: Option<f64>) -> Self
pub fn time_cursor(self, time: Option<f64>) -> Self
A vertical line at time (an x value), the time a timeline
shows; None, none. The application passes it every pass.
Sourcepub fn drag_cursor(self, on: bool) -> Self
pub fn drag_cursor(self, on: bool) -> Self
The time cursor follows the pointer when dragged; where it went is
PlotOutput::cursor_dragged (default: off; on with a timeline).
Sourcepub fn time_scale(self, scale: TimeScale) -> Self
pub fn time_scale(self, scale: TimeScale) -> Self
The x axis in a timeline’s scale: x values are seconds, the ticks
and labels the timeline ruler’s (1:05, 00:00:02:10, 17.2).
Sourcepub fn timeline(self, state: &'a mut TimelineState) -> Self
pub fn timeline(self, state: &'a mut TimelineState) -> Self
Follows a timeline: its scale on the x axis, its playhead as the time cursor, its range highlighted; dragging the cursor moves the playhead (on the scale’s units, inside its bounds). Draw the timeline in the same pass, before or after: each shows what the other did.
Sourcepub fn highlight_range(self, range: Option<TimeRange>) -> Self
pub fn highlight_range(self, range: Option<TimeRange>) -> Self
A span of x highlighted under the series (a timeline’s range); a
timeline given by Plot::timeline gives its own.
Sourcepub fn values_tooltip(self, on: bool) -> Self
pub fn values_tooltip(self, on: bool) -> Self
While the pointer is over the plot, a tooltip lists every line’s value at its x, marked on the lines (default: on with a time scale or a timeline).
Sourcepub fn emphasize(self, series: Option<usize>) -> Self
pub fn emphasize(self, series: Option<usize>) -> Self
Draws one series thicker, the one an application has selected or hovered elsewhere.
Sourcepub fn link_x(self, group: impl Into<String>) -> Self
pub fn link_x(self, group: impl Into<String>) -> Self
Zooms and pans the x axis together with the other plots of
group (egui_plot’s linked axes).
Sourcepub fn link_cursor(self, group: impl Into<String>) -> Self
pub fn link_cursor(self, group: impl Into<String>) -> Self
Shows the pointer’s x as a line in the other plots of group
(egui_plot’s linked cursors).
Sourcepub fn interactive(self, on: bool) -> Self
pub fn interactive(self, on: bool) -> Self
Takes the zoom, the pan and the box zoom (default: on).
Sourcepub fn bar_width(self, width: f64) -> Self
pub fn bar_width(self, width: f64) -> Self
The width a bar takes of the space between two x values, shared by the bar series side by side (default: 0.8).
Sourcepub fn color_of(palette: &DataPalette, series: &Series, index: usize) -> Color32
pub fn color_of(palette: &DataPalette, series: &Series, index: usize) -> Color32
The colour series index is drawn in.
pub fn show(self, ui: &mut Ui) -> PlotOutput
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Plot<'a>
impl<'a> RefUnwindSafe for Plot<'a>
impl<'a> Send for Plot<'a>
impl<'a> Sync for Plot<'a>
impl<'a> Unpin for Plot<'a>
impl<'a> UnsafeUnpin for Plot<'a>
impl<'a> !UnwindSafe for Plot<'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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 more