#html #charts #bar #vega #partial #graph #stacked

gust

A small charting library for generating d3 and html charts using Rust

5 releases

Uses old Rust 2015

0.1.4 Dec 24, 2017
0.1.3 Dec 22, 2017
0.1.2 Dec 20, 2017
0.1.1 Dec 18, 2017
0.1.0 Dec 13, 2017

#190 in Visualization

Download history 8/week @ 2024-02-26 2/week @ 2024-03-11 77/week @ 2024-04-01

79 downloads per month

Unlicense/MIT

120KB
1K SLoC

Gust

A charting library for rust!

Build Status Crates.io

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!


What is Gust

Gust is small a 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 Implementations

Currently, Gust supports only 3 charts so far:

  1. Bar Charts
  2. Stacked Bar Charts
  3. Line Charts

More will be coming soon! If you're interested in contributing your own, just read the contributions page. Cheers!

Why did you do this in rust?

Installation

gust = "0.1.4"

Samples and Sample Usage

    use backend::bar_chart::BarChart;
    use frontend::write::render_graph;

Sample Bar Chart

     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();

Result: gust_build/html/bar_chart.html

bar chart

Stacked Bar Chart example

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();

Result: gust_build/html/stacked_bar_chart.html

stacked bar chart

Additional Docs

https://docs.rs/gust/0.1.4/gust/

Special Mentions

The rendering is all handled by Vega: https://vega.github.io/

Dependencies

~7–10MB
~216K SLoC