1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
//! # Vidi
//!
//! A high-performance data visualization library for Rust, powered by [Bevy](https://bevyengine.org/).
//!
//! 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
//!
//! ```rust,no_run
//! 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:
//!
//! ```rust,no_run
//! 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:
//!
//! ```rust,ignore
//! 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
use fmt;
/// Error type for Vidi operations.
;
/// Result type alias using error-stack for rich error context.
pub type Result<T> = Result;
use *;
/// Prelude module - import everything you need with `use vidi::prelude::*;`
///
/// This includes:
/// - All core data types (Plot, Graph2D, Graph3D, Color, Style, etc.)
/// - Dashboard builder API (dash, DashBuilder, Plot2DBuilder, etc.)
/// - Render components (PlotId, etc.)
/// - Runtime functions (run_dashboard)
/// - Web dashboard types (WebConfig, WebDashboard) on native