Vidi
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.
Features
- 2D Charts: Line plots, scatter plots, area charts, bar charts, bubble charts, fill-between regions
- 3D Visualization: 3D scatter plots and surface plots with orbit controls
- Statistical Plots: Histograms, PDFs (kernel density estimation), box plots, ECDF
- Financial Charts: Candlestick/OHLC charts
- Heatmaps: 2D heatmaps with multiple colormaps
- Radial Charts: Pie charts and radar/spider charts
- Interactive: Pan, zoom, and rotate controls out of the box
- Multi-plot Dashboards: Grid layouts with tabs
- Real-time Updates: Stream data to dashboards via WebSocket
- Dual Target: Native desktop and WebAssembly (browser)
Quick Start
Add to your Cargo.toml:
[]
= "0.1"
Note: The crate is published as vidi-charts on crates.io (the name vidi was taken).
Create a simple dashboard:
use *;
use Vec2;
Run with:
Examples
Scatter Plot with Regression Line
dash
.add_2d
.run_local;
3D Surface Plot
dash
.add_3d
.run_local;
Histogram
dash
.add_distribution
.run_local;
Multi-Plot Dashboard with Tabs
dash
.add_tab
.add_tab
.run_local;
Web Dashboard (Server Mode)
Vidi includes a server component for hosting dashboards in the browser:
// Post dashboard to server and open in browser
let handle = dash
.add_2d
.run_web?;
// Stream updates in real-time
handle.append_points_2d?;
Running the Server
# Build and run the server
# Or with Docker
API Overview
Dashboard Builder
dash
.background_color // Set background
.columns // Force 2-column layout
.add_2d // Add 2D plot
.add_3d // Add 3D plot
.add_distribution // Add histogram/PDF/boxplot
.add_candlestick // Add OHLC chart
.add_heatmap // Add heatmap
.add_radial // Add pie/radar chart
.add_tab // Add tabbed section
.run_local // Run native window
2D Plot Builder
plot.line // Line chart
.scatter // Scatter plot
.area // Area chart
.bars // Bar chart
.bubble // Bubble chart
.fill_between // Confidence bands
.x_label
.y_label
.title
3D Plot Builder
plot.points // 3D scatter
.surface // 3D surface mesh
.x_label.y_label.z_label
Distribution Builder
dist.histogram.bins // Histogram
.pdf // Probability density
.boxplot // Box plot
.ecdf // Empirical CDF
Style
Style
Controls
| Action | 2D Plots | 3D Plots |
|---|---|---|
| Pan | Click + Drag | - |
| Zoom | Scroll wheel | Scroll wheel |
| Rotate | - | Click + Drag |
| Reset | Double-click | Double-click |
Architecture
Vidi is built on the Bevy game engine, which provides:
- GPU-accelerated rendering via wgpu
- Cross-platform support (Windows, macOS, Linux, Web)
- Entity Component System (ECS) for efficient updates
- Hot-reloading and developer ergonomics
Requirements
- Rust 1.85+ (edition 2024)
- For native: GPU with Vulkan/Metal/DX12 support
- For web: Modern browser with WebGL2/WebGPU
License
MIT OR Apache-2.0
Contributing
Contributions welcome! Please open an issue or PR on GitHub.