MCPcopy Create free account
hub / github.com/5ocworkshop/bgraph / new

Method new

src/classes/cls_graph.rs:55–69  ·  view source on GitHub ↗

Create a new graph with the given data source

(data: &'a dyn DataSource)

Source from the content-addressed store, hash-verified

53impl<'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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected