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>
impl<T: 'static> ChartSource<T>
Sourcepub fn with_all_series<R>(&self, f: impl FnOnce(&[SeriesView<'_, T>]) -> R) -> R
pub fn with_all_series<R>(&self, f: impl FnOnce(&[SeriesView<'_, T>]) -> R) -> R
Read the visible series and borrowed point slices.
Sourcepub fn with_series_view<R>(
&self,
series: SeriesId,
f: impl FnOnce(SeriesView<'_, T>) -> R,
) -> Option<R>
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.
Sourcepub fn with_series<R>(
&self,
series: SeriesId,
f: impl FnOnce(&str, Option<&ColorProp>, bool) -> R,
) -> Option<R>
pub fn with_series<R>( &self, series: SeriesId, f: impl FnOnce(&str, Option<&ColorProp>, bool) -> R, ) -> Option<R>
Read series metadata from the source.
Sourcepub fn set_series_visible(&self, series: SeriesId, visible: bool)
pub fn set_series_visible(&self, series: SeriesId, visible: bool)
Change source visibility, for interactive legends.
Sourcepub fn series_ids(&self) -> Vec<SeriesId>
pub fn series_ids(&self) -> Vec<SeriesId>
Ordered series identifiers.
Sourcepub fn series_count(&self) -> usize
pub fn series_count(&self) -> usize
Number of series, including hidden series.
Sourcepub fn series_id_at(&self, index: usize) -> Option<SeriesId>
pub fn series_id_at(&self, index: usize) -> Option<SeriesId>
Series at the given display position.
Sourcepub fn only_series(&self) -> Option<SeriesId>
pub fn only_series(&self) -> Option<SeriesId>
Sole series, when the source has exactly one.
Sourcepub fn point_count(&self, series: SeriesId) -> usize
pub fn point_count(&self, series: SeriesId) -> usize
Number of visible points in a series.
Sourcepub fn structure_version(&self) -> Signal<u64>
pub fn structure_version(&self) -> Signal<u64>
Reactive version for geometry and accessible data.
Sourcepub fn style_version(&self) -> Signal<u64>
pub fn style_version(&self) -> Signal<u64>
Reactive version for colors and patterns.
Sourcepub fn observe_changes(
&self,
f: impl Fn(&ChartChange) + 'static,
) -> ObserverHandle
pub fn observe_changes( &self, f: impl Fn(&ChartChange) + 'static, ) -> ObserverHandle
Observe changes using indices relative to this input.