| Crates.io | bml_grapher |
| lib.rs | bml_grapher |
| version | 0.1.5 |
| created_at | 2025-03-14 22:58:13.782559+00 |
| updated_at | 2025-08-08 01:24:43.2314+00 |
| description | A library for graphing functions, plots, and other things probably. It's a wrapper over minifb for drawing functions with similar syntax to canvas in JS. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1592836 |
| size | 219,378 |
(Note to self: Run "cargo publish" to update this) To get started, first add a SnorfWindow. The following code will display a 480x540 black window, with a red line drawn at the bottom.
let mut window = SnorfWindow::new("Grapher", 480,540, None);
let mut ctx = window.get_context();
while window.is_open() {
ctx.clear_rect(0x000000);
for i in 10..200 {
ctx.draw_pixel(i, 10, 0xff0800);
}
window.update(&ctx).unwrap();
}
A good example of how to use this crate is in the simulated_annealing example, it displays a function and runs a hill climbing algorithm on it indicated by squares.
cargo run --example simulated_annealing