ChartSource
Shared chart input for a complete model or a live tail projection.
Public functions
ChartSource
| Returns | Function |
|---|---|
| Methods | |
R | with_all_series<R>(f: impl FnOnce(&[SeriesView<'_, T>]) -> R) |
Option<R> | with_series_view<R>(series: SeriesId, f: impl FnOnce(SeriesView<'_, T>) -> R) |
Option<R> | with_series<R>(series: SeriesId, f: impl FnOnce(&str, Option<&ColorProp>, bool) -> R) |
set_series_visible(series: SeriesId, visible: bool) | |
Vec<SeriesId> | series_ids() |
usize | series_count() |
Option<SeriesId> | series_id_at(index: usize) |
Option<SeriesId> | only_series() |
usize | point_count(series: SeriesId) |
Signal<u64> | structure_version() |
Signal<u64> | style_version() |
ObserverHandle | observe_changes(f: impl Fn(&ChartChange) + 'static) |
API reference
📖 Full rustdoc API for this module
pub enum ChartSource
Import: use teksilo::data::ChartSource;
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.
#![allow(unused)] fn main() { pub enum ChartSource<T: 'static> { /* variants */ } }
Variants
Model(ChartModel<T>)— All points in the model.Window(ChartWindow<T>)— The last configured number of points in each series.
Methods
pub fn with_all_series<R>(&self, f: impl FnOnce(&[SeriesView<'_, T>]) -> R) -> R
Read the visible series and borrowed point slices.
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.
pub fn with_series<R>( &self, series: SeriesId, f: impl FnOnce(&str, Option<&ColorProp>, bool) -> R, ) -> Option<R>
Read series metadata from the source.
pub fn set_series_visible(&self, series: SeriesId, visible: bool)
Change source visibility, for interactive legends.
pub fn series_ids(&self) -> Vec<SeriesId>
Ordered series identifiers.
pub fn series_count(&self) -> usize
Number of series, including hidden series.
pub fn series_id_at(&self, index: usize) -> Option<SeriesId>
Series at the given display position.
pub fn only_series(&self) -> Option<SeriesId>
Sole series, when the source has exactly one.
pub fn point_count(&self, series: SeriesId) -> usize
Number of visible points in a series.
pub fn structure_version(&self) -> Signal<u64>
Reactive version for geometry and accessible data.
pub fn style_version(&self) -> Signal<u64>
Reactive version for colors and patterns.
pub fn observe_changes(&self, f: impl Fn(&ChartChange) + 'static) -> ObserverHandle
Observe changes using indices relative to this input.