Vista
A utility library for displaying and formatting arrays, matrices and tensors in the terminal.
Overview
Vista provides flexible, readable formatting options for ndarray arrays in Rust. Whether you're working with 1D vectors, 2D matrices, or higher-dimensional tensors, Vista makes it easy to display your array data clearly in the terminal.
Features
- 📊 Support for arrays of all dimensions (1D, 2D, 3D, 4D, and higher)
- 🎨 Multiple display formats to choose from
- 🧰 Simple, ergonomic API
- ⚡ Zero dependencies beyond ndarray itself
- 📝 Comprehensive documentation and examples
Installation
Add Vista to your Cargo.toml:
[]
= "0.1.0"
= "0.16.1"
Quick Start
use arr2;
use ;
Display Methods
Vista provides four display methods out of the box:
Separated
Displays elements with space separation and aligned columns:
1.0 2.0 3.0
4.0 5.0 6.0
CommaSeparated
Displays elements with comma separation and aligned columns:
1.0, 2.0, 3.0
4.0, 5.0, 6.0
Joined
Displays elements without separators:
1.02.03.0
4.05.06.0
DoubleJoined
Displays each element twice with no separators:
1.01.02.02.03.03.0
4.04.05.05.06.06.0
Note: This is useful for displaying image data.
Examples
1D Array (Vector)
use arr1;
use ;
let vector = arr1;
println!;
// Output: 1.0 2.0 3.0 4.0
2D Array (Matrix)
use arr2;
use ;
let matrix = arr2;
println!;
// Output:
// 1.0, 2.0
// 3.0, 4.0
3D Array (Tensor)
use arr3;
use ;
let tensor = arr3;
println!;
// Output:
// 1.0 2.0
// 3.0 4.0
//
// 5.0 6.0
// 7.0 8.0