Crate vidi_charts

Crate vidi_charts 

Source
Expand description

§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
  • 3D Visualization: 3D scatter plots and surface plots with orbit controls
  • Statistical Plots: Histograms, PDFs, 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
  • Real-time Updates: Stream data via WebSocket

§Quick Start

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")
        })
        .run_local();
}

§Dashboard Builder

Use the [dash()] function to start building a dashboard:

use vidi::prelude::*;

dash()
    .add_2d(|p| p.scatter(vec![], None))     // 2D plot
    .add_3d(|p| p.points(vec![], None))      // 3D plot
    .add_distribution(|d| d.histogram(vec![])) // Statistical
    .add_heatmap(|h| h.data(10, 10, vec![0.0; 100])) // Heatmap
    .run_local();

§Web Dashboard

Post dashboards to a vidi-server for browser viewing:

let handle = dash()
    .add_2d(|p| p.line(data, None))
    .run_web("http://localhost:8080", WebConfig::default())?;

// Stream updates
handle.append_points_2d(plot_id, 0, &new_points)?;

§Modules

  • core: Data model definitions (Plot, Graph2D, Graph3D, etc.)
  • dash: Builder API for constructing dashboards
  • render: Bevy ECS rendering implementation
  • runtime: Application bootstrap and run loop

Modules§

core
dash
prelude
Prelude module - import everything you need with use vidi::prelude::*;
render
runtime

Structs§

VidiError
Error type for Vidi operations.

Type Aliases§

Result
Result type alias using error-stack for rich error context.