Create a new graph with the given data source
(data: &'a dyn DataSource)
| 53 | impl<'a> Graph<'a> { |
| 54 | /// Create a new graph with the given data source |
| 55 | pub fn new(data: &'a dyn DataSource) -> Self { |
| 56 | Self { |
| 57 | data, |
| 58 | x_range: (0.0, 1.0), |
| 59 | y_range: (-1.0, 1.0), |
| 60 | style: Style::default().fg(Color::Cyan), |
| 61 | render_mode: RenderMode::Braille, |
| 62 | wave_char: '█', |
| 63 | show_zero_line: true, |
| 64 | zero_line_style: Style::default().fg(Color::DarkGray), |
| 65 | gradient: None, |
| 66 | gradient_mode: GradientMode::default(), |
| 67 | invert_y: false, |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | /// Set the horizontal range (x-axis) |
| 72 | pub fn x_range(mut self, start: f32, end: f32) -> Self { |
nothing calls this directly
no outgoing calls
no test coverage detected