A small charting/visualization tool and partial vega implementation for Rust

Overview

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 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 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 make a pull request. 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/

You might also like...
A rust drawing library for high quality data plotting for both WASM and native, statically and realtimely 🦀 📈🚀
A rust drawing library for high quality data plotting for both WASM and native, statically and realtimely 🦀 📈🚀

Plotters - A Rust drawing library focus on data plotting for both WASM and native applications 🦀 📈 🚀 Plotters is drawing library designed for rende

Swash is a pure Rust, cross-platform crate that provides font introspection, complex text shaping and glyph rendering.

Swash is a pure Rust, cross-platform crate that provides font introspection, complex text shaping and glyph rendering. Goals This crate aims to

 KDash - A fast and simple dashboard for Kubernetes
KDash - A fast and simple dashboard for Kubernetes

KDash - A fast and simple dashboard for Kubernetes

🌱 Easy to use, blazing-fast, and reliable Chia plot manager for your farm

🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧 UNDER DEVELOPME

Data plotting library for Rust
Data plotting library for Rust

plotlib plotlib is a generic data visualisation and plotting library for Rust. It is currently in the very early stages of development. It can current

Plotly for Rust

Plotly.rs Plotly for Rust Getting Started | Recipes | API Docs | Changelog | | | A plotting library for Rust powered by Plotly.js. Usage Add this to y

A Rust library for drawing plots, powered by Gnuplot.
A Rust library for drawing plots, powered by Gnuplot.

RustGnuplot A Gnuplot controller written in Rust. Documentation See here Examples A simple example: let mut fg = Figure::new(); fg.axes2d() .set_titl

Render farm simulator & plotting for optimisation written in Rust.
Render farm simulator & plotting for optimisation written in Rust.

Farm Usage Simulator Given a few basic charasteristics of a render farm and render jobs this app runs a few randomized farm usage scenarios and plots

Rust crate for creating beautiful interactive Chord Diagrams
Rust crate for creating beautiful interactive Chord Diagrams

Chord PRO Released Chord PRO is the full-featured chord visualization API, producing beautiful interactive visualizations, e.g. those featured on the

Comments
  • Unable to render_graph

    Unable to render_graph

    I tried to use gust with the following code:

    extern crate gust;
    
    use gust::backend::bar_chart::BarChart;
    use gust::frontend::write::render_graph;
    use gust::backend::general::FileType;
    
    fn main() {
        println!("Hello, world!");
    
        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();
    }
    

    But it seems to panic at this line:

    https://github.com/saresend/Gust/blob/38586147c0836795c69e5e8adc174149641cba91/src/frontend/html_render.rs#L16

    opened by dashed 2
  • Doesn't compile

    Doesn't compile

    I get several of these errors when I try to compile:

    error[E0046]: not all trait items implemented, missing: `set_color`, `set_dimensions`, `get_dimensions`, `set_description`, `set_identifier`
       --> src/backend/stacked_bar_chart.rs:109:1
        |
    109 | impl Graphable for StackedBarChart {
        | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `set_color`, `set_dimensions`, `get_dimensions`, `set_description`, `set_identifier` in implementation
        | 
       ::: src/backend/traits.rs:16:5
        |
    16  |     fn set_color(&mut self, &str);
        |     ------------------------------ `set_color` from trait
    17  |     // set_dimensions
    18  |     fn set_dimensions(&mut self, (i32, i32));
        |     ----------------------------------------- `set_dimensions` from trait
    19  | 
    20  |     fn get_dimensions(&self) -> (i32, i32);
        |     --------------------------------------- `get_dimensions` from trait
    21  | 
    22  |     fn set_description(&mut self, &str);
        |     ------------------------------------ `set_description` from trait
    23  | 
    24  |     fn set_identifier(&mut self, &str);
        |     ----------------------------------- `set_identifier` from trait
    
    opened by Ploppz 0
Owner
Samuel Resendez
Stoke levels too damn high
Samuel Resendez
A color-coded visualization tool for the instructions of an anchor program

anchor-viz A color-coded visualization tool for the instructions of an anchor program. (This is a schematic of basic-2 from anchor's examples/tutorial

cavemanloverboy 5 Oct 15, 2022
📝 Web-based, reactive Datalog notebooks for data analysis and visualization

?? Web-based, reactive Datalog notebooks for data analysis and visualization

Eric Zhang 486 Dec 28, 2022
A pure Rust visualization library inspired by D3.js

charts A pure Rust visualization library inspired by D3.js. See gallery and examples for code and more charts. Install You can add this as a dependenc

Iulian Gulea 186 Dec 29, 2022
🔵🟠 Portal Explorer — web visualization of mind-blowing portals using ray-tracing.

In Portal Explorer you can view how interesting portals are constructed, and visually explore their properties by moving and rotating them. This program doesn't work well on mobile, better opened from PC.

ilya sheprut 99 Dec 7, 2022
A better visualization of clang's -ftime-trace output

crofiler: Easier C++ build profiling Understanding why C++ builds get slow has become a lot easier since clang introduced their -ftime-trace build tra

Hadrien G. 7 Nov 15, 2022
This is an implementation of an Iced backend for Plotters, for both native and wasm applications.

plotters-iced This is an implementation of an Iced backend for Plotters, for both native and wasm applications. This backend has been optimized as for

joylei 54 Dec 14, 2022
below is an interactive tool to view and record historical system data.

A time traveling resource monitor for modern Linux systems

Facebook Incubator 824 Dec 31, 2022
This is a Rust implementation of a boid flocking simulation using the ggez graphics crate.

Boidflock This is a Rust implementation of a boid flocking simulation using the ggez graphics crate. The CLI for this program is built using the struc

Andrew Lee 12 Jan 4, 2023
binocle is a graphical tool to visualize binary data

a graphical tool to visualize binary data

David Peter 773 Dec 30, 2022