pub struct PrimitiveView<'a> {
pub series: SeriesId,
pub study: Option<&'a dyn Indicator>,
pub mapping: ChartMapping,
pub bars: &'a [Bar],
pub visible: Range<usize>,
}Expand description
The pane and scale a primitive draws on in the current frame.
Fields§
§series: SeriesIdThe series the primitive is attached to.
study: Option<&'a dyn Indicator>The study the primitive is attached to, whose values a custom series renderer draws.
None for a bar series.
mapping: ChartMappingBar index to x on the time axis the panes share, and price to y on the series’ price
scale. mapping.rect is the plot area of the pane.
bars: &'a [Bar]The bars laid out on the time axis, oldest first: the main series, or the elements of a
price-based chart type. Bar i is centred at index_to_x(i as f64).
visible: Range<usize>The indices of bars in view.
Implementations§
Source§impl PrimitiveView<'_>
impl PrimitiveView<'_>
Sourcepub fn point_groups(&self, factor: usize) -> impl Iterator<Item = Range<usize>>
pub fn point_groups(&self, factor: usize) -> impl Iterator<Item = Range<usize>>
Aligned source ranges for a custom renderer’s merge hook. Groups start at multiples
of factor, include the visible range’s edge groups and never exceed bars.
A factor of zero is treated as one. Merge values in source order so open/close and
extrema keep their meaning; host payload aggregation belongs to the renderer.
Sourcepub fn index_to_x(&self, index: f64) -> f32
pub fn index_to_x(&self, index: f64) -> f32
The x of a fractional bar index, the centre of bar index when it is whole.
Trait Implementations§
Source§impl<'a> Clone for PrimitiveView<'a>
impl<'a> Clone for PrimitiveView<'a>
Source§fn clone(&self) -> PrimitiveView<'a>
fn clone(&self) -> PrimitiveView<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'a> !RefUnwindSafe for PrimitiveView<'a>
impl<'a> !Send for PrimitiveView<'a>
impl<'a> !Sync for PrimitiveView<'a>
impl<'a> !UnwindSafe for PrimitiveView<'a>
impl<'a> Freeze for PrimitiveView<'a>
impl<'a> Unpin for PrimitiveView<'a>
impl<'a> UnsafeUnpin for PrimitiveView<'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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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