pub struct MinMaxPyramid { /* private fields */ }Available on crate feature
data only.Expand description
A min/max pyramid over a paged source. Levels are built on first use and blocks are cached, so a plot asks only for the tiles its viewport needs.
§Example
use crisol_core::data::MinMaxPyramid;Implementations§
Source§impl MinMaxPyramid
impl MinMaxPyramid
Sourcepub fn new(
source: Arc<dyn DataSource>,
x_column: usize,
y_column: usize,
block: usize,
) -> Self
pub fn new( source: Arc<dyn DataSource>, x_column: usize, y_column: usize, block: usize, ) -> Self
A pyramid over two columns of source, with block rows per tile.
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Invalidate every tile after the source changed.
Sourcepub fn tile(
&self,
level: usize,
index: usize,
) -> Result<Option<LodTile>, DataError>
pub fn tile( &self, level: usize, index: usize, ) -> Result<Option<LodTile>, DataError>
The tile at level and index, building the level when needed.
§Errors
When a source page cannot be read.
Sourcepub fn polyline(
&self,
range: Range<usize>,
budget: usize,
) -> Result<Vec<[f64; 2]>, DataError>
pub fn polyline( &self, range: Range<usize>, budget: usize, ) -> Result<Vec<[f64; 2]>, DataError>
Sourcepub fn tiles_in_x(
&self,
x_min: f64,
x_max: f64,
budget: usize,
) -> Result<Vec<LodTile>, DataError>
pub fn tiles_in_x( &self, x_min: f64, x_max: f64, budget: usize, ) -> Result<Vec<LodTile>, DataError>
Tiles whose x span intersects [x_min, x_max], at the finest level that fits
budget tiles. This is the zoom-driven lookup a streaming plot uses: the row
range is not known, only the visible data range.
§Errors
When a source page cannot be read.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MinMaxPyramid
impl !RefUnwindSafe for MinMaxPyramid
impl !Send for MinMaxPyramid
impl !Sync for MinMaxPyramid
impl !UnwindSafe for MinMaxPyramid
impl Forget for MinMaxPyramid
impl Move for MinMaxPyramid
impl Unpin for MinMaxPyramid
impl UnsafeUnpin for MinMaxPyramidwhere
*const ArcInner<dyn DataSource> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn DataSource>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Option<Vec<LodTile>>>: UnsafeUnpin,
PhantomData<((usize, usize), LodTile)>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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