Skip to main content

Crate trueno_viz

Crate trueno_viz 

Source
Expand description

§Trueno-Viz

SIMD/GPU/WASM-accelerated visualization library for data science and machine learning.

Built on the trueno core library, trueno-viz provides hardware-accelerated rendering of statistical and scientific visualizations with zero JavaScript/HTML dependencies.

§Features

  • Pure Rust: No JavaScript, HTML, or browser dependencies
  • Hardware Acceleration: Automatic dispatch to SIMD (SSE2/AVX2/AVX512/NEON), GPU, or WASM
  • Grammar of Graphics: Declarative, composable visualization API
  • Multiple Outputs: PNG, SVG, and terminal (ASCII/Unicode) rendering

§Quick Start

use trueno_viz::prelude::*;

// Create a scatter plot
let plot = ScatterPlot::new()
    .x(&[1.0, 2.0, 3.0, 4.0, 5.0])
    .y(&[2.0, 4.0, 1.0, 5.0, 3.0])
    .color(Rgba::BLUE)
    .build();

// Render to PNG
plot.render_to_file("scatter.png")?;

§Feature Flags

  • gpu: Enable GPU compute acceleration
  • parallel: Enable parallel processing with rayon
  • ml: Integration with aprender/entrenar ML libraries
  • graph: Integration with trueno-graph
  • db: Integration with trueno-db
  • terminal: Terminal output support
  • svg: SVG output support
  • full: All features enabled

§Academic References

This library implements algorithms from peer-reviewed research:

  • Wilkinson, L. (2005). The Grammar of Graphics. Springer.
  • Wu, X. (1991). “An Efficient Antialiasing Technique.” SIGGRAPH ’91.
  • Douglas, D. H., & Peucker, T. K. (1973). Line simplification algorithm.
  • Fruchterman, T. M. J., & Reingold, E. M. (1991). Force-directed graph layout.

Re-exports§

pub use error::Error;
pub use error::Result;
pub use trueno;

Modules§

accel
SIMD/GPU acceleration layer. SIMD/GPU acceleration layer.
color
Color types and color space conversions. Color types and color space conversions.
error
Error types for trueno-viz operations. Error types for trueno-viz operations.
framebuffer
Core framebuffer for pixel rendering. Core framebuffer for pixel rendering.
geometry
Geometric primitives (points, lines, rectangles). Geometric primitives for visualization.
grammar
Grammar of Graphics implementation. Grammar of Graphics implementation.
interop
Ecosystem integrations (trueno-db, trueno-graph, aprender). Ecosystem integrations.
monitormonitor
TUI monitoring system (btop-like). TUI Monitoring System for trueno-viz.
output
Output encoders (PNG, SVG, terminal). Output encoders (PNG, SVG, HTML, terminal).
plots
High-level plot types (scatter, heatmap, histogram, etc.). High-level plot types.
prelude
Commonly used types and traits for convenient imports.
prompt
Text prompt interface for declarative visualization DSL. Text prompt interface for declarative visualization.
render
Rendering backends and rasterization. Rendering backends and rasterization.
scale
Scale functions for data-to-visual mappings. Scale functions for data-to-visual mappings.
wasmwasm
WebAssembly bindings for browser usage. WebAssembly bindings for trueno-viz.
widgets
Dashboard widgets for experiment tracking and visualization. Dashboard widgets for experiment tracking and visualization.

Macros§

debug
Convenience macro for debug level.
debug_log
Logs with format arguments.
error
Convenience macro for error level.
info
Convenience macro for info level.
time_scope
Creates a timing guard for a scope.
trace
Convenience macro for trace level.
warn
Convenience macro for warn level.