tui-bar-graph 0.3.1

A Ratatui widget for rendering pretty bar graphs in the terminal
Documentation

Tui-bar-graph

A Ratatui widget to render bold, colorful bar graphs. Part of the tui-widgets suite by Joshka.

Braille Rainbow Solid Plasma Quadrant Magma Octant Viridis

Braille Magma Braille Viridis Solid Inferno Solid Sinebow Quadrant Plasma Quadrant Sinebow Octant Inferno Octant Rainbow

Uses the Colorgrad crate for gradient coloring.

Crate badge Docs Badge Deps Badge License Badge Coverage Badge Discord Badge

GitHub Repository · API Docs · Examples · Changelog · Contributing

Installation

cargo add ratatui tui-bar-graph

Usage

Build a BarGraph with your data and render it in a widget area.

use tui_bar_graph::{BarGraph, BarStyle, ColorMode};

let data = vec![0.0, 0.1, 0.2, 0.3, 0.4, 0.5];
let bar_graph = BarGraph::new(data)
    .with_gradient(colorgrad::preset::turbo())
    .with_bar_style(BarStyle::Braille)
    .with_color_mode(ColorMode::VerticalGradient);
frame.render_widget(bar_graph, area);

More widgets

For the full suite of widgets, see tui-widgets.

License

Copyright (c) Josh McKinney

This project is licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

See CONTRIBUTING.md.