[][src]Trait rt_graph::DataSource

pub trait DataSource: Debug + Send {
    fn get_data(&mut self) -> Result<Vec<Point>>;
fn get_num_values(&self) -> Result<usize>; fn get_colors(&self) -> Result<Vec<Color>> { ... } }

Implement this to get your own data into a Graph.

Required methods

fn get_data(&mut self) -> Result<Vec<Point>>

Return whatever points you have available when this method is called.

Each point must have a t field greater than the previous point.

Each point must have a vs field with length equal to the value returned by get_num_values.

This is currently called once a frame.

fn get_num_values(&self) -> Result<usize>

The number of values that each Point will have.

Loading content...

Provided methods

fn get_colors(&self) -> Result<Vec<Color>>

Return the colors you want to use to display each value of the graph.

Some sample colors are returned by default.

If you don't supply enough colors for the number of values returned, these colors will be repeated.

Loading content...

Implementors

impl DataSource for NullDataSource[src]

impl DataSource for TestDataGenerator[src]

Loading content...