| Crates.io | vidi-charts |
| lib.rs | vidi-charts |
| version | 0.1.2 |
| created_at | 2026-01-21 04:26:45.88094+00 |
| updated_at | 2026-01-21 04:36:44.465687+00 |
| description | High-performance data visualization library for Rust, powered by Bevy |
| homepage | https://github.com/alexlatif/vidi |
| repository | https://github.com/alexlatif/vidi |
| max_upload_size | |
| id | 2058297 |
| size | 469,482 |
A high-performance data visualization library for Rust, powered by Bevy.
Vidi provides a declarative API for creating interactive 2D/3D plots and dashboards that run natively or in the browser via WebAssembly.
Add to your Cargo.toml:
[dependencies]
vidi-charts = "0.1"
Note: The crate is published as vidi-charts on crates.io (the name vidi was taken).
Create a simple dashboard:
use vidi::prelude::*;
use glam::Vec2;
fn main() {
dash()
.add_2d(|p| {
let data: Vec<Vec2> = (0..100)
.map(|i| {
let x = i as f32 * 0.1;
Vec2::new(x, x.sin())
})
.collect();
p.line(data, None)
.x_label("Time")
.y_label("Amplitude")
.title("Sine Wave")
})
.run_local();
}
Run with:
cargo run --example simple
dash()
.add_2d(|p| {
p.scatter(points, Style::default().color(Color::RED))
.line(regression_line, Style::default().color(Color::BLUE))
})
.run_local();
dash()
.add_3d(|p| {
let (xyz, nx, ny) = generate_surface();
p.surface(xyz, nx, ny, None)
.title("3D Surface")
})
.run_local();
dash()
.add_distribution(|d| {
d.histogram(samples)
.bins(30)
.style(Style::default().color(Color::GREEN))
})
.run_local();
dash()
.add_tab("Overview", |tab| {
tab.add_2d(|p| p.line(data1, None))
.add_2d(|p| p.scatter(data2, None))
})
.add_tab("Details", |tab| {
tab.add_distribution(|d| d.histogram(samples))
.add_heatmap(|h| h.from_2d(matrix))
})
.run_local();
Vidi includes a server component for hosting dashboards in the browser:
// Post dashboard to server and open in browser
let handle = dash()
.add_2d(|p| p.line(data, None))
.run_web("http://localhost:8080", WebConfig::default())?;
// Stream updates in real-time
handle.append_points_2d(plot_id, layer_idx, &new_points)?;
# Build and run the server
cargo run -p vidi-server
# Or with Docker
docker build -t vidi-server .
docker run -p 8080:8080 vidi-server
dash()
.background_color(Color::BLACK) // Set background
.columns(2) // Force 2-column layout
.add_2d(|p| { ... }) // Add 2D plot
.add_3d(|p| { ... }) // Add 3D plot
.add_distribution(|d| { ... }) // Add histogram/PDF/boxplot
.add_candlestick(|c| { ... }) // Add OHLC chart
.add_heatmap(|h| { ... }) // Add heatmap
.add_radial(|r| { ... }) // Add pie/radar chart
.add_tab("Name", |t| { ... }) // Add tabbed section
.run_local() // Run native window
plot.line(points, style) // Line chart
.scatter(points, style) // Scatter plot
.area(points, style) // Area chart
.bars(points, style) // Bar chart
.bubble(points, sizes, style) // Bubble chart
.fill_between(upper, lower, style) // Confidence bands
.x_label("X Axis")
.y_label("Y Axis")
.title("Plot Title")
plot.points(xyz, style) // 3D scatter
.surface(xyz, nx, ny, style) // 3D surface mesh
.x_label("X").y_label("Y").z_label("Z")
dist.histogram(values).bins(30) // Histogram
.pdf(values) // Probability density
.boxplot(groups) // Box plot
.ecdf(values) // Empirical CDF
Style {
color: Color::rgb(1.0, 0.0, 0.0), // RGB color
size: 2.0, // Line width / point size
opacity: 0.8, // Transparency
}
| Action | 2D Plots | 3D Plots |
|---|---|---|
| Pan | Click + Drag | - |
| Zoom | Scroll wheel | Scroll wheel |
| Rotate | - | Click + Drag |
| Reset | Double-click | Double-click |
Vidi is built on the Bevy game engine, which provides:
MIT OR Apache-2.0
Contributions welcome! Please open an issue or PR on GitHub.