Skip to main content

ChartSource

Enum ChartSource 

Source
pub enum ChartSource<T: 'static> {
    Model(ChartModel<T>),
    Window(ChartWindow<T>),
}
Expand description

A reactive chart input. Conversions retain shared handles and copy no points.

Window point indices (including hover and selection indices) are local to the visible tail. A window bounds the displayed data, not source storage.

Variants§

§

Model(ChartModel<T>)

All points in the model.

§

Window(ChartWindow<T>)

The last configured number of points in each series.

Implementations§

Source§

impl<T: 'static> ChartSource<T>

Source

pub fn with_all_series<R>(&self, f: impl FnOnce(&[SeriesView<'_, T>]) -> R) -> R

Read the visible series and borrowed point slices.

Source

pub fn with_series_view<R>( &self, series: SeriesId, f: impl FnOnce(SeriesView<'_, T>) -> R, ) -> Option<R>

Read one visible series, using window-local point indices.

Source

pub fn with_series<R>( &self, series: SeriesId, f: impl FnOnce(&str, Option<&ColorProp>, bool) -> R, ) -> Option<R>

Read series metadata from the source.

Source

pub fn set_series_visible(&self, series: SeriesId, visible: bool)

Change source visibility, for interactive legends.

Source

pub fn series_ids(&self) -> Vec<SeriesId>

Ordered series identifiers.

Source

pub fn series_count(&self) -> usize

Number of series, including hidden series.

Source

pub fn series_id_at(&self, index: usize) -> Option<SeriesId>

Series at the given display position.

Source

pub fn only_series(&self) -> Option<SeriesId>

Sole series, when the source has exactly one.

Source

pub fn point_count(&self, series: SeriesId) -> usize

Number of visible points in a series.

Source

pub fn structure_version(&self) -> Signal<u64>

Reactive version for geometry and accessible data.

Source

pub fn style_version(&self) -> Signal<u64>

Reactive version for colors and patterns.

Source

pub fn observe_changes( &self, f: impl Fn(&ChartChange) + 'static, ) -> ObserverHandle

Observe changes using indices relative to this input.

Trait Implementations§

Source§

impl<T: 'static> Clone for ChartSource<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug + 'static> Debug for ChartSource<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: 'static> From<ChartModel<T>> for ChartSource<T>

Source§

fn from(model: ChartModel<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: 'static> From<ChartWindow<T>> for ChartSource<T>

Source§

fn from(window: ChartWindow<T>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for ChartSource<T>

§

impl<T> !Send for ChartSource<T>

§

impl<T> !Sync for ChartSource<T>

§

impl<T> !UnwindSafe for ChartSource<T>

§

impl<T> Freeze for ChartSource<T>

§

impl<T> Unpin for ChartSource<T>

§

impl<T> UnsafeUnpin for ChartSource<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.