pub enum DecimateMode {
Auto,
Off,
Explicit(usize, DecimateMethod),
}Expand description
How decimation is resolved for a series at render time.
This drives the index-selection logic in the draw path:
DecimateMode::Auto(the default) — decimate with LTTB toDEFAULT_DECIMATE_THRESHOLDpoints only when the series is larger than that threshold; otherwise every point is drawn. This gives large series a fast, faithful render with zero configuration while leaving small series untouched.DecimateMode::Off— never decimate; always draw every point. Use this when exact point-for-point rendering is required.DecimateMode::Explicit— decimate to the given point count using the given method whenever the series exceeds that count. Set via the.decimate(n)/.decimate_with(n, method)builder methods.
Variants§
Auto
Auto-decimate large series to DEFAULT_DECIMATE_THRESHOLD via LTTB.
Off
Disable decimation entirely; draw every point.
Explicit(usize, DecimateMethod)
Decimate to usize points using the chosen DecimateMethod.
Implementations§
Source§impl DecimateMode
impl DecimateMode
Sourcepub fn resolve_indices(self, x: &[f64], y: &[f64]) -> Vec<usize>
pub fn resolve_indices(self, x: &[f64], y: &[f64]) -> Vec<usize>
Resolves the set of point indices to draw for a series of length n,
given x/y data, according to this mode.
The returned indices always include the first and last (finite) points
when decimation is applied. When no decimation is needed, the full
0..n range is returned. This function is pure and deterministic: the
same inputs always yield the same indices.
Trait Implementations§
Source§impl Clone for DecimateMode
impl Clone for DecimateMode
Source§fn clone(&self) -> DecimateMode
fn clone(&self) -> DecimateMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DecimateMode
Source§impl Debug for DecimateMode
impl Debug for DecimateMode
Source§impl Default for DecimateMode
impl Default for DecimateMode
Source§fn default() -> DecimateMode
fn default() -> DecimateMode
Returns the “default value” for a type. Read more
Source§impl PartialEq for DecimateMode
impl PartialEq for DecimateMode
Source§fn eq(&self, other: &DecimateMode) -> bool
fn eq(&self, other: &DecimateMode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DecimateMode
Auto Trait Implementations§
impl Freeze for DecimateMode
impl RefUnwindSafe for DecimateMode
impl Send for DecimateMode
impl Sync for DecimateMode
impl Unpin for DecimateMode
impl UnsafeUnpin for DecimateMode
impl UnwindSafe for DecimateMode
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
Mutably borrows from an owned value. Read more