A charting library for rust!
Disclaimer This is still very much a work in progress! APIs are very unstable and subject to change. Contributions and suggestions are welcomed and greatly appreciated!
Gust is a small charting crate to make it really easy to build simple interactive data visualizations in rust. It also serves as a partial Vega implementation that will (hopefully) become more complete over time.
Gust allows you to render the actual visualizations themselves using D3.js, (meaning they're interactive!) as well as providing the flexibility to directly render the underlying JSON specification for Vega.
Currently, Gust supports only 3 charts so far:
- Bar Charts
- Stacked Bar Charts
- Line Charts
More will be coming soon! If you're interested in contributing your own, just make a pull request. Cheers!
gust = "0.1.4"
use backend::bar_chart::BarChart;
use frontend::write::render_graph;
let mut b = BarChart::new();
let v = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"];
for i in 0..10 {
b.add_data(v[i].to_string(), (i * i * i) as i32);
}
render_graph(&b, FileType::HTML).unwrap();
use backend::stacked_bar_chart::StackedBarChart;
let mut b = StackedBarChart::new();
for i in 0..10 {
b.add_data(i, i * i, 1);
b.add_data(i, i + i, 0);
}
render_graph(&b, FileType::HTML).unwrap();
https://docs.rs/gust/0.1.4/gust/
The rendering is all handled by Vega: https://vega.github.io/